From: João Matos Date: Tue, 16 Dec 2014 19:26:08 +0000 (-0500) Subject: Merge pull request #1349 from martinjt/MachineKeyProtect X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=5742335f66bc628ad0ce75be7870127da04916df;hp=8302b5782df1f22d6c5dc811ca5fbc2bb11eb3da;p=mono.git Merge pull request #1349 from martinjt/MachineKeyProtect Implement MachineKey.Protect and MachineKey.Unprotect --- diff --git a/.gitignore b/.gitignore index ea48a9e7fb9..55a955ec624 100644 --- a/.gitignore +++ b/.gitignore @@ -69,6 +69,7 @@ config.status config.sub configure configure.scan +cygconfig.h depcomp install-sh libtool diff --git a/.gitmodules b/.gitmodules index 4dbffc0de07..7cf5b99cbe8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,6 +16,7 @@ [submodule "external/rx"] path = external/rx url = git://github.com/mono/rx.git + branch = rx-oss-v2.2 [submodule "external/ikvm"] path = external/ikvm url = git://github.com/mono/ikvm-fork.git @@ -25,3 +26,10 @@ [submodule "external/ikdasm"] path = external/ikdasm url = git://github.com/mono/ikdasm.git +[submodule "external/referencesource"] + path = external/referencesource + url = git://github.com/mono/referencesource + branch = mono +[submodule "external/reference-assemblies"] + path = external/reference-assemblies + url = git://github.com/mono/reference-assemblies.git diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a04886ff4b0..230a4505f08 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ When contributing to the Mono project, please follow the [Mono Coding Guidelines][1]. We have been using a coding style for many years, please make your patches conform to these guidelines. -[1] http://www.mono-project.com/community/contributing/coding-guidelines/ +[1]: http://www.mono-project.com/community/contributing/coding-guidelines/ Etiquette ========= @@ -68,7 +68,7 @@ status of your pull request. If it succeeded and we like the changes, a maintainer will likely merge it. Otherwise, you can amend your pull request to fix build breakage and Jenkins will test it again. -[2] http://jenkins.mono-project.com/ +[2]: http://jenkins.mono-project.com/ # Inactivity diff --git a/Makefile.am b/Makefile.am index c44c4b93c09..eb4d0443e03 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,7 @@ if CROSS_COMPILING SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) # Keep in sync with SUBDIRS ## 'tools' is not normally built -DIST_SUBDIRS = m4 po libgc eglib mono ikvm-native support data runtime scripts man samples tools msvc docs +DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs else if ONLY_MONOTOUCH SUBDIRS = $(MONOTOUCH_SUBDIRS) runtime @@ -19,7 +19,7 @@ else SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) # Keep in sync with SUBDIRS ## 'tools' is not normally built -DIST_SUBDIRS = m4 po libgc eglib mono ikvm-native support data runtime scripts man samples tools msvc docs +DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs endif endif endif @@ -52,7 +52,7 @@ dist-hook: d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive rm -rf `find $(top_distdir)/external -path '*\.git'` rm -f `find $(top_distdir)/external -path '*\.exe'` - rm -f `find $(top_distdir)/external -path '*\.dll'` + rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/reference-assemblies/v4\.0*'` cp mcs/class/lib/basic/System.Configuration.dll mcs/class/lib/monolite/ cp mcs/class/lib/basic/System.Security.dll mcs/class/lib/monolite/ # Disable this for now because it is very slow and causes wrench to timeout: diff --git a/README.md b/README.md index b061956eee2..bb5b98a76c7 100644 --- a/README.md +++ b/README.md @@ -1,161 +1,148 @@ Mono is a software platform designed to allow developers to easily create cross platform applications. -Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. +It is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. -[![Build Status](http://jenkins.mono-project.com/job/test-mono-mainline/badge/icon/)](http://jenkins.mono-project.com/job/test-mono-mainline/) - -1. [Installation](#compilation-and-installation) +1. [Compilation and Installation](#compilation-and-installation) 2. [Using Mono](#using-mono) 3. [Directory Roadmap](#directory-roadmap) -4. [Contributing to Mono] (#contributing-to-mono) -5. [Git submodules maintenance](#git-submodules-maintenance) -6. [Reporting bugs](#reporting-bugs) +4. [Contributing to Mono](#contributing-to-mono) +5. [Reporting bugs](#reporting-bugs) +6. [Configuration Options](#configuration-options) + +**Build Status** + +| debian-amd64 | debian-i386 | centos-s390x | windows-amd64 | +|:------------:|:-----------:|:------------:|:-------------:| +| [![debian-amd64](http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/badge/icon)](http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/) | [![debian-i386](http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-i386/badge/icon)](http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-i386/) | [![centos-s390x](http://jenkins.mono-project.com/job/test-mono-mainline/label=centos-s390x/badge/icon)](http://jenkins.mono-project.com/job/test-mono-mainline/label=centos-s390x/) | [![windows-amd64](https://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true)](https://ci.appveyor.com/project/ajlennon/mono-817/branch/master) | Compilation and Installation ============================ -a. Build Requirements +Building the Software --------------------- -* On Itanium, you must obtain libunwind: http://www.hpl.hp.com/research/linux/libunwind/download.php4 - -* On Solaris - - 1. Make sure that you used GNU tar to unpack this package, as - Solaris tar will not unpack this correctly, and you will get strange errors. +Please see our guides for building Mono on +[Mac OS X](http://www.mono-project.com/docs/compiling-mono/mac/), +[Linux](http://www.mono-project.com/docs/compiling-mono/linux/) and +[Windows](http://www.mono-project.com/docs/compiling-mono/windows/). - 2. Make sure that you use the GNU toolchain to build the software. +Note that building from Git assumes that you already have Mono installed, +so please download and [install the latest Mono release](http://www.mono-project.com/download/) +before trying to build from Git. This is required because the Mono build +relies on a working Mono C# compiler to compile itself +(also known as [bootstrapping](http://en.wikipedia.org/wiki/Bootstrapping_(compilers))). - 3. Optional dependencies +If you don't have a working Mono installation +--------------------------------------------- - * libgdiplus - Required for System.Drawing. This library in turn requires glib and pkg-config +If you don't have a working Mono installation, you can try a slightly +more risky approach: getting the latest version of the 'monolite' distribution, +which contains just enough to run the 'mcs' compiler. You do this with: - * pkg-config - Available at: http://www.freedesktop.org/Software/pkgconfig + # Run the following line after ./autogen.sh + make get-monolite-latest - * glib 2.4 - Available at: http://www.gtk.org/ +This will download and place the files appropriately so that you can then +just run: - * libzlib - This library and the development headers are required for compression -file support in the 2.0 profile. + make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/basic.exe - 4. Mono is required to build Mono. Use a system package or monolite (explained further below) - - 5. If you have a system Mono (not monolite), you will need to read this: http://mono-project.com/Parallel_Mono_Environments#Setting_up_a_Build_Environment +The build will then use the files downloaded by `make get-monolite-latest`. -b. Building the Software +Testing and Installation ------------------------ -If you obtained this package as an officially released tarball, -this is very simple, use configure and make: +You can run the mono and mcs test suites with the command: `make check`. -`./configure --prefix=/usr/local ; make ; make install` +Expect to find a few test suite failures. As a sanity check, you +can compare the failures you got with [https://wrench.mono-project.com/Wrench/](https://wrench.mono-project.com/Wrench/) +and [http://jenkins.mono-project.com/](http://jenkins.mono-project.com/). -Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390, -S/390x, AMD64, ARM and PowerPC systems. +You can now install mono with: `make install` -If you obtained this as a snapshot, you will need an existing -Mono installation. To upgrade your installation, unpack both -mono and mcs: +You can verify your installation by using the mono-test-install +script, it can diagnose some common problems with Mono's install. +Failure to follow these steps may result in a broken installation. - tar xzf mcs-XXXX.tar.gz - tar xzf mono-XXXX.tar.gz - mv mono-XXX mono - mv mcs-XXX mcs - cd mono - ./autogen.sh --prefix=/usr/local - make +Using Mono +========== -The Mono build system is silent for most compilation commands. -To enable a more verbose compile (for example, to pinpoint -problems in your makefiles or your system) pass the V=1 flag to make, like this: +Once you have installed the software, you can run a few programs: -` make V=1` +* `mono program.exe` runtime engine +* `mcs program.cs` C# compiler -c. Building the software from GIT ---------------------------------- +* `monodis program.exe` CIL Disassembler -If you are building the software from GIT, make sure that you -have up-to-date mcs and mono sources: +See the man pages for mono(1), mcs(1) and monodis(1) for further details. - * If you are an anonymous user: `git clone git://github.com/mono/mono.git` +Directory Roadmap +================= - * If you are a Mono contributor with read/write privileges: `git clone git@github.com:mono/mono.git` +* `data/` - Configuration files installed as part of the Mono runtime. -Then, go into the mono directory, and configure: +* `docs/` - Technical documents about the Mono runtime. - cd mono - ./autogen.sh --prefix=/usr/local - make +* `external/` - Git submodules for external libraries (Newtonsoft.Json, ikvm, etc). -For people with non-standard installations of the auto* utils and of -pkg-config (common on misconfigured OSX and windows boxes), you could get -an error like this: +* `man/` - Manual pages for the various Mono commands and programs. - ./configure: line 19176: syntax error near unexpected token 'PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ... +* `mcs/` - The class libraries, compiler and tools -This means that you need to set the ACLOCAL_FLAGS environment variable -when invoking autogen.sh, like this: + * `class/` - The class libraries (like System.*, Microsoft.Build, etc.) - ACLOCAL_FLAGS="-I $acprefix/share/aclocal" ./autogen.sh --prefix=/usr/local + * `mcs/` - The Mono C# compiler written in C# -where $acprefix is the prefix where aclocal has been installed. -This will automatically go into the mcs/ tree and build the -binaries there. + * `tools/` - Tools like gacutil, ikdasm, mdoc, etc. -This assumes that you have a working mono installation, and that -there's a C# compiler named 'mcs', and a corresponding IL -runtime called 'mono'. You can use two make variables -EXTERNAL_MCS and EXTERNAL_RUNTIME to override these. e.g., you -can say: +* `mono/` - The core of the Mono Runtime. - make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono + * `arch/` - Architecture specific portions. -If you don't have a working Mono installation ---------------------------------------------- + * `cil/` - Common Intermediate Representation, XML +definition of the CIL bytecodes. -If you don't have a working Mono installation, an obvious choice -is to install the latest released packages of 'mono' for your -distribution and running `autogen.sh; make; make install` in the -mono module directory. + * `dis/` - CIL executable Disassembler -You can also try a slightly more risky approach: this may not work, -so start from the released tarball as detailed above. + * `io-layer/` - The I/O layer and system abstraction for +emulating the .NET IO model. -This works by first getting the latest version of the 'monolite' -distribution, which contains just enough to run the 'mcs' -compiler. You do this with: + * `metadata/` - The object system and metadata reader. - # Run the following line after ./autogen.sh - make get-monolite-latest + * `mini/` - The Just in Time Compiler. -This will download and automatically gunzip and untar the -tarball, and place the files appropriately so that you can then -just run: `make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe` +* `runtime/` - A directory that contains the Makefiles that link the +mono/ and mcs/ build systems. -That will use the files downloaded by 'make get-monolite-latest. +* `samples/` -Some simple sample programs on uses of the Mono +runtime as an embedded library. -Testing and Installation ------------------------- +* `scripts/` - Scripts used to invoke Mono and the corresponding program. -You can run *(part of)* the mono and mcs test suites with the command: `make check`. -All tests should pass. +* `../olive/` - Incubation code from [Olive](https://github.com/mono/olive). -If you want more *extensive* tests, including those that test the -class libraries, you need to re-run 'configure' with the -'--enable-nunit-tests' flag, and try: `make -k check` + * If the directory ../olive is present (as an +independent checkout) from the Mono module, that +directory is automatically configured to share the +same prefix than this module gets. -Expect to find a few test suite failures. As a sanity check, you -can compare the failures you got with +Contributing to Mono +==================== - https://wrench.mono-project.com/Wrench/ +Before submitting changes to Mono, please review the [contribution guidelines](http://www.mono-project.com/community/contributing/). +Please pay particular attention to the [Important Rules](http://www.mono-project.com/community/contributing/#important-rules) section. -You can now install mono with: `make install` +Reporting bugs +============== -You can verify your installation by using the mono-test-install -script, it can diagnose some common problems with Mono's install. -Failure to follow these steps may result in a broken installation. +To submit bug reports, please use [Xamarin's Bugzilla](https://bugzilla.xamarin.com/) -d. Configuration Options ------------------------- +Please use the search facility to ensure the same bug hasn't already +been submitted and follow our [guidelines](http://www.mono-project.com/community/bugs/make-a-good-bug-report/) +on how to make a good bug report. + +Configuration Options +===================== The following are the configuration options that someone building Mono might want to use: @@ -164,17 +151,16 @@ building Mono might want to use: compilation of a Mono runtime with the SGen garbage collector. * On platforms that support it, after building Mono, you will have -both a mono binary and a mono-sgen binary. Mono uses Boehm, while -mono-sgen uses the Simple Generational GC. +both a `mono` binary and a `mono-sgen` binary. `mono` uses Boehm, while +`mono-sgen` uses the Simple Generational GC. -* `--with-gc=[boehm, included, sgen, none]` - Selects the default Boehm garbage +* `--with-gc=[included, boehm, none]` - Selects the default Boehm garbage collector engine to use. * *included*: (*slighty modified Boehm GC*) -This is the default value, and its -the most feature complete, it will allow Mono -to use typed allocations and support the -debugger. +This is the default value for the Boehm GC, and it's +the most feature complete, it will allow Mono +to use typed allocations and support the debugger. * *boehm*: This is used to use a system-install Boehm GC, @@ -267,30 +253,6 @@ and runtime. * This defaults to `yes`. -* `--with-moonlight=yes,no` - - * Whether you want to generate the Silverlight/Moonlight -libraries and toolchain in addition to the default -(1.1 and 2.0 APIs). - - * This will produce the `smcs` compiler which will reference -the Silverlight modified assemblies (mscorlib.dll, -System.dll, System.Code.dll and System.Xml.Core.dll) and turn -on the LINQ extensions for the compiler. - -* `--with-moon-gc=boehm,sgen` - Select the GC to use for Moonlight. - - * *boehm*: -Selects the Boehm Garbage Collector, with the same flags -as the regular Mono build. This is the default. - - * *sgen*: -Selects the new SGen Garbage Collector, which provides -Generational GC support, using the same flags as the -mono-sgen build. - - * This defaults to `boehm`. - * `--with-libgdiplus=installed,sibling,` - Configure where Mono searches for libgdiplus when running System.Drawing tests. @@ -298,7 +260,7 @@ searches for libgdiplus when running System.Drawing tests. library is available to Mono through the regular system setup. - * `sibling' can be used to specify that a libgdiplus + * `sibling` can be used to specify that a libgdiplus that resides as a sibling of this directory (mono) should be used. @@ -405,13 +367,13 @@ for Mono. The LLVM code generator and optimizer will be used instead of Mono's built-in code generator for both Just in Time and Ahead of Time compilations. - * See the http://www.mono-project.com/Mono_LLVM for the + * See http://www.mono-project.com/docs/advanced/mono-llvm/ for the full details and up-to-date information on this feature. * You will need to have an LLVM built that Mono can link against. - * The --enable-loadedllvm variant will make the LLVM backend + * The `--enable-loadedllvm` variant will make the LLVM backend into a runtime-loadable module instead of linking it directly into the main mono binary. @@ -445,7 +407,6 @@ not done much testing with Mono. runtime that contains DTrace probes and can participate in the system profiling using DTrace. - * `--disable-dev-random` * Mono uses /dev/random to obtain good random data for @@ -464,85 +425,3 @@ http://code.google.com/p/nativeclient/ * Currently this is used with Mono's AOT engine as Native Client does not support JIT engines yet. - -Using Mono -========== - -Once you have installed the software, you can run a few programs: - -* `mono program.exe` runtime engine - -* `mcs program.cs` C# compiler - -* `monodis program.exe` CIL Disassembler - -See the man pages for mono(1), mint(1), monodis(1) and mcs(2) -for further details. - -Directory Roadmap -================= - -* `docs/` - Technical documents about the Mono runtime. - -* `data/` - Configuration files installed as part of the Mono runtime. - -* `mono/` - The core of the Mono Runtime. - - * `metadata/` - The object system and metadata reader. - - * `mini/` - The Just in Time Compiler. - - * `dis/` - CIL executable Disassembler - - * `io-layer/` - The I/O layer and system abstraction for -emulating the .NET IO model. - - * `cil/` - Common Intermediate Representation, XML -definition of the CIL bytecodes. - - * `arch/` - Architecture specific portions. - -* `man/` - Manual pages for the various Mono commands and programs. - -* `samples/` -Some simple sample programs on uses of the Mono -runtime as an embedded library. - -* `scripts/` - Scripts used to invoke Mono and the corresponding program. - -* `runtime/` - A directory that contains the Makefiles that link the -mono/ and mcs/ build systems. - -* `../olive/` - - * If the directory ../olive is present (as an -independent checkout) from the Mono module, that -directory is automatically configured to share the -same prefix than this module gets. - -Contributing to Mono -==================== -Before submitting changes to Mono, please review the contribution guidelines at http://mono-project.com/Contributing. Please pay particular attention to the [Important Rules](http://mono-project.com/Contributing#Important_Rules) section. - - -Git submodules maintenance -========================== - -Read documentation at http://mono-project.com/Git_Submodule_Maintenance - -Maintainer -========== - -Mono is maintained by miguel@xamarin.com - -Reporting bugs -============== - -To submit bug reports, please use Xamarin's Bugzilla: - -https://bugzilla.xamarin.com/ - -Please use the search facility to ensure the same bug hasn't already -been submitted and follow our guidelines on how to make a good bug -report: - -http://mono-project.com/Bugs#How_to_make_a_good_bug_report diff --git a/configure.ac b/configure.ac index 2bc3c0d08f5..45838328adb 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script. #AC_PREREQ([2.62]) -AC_INIT(mono, [3.12.1], +AC_INIT(mono, [3.99.0], [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono]) AC_CONFIG_SRCDIR([README.md]) @@ -2299,9 +2299,6 @@ fi AC_ARG_ENABLE(bcl-opt, [ --disable-bcl-opt BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes) -AC_ARG_ENABLE(nunit-tests, [ --enable-nunit-tests Run the nunit tests of the class library on 'make check']) -AM_CONDITIONAL(ENABLE_NUNIT_TESTS, [test x$enable_nunit_tests = xyes]) - AC_MSG_CHECKING([if big-arrays are to be enabled]) AC_ARG_ENABLE(big-arrays, [ --enable-big-arrays Enable the allocation and indexing of arrays greater than Int32.MaxValue], enable_big_arrays=$enableval, enable_big_arrays=no) if test "x$enable_big_arrays" = "xyes" ; then @@ -2799,7 +2796,18 @@ if test "x$host" != "x$target"; then # in mono-compiler.h with_tls=pthread target_mach=no - ;; + ;; + aarch64*-linux-*) + TARGET=ARM64; + arch_target=arm64; + AC_DEFINE(TARGET_ARM64, 1, [...]) + AC_DEFINE(TARGET_ANDROID, 1, [...]) + CPPFLAGS="$CPPFLAGS" + # Can't use tls, since it depends on the runtime detection of tls offsets + # in mono-compiler.h + with_tls=pthread + target_mach=no + ;; aarch64-*) TARGET=ARM64 ;; @@ -3199,8 +3207,6 @@ case "x$libgc" in ;; esac -AC_ARG_WITH(profile2, [ --with-profile2=yes,no If you want to install the 2.0/3.5 FX (defaults to yes)], [], [with_profile2=yes]) -AC_ARG_WITH(profile4, [ --with-profile4=yes,no If you want to install the 4.0 FX (defaults to yes)], [], [with_profile4=yes]) AC_ARG_WITH(profile4_5,[ --with-profile4_5=yes,no If you want to install the 4.5 FX (defaults to yes)], [], [with_profile4_5=yes]) AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=no]) AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no,only If you want to build the MonoTouch assemblies (defaults to no)], [], [with_monotouch=no]) @@ -3235,7 +3241,7 @@ AC_ARG_WITH(mcs_docs,[ --with-mcs-docs=yes,no If you want to build the DISABLE_MCS_DOCS=yes fi ]) -if test x$with_profile4 != xyes; then +if test x$with_profile4_5 != xyes; then DISABLE_MCS_DOCS=yes fi @@ -3275,8 +3281,6 @@ dnl Consistency settings dnl if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then DISABLE_MCS_DOCS=yes - with_profile2=no - with_profile4=no with_profile4_5=no with_monodroid=no with_monotouch=no @@ -3299,8 +3303,6 @@ AC_SUBST(OPROFILE_LIBS) libmono_ldflags="$libmono_ldflags $LIBS" -AM_CONDITIONAL(INSTALL_2_0, [test "x$with_profile2" = xyes]) -AM_CONDITIONAL(INSTALL_4_0, [test "x$with_profile4" = xyes]) AM_CONDITIONAL(INSTALL_4_5, [test "x$with_profile4_5" = xyes]) AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"]) AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" != "xno"]) @@ -3683,10 +3685,7 @@ fi echo "EXTENSION_MODULE = 1" >> $srcdir/$mcsdir/build/config.make fi - default_profile=net_2_0 - if test -z "$INSTALL_4_0_TRUE"; then : - default_profile=net_4_0 - fi + default_profile=net_4_5 if test -z "$INSTALL_MONODROID_TRUE"; then : default_profile=monodroid fi @@ -3744,8 +3743,6 @@ echo " LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm) Libraries: - .NET 2.0/3.5: $with_profile2 - .NET 4.0: $with_profile4 .NET 4.5: $with_profile4_5 MonoDroid: $with_monodroid MonoTouch: $with_monotouch diff --git a/data/Makefile.am b/data/Makefile.am index daf6f38a79b..73dbe78209b 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,8 +1,4 @@ -SUBDIRS = net_2_0 - -if INSTALL_4_0 -SUBDIRS += net_4_0 net_4_5 -endif +SUBDIRS = net_2_0 net_4_0 net_4_5 monodir = $(sysconfdir)/mono diff --git a/docs/Makefile.am b/docs/Makefile.am index 39527b5f8eb..811955257bb 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -99,14 +99,14 @@ mono-file-formats.tree: $(srcdir)/docs.make $(srcdir)/Makefile.am $(srcdir)/depl deploy/.stamp: convert.exe Makefile.am $(mkdir_p) html runtimedir=`cd ../runtime && pwd`; export runtimedir; \ - MONO_PATH=../mcs/class/lib/net_2_0 perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c + MONO_PATH=../mcs/class/lib/net_4_5 perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c touch $@ extract: deploy/.stamp convert.exe: convert.cs AgilityPack.dll - $(TOOL_MAKE) PROFILE=net_2_0 convert.exe + $(TOOL_MAKE) PROFILE=net_4_5 convert.exe AgilityPack.dll: - $(TOOL_MAKE) PROFILE=net_2_0 AgilityPack.dll + $(TOOL_MAKE) PROFILE=net_4_5 AgilityPack.dll diff --git a/eglib/configure.ac b/eglib/configure.ac index 1ff6c42ff28..5281419c00b 100644 --- a/eglib/configure.ac +++ b/eglib/configure.ac @@ -135,6 +135,7 @@ AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf) +AC_CHECK_FUNCS(getrlimit) # # Mono currently supports 10.6, but strndup is not available prior to 10.7; avoiding @@ -179,7 +180,7 @@ if test "x$have_iso_varargs" = "xyes"; then fi AC_SUBST(G_HAVE_ISO_VARARGS) -AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h sys/types.h) +AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h sys/types.h sys/resource.h) AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0]) AC_SUBST(HAVE_ALLOCA_H) diff --git a/eglib/src/glib.h b/eglib/src/glib.h index 533c84116c3..d23e32a534c 100644 --- a/eglib/src/glib.h +++ b/eglib/src/glib.h @@ -176,7 +176,6 @@ typedef struct _GMemChunk GMemChunk; /* * Misc. */ -#define g_atexit(func) ((void) atexit (func)) const gchar * g_getenv(const gchar *variable); gboolean g_setenv(const gchar *variable, const gchar *value, gboolean overwrite); diff --git a/eglib/src/gspawn.c b/eglib/src/gspawn.c index 836e6f2aa9c..449a724be9d 100644 --- a/eglib/src/gspawn.c +++ b/eglib/src/gspawn.c @@ -53,6 +53,10 @@ #include #endif +#ifdef HAVE_SYS_RESOURCE_H +# include +#endif + #ifdef G_OS_WIN32 #include #include @@ -213,6 +217,23 @@ write_all (int fd, const void *vbuf, size_t n) return nwritten; } +#ifndef G_OS_WIN32 +static int +g_getdtablesize (void) +{ +#ifdef HAVE_GETRLIMIT + struct rlimit limit; + int res; + + res = getrlimit (RLIMIT_NOFILE, &limit); + g_assert (res == 0); + return limit.rlim_cur; +#else + return getdtablesize (); +#endif +} +#endif + gboolean g_spawn_command_line_sync (const gchar *command_line, gchar **standard_output, @@ -256,7 +277,7 @@ g_spawn_command_line_sync (const gchar *command_line, close (stderr_pipe [0]); dup2 (stderr_pipe [1], STDERR_FILENO); } - for (i = getdtablesize () - 1; i >= 3; i--) + for (i = g_getdtablesize () - 1; i >= 3; i--) close (i); /* G_SPAWN_SEARCH_PATH is always enabled for g_spawn_command_line_sync */ @@ -417,7 +438,7 @@ g_spawn_async_with_pipes (const gchar *working_directory, } if ((flags & G_SPAWN_LEAVE_DESCRIPTORS_OPEN) != 0) { - for (i = getdtablesize () - 1; i >= 3; i--) + for (i = g_getdtablesize () - 1; i >= 3; i--) close (i); } diff --git a/eglib/winconfig.h b/eglib/winconfig.h index fdab3ddae63..04e8d4075ce 100755 --- a/eglib/winconfig.h +++ b/eglib/winconfig.h @@ -1,6 +1,10 @@ /* config.h. Generated by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ +#ifndef _MSC_VER +#include "cygconfig.h" +#else + /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 @@ -74,3 +78,4 @@ #define VERSION "0.1" #define HAVE_STRTOK_R 1 +#endif diff --git a/external/reference-assemblies b/external/reference-assemblies new file mode 160000 index 00000000000..4abf9a74bd9 --- /dev/null +++ b/external/reference-assemblies @@ -0,0 +1 @@ +Subproject commit 4abf9a74bd9a807380ba8f55a73b322625e15565 diff --git a/external/referencesource b/external/referencesource new file mode 160000 index 00000000000..d7cd1d254ef --- /dev/null +++ b/external/referencesource @@ -0,0 +1 @@ +Subproject commit d7cd1d254eff76396c94433fcf40cbb7e6b3c5bc diff --git a/external/rx b/external/rx index 00c1aadf149..b29a4b0fda6 160000 --- a/external/rx +++ b/external/rx @@ -1 +1 @@ -Subproject commit 00c1aadf149334c694d2a5096983a84cf46221b8 +Subproject commit b29a4b0fda609e0af33ff54ed13652b6ccf0e05e diff --git a/man/csharp.1 b/man/csharp.1 index 50cbdc86508..9379658e62e 100644 --- a/man/csharp.1 +++ b/man/csharp.1 @@ -358,9 +358,9 @@ gmcs(1), mcs(1), mdb(1), mono(1), pkg-config(1) .SH BUGS To report bugs in the compiler, you must file them on our bug tracking system, at: -http://www.mono-project.com/Bugs +http://www.mono-project.com/community/bugs/ .SH MAILING LIST -The Mono Mailing lists are listed at http://www.mono-project.com/Mailing_Lists +The Mono Mailing lists are listed at http://www.mono-project.com/community/help/mailing-lists/ .SH MORE INFORMATION The Mono C# compiler was developed by Novell, Inc (http://www.novell.com, http) and is based on the @@ -368,5 +368,5 @@ ECMA C# language standard available here: http://www.ecma.ch/ecma1/STAND/ecma-334.htm .PP The home page for the Mono C# compiler is at -http://www.mono-project.com/CSharp_Compiler information about the -interactive mode for C# is available in http://mono-project.com/CsharpRepl +http://www.mono-project.com/docs/about-mono/languages/csharp/ information about the +interactive mode for C# is available in http://mono-project.com/docs/tools+libraries/tools/repl/ diff --git a/man/httpcfg.1 b/man/httpcfg.1 index ade4063a015..78c0e587b42 100644 --- a/man/httpcfg.1 +++ b/man/httpcfg.1 @@ -54,7 +54,7 @@ httpcfg -add -port 8081 -pvk myfile.pvk -cert MyCert For more details on creating the certificate file and the private key, see the following web page: .PP -http://www.mono-project.com/UsingClientCertificatesWithXSP +http://www.mono-project.com/docs/web/using-clientcertificates-with-xsp/ .SH FILES The certificates are stored in the ~/.mono/httplistener directory .SH AUTHOR @@ -72,4 +72,4 @@ Visit http://www.mono-project.com for details The private key format: .nf http://www.drh-consultancy.demon.co.uk/pvk.html -.fi \ No newline at end of file +.fi diff --git a/man/lc.1 b/man/lc.1 index 29e2f72ae16..f667a8f62a6 100644 --- a/man/lc.1 +++ b/man/lc.1 @@ -78,7 +78,7 @@ version and publickeytoken. .SH MAILING LISTS Mailing lists are listed at the -http://www.mono-project.com/Mailing_Lists +http://www.mono-project.com/community/help/mailing-lists/ .SH WEB SITE http://www.mono-project.com .SH SEE ALSO diff --git a/man/mcs.1 b/man/mcs.1 index dc1e5f42386..14221a83c10 100644 --- a/man/mcs.1 +++ b/man/mcs.1 @@ -538,13 +538,13 @@ csharp(1), mdb(1), mono(1), mopen(1), pkg-config(1), sn(1) .SH BUGS To report bugs in the compiler, you must file them on our bug tracking system, at: -http://www.mono-project.com/Bugs +http://www.mono-project.com/community/bugs/ .SH MAILING LIST -The Mono Mailing lists are listed at http://www.mono-project.com/Mailing_Lists +The Mono Mailing lists are listed at http://www.mono-project.com/community/help/mailing-lists/ .SH MORE INFORMATION The Mono C# compiler was developed by Novell, Inc (http://www.novell.com) and Xamarin Inc (http://www.xamarin.com) is based on the ECMA C# language standard available here: http://www.ecma.ch/ecma1/STAND/ecma-334.htm .PP -The home page for the Mono C# compiler is at http://www.mono-project.com/CSharp_Compiler +The home page for the Mono C# compiler is at http://www.mono-project.com/docs/about-mono/languages/csharp/ diff --git a/man/mdassembler.1 b/man/mdassembler.1 index 19a085e7441..215bd11a53b 100644 --- a/man/mdassembler.1 +++ b/man/mdassembler.1 @@ -198,7 +198,7 @@ file for a list of PATH values .I //node/@name values). .sp -See also: http://www.mono-project.com/Generating_Documentation +See also: http://www.mono-project.com/docs/tools+libraries/tools/monodoc/generating-documentation/ .TP .I Create your documentation See also the @@ -256,4 +256,4 @@ Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. .SH WEB SITE See also: http://www.mono-project.com and -http://www.mono-project.com/Assembler +http://www.mono-project.com/docs/tools+libraries/tools/mdassembler/ diff --git a/man/mdoc-assemble.1 b/man/mdoc-assemble.1 index 40e00252713..4497101395c 100644 --- a/man/mdoc-assemble.1 +++ b/man/mdoc-assemble.1 @@ -207,4 +207,4 @@ file and looks for referenced documents to create the help source. .TP Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. .SH WEB SITE -See also: http://www.mono-project.com/mdoc +See also: http://www.mono-project.com/docs/tools+libraries/tools/mdoc/ diff --git a/man/mdoc-export-html.1 b/man/mdoc-export-html.1 index 130381c1c7e..319628957ee 100644 --- a/man/mdoc-export-html.1 +++ b/man/mdoc-export-html.1 @@ -148,4 +148,4 @@ See the \fICREF FORMAT\fR section of \fBmdoc\fR(5) for more information. .TP Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. .SH WEB SITE -Visit http://www.mono-project.com/mdoc for details +Visit http://www.mono-project.com/docs/tools+libraries/tools/mdoc/ for details diff --git a/man/mdoc-export-msxdoc.1 b/man/mdoc-export-msxdoc.1 index 697f25020e0..b0ee45aa18f 100644 --- a/man/mdoc-export-msxdoc.1 +++ b/man/mdoc-export-msxdoc.1 @@ -34,4 +34,4 @@ Display a help message and exit. .TP Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. .SH WEB SITE -Visit http://www.mono-project.com/mdoc for details +Visit http://www.mono-project.com/docs/tools+libraries/tools/mdoc/ for details diff --git a/man/mdoc-validate.1 b/man/mdoc-validate.1 index 27098444425..296481bba26 100644 --- a/man/mdoc-validate.1 +++ b/man/mdoc-validate.1 @@ -51,4 +51,4 @@ documentation within that directory, recursively), use: .TP Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. .SH WEB SITE -Visit http://www.mono-project.com/mdoc for details +Visit http://www.mono-project.com/docs/tools+libraries/tools/mdoc/ for details diff --git a/man/mdoc.1 b/man/mdoc.1 index dd2ecace4bd..620c45aaf02 100644 --- a/man/mdoc.1 +++ b/man/mdoc.1 @@ -195,4 +195,4 @@ mdoc-validate(1) .TP Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. .SH WEB SITE -Visit http://www.mono-project.com/mdoc for details +Visit http://www.mono-project.com/docs/tools+libraries/tools/mdoc/ for details diff --git a/man/mono-cil-strip.1 b/man/mono-cil-strip.1 index 7520479d59d..2a4ab8f1fd9 100644 --- a/man/mono-cil-strip.1 +++ b/man/mono-cil-strip.1 @@ -11,7 +11,7 @@ longer necessary, but the metadata still is. .SH COPYRIGHT Copyright (C) 2008 Novell, Inc (http://www.novell.com) .SH MAILING LISTS -Mailing lists are listed at http://www.mono-project.com/Mailing_Lists +Mailing lists are listed at http://www.mono-project.com/community/help/mailing-lists/ .SH LICENSE mono-cil-strip is licensed under the MIT/X11 license. Please read the accompayning MIT.X11 file for details. diff --git a/man/mono-xmltool.1 b/man/mono-xmltool.1 index 9c9d96c56d5..13c4928c929 100644 --- a/man/mono-xmltool.1 +++ b/man/mono-xmltool.1 @@ -78,7 +78,7 @@ specified it reads the standard input. If is not specified, the output is sent to the standard output. .SH MAILING LISTS Mailing lists are listed at the -http://www.mono-project.com/Mailing_Lists +http://www.mono-project.com/community/help/mailing-lists/ .SH WEB SITE http://www.mono-project.com .SH SEE ALSO diff --git a/man/mono.1 b/man/mono.1 index 784c078d381..66fc7a3fba4 100644 --- a/man/mono.1 +++ b/man/mono.1 @@ -119,6 +119,7 @@ If specified, forces the generated AOT files to be bound to the runtime version of the compiling Mono. This will prevent the AOT files from being consumed by a different Mono runtime. .I full +.Sp This is currently an experimental feature as it is not complete. This instructs Mono to precompile code that has historically not been precompiled with AOT. @@ -221,7 +222,7 @@ example, --tool=prefix=arm-linux-gnueabi- will make the AOT compiler run .I write-symbols Instructs the AOT compiler to emit debug symbol information. .PP -For more information about AOT, see: http://www.mono-project.com/AOT +For more information about AOT, see: http://www.mono-project.com/docs/advanced/aot/ .RE .TP \fB--attach=[options]\fR @@ -317,7 +318,7 @@ If the Mono runtime has been compiled with LLVM support (not available in all configurations), Mono will use the LLVM optimization and code generation engine to JIT or AOT compile. .Sp -For more information, consult: http://www.mono-project.com/Mono_LLVM +For more information, consult: http://www.mono-project.com/docs/advanced/mono-llvm/ .TP \fB--nollvm\fR When using a Mono that has been compiled with LLVM support, it forces @@ -400,7 +401,7 @@ e.g. execution of Code Access Security (CAS) or non-CAS demands. .I core-clr Enables the core-clr security system, typically used for Moonlight/Silverlight applications. It provides a much simpler -security system than CAS, see http://www.mono-project.com/Moonlight +security system than CAS, see http://www.mono-project.com/docs/web/moonlight/ for more details and links to the descriptions of this new system. .TP .I validil @@ -736,7 +737,7 @@ shared library `mono-profiler-custom.so'. This profiler module must be on your dynamic linker library path. .PP A list of other third party profilers is available from Mono's web -site (www.mono-project.com/Performance_Tips) +site (www.mono-project.com/docs/advanced/performance-tips/) .PP Custom profiles are written as shared libraries. The shared library must be called `mono-profiler-NAME.so' where `NAME' is the name of @@ -1371,7 +1372,7 @@ libraries side-by-side with the main executable. .Sp For a complete description of recommended practices for application deployment, see -http://www.mono-project.com/Guidelines:Application_Deployment +http://www.mono-project.com/docs/getting-started/application-deployment/ .TP \fBMONO_RTC\fR Experimental RTC support in the statistical profiler: if the user has @@ -1755,7 +1756,7 @@ on this subject see the http://www.mono-project.com/Config_system.web page. .SH MAILING LISTS Mailing lists are listed at the -http://www.mono-project.com/Mailing_Lists +http://www.mono-project.com/community/help/mailing-lists/ .SH WEB SITE http://www.mono-project.com .SH SEE ALSO @@ -1764,6 +1765,6 @@ certmgr(1), csharp(1), mcs(1), mdb(1), monocov(1), monodis(1), mono-config(5), mozroots(1), mprof-report(1), pdb2mdb(1), xsp(1), mod_mono(8). .PP For more information on AOT: -http://www.mono-project.com/AOT +http://www.mono-project.com/docs/advanced/aot/ .PP For ASP.NET-related documentation, see the xsp(1) manual page diff --git a/man/monolinker.1 b/man/monolinker.1 index cf49920a39c..1ec7bcce818 100644 --- a/man/monolinker.1 +++ b/man/monolinker.1 @@ -202,13 +202,13 @@ Specify a parameter for a custom step. .SH COPYRIGHT Copyright (C) 2007 Novell, Inc (http://www.novell.com) .SH BUGS -Bugs report are welcome at http://bugzilla.ximian.com +Bugs report are welcome at http://bugzilla.xamarin.com .PP Product Mono Tools, Component linker. .SH MAILING LISTS -Mailing lists are listed at http://www.mono-project.com/Mailing_Lists +Mailing lists are listed at http://www.mono-project.com/community/help/mailing-lists/ .SH WEB SITE -http://www.mono-project.com/Linker +http://www.mono-project.com/docs/tools+libraries/tools/linker/ .SH AUTHORS The linker has been written by Jb Evain, and have been partially founded by the Google Summer of Code. diff --git a/man/mozroots.1 b/man/mozroots.1 index 2b2cc1d1128..438f7692bee 100644 --- a/man/mozroots.1 +++ b/man/mozroots.1 @@ -170,7 +170,7 @@ manual page for more information on managing certificate stores. Copyright (C) 2005 Novell. .SH MAILING LISTS Mailing lists are listed at the -http://www.mono-project.com/Mailing_Lists +http://www.mono-project.com/community/help/mailing-lists/ .SH WEB SITE http://www.mono-project.com .SH SEE ALSO diff --git a/man/mprof-report.1 b/man/mprof-report.1 index 4b1b7816817..fec61afe13a 100644 --- a/man/mprof-report.1 +++ b/man/mprof-report.1 @@ -536,7 +536,7 @@ information, you could use it like this: .PP \f[B]output=|mprof-report\ --reports=monitor\ --traces\ -\f[] .SH WEB SITE -http://www.mono-project.com/Profiler +http://www.mono-project.com/docs/debug+profile/profile/profiler/ .SH SEE ALSO .PP mono(1) diff --git a/man/sqlsharp.1 b/man/sqlsharp.1 index 4bb8ea98902..4bf500ffd4a 100644 --- a/man/sqlsharp.1 +++ b/man/sqlsharp.1 @@ -518,7 +518,7 @@ licenses are available from Novell or Daniel Morgan. To report bugs in the compiler, you can use `bug-buddy', or you can file bug reports in our bug tracking system: .nf -http://bugzilla.ximian.com. +http://bugzilla.xamarin.com. .fi .PP .SH MAILING LISTS diff --git a/mcs/Makefile b/mcs/Makefile index 9bcf32ea2fb..f85356e7f37 100644 --- a/mcs/Makefile +++ b/mcs/Makefile @@ -6,17 +6,16 @@ SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs basic_SUBDIRS := build jay mcs class build_SUBDIRS := build class mcs class/aot-compiler tools -net_2_0_SUBDIRS := build class nunit24 ilasm tools tests errors docs monodroid_SUBDIRS := build class monotouch_SUBDIRS := build class monotouch_runtime_SUBDIRS := build class xammac_SUBDIRS := build class mobile_SUBDIRS := build class mobile_static_SUBDIRS := build class -net_3_5_SUBDIRS := build class tools/xbuild net_4_0_SUBDIRS := build class net_4_5_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs xbuild_12_SUBDIRS := build class tools/xbuild +xbuild_14_SUBDIRS := build class tools/xbuild # List of test subdirs that should pass 100% centum_tests := \ @@ -87,7 +86,7 @@ dir-check: # fun specialty targets -PROFILES = net_2_0 net_3_5 net_4_0 net_4_5 xbuild_12 +PROFILES = net_4_5 net_4_0 xbuild_12 xbuild_14 .PHONY: all-profiles $(STD_TARGETS:=-profiles) all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--% @@ -106,17 +105,16 @@ profiles-do--run-test: # Orchestrate the bootstrap here. _boot_ = all clean install +$(_boot_:%=profile-do--xbuild_14--%): profile-do--xbuild_14--%: profile-do--net_4_5--% $(_boot_:%=profile-do--xbuild_12--%): profile-do--xbuild_12--%: profile-do--net_4_5--% -$(_boot_:%=profile-do--net_4_5--%): profile-do--net_4_5--%: profile-do--build--% $(_boot_:%=profile-do--net_4_0--%): profile-do--net_4_0--%: profile-do--build--% -$(_boot_:%=profile-do--net_3_5--%): profile-do--net_3_5--%: profile-do--net_2_0--% +$(_boot_:%=profile-do--net_4_5--%): profile-do--net_4_5--%: profile-do--build--% $(_boot_:%=profile-do--monodroid--%): profile-do--monodroid--%: profile-do--build--% $(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--build--% $(_boot_:%=profile-do--monotouch_runtime--%): profile-do--monotouch_runtime--%: profile-do--build--% $(_boot_:%=profile-do--xammac--%): profile-do--xammac--%: profile-do--build--% $(_boot_:%=profile-do--mobile--%): profile-do--mobile--%: profile-do--build--% $(_boot_:%=profile-do--mobile_static--%): profile-do--mobile_static--%: profile-do--build--% -$(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--build--% $(_boot_:%=profile-do--build--%): profile-do--build--%: profile-do--basic--% testcorlib: diff --git a/mcs/build/Makefile b/mcs/build/Makefile index ce026ae275f..8ca1e7c7fa2 100644 --- a/mcs/build/Makefile +++ b/mcs/build/Makefile @@ -18,17 +18,17 @@ PLATFORMS = darwin linux win32 PROFILES = \ basic \ build \ - net_2_0 \ - net_3_5 \ - net_4_0 \ + net_4_0 \ net_4_5 \ - xbuild_12 + xbuild_12 \ + xbuild_14 COMMON_SRCS = \ Consts.cs.in \ Locale.cs \ MonoTODOAttribute.cs \ - basic-profile-check.cs + basic-profile-check.cs \ + SR.cs DISTFILES = \ README.makefiles \ diff --git a/mcs/build/common/Consts.cs.in b/mcs/build/common/Consts.cs.in index 5aa2f39908d..467b4d156c6 100644 --- a/mcs/build/common/Consts.cs.in +++ b/mcs/build/common/Consts.cs.in @@ -52,28 +52,13 @@ static class Consts public const string VsVersion = "0.0.0.0"; // Useless ? public const string VsFileVersion = "11.0.0.0"; // TODO: #elif NET_4_0 - public const string FxVersion = "4.0.0.0"; - public const string FxFileVersion = "4.0.30319.1"; - - public const string VsVersion = "0.0.0.0"; // Useless ? - public const string VsFileVersion = "10.0.0.0"; // TODO: + #error Profile NET_4_0 is not supported. #elif NET_3_5 - // Versions of .NET Framework 3.5 RTM - public const string FxVersion = "3.5.0.0"; - public const string FxFileVersion = "3.5.21022.8"; - - public const string VsVersion = "0.0.0.0"; // Useless ? + #error Profile NET_3_5 is not supported. #elif NET_3_0 - public const string FxVersion = "3.0.0.0"; - public const string VsVersion = "8.0.0.0"; - public const string FxFileVersion = "3.0.4506.648"; - public const string VsFileVersion = "6.0.6001.17014"; + #error Profile NET_3_0 is not supported. #elif NET_2_0 - // 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"; + #error Profile NET_2_0 is not supported. #elif NET_1_1 #error Profile NET_1_1 is not supported. #elif NET_1_0 @@ -124,7 +109,5 @@ static class Consts public const string AssemblySystemServiceModel_3_0 = "System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; #elif NET_2_1 public const string AssemblySystem_Core = "System.Core, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089"; -#elif NET_2_0 - public const string AssemblySystem_Core = "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; #endif } diff --git a/mcs/build/common/SR.cs b/mcs/build/common/SR.cs new file mode 100644 index 00000000000..86d6af79d77 --- /dev/null +++ b/mcs/build/common/SR.cs @@ -0,0 +1,46 @@ +using System.Globalization; + +static class AssemblyRef +{ + // FIXME + internal const string SystemConfiguration = "System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + internal const string System = "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + + public const string EcmaPublicKey = "b77a5c561934e089"; + public const string MicrosoftPublicKey = "b03f5f7f11d50a3a"; + + public const string SystemDesign = Consts.AssemblySystem_Design; + public const string SystemDrawing = Consts.AssemblySystem_Drawing; + public const string SystemWeb = Consts.AssemblySystem_Web; + public const string SystemWebExtensions = "System.Web.Extensions, Version=" + Consts.FxVersion + ", Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + public const string SystemWindowsForms = Consts.AssemblySystem_Windows_Forms; +} + +static partial class SR +{ + internal static string GetString(string name, params object[] args) + { + return GetString (CultureInfo.InvariantCulture, name, args); + } + + internal static string GetString(CultureInfo culture, string name, params object[] args) + { + return string.Format (culture, name, args); + } + + internal static string GetString(string name) + { + return name; + } + + internal static string GetString(CultureInfo culture, string name) + { + return name; + } +} + +namespace System.Runtime.CompilerServices +{ + class FriendAccessAllowed : Attribute + { } +} diff --git a/mcs/build/common/basic-profile-check.cs b/mcs/build/common/basic-profile-check.cs index 42d7adedfea..032dc42a5b3 100644 --- a/mcs/build/common/basic-profile-check.cs +++ b/mcs/build/common/basic-profile-check.cs @@ -1,3 +1,5 @@ +using System; + class X { // Check installed compiler static void Generic () @@ -20,6 +22,27 @@ class X { if (o == null) return 1; + var consts = o.GetType ().Assembly.GetType ("Consts"); + if (consts == null) { + // We could be bootraping on cygwin using .net runtime + var assembly = o.GetType ().Assembly; + if (assembly.GetName ().Version >= new Version (4, 0) && assembly.Location.Contains ("Microsoft.NET")) + return 0; + + return 2; + } + + var field = consts.GetField ("MonoVersion"); + if (field == null) + return 3; + + Version version; + if (!Version.TryParse (field.GetValue (null) as string, out version)) + return 4; + + if (version < new Version (3, 2)) + return 5; + return 0; } } diff --git a/mcs/build/platforms/darwin.make b/mcs/build/platforms/darwin.make index de94a445eb8..bfc73413391 100644 --- a/mcs/build/platforms/darwin.make +++ b/mcs/build/platforms/darwin.make @@ -9,7 +9,7 @@ PLATFORM_RUNTIME = $(RUNTIME) PLATFORM_CORLIB = mscorlib.dll PLATFORM_TEST_HARNESS_EXCLUDES = NotOnMac, -EXTERNAL_MCS = gmcs +EXTERNAL_MCS = mcs EXTERNAL_MBAS = mbas EXTERNAL_RUNTIME = mono #ILDISASM = monodis diff --git a/mcs/build/platforms/linux.make b/mcs/build/platforms/linux.make index a70984716ee..fd54351c47b 100644 --- a/mcs/build/platforms/linux.make +++ b/mcs/build/platforms/linux.make @@ -9,7 +9,7 @@ PLATFORM_RUNTIME = $(RUNTIME) PLATFORM_CORLIB = mscorlib.dll PLATFORM_TEST_HARNESS_EXCLUDES = -EXTERNAL_MCS = gmcs +EXTERNAL_MCS = mcs EXTERNAL_MBAS = mbas EXTERNAL_RUNTIME = mono #ILDISASM = monodis diff --git a/mcs/build/platforms/win32.make b/mcs/build/platforms/win32.make index 3a98d99a4a9..d5df46e9da8 100644 --- a/mcs/build/platforms/win32.make +++ b/mcs/build/platforms/win32.make @@ -9,7 +9,7 @@ PLATFORM_RUNTIME = PLATFORM_CORLIB = mscorlib.dll PLATFORM_TEST_HARNESS_EXCLUDES = -EXTERNAL_MCS = gmcs +EXTERNAL_MCS = mcs EXTERNAL_MBAS = vbc.exe EXTERNAL_RUNTIME = diff --git a/mcs/build/profiles/basic.make b/mcs/build/profiles/basic.make index 12f6c82cff2..6d9519a60a2 100644 --- a/mcs/build/profiles/basic.make +++ b/mcs/build/profiles/basic.make @@ -18,11 +18,11 @@ endif MCS = $(with_mono_path) $(INTERNAL_GMCS) -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:BOOTSTRAP_BASIC -nowarn:1699 +PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -d:DISABLE_CAS_USE NO_SIGN_ASSEMBLY = yes NO_TEST = yes NO_INSTALL = yes -FRAMEWORK_VERSION = 2.0 +FRAMEWORK_VERSION = 4.0 # Compiler all using same bootstrap compiler LIBRARY_COMPILE = $(BOOT_COMPILE) @@ -65,8 +65,9 @@ do-profile-check: $(depsdir)/.stamp $(MAKE) -s do-profile-check-monolite ; \ else \ echo "*** The compiler '$(BOOTSTRAP_MCS)' doesn't appear to be usable." 1>&2; \ - echo "*** You need Mono version 2.10 or better installed to build MCS" 1>&2 ; \ + echo "*** You need Mono version 3.2 or better installed to build MCS" 1>&2 ; \ echo "*** Check mono README for information on how to bootstrap a Mono installation." 1>&2 ; \ + echo "*** The version of '$(BOOTSTRAP_MCS)' is: `$(BOOTSTRAP_MCS) --version`." 1>&2 ; \ exit 1; fi; fi diff --git a/mcs/build/profiles/build.make b/mcs/build/profiles/build.make index b09a441a03f..b8ba1ce1146 100644 --- a/mcs/build/profiles/build.make +++ b/mcs/build/profiles/build.make @@ -13,10 +13,10 @@ profile-check: @: DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) +PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) NO_SIGN_ASSEMBLY = yes NO_TEST = yes NO_INSTALL = yes -FRAMEWORK_VERSION = 4.0 +FRAMEWORK_VERSION = 4.5 diff --git a/mcs/build/profiles/mobile.make b/mcs/build/profiles/mobile.make index 117ac605151..75611d8cda4 100644 --- a/mcs/build/profiles/mobile.make +++ b/mcs/build/profiles/mobile.make @@ -22,6 +22,8 @@ PROFILE_MCS_FLAGS = \ -d:NET_3_5 \ -d:NET_4_0 \ -d:NET_4_5 \ + -d:MONO \ + -d:DISABLE_CAS_USE \ -nowarn:1699 \ -nostdlib \ -lib:$(topdir)/class/lib/$(PROFILE) \ diff --git a/mcs/build/profiles/mobile_static.make b/mcs/build/profiles/mobile_static.make index b7898235194..2fef29aa96f 100644 --- a/mcs/build/profiles/mobile_static.make +++ b/mcs/build/profiles/mobile_static.make @@ -20,6 +20,8 @@ PROFILE_MCS_FLAGS = \ -d:NET_3_5 \ -d:NET_4_0 \ -d:NET_4_5 \ + -d:MONO \ + -d:DISABLE_CAS_USE \ -d:MOBILE \ -d:FULL_AOT_RUNTIME \ -d:DISABLE_REMOTING \ diff --git a/mcs/build/profiles/monodroid.make b/mcs/build/profiles/monodroid.make index c14f61c6087..28698ca63d6 100644 --- a/mcs/build/profiles/monodroid.make +++ b/mcs/build/profiles/monodroid.make @@ -20,6 +20,8 @@ PROFILE_MCS_FLAGS = \ -d:NET_3_5 \ -d:NET_4_0 \ -d:NET_4_5 \ + -d:MONO \ + -d:DISABLE_CAS_USE \ -d:MOBILE \ -d:MOBILE_DYNAMIC \ -d:MONODROID \ diff --git a/mcs/build/profiles/monotouch.make b/mcs/build/profiles/monotouch.make index 706463d748c..c60d9398ffa 100644 --- a/mcs/build/profiles/monotouch.make +++ b/mcs/build/profiles/monotouch.make @@ -21,6 +21,8 @@ PROFILE_MCS_FLAGS = \ -d:NET_4_0 \ -d:NET_4_5 \ -d:MOBILE \ + -d:MONO \ + -d:DISABLE_CAS_USE \ -d:MONOTOUCH \ -d:DISABLE_REMOTING \ -d:DISABLE_COM \ diff --git a/mcs/build/profiles/monotouch_runtime.make b/mcs/build/profiles/monotouch_runtime.make index f438e805f0d..59c7df4c31c 100644 --- a/mcs/build/profiles/monotouch_runtime.make +++ b/mcs/build/profiles/monotouch_runtime.make @@ -14,7 +14,7 @@ profile-check: @: DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:MONOTOUCH -D:DISABLE_REMOTING -d:DISABLE_COM -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) +PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -d:MOBILE -d:MONOTOUCH -D:DISABLE_REMOTING -d:DISABLE_COM -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) FRAMEWORK_VERSION = 2.1 diff --git a/mcs/build/profiles/net_2_0.make b/mcs/build/profiles/net_2_0.make deleted file mode 100644 index e3be2c83438..00000000000 --- a/mcs/build/profiles/net_2_0.make +++ /dev/null @@ -1,16 +0,0 @@ -# -*- makefile -*- - -BOOTSTRAP_PROFILE = build -BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS) -MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS) - -# nuttzing! - -profile-check: - @: - -DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) - -FRAMEWORK_VERSION = 2.0 -XBUILD_VERSION = 2.0 diff --git a/mcs/build/profiles/net_3_5.make b/mcs/build/profiles/net_3_5.make deleted file mode 100644 index 97176892a4a..00000000000 --- a/mcs/build/profiles/net_3_5.make +++ /dev/null @@ -1,20 +0,0 @@ -# -*- makefile -*- - -BOOTSTRAP_PROFILE = build - -MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS) - -# nuttzing! - -profile-check: - @: - -DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_5 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) -lib:$(topdir)/class/lib/net_2_0 $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) - -FRAMEWORK_VERSION = 3.5 -XBUILD_VERSION = 3.5 - -TEST_HARNESS = $(topdir)/class/lib/net_2_0/nunit-console.exe -TEST_MONO_PATH = $(topdir)/class/lib/net_2_0 - diff --git a/mcs/build/profiles/net_4_0.make b/mcs/build/profiles/net_4_0.make index 99782bd526a..83e22c4dcb0 100644 --- a/mcs/build/profiles/net_4_0.make +++ b/mcs/build/profiles/net_4_0.make @@ -1,22 +1,12 @@ # -*- makefile -*- -BOOTSTRAP_PROFILE = build - -BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS) -MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS) - -# nuttzing! - profile-check: @: -DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) - FRAMEWORK_VERSION = 4.0 XBUILD_VERSION = 4.0 LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION) -# Ignore tests on net_4_0 as the 4.0 IL code is never used for running (just for metadata), so it doesn't make sense to execute tests there +NO_BUILD = yes NO_TEST = yes diff --git a/mcs/build/profiles/net_4_5.make b/mcs/build/profiles/net_4_5.make index ad921e705ea..7c37b2c89d6 100644 --- a/mcs/build/profiles/net_4_5.make +++ b/mcs/build/profiles/net_4_5.make @@ -11,7 +11,7 @@ profile-check: @: DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) +PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) FRAMEWORK_VERSION = 4.5 XBUILD_VERSION = 4.0 diff --git a/mcs/build/profiles/xammac.make b/mcs/build/profiles/xammac.make index d463a0fe943..3a91b7620e2 100644 --- a/mcs/build/profiles/xammac.make +++ b/mcs/build/profiles/xammac.make @@ -18,6 +18,8 @@ PROFILE_MCS_FLAGS = \ -d:NET_3_5 \ -d:NET_4_0 \ -d:NET_4_5 \ + -d:MONO \ + -d:DISABLE_CAS_USE \ -d:MOBILE \ -d:MOBILE_DYNAMIC \ -d:XAMMAC \ diff --git a/mcs/build/profiles/xbuild_12.make b/mcs/build/profiles/xbuild_12.make index d3aff7e92e6..4e0f9940dfe 100644 --- a/mcs/build/profiles/xbuild_12.make +++ b/mcs/build/profiles/xbuild_12.make @@ -2,6 +2,6 @@ include $(topdir)/build/profiles/net_4_5.make -PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -lib:$(topdir)/class/lib/net_4_5 +PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:MONO -d:DISABLE_CAS_USE -lib:$(topdir)/class/lib/net_4_5 XBUILD_VERSION = 12.0 diff --git a/mcs/build/profiles/xbuild_14.make b/mcs/build/profiles/xbuild_14.make new file mode 100644 index 00000000000..eeff4082678 --- /dev/null +++ b/mcs/build/profiles/xbuild_14.make @@ -0,0 +1,7 @@ +# -*- makefile -*- + +include $(topdir)/build/profiles/net_4_5.make + +PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:XBUILD_14 -d:MONO -d:DISABLE_CAS_USE -lib:$(topdir)/class/lib/net_4_5 + +XBUILD_VERSION = 14.0 diff --git a/mcs/class/Accessibility/Accessibility-net_2_0.csproj b/mcs/class/Accessibility/Accessibility-net_2_0.csproj deleted file mode 100644 index af67d345b4f..00000000000 --- a/mcs/class/Accessibility/Accessibility-net_2_0.csproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {43A23ADA-35D9-4A48-BCE5-C21C081C6676} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Accessibility - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/Accessibility/Accessibility-net_4_0.csproj b/mcs/class/Accessibility/Accessibility-net_4_0.csproj deleted file mode 100644 index ca19c093393..00000000000 --- a/mcs/class/Accessibility/Accessibility-net_4_0.csproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0978E130-1E7B-4627-A9CC-7489DB17BFF1} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Accessibility - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - - - - - diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_2_0.csproj b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_2_0.csproj deleted file mode 100644 index 7c109325edf..00000000000 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_2_0.csproj +++ /dev/null @@ -1,128 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2B2412A6-4397-4DA7-94A6-D1AFEBCFA563} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Commons.Xml.Relaxng - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - relaxng.rng - - - - diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_4_0.csproj b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_4_0.csproj deleted file mode 100644 index 7b187121222..00000000000 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_4_0.csproj +++ /dev/null @@ -1,128 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4381A633-26BF-430E-B03B-A83DC8146BF9} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Commons.Xml.Relaxng - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - - relaxng.rng - - - - diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_2_0.csproj b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_2_0.csproj deleted file mode 100644 index 726cbf61cac..00000000000 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_2_0.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0CCD9F77-53C4-4E1A-92C5-0A237C034C00} - Library - 1699,618,219,169 - bin\Debug\Commons.Xml.Relaxng-tests-net_2_0 - True - False - - Properties - - - Commons.Xml.Relaxng_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {2B2412A6-4397-4DA7-94A6-D1AFEBCFA563} - Commons.Xml.Relaxng\Commons.Xml.Relaxng-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - relaxng.rng - - - - diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_4_0.csproj b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_4_0.csproj deleted file mode 100644 index 91ba9f23c9e..00000000000 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_4_0.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {75496501-CA6D-4C97-952E-95DC6F77C523} - Library - 1699,618,219,169 - bin\Debug\Commons.Xml.Relaxng-tests-net_4_0 - True - False - - Properties - - - Commons.Xml.Relaxng_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {4381A633-26BF-430E-B03B-A83DC8146BF9} - Commons.Xml.Relaxng\Commons.Xml.Relaxng-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - - relaxng.rng - - - - diff --git a/mcs/class/Compat.ICSharpCode.SharpZipLib/Compat.ICSharpCode.SharpZipLib-net_2_0.csproj b/mcs/class/Compat.ICSharpCode.SharpZipLib/Compat.ICSharpCode.SharpZipLib-net_2_0.csproj deleted file mode 100644 index 14e8e98dde1..00000000000 --- a/mcs/class/Compat.ICSharpCode.SharpZipLib/Compat.ICSharpCode.SharpZipLib-net_2_0.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8F572B12-CBD2-48F8-8234-41A876C57364} - Library - 1699 - ./../../class/compat/net_2_0 - True - True - - Properties - - - ICSharpCode.SharpZipLib - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/Cscompmgd/Cscompmgd-net_2_0.csproj b/mcs/class/Cscompmgd/Cscompmgd-net_2_0.csproj deleted file mode 100644 index c82899356fa..00000000000 --- a/mcs/class/Cscompmgd/Cscompmgd-net_2_0.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C010783F-1EAC-480C-B1D4-A289426D3F8F} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - cscompmgd - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Cscompmgd/Cscompmgd-net_4_0.csproj b/mcs/class/Cscompmgd/Cscompmgd-net_4_0.csproj deleted file mode 100644 index 0dc073fca40..00000000000 --- a/mcs/class/Cscompmgd/Cscompmgd-net_4_0.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B26893EC-D295-40B7-8AE6-60B3D0F5CBA6} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - cscompmgd - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/Cscompmgd/Cscompmgd-tests-net_2_0.csproj b/mcs/class/Cscompmgd/Cscompmgd-tests-net_2_0.csproj deleted file mode 100644 index 2ecba673b44..00000000000 --- a/mcs/class/Cscompmgd/Cscompmgd-tests-net_2_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B3E7EE0C-3AB6-4578-844E-FF72C5807953} - Library - 1699,618,219,169 - bin\Debug\Cscompmgd-tests-net_2_0 - True - False - - Properties - - - Cscompmgd_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {C010783F-1EAC-480C-B1D4-A289426D3F8F} - Cscompmgd\Cscompmgd-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Cscompmgd/Cscompmgd-tests-net_4_0.csproj b/mcs/class/Cscompmgd/Cscompmgd-tests-net_4_0.csproj deleted file mode 100644 index 2db269e7883..00000000000 --- a/mcs/class/Cscompmgd/Cscompmgd-tests-net_4_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0CD2EF3C-6E4A-4FC5-9D8C-B0CB5E4EE3BF} - Library - 1699,618,219,169 - bin\Debug\Cscompmgd-tests-net_4_0 - True - False - - Properties - - - Cscompmgd_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {B26893EC-D295-40B7-8AE6-60B3D0F5CBA6} - Cscompmgd\Cscompmgd-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/CustomMarshalers/CustomMarshalers-net_2_0.csproj b/mcs/class/CustomMarshalers/CustomMarshalers-net_2_0.csproj deleted file mode 100644 index 367270e3577..00000000000 --- a/mcs/class/CustomMarshalers/CustomMarshalers-net_2_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {81062FC0-B86A-4707-9BC3-F67FDFB47AF4} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - CustomMarshalers - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/CustomMarshalers/CustomMarshalers-net_4_0.csproj b/mcs/class/CustomMarshalers/CustomMarshalers-net_4_0.csproj deleted file mode 100644 index dbc975dfc4e..00000000000 --- a/mcs/class/CustomMarshalers/CustomMarshalers-net_4_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {73865D3C-DCFC-4C7A-8AB5-D8C3CA6DBB42} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - CustomMarshalers - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/I18N/CJK/I18N.CJK-net_2_0.csproj b/mcs/class/I18N/CJK/I18N.CJK-net_2_0.csproj deleted file mode 100644 index 73a2654ab7b..00000000000 --- a/mcs/class/I18N/CJK/I18N.CJK-net_2_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9C753AD5-56C6-46F8-976E-3AD3A4481626} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N.CJK - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - - - - - - big5.table - - - gb2312.table - - - jis.table - - - ks.table - - - gb18030.table - - - - diff --git a/mcs/class/I18N/CJK/I18N.CJK-net_4_0.csproj b/mcs/class/I18N/CJK/I18N.CJK-net_4_0.csproj deleted file mode 100644 index 9b59c9ee1b5..00000000000 --- a/mcs/class/I18N/CJK/I18N.CJK-net_4_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {500EF496-DB58-4EB4-B123-BC09DACE2012} - Library - 1699 - ./../../../class/lib/net_4_0 - True - True - true - Properties - - - I18N.CJK - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {1EBB84BA-DA98-4DE8-B0E5-8F476F3A732E} - Common\I18N-net_4_0 - - - - - - - - big5.table - - - gb2312.table - - - jis.table - - - ks.table - - - gb18030.table - - - - diff --git a/mcs/class/I18N/CJK/I18N.CJK-tests-net_2_0.csproj b/mcs/class/I18N/CJK/I18N.CJK-tests-net_2_0.csproj deleted file mode 100644 index 2f53e5834cb..00000000000 --- a/mcs/class/I18N/CJK/I18N.CJK-tests-net_2_0.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {53F4354D-AEFA-4AB8-AF76-89012BB8FEB3} - Library - 1699 - bin\Debug\I18N.CJK-tests-net_2_0 - True - False - true - Properties - - - I18N.CJK_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - {9C753AD5-56C6-46F8-976E-3AD3A4481626} - CJK\I18N.CJK-net_2_0 - - - - - - - - big5.table - - - gb2312.table - - - jis.table - - - ks.table - - - gb18030.table - - - - diff --git a/mcs/class/I18N/CJK/I18N.CJK-tests-net_4_0.csproj b/mcs/class/I18N/CJK/I18N.CJK-tests-net_4_0.csproj deleted file mode 100644 index fafecafb9b3..00000000000 --- a/mcs/class/I18N/CJK/I18N.CJK-tests-net_4_0.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7D404BC0-DF57-4817-8F9A-A6B91AE6EAE6} - Library - 1699 - bin\Debug\I18N.CJK-tests-net_4_0 - True - False - true - Properties - - - I18N.CJK_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {1EBB84BA-DA98-4DE8-B0E5-8F476F3A732E} - Common\I18N-net_4_0 - - - {500EF496-DB58-4EB4-B123-BC09DACE2012} - CJK\I18N.CJK-net_4_0 - - - - - - - - big5.table - - - gb2312.table - - - jis.table - - - ks.table - - - gb18030.table - - - - diff --git a/mcs/class/I18N/Common/I18N-net_2_0.csproj b/mcs/class/I18N/Common/I18N-net_2_0.csproj deleted file mode 100644 index 4c71f897245..00000000000 --- a/mcs/class/I18N/Common/I18N-net_2_0.csproj +++ /dev/null @@ -1,84 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/Common/I18N-net_4_0.csproj b/mcs/class/I18N/Common/I18N-net_4_0.csproj deleted file mode 100644 index c3462514c79..00000000000 --- a/mcs/class/I18N/Common/I18N-net_4_0.csproj +++ /dev/null @@ -1,84 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1EBB84BA-DA98-4DE8-B0E5-8F476F3A732E} - Library - 1699 - ./../../../class/lib/net_4_0 - True - True - true - Properties - - - I18N - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - - - - - diff --git a/mcs/class/I18N/MidEast/I18N.MidEast-net_2_0.csproj b/mcs/class/I18N/MidEast/I18N.MidEast-net_2_0.csproj deleted file mode 100644 index f02ffb331dc..00000000000 --- a/mcs/class/I18N/MidEast/I18N.MidEast-net_2_0.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {81E84AE7-FF9C-499B-9CA1-02E438C233C6} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N.MidEast - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/MidEast/I18N.MidEast-net_4_0.csproj b/mcs/class/I18N/MidEast/I18N.MidEast-net_4_0.csproj deleted file mode 100644 index 6c332f3707b..00000000000 --- a/mcs/class/I18N/MidEast/I18N.MidEast-net_4_0.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BF6B8C9E-ADAA-4682-BA1D-F01EAE06BA6F} - Library - 1699 - ./../../../class/lib/net_4_0 - True - True - true - Properties - - - I18N.MidEast - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {1EBB84BA-DA98-4DE8-B0E5-8F476F3A732E} - Common\I18N-net_4_0 - - - - - - - diff --git a/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_2_0.csproj b/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_2_0.csproj deleted file mode 100644 index 1a204a27cd1..00000000000 --- a/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_2_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6BC73CD0-ADAF-461D-B190-F1458D439314} - Library - 1699 - bin\Debug\I18N.MidEast-tests-net_2_0 - True - False - true - Properties - - - I18N.MidEast_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - {81E84AE7-FF9C-499B-9CA1-02E438C233C6} - MidEast\I18N.MidEast-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_4_0.csproj b/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_4_0.csproj deleted file mode 100644 index cbeabf92f5d..00000000000 --- a/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_4_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {476F5ACC-F7DF-4EA1-8566-E97D4C839E04} - Library - 1699 - bin\Debug\I18N.MidEast-tests-net_4_0 - True - False - true - Properties - - - I18N.MidEast_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {1EBB84BA-DA98-4DE8-B0E5-8F476F3A732E} - Common\I18N-net_4_0 - - - {BF6B8C9E-ADAA-4682-BA1D-F01EAE06BA6F} - MidEast\I18N.MidEast-net_4_0 - - - - - - - diff --git a/mcs/class/I18N/Other/I18N.Other-net_2_0.csproj b/mcs/class/I18N/Other/I18N.Other-net_2_0.csproj deleted file mode 100644 index 1886f5c00be..00000000000 --- a/mcs/class/I18N/Other/I18N.Other-net_2_0.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F77F18AA-4F63-456F-8FC4-6A2DFD8F9D54} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N.Other - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/Other/I18N.Other-net_4_0.csproj b/mcs/class/I18N/Other/I18N.Other-net_4_0.csproj deleted file mode 100644 index e8f9a8e8611..00000000000 --- a/mcs/class/I18N/Other/I18N.Other-net_4_0.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CC8BF0F1-8799-4639-AFAF-83A89F73E8B9} - Library - 1699 - ./../../../class/lib/net_4_0 - True - True - true - Properties - - - I18N.Other - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {1EBB84BA-DA98-4DE8-B0E5-8F476F3A732E} - Common\I18N-net_4_0 - - - - - - - diff --git a/mcs/class/I18N/Rare/I18N.Rare-net_2_0.csproj b/mcs/class/I18N/Rare/I18N.Rare-net_2_0.csproj deleted file mode 100644 index 0ba3a612cba..00000000000 --- a/mcs/class/I18N/Rare/I18N.Rare-net_2_0.csproj +++ /dev/null @@ -1,118 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {83015125-AD39-4160-B723-677CB4F1EF3D} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N.Rare - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/Rare/I18N.Rare-net_4_0.csproj b/mcs/class/I18N/Rare/I18N.Rare-net_4_0.csproj deleted file mode 100644 index 62866c13d3e..00000000000 --- a/mcs/class/I18N/Rare/I18N.Rare-net_4_0.csproj +++ /dev/null @@ -1,118 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {94F03A2C-5E8D-4FEC-B936-BCF99F97C2DF} - Library - 1699 - ./../../../class/lib/net_4_0 - True - True - true - Properties - - - I18N.Rare - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {1EBB84BA-DA98-4DE8-B0E5-8F476F3A732E} - Common\I18N-net_4_0 - - - - - - - diff --git a/mcs/class/I18N/West/I18N.West-net_2_0.csproj b/mcs/class/I18N/West/I18N.West-net_2_0.csproj deleted file mode 100644 index f877f6d8cfa..00000000000 --- a/mcs/class/I18N/West/I18N.West-net_2_0.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AA988ADC-FBBB-4168-B8E4-83B6C6D543EC} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N.West - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/West/I18N.West-net_4_0.csproj b/mcs/class/I18N/West/I18N.West-net_4_0.csproj deleted file mode 100644 index cab90b7fc5e..00000000000 --- a/mcs/class/I18N/West/I18N.West-net_4_0.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {455087AC-2DB8-46F3-A9CA-35732C90D233} - Library - 1699 - ./../../../class/lib/net_4_0 - True - True - true - Properties - - - I18N.West - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {1EBB84BA-DA98-4DE8-B0E5-8F476F3A732E} - Common\I18N-net_4_0 - - - - - - - diff --git a/mcs/class/I18N/West/I18N.West-tests-net_2_0.csproj b/mcs/class/I18N/West/I18N.West-tests-net_2_0.csproj deleted file mode 100644 index d0558bc6788..00000000000 --- a/mcs/class/I18N/West/I18N.West-tests-net_2_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C1E0F01D-878A-4343-A283-8864D7D8956E} - Library - 1699 - bin\Debug\I18N.West-tests-net_2_0 - True - False - true - Properties - - - I18N.West_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - {AA988ADC-FBBB-4168-B8E4-83B6C6D543EC} - West\I18N.West-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/West/I18N.West-tests-net_4_0.csproj b/mcs/class/I18N/West/I18N.West-tests-net_4_0.csproj deleted file mode 100644 index f04c5764afc..00000000000 --- a/mcs/class/I18N/West/I18N.West-tests-net_4_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {73503F84-B247-40EB-B6BA-58CFEE72F735} - Library - 1699 - bin\Debug\I18N.West-tests-net_4_0 - True - False - true - Properties - - - I18N.West_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {1EBB84BA-DA98-4DE8-B0E5-8F476F3A732E} - Common\I18N-net_4_0 - - - {455087AC-2DB8-46F3-A9CA-35732C90D233} - West\I18N.West-net_4_0 - - - - - - - diff --git a/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_2_0.csproj b/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_2_0.csproj deleted file mode 100644 index ee2f07a91dc..00000000000 --- a/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_2_0.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {47BD9179-658F-4881-85D3-4883B11BCE12} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - IBM.Data.DB2 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - - - - - diff --git a/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_4_0.csproj b/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_4_0.csproj deleted file mode 100644 index 33e59449e0d..00000000000 --- a/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_4_0.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4D194635-F673-40DD-811D-EB0B84F0B44B} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - IBM.Data.DB2 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - - - - - diff --git a/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_2_0.csproj b/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_2_0.csproj deleted file mode 100644 index bd79d3c5b47..00000000000 --- a/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_2_0.csproj +++ /dev/null @@ -1,133 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9E123979-3457-435B-A081-8432EEBA134A} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - ICSharpCode.SharpZipLib - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_4_0.csproj b/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_4_0.csproj deleted file mode 100644 index 193ce3cffae..00000000000 --- a/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_4_0.csproj +++ /dev/null @@ -1,133 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D7EC98B8-2158-4304-9E84-D19D50CE16E8} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - ICSharpCode.SharpZipLib - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - diff --git a/mcs/class/Makefile b/mcs/class/Makefile index 8ca914dca53..dd84b83acda 100644 --- a/mcs/class/Makefile +++ b/mcs/class/Makefile @@ -33,6 +33,7 @@ net_2_0_dirs := \ System.EnterpriseServices \ Mono.Data.Tds \ System.Data \ + System.ComponentModel.DataAnnotations \ Accessibility \ Mono.WebBrowser \ System.Runtime.Serialization.Formatters.Soap \ @@ -81,9 +82,7 @@ net_2_0_dirs := \ System.ServiceModel \ System.Web.Extensions \ System.Web.Extensions.Design \ - System.ComponentModel.DataAnnotations \ System.Web.DynamicData \ - System.Web.Mvc2 \ Mono.C5 \ Mono.Management \ Mono.Options \ @@ -102,7 +101,6 @@ net_2_0_only_dirs := \ System.ServiceModel.Web \ System.Data.Services.Client \ System.Data.Services \ - System.Web.Mvc \ pcl_facade_dirs := Facades @@ -192,11 +190,9 @@ net_4_0_dirs := \ System.Data.Services.Client \ System.Data.Services \ System.Json.Microsoft \ + System.Data.Entity \ monodoc -net_4_0_only_dirs := \ - System.ComponentModel.Composition - net_4_5_dirs := \ System.Threading.Tasks.Dataflow \ System.ComponentModel.Composition.4.5 \ @@ -231,23 +227,22 @@ xbuild_4_0_dirs := \ $(xbuild_2_0_dirs) \ Microsoft.Build -net_2_0_SUBDIRS := $(net_2_0_dirs) $(net_2_0_only_dirs) $(xbuild_2_0_dirs) aot-compiler monodroid_SUBDIRS := $(monodroid_dirs) monotouch_SUBDIRS := $(monotouch_dirs) monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs) mobile_static_SUBDIRS := $(mobile_static_dirs) mobile_SUBDIRS := $(mobile_dynamic_dirs) xammac_SUBDIRS := $(xammac_dirs) -net_3_5_SUBDIRS := $(xbuild_2_0_dirs) -net_4_0_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(xbuild_4_0_dirs) +net_4_0_SUBDIRS := reference-assemblies net_4_5_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_5_dirs) $(xbuild_4_0_dirs) aot-compiler xbuild_12_SUBDIRS := $(xbuild_4_0_dirs) +xbuild_14_SUBDIRS := $(xbuild_4_0_dirs) include ../build/rules.make -SUBDIRS = $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_static_dirs) $(mobile_dynamic_dirs) $(monotouch_dirs) $(monodroid_dirs) $(xammac_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs) +SUBDIRS = $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_static_dirs) $(mobile_dynamic_dirs) $(monotouch_dirs) $(monodroid_dirs) $(xammac_dirs) $(net_4_0_dirs) $(net_4_5_dirs) -DIST_ONLY_SUBDIRS = dlr aot-compiler $(xbuild_4_0_dirs) +DIST_ONLY_SUBDIRS = dlr aot-compiler reference-assemblies $(xbuild_4_0_dirs) # No new makefiles for: System.Messaging, System.Web.Mobile, # System.ServiceProcess diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-net_2_0.csproj b/mcs/class/Managed.Windows.Forms/System.Windows.Forms-net_2_0.csproj deleted file mode 100644 index 2144ea57633..00000000000 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-net_2_0.csproj +++ /dev/null @@ -1,1193 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Library - 1699,618,612,809 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Windows.Forms - v2.0 - 512 - - - true - full - 1699,618,612,809 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,612,809 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {43A23ADA-35D9-4A48-BCE5-C21C081C6676} - Accessibility\Accessibility-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - {F46C8C89-6CD0-432D-8BEF-C962DB694CDB} - Mono.WebBrowser\Mono.WebBrowser-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - - - - - - System.Windows.Forms.SplitterNS.cur - - - System.Windows.Forms.SplitterWE.cur - - - System.Windows.Forms.NESW.cur - - - System.Windows.Forms.NWSE.cur - - - System.Windows.Forms.DnDNo.cur - - - System.Windows.Forms.DnDCopy.cur - - - System.Windows.Forms.DnDLink.cur - - - System.Windows.Forms.DnDMove.cur - - - keyboards.resources - - - 16_computer.png - - - 32_computer.png - - - computer.png - - - 16_document-open.png - - - 32_document-open.png - - - document-open.png - - - 16_folder.png - - - folder-new.png - - - folder.png - - - 16_folder-remote.png - - - 32_folder-remote.png - - - folder-remote.png - - - go-previous.png - - - go-top.png - - - 22_page-magnifier.png - - - preferences-system-windows.png - - - 16_printer.png - - - 32_printer.png - - - text-x-generic.png - - - 16_user-desktop.png - - - 32_user-desktop.png - - - user-desktop.png - - - 16_user-home.png - - - 32_user-home.png - - - user-home.png - - - 16_dialog-error.png - - - 16_dialog-information.png - - - 16_dialog-warning.png - - - 1-up.png - - - 2-up.png - - - 3-up.png - - - 4-up.png - - - 6-up.png - - - nav_delete.png - - - nav_end.png - - - nav_first.png - - - nav_next.png - - - nav_plus.png - - - nav_previous.png - - - image-missing.png - - - image-x-generic.png - - - System.Windows.Forms.propertygrid-alphabetical.png - - - System.Windows.Forms.propertygrid-categorized.png - - - System.Windows.Forms.propertygrid-propertypages.png - - - System.Windows.Forms.Design.EventsTab.bmp - - - System.Windows.Forms.PropertyGridInternal.PropertiesTab.bmp - - - mono.ico - - - errorProvider.ico - - - - diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-net_4_0.csproj b/mcs/class/Managed.Windows.Forms/System.Windows.Forms-net_4_0.csproj deleted file mode 100644 index c6f4ce534b7..00000000000 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-net_4_0.csproj +++ /dev/null @@ -1,1193 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Library - 1699,618,612,809 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - System.Windows.Forms - v4.0 - 512 - - - true - full - 1699,618,612,809 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618,612,809 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {0978E130-1E7B-4627-A9CC-7489DB17BFF1} - Accessibility\Accessibility-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {E9A655D1-EE99-467A-8F4B-CAC80E0E65BE} - Mono.Posix\Mono.Posix-net_4_0 - - - {7CF0E3C1-B971-4B78-8145-976EF6F5287B} - Mono.WebBrowser\Mono.WebBrowser-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {2FDBA71E-A6EC-4247-B0BD-BF7A618C0747} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_4_0 - - - - - - - - System.Windows.Forms.SplitterNS.cur - - - System.Windows.Forms.SplitterWE.cur - - - System.Windows.Forms.NESW.cur - - - System.Windows.Forms.NWSE.cur - - - System.Windows.Forms.DnDNo.cur - - - System.Windows.Forms.DnDCopy.cur - - - System.Windows.Forms.DnDLink.cur - - - System.Windows.Forms.DnDMove.cur - - - keyboards.resources - - - 16_computer.png - - - 32_computer.png - - - computer.png - - - 16_document-open.png - - - 32_document-open.png - - - document-open.png - - - 16_folder.png - - - folder-new.png - - - folder.png - - - 16_folder-remote.png - - - 32_folder-remote.png - - - folder-remote.png - - - go-previous.png - - - go-top.png - - - 22_page-magnifier.png - - - preferences-system-windows.png - - - 16_printer.png - - - 32_printer.png - - - text-x-generic.png - - - 16_user-desktop.png - - - 32_user-desktop.png - - - user-desktop.png - - - 16_user-home.png - - - 32_user-home.png - - - user-home.png - - - 16_dialog-error.png - - - 16_dialog-information.png - - - 16_dialog-warning.png - - - 1-up.png - - - 2-up.png - - - 3-up.png - - - 4-up.png - - - 6-up.png - - - nav_delete.png - - - nav_end.png - - - nav_first.png - - - nav_next.png - - - nav_plus.png - - - nav_previous.png - - - image-missing.png - - - image-x-generic.png - - - System.Windows.Forms.propertygrid-alphabetical.png - - - System.Windows.Forms.propertygrid-categorized.png - - - System.Windows.Forms.propertygrid-propertypages.png - - - System.Windows.Forms.Design.EventsTab.bmp - - - System.Windows.Forms.PropertyGridInternal.PropertiesTab.bmp - - - mono.ico - - - errorProvider.ico - - - - diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-tests-net_2_0.csproj b/mcs/class/Managed.Windows.Forms/System.Windows.Forms-tests-net_2_0.csproj deleted file mode 100644 index e55d9615487..00000000000 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-tests-net_2_0.csproj +++ /dev/null @@ -1,312 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4A3A8DC3-F8A2-47E9-96F5-1C8F7E4C3D77} - Library - 1699,618,612 - bin\Debug\System.Windows.Forms-tests-net_2_0 - True - False - - Properties - - - System.Windows.Forms_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,612 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,612 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {43A23ADA-35D9-4A48-BCE5-C21C081C6676} - Accessibility\Accessibility-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - - - - - - a.cur - - - 32x32.ico - - - - diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-tests-net_4_0.csproj b/mcs/class/Managed.Windows.Forms/System.Windows.Forms-tests-net_4_0.csproj deleted file mode 100644 index d82a113b41a..00000000000 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-tests-net_4_0.csproj +++ /dev/null @@ -1,312 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D2C4D760-69DE-45C3-B255-DFF26EC4A99B} - Library - 1699,618,612 - bin\Debug\System.Windows.Forms-tests-net_4_0 - True - False - - Properties - - - System.Windows.Forms_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618,612 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618,612 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Managed.Windows.Forms\System.Windows.Forms-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {0978E130-1E7B-4627-A9CC-7489DB17BFF1} - Accessibility\Accessibility-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {2FDBA71E-A6EC-4247-B0BD-BF7A618C0747} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_4_0 - - - - - - - - a.cur - - - 32x32.ico - - - - diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/TableLayout.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/TableLayout.cs index 98b16b4bcdd..7d306658c6f 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/TableLayout.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/TableLayout.cs @@ -368,7 +368,20 @@ namespace System.Windows.Forms.Layout } if (total_width > 0) - panel.column_widths[col_styles.Count - 1] += total_width; + { + // Find the last column that isn't an Absolute SizeType, and give it + // all this free space. (Absolute sized columns need to retain their + // absolute width if at all possible!) + int col = col_styles.Count - 1; + for (; col >= 0; --col) + { + if (col_styles[col].SizeType != SizeType.Absolute) + break; + } + if (col < 0) + col = col_styles.Count - 1; + panel.column_widths[col] += total_width; + } // Figure up all the row heights int total_height = parentDisplayRectangle.Height - (border_width * (rows + 1)); @@ -464,7 +477,20 @@ namespace System.Windows.Forms.Layout } if (total_height > 0) - panel.row_heights[row_styles.Count - 1] += total_height; + { + // Find the last row that isn't an Absolute SizeType, and give it + // all this free space. (Absolute sized rows need to retain their + // absolute height if at all possible!) + int row = row_styles.Count - 1; + for (; row >= 0; --row) + { + if (row_styles[row].SizeType != SizeType.Absolute) + break; + } + if (row < 0) + row = row_styles.Count - 1; + panel.row_heights[row] += total_height; + } } private void LayoutControls (TableLayoutPanel panel) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs index 393d5cba9ae..3ce4ab7b574 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs @@ -5133,7 +5133,17 @@ namespace System.Windows.Forms { SetSelectedRowCore (rowIndex, false); } - if (Rows.Count - e.RowCount <= 0) { + int RowsLeft = Rows.Count - e.RowCount; + if (RowsLeft < 0) + RowsLeft = 0; + + if (first_row_index > RowsLeft - 1) + first_row_index = RowsLeft - 1; + + if (first_row_index < 0) + first_row_index = 0; + + if (RowsLeft == 0) { MoveCurrentCell (-1, -1, true, false, false, true); hover_cell = null; } else if (Columns.Count == 0) { @@ -5141,8 +5151,8 @@ namespace System.Windows.Forms { hover_cell = null; } else if (currentCell != null && currentCell.RowIndex == e.RowIndex) { int nextRowIndex = e.RowIndex; - if (nextRowIndex >= Rows.Count - e.RowCount) - nextRowIndex = Rows.Count - 1 - e.RowCount; + if (nextRowIndex >= RowsLeft) + nextRowIndex = RowsLeft - 1; MoveCurrentCell (currentCell != null ? currentCell.ColumnIndex : 0, nextRowIndex, true, false, false, true); if (hover_cell != null && hover_cell.RowIndex >= e.RowIndex) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs index 8261f1f8756..24aa28797ba 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs @@ -261,14 +261,14 @@ namespace System.Windows.Forms for (int i = 0; i < total; i++) { DataGridViewRow row = (DataGridViewRow)list[0]; - + row.SetIndex(0); + // We can exit because the NewRow is always last if (row.IsNewRow) break; row.SetDataGridView (null); list.Remove (row); - ReIndex (); } DataGridView.OnRowsPostRemovedInternal (new DataGridViewRowsRemovedEventArgs (0, total)); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs index 3af4684710a..1087563b16a 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs @@ -1031,6 +1031,7 @@ namespace System.Windows.Forms virtual_list_size = value; if (virtual_mode) { + focused_item_index = -1; selected_indices.Reset (); Redraw (true); } @@ -2670,6 +2671,12 @@ namespace System.Windows.Forms clicked_item.Selected = true; } + // Side-effects of changing the selection can possibly result in ItemsMouseUp() being called and + // and clicked_item being set to null. (See Xamarin bug 23591.) In such a case, assume + // that there's nothing more we can do here. + if (clicked_item == null) + return; + if (owner.VirtualMode && changed) { // Broken event - It's not fired from Item.Selected also ListViewVirtualItemsSelectionRangeChangedEventArgs args = diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs index 4d7ef78c919..23c0534d856 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs @@ -817,6 +817,12 @@ namespace System.Windows.Forms { else SelectedIndex = (SelectedIndex + TabCount - 1) % TabCount; ke.Handled = true; + } else if (ke.KeyCode == Keys.PageUp && (ke.KeyData & Keys.Control) != 0) { + SelectedIndex = (SelectedIndex + TabCount - 1) % TabCount; + ke.Handled = true; + } else if (ke.KeyCode == Keys.PageDown && (ke.KeyData & Keys.Control) != 0) { + SelectedIndex = (SelectedIndex + 1) % TabCount; + ke.Handled = true; } else if (ke.KeyCode == Keys.Home) { SelectedIndex = 0; ke.Handled = true; diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutPanel.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutPanel.cs index e288bf879a9..4ba18553c3c 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutPanel.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TableLayoutPanel.cs @@ -28,6 +28,7 @@ using System; using System.Drawing; +using System.Collections.Generic; using System.ComponentModel; using System.Runtime.InteropServices; using System.Windows.Forms.Layout; @@ -514,29 +515,67 @@ namespace System.Windows.Forms int actual_cols = actual_positions.GetLength (0); int actual_rows = actual_positions.GetLength (1); + // Find the largest column-span/row-span values. A table entry that spans more than one + // column (row) should not be treated as though it's width (height) all belongs to the + // first column (row), but should be spread out across all the columns (rows) that are + // spanned. So we need to keep track of the widths (heights) of spans as well as + // individual columns (rows). + int max_colspan = 1, max_rowspan = 1; + foreach (Control c in Controls) + { + max_colspan = Math.Max(max_colspan, GetColumnSpan(c)); + max_rowspan = Math.Max(max_rowspan, GetRowSpan(c)); + } + // Figure out how wide the owner needs to be int[] column_widths = new int[actual_cols]; + // Keep track of widths for spans as well as columns. column_span_widths[i,j] stores + // the maximum width for items column i than have a span of j+1 (ie, covers columns + // i through i+j). + int[,] column_span_widths = new int[actual_cols, max_colspan]; + int[] biggest = new int[max_colspan]; float total_column_percentage = 0f; - // Figure out how tall each column wants to be + // Figure out how wide each column wants to be for (int i = 0; i < actual_cols; i++) { if (i < ColumnStyles.Count && ColumnStyles[i].SizeType == SizeType.Percent) total_column_percentage += ColumnStyles[i].Width; - - int biggest = 0; + int absolute_width = -1; + if (i < ColumnStyles.Count && ColumnStyles[i].SizeType == SizeType.Absolute) + absolute_width = (int)ColumnStyles[i].Width; // use the absolute width if it's absolute! + + for (int s = 0; s < max_colspan; ++s) + biggest[s] = 0; for (int j = 0; j < actual_rows; j++) { Control c = actual_positions[i, j]; if (c != null) { - if (!c.AutoSize) - biggest = Math.Max (biggest, c.ExplicitBounds.Width + c.Margin.Horizontal + Padding.Horizontal); + int colspan = GetColumnSpan (c); + if (colspan == 0) + continue; + if (colspan == 1 && absolute_width > -1) + biggest[0] = absolute_width; // use the absolute width if the column has absolute width assigned! + else if (!c.AutoSize) + biggest[colspan-1] = Math.Max (biggest[colspan-1], c.ExplicitBounds.Width + c.Margin.Horizontal + Padding.Horizontal); else - biggest = Math.Max (biggest, c.PreferredSize.Width + c.Margin.Horizontal + Padding.Horizontal); + biggest[colspan-1] = Math.Max (biggest[colspan-1], c.PreferredSize.Width + c.Margin.Horizontal + Padding.Horizontal); + } + else if (absolute_width > -1) { + biggest[0] = absolute_width; } } - column_widths[i] = biggest; + for (int s = 0; s < max_colspan; ++s) + column_span_widths[i,s] = biggest[s]; + } + + for (int i = 0; i < actual_cols; ++i) { + for (int s = 1; s < max_colspan; ++s) { + if (column_span_widths[i,s] > 0) + AdjustWidthsForSpans (column_span_widths, i, s); + } + column_widths[i] = column_span_widths[i,0]; } // Because percentage based rows divy up the remaining space, @@ -552,30 +591,55 @@ namespace System.Windows.Forms non_percent_total_width += column_widths[i]; } + int border_width = GetCellBorderWidth (CellBorderStyle); + int needed_width = non_percent_total_width + percent_total_width + (border_width * (actual_cols + 1)); // Figure out how tall the owner needs to be int[] row_heights = new int[actual_rows]; + int[,] row_span_heights = new int[actual_rows, max_rowspan]; + biggest = new int[max_rowspan]; float total_row_percentage = 0f; // Figure out how tall each row wants to be for (int j = 0; j < actual_rows; j++) { if (j < RowStyles.Count && RowStyles[j].SizeType == SizeType.Percent) total_row_percentage += RowStyles[j].Height; + int absolute_height = -1; + if (j < RowStyles.Count && RowStyles[j].SizeType == SizeType.Absolute) + absolute_height = (int)RowStyles[j].Height; // use the absolute height if it's absolute! - int biggest = 0; + for (int s = 0; s < max_rowspan; ++s) + biggest[s] = 0; for (int i = 0; i < actual_cols; i++) { Control c = actual_positions[i, j]; if (c != null) { - if (!c.AutoSize) - biggest = Math.Max (biggest, c.ExplicitBounds.Height + c.Margin.Vertical + Padding.Vertical); + int rowspan = GetRowSpan (c); + if (rowspan == 0) + continue; + if (rowspan == 1 && absolute_height > -1) + biggest[0] = absolute_height; // use the absolute height if the row has absolute height assigned! + else if (!c.AutoSize) + biggest[rowspan-1] = Math.Max (biggest[rowspan-1], c.ExplicitBounds.Height + c.Margin.Vertical + Padding.Vertical); else - biggest = Math.Max (biggest, c.PreferredSize.Height + c.Margin.Vertical + Padding.Vertical); + biggest[rowspan-1] = Math.Max (biggest[rowspan-1], c.PreferredSize.Height + c.Margin.Vertical + Padding.Vertical); + } + else if (absolute_height > -1) { + biggest[0] = absolute_height; } } - row_heights[j] = biggest; + for (int s = 0; s < max_rowspan; ++s) + row_span_heights[j,s] = biggest[s]; + } + + for (int j = 0; j < actual_rows; ++j) { + for (int s = 1; s < max_rowspan; ++s) { + if (row_span_heights[j,s] > 0) + AdjustHeightsForSpans (row_span_heights, j, s); + } + row_heights[j] = row_span_heights[j,0]; } // Because percentage based rows divy up the remaining space, @@ -591,8 +655,111 @@ namespace System.Windows.Forms non_percent_total_height += row_heights[j]; } - int border_width = GetCellBorderWidth (CellBorderStyle); - return new Size (non_percent_total_width + percent_total_width + (border_width * (actual_cols + 1)), non_percent_total_height + percent_total_height + (border_width * (actual_rows + 1))); + int needed_height = non_percent_total_height + percent_total_height + (border_width * (actual_rows + 1)); + + return new Size (needed_width, needed_height); + } + + /// + /// Adjust the widths of the columns underlying a span if necessary. + /// + private void AdjustWidthsForSpans (int[,] widths, int col, int span) + { + // Get the combined width of the columns underlying the span. + int existing_width = 0; + for (int i = col; i <= col+span; ++i) + existing_width += widths[i,0]; + if (widths[col,span] > existing_width) + { + // We need to expand one or more of the underlying columns to fit the span, + // preferably ones that are not Absolute style. + int excess = widths[col,span] - existing_width; + int remaining = excess; + List adjusting = new List(); + List adjusting_widths = new List(); + for (int i = col; i <= col+span; ++i) { + if (i < ColumnStyles.Count && ColumnStyles[i].SizeType != SizeType.Absolute) { + adjusting.Add(i); + adjusting_widths.Add((float)widths[i,0]); + } + } + if (adjusting.Count == 0) { + // if every column is Absolute, spread the gain across every column + for (int i = col; i <= col+span; ++i) { + adjusting.Add(i); + adjusting_widths.Add((float)widths[i,0]); + } + } + float original_total = 0f; + foreach (var w in adjusting_widths) + original_total += w; + // Divide up the needed additional width proportionally. + for (int i = 0; i < adjusting.Count; ++i) { + var idx = adjusting[i]; + var percent = adjusting_widths[i] / original_total; + var adjust = (int)(percent * excess); + widths[idx,0] += adjust; + remaining -= adjust; + } + // Any remaining fragment (1 or 2 pixels?) is divided evenly. + while (remaining > 0) { + for (int i = 0; i < adjusting.Count && remaining > 0; ++i) { + ++widths[adjusting[i],0]; + --remaining; + } + } + } + } + + /// + /// Adjust the heights of the rows underlying a span if necessary. + /// + private void AdjustHeightsForSpans (int[,] heights, int row, int span) + { + // Get the combined height of the rows underlying the span. + int existing_height = 0; + for (int i = row; i <= row+span; ++i) + existing_height += heights[i,0]; + if (heights[row,span] > existing_height) + { + // We need to expand one or more of the underlying rows to fit the span, + // preferably ones that are not Absolute style. + int excess = heights[row,span] - existing_height; + int remaining = excess; + List adjusting = new List(); + List adjusting_heights = new List(); + for (int i = row; i <= row+span; ++i) { + if (i < RowStyles.Count && RowStyles[i].SizeType != SizeType.Absolute) { + adjusting.Add(i); + adjusting_heights.Add((float)heights[i,0]); + } + } + if (adjusting.Count == 0) { + // if every row is Absolute, spread the gain across every row + for (int i = row; i <= row+span; ++i) { + adjusting.Add(i); + adjusting_heights.Add((float)heights[i,0]); + } + } + float original_total = 0f; + foreach (var w in adjusting_heights) + original_total += w; + // Divide up the needed additional height proportionally. + for (int i = 0; i < adjusting.Count; ++i) { + var idx = adjusting[i]; + var percent = adjusting_heights[i] / original_total; + var adjust = (int)(percent * excess); + heights[idx,0] += adjust; + remaining -= adjust; + } + // Any remaining fragment (1 or 2 pixels?) is divided evenly. + while (remaining > 0) { + for (int i = 0; i < adjusting.Count && remaining > 0; ++i) { + ++heights[adjusting[i],0]; + --remaining; + } + } + } } #endregion diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs index d6214c5e93b..7180bd30969 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs @@ -369,7 +369,7 @@ namespace System.Windows.Forms Image image = button.Image; string text = button.Text; Rectangle content_rect = button.PaddingClientRectangle; - Size text_size = TextRenderer.MeasureTextInternal (g, text, button.Font, content_rect.Size, button.TextFormatFlags | TextFormatFlags.NoPadding, button.UseCompatibleTextRendering); + Size text_size = TextRenderer.MeasureTextInternal (g, text, button.Font, content_rect.Size, button.TextFormatFlags, button.UseCompatibleTextRendering); Size image_size = image == null ? Size.Empty : image.Size; textRectangle = Rectangle.Inflate (content_rect, -4, -4); @@ -545,8 +545,11 @@ namespace System.Windows.Forms var textHeight = excess_height >= 0 ? totalArea.Height - final_image_rect.Height : textSize.Height; final_text_rect = new Rectangle (AlignInRectangle (totalArea, textSize, textAlign).Left, final_image_rect.Bottom + element_spacing, textSize.Width, textHeight); - if (final_text_rect.Bottom > totalArea.Bottom) - final_text_rect.Y = totalArea.Top; + if (final_text_rect.Bottom > totalArea.Bottom) { + final_text_rect.Y -= (final_text_rect.Bottom - totalArea.Bottom); + if (final_text_rect.Y < totalArea.Top) + final_text_rect.Y = totalArea.Top; + } } if (displayEllipsis) { diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs index 30c0d89f5fb..6cfe4b2ecf8 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs @@ -1145,13 +1145,7 @@ namespace System.Windows.Forms if (tsi.Enabled && tsi.Visible && !string.IsNullOrEmpty (tsi.Text) && Control.IsMnemonic (charCode, tsi.Text)) return tsi.ProcessMnemonic (charCode); - string code = Char.ToUpper (charCode).ToString (); - - // If any item's text starts with our letter, it gets the message - if ((Control.ModifierKeys & Keys.Alt) != 0 || this is ToolStripDropDownMenu) - foreach (ToolStripItem tsi in this.Items) - if (tsi.Enabled && tsi.Visible && !string.IsNullOrEmpty (tsi.Text) && tsi.Text.ToUpper ().StartsWith (code) && !(tsi is ToolStripControlHost)) - return tsi.ProcessMnemonic (charCode); + // Do not try to match any further here. See Xamarin bug 23532. return base.ProcessMnemonic (charCode); } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs index 34102f4e924..c9fd272e24e 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs @@ -1632,14 +1632,14 @@ namespace System.Windows.Forms image_rect = AlignInRectangle (contentRectangle, GetImageSize (), this.image_align); break; case TextImageRelation.ImageAboveText: - text_area = new Rectangle (contentRectangle.Left, contentRectangle.Bottom - (text_size.Height - 4), contentRectangle.Width, text_size.Height - 4); + text_area = new Rectangle (contentRectangle.Left, contentRectangle.Bottom - text_size.Height, contentRectangle.Width, text_size.Height); image_area = new Rectangle (contentRectangle.Left, contentRectangle.Top, contentRectangle.Width, contentRectangle.Height - text_area.Height); text_rect = AlignInRectangle (text_area, this.text_size, this.text_align); image_rect = AlignInRectangle (image_area, GetImageSize (), this.image_align); break; case TextImageRelation.TextAboveImage: - text_area = new Rectangle (contentRectangle.Left, contentRectangle.Top, contentRectangle.Width, text_size.Height - 4); + text_area = new Rectangle (contentRectangle.Left, contentRectangle.Top, contentRectangle.Width, text_size.Height); image_area = new Rectangle (contentRectangle.Left, text_area.Bottom, contentRectangle.Width, contentRectangle.Height - text_area.Height); text_rect = AlignInRectangle (text_area, this.text_size, this.text_align); diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/.gitattributes b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/.gitattributes index ace0846b846..7dca390e2f1 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/.gitattributes +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/.gitattributes @@ -16,7 +16,7 @@ /SendKeysTest.cs -crlf /SplitContainerTests.cs -crlf /StatusStripTest.cs -crlf -/TableLayoutTest.cs -crlf +/TableLayoutTest.cs -crlf -whitespace /TimerTest.cs -crlf /ToolStripContainerTest.cs -crlf /ToolStripContentPanelTest.cs -crlf diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs index 666bd7a6fec..e973b2b9232 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs @@ -2569,6 +2569,42 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual (30, dgv.Rows [0].MinimumHeight); } } + + [Test] // Xamarin bug #24372 + public void Bug24372_first_row_index () + { + Form form = new Form (); + DataGridView24372 dgv = new DataGridView24372 (); + dgv.Parent = form; + dgv.ColumnCount = 1; + dgv.RowCount = 100; + dgv.CurrentCell = dgv[0,50]; + dgv.Focus (); + form.Show (); + + dgv.Rows.Clear (); + form.Refresh (); + Application.DoEvents (); + + if (dgv.HasException) + Assert.Fail("#A1"); + + form.Dispose (); + } + + class DataGridView24372 : DataGridView + { + public bool HasException { get; private set; } + protected override void OnPaint (PaintEventArgs e) + { + HasException = false; + try { + base.OnPaint(e); + } catch (ArgumentOutOfRangeException ex) { + HasException = true; + } + } + } } [TestFixture] diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TableLayoutTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TableLayoutTest.cs index feb07392244..2d5ad06b067 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TableLayoutTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TableLayoutTest.cs @@ -1672,6 +1672,55 @@ namespace MonoTests.System.Windows.Forms tlp.LayoutSettings = tls; // Should not throw an exception } } + + [Test] + public void XamarinBug18638 () + { + // Spanning items should not have their entire width assigned to the first column in the span. + TableLayoutPanel tlp = new TableLayoutPanel (); + tlp.SuspendLayout (); + tlp.Size = new Size(291, 100); + tlp.AutoSize = true; + tlp.ColumnStyles.Add (new ColumnStyle (SizeType.Absolute, 60)); + tlp.ColumnStyles.Add (new ColumnStyle (SizeType.Percent, 100)); + tlp.ColumnStyles.Add (new ColumnStyle (SizeType.Absolute, 45)); + tlp.ColumnCount = 3; + tlp.RowStyles.Add (new RowStyle (SizeType.AutoSize)); + var label1 = new Label {AutoSize = true, Text = @"This line spans all three columns in the table!"}; + tlp.Controls.Add (label1, 0, 0); + tlp.SetColumnSpan (label1, 3); + tlp.RowStyles.Add (new RowStyle (SizeType.AutoSize)); + tlp.RowCount = 1; + var label2 = new Label {AutoSize = true, Text = @"This line spans columns two and three."}; + tlp.Controls.Add (label2, 1, 1); + tlp.SetColumnSpan (label2, 2); + tlp.RowCount = 2; + AddTableRow (tlp, "First Row", "This is a test"); + AddTableRow (tlp, "Row 2", "This is another test"); + tlp.ResumeLayout (); + + var widths = tlp.GetColumnWidths (); + Assert.AreEqual (4, tlp.RowCount, "X18638-1"); + Assert.AreEqual (3, tlp.ColumnCount, "X18638-2"); + Assert.AreEqual (60, widths[0], "X18638-3"); + Assert.Greater (label2.Width, widths[1], "X18638-5"); + Assert.AreEqual (45, widths[2], "X18638-4"); + } + + private void AddTableRow(TableLayoutPanel tlp, string label, string text) + { + tlp.SuspendLayout (); + int row = tlp.RowCount; + tlp.RowStyles.Add (new RowStyle (SizeType.AutoSize)); + var first = new Label {AutoSize = true, Dock = DockStyle.Fill, Text = label}; + tlp.Controls.Add (first, 0, row); + var second = new TextBox {AutoSize = true, Text = text, Dock = DockStyle.Fill, Multiline = true}; + tlp.Controls.Add (second, 1, row); + var third = new Button {Text = @"DEL", Dock = DockStyle.Fill}; + tlp.Controls.Add (third, 2, row); + tlp.RowCount = row + 1; + tlp.ResumeLayout (); + } } } #endif diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs index 25c04e1aab3..ea0d322b3a6 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs @@ -560,11 +560,13 @@ namespace Microsoft.Build.BuildEngine { get { // This is used as the fall back version if the // project can't find a version to use - // Hard-coded to 2.0, so it allows even vs2005 projects - // to build correctly, as they won't have a ToolsVersion - // set! return String.IsNullOrEmpty (defaultToolsVersion) - ? "2.0" + ? +#if NET_4_0 + "4.0" +#else + "2.0" +#endif : defaultToolsVersion; } set { diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_2_0.csproj b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_2_0.csproj deleted file mode 100644 index c0b32ab9202..00000000000 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_2_0.csproj +++ /dev/null @@ -1,169 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6A56A8BD-4228-4865-8112-9D31C6829638} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Microsoft.Build.Engine - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_4_0.csproj b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_4_0.csproj deleted file mode 100644 index 02437dd5a47..00000000000 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_4_0.csproj +++ /dev/null @@ -1,169 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4E55B240-B470-43B4-ABDA-8C03E7B1BF8E} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Microsoft.Build.Engine - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {7A96CB43-304B-417C-AAB3-C096E48DAE70} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_0 - - - {98DC1B90-280C-4A1B-A834-9D5143840323} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_4_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_2_0.csproj b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_2_0.csproj deleted file mode 100644 index d08f9a6e6d9..00000000000 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_2_0.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {750EAC81-53A4-41F4-9713-16B07578B170} - Library - 1699 - bin\Debug\Microsoft.Build.Engine-tests-net_2_0 - True - False - - Properties - - - Microsoft.Build.Engine_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {6A56A8BD-4228-4865-8112-9D31C6829638} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_2_0 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_4_0.csproj b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_4_0.csproj deleted file mode 100644 index dec70cc0689..00000000000 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_4_0.csproj +++ /dev/null @@ -1,118 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {610DE398-8F0E-4857-A600-17773B98E457} - Library - 1699 - bin\Debug\Microsoft.Build.Engine-tests-net_4_0 - True - False - - Properties - - - Microsoft.Build.Engine_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - xcopy $(TargetName).* $(ProjectDir)..\lib\net_4_0\ /Y /R /D - - - - - - {3874F10B-9AE4-4A7E-873B-42FFDCE80CB7} - corlib\corlib-net_4_0 - - - {9B0AC297-CB85-43C1-8C18-12997CF1B78D} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_4_0 - - - {1D4BCF4D-31D1-4F92-A2B2-D9E41A640649} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_0 - - - {A20F004B-16AC-44DE-A14E-2C2B5E9F72BE} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_4_0 - - - {51720A26-B4D9-4B84-8CB5-9CBA57477FBB} - System.XML\System.Xml-net_4_0-1 - - - - - - diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs index 8db3be70a9d..e17d6dc53e5 100644 --- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/Consts.cs @@ -39,7 +39,9 @@ public static class Consts { public static string BinPath { get { if (RunningOnMono ()) { -#if XBUILD_12 +#if XBUILD_14 + string profile = "xbuild_14"; +#elif XBUILD_12 string profile = "xbuild_12"; #elif NET_4_5 string profile = "net_4_5"; @@ -54,7 +56,9 @@ public static class Consts { var lib = Path.GetDirectoryName (Path.GetDirectoryName (corlib)); return Path.Combine (lib, profile); } else { -#if XBUILD_12 +#if XBUILD_14 + return ToolLocationHelper.GetPathToBuildTools ("14.0"); +#elif XBUILD_12 return ToolLocationHelper.GetPathToBuildTools ("12.0"); #elif NET_4_5 return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version45); @@ -71,7 +75,9 @@ public static class Consts { public static string ToolsVersionString { get { -#if XBUILD_12 +#if XBUILD_14 + return " ToolsVersion='14.0'"; +#elif XBUILD_12 return " ToolsVersion='12.0'"; #elif NET_4_0 return " ToolsVersion='4.0'"; @@ -85,7 +91,9 @@ public static class Consts { public static string GetTasksAsmPath () { -#if XBUILD_12 +#if XBUILD_14 + return Path.Combine (BinPath, "Microsoft.Build.Tasks.Core.dll"); +#elif XBUILD_12 return Path.Combine (BinPath, "Microsoft.Build.Tasks.v12.0.dll"); #elif NET_4_0 return Path.Combine (BinPath, "Microsoft.Build.Tasks.v4.0.dll"); diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_2_0.csproj b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_2_0.csproj deleted file mode 100644 index 1dfa4fa99e6..00000000000 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_2_0.csproj +++ /dev/null @@ -1,141 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Microsoft.Build.Framework - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_4_0.csproj b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_4_0.csproj deleted file mode 100644 index e0e3fc5088b..00000000000 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_4_0.csproj +++ /dev/null @@ -1,141 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7A96CB43-304B-417C-AAB3-C096E48DAE70} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Microsoft.Build.Framework - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_2_0.csproj b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_2_0.csproj deleted file mode 100644 index a3322ae3c5b..00000000000 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_2_0.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F8559E0C-7D86-40C4-B481-5B71DC1DBE8F} - Library - 1699 - bin\Debug\Microsoft.Build.Framework-tests-net_2_0 - True - False - - Properties - - - Microsoft.Build.Framework_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_4_0.csproj b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_4_0.csproj deleted file mode 100644 index 7c6585fe5d5..00000000000 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_4_0.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1ADD07F3-3897-4865-888E-BD37F1B55EBD} - Library - 1699 - bin\Debug\Microsoft.Build.Framework-tests-net_4_0 - True - False - - Properties - - - Microsoft.Build.Framework_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {7A96CB43-304B-417C-AAB3-C096E48DAE70} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_2_0.csproj b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_2_0.csproj deleted file mode 100644 index 9bee01e65f4..00000000000 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_2_0.csproj +++ /dev/null @@ -1,225 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9EF938FF-4761-414A-B1BA-0A9645CAA14A} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Microsoft.Build.Tasks - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_2_0 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - {6A56A8BD-4228-4865-8112-9D31C6829638} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_2_0 - - - {8C54606D-305D-45B0-9932-380FE021BEFE} - Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_0.csproj b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_0.csproj deleted file mode 100644 index 945fdf7d885..00000000000 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_0.csproj +++ /dev/null @@ -1,225 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5832CC3F-D152-43B4-AE8B-E922F8024171} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Microsoft.Build.Tasks.v4.0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Managed.Windows.Forms\System.Windows.Forms-net_4_0 - - - {98DC1B90-280C-4A1B-A834-9D5143840323} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_4_0 - - - {7A96CB43-304B-417C-AAB3-C096E48DAE70} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_0 - - - {4E55B240-B470-43B4-ABDA-8C03E7B1BF8E} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_4_0 - - - {B8993C2D-04FD-4738-91ED-060E29A5FBD4} - Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_4_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_2_0.csproj b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_2_0.csproj deleted file mode 100644 index dd207b0066f..00000000000 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_2_0.csproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DEC22ED1-001B-4849-8F68-105493B5CBE3} - Library - 1699 - bin\Debug\Microsoft.Build.Tasks-tests-net_2_0 - True - False - - Properties - - - Microsoft.Build.Tasks_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {9EF938FF-4761-414A-B1BA-0A9645CAA14A} - Microsoft.Build.Tasks\Microsoft.Build.Tasks-net_2_0 - - - {6A56A8BD-4228-4865-8112-9D31C6829638} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_2_0 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - {8C54606D-305D-45B0-9932-380FE021BEFE} - Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_2_0 - - - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_4_0.csproj b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_4_0.csproj deleted file mode 100644 index f843f417aa5..00000000000 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_4_0.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E3E93786-14F7-41DE-AFBB-20912C970ED8} - Library - 1699 - bin\Debug\Microsoft.Build.Tasks-tests-net_4_0 - True - False - - Properties - - - Microsoft.Build.Tasks_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - xcopy $(TargetName).* $(ProjectDir)..\lib\net_4_0\ /Y /R /D - - - - - - {3874F10B-9AE4-4A7E-873B-42FFDCE80CB7} - corlib\corlib-net_4_0 - - - {0F2C25D7-DF2E-4F4B-85D8-7EFC4DCD3B0C} - Microsoft.Build.Tasks\Microsoft.Build.Tasks-net_4_0 - - - {9B0AC297-CB85-43C1-8C18-12997CF1B78D} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_4_0 - - - {1D4BCF4D-31D1-4F92-A2B2-D9E41A640649} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_0 - - - {A20F004B-16AC-44DE-A14E-2C2B5E9F72BE} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_4_0 - - - {D121EB80-19C6-4313-9BBE-6F66556CE8B7} - System.Core\System.Core-net_4_0 - - - - - - diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs index 272a6f0056a..6e969a0d766 100644 --- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs +++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs @@ -319,7 +319,7 @@ namespace MonoTests.Microsoft.Build.Tasks { Assert.AreEqual (FileAttributes.ReadOnly, File.GetAttributes (target_file), "A1"); string documentString = @" - + " + target_file + @" 1 diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_2_0.csproj b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_2_0.csproj deleted file mode 100644 index 27ff84c2244..00000000000 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_2_0.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Microsoft.Build.Utilities - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_4_0.csproj b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_4_0.csproj deleted file mode 100644 index 264dc23f24c..00000000000 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_4_0.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {98DC1B90-280C-4A1B-A834-9D5143840323} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Microsoft.Build.Utilities.v4.0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {7A96CB43-304B-417C-AAB3-C096E48DAE70} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_2_0.csproj b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_2_0.csproj deleted file mode 100644 index 0b497e46ad5..00000000000 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_2_0.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C6AD8AA6-5A1A-4430-99E0-CAB47FB7844B} - Library - 1699 - bin\Debug\Microsoft.Build.Utilities-tests-net_2_0 - True - False - - Properties - - - Microsoft.Build.Utilities_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_2_0 - - - False - ./../../class/lib/net_2_0/Microsoft.Build.Engine.dll - False - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_4_0.csproj b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_4_0.csproj deleted file mode 100644 index 75bb369e7ed..00000000000 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_4_0.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {52AF96F7-968E-4D90-AD5F-A5F2B7E187AE} - Library - 1699 - bin\Debug\Microsoft.Build.Utilities-tests-net_4_0 - True - False - - Properties - - - Microsoft.Build.Utilities_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - xcopy $(TargetName).* $(ProjectDir)..\lib\net_4_0\ /Y /R /D - - - - - - {3874F10B-9AE4-4A7E-873B-42FFDCE80CB7} - corlib\corlib-net_4_0 - - - {A20F004B-16AC-44DE-A14E-2C2B5E9F72BE} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_4_0 - - - {1D4BCF4D-31D1-4F92-A2B2-D9E41A640649} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_0 - - - {8260E24F-1471-4320-AB5B-7CC7B68521E3} - System\System-net_4_0-2 - - - - - - diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs index 8b667ced1ba..0a894e7b0f6 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TargetDotNetFrameworkVersion.cs @@ -53,8 +53,13 @@ namespace Microsoft.Build.Utilities #if XBUILD_12 Version451, #endif +#if XBUILD_14 + Version453, +#endif -#if XBUILD_12 +#if XBUILD_14 + VersionLatest = Version453 +#elif XBUILD_12 VersionLatest = Version451 #elif NET_4_5 VersionLatest = Version45 diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs index f3aa310c09b..736b8ad0c4a 100644 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs +++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolLocationHelper.cs @@ -233,11 +233,20 @@ namespace Microsoft.Build.Utilities public static string GetPathToBuildTools (string toolsVersion) { - if (toolsVersion != "12.0") + string path; + switch (toolsVersion) { + case "12.0": + path = "xbuild_12"; + break; + case "14.0": + path = "xbuild_14"; + break; + default: return null; + } if (Environment.GetEnvironmentVariable ("TESTING_MONO") != null) - return Path.Combine (lib_mono_dir, "xbuild_12"); + return Path.Combine (lib_mono_dir, path); if (runningOnDotNet) { //see http://msdn.microsoft.com/en-us/library/vstudio/bb397428(v=vs.120).aspx diff --git a/mcs/class/Microsoft.Build/Makefile b/mcs/class/Microsoft.Build/Makefile index 279a8147c6f..df521a857cb 100644 --- a/mcs/class/Microsoft.Build/Makefile +++ b/mcs/class/Microsoft.Build/Makefile @@ -35,5 +35,4 @@ BUILT_SOURCES = $(EXPR_PARSER).cs include ../../build/library.make -XBUILD_FRAMEWORK_FOLDERS_PATH=xbuild-testing include $(XBUILD_DIR)/xbuild_test.make diff --git a/mcs/class/Microsoft.Build/Microsoft.Build-net_4_0.csproj b/mcs/class/Microsoft.Build/Microsoft.Build-net_4_0.csproj deleted file mode 100644 index 499f9adb421..00000000000 --- a/mcs/class/Microsoft.Build/Microsoft.Build-net_4_0.csproj +++ /dev/null @@ -1,205 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {99FAA9FF-3AE6-468C-9E46-839749A59EC5} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Microsoft.Build - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;MICROSOFT_BUILD_DLL - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;MICROSOFT_BUILD_DLL - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {4E55B240-B470-43B4-ABDA-8C03E7B1BF8E} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_4_0 - - - {7A96CB43-304B-417C-AAB3-C096E48DAE70} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build/Microsoft.Build-tests-net_4_0.csproj b/mcs/class/Microsoft.Build/Microsoft.Build-tests-net_4_0.csproj deleted file mode 100644 index 5fba28ee5f2..00000000000 --- a/mcs/class/Microsoft.Build/Microsoft.Build-tests-net_4_0.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FF9A5982-D153-498D-BEF1-8CF18CD5796C} - Library - 1699 - bin\Debug\Microsoft.Build-tests-net_4_0 - True - False - - Properties - - - Microsoft.Build_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;MICROSOFT_BUILD_DLL - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;MICROSOFT_BUILD_DLL - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {99FAA9FF-3AE6-468C-9E46-839749A59EC5} - Microsoft.Build\Microsoft.Build-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {4E55B240-B470-43B4-ABDA-8C03E7B1BF8E} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_4_0 - - - {7A96CB43-304B-417C-AAB3-C096E48DAE70} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_4_0 - - - {98DC1B90-280C-4A1B-A834-9D5143840323} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_4_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollection.cs b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollection.cs index 4170fa00253..60ccbe37bde 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollection.cs +++ b/mcs/class/Microsoft.Build/Microsoft.Build.Evaluation/ProjectCollection.cs @@ -251,12 +251,6 @@ namespace Microsoft.Build.Evaluation //FIXME: should also support config file, depending on ToolsetLocations void LoadDefaultToolsets () { - AddToolset (new Toolset ("2.0", - ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20), this, null)); - AddToolset (new Toolset ("3.0", - ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version30), this, null)); - AddToolset (new Toolset ("3.5", - ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version35), this, null)); #if NET_4_0 AddToolset (new Toolset ("4.0", ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40), this, null)); @@ -264,7 +258,19 @@ namespace Microsoft.Build.Evaluation #if XBUILD_12 AddToolset (new Toolset ("12.0", ToolLocationHelper.GetPathToBuildTools ("12.0"), this, null)); #endif - default_tools_version = toolsets.First ().ToolsVersion; +#if XBUILD_14 + AddToolset (new Toolset ("14.0", ToolLocationHelper.GetPathToBuildTools ("14.0"), this, null)); +#endif + + // We don't support these anymore + AddToolset (new Toolset ("2.0", + ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20), this, null)); + AddToolset (new Toolset ("3.0", + ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version30), this, null)); + AddToolset (new Toolset ("3.5", + ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version35), this, null)); + + default_tools_version = toolsets [0].ToolsVersion; } [MonoTODO ("not verified at all")] diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs index 4e23c2a7a5a..c4fe2401bd5 100644 --- a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs @@ -66,7 +66,7 @@ namespace MonoTests.Microsoft.Build.Execution var prop = proj.Properties.First (p => p.Name=="P"); Assert.AreEqual ("valid", prop.EvaluatedValue, "#2"); Assert.IsNotNull (proj.GetProperty ("MSBuildProjectDirectory"), "#3"); - Assert.AreEqual ("2.0", proj.ToolsVersion, "#4"); + Assert.AreEqual ("4.0", proj.ToolsVersion, "#4"); } [Test] diff --git a/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v2.0/RedistList/FrameworkList.xml b/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v2.0/RedistList/FrameworkList.xml index 879fdf42d0d..79b73d66e45 100644 --- a/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v2.0/RedistList/FrameworkList.xml +++ b/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v2.0/RedistList/FrameworkList.xml @@ -1,3 +1,3 @@ - + diff --git a/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v3.5/RedistList/FrameworkList.xml b/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v3.5/RedistList/FrameworkList.xml index 6f4b7b97973..dab4ced6ae5 100644 --- a/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v3.5/RedistList/FrameworkList.xml +++ b/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v3.5/RedistList/FrameworkList.xml @@ -1,3 +1,3 @@ - + diff --git a/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v4.0/RedistList/FrameworkList.xml b/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v4.0/RedistList/FrameworkList.xml index 9899af1dada..e373f1e968d 100644 --- a/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v4.0/RedistList/FrameworkList.xml +++ b/mcs/class/Microsoft.Build/xbuild-testing/.NETFramework/v4.0/RedistList/FrameworkList.xml @@ -1,3 +1,3 @@ - + diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp-net_4_0.csproj b/mcs/class/Microsoft.CSharp/Microsoft.CSharp-net_4_0.csproj deleted file mode 100644 index c663aa77326..00000000000 --- a/mcs/class/Microsoft.CSharp/Microsoft.CSharp-net_4_0.csproj +++ /dev/null @@ -1,109 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9ACDCB1D-5099-4091-A426-DBBA9B0976C2} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Microsoft.CSharp - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {7F51AF6B-0658-41D2-9165-D9700122D4C9} - Mono.CSharp\Mono.CSharp-net_4_0 - - - - - - - diff --git a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderContext.cs b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderContext.cs index bcb6e3c0b0e..e2b38dbfcd6 100644 --- a/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderContext.cs +++ b/mcs/class/Microsoft.CSharp/Microsoft.CSharp.RuntimeBinder/RuntimeBinderContext.cs @@ -111,7 +111,7 @@ namespace Microsoft.CSharp.RuntimeBinder throw new NotImplementedException (); } - public Compiler.ExtensionMethodCandidates LookupExtensionMethod (Compiler.TypeSpec extensionType, string name, int arity) + public Compiler.ExtensionMethodCandidates LookupExtensionMethod (string name, int arity) { // No extension method lookup in this context return null; diff --git a/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_2_0.csproj b/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_2_0.csproj deleted file mode 100644 index f9a2afac551..00000000000 --- a/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_2_0.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9BFFAB87-980B-4074-963C-1542F2E0F2FE} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Microsoft.VisualC - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_4_0.csproj b/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_4_0.csproj deleted file mode 100644 index 0a1f1c542ae..00000000000 --- a/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_4_0.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0EB544A0-2EAA-466C-84E5-054E5F635AD9} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Microsoft.VisualC - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure-net_4_0.csproj b/mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure-net_4_0.csproj deleted file mode 100644 index e700a180dba..00000000000 --- a/mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure-net_4_0.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {31114AEC-054F-44C3-B493-DD0815A5090F} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Microsoft.Web.Infrastructure - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {2AB66C1A-6094-4C45-AF9B-FA85F8D5E98A} - System.Web\System.Web-net_4_0-2 - - - - - - - diff --git a/mcs/class/Mono.C5/Mono.C5-net_2_0.csproj b/mcs/class/Mono.C5/Mono.C5-net_2_0.csproj deleted file mode 100644 index d25fc4a0778..00000000000 --- a/mcs/class/Mono.C5/Mono.C5-net_2_0.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C54C9EFB-5E3B-43D6-94C9-DD3A66EDA8DA} - Library - 1699,169,219,414,1030,3001,3005,3006 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.C5 - v2.0 - 512 - - - true - full - 1699,169,219,414,1030,3001,3005,3006 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,169,219,414,1030,3001,3005,3006 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Mono.C5/Mono.C5-net_4_0.csproj b/mcs/class/Mono.C5/Mono.C5-net_4_0.csproj deleted file mode 100644 index f3941fbf19a..00000000000 --- a/mcs/class/Mono.C5/Mono.C5-net_4_0.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FF7548C2-DDB5-4E31-B2B3-BCF20B8CC4CB} - Library - 1699,169,219,414,1030,3001,3005,3006 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.C5 - v4.0 - 512 - - - true - full - 1699,169,219,414,1030,3001,3005,3006 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,169,219,414,1030,3001,3005,3006 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/Mono.C5/Mono.C5-tests-net_2_0.csproj b/mcs/class/Mono.C5/Mono.C5-tests-net_2_0.csproj deleted file mode 100644 index 49f9f7b491c..00000000000 --- a/mcs/class/Mono.C5/Mono.C5-tests-net_2_0.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E698BCE2-5238-4E29-A859-406C99A83E28} - Library - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - bin\Debug\Mono.C5-tests-net_2_0 - True - False - - Properties - - - Mono.C5_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {C54C9EFB-5E3B-43D6-94C9-DD3A66EDA8DA} - Mono.C5\Mono.C5-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Mono.C5/Mono.C5-tests-net_4_0.csproj b/mcs/class/Mono.C5/Mono.C5-tests-net_4_0.csproj deleted file mode 100644 index 527e6668a03..00000000000 --- a/mcs/class/Mono.C5/Mono.C5-tests-net_4_0.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0DE538B3-2404-4686-AD32-6BDD84A91549} - Library - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - bin\Debug\Mono.C5-tests-net_4_0 - True - False - - Properties - - - Mono.C5_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {FF7548C2-DDB5-4E31-B2B3-BCF20B8CC4CB} - Mono.C5\Mono.C5-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/Mono.CSharp/Mono.CSharp-net_2_0.csproj b/mcs/class/Mono.CSharp/Mono.CSharp-net_2_0.csproj deleted file mode 100644 index ed18eec2f09..00000000000 --- a/mcs/class/Mono.CSharp/Mono.CSharp-net_2_0.csproj +++ /dev/null @@ -1,145 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CA9B3BCC-D6B6-4FE5-B90E-106D88030B7D} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.CSharp - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Mono.CSharp/Mono.CSharp-net_4_0.csproj b/mcs/class/Mono.CSharp/Mono.CSharp-net_4_0.csproj deleted file mode 100644 index ac2a948eec5..00000000000 --- a/mcs/class/Mono.CSharp/Mono.CSharp-net_4_0.csproj +++ /dev/null @@ -1,145 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7F51AF6B-0658-41D2-9165-D9700122D4C9} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.CSharp - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_2_0.csproj b/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_2_0.csproj deleted file mode 100644 index 769eaaab44a..00000000000 --- a/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_2_0.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {02C4293A-4B99-4E94-9C69-09207A6A457D} - Library - 1699 - bin\Debug\Mono.CSharp-tests-net_2_0 - True - False - - Properties - - - Mono.CSharp_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {CA9B3BCC-D6B6-4FE5-B90E-106D88030B7D} - Mono.CSharp\Mono.CSharp-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_4_0.csproj b/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_4_0.csproj deleted file mode 100644 index c9c5a06c399..00000000000 --- a/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_4_0.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {84804E34-5070-45EE-80DD-6D25338C89FA} - Library - 1699 - bin\Debug\Mono.CSharp-tests-net_4_0 - True - False - - Properties - - - Mono.CSharp_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {7F51AF6B-0658-41D2-9165-D9700122D4C9} - Mono.CSharp\Mono.CSharp-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs b/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs index feb4294647f..3eef06b3b15 100644 --- a/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs +++ b/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs @@ -146,6 +146,15 @@ namespace MonoTests.EvaluatorTest Assert.IsTrue (Evaluator.Run ("x();"), "#2"); } + [Test] + public void CapturedLocalVariable () + { + Evaluator.Run ("using System;"); + + var res = Evaluator.Evaluate("var x = 123; Action a = () => x++; a(); x;"); + Assert.AreEqual (124, res); + } + #if NET_4_0 [Test] public void DynamicStatement () diff --git a/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs b/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs index 970aa33443d..c124ad3739f 100644 --- a/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs +++ b/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs @@ -104,7 +104,15 @@ namespace MonoTests.EvaluatorTest { Evaluator.Run ("class A { class B { } }"); Evaluator.Run ("var x = new A ();"); + } + [Test] + public void DelegateType () + { + Evaluator.Run ("public delegate int D();"); + Evaluator.Run ("D d = delegate () { return 7; };"); + object res = Evaluator.Evaluate ("d();"); + Assert.AreEqual (7, res); } } } \ No newline at end of file diff --git a/mcs/class/Mono.Cairo/Mono.Cairo-net_2_0.csproj b/mcs/class/Mono.Cairo/Mono.Cairo-net_2_0.csproj deleted file mode 100644 index f408f459132..00000000000 --- a/mcs/class/Mono.Cairo/Mono.Cairo-net_2_0.csproj +++ /dev/null @@ -1,131 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {07DF935D-130B-4185-9DE2-027042BA1E35} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Cairo - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Cairo/Mono.Cairo-net_4_0.csproj b/mcs/class/Mono.Cairo/Mono.Cairo-net_4_0.csproj deleted file mode 100644 index 0c331474078..00000000000 --- a/mcs/class/Mono.Cairo/Mono.Cairo-net_4_0.csproj +++ /dev/null @@ -1,131 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4616F5BD-3EDB-4503-89D5-CF9A1C0E00EF} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.Cairo - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_2_0.csproj b/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_2_0.csproj deleted file mode 100644 index 955d4593154..00000000000 --- a/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_2_0.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7230E9AE-C6D4-402A-91CF-C164148CDD21} - Library - 1699 - bin\Debug\Mono.Cecil.Mdb-net_2_0 - True - True - - Properties - - - Mono.Cecil.Mdb - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;CECIL - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;CECIL - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - xcopy $(TargetName).* $(ProjectDir)..\lib\net_2_0\ /Y /R /D - - - - - {EB7444A6-C3E6-4224-BDB0-63CA3B4F2B87} - corlib\corlib-net_2_0 - - - {79F25FD7-0D76-4526-AF39-1A648649A827} - System\System-net_2_0-2 - - - {2F1D61B7-0586-4587-8ECE-926A065F6276} - Mono.Cecil\Mono.Cecil-net_2_0 - - - - - - diff --git a/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_0.csproj b/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_0.csproj deleted file mode 100644 index 11cabb5dc2b..00000000000 --- a/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_4_0.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5F3D2BE6-A096-4504-AA3E-307B0A819E85} - Library - 1699 - bin\Debug\Mono.Cecil.Mdb-net_4_0 - True - True - - Properties - - - Mono.Cecil.Mdb - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;CECIL - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;CECIL - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - xcopy $(TargetName).* $(ProjectDir)..\lib\net_4_0\ /Y /R /D - - - - - {3874F10B-9AE4-4A7E-873B-42FFDCE80CB7} - corlib\corlib-net_4_0 - - - {8260E24F-1471-4320-AB5B-7CC7B68521E3} - System\System-net_4_0-2 - - - {1FA0877C-43C9-44C7-9682-0C3F826BEA3E} - Mono.Cecil\Mono.Cecil-net_4_0 - - - - - - diff --git a/mcs/class/Mono.Cecil/Makefile b/mcs/class/Mono.Cecil/Makefile index d9643b7f5a9..37d7fb0f56d 100644 --- a/mcs/class/Mono.Cecil/Makefile +++ b/mcs/class/Mono.Cecil/Makefile @@ -9,8 +9,4 @@ LIB_MCS_FLAGS = /r:$(corlib) -keyfile:$(LIBRARY_SNK) -r:System.Core.dll -d:NET_3 NO_TEST = yes -ifneq (net_2_0, $(PROFILE)) -NO_INSTALL = yes -endif - include ../../build/library.make diff --git a/mcs/class/Mono.Cecil/Mono.Cecil-net_2_0.csproj b/mcs/class/Mono.Cecil/Mono.Cecil-net_2_0.csproj deleted file mode 100644 index b0331b65be5..00000000000 --- a/mcs/class/Mono.Cecil/Mono.Cecil-net_2_0.csproj +++ /dev/null @@ -1,206 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EED155FA-9877-4A62-889B-365D5DED03DB} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Cecil - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Cecil/Mono.Cecil-net_4_0.csproj b/mcs/class/Mono.Cecil/Mono.Cecil-net_4_0.csproj deleted file mode 100644 index 74726522acd..00000000000 --- a/mcs/class/Mono.Cecil/Mono.Cecil-net_4_0.csproj +++ /dev/null @@ -1,206 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CFE79CC1-F050-42A8-BBB2-012A10DC095B} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.Cecil - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.CodeContracts/Mono.CodeContracts-net_4_0.csproj b/mcs/class/Mono.CodeContracts/Mono.CodeContracts-net_4_0.csproj deleted file mode 100644 index 981026d9d69..00000000000 --- a/mcs/class/Mono.CodeContracts/Mono.CodeContracts-net_4_0.csproj +++ /dev/null @@ -1,456 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {155AEF28-C81F-405D-9072-9D52780E3E70} - Library - 1699 - ./../../class/lib/net_4_0 - true - - Properties - - Mono.CodeContracts - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - ./../../class/lib/net_4_0 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - ./../../class/lib/net_4_0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - mscorlib.dll - - - False - System - - - False - System.Core - - - False - Mono.Cecil.dll - - - False - Mono.Cecil.Mdb.dll - - - - - - - - diff --git a/mcs/class/Mono.CodeContracts/Mono.CodeContracts-tests-net_4_0.csproj b/mcs/class/Mono.CodeContracts/Mono.CodeContracts-tests-net_4_0.csproj deleted file mode 100644 index a4c2559ae9a..00000000000 --- a/mcs/class/Mono.CodeContracts/Mono.CodeContracts-tests-net_4_0.csproj +++ /dev/null @@ -1,72 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {155AEF28-C81F-405D-9072-9D52780E3E70} - Library - 1699 - .\ - true - - Properties - - Mono.CodeContracts_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - ./../../class/lib/net_4_0 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - ./../../class/lib/net_4_0 - - - - - - - - - - - - - - False - mscorlib.dll - - - False - ./../../class/lib/net_4_0/Mono.CodeContracts.dll - - - - - - - - - - diff --git a/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_2_0.csproj b/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_2_0.csproj deleted file mode 100644 index 981bb193907..00000000000 --- a/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_2_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D59758D7-08DC-4645-A96A-0EBE93F281A6} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.CompilerServices.SymbolWriter - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_4_0.csproj b/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_4_0.csproj deleted file mode 100644 index d38884f78ca..00000000000 --- a/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_4_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {918B2C1D-3B25-4076-9B44-F96B43AA923F} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.CompilerServices.SymbolWriter - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {714C7BA8-AC9A-49C4-ADCA-CD4585EF1A46} - System\System-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_2_0.csproj b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_2_0.csproj deleted file mode 100644 index 789777acdc6..00000000000 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_2_0.csproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7B3F5668-ED1F-48EB-9897-E6BE6A1C8CB3} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Data.Sqlite - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SQLITE_STANDARD - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;SQLITE_STANDARD - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - SR.resources - - - SQLiteCommand.bmp - - - SQLiteConnection.bmp - - - SQLiteDataAdapter.bmp - - - - diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_4_0.csproj b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_4_0.csproj deleted file mode 100644 index 69f9a4cf68b..00000000000 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_4_0.csproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {74084B98-6858-4133-998C-E594D367D8F1} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - Mono.Data.Sqlite - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SQLITE_STANDARD - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SQLITE_STANDARD - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {03A0E889-9E62-423F-B65E-40416E021F1B} - System.Transactions\System.Transactions-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - - SR.resources - - - SQLiteCommand.bmp - - - SQLiteConnection.bmp - - - SQLiteDataAdapter.bmp - - - - diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_2_0.csproj b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_2_0.csproj deleted file mode 100644 index 3c937737692..00000000000 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_2_0.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {082EFA10-D1AE-41EA-8CDD-7D881109D97A} - Library - 1699,618 - bin\Debug\Mono.Data.Sqlite-tests-net_2_0 - True - False - true - Properties - - - Mono.Data.Sqlite_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SQLITE_STANDARD - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;SQLITE_STANDARD - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {7B3F5668-ED1F-48EB-9897-E6BE6A1C8CB3} - Mono.Data.Sqlite\Mono.Data.Sqlite-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - SR.resources - - - SQLiteCommand.bmp - - - SQLiteConnection.bmp - - - SQLiteDataAdapter.bmp - - - - diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_4_0.csproj b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_4_0.csproj deleted file mode 100644 index 8aba4f2bb35..00000000000 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_4_0.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {539D0731-5739-4568-917A-D689EBB043B4} - Library - 1699,618 - bin\Debug\Mono.Data.Sqlite-tests-net_4_0 - True - False - true - Properties - - - Mono.Data.Sqlite_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SQLITE_STANDARD - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SQLITE_STANDARD - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {74084B98-6858-4133-998C-E594D367D8F1} - Mono.Data.Sqlite\Mono.Data.Sqlite-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {03A0E889-9E62-423F-B65E-40416E021F1B} - System.Transactions\System.Transactions-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - - SR.resources - - - SQLiteCommand.bmp - - - SQLiteConnection.bmp - - - SQLiteDataAdapter.bmp - - - - diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_2_0.csproj b/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_2_0.csproj deleted file mode 100644 index b092598503a..00000000000 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_2_0.csproj +++ /dev/null @@ -1,125 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C21CB6AB-7059-4FA5-A23C-84EA0B854BB7} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Data.Tds - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_4_0.csproj b/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_4_0.csproj deleted file mode 100644 index 85bb51287cb..00000000000 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_4_0.csproj +++ /dev/null @@ -1,125 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6ECC0DBC-E614-4ABD-811F-0DE92E8314EA} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.Data.Tds - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Mono.Security\Mono.Security-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_2_0.csproj b/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_2_0.csproj deleted file mode 100644 index afd72be7002..00000000000 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_2_0.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B248ADC8-9309-4844-90C0-6377AC3467D4} - Library - 1699 - bin\Debug\Mono.Data.Tds-tests-net_2_0 - True - False - - Properties - - - Mono.Data.Tds_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {C21CB6AB-7059-4FA5-A23C-84EA0B854BB7} - Mono.Data.Tds\Mono.Data.Tds-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - False - System.Net.dll - False - - - - - - - diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_4_0.csproj b/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_4_0.csproj deleted file mode 100644 index eb3d797bcdc..00000000000 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_4_0.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F1D7B09F-B70E-4B01-B74F-1E79F6D8F47E} - Library - 1699 - bin\Debug\Mono.Data.Tds-tests-net_4_0 - True - False - - Properties - - - Mono.Data.Tds_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {6ECC0DBC-E614-4ABD-811F-0DE92E8314EA} - Mono.Data.Tds\Mono.Data.Tds-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {ED90CD4E-E958-4E14-B0E4-425CFA3BF661} - System.Net\System.Net-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_2_0.csproj b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_2_0.csproj deleted file mode 100644 index c53b28ec198..00000000000 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_2_0.csproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {08AD7FD1-889B-4ADC-8AAA-05459828C75F} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Debugger.Soft - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {EED155FA-9877-4A62-889B-365D5DED03DB} - Mono.Cecil\Mono.Cecil-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_4_0.csproj b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_4_0.csproj deleted file mode 100644 index 20ac8ceb8f4..00000000000 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_4_0.csproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {30117DA1-A570-4400-88B5-CBC0EF7CCC96} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - Mono.Debugger.Soft - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {CFE79CC1-F050-42A8-BBB2-012A10DC095B} - Mono.Cecil\Mono.Cecil-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_2_0.csproj b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_2_0.csproj deleted file mode 100644 index de8b73ff4f9..00000000000 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_2_0.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3C5E6859-9346-4FE8-AD24-2D00753DEDE4} - Library - 1699 - bin\Debug\Mono.Debugger.Soft-tests-net_2_0 - True - False - - Properties - - - Mono.Debugger.Soft_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {08AD7FD1-889B-4ADC-8AAA-05459828C75F} - Mono.Debugger.Soft\Mono.Debugger.Soft-net_2_0 - - - {EED155FA-9877-4A62-889B-365D5DED03DB} - Mono.Cecil\Mono.Cecil-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_4_0.csproj b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_4_0.csproj deleted file mode 100644 index 71cf512b4d2..00000000000 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_4_0.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1B2FA57B-B4D8-4CF8-B291-02CAD401ECAD} - Library - 1699 - bin\Debug\Mono.Debugger.Soft-tests-net_4_0 - True - False - - Properties - - - Mono.Debugger.Soft_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {30117DA1-A570-4400-88B5-CBC0EF7CCC96} - Mono.Debugger.Soft\Mono.Debugger.Soft-net_4_0 - - - {CFE79CC1-F050-42A8-BBB2-012A10DC095B} - Mono.Cecil\Mono.Cecil-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs index a54315f175e..753f3910f83 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs @@ -417,7 +417,7 @@ namespace Mono.Debugger.Soft * with newer runtimes, and vice versa. */ internal const int MAJOR_VERSION = 2; - internal const int MINOR_VERSION = 37; + internal const int MINOR_VERSION = 38; enum WPSuspendPolicy { NONE = 0, @@ -585,7 +585,8 @@ namespace Mono.Debugger.Soft enum CmdStackFrame { GET_VALUES = 1, GET_THIS = 2, - SET_VALUES = 3 + SET_VALUES = 3, + GET_DOMAIN = 4, } enum CmdArrayRef { @@ -2378,6 +2379,10 @@ namespace Mono.Debugger.Soft SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.SET_VALUES, new PacketWriter ().WriteId (thread_id).WriteId (id).WriteInt (len).WriteInts (pos).WriteValues (values)); } + internal long StackFrame_GetDomain (long thread_id, long id) { + return SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.GET_DOMAIN, new PacketWriter ().WriteId (thread_id).WriteId (id)).ReadId (); + } + /* * ARRAYS */ diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs index 7a6a34fa539..8549a93700a 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs @@ -7,6 +7,7 @@ namespace Mono.Debugger.Soft public class StackFrame : Mirror { ThreadMirror thread; + AppDomainMirror domain; MethodMirror method; int il_offset; Location location; @@ -32,6 +33,16 @@ namespace Mono.Debugger.Soft } } + public AppDomainMirror Domain { + get { + vm.CheckProtocolVersion (2, 38); + if (domain == null) + domain = vm.GetDomain (vm.conn.StackFrame_GetDomain (thread.Id, Id)); + + return domain; + } + } + public MethodMirror Method { get { return method; diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs index df4fbcc6648..d7aaacd3383 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs @@ -2869,8 +2869,10 @@ public class DebuggerTests var frames = e.Thread.GetFrames (); Assert.AreEqual ("invoke_in_domain", frames [0].Method.Name); + Assert.AreEqual (domain, frames [0].Domain); Assert.AreEqual ("invoke", frames [1].Method.Name); Assert.AreEqual ("domains", frames [2].Method.Name); + Assert.AreEqual (vm.RootDomain, frames [2].Domain); // Test breakpoints on already JITted methods in other domains m = entry_point.DeclaringType.GetMethod ("invoke_in_domain_2"); diff --git a/mcs/class/Mono.Http/Mono.Http-net_2_0.csproj b/mcs/class/Mono.Http/Mono.Http-net_2_0.csproj deleted file mode 100644 index 40fcb94da50..00000000000 --- a/mcs/class/Mono.Http/Mono.Http-net_2_0.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7323A289-ABB8-4556-A9D5-8994223523B5} - Library - 1699,618 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Http - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - {9E123979-3457-435B-A081-8432EEBA134A} - ICSharpCode.SharpZipLib\ICSharpCode.SharpZipLib-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Http/Mono.Http-net_4_0.csproj b/mcs/class/Mono.Http/Mono.Http-net_4_0.csproj deleted file mode 100644 index 03e7cf7f5a8..00000000000 --- a/mcs/class/Mono.Http/Mono.Http-net_4_0.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8058482B-59D1-43C3-BCD8-B9CD97F25AE3} - Library - 1699,618 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.Http - v4.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {C385F6FA-0893-438F-AA08-32E08FF478AA} - System.Web\System.Web-net_4_0-1 - - - {D7EC98B8-2158-4304-9E84-D19D50CE16E8} - ICSharpCode.SharpZipLib\ICSharpCode.SharpZipLib-net_4_0 - - - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Mono.Security\Mono.Security-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Management/Mono.Management-net_2_0.csproj b/mcs/class/Mono.Management/Mono.Management-net_2_0.csproj deleted file mode 100644 index f1c6fe2f1e4..00000000000 --- a/mcs/class/Mono.Management/Mono.Management-net_2_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BF4F4B81-6779-40D0-85B9-2FD9ED8DFF63} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Management - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Management/Mono.Management-net_4_0.csproj b/mcs/class/Mono.Management/Mono.Management-net_4_0.csproj deleted file mode 100644 index 778873ee18e..00000000000 --- a/mcs/class/Mono.Management/Mono.Management-net_4_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EF47FFCA-F3A6-4D13-B821-A17A9CC00E5A} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.Management - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {E9A655D1-EE99-467A-8F4B-CAC80E0E65BE} - Mono.Posix\Mono.Posix-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_2_0.csproj b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_2_0.csproj deleted file mode 100644 index 827b2ebcbc1..00000000000 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_2_0.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D7F14FD3-CE00-4000-813C-9D34D42FE887} - Library - 1699,618 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Messaging.RabbitMQ - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - System.Messaging\System.Messaging-net_2_0 - - - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Mono.Messaging\Mono.Messaging-net_2_0 - - - {962E924C-777A-42E1-B7AC-823BFA34D22C} - client\RabbitMQ.Client-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_4_0.csproj b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_4_0.csproj deleted file mode 100644 index 42914578eba..00000000000 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_4_0.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EC559825-D111-40A5-B815-D4F669A6564A} - Library - 1699,618 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.Messaging.RabbitMQ - v4.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {5854BF27-FC35-44F5-BE59-580900694E32} - System.Messaging\System.Messaging-net_4_0 - - - {DD379954-9A73-4B1D-B314-D8EF1D4C5EB7} - Mono.Messaging\Mono.Messaging-net_4_0 - - - {E06EB369-D458-4373-ABA7-CE156714DE4F} - client\RabbitMQ.Client-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_2_0.csproj b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_2_0.csproj deleted file mode 100644 index b90bc4f6a7e..00000000000 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_2_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CC2D1BF7-1070-41B3-B316-85EA0B2E7E9E} - Library - 1699,618,618,219,169 - bin\Debug\Mono.Messaging.RabbitMQ-tests-net_2_0 - True - False - - Properties - - - Mono.Messaging.RabbitMQ_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {D7F14FD3-CE00-4000-813C-9D34D42FE887} - Mono.Messaging.RabbitMQ\Mono.Messaging.RabbitMQ-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - System.Messaging\System.Messaging-net_2_0 - - - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Mono.Messaging\Mono.Messaging-net_2_0 - - - {962E924C-777A-42E1-B7AC-823BFA34D22C} - client\RabbitMQ.Client-net_2_0 - - - False - nunit.mocks.dll - False - - - - - - - diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_4_0.csproj b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_4_0.csproj deleted file mode 100644 index 641cd795e90..00000000000 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_4_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {69E3B31F-30F1-4C97-9C0B-EF791BF6D9A5} - Library - 1699,618,618,219,169 - bin\Debug\Mono.Messaging.RabbitMQ-tests-net_4_0 - True - False - - Properties - - - Mono.Messaging.RabbitMQ_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {EC559825-D111-40A5-B815-D4F669A6564A} - Mono.Messaging.RabbitMQ\Mono.Messaging.RabbitMQ-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {5854BF27-FC35-44F5-BE59-580900694E32} - System.Messaging\System.Messaging-net_4_0 - - - {DD379954-9A73-4B1D-B314-D8EF1D4C5EB7} - Mono.Messaging\Mono.Messaging-net_4_0 - - - {E06EB369-D458-4373-ABA7-CE156714DE4F} - client\RabbitMQ.Client-net_4_0 - - - False - nunit.mocks.dll - False - - - - - - - diff --git a/mcs/class/Mono.Messaging/Mono.Messaging-net_2_0.csproj b/mcs/class/Mono.Messaging/Mono.Messaging-net_2_0.csproj deleted file mode 100644 index b27257ce567..00000000000 --- a/mcs/class/Mono.Messaging/Mono.Messaging-net_2_0.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Messaging - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Messaging/Mono.Messaging-net_4_0.csproj b/mcs/class/Mono.Messaging/Mono.Messaging-net_4_0.csproj deleted file mode 100644 index 9d4e0c12b9e..00000000000 --- a/mcs/class/Mono.Messaging/Mono.Messaging-net_4_0.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DD379954-9A73-4B1D-B314-D8EF1D4C5EB7} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.Messaging - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_2_0.csproj b/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_2_0.csproj deleted file mode 100644 index 80c2a9eace0..00000000000 --- a/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_2_0.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {62E7C77F-D5EF-4761-8C20-571CC01C8202} - Library - 1699,618,219,169 - bin\Debug\Mono.Messaging-tests-net_2_0 - True - False - - Properties - - - Mono.Messaging_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Mono.Messaging\Mono.Messaging-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - False - System.Messaging.dll - False - - - False - nunit.mocks.dll - False - - - - - - - diff --git a/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_4_0.csproj b/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_4_0.csproj deleted file mode 100644 index f601663d7d1..00000000000 --- a/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_4_0.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B7589A5F-C173-45C5-96CC-C82162D783CC} - Library - 1699,618,219,169 - bin\Debug\Mono.Messaging-tests-net_4_0 - True - False - - Properties - - - Mono.Messaging_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {DD379954-9A73-4B1D-B314-D8EF1D4C5EB7} - Mono.Messaging\Mono.Messaging-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - System.Messaging\System.Messaging-net_2_0 - - - False - nunit.mocks.dll - False - - - - - - - diff --git a/mcs/class/Mono.Options/Mono.Options-net_2_0.csproj b/mcs/class/Mono.Options/Mono.Options-net_2_0.csproj deleted file mode 100644 index b1d91902ed5..00000000000 --- a/mcs/class/Mono.Options/Mono.Options-net_2_0.csproj +++ /dev/null @@ -1,83 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {91B954C8-077B-49DD-BA35-AD8BAE7A79CD} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Options - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Mono.Options/Mono.Options-net_4_0.csproj b/mcs/class/Mono.Options/Mono.Options-net_4_0.csproj deleted file mode 100644 index c168c2f42af..00000000000 --- a/mcs/class/Mono.Options/Mono.Options-net_4_0.csproj +++ /dev/null @@ -1,83 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E945A161-D20B-46FF-AC8D-6D1647A21197} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.Options - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/Mono.Options/Mono.Options-tests-net_2_0.csproj b/mcs/class/Mono.Options/Mono.Options-tests-net_2_0.csproj deleted file mode 100644 index 4e7699dc2a4..00000000000 --- a/mcs/class/Mono.Options/Mono.Options-tests-net_2_0.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E1915F81-F06D-4A4F-AA38-BB1BA8200B91} - Library - 1699 - bin\Debug\Mono.Options-tests-net_2_0 - True - False - - Properties - - - Mono.Options_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {91B954C8-077B-49DD-BA35-AD8BAE7A79CD} - Mono.Options\Mono.Options-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Options/Mono.Options-tests-net_4_0.csproj b/mcs/class/Mono.Options/Mono.Options-tests-net_4_0.csproj deleted file mode 100644 index bf70525aae8..00000000000 --- a/mcs/class/Mono.Options/Mono.Options-tests-net_4_0.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6005A0F1-D347-4299-82C5-3197D07E3104} - Library - 1699 - bin\Debug\Mono.Options-tests-net_4_0 - True - False - - Properties - - - Mono.Options_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {E945A161-D20B-46FF-AC8D-6D1647A21197} - Mono.Options\Mono.Options-net_4_0 - - - {E9A655D1-EE99-467A-8F4B-CAC80E0E65BE} - Mono.Posix\Mono.Posix-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Parallel/Mono.Parallel-net_4_0.csproj b/mcs/class/Mono.Parallel/Mono.Parallel-net_4_0.csproj deleted file mode 100644 index ea5494f2652..00000000000 --- a/mcs/class/Mono.Parallel/Mono.Parallel-net_4_0.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {56844AC8-547D-4C9D-A90A-5753ACA81619} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.Parallel - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;INSIDE_MONO_PARALLEL - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;INSIDE_MONO_PARALLEL - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/Mono.Parallel/Mono.Parallel-tests-net_4_0.csproj b/mcs/class/Mono.Parallel/Mono.Parallel-tests-net_4_0.csproj deleted file mode 100644 index 28b7af76fa1..00000000000 --- a/mcs/class/Mono.Parallel/Mono.Parallel-tests-net_4_0.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A6FB8E72-C8BD-427D-8096-9E04EB219611} - Library - 1699 - bin\Debug\Mono.Parallel-tests-net_4_0 - True - False - - Properties - - - Mono.Parallel_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {56844AC8-547D-4C9D-A90A-5753ACA81619} - Mono.Parallel\Mono.Parallel-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Posix/Mono.Posix-net_2_0.csproj b/mcs/class/Mono.Posix/Mono.Posix-net_2_0.csproj deleted file mode 100644 index fb08807aa50..00000000000 --- a/mcs/class/Mono.Posix/Mono.Posix-net_2_0.csproj +++ /dev/null @@ -1,136 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Library - 1699,618,612 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Posix - v2.0 - 512 - - - true - full - 1699,618,612 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,612 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Posix/Mono.Posix-net_4_0.csproj b/mcs/class/Mono.Posix/Mono.Posix-net_4_0.csproj deleted file mode 100644 index 73caab37c07..00000000000 --- a/mcs/class/Mono.Posix/Mono.Posix-net_4_0.csproj +++ /dev/null @@ -1,136 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E9A655D1-EE99-467A-8F4B-CAC80E0E65BE} - Library - 1699,618,612 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - Mono.Posix - v4.0 - 512 - - - true - full - 1699,618,612 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618,612 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {714C7BA8-AC9A-49C4-ADCA-CD4585EF1A46} - System\System-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Posix/Mono.Posix-tests-net_2_0.csproj b/mcs/class/Mono.Posix/Mono.Posix-tests-net_2_0.csproj deleted file mode 100644 index ccbe2bef1e8..00000000000 --- a/mcs/class/Mono.Posix/Mono.Posix-tests-net_2_0.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CC6C32E1-55ED-469E-82B1-C60DA038FBE6} - Library - 1699,219,618 - bin\Debug\Mono.Posix-tests-net_2_0 - True - False - - Properties - - - Mono.Posix_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,219,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Posix/Mono.Posix-tests-net_4_0.csproj b/mcs/class/Mono.Posix/Mono.Posix-tests-net_4_0.csproj deleted file mode 100644 index ea71a4c9967..00000000000 --- a/mcs/class/Mono.Posix/Mono.Posix-tests-net_4_0.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {89913586-15DA-4305-8E1F-58A0F350C865} - Library - 1699,219,618 - bin\Debug\Mono.Posix-tests-net_4_0 - True - False - - Properties - - - Mono.Posix_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,219,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {E9A655D1-EE99-467A-8F4B-CAC80E0E65BE} - Mono.Posix\Mono.Posix-net_4_0 - - - {E9A655D1-EE99-467A-8F4B-CAC80E0E65BE} - Mono.Posix\Mono.Posix-net_4_0 - - - {714C7BA8-AC9A-49C4-ADCA-CD4585EF1A46} - System\System-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Posix/Mono.Unix.Native/NativeConvert.cs b/mcs/class/Mono.Posix/Mono.Unix.Native/NativeConvert.cs index 7951d08ae17..ffa329f1b5b 100644 --- a/mcs/class/Mono.Posix/Mono.Unix.Native/NativeConvert.cs +++ b/mcs/class/Mono.Posix/Mono.Unix.Native/NativeConvert.cs @@ -195,6 +195,11 @@ namespace Mono.Unix.Native { return FromTimeT (time); } + public static DateTime ToDateTime (long time, long nanoTime) + { + return FromTimeT (time).AddMilliseconds (nanoTime / 1000); + } + public static long FromDateTime (DateTime time) { return ToTimeT (time); diff --git a/mcs/class/Mono.Posix/Mono.Unix/UnixFileSystemInfo.cs b/mcs/class/Mono.Posix/Mono.Unix/UnixFileSystemInfo.cs index c6a9b283b5f..149f79b84ed 100644 --- a/mcs/class/Mono.Posix/Mono.Unix/UnixFileSystemInfo.cs +++ b/mcs/class/Mono.Posix/Mono.Unix/UnixFileSystemInfo.cs @@ -192,7 +192,7 @@ namespace Mono.Unix { } public DateTime LastAccessTime { - get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_atime);} + get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_atime, stat.st_atime_nsec);} } public DateTime LastAccessTimeUtc { @@ -200,7 +200,7 @@ namespace Mono.Unix { } public DateTime LastWriteTime { - get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_mtime);} + get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_mtime, stat.st_mtime_nsec);} } public DateTime LastWriteTimeUtc { @@ -208,7 +208,7 @@ namespace Mono.Unix { } public DateTime LastStatusChangeTime { - get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_ctime);} + get {AssertValid (); return Native.NativeConvert.ToDateTime (stat.st_ctime, stat.st_ctime_nsec);} } public DateTime LastStatusChangeTimeUtc { diff --git a/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_2_0.csproj b/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_2_0.csproj deleted file mode 100644 index 94ca7da27b1..00000000000 --- a/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_2_0.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5A61BC1B-CF0D-450F-A114-02A4C863B71F} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Security.Win32 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_4_0.csproj b/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_4_0.csproj deleted file mode 100644 index e9a6f6b1e4c..00000000000 --- a/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_4_0.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {54BD833F-C0CF-4192-9083-56F6CD3814DD} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - Mono.Security.Win32 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Security/Mono.Security-net_2_0.csproj b/mcs/class/Mono.Security/Mono.Security-net_2_0.csproj deleted file mode 100644 index 935f3dc2a10..00000000000 --- a/mcs/class/Mono.Security/Mono.Security-net_2_0.csproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {57CFE851-81AC-4269-B24A-965A53D87248} - Library - 1699,1030 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Security - v2.0 - 512 - - - true - full - 1699,1030 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,1030 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Security/Mono.Security-net_4_0.csproj b/mcs/class/Mono.Security/Mono.Security-net_4_0.csproj deleted file mode 100644 index 065c206186a..00000000000 --- a/mcs/class/Mono.Security/Mono.Security-net_4_0.csproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Library - 1699,1030 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - Mono.Security - v4.0 - 512 - - - true - full - 1699,1030 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,1030 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {714C7BA8-AC9A-49C4-ADCA-CD4585EF1A46} - System\System-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Security/Mono.Security-tests-net_2_0.csproj b/mcs/class/Mono.Security/Mono.Security-tests-net_2_0.csproj deleted file mode 100644 index 3da8463338b..00000000000 --- a/mcs/class/Mono.Security/Mono.Security-tests-net_2_0.csproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1FE45C8C-1411-4C7E-BBF4-6C2F816239BE} - Library - 1699,1030,169,219,618,672 - bin\Debug\Mono.Security-tests-net_2_0 - True - False - true - Properties - - - Mono.Security_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,1030,169,219,618,672 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,1030,169,219,618,672 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Security/Mono.Security-tests-net_4_0.csproj b/mcs/class/Mono.Security/Mono.Security-tests-net_4_0.csproj deleted file mode 100644 index fa6828bdb8a..00000000000 --- a/mcs/class/Mono.Security/Mono.Security-tests-net_4_0.csproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A6B7ED7F-8A76-4D58-9345-14A9B74C91E8} - Library - 1699,1030,169,219,618,672 - bin\Debug\Mono.Security-tests-net_4_0 - True - False - true - Properties - - - Mono.Security_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,1030,169,219,618,672 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,1030,169,219,618,672 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Mono.Security\Mono.Security-net_4_0 - - - {714C7BA8-AC9A-49C4-ADCA-CD4585EF1A46} - System\System-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Simd/Makefile b/mcs/class/Mono.Simd/Makefile index 3341fdabacd..04dc927a0f3 100644 --- a/mcs/class/Mono.Simd/Makefile +++ b/mcs/class/Mono.Simd/Makefile @@ -10,7 +10,7 @@ NO_TEST = yes # This is a .NET 2.0+ only assembly -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-Mono.Simd.dll NO_INSTALL = yes diff --git a/mcs/class/Mono.Simd/Mono.Simd-net_2_0.csproj b/mcs/class/Mono.Simd/Mono.Simd-net_2_0.csproj deleted file mode 100644 index 87ddb676511..00000000000 --- a/mcs/class/Mono.Simd/Mono.Simd-net_2_0.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2DE3C48F-6194-476B-99D9-B990C261EFF8} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Simd - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Simd/Mono.Simd-net_4_0.csproj b/mcs/class/Mono.Simd/Mono.Simd-net_4_0.csproj deleted file mode 100644 index 8ea6fe75f5c..00000000000 --- a/mcs/class/Mono.Simd/Mono.Simd-net_4_0.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CEECA2D3-21F6-4A61-85B4-FA78AF6499E0} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - Mono.Simd - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.Tasklets/Mono.Tasklets-net_2_0.csproj b/mcs/class/Mono.Tasklets/Mono.Tasklets-net_2_0.csproj deleted file mode 100644 index c9c156076c2..00000000000 --- a/mcs/class/Mono.Tasklets/Mono.Tasklets-net_2_0.csproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D329F40E-D458-4164-BAA4-196644F8E73C} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Tasklets - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Tasklets/Mono.Tasklets-net_4_0.csproj b/mcs/class/Mono.Tasklets/Mono.Tasklets-net_4_0.csproj deleted file mode 100644 index 6509a446d61..00000000000 --- a/mcs/class/Mono.Tasklets/Mono.Tasklets-net_4_0.csproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6E14C0A3-9119-4C8A-94D9-3C49FA255841} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.Tasklets - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - - - - - diff --git a/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_2_0.csproj b/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_2_0.csproj deleted file mode 100644 index 2611d1a2f8f..00000000000 --- a/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_2_0.csproj +++ /dev/null @@ -1,236 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F46C8C89-6CD0-432D-8BEF-C962DB694CDB} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.WebBrowser - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_4_0.csproj b/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_4_0.csproj deleted file mode 100644 index c26839a06f4..00000000000 --- a/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_4_0.csproj +++ /dev/null @@ -1,236 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7CF0E3C1-B971-4B78-8145-976EF6F5287B} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.WebBrowser - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_2_0.csproj b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_2_0.csproj deleted file mode 100644 index 5678ab0b5e5..00000000000 --- a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_2_0.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8C54606D-305D-45B0-9932-380FE021BEFE} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.XBuild.Tasks - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_4_0.csproj b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_4_0.csproj deleted file mode 100644 index 240d8978166..00000000000 --- a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_4_0.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B8993C2D-04FD-4738-91ED-060E29A5FBD4} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Mono.XBuild.Tasks - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - diff --git a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_2_0.csproj b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_2_0.csproj deleted file mode 100644 index 91af433629b..00000000000 --- a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_2_0.csproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FBD61913-57C0-46E2-98D6-230F1953E28F} - Library - 1699 - bin\Debug\Mono.XBuild.Tasks-tests-net_2_0 - True - False - - Properties - - - Mono.XBuild.Tasks_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {8C54606D-305D-45B0-9932-380FE021BEFE} - Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_4_0.csproj b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_4_0.csproj deleted file mode 100644 index 0e005df2bc5..00000000000 --- a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_4_0.csproj +++ /dev/null @@ -1,75 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0C851F1F-CF06-4440-8E69-F33FBF07D605} - Library - 1699 - bin\Debug\Mono.XBuild.Tasks-tests-net_4_0 - True - False - Properties - Mono.XBuild.Tasks_test_net_4_0 - v4.0 - 512 - - - true - full - false - DEBUG;TRACE;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - true - NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - xcopy $(TargetName).* $(ProjectDir)..\lib\net_4_0\ /Y /R /D - - - - - ..\lib\net_4_0\mscorlib.dll - - - ..\lib\net_4_0\System.Core.dll - - - ..\lib\net_4_0\nunit.framework.dll - - - - - {F7F03F9B-6E7A-43BD-993A-7F197A440150} - Mono.XBuild.Tasks-net_4_0 - - - diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_2_0.csproj b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_2_0.csproj deleted file mode 100644 index c806cfcde22..00000000000 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_2_0.csproj +++ /dev/null @@ -1,304 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {30C57C43-3A84-4E9F-A889-53CAE3C634C4} - Library - 1699,612 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Novell.Directory.Ldap - v2.0 - 512 - - - true - full - 1699,612 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,612 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - - ResultCodeMessages.resources - - - - diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_4_0.csproj b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_4_0.csproj deleted file mode 100644 index 20f659fed36..00000000000 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_4_0.csproj +++ /dev/null @@ -1,304 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D6DA2E60-D81F-42EC-991E-ED2FFBD5094D} - Library - 1699,612 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Novell.Directory.Ldap - v4.0 - 512 - - - true - full - 1699,612 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,612 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Mono.Security\Mono.Security-net_4_0 - - - - - - - - ResultCodeMessages.resources - - - - diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_2_0.csproj b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_2_0.csproj deleted file mode 100644 index 5cccc522787..00000000000 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_2_0.csproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C0155A06-C828-42B0-96FC-A2F306B4CBD4} - Library - 1699 - bin\Debug\Novell.Directory.Ldap-tests-net_2_0 - True - False - - Properties - - - Novell.Directory.Ldap_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {30C57C43-3A84-4E9F-A889-53CAE3C634C4} - Novell.Directory.Ldap\Novell.Directory.Ldap-net_2_0 - - - - - - - diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_4_0.csproj b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_4_0.csproj deleted file mode 100644 index 51d82c49b5c..00000000000 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_4_0.csproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D61C0DEC-AF59-44ED-BECE-DB9EAB391962} - Library - 1699 - bin\Debug\Novell.Directory.Ldap-tests-net_4_0 - True - False - - Properties - - - Novell.Directory.Ldap_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {D6DA2E60-D81F-42EC-991E-ED2FFBD5094D} - Novell.Directory.Ldap\Novell.Directory.Ldap-net_4_0 - - - - - - - diff --git a/mcs/class/Npgsql/Npgsql-net_2_0.csproj b/mcs/class/Npgsql/Npgsql-net_2_0.csproj deleted file mode 100644 index 831627755be..00000000000 --- a/mcs/class/Npgsql/Npgsql-net_2_0.csproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {13268A15-2B77-416C-B815-B0AF1848580E} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Npgsql - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - - Npgsql.NpgsqlState.resources - - - Npgsql.NpgsqlClosedState.resources - - - Npgsql.NpgsqlParameterCollection.resources - - - Npgsql.NpgsqlParameter.resources - - - Npgsql.NpgsqlCommand.resources - - - Npgsql.NpgsqlCommandBuilder.resources - - - Npgsql.NpgsqlConnectedState.resources - - - Npgsql.NpgsqlConnection.resources - - - Npgsql.NpgsqlReadyState.resources - - - Npgsql.NpgsqlTransaction.resources - - - Npgsql.NpgsqlEventLog.resources - - - Npgsql.NpgsqlException.resources - - - Npgsql.PGUtil.resources - - - Npgsql.NpgsqlConnectionString.resources - - - NpgsqlTypes.NpgsqlTypesHelper.resources - - - - diff --git a/mcs/class/Npgsql/Npgsql-net_4_0.csproj b/mcs/class/Npgsql/Npgsql-net_4_0.csproj deleted file mode 100644 index 3ea1ceae08c..00000000000 --- a/mcs/class/Npgsql/Npgsql-net_4_0.csproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {65DBA42E-7B72-4718-9DC5-468A2EEEE55E} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - Npgsql - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Mono.Security\Mono.Security-net_4_0 - - - - - - - - Npgsql.NpgsqlState.resources - - - Npgsql.NpgsqlClosedState.resources - - - Npgsql.NpgsqlParameterCollection.resources - - - Npgsql.NpgsqlParameter.resources - - - Npgsql.NpgsqlCommand.resources - - - Npgsql.NpgsqlCommandBuilder.resources - - - Npgsql.NpgsqlConnectedState.resources - - - Npgsql.NpgsqlConnection.resources - - - Npgsql.NpgsqlReadyState.resources - - - Npgsql.NpgsqlTransaction.resources - - - Npgsql.NpgsqlEventLog.resources - - - Npgsql.NpgsqlException.resources - - - Npgsql.PGUtil.resources - - - Npgsql.NpgsqlConnectionString.resources - - - NpgsqlTypes.NpgsqlTypesHelper.resources - - - - diff --git a/mcs/class/Npgsql/Npgsql-tests-net_2_0.csproj b/mcs/class/Npgsql/Npgsql-tests-net_2_0.csproj deleted file mode 100644 index fbb242e28bd..00000000000 --- a/mcs/class/Npgsql/Npgsql-tests-net_2_0.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2B752480-031B-4781-91D0-0250D4B9F372} - Library - 1699,618,219,169 - bin\Debug\Npgsql-tests-net_2_0 - True - False - - Properties - - - Npgsql_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {13268A15-2B77-416C-B815-B0AF1848580E} - Npgsql\Npgsql-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - - - - - diff --git a/mcs/class/Npgsql/Npgsql-tests-net_4_0.csproj b/mcs/class/Npgsql/Npgsql-tests-net_4_0.csproj deleted file mode 100644 index 77f5f9c8a53..00000000000 --- a/mcs/class/Npgsql/Npgsql-tests-net_4_0.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E2EB45EC-208E-4A71-9A13-368BA39E888B} - Library - 1699,618,219,169 - bin\Debug\Npgsql-tests-net_4_0 - True - False - - Properties - - - Npgsql_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {65DBA42E-7B72-4718-9DC5-468A2EEEE55E} - Npgsql\Npgsql-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {C385F6FA-0893-438F-AA08-32E08FF478AA} - System.Web\System.Web-net_4_0-1 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - - - - - diff --git a/mcs/class/PEAPI/PEAPI-net_2_0.csproj b/mcs/class/PEAPI/PEAPI-net_2_0.csproj deleted file mode 100644 index 22a4588502b..00000000000 --- a/mcs/class/PEAPI/PEAPI-net_2_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {49C972D3-309D-4B4E-AEB7-01030E473870} - Library - 1699,414,618 - ./../../class/lib/net_2_0 - True - True - - Properties - - - PEAPI - v2.0 - 512 - - - true - full - 1699,414,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,414,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/PEAPI/PEAPI-net_4_0.csproj b/mcs/class/PEAPI/PEAPI-net_4_0.csproj deleted file mode 100644 index 0acd5338385..00000000000 --- a/mcs/class/PEAPI/PEAPI-net_4_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1EE472E0-5E7F-484A-A5DC-D88E13210743} - Library - 1699,414,618 - ./../../class/lib/net_4_0 - True - True - - Properties - - - PEAPI - v4.0 - 512 - - - true - full - 1699,414,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,414,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_2_0.csproj b/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_2_0.csproj deleted file mode 100644 index 002f0f56eb2..00000000000 --- a/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_2_0.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B0FB491D-9EEC-47DC-B7D0-1D6B58F726AC} - Library - 1699 - ./../../../../class/lib/net_2_0 - True - True - - Properties - - - RabbitMQ.Client.Apigen - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_4_0.csproj b/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_4_0.csproj deleted file mode 100644 index 31e6200e3de..00000000000 --- a/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_4_0.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DE8E8510-953B-4927-9923-633C33F18043} - Library - 1699 - ./../../../../class/lib/net_4_0 - True - True - - Properties - - - RabbitMQ.Client.Apigen - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - - - - - diff --git a/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_2_0.csproj b/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_2_0.csproj deleted file mode 100644 index 099fd1680e2..00000000000 --- a/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_2_0.csproj +++ /dev/null @@ -1,211 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {962E924C-777A-42E1-B7AC-823BFA34D22C} - Library - 1699,618 - ./../../../../class/lib/net_2_0 - True - True - - Properties - - - RabbitMQ.Client - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_4_0.csproj b/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_4_0.csproj deleted file mode 100644 index 39e666be678..00000000000 --- a/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_4_0.csproj +++ /dev/null @@ -1,211 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E06EB369-D458-4373-ABA7-CE156714DE4F} - Library - 1699,618 - ./../../../../class/lib/net_4_0 - True - True - - Properties - - - RabbitMQ.Client - v4.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - diff --git a/mcs/class/System.ComponentModel.Composition/.gitignore b/mcs/class/System.ComponentModel.Composition/.gitignore deleted file mode 100644 index 270df4cda87..00000000000 --- a/mcs/class/System.ComponentModel.Composition/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.resources diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AggregateCatalog.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AggregateCatalog.xml deleted file mode 100644 index 7c9a15cb56a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AggregateCatalog.xml +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartCatalog - - - - System.ComponentModel.Composition.Hosting.INotifyComposablePartCatalogChanged - - - - To be added. - - - A catalog that combines the elements of objects. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified catalogs. - - - A collection of objects to add to the or null to create an empty . - - - - - - Constructor - - 4.0.0.0 - - - - - - System.ParamArray - - - - - - To be added. - - - Initializes a new instance of the class with the specified catalogs. - - - A array of objects to add to the . - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.ICollection<System.ComponentModel.Composition.Primitives.ComposablePartCatalog> - - - To be added. - To be added. - - - Gets the underlying catalogs of the object. - - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs> - - - To be added. - - - Occurs when the contents of the object have changed. - - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs> - - - To be added. - - - Occurs when the contents of the object are changing. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerator<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - - To be added. - - - Returns an enumerator that iterates through the catalog. - - - - An enumerator that can be used to iterate through the catalog. - - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Tuple<System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.ComponentModel.Composition.Primitives.ExportDefinition>> - - - - - - To be added. - - - Gets the export definitions that match the constraint expressed by the specified definition. - - - - A collection of containing the objects and their associated objects for objects that match the constraint specified by . - - - The conditions of the objects to be returned. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Raises the event. - - - A object that contains the event data. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Raises the event. - - - A object that contains the event data. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AggregateExportProvider.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AggregateExportProvider.xml deleted file mode 100644 index 35d97377e5f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AggregateExportProvider.xml +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.ExportProvider - - - - System.IDisposable - - - - To be added. - - - Retrieves exports provided by a collection of objects. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - - The class consults the providers in the order in which they have been specified when it calls . - The does not take ownership of the specified providers. That is, it tries to dispose of any of the providers when it is disposed. - - - - Initializes a new instance of the class. - - - The prioritized list of export providers. The providers are consulted in the order in which they are supplied. - - - - - - Constructor - - 4.0.0.0 - - - - - - System.ParamArray - - - - - - - - The class consults the providers in the order in which they have been specified when it calls . - The does not take ownership of the specified providers. That is, it tries to dispose of any of the providers when it is disposed. - - - - Initializes a new instance of the class. - - - The prioritized list of export providers. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method. - - Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method. - - - - - Releases all resources used by the current instance of the class. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the class and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> - - - - - - - - - Implementers should not treat cardinality-related mismatches as errors and are not expected to throw exceptions in those cases. - For example, if the import requests exactly one export and the provider has either no matching exports or more than one, the method should return an empty collection of . - - - - Gets all the exports that match the conditions of the specified import. - - - - A collection that contains all the exports that match the specified condition. - - - The conditions of the objects to be returned. - - The transactional container for the composition. - - - - - - Property - - 4.0.0.0 - - - System.Collections.ObjectModel.ReadOnlyCollection<System.ComponentModel.Composition.Hosting.ExportProvider> - - - To be added. - To be added. - - - Gets a collection that contains the providers that the object aggregates. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ApplicationCatalog.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ApplicationCatalog.xml deleted file mode 100644 index b984c29b747..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ApplicationCatalog.xml +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartCatalog - - - - System.ComponentModel.Composition.Primitives.ICompositionElement - - - - To be added. - - - Discovers attributed parts in the dynamic link library (DLL) and EXE files in an application's directory and path. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class by using the specified source for parts. - - - The element used by diagnostics to identify the source for parts. - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class by using the specified reflection context. - - - The reflection context. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class by using the specified reflection context and source for parts. - - - The reflection context. - - The element used by diagnostics to identify the source for parts. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerator<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - - To be added. - - - Returns an enumerator that iterates through the collection. - - - - An enumerator that can be used to iterate through the collection. - - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Tuple<System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.ComponentModel.Composition.Primitives.ExportDefinition>> - - - - - - To be added. - - - Gets the export definitions that match the constraint expressed by the specified import definition. - - - - A collection of objects that contain the objects and their associated objects that match the specified constraint. - - - The conditions of the objects to be returned. - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - - - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - - - - Gets the display name of the application catalog. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ICompositionElement - - - To be added. - - - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - - - - Gets the composition element from which the application catalog originated. - - - - - - - Method - - 4.0.0.0 - - - System.String - - - - To be added. - - - Retrieves a string representation of the application catalog. - - - - A string representation of the catalog. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AssemblyCatalog.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AssemblyCatalog.xml deleted file mode 100644 index 935a63d93b2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AssemblyCatalog.xml +++ /dev/null @@ -1,381 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartCatalog - - - - System.ComponentModel.Composition.Primitives.ICompositionElement - - - - - System.Diagnostics.DebuggerTypeProxy(typeof(System.ComponentModel.Composition.Hosting.AssemblyCatalogDebuggerProxy)) - - - - - - An is used to parse all the parts present in a specified assembly. The target assembly can be indicated either by object reference or by path. - This type is thread safe. - - - - Discovers attributed parts in a managed code assembly. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified assembly. - - - The assembly that contains the attributed objects to add to the object. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - The assembly referenced by is loaded into the load context. - - - - Initializes a new instance of the class with the specified code base. - - - A string that specifies the code base of the assembly (that is, the path to the assembly file) that contains the attributed objects to add to the object. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified assembly. - - - The assembly that contains the attributed objects to add to the object. - - The element used by diagnostics to identify the sources of parts. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified assembly and reflection context. - - - The assembly that contains the attributed objects to add to the object. - - The context used by the catalog to interpret types. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified code base. - - - A string that specifies the code base of the assembly (that is, the path to the assembly file) that contains the attributed objects to add to the object. - - The element used by diagnostics to identify the sources of parts. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified code base and reflection context. - - - A string that specifies the code base of the assembly (that is, the path to the assembly file) that contains the attributed objects to add to the object. - - The context used by the catalog to interpret types. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified assembly and reflection context. - - - The assembly that contains the attributed objects to add to the object. - - The context used by the catalog to interpret types. - - The element used by diagnostics to identify the sources of parts. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified code base and reflection context. - - - A string that specifies the code base of the assembly (that is, the path to the assembly file) that contains the attributed objects to add to the object. - - The context used by the catalog to interpret types. - - The element used by diagnostics to identify the sources of parts. - - - - - - Property - - 4.0.0.0 - - - System.Reflection.Assembly - - - To be added. - To be added. - - - Gets the assembly whose attributed types are contained in the assembly catalog. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerator<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - - To be added. - - - Returns an enumerator that iterates through the catalog. - - - - An enumerator that can be used to iterate through the catalog. - - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Tuple<System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.ComponentModel.Composition.Primitives.ExportDefinition>> - - - - - - To be added. - - - Gets a collection of exports that match the conditions specified by the import definition. - - - - A collection of exports that match the conditions specified by . - - - Conditions that specify which exports to match. - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - - - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - - - - Gets the display name of the object. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ICompositionElement - - - To be added. - - - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - - - - Gets the composition element that this element originated from. - - - - - - - Method - - 4.0.0.0 - - - System.String - - - - To be added. - - - Gets a string representation of the assembly catalog. - - - - A representation of the assembly catalog. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AtomicComposition.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AtomicComposition.xml deleted file mode 100644 index 1542a5e8912..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/AtomicComposition.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - System.IDisposable - - - - To be added. - - - Represents a single composition operation for transactional composition. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified parent . - - - The parent of this composition operation. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Adds an action to be executed when the overall composition operation completes successfully. - - - The action to be executed. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Adds an action to be executed if the overall composition operation fails. - - - The action to be executed. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - If this is nested, completion actions will not be executed until the parent composition operation has also completed. - - - - Marks this composition operation as complete. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method. - - Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method. - - - - - Releases all resources used by the current instance of the class, and mark this composition operation as failed. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - To be added. - - - Saves a key-value pair in the transaction to track tentative state. - - - The key to save. - - The value to save. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CatalogExportProvider.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CatalogExportProvider.xml deleted file mode 100644 index 2243cfd22cc..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CatalogExportProvider.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.ExportProvider - - - - System.IDisposable - - - - To be added. - - - Retrieves exports from a catalog. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified catalog. - - - The catalog that the uses to produce objects. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified catalog and optional thread-safe mode. - - - The catalog that the uses to produce objects. - - true if this object must be thread-safe; otherwise, false. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified catalog and composition options. - - - The catalog that the uses to produce objects. - - Options that determine the behavior of this provider. - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartCatalog - - - To be added. - To be added. - - - Gets the catalog that is used to provide exports. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method. - - Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method. - - - - - Releases all resources used by the current instance of the class. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> - - - - - - - - - Implementers should not treat cardinality-related mismatches as errors and should not throw exceptions for cardinality-related mismatches. For example, if the import requests exactly one export and the provider has either no matching exports or more than one, the method should return an empty collection of objects. - - - - Returns all exports that match the conditions of the specified import. - - - - A collection that contains all the exports that match the specified condition. - - - The conditions of the objects to be returned. - - The composition transaction to use, or null to disable transactional composition. - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.ExportProvider - - - To be added. - - - You must set this property before you access any methods on the object. - - - - Gets or sets the export provider that provides access to additional exports. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CatalogExtensions.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CatalogExtensions.xml deleted file mode 100644 index 2d56d3d466d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CatalogExtensions.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Provides extension methods for constructing composition services. - - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.CompositionService - - - - - - To be added. - - - Creates a new composition service by using the specified catalog as a source for exports. - - - - A new composition service. - - - The catalog that will provide exports. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ComposablePartCatalogChangeEventArgs.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ComposablePartCatalogChangeEventArgs.xml deleted file mode 100644 index a14855a728a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ComposablePartCatalogChangeEventArgs.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.EventArgs - - - - To be added. - - - Provides data for the event. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified changes. - - - The part definitions that were added to the catalog. - - The part definitions that were removed from the catalog. - - The composition transaction to use, or null to disable transactional composition. - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - To be added. - To be added. - - - Gets a collection of definitions added to the in this change. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.AtomicComposition - - - To be added. - To be added. - - - Gets the composition transaction for this change. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - To be added. - To be added. - - - Gets a collection of definitions removed from the in this change. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ComposablePartExportProvider.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ComposablePartExportProvider.xml deleted file mode 100644 index 1f7ee3eeef9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ComposablePartExportProvider.xml +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.ExportProvider - - - - System.IDisposable - - - - To be added. - - - Retrieves exports from a part. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class, optionally in thread-safe mode. - - - true if the object must be thread-safe; otherwise, false. - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified composition options. - - - Options that specify the behavior of this provider. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Executes composition on the specified batch. - - - The batch to execute composition on. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method. - - Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method. - - - - - Releases all resources used by the current instance of the class. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> - - - - - - - - - Implementers should not treat cardinality-related mismatches as errors and should not throw exceptions for cardinality-related mismatches. For example, if the import requests exactly one export and the provider has no matching exports or more than one, the method should return an empty collection of objects. - - - - Gets a collection of all exports in this provider that match the conditions of the specified import. - - - - A collection of all exports in this provider that match the specified conditions. - - - The that defines the conditions of the to get. - - The composition transaction to use, or null to disable transactional composition. - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.ExportProvider - - - To be added. - - - This property must be set before accessing any methods on the . - - - - Gets or sets the export provider that provides access to additional objects. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionBatch.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionBatch.xml deleted file mode 100644 index fd793158c03..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionBatch.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Represents a set of objects which will be added or removed from the container in a single transactional composition. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified parts for addition and removal. - - - A collection of objects to add. - - A collection of objects to remove. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - To be added. - - - Adds the specified export to the object. - - - - The part added. - - - The export to add to the object. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Adds the specified part to the object. - - - The part to add. - - - - - - Property - - 4.0.0.0 - - - System.Collections.ObjectModel.ReadOnlyCollection<System.ComponentModel.Composition.Primitives.ComposablePart> - - - To be added. - To be added. - - - Gets the collection of objects to be added. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.ObjectModel.ReadOnlyCollection<System.ComponentModel.Composition.Primitives.ComposablePart> - - - To be added. - To be added. - - - Gets the collection of objects to be removed. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Puts the specified part on the list of parts to remove. - - - The part to be removed. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionConstants.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionConstants.xml deleted file mode 100644 index 6df3b0ecfcb..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionConstants.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - - - Do not create metadata by using any of the keys in this class, except to deliberately interact with the composition system. Other uses will cause unpredictable behavior. - - - - Contains static metadata keys used by the composition system. - - - - - - - Field - - 4.0.0.0 - - - System.String - - - To be added. - - - Specifies the metadata key created by the composition system to mark a part with a unique identifier. - - - - - - - Field - - 4.0.0.0 - - - System.String - - - To be added. - - - Specifies the metadata key created by the composition system to mark a generic contract. - - - - - - - Field - - 4.0.0.0 - - - System.String - - - To be added. - - - Specifies the metadata key created by the composition system to mark generic parameters. - - - - - - - Field - - 4.0.0.0 - - - System.String - - - To be added. - - - Specifies the metadata key created by the composition system to mark an import source. - - - - - - - Field - - 4.0.0.0 - - - System.String - - - To be added. - - - Specifies the metadata key created by the composition system to mark an IsGenericPart method. - - - - - - - Field - - 4.0.0.0 - - - System.String - - - To be added. - - - Specifies the metadata key created by the composition system to mark a part with a creation policy. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionContainer.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionContainer.xml deleted file mode 100644 index b1879b7965e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionContainer.xml +++ /dev/null @@ -1,512 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.ExportProvider - - - - System.ComponentModel.Composition.ICompositionService - - - System.IDisposable - - - - - - A object serves two major purposes in an application. First, it keeps track of which parts are available for composition and what their dependencies are, and performs composition whenever the set of available parts changes. Second, it provides the methods by which the application gets instances of composed parts or fills the dependencies of a composable part. - Parts can be made available to the container either directly or through the property. All the parts discoverable in this are available to the container to fulfill imports, along with any parts added directly. - The method allows instantiated parts to be added to an existing container. Assuming composition is successful, these parts will have their imports filled with parts retrieved from the container, and their exports will be available to other parts. Imports marked as recomposable will be registered for recomposition. - The method allows a part to have its imports filled without being added to the container. If the composition is successful, the part's imports will be filled, but the part's exports will not be available to other parts and no imports will be registered for recomposition. - - objects should always be disposed. When the method is called, the object also disposes all the parts that it has created. - A object that can be accessed from multiple threads must be constructed with the parameter set to true, using the constructor. Performance will be slightly slower when is true, so we recommend that you set this parameter to false in single-threaded scenarios. The default is false. - - A should never import itself, or a part that has a reference to it. Such a reference could allow an untrusted part to gain access all the parts in the container. - - - - - Manages the composition of parts. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - System.ParamArray - - - - - - To be added. - - - Initializes a new instance of the class with the specified export providers. - - - An array of objects that provide the access to objects, or null to set to an empty . - - - - - - Constructor - - 4.0.0.0 - - - - - - - System.ParamArray - - - - - - To be added. - - - Initializes a new instance of the class with the specified export providers and options. - - - An object that specifies the behavior of this container. - - An array of objects that provide the access to objects, or null to set to an empty . - - - - - - Constructor - - 4.0.0.0 - - - - - - - System.ParamArray - - - - - - To be added. - - - Initializes a new instance of the class with the specified catalog and export providers. - - - A catalog that provides objects to the . - - An array of objects that provide the access to objects, or null to set to an empty . - - - - - - Constructor - - 4.0.0.0 - - - - - - - - System.ParamArray - - - - - - - - A object that can be accessed from multiple threads must set the parameter to true. Performance will be slightly slower when is true, so we recommend that you set this parameter to false in single-threaded scenarios. The default is false. - - - - Initializes a new instance of the class with the specified catalog, thread-safe mode, and export providers. - - - A catalog that provides objects to the . - - true if this object must be thread-safe; otherwise, false. - - An array of objects that provide the access to objects, or null to set the property to an empty . - - - - - - Constructor - - 4.0.0.0 - - - - - - - - System.ParamArray - - - - - - To be added. - - - Initializes a new instance of the class with the specified catalog, options, and export providers. - - - A catalog that provides objects to the . - - An object that specifies options that affect the behavior of the container. - - An array of objects that provide the access to objects, or null to set to an empty . - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartCatalog - - - To be added. - To be added. - - - Gets the that provides the container access to objects. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - - This method is the primary way of directly adding or removing parts from the container. The will always maintain a stable, composed state. Therefore, calling with an empty is never necessary to start composition. Instead, call the method whenever you need to make changes to the parts available to the . - The can contain both parts to be added and parts to be removed. Recomposition will take place only once for each call to . - - - - Adds or removes the parts in the specified from the container and executes composition. - - - Changes to the to include during the composition. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method. - - Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method. - - - - - Releases all resources used by the current instance of the class. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> - - - - - - - - - Implementations should not treat cardinality-related mismatches as errors and should not throw exceptions for cardinality-related mismatches. For example, if the import requests exactly one export and the provider has either no matching exports or more than one, the method should return an empty collection of objects. - - - - Returns a collection of all exports that match the conditions in the specified object. - - - - A collection of all the objects in this object that match the conditions specified by . - - - The object that defines the conditions of the objects to get. - - The composition transaction to use, or null to disable transactional composition. - - - - - - Property - - 4.0.0.0 - - - System.Collections.ObjectModel.ReadOnlyCollection<System.ComponentModel.Composition.Hosting.ExportProvider> - - - To be added. - To be added. - - - Gets the export providers that provide the container access to additional objects. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - - The behavior of this method may vary depending on the implementation of the that produced the instance. As a rule, non-shared exports should be detached from the container. - For example, the will only release an if it comes from a that was constructed under a context. Release in this context means walking the dependency chain of the objects, detaching references from the container and calling Dispose on the objects as needed. If the was constructed under a context the will do nothing, as the specified may being used by other requestors. Those will only be detached when the container is itself disposed. - - - - Releases the specified object from the . - - - The that needs to be released. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - - - To be added. - - - Removes the specified export from composition and releases its resources if possible. - - - An indirect reference to the export to remove. - - The type of the export. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - - The behavior of this method may vary depending on the context in which the was constructed. For more information, see the method. - - - - Releases a set of objects from the . - - - A collection of objects to be released. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - - - To be added. - - - Removes a collection of exports from composition and releases their resources if possible. - - - A collection of indirect references to the exports to be removed. - - The type of the exports. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Satisfies the imports of the specified object without registering it for recomposition. - - - The part to satisfy the imports of. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionOptions.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionOptions.xml deleted file mode 100644 index 21b808a7e74..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionOptions.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Enum - - - - System.Flags - - - - To be added. - - - Defines options for export providers. - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.CompositionOptions - - - - - No options are defined. - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.CompositionOptions - - - - - Silent rejection is disabled, so all rejections will result in errors. - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.CompositionOptions - - - - - This provider is an export composition service. - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.CompositionOptions - - - - - This provider should be thread-safe. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionScopeDefinition.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionScopeDefinition.xml deleted file mode 100644 index dffd288b862..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionScopeDefinition.xml +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartCatalog - - - - System.ComponentModel.Composition.Hosting.INotifyComposablePartCatalogChanged - - - - - System.Diagnostics.DebuggerTypeProxy(typeof(System.ComponentModel.Composition.Hosting.CompositionScopeDefinitionDebuggerProxy)) - - - - To be added. - - - Represents a node in a tree of scoped catalogs, reflecting an underlying catalog and its child scopes. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified underlying catalog and children. - - - The underlying catalog for this catalog. - - A collection of the child scopes of this catalog. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified underlying catalog, children, and public surface. - - - The underlying catalog for this catalog. - - A collection of the child scopes of this catalog. - - The public surface for this catalog. - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs> - - - To be added. - - - Occurs when the underlying catalog has changed, if that catalog supports notifications. - - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs> - - - To be added. - - - Occurs when the underlying catalog is changing, if that catalog supports notifications. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Hosting.CompositionScopeDefinition> - - - To be added. - To be added. - - - Gets the child scopes of this catalog. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - - This method is called only by the public Dispose() and Finalize() methods; do not call this method directly.When you implement the dispose pattern, the Boolean parameter of the Dispose(Boolean) method should be used as follows: - - - The Dispose() method of the current object should call Dispose(Boolean) with the Boolean parameter set to true to release both managed and unmanaged resources. - - - The Finalize() method of the current object should call Dispose(Boolean) with the Boolean parameter set to false to release only unmanaged resources. - - - For more information, see Implementing a Dispose Method. - - - - Called by the Dispose() and Finalize() methods to release the managed and unmanaged resources used by the current instance of the class. - - - true to release managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerator<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - - To be added. - - - Returns an enumerator that iterates through the catalog. - - - - An enumerator that can be used to iterate through the catalog. - - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Tuple<System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.ComponentModel.Composition.Primitives.ExportDefinition>> - - - - - - To be added. - - - Gets a collection of exports that match the conditions specified by the import definition. - - - - A collection of exports that match the specified conditions. - - - Conditions that specify which exports to match. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Raises the event. - - - Contains data for the event. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Raises the event. - - - Contains data for the event. - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ExportDefinition> - - - To be added. - To be added. - - - Gets a collection of parts visible to the parent scope of this catalog. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionService.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionService.xml deleted file mode 100644 index a490bd433c7..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/CompositionService.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - System.ComponentModel.Composition.ICompositionService - - - System.IDisposable - - - - To be added. - - - Provides methods to satisfy imports on an existing part instance. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method. - - Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method. - - - - - Releases all resources used by the current instance of the class. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Composes the specified part, with recomposition and validation disabled. - - - The part to compose. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/DirectoryCatalog.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/DirectoryCatalog.xml deleted file mode 100644 index 610a5c3e91d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/DirectoryCatalog.xml +++ /dev/null @@ -1,556 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartCatalog - - - - System.ComponentModel.Composition.Hosting.INotifyComposablePartCatalogChanged - - - System.ComponentModel.Composition.Primitives.ICompositionElement - - - - - System.Diagnostics.DebuggerTypeProxy(typeof(System.ComponentModel.Composition.Hosting.DirectoryCatalog/DirectoryCatalogDebuggerProxy)) - - - - - - You can use a object to parse the contents of a designated directory. Any attributed parts contained in dynamic link library (DLL) files are extracted and made available through the catalog.To restrict parsing to specific DLLs, you can specify a search pattern by using the same syntax as the method. - - The designated directory should not allow access to non-administrators. For example, using a folder that contains temporary Internet files could create vulnerabilities in your application. - - - - - Discovers attributed parts in the assemblies in a specified directory. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class by using objects based on all the DLL files in the specified directory path. - - - The path to the directory to scan for assemblies to add to the catalog. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class by using objects based on all the DLL files in the specified directory path with the specified source for parts. - - - The path to the directory to scan for assemblies to add to the catalog. - - The element used by diagnostics to identify the source for parts. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class by using objects based on all the DLL files in the specified directory path, in the specified reflection context. - - - The path to the directory to scan for assemblies to add to the catalog. - - The context used to create parts. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class by using objects that match a specified search pattern in the specified directory path. - - - The path to the directory to scan for assemblies to add to the catalog. - - The search string. The format of the string should be the same as specified for the method. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class by using objects based on all the DLL files in the specified directory path, in the specified reflection context. - - - The path to the directory to scan for assemblies to add to the catalog. - - The context used to create parts. - - The element used by diagnostics to identify the source for parts. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class by using objects based on the specified search pattern in the specified directory path with the specified source for parts. - - - The path to the directory to scan for assemblies to add to the catalog. - - The search string. The format of the string should be the same as specified for the method. - - The element used by diagnostics to identify the source for parts. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class by using objects based on the specified search pattern in the specified directory path, using the specified reflection context. - - - The path to the directory to scan for assemblies to add to the catalog. - - The search string. The format of the string should be the same as specified for the method. - - The context used to create parts. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - - To be added. - - - Initializes a new instance of the class by using objects based on the specified search pattern in the specified directory path, using the specified reflection context. - - - The path to the directory to scan for assemblies to add to the catalog. - - The search string. The format of the string should be the same as specified for the method. - - The context used to create parts. - - The element used by diagnostics to identify the source for parts. - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs> - - - To be added. - - - Occurs when the contents of the catalog has changed. - - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs> - - - To be added. - - - Occurs when the catalog is changing. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets the translated absolute path observed by the object. - - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerator<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - - To be added. - - - Returns an enumerator that iterates through the catalog. - - - - An enumerator that can be used to iterate through the catalog. - - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Tuple<System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.ComponentModel.Composition.Primitives.ExportDefinition>> - - - - - - To be added. - - - Gets the export definitions that match the constraint expressed by the specified import definition. - - - - A collection of objects that contain the objects and their associated objects that match the constraint specified by . - - - The conditions of the objects to be returned. - - - - - - Property - - 4.0.0.0 - - - System.Collections.ObjectModel.ReadOnlyCollection<System.String> - - - To be added. - To be added. - - - Gets the collection of files currently loaded in the catalog. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Raises the event. - - - An object that contains the event data. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Raises the event. - - - An object that contains the event data. - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets the path observed by the object. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - If files were added to the directory, they are also added to the catalog. If files were removed from the directory, they are also removed from the catalog. For files that have been removed, the assembly cannot be unloaded from the process, so objects for those files will be removed only from the catalog. - - - - Refreshes the objects with the latest files in the directory that match the search pattern. - - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets the search pattern that is passed into the constructor of the object. - - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - - - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - - - - Gets the display name of the directory catalog. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ICompositionElement - - - To be added. - - - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - - - - Gets the composition element from which the directory catalog originated. - - - - - - - Method - - 4.0.0.0 - - - System.String - - - - To be added. - - - Gets a string representation of the directory catalog. - - - - A string representation of the catalog. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ExportProvider.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ExportProvider.xml deleted file mode 100644 index 77778f5917a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ExportProvider.xml +++ /dev/null @@ -1,761 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Retrieves exports which match a specified object. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ExportsChangeEventArgs> - - - To be added. - - - Occurs when the exports in the change. - - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ExportsChangeEventArgs> - - - To be added. - - - Occurs when the provided exports are changing. - - - - - - - Method - - 4.0.0.0 - - - System.Lazy<T> - - - - - - - - - The contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Returns the export with the contract name derived from the specified type parameter. If there is not exactly one matching export, an exception is thrown. - - - - The export with the contract name derived from the specified type parameter. - - - The type parameter of the object to return. The contract name is also derived from this type parameter. - - - - - - Method - - 4.0.0.0 - - - System.Lazy<T> - - - - - - - - - - - The default contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Returns the export with the specified contract name. If there is not exactly one matching export, an exception is thrown. - - - - The export with the specified contract name. - - - The contract name of the object to return, or null or an empty string ("") to use the default contract name. - - The type parameter of the object to return. - - - - - - Method - - 4.0.0.0 - - - System.Lazy<T,TMetadataView> - - - - - - - - - - The contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Returns the export with the contract name derived from the specified type parameter. If there is not exactly one matching export, an exception is thrown. - - - - System.Lazy`2 - - - The type parameter of the object to return. The contract name is also derived from this type parameter. - - The type of the metadata view of the object to return. - - - - - - Method - - 4.0.0.0 - - - System.Lazy<T,TMetadataView> - - - - - - - - - - - - The default contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Returns the export with the specified contract name. If there is not exactly one matching export, an exception is thrown. - - - - The export with the specified contract name. - - - The contract name of the object to return, or null or an empty string ("") to use the default contract name. - - The type parameter of the object to return. - - The type of the metadata view of the object to return. - - - - - - Method - - 4.0.0.0 - - - T - - - - - - - - - The contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Returns the exported object with the contract name derived from the specified type parameter. If there is not exactly one matching exported object, an exception is thrown. - - - - The exported object with the contract name derived from the specified type parameter. - - - The type of the exported object to return. The contract name is also derived from this type parameter. - - - - - - Method - - 4.0.0.0 - - - T - - - - - - - - - - - The default contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Returns the exported object with the specified contract name. If there is not exactly one matching exported object, an exception is thrown. - - - - The exported object with the specified contract name. - - - The contract name of the exported object to return, or null or an empty string ("") to use the default contract name. - - The type of the exported object to return. - - - - - - Method - - 4.0.0.0 - - - T - - - - - - - - - If the exported object is not found, this method returns the appropriate default value for ; for example, zero for integer types, false for Boolean types, and null for reference types. - The contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Gets the exported object with the contract name derived from the specified type parameter or the default value for the specified type, or throws an exception if there is more than one matching exported object. - - - - The exported object with the contract name derived from , if found; otherwise, the default value for . - - - The type of the exported object to return. The contract name is also derived from this type parameter. - - - - - - Method - - 4.0.0.0 - - - T - - - - - - - - - - - If the exported object is not found, this method returns the appropriate default value for ; for example, zero for integer types, false for Boolean types, and null for reference types. - The default contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Gets the exported object with the specified contract name or the default value for the specified type, or throws an exception if there is more than one matching exported object. - - - - The exported object with the specified contract name, if found; otherwise, the default value for . - - - The contract name of the exported object to return, or null or an empty string ("") to use the default contract name. - - The type of the exported object to return. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<T> - - - - - - - - - The contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Gets all the exported objects with the contract name derived from the specified type parameter. - - - - The exported objects with the contract name derived from the specified type parameter, if found; otherwise, an empty object. - - - The type of the exported object to return. The contract name is also derived from this type parameter. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<T> - - - - - - - - - - - The default contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Gets all the exported objects with the specified contract name. - - - - The exported objects with the specified contract name, if found; otherwise, an empty object. - - - The contract name of the exported objects to return; or null or an empty string ("") to use the default contract name. - - The type of the exported object to return. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> - - - - - - To be added. - - - Gets all exports that match the conditions of the specified import definition. - - - - A collection of all the objects matching the condition specified by . - - - The object that defines the conditions of the objects to get. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> - - - - - - - To be added. - - - Gets all exports that match the conditions of the specified import definition and composition. - - - - A collection of all the objects matching the condition specified by and . - - - The object that defines the conditions of the objects to get. - - The transactional container for the composition. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Lazy<System.Object,System.Object>> - - - - - - - - - - The default contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Gets all the exports with the specified contract name. - - - - A collection of all the objects for the contract matching . - - - The type parameter of the objects to return. - - The type of the metadata view of the objects to return. - - The contract name of the object to return, or null or an empty string ("") to use the default contract name. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Lazy<T>> - - - - - - - - - The contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Gets all the exports with the contract name derived from the specified type parameter. - - - - The objects with the contract name derived from , if found; otherwise, an empty object. - - - The type parameter of the objects to return. The contract name is also derived from this type parameter. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Lazy<T>> - - - - - - - - - - - The default contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Gets all the exports with the specified contract name. - - - - The objects with the specified contract name, if found; otherwise, an empty object. - - - The contract name of the objects to return, or null or an empty string ("") to use the default contract name. - - The type parameter of the objects to return. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Lazy<T,TMetadataView>> - - - - - - - - - - The contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Gets all the exports with the contract name derived from the specified type parameter. - - - - The objects with the contract name derived from , if found; otherwise, an empty object. - - - The type parameter of the objects to return. The contract name is also derived from this type parameter. - - The type of the metadata view of the objects to return. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Lazy<T,TMetadataView>> - - - - - - - - - - - - The default contract name is the result of calling the method on . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Gets all the exports with the specified contract name. - - - - The objects with the specified contract name if found; otherwise, an empty object. - - - The contract name of the objects to return, or null or an empty string ("") to use the default contract name. - - The type parameter of the objects to return. The contract name is also derived from this type parameter. - - The type of the metadata view of the objects to return. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.Export> - - - - - - - - - Overrides of this method should not treat cardinality-related mismatches as errors, and should not throw exceptions in those cases. For example, if is and there are zero objects that match the conditions of the specified , an empty collection should be returned. - - - - Gets all the exports that match the constraint defined by the specified definition. - - - - A collection that contains all the exports that match the specified condition. - - - The object that defines the conditions of the objects to return. - - The transactional container for the composition. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Raises the event. - - - An that contains the event data. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Raises the event. - - - An that contains the event data. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ExportsChangeEventArgs.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ExportsChangeEventArgs.xml deleted file mode 100644 index dfa725ee57d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ExportsChangeEventArgs.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.EventArgs - - - - To be added. - - - Provides data for the and event. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class. - - - The events that were added. - - The events that were removed. - - The composition transaction that contains the change. - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ExportDefinition> - - - To be added. - To be added. - - - Gets the exports that were added in this change. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.AtomicComposition - - - To be added. - To be added. - - - Gets the composition transaction of the change, if any. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.String> - - - To be added. - To be added. - - - Gets the contract names that were altered in the change. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ExportDefinition> - - - To be added. - To be added. - - - Gets the exports that were removed in the change. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/FilteredCatalog.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/FilteredCatalog.xml deleted file mode 100644 index c152fc4e90b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/FilteredCatalog.xml +++ /dev/null @@ -1,335 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartCatalog - - - - System.ComponentModel.Composition.Hosting.INotifyComposablePartCatalogChanged - - - - To be added. - - - Represents a catalog after a filter function is applied to it. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified underlying catalog and filter. - - - The underlying catalog. - - The function to filter parts. - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs> - - - To be added. - - - Occurs when the underlying catalog has changed. - - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs> - - - To be added. - - - Occurs when the underlying catalog is changing. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.FilteredCatalog - - - To be added. - To be added. - - - Gets a catalog that contains parts that are present in the underlying catalog but that were filtered out by the filter function. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - - This method is called only by the public Dispose() and Finalize() methods; do not call this method directly.When you implement the dispose pattern, the Boolean parameter of the Dispose(Boolean) method should be used as follows: - - - The Dispose() method of the current object should call Dispose(Boolean) with the Boolean parameter set to true to release both managed and unmanaged resources. - - - The Finalize() method of the current object should call Dispose(Boolean) with the Boolean parameter set to false to release only unmanaged resources. - - - For more information, see Implementing a Dispose Method. - - - - Called by the Dispose() and Finalize() methods to release the managed and unmanaged resources used by the current instance of the class. - - - true to release managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerator<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - - To be added. - - - Returns an enumerator that iterates through the catalog. - - - - An enumerator that can be used to iterate through the catalog. - - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Tuple<System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.ComponentModel.Composition.Primitives.ExportDefinition>> - - - - - - To be added. - - - Gets the exported parts from this catalog that match the specified import. - - - - A collection of matching parts. - - - The import to match. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.FilteredCatalog - - - - To be added. - - - Gets a new object that contains all the parts from this catalog and all their dependencies. - - - - The new catalog. - - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.FilteredCatalog - - - - - - To be added. - - - Gets a new object that contains all the parts from this catalog and all dependencies that can be reached through imports that match the specified filter. - - - - The new catalog. - - - The filter for imports. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.FilteredCatalog - - - - To be added. - - - Gets a new object that contains all the parts from this catalog and all their dependents. - - - - The new catalog. - - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.FilteredCatalog - - - - - - To be added. - - - Gets a new object that contains all the parts from this catalog and all dependents that can be reached through imports that match the specified filter. - - - - The new catalog. - - - The filter for imports. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Raises the event. - - - Provides data for the event. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Raises the event. - - - Provides data for the event. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/INotifyComposablePartCatalogChanged.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/INotifyComposablePartCatalogChanged.xml deleted file mode 100644 index 566aa4b6831..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/INotifyComposablePartCatalogChanged.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - - To be added. - - - Provides notifications when a changes. - - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs> - - - To be added. - - - Occurs when a has changed. - - - - - - - Event - - 4.0.0.0 - - - System.EventHandler<System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs> - - - To be added. - - - Occurs when a is changing. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ImportEngine.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ImportEngine.xml deleted file mode 100644 index fb30567d6df..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ImportEngine.xml +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - System.ComponentModel.Composition.ICompositionService - - - System.IDisposable - - - - - - This class is used internally by . You should generally not use it unless you are authoring a container. - - - - Performs composition for containers. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class. - - - The that provides the access to objects. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class, optionally in thread-safe mode. - - - The that provides the access to objects. - - true if thread safety is required; otherwise, false. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified options. - - - The that provides the access to objects. - - An object that specifies options that affect the behavior of the engine. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method. - - Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method. - - - - - Releases all resources used by the current instance of the class. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - To be added. - - - Previews all the required imports for the specified part to make sure that they can be satisfied, without actually setting them. - - - The part to preview the imports of. - - The composition transaction to use, or null for no composition transaction. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - To be added. - - - Releases all the exports used to satisfy the imports of the specified part. - - - The part to release the imports of. - - The composition transaction to use, or null for no composition transaction. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Satisfies the imports of the specified part. - - - The part to satisfy the imports of. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Satisfies the imports of the specified part without registering them for recomposition. - - - The part to satisfy the imports of. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ScopingExtensions.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ScopingExtensions.xml deleted file mode 100644 index 2a3cdbeb43f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/ScopingExtensions.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Defines static convenience methods for scoping. - - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - To be added. - - - Gets a value that indicates whether the specified part contains metadata that has the specified key. - - - - true if contains metadata that has the specified key; otherwise, false. - - - The part to search. - - The metadata key. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - To be added. - - - Gets a value that indicates whether the specified part exports the specified contract. - - - - true if exports the specified contract; otherwise, false. - - - The part to search. - - The name of the contract. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Hosting.FilteredCatalog - - - - - - - To be added. - - - Filters the specified catalog with the specified filter function. - - - - A new catalog filtered by using the specified filter. - - - The catalog to filter. - - The filter function. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - To be added. - - - Determines whether the specified part imports the specified contract. - - - - true if imports the specified contract; otherwise, false. - - - The part to search. - - The name of the contract. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - - To be added. - - - Determines whether the specified part imports the specified contract with the specified cardinality. - - - - true if imports a contract that has the specified name and cardinality; otherwise, false. - - - The part to search. - - The name of the contract. - - The cardinality of the contract. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/TypeCatalog.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/TypeCatalog.xml deleted file mode 100644 index a41e0f93513..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Hosting/TypeCatalog.xml +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartCatalog - - - - System.ComponentModel.Composition.Primitives.ICompositionElement - - - - - System.Diagnostics.DebuggerTypeProxy(typeof(System.ComponentModel.Composition.Primitives.ComposablePartCatalogDebuggerProxy)) - - - - - - This class is thread safe. - - - - Discovers attributed parts from a collection of types. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified types. - - - A collection of attributed objects to add to the object. - - - - - - Constructor - - 4.0.0.0 - - - - - - System.ParamArray - - - - - - To be added. - - - Initializes a new instance of the class with the specified types. - - - An array of attributed objects to add to the object. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified types and source for parts. - - - A collection of attributed objects to add to the object. - - An element used by diagnostics to identify the source for parts. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified types in the specified reflection context. - - - A collection of attributed objects to add to the object. - - The context used to interpret the types. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified types in the specified reflection context and source for parts. - - - A collection of attributed objects to add to the object. - - The context used to interpret the types. - - An element used by diagnostics to identify the source for parts. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerator<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - - To be added. - - - Returns an enumerator that iterates through the catalog. - - - - An enumerator that can be used to iterate through the catalog. - - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - - - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - - - - Gets the display name of the type catalog. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ICompositionElement - - - To be added. - - - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - - - - Gets the composition element from which the type catalog originated. - - - - - - - Method - - 4.0.0.0 - - - System.String - - - - To be added. - - - Returns a string representation of the type catalog. - - - - A string representation of the type catalog. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePart.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePart.xml deleted file mode 100644 index 5ff46c2e5fc..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePart.xml +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Defines the abstract base class for composable parts, which import objects and produce exported objects. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - Once this method is called, no further imports can be set unless a call is made to Deactivate. - - - - Called when all the imports of the part have been set, and exports can be retrieved. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ExportDefinition> - - - To be added. - - - If the object was created from a object, this property should return the result of . - Overrides of this property should never return null. If the does not have exports, return an empty collection instead. - - - - Gets a collection of the objects that describe the exported objects provided by the part. - - - - - - - Method - - 4.0.0.0 - - - System.Object - - - - - - To be added. - - - Gets the exported object described by the specified object. - - - - The exported object described by . - - - One of the objects from the property that describes the exported object to return. - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ImportDefinition> - - - To be added. - - - If the object was created from a object, this property should return the result of . - Overrides of this property should never return null. If the does not have imports, return an empty collection instead. - - - - Gets a collection of the objects that describe the imported objects required by the part. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IDictionary<System.String,System.Object> - - - To be added. - - - If the object was created from a object, this property should return the result of . - Overrides of this property should return a read-only object with a case-sensitive, non-linguistic comparer, such as , and should never return null. If the does not contain metadata, return an empty instead. - - - - Gets the metadata of the object. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - To be added. - - - Sets the import described by the specified object to be satisfied by the specified exports. - - - One of the objects from the property that specifies the import to be set. - - A collection of objects of which to set the import described by . - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePartCatalog.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePartCatalog.xml deleted file mode 100644 index f127d93bbed..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePartCatalog.xml +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - System.IDisposable - - - - - System.Diagnostics.DebuggerTypeProxy(typeof(System.ComponentModel.Composition.Primitives.ComposablePartCatalogDebuggerProxy)) - - - - - - This type is thread safe. - - - - Represents the abstract base class for composable part catalogs, which collect and return objects. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method. - - Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method. - - - - - Releases all resources used by the . - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerator<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - - To be added. - - - Returns an enumerator that iterates through the catalog. - - - - An enumerator that can be used to iterate through the catalog. - - - - - - - Method - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Tuple<System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.ComponentModel.Composition.Primitives.ExportDefinition>> - - - - - - - - Overrides of this method should never return null. If no matches the conditions defined by , return an empty object. - - - - Gets a list of export definitions that match the constraint defined by the specified object. - - - - A collection of containing the objects and their associated objects for objects that match the constraint specified by . - - - The conditions of the objects to be returned. - - - - - - Property - - 4.0.0.0 - - - - System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never) - - - - System.Linq.IQueryable<System.ComponentModel.Composition.Primitives.ComposablePartDefinition> - - - To be added. - - - Overrides of this property should never return null. - - - - Gets the part definitions that are contained in the catalog. - - - - - - - Method - - 4.0.0.0 - - - System.Collections.IEnumerator - - - - - - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - - - - Returns an enumerator that iterates through the catalog. - - - - An enumerator that can be used to iterate through the catalog. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePartDefinition.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePartDefinition.xml deleted file mode 100644 index 97b9ceb9c04..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePartDefinition.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Defines an abstract base class for composable part definitions, which describe and enable the creation of objects. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - Derived types that override this method should return a new instance of a object every time that the method is invoked and should never return null. - - - - Creates a new instance of a part that the describes. - - - - The created part. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ExportDefinition> - - - To be added. - - - Overrides of this property should never return null. If the objects created by the do not provide exported objects, return an empty collection instead. - - - - Gets a collection of objects that describe the objects exported by the part defined by this object. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.ComponentModel.Composition.Primitives.ImportDefinition> - - - To be added. - - - Overrides of this property should never return null. If the objects created by the do not have imports, return an empty collection instead. - - - - Gets a collection of objects that describe the imports required by the part defined by this object. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IDictionary<System.String,System.Object> - - - To be added. - - - Overrides of this property should return a read-only object with a case-sensitive, non-linguistic comparer, such as , and should never return null. If the does not contain metadata, return an empty object instead. - - - - Gets a collection of the metadata for this object. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePartException.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePartException.xml deleted file mode 100644 index e0924e9db55..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ComposablePartException.xml +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Exception - - - - - System.Diagnostics.DebuggerDisplay("{Message}") - - - System.Diagnostics.DebuggerTypeProxy(typeof(System.ComponentModel.Composition.Primitives.ComposablePartExceptionDebuggerProxy)) - - - - To be added. - - - The exception that is thrown when an error occurs when calling methods on a object. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified error message. - - - A message that describes the , or null to set the property to its default value. - - - - - - Constructor - - 4.0.0.0 - - - - System.Security.SecuritySafeCritical - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified serialization data. - - - An object that holds the serialized object data for the . - - An object that contains contextual information about the source or destination. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified error message and the composition element that is the cause of the exception. - - - A message that describes the , or null to set the property to its default value. - - The composition element that is the cause of the , or null to set the property to null. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified error message and the exception that is the cause of this exception. - - - A message that describes the , or null to set the property to its default value. - - The exception that is the underlying cause of the , or null to set the property to null. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified error message, and the composition element and exception that are the cause of this exception. - - - A message that describes the , or null to set the property to its default value. - - The composition element that is the cause of the , or null to set the property to null. - - The exception that is the underlying cause of the , or null to set the property to null. - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ICompositionElement - - - To be added. - To be added. - - - Gets the composition element that is the cause of the exception. - - - - - - - Method - - 4.0.0.0 - - - - System.Security.SecurityCritical - - - - System.Void - - - - - - - To be added. - - - Gets the serialization data for the exception. - - - After calling the method, contains serialized object data about the . - - After calling the method, contains contextual information about the source or destination. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ContractBasedImportDefinition.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ContractBasedImportDefinition.xml deleted file mode 100644 index 10b6e3e57fe..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ContractBasedImportDefinition.xml +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ImportDefinition - - - - To be added. - - - Represents an import that is required by a object and that can specify both a contract name and metadata. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified contract name, required type identity, required metadata, cardinality, and creation policy, and indicates whether the import definition is recomposable or a prerequisite. - - - The contract name of the object required by the import definition. - - The type identity of the export type expected. Use the method to generate a type identity for a given type. If no specific type is required, use null. - - A collection of key/value pairs that contain the metadata names and types required by the import definition; or null to set the property to an empty collection. - - One of the enumeration values that indicates the cardinality of the objects required by the import definition. - - true to specify that the import definition can be satisfied multiple times throughout the lifetime of a ; otherwise, false. - - true to specify that the import definition is required to be satisfied before a can start producing exported objects; otherwise, false. - - A value that indicates that the importer requires a specific creation policy for the exports used to satisfy this import. If no specific creation policy is needed, the default is . - - - - - - Constructor - - 4.0.0.0 - - - - - - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified contract name, required type identity, required and optional metadata, cardinality, and creation policy, and indicates whether the import definition is recomposable or a prerequisite. - - - The contract name of the object required by the import definition. - - The type identity of the export type expected. Use the method to generate a type identity for a given type. If no specific type is required, use null. - - A collection of key/value pairs that contain the metadata names and types required by the import definition; or null to set the property to an empty collection. - - One of the enumeration values that indicates the cardinality of the objects required by the import definition. - - true to specify that the import definition can be satisfied multiple times throughout the lifetime of a ; otherwise, false. - - true to specify that the import definition is required to be satisfied before a can start producing exported objects; otherwise, false. - - A value that indicates that the importer requires a specific creation policy for the exports used to satisfy this import. If no specific creation policy is needed, the default is . - - The metadata associated with this import. - - - - - - Property - - 4.0.0.0 - - - System.Linq.Expressions.Expression<System.Func<System.ComponentModel.Composition.Primitives.ExportDefinition,System.Boolean>> - - - To be added. - To be added. - - - Gets an expression that defines conditions that must be matched to satisfy the import described by this import definition. - - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - To be added. - - - Returns a value indicating whether the constraint represented by this object is satisfied by the export represented by the given export definition. - - - - true if the constraint is satisfied; otherwise, false. - - - The export definition to test. - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.CreationPolicy - - - To be added. - To be added. - - - Gets or sets a value that indicates that the importer requires a specific for the exports used to satisfy this import. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,System.Type>> - - - To be added. - - - Overrides of this property should never return null or return an collection that contains an element that is null. If the definition does not contain required metadata, return an empty collection instead. - - - - Gets the metadata names of the export required by the import definition. - - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets the expected type of the export that matches this . - - - - - - - Method - - 4.0.0.0 - - - System.String - - - - To be added. - To be added. - - - Returns . - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/Export.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/Export.xml deleted file mode 100644 index b76750e5ec0..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/Export.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Represents an export, which is a type that consists of a delay-created exported object and the metadata that describes that object. - - - - - - - Constructor - - 4.0.0.0 - - - - - - Derived types that call this constructor must override the property and the method. - - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified export definition and exported object getter. - - - An object that describes the contract that the object satisfies. - - A method that is called to create the exported object of the . This delays the creation of the object until the property is called. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified contract name and exported value getter. - - - The contract name of the object. - - A method that is called to create the exported object of the . This delays the creation of the object until the method is called. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified contract name, metadata, and exported value getter. - - - The contract name of the object. - - The metadata of the object or null to set the property to an empty, read-only object. - - A method that is called to create the exported object of the . This delays the creation of the object until the method is called. - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ExportDefinition - - - To be added. - - - Overrides of this property should never return null. - - - - Gets the definition that describes the contract that the export satisfies. - - - - - - - Method - - 4.0.0.0 - - - System.Object - - - - To be added. - - - Returns the exported object the export provides. - - - - The exported object the export provides. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IDictionary<System.String,System.Object> - - - To be added. - - - This property returns the value of of the property. - - - - Gets the metadata for the export. - - - - - - - Property - - 4.0.0.0 - - - System.Object - - - To be added. - To be added. - - - Provides the object this export represents. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ExportDefinition.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ExportDefinition.xml deleted file mode 100644 index 33b735e3a46..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ExportDefinition.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Describes the contract that a particular object satisfies. - - - - - - - Constructor - - 4.0.0.0 - - - - - - Derived types that call this constructor must override the property and optionally, the property. By default, returns an empty, read-only dictionary. - - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified contract name and metadata. - - - The contract name of the object. - - The metadata of the or null to set the property to an empty, read-only object. - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - - - Overrides of this property should never return null or an empty string (""). - - - - Gets the contract name. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IDictionary<System.String,System.Object> - - - To be added. - - - Overrides of this property should return a read-only object with a case-sensitive, non-linguistic comparer, such as , and should never return null. - If the does not contain metadata, return an empty instead. - - - - Gets the contract metadata. - - - - - - - Method - - 4.0.0.0 - - - System.String - - - - To be added. - - - Returns a string representation of the export definition. - - - - A string representation of the export definition. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ExportedDelegate.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ExportedDelegate.xml deleted file mode 100644 index 34386727d0f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ExportedDelegate.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Represents a function exported by a . - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class for the specified part and method. - - - The part exporting the method. - - The method to be exported. - - - - - - Method - - 4.0.0.0 - - - System.Delegate - - - - - - To be added. - - - Gets a delegate of the specified type. - - - - A delegate of the specified type, or null if no such delegate can be created. - - - The type of the delegate to return. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ICompositionElement.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ICompositionElement.xml deleted file mode 100644 index 957386ece9a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ICompositionElement.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - - To be added. - - - Represents an element that participates in composition. - - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - - - Implementers of this property should never return null or an empty string (""). - - - - Gets the display name of the composition element. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ICompositionElement - - - To be added. - To be added. - - - Gets the composition element from which the current composition element originated. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ImportCardinality.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ImportCardinality.xml deleted file mode 100644 index 87bd4da3b7b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ImportCardinality.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Enum - - - To be added. - - - Indicates the cardinality of the objects required by an . - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ImportCardinality - - - - - Exactly one object is required by the . - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ImportCardinality - - - - - Zero or more objects are required by the . - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ImportCardinality - - - - - Zero or one objects are required by the . - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ImportDefinition.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ImportDefinition.xml deleted file mode 100644 index f34b992f456..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.Primitives/ImportDefinition.xml +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Represents an import that is required by a object. - - - - - - - Constructor - - 4.0.0.0 - - - - - - Derived types that call this constructor must override the property, and optionally, the , and properties. - - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified constraint, contract name, and cardinality, and indicates whether the import definition is recomposable or a prerequisite. - - - An expression that contains a object that defines the conditions an must match to satisfy the import definition. - - The contract name. - - One of the enumeration values that indicates the cardinality of the objects required by the import definition. - - true to specify that the import definition can be satisfied multiple times throughout the lifetime of a object; otherwise, false. - - true to specify that the import definition must be satisfied before a can start producing exported objects; otherwise, false. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified constraint, contract name, cardinality, and metadata, and indicates whether the import definition is recomposable or a prerequisite. - - - An expression that contains a object that defines the conditions an must match to satisfy the import definition. - - The contract name. - - One of the enumeration values that indicates the cardinality of the objects required by the import definition. - - true to specify that the import definition can be satisfied multiple times throughout the lifetime of a object; otherwise, false. - - true to specify that the import definition must be satisfied before a can start producing exported objects; otherwise, false. - - The metadata associated with the import. - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ImportCardinality - - - To be added. - To be added. - - - Gets the cardinality of the exports required by the import definition. - - - - - - - Property - - 4.0.0.0 - - - System.Linq.Expressions.Expression<System.Func<System.ComponentModel.Composition.Primitives.ExportDefinition,System.Boolean>> - - - To be added. - - - Overrides of this property should never return null. - - - - Gets an expression that defines conditions that the import must satisfy to match the import definition. - - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets the name of the contract. - - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - To be added. - - - Gets a value that indicates whether the export represented by the specified definition satisfies the constraints of this import definition. - - - - true if the constraints are satisfied; otherwise, false. - - - The export definition to test. - - - - - - Property - - 4.0.0.0 - - - System.Boolean - - - To be added. - To be added. - - - Gets a value that indicates whether the import definition must be satisfied before a part can start producing exported objects. - - - - - - - Property - - 4.0.0.0 - - - System.Boolean - - - To be added. - To be added. - - - Gets a value that indicates whether the import definition can be satisfied multiple times. - - - - - - - Property - - 4.0.0.0 - - - System.Collections.Generic.IDictionary<System.String,System.Object> - - - To be added. - - - This property should never return null. Imports with no metadata should return an empty collection. - - - - Gets the metadata associated with this import. - - - - - - - Method - - 4.0.0.0 - - - System.String - - - - To be added. - - - Returns a string representation of the import definition. - - - - A string representation of the import definition. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.ReflectionModel/LazyMemberInfo.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.ReflectionModel/LazyMemberInfo.xml deleted file mode 100644 index a9407513ea3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.ReflectionModel/LazyMemberInfo.xml +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ValueType - - - - To be added. - - - Represents a object that does not load assemblies or create objects until requested. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class, representing the specified member. - - - The member to represent. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class for a member of the specified type with the specified accessors. - - - The type of the represented member. - - A function whose return value is a collection of the accessors for the represented member. - - - - - - Constructor - - 4.0.0.0 - - - - - - - System.ParamArray - - - - - - To be added. - - - Initializes a new instance of the class for a member of the specified type with the specified accessors. - - - The type of the represented member. - - An array of the accessors for the represented member. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - To be added. - To be added. - To be added. - - The other object. - - - - - - Method - - 4.0.0.0 - - - System.Reflection.MemberInfo[] - - - - To be added. - - - Gets an array of the accessors for the represented member. - - - - An array of the accessors for the represented member. - - - - - - - Method - - 4.0.0.0 - - - System.Int32 - - - - To be added. - To be added. - To be added. - - - - - - Property - - 4.0.0.0 - - - System.Reflection.MemberTypes - - - To be added. - To be added. - - - Gets the type of the represented member. - - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - To be added. - - - Determines whether the two specified objects are equal. - - - - true if the objects are equal; otherwise, false. - - - The first object to test. - - The second object to test. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - To be added. - - - Determines whether the two specified objects are not equal. - - - - true if the objects are equal; otherwise, false. - - - The first object to test. - - The second object to test. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.ReflectionModel/ReflectionModelServices.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.ReflectionModel/ReflectionModelServices.xml deleted file mode 100644 index 47c235f067f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition.ReflectionModel/ReflectionModelServices.xml +++ /dev/null @@ -1,595 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Provides extension methods to create and retrieve reflection-based parts. - - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ExportDefinition - - - - - - - - - To be added. - - - Creates an export definition from the specified member, with the specified contract name, metadata, and origin. - - - - An export definition created from the specified parameters. - - - The member to export. - - The contract name to use for the export. - - The metadata for the export. - - The object that the export originates from. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition - - - - - - - - - - - - To be added. - - - Creates an import definition for the specified parameter by using the specified contract name, type identity, import metadata, cardinality, and creation policy. - - - - An import definition created from the specified parameters. - - - The parameter to import. - - The contract name to use for the import. - - The required type identity for the import. - - The required metadata for the import. - - The cardinality of the import. - - One of the enumeration values that specifies the import's creation policy. - - The object to import into. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition - - - - - - - - - - - - - To be added. - - - Creates an import definition for the specified member by using the specified contract name, type identity, import metadata, cardinality, recomposition policy, and creation policy. - - - - An import definition created from the specified parameters. - - - The member to import into. - - The contract name to use for the import. - - The required type identity for the import. - - The required metadata for the import. - - The cardinality of the import. - - true to indicate that the import is recomposable; otherwise, false. - - One of the enumeration values that specifies the import's creation policy. - - The object to import into. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition - - - - - - - - - - - - - - To be added. - - - Creates an import definition for the specified parameter by using the specified contract name, type identity, import and contract metadata, cardinality, and creation policy. - - - - An import definition created from the specified parameters. - - - The parameter to import. - - The contract name to use for the import. - - The required type identity for the import. - - The required metadata for the import. - - The cardinality of the import. - - One of the enumeration values that specifies the import's creation policy. - - The contract metadata - - true to indicate that the import represents an ; otherwise, false. - - The object to import into. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition - - - - - - - - - - - - - - - To be added. - - - Creates an import definition for the specified member by using the specified contract name, type identity, import and contract metadata, cardinality, recomposition policy, and creation policy. - - - - An import definition created from the specified parameters. - - - The member to import into. - - The contract name to use for the import. - - The required type identity for the import. - - The required metadata for the import. - - The cardinality of the import. - - true to indicate that the import is recomposable; otherwise, false. - - One of the enumeration values that specifies the import's creation policy. - - The contract metadata. - - true to indicate that the import represents an ; otherwise, false. - - The object to import into. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition - - - - - - - - - - - - - - - - To be added. - - - Creates an import definition for the specified member by using the specified contract name, type identity, import and contract metadata, cardinality, recomposition policy, and creation policy. - - - - An import definition created from the specified parameters. - - - The member to import into. - - The contract name to use for the import. - - The required type identity for the import. - - The required metadata for the import. - - The cardinality of the import. - - true to indicate that the import is recomposable; otherwise, false. - - true to indicate that the import is a prerequisite; otherwise, false. - - One of the enumeration values that specifies the import's creation policy. - - The contract metadata. - - true to indicate that the import represents an ; otherwise, false. - - The object to import into. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartDefinition - - - - - - - - - - - To be added. - - - Creates a part definition with the specified part type, imports, exports, metadata, and origin. - - - - A part definition created from the specified parameters. - - - The type of the part. - - true if the part requires disposal; otherwise, false. - - A collection of the part's imports. - - A collection of the part's exports. - - The part's metadata. - - The part's origin. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition - - - - - - To be added. - - - Returns a representation of an import definition as an export factory product. - - - - The representation of the import definition. - - - The import definition to represent. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo - - - - - - To be added. - - - Gets the exporting member from a specified export definition. - - - - The member specified in the export definition. - - - The export definition to examine. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo - - - - - - To be added. - - - Gets the importing member from a specified import definition. - - - - The member specified in the import definition. - - - The import definition to examine. - - - - - - Method - - 4.0.0.0 - - - System.Lazy<System.Reflection.ParameterInfo> - - - - - - To be added. - - - Gets the importing parameter from a specified import definition. - - - - The parameter specified in the import definition. - - - The import definition to examine. - - - - - - Method - - 4.0.0.0 - - - System.Lazy<System.Type> - - - - - - To be added. - - - Gets the type of a part from a specified part definition. - - - - The type of the defined part. - - - The part definition to examine. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - To be added. - - - Determines whether the specified part requires disposal. - - - - true if the part requires disposal; otherwise, false. - - - The part to examine. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - To be added. - - - Indicates whether a specified import definition represents an export factory ( or object). - - - - true if the specified import definition represents an export factory; otherwise, false. - - - The import definition to check. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - To be added. - - - Determines whether an import definition represents a member or a parameter. - - - - true if the import definition represents a parameter; otherwise, false. - - - The import definition to examine. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/AttributedModelServices.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/AttributedModelServices.xml deleted file mode 100644 index d83a1c426ec..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/AttributedModelServices.xml +++ /dev/null @@ -1,711 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - To be added. - - - Contains helper methods for using the MEF attributed programming model with composition. - - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - To be added. - - - Creates a composable part from the specified attributed object, and adds it to the specified composition batch. - - - - The new part. - - - The batch to add to. - - The object to add. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - - System.ParamArray - - - - - - To be added. - - - Creates composable parts from an array of attributed objects and composes them in the specified composition container. - - - The composition container to perform composition in. - - An array of attributed objects to compose. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - To be added. - - - Creates a composable part from the specified attributed object. - - - - The created part. - - - The attributed object. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - To be added. - - - Creates a composable part from the specified attributed object, using the specified part definition. - - - - The created part. - - - The definition of the new part. - - The attributed object. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - To be added. - - - Creates a composable part from the specified attributed object, using the specified reflection context. - - - - The created part. - - - The attributed object. - - The reflection context for the part. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartDefinition - - - - - - - To be added. - - - Creates a part definition with the specified type and origin. - - - - The new part definition. - - - The type of the definition. - - The origin of the definition. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePartDefinition - - - - - - - - To be added. - - - Creates a part definition with the specified type and origin. - - - - The new part definition. - - - The type of the definition. - - The origin of the definition. - - A value indicating whether or not the new definition should be discoverable. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - To be added. - - - Returns a value that indicates whether the specified part contains an export that matches the specified contract type. - - - - true if contains an export definition that matches ; otherwise, false. - - - The part to search. - - The contract type. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - - - To be added. - - - Returns a value that indicates whether the specified part contains an export that matches the specified contract type. - - - - true if contains an export definition of type ; otherwise, false. - - - The part to search. - - The contract type. - - - - - - Method - - 4.0.0.0 - - - System.String - - - - - - To be added. - - - Gets a canonical contract name for the specified type. - - - - A contract name created from the specified type. - - - The type to use. - - - - - - Method - - 4.0.0.0 - - - TMetadataView - - - - - - - - - To be added. - - - Gets a metadata view object from a dictionary of loose metadata. - - - - A metadata view containing the specified metadata. - - - A collection of loose metadata. - - The type of the metadata view object to get. - - - - - - Method - - 4.0.0.0 - - - System.String - - - - - - To be added. - - - Gets the unique identifier for the specified method. - - - - The unique identifier for the method. - - - The method to examine. - - - - - - Method - - 4.0.0.0 - - - System.String - - - - - - To be added. - - - Gets the unique identifier for the specified type. - - - - The unique identifier for the type. - - - The type to examine. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - To be added. - - - Returns a value that indicates whether the specified part contains an import that matches the specified contract type. - - - - true if contains an import definition that matches ; otherwise, false. - - - The part to search. - - The contract type. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - - To be added. - - - Returns a value that indicates whether the specified part contains an import that matches the specified contract type and import cardinality. - - - - true if contains an import definition that matches and ; otherwise, false. - - - The part to search. - - The contract type. - - The import cardinality. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - - - To be added. - - - Returns a value that indicates whether the specified part contains an import that matches the specified contract type. - - - - true if contains an import definition of type ; otherwise, false. - - - The part to search. - - The contract type. - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - - - - - To be added. - - - Returns a value that indicates whether the specified part contains an import that matches the specified contract type and import cardinality. - - - - true if contains an import definition of type that has the specified import cardinality; otherwise, false. - - - The part to search. - - The import cardinality. - - The contract type. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - - - Unlike ordinary composition, parts composed with this method are not guaranteed to remain valid if the catalog behind changes. - - - - Composes the specified part by using the specified composition service, with recomposition disabled. - - - - The composed part. - - - The composition service to use. - - The part to compose. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - - To be added. - - - Composes the specified part by using the specified composition service, with recomposition disabled and using the specified reflection context. - - - - The composed part. - - - The composition service to use. - - The part to compose. - - The reflection context for the part. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CatalogReflectionContextAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CatalogReflectionContextAttribute.xml deleted file mode 100644 index e4500e9a8c2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CatalogReflectionContextAttribute.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Attribute - - - - - System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=true) - - - - To be added. - - - When applied to a object, enables an object to discover custom objects. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified type. - - - The type of the reflection context. - - - - - - Method - - 4.0.0.0 - - - System.Reflection.ReflectionContext - - - - To be added. - - - Creates an instance of the custom object. - - - - An instance of the custom reflection context. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ChangeRejectedException.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ChangeRejectedException.xml deleted file mode 100644 index 9f8ca2a5054..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ChangeRejectedException.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.CompositionException - - - - To be added. - - - An exception that indicates whether a part has been rejected during composition. - - - - - - - Constructor - - 4.0.0.0 - - - - - - This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "DefaultMessageDisplayedByParameterlessCtorWriterMustSupply" This message takes into account the current system culture. - The following table shows the initial property values for an instance of . - - - - - Property - - - Value - - - - - - - - - - - null. - - - - - - - - - - The localized error message string. - - - - - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with a list of composition errors. - - - A collection of errors that occurred during composition. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - The following table shows the initial property values for an instance of . - - - - - Property - - - Value - - - - - - - - - - - null. - - - - - - - - - - The error message string specified in . - - - - - - - Initializes a new instance of the class with a specified message that describes the error. - - - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - - An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed to the constructor, or null if the property does not supply the inner exception value to the constructor. - The following table shows the initial property values for an instance of . - - - - - Property - - - Value - - - - - - - - - - - null. - - - - - - - - - - The error message string specified in . - - - - - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - - - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets or sets the message associated with the component rejection. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CompositionContractMismatchException.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CompositionContractMismatchException.xml deleted file mode 100644 index 663127276cf..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CompositionContractMismatchException.xml +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Exception - - - - To be added. - - - The exception that is thrown when the underlying exported value or metadata of a or object cannot be cast to T or TMetadataView, respectively. - - - - - - - Constructor - - 4.0.0.0 - - - - - - This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "DefaultMessageDisplayedByParameterlessCtorWriterMustSupply". This message takes into account the current system culture. - The following table shows the initial property values for an instance of . - - - - - Property - - - Value - - - - - - - - - - - null. - - - - - - - - - - The localized error message string. - - - - - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - - The following table shows the initial property values for an instance of . - - - - - Property - - - Value - - - - - - - - - - - null. - - - - - - - - - - The error message string specified in . - - - - - - - Initializes a new instance of the class with a specified message that describes the error. - - - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - - - - Constructor - - 4.0.0.0 - - - - System.Security.SecuritySafeCritical - - - - - - - - - - This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. For more information, see XML and Soap Serialization. - - - - Initializes a new instance of the class with serialized data. - - - The object that holds the serialized object data. - - The contextual information about the source or destination. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - - An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or null if the property does not supply the inner exception value to the constructor. - The following table shows the initial property values for an instance of . - - - - - Property - - - Value - - - - - - - - - - - null. - - - - - - - - - - The error message string specified in . - - - - - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - - - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CompositionError.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CompositionError.xml deleted file mode 100644 index 24e67be6a23..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CompositionError.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Object - - - - - System.Diagnostics.DebuggerTypeProxy(typeof(System.ComponentModel.Composition.CompositionErrorDebuggerProxy)) - - - - To be added. - - - Represents an error that occurred during composition. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified error message. - - - A message that describes the or null to set the property to an empty string (""). - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified error message and the composition element that is the cause of the composition error. - - - A message that describes the or null to set the property to an empty string (""). - - The composition element that is the cause of the or null to set the property to null. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified error message and the exception that is the cause of the composition error. - - - A message that describes the or null to set the property to an empty string (""). - - The that is the underlying cause of the or null to set the property to null. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - - - Initializes a new instance of the class with the specified error message, and the composition element and exception that are the cause of the composition error. - - - A message that describes the or null to set the property to an empty string (""). - - The composition element that is the cause of the or null to set the property to null. - - The that is the underlying cause of the or null to set the property to null. - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets a description of the composition error. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ICompositionElement - - - To be added. - To be added. - - - Gets the composition element that is the cause of the error. - - - - - - - Property - - 4.0.0.0 - - - System.Exception - - - To be added. - To be added. - - - Gets the exception that is the underlying cause of the composition error. - - - - - - - Method - - 4.0.0.0 - - - System.String - - - - To be added. - - - Returns a string representation of the composition error. - - - - A string that contains the property. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CompositionException.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CompositionException.xml deleted file mode 100644 index 80af0091e07..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CompositionException.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Exception - - - - - System.Diagnostics.DebuggerDisplay("{Message}") - - - System.Diagnostics.DebuggerTypeProxy(typeof(System.ComponentModel.Composition.CompositionExceptionDebuggerProxy)) - - - - To be added. - - - Represents the exception that is thrown when one or more errors occur during composition in a object. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified collection of composition errors. - - - A collection of objects that represent problems during composition. - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified error message. - - - A message that describes the or null to set the property to its default value. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified error message and the exception that is the cause of this exception. - - - A message that describes the or null to set the property to its default value. - - The exception that is the underlying cause of the or null to set the property to null. - - - - - - Property - - 4.0.0.0 - - - System.Collections.ObjectModel.ReadOnlyCollection<System.ComponentModel.Composition.CompositionError> - - - To be added. - To be added. - - - Gets or sets a collection of objects that describe the errors associated with the . - - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets a message that describes the exception. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CreationPolicy.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CreationPolicy.xml deleted file mode 100644 index dc41e32676f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/CreationPolicy.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Enum - - - - - In the course of composition, the needs instances of the objects described by exports in order to fill imports. If a one export is used to fill multiple imports, there are two possible behaviors. Either a single instance of the exported object is created, and a reference to the same object is given to every importer, or a separate instance of the exported object is created for each importer. - Which behavior occurs depends on the property of the attached to the export and the of the . Both of which will contain a value from the enumeration. If the policies are incompatible, that export will not be considered a match for the given import. The following table summarizes the interaction of these two properties. - - - - - - - - - - Export's specifies or none specified. - - - Export's specifies - - - Export's specifies - - - - - - - - - - - A single, shared instance of the exported object will be created. - - - A single, shared instance of the exported object will be created. - - - A new instance of the exported object will be created for each importer. - - - - - - - - - - A single, shared instance of the exported object will be created. - - - A single, shared instance of the exported object will be created. - - - The export will not be considered a match for the import. - - - - - - - - - - A new instance of the exported object will be created for each importer. - - - The export will not be considered a match for the import. - - - A new instance of the exported object will be created for each importer. - - - - - - - Specifies when and how a part will be instantiated. - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.CreationPolicy - - - - - Specifies that the will use the most appropriate for the part given the current context. This is the default . By default, will use , unless the or importer requests . - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.CreationPolicy - - - To be added. - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.CreationPolicy - - - - - Specifies that a new non-shared instance of the associated will be created by the for every requestor. - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.CreationPolicy - - - - - Specifies that a single shared instance of the associated will be created by the and shared by all requestors. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportAttribute.xml deleted file mode 100644 index f11134e56d4..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportAttribute.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Attribute - - - - - System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.All, AllowMultiple=true, Inherited=false) - - - - - - In the Attributed Programming Model, the declares that a part exports, or provides to the composition container, an object that fulfills a particular contract. During composition, parts with imports that have matching contracts will have those dependencies filled by the exported object. - The can decorate either an entire class, or a property, field, or method of a class. If the entire class is decorated, an instance of the class is the exported object. If a member of a class is decorated, the exported object will be the value of the decorated member. - Whether or not a contract matches is determined primarily by the contract name and the contract type. For more information, see . - - - - Specifies that a type, property, field, or method provides a particular export. - - - - - - - Constructor - - 4.0.0.0 - - - - - - The default contract name is the result of calling the method on the property or field type, or on the type that is marked with this attribute. - Methods marked with this attribute must specify a contract name or a type by using either or . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - - Initializes a new instance of the class, exporting the type or member marked with this attribute under the default contract name. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - - The default contract name is the result of calling the method on the property or field type, or on the type that this is marked with this attribute. - Methods marked with this attribute must specify a contract name or a type by using either or . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Initializes a new instance of the class, exporting the type or member marked with this attribute under the specified contract name. - - - The contract name that is used to export the type or member marked with this attribute, or null or an empty string ("") to use the default contract name. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - The contract name is the result of calling the method on . - The default contract name is the result of calling the method on the property or field type, or on the type that is marked with this attribute. - Methods marked with this attribute must specify a contract name or a type by using either or . - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Initializes a new instance of the class, exporting the type or member marked with this attribute under a contract name derived from the specified type. - - - A type from which to derive the contract name that is used to export the type or member marked with this attribute, or null to use the default contract name. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class, exporting the specified type under the specified contract name. - - - The contract name that is used to export the type or member marked with this attribute, or null or an empty string ("") to use the default contract name. - - The type to export. - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets the contract name that is used to export the type or member marked with this attribute. - - - - - - - Property - - 4.0.0.0 - - - System.Type - - - To be added. - To be added. - - - Gets the contract type that is exported by the member that this attribute is attached to. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportFactory`1.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportFactory`1.xml deleted file mode 100644 index 1b2b95edc66..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportFactory`1.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - - - - System.Object - - - - To be added. - - - When you refer indirectly to a part by using a object, the property always returns a reference to the same object. In some circumstances, you might want each reference to result in the creation of a new object. is designed for those scenarios. - - can be used in a similar fashion to when creating attributed parts. That is, an import contract that is defined on with a generic parameter of will match an export that is defined on . For example, the follow export and import match: - [Export] -public String myData = "Example Data."; - -[Import] -public ExportFactory<String> theData { get; set; } - <Export()> -Public myData As String = "Example Data." - -<Import()> -Public Property theData As ExportFactory(Of String) - The method returns an object, which has two pieces. The property provides access to the created part. Calling the method of the object cleans up the created part and all of its dependencies, thereby allowing the part's lifetime to be managed without reference to the container that created it. - - - - A factory that creates new instances of a part that provides the specified export. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - To be added. - To be added. - - - - - - Method - - 4.0.0.0 - - - System.ComponentModel.Composition.ExportLifetimeContext<T> - - - - To be added. - - - Creates an instance of the factory's export type. - - - - A valid instance of the factory's exported type. - - - - - - - Method - - 4.0.0.0 - - - System.Boolean - - - - - - To be added. - - - When overridden in a derived class, filters part definitions in the scope of the object. - - - - true if the part definition should be included in the scope; otherwise, false. - - - The part definition to filter. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportFactory`2.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportFactory`2.xml deleted file mode 100644 index aef99868c3a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportFactory`2.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - - - - - System.ComponentModel.Composition.ExportFactory<T> - - T - - - - - To be added. - To be added. - - - - extends to include a metadata object, in much the same way that extends . For more information, see and . - - - - A factory that creates new instances of a part that provides the specified export, with attached metadata. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - Property - - 4.0.0.0 - - - TMetadata - - - To be added. - To be added. - - - Gets the metadata to be attached to the created parts. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportLifetimeContext`1.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportLifetimeContext`1.xml deleted file mode 100644 index 18f8acb33db..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportLifetimeContext`1.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - - - - System.Object - - - - System.IDisposable - - - - To be added. - To be added. - - - Holds an exported value created by an object and a reference to a method to release that object. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - Calling the Dispose method of a object calls the referenced method to release its associated export. - Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method. - - Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method. - - - - - Releases all resources used by the current instance of the class, including its associated export. - - - - - - - Property - - 4.0.0.0 - - - T - - - To be added. - To be added. - - - Gets the exported value of a object. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportMetadataAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportMetadataAttribute.xml deleted file mode 100644 index 04d61fae4bd..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ExportMetadataAttribute.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Attribute - - - - - System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.All, AllowMultiple=true, Inherited=false) - - - - To be added. - - - Specifies metadata for a type, property, field, or method marked with the . - - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the with the specified name and metadata value. - - - A string that contains the name of the metadata value, or null to set the property to an empty string (""). - - An object that contains the metadata value. This can be null. - - - - - - Property - - 4.0.0.0 - - - System.Boolean - - - To be added. - To be added. - - - Gets or sets a value that indicates whether this item is marked with this attribute more than once. - - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets the name of the metadata value. - - - - - - - Property - - 4.0.0.0 - - - System.Object - - - To be added. - To be added. - - - Gets the metadata value. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ICompositionService.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ICompositionService.xml deleted file mode 100644 index 11a30f08799..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ICompositionService.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - - To be added. - - - Provides methods to satisfy imports on an existing part instance. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - - - To be added. - - - Composes the specified part, with recomposition and validation disabled. - - - The part to compose. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/IPartImportsSatisfiedNotification.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/IPartImportsSatisfiedNotification.xml deleted file mode 100644 index 1ebcd6f5a64..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/IPartImportsSatisfiedNotification.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - - To be added. - - - Notifies a part when its imports have been satisfied. - - - - - - - Method - - 4.0.0.0 - - - System.Void - - - - To be added. - - - Called when a part's imports have been satisfied and it is safe to use. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportAttribute.xml deleted file mode 100644 index 3a4830a2dd0..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportAttribute.xml +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Attribute - - - - System.ComponentModel.Composition.IAttributedImport - - - - - System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.All, AllowMultiple=false, Inherited=false) - - - - - - In the Attributed Programming Model, the is used to declare the imports, or dependencies, of a given part. It can decorate a property, a field, or a method. During composition, a part's imports will be filled by the object to which that part belongs, by using the exports provided to that object. - Whether an import matches a given export is determined primarily by comparing the contract name and the contract type. Ordinarily, you do not have to specify either of these when using the import attribute in code, and they will be automatically inferred from the type of the decorated member. If the import must match an export of a different type (for example, a subclass of the type of the decorated member, or an interface implemented by that member), then the contract type must be explicitly specified. The contract name can also be explicitly specified, for example to distinguish between multiple contracts with the same type, but it is usually better to do this through metadata. For more information about metadata, see . - - - - Specifies that a property, field, or parameter value should be provided by the .object - - - - - - - Constructor - - 4.0.0.0 - - - - - - The default contract name is the result of calling the method on the property, field, or parameter type that this is marked with this attribute. - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Initializes a new instance of the class, importing the export with the default contract name. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - - The default contract name is the result of calling the method on the property, field, or parameter type that is marked with this attribute. - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Initializes a new instance of the class, importing the export with the specified contract name. - - - The contract name of the export to import, or null or an empty string ("") to use the default contract name. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - The contract name is the result of calling the method on . - The default contract name is the result of calling the method on the property, field, or parameter type that is marked with this attribute. - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Initializes a new instance of the class, importing the export with the contract name derived from the specified type. - - - The type to derive the contract name of the export from, or null to use the default contract name. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class, importing the export with the specified contract name and type. - - - The contract name of the export to import, or null or an empty string ("") to use the default contract name. - - The type of the export to import. - - - - - - Property - - 4.0.0.0 - - - System.Boolean - - - To be added. - - - The default value of the type of a property, field, or parameter is null for reference types and zero for numeric value types. For other value types, the default value will be each field of the value type initialized to zero if the field is a value type, or null if the field is a reference type. - - - - Gets or sets a value that indicates whether the property, field, or parameter will be set to its type's default value when an export with the contract name is not present in the container. - - - - - - - Property - - 4.0.0.0 - - - System.Boolean - - - To be added. - To be added. - - - Gets or sets a value that indicates whether the property or field will be recomposed when exports with a matching contract have changed in the container. - - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets the contract name of the export to import. - - - - - - - Property - - 4.0.0.0 - - - System.Type - - - To be added. - To be added. - - - Gets the type of the export to import. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.CreationPolicy - - - To be added. - To be added. - - - Gets or sets a value that indicates that the importer requires a specific for the exports used to satisfy this import. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.ImportSource - - - To be added. - To be added. - - - Gets or sets a value that specifies the scopes from which this import may be satisfied. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ImportCardinality - - - To be added. - To be added. - To be added. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportCardinalityMismatchException.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportCardinalityMismatchException.xml deleted file mode 100644 index 53331fd82e3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportCardinalityMismatchException.xml +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Exception - - - - - System.Diagnostics.DebuggerDisplay("{Message}") - - - System.Diagnostics.DebuggerTypeProxy(typeof(System.ComponentModel.Composition.ImportCardinalityMismatchExceptionDebuggerProxy)) - - - - To be added. - - - The exception that is thrown when the cardinality of an import is not compatible with the cardinality of the matching exports. - - - - - - - Constructor - - 4.0.0.0 - - - - - - This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "DefaultMessageDisplayedByParameterlessCtorWriterMustSupply". This message takes into account the current system culture. - The following table shows the initial property values for an instance of . - - - - - Property - - - Value - - - - - - - - - - - null. - - - - - - - - - - The localized error message string. - - - - - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - - The following table shows the initial property values for an instance of . - - - - - Property - - - Value - - - - - - - - - - - null. - - - - - - - - - - The error message string specified in . - - - - - - - Initializes a new instance of the class with a specified message that describes the error. - - - A message that describes the , or null to set the property to its default value. - - - - - - Constructor - - 4.0.0.0 - - - - System.Security.SecuritySafeCritical - - - - - - - - - - This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. For more information, see XML and SOAP Serialization. - - - - Initializes a new instance of the class with serialized data. - - - An object that holds the serialized object data about the . - - An object that contains contextual information about the source or destination. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - - An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the property. The property returns the same value that is passed into the constructor, or null if the property does not supply the inner exception value to the constructor. - The following table shows the initial property values for an instance of . - - - - - Property - - - Value - - - - - - - - - - - null. - - - - - - - - - - The error message string specified in . - - - - - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - - - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportManyAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportManyAttribute.xml deleted file mode 100644 index d94d1cfc44d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportManyAttribute.xml +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Attribute - - - - System.ComponentModel.Composition.IAttributedImport - - - - - System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.All, AllowMultiple=false, Inherited=false) - - - - To be added. - - - Specifies that a property, field, or parameter should be populated with all matching exports by the object. - - - - - - - Constructor - - 4.0.0.0 - - - - - - The default contract name is the result of calling the method on the type of the property, field, or parameter that is marked with this attribute. - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Initializes a new instance of the class, importing the set of exports with the default contract name. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - - The default contract name is the result of calling the method on the property, field, or parameter type that is marked with this attribute. - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Initializes a new instance of the class, importing the set of exports with the specified contract name. - - - The contract name of the exports to import, or null or an empty string ("") to use the default contract name. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - The contract name is the result of calling the method on . - The default contract name is the result of calling the method on the property, field, or parameter type that is marked with this attribute. - The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. - - - - Initializes a new instance of the class, importing the set of exports with the contract name derived from the specified type. - - - The type to derive the contract name of the exports to import, or null to use the default contract name. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class, importing the set of exports with the specified contract name and contract type. - - - The contract name of the exports to import, or null or an empty string ("") to use the default contract name. - - The type of the export to import. - - - - - - Property - - 4.0.0.0 - - - System.Boolean - - - To be added. - To be added. - - - Gets or sets a value indicating whether the decorated property or field will be recomposed when exports that provide the matching contract change. - - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets the contract name of the exports to import. - - - - - - - Property - - 4.0.0.0 - - - System.Type - - - To be added. - To be added. - - - Gets the contract type of the export to import. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.CreationPolicy - - - To be added. - To be added. - - - Gets or sets a value that indicates that the importer requires a specific for the exports used to satisfy this import. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.ImportSource - - - To be added. - To be added. - - - Gets or sets a value that specifies the scopes from which this import may be satisfied. - - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.Primitives.ImportCardinality - - - To be added. - To be added. - To be added. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportSource.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportSource.xml deleted file mode 100644 index 40e240ec56b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportSource.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Enum - - - To be added. - - - Specifies values that indicate how the MEF composition engine searches for imports. - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.ImportSource - - - - - Imports may be satisfied from the current scope or any ancestor scope. - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.ImportSource - - - - - Imports may be satisfied only from the current scope. - - - - - - - Field - - 4.0.0.0 - - - System.ComponentModel.Composition.ImportSource - - - - - Imports may be satisfied only from an ancestor scope. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportingConstructorAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportingConstructorAttribute.xml deleted file mode 100644 index 196be1b5693..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/ImportingConstructorAttribute.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Attribute - - - - - System.AttributeUsage(System.AttributeTargets.Constructor, AllowMultiple=false, Inherited=false) - - - - - - By default, only a parameter-less constructor will be used to construct an attributed part. Use to indicate that a specific constructor should be used instead. Parameters to the decorated constructor will be treated as imports. - - - - Specifies which constructor should be used when creating a part. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/InheritedExportAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/InheritedExportAttribute.xml deleted file mode 100644 index f95dc311b0e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/InheritedExportAttribute.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.ComponentModel.Composition.ExportAttribute - - - - - System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.All, AllowMultiple=true, Inherited=true) - - - - To be added. - - - Specifies that a type provides a particular export, and that subclasses of that type will also provide that export. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified contract name. - - - The name of the contract. - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified contract type. - - - The type of the contract. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified contract name and type. - - - The name of the contract. - - The type of the contract. - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/MetadataAttributeAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/MetadataAttributeAttribute.xml deleted file mode 100644 index 50f7733a2dd..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/MetadataAttributeAttribute.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Attribute - - - - - System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true) - - - - To be added. - - - Specifies that a custom attribute’s properties provide metadata for exports applied to the same type, property, field, or method. - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/MetadataViewImplementationAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/MetadataViewImplementationAttribute.xml deleted file mode 100644 index 0effc6caa76..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/MetadataViewImplementationAttribute.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Attribute - - - - - System.AttributeUsage(System.AttributeTargets.Interface, AllowMultiple=false, Inherited=false) - - - - - - By default, metadata views are created using generated types. Use this attribute to specify that a metadata view should use an existing type. - - - - Specifies the type used to implement a metadata view. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class. - - - The type of the metadata view. - - - - - - Property - - 4.0.0.0 - - - System.Type - - - To be added. - To be added. - - - Gets the type of the metadata view. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/PartCreationPolicyAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/PartCreationPolicyAttribute.xml deleted file mode 100644 index e5885deb216..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/PartCreationPolicyAttribute.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Attribute - - - - - System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=false) - - - - To be added. - - - Specifies the for a part. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - - - Initializes a new instance of the class with the specified creation policy. - - - The creation policy to use. - - - - - - Property - - 4.0.0.0 - - - System.ComponentModel.Composition.CreationPolicy - - - To be added. - To be added. - - - Gets or sets a value that indicates the creation policy of the attributed part. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/PartMetadataAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/PartMetadataAttribute.xml deleted file mode 100644 index f953761a9ef..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/PartMetadataAttribute.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Attribute - - - - - System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=false) - - - - To be added. - - - Specifies metadata for a part. - - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - - - Initializes a new instance of the class with the specified name and metadata value. - - - A string that contains the name of the metadata value or null to use an empty string (""). - - An object that contains the metadata value. This can be null. - - - - - - Property - - 4.0.0.0 - - - System.String - - - To be added. - To be added. - - - Gets the name of the metadata value. - - - - - - - Property - - 4.0.0.0 - - - System.Object - - - To be added. - To be added. - - - Gets the metadata value. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/PartNotDiscoverableAttribute.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/PartNotDiscoverableAttribute.xml deleted file mode 100644 index 05106c2876e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System.ComponentModel.Composition/PartNotDiscoverableAttribute.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - System.Attribute - - - - - System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=false) - - - - To be added. - - - Specifies that this type’s exports won’t be included in a . - - - - - - - Constructor - - 4.0.0.0 - - - - To be added. - - - Initializes a new instance of the class. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/System/Lazy`2.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/System/Lazy`2.xml deleted file mode 100644 index 021848fad4c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/System/Lazy`2.xml +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - System.ComponentModel.Composition - 4.0.0.0 - - - - - - - System.Lazy<T> - - T - - - - - To be added. - To be added. - To be added. - - - Provides a lazy indirect reference to an object and its associated metadata for use by the Managed Extensibility Framework. - - - - - - - Constructor - - 4.0.0.0 - - - - - - To be added. - To be added. - To be added. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - Constructor - - 4.0.0.0 - - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - Constructor - - 4.0.0.0 - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - Property - - 4.0.0.0 - - - TMetadata - - - To be added. - To be added. - - - Gets the metadata associated with the referenced object. - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/index.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/index.xml deleted file mode 100644 index 30ef37ed61c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/index.xml +++ /dev/null @@ -1,663 +0,0 @@ - - - - [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] - - - System.CLSCompliant(true) - - - System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints) - - - System.Reflection.AssemblyCompany("Mono development team") - - - System.Reflection.AssemblyCopyright("(c) Microsoft Corporation. All rights reserved.") - - - System.Reflection.AssemblyDefaultAlias("System.ComponentModel.Composition.dll") - - - System.Reflection.AssemblyDescription("System.ComponentModel.Composition.dll") - - - System.Reflection.AssemblyFileVersion("4.0.30319.17020") - - - System.Reflection.AssemblyInformationalVersion("4.0.30319.17020") - - - System.Reflection.AssemblyProduct("Mono Common Language Infrastructure") - - - System.Reflection.AssemblyTitle("System.ComponentModel.Composition.dll") - - - System.Resources.NeutralResourcesLanguage("en-US") - - - System.Resources.SatelliteContractVersion("4.0.0.0") - - - System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true) - - - System.Runtime.InteropServices.ComVisible(false) - - - System.Security.AllowPartiallyTrustedCallers - - - System.Security.SecurityCritical - - - - - To be added. - To be added. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - System.ComponentModel.Composition - - - - - - - - - ExtensionMethod - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Void - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Void - - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Void - - - - - - - System.ParamArray - - - - - - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Boolean - - - - - - - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Boolean - - - - - - - - - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Boolean - - - - - - - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Boolean - - - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Boolean - - - - - - - - - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Boolean - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.ComponentModel.Composition.Primitives.ComposablePart - - - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.ComponentModel.Composition.Hosting.CompositionService - - - - - - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Boolean - - - - - - - - - - - To be added. - To be added. - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Boolean - - - - - - - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Boolean - - - - - - - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.ComponentModel.Composition.Hosting.FilteredCatalog - - - - - - - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Boolean - - - - - - - To be added. - To be added. - To be added. - - - - - - - - - - - - ExtensionMethod - - System.Boolean - - - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.Hosting.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.Hosting.xml deleted file mode 100644 index ac31a36301a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.Hosting.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - To be added. - - - The namespace provides Managed Extensibility Framework (MEF) types that are useful to developers of extensible applications, or hosts. - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.Primitives.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.Primitives.xml deleted file mode 100644 index 2e8881f6af5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.Primitives.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - To be added. - - - This namespace provides the primitive types underlying the MEF programming model. - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.ReflectionModel.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.ReflectionModel.xml deleted file mode 100644 index f1f7cad16f3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.ReflectionModel.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - To be added. - - - The namespace provides Managed Extensibility Framework (MEF) types for developers who use a reflection-based programming model. - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.xml deleted file mode 100644 index 84d912dcb79..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.ComponentModel.Composition.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - To be added. - - - This namespace provides classes that constitute the core of the Managed Extensibility Framework, or MEF. - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.xml b/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.xml deleted file mode 100644 index c969274264a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Documentation/en/ns-System.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - To be added. - To be added. - - diff --git a/mcs/class/System.ComponentModel.Composition/Makefile b/mcs/class/System.ComponentModel.Composition/Makefile deleted file mode 100644 index a039de61fec..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -thisdir = class/System.ComponentModel.Composition -SUBDIRS = -include ../../build/rules.make - -LIBRARY = System.ComponentModel.Composition.dll -LIB_MCS_FLAGS = -r:System.dll -r:System.Core.dll -d:CLR40 -resource:$(STRING_MESSAGES) - -STRING_MESSAGES = Microsoft.Internal.Strings.resources - -CLEAN_FILES += $(STRING_MESSAGES) - -EXTRA_DISTFILES = \ - src/ComponentModel/Strings.resx - -VALID_PROFILE := $(filter 4, $(FRAMEWORK_VERSION_MAJOR)) -ifndef VALID_PROFILE -LIBRARY_NAME = dummy-System.ComponentModel.Composition.dll -NO_INSTALL = yes -NO_SIGN_ASSEMBLY = yes -NO_TEST = yes -endif - -include ../../build/library.make - -$(the_lib): $(STRING_MESSAGES) - -$(STRING_MESSAGES): src/ComponentModel/Strings.resx - $(RESGEN) $< $@ diff --git a/mcs/class/System.ComponentModel.Composition/README.txt b/mcs/class/System.ComponentModel.Composition/README.txt deleted file mode 100644 index ece387dba60..00000000000 --- a/mcs/class/System.ComponentModel.Composition/README.txt +++ /dev/null @@ -1,13 +0,0 @@ -This directory contains an import of Microsoft's Mananged Extensibility Preview 9 -as downloaded from: - - http://mef.codeplex.com/ - -The version integrated on this release is: - - http://mef.codeplex.com/releases/view/40606 - -Only the source code and test suite has been integrated - -On top of it, we applied r160608 that needs to be re-applied after -an up-stream update. It fixes MEF on case sensitive file systems. diff --git a/mcs/class/System.ComponentModel.Composition/System.ComponentModel.Composition-net_4_0.csproj b/mcs/class/System.ComponentModel.Composition/System.ComponentModel.Composition-net_4_0.csproj deleted file mode 100644 index 7ad9e434a7d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/System.ComponentModel.Composition-net_4_0.csproj +++ /dev/null @@ -1,241 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3F374DB1-80D5-4BC4-8B86-B08AB5214C8B} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.ComponentModel.Composition - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;CLR40 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;CLR40 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - - Microsoft.Internal.Strings.resources - - - - diff --git a/mcs/class/System.ComponentModel.Composition/System.ComponentModel.Composition-net_4_5.csproj b/mcs/class/System.ComponentModel.Composition/System.ComponentModel.Composition-net_4_5.csproj deleted file mode 100644 index 9b6a7217eb1..00000000000 --- a/mcs/class/System.ComponentModel.Composition/System.ComponentModel.Composition-net_4_5.csproj +++ /dev/null @@ -1,246 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {51392CAD-5DCF-443F-8ECF-C9113DF3B91A} - Library - 1699,219,414 - ./../../class/lib/net_4_5 - True - True - - Properties - - - System.ComponentModel.Composition - v4.5 - 512 - - - - true - full - 1699,219,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;CLR40;USE_ECMA_KEY;FEATURE_REFLECTIONCONTEXT;FEATURE_REFLECTIONFILEIO;FEATURE_SERIALIZATION;FEATURE_SLIMLOCK - prompt - 4 - - - pdbonly - 1699,219,414 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;CLR40;USE_ECMA_KEY;FEATURE_REFLECTIONCONTEXT;FEATURE_REFLECTIONFILEIO;FEATURE_SERIALIZATION;FEATURE_SLIMLOCK - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {33BF0182-AC5C-464C-995B-C9CFE74E1A95} - corlib-net_4_5 - - - {FFAC0B73-D997-493B-9C62-27656CD858BB} - System-net_4_5 - - - {D92530F4-3F2B-4351-BD21-9D6BEE6D2A4E} - System.Core-net_4_5 - - - - - - - - Microsoft.Internal.Strings.resources - - - - diff --git a/mcs/class/System.ComponentModel.Composition/System.ComponentModel.Composition.dll.sources b/mcs/class/System.ComponentModel.Composition/System.ComponentModel.Composition.dll.sources deleted file mode 100644 index b70c9d67128..00000000000 --- a/mcs/class/System.ComponentModel.Composition/System.ComponentModel.Composition.dll.sources +++ /dev/null @@ -1,153 +0,0 @@ -../../build/common/Consts.cs -src/ComponentModel/SuppressMessages.cs -src/ComponentModel/SilverlightAdditions.cs -src/ComponentModel/SuppressMessagesBaselined.cs -src/ComponentModel/AssemblyInfo.cs -src/ComponentModel/Microsoft/Internal/Runtime/Serialization/SerializationServices.cs -src/ComponentModel/Microsoft/Internal/GenerationServices.cs -src/ComponentModel/Microsoft/Internal/Lock.cs -src/ComponentModel/Microsoft/Internal/Requires.cs -src/ComponentModel/Microsoft/Internal/SilverlightReflectionInvoke.cs -src/ComponentModel/Microsoft/Internal/Assumes.InternalErrorException.cs -src/ComponentModel/Microsoft/Internal/ContractServices.cs -src/ComponentModel/Microsoft/Internal/LazyServices.cs -src/ComponentModel/Microsoft/Internal/Assumes.cs -src/ComponentModel/Microsoft/Internal/ReflectionServices.cs -src/ComponentModel/Microsoft/Internal/Collections/CollectionServices.cs -src/ComponentModel/Microsoft/Internal/Collections/ConditionalWeakTable.cs -src/ComponentModel/Microsoft/Internal/Collections/EnumerableCardinality.cs -src/ComponentModel/Microsoft/Internal/Collections/WeakReferenceCollection.cs -src/ComponentModel/Microsoft/Internal/Collections/ReadOnlyDictionaryDebuggerProxy.cs -src/ComponentModel/Microsoft/Internal/Collections/ReadOnlyDictionary.cs -src/ComponentModel/Microsoft/Internal/Collections/CollectionServices.CollectionOfObject.cs -src/ComponentModel/Microsoft/Internal/StringComparers.cs -src/ComponentModel/Microsoft/Internal/ReflectionInvoke.cs -src/ComponentModel/Microsoft/Internal/Lock.Reader.cs -src/ComponentModel/Microsoft/Internal/Lock.Writer.cs -src/ComponentModel/Microsoft/Internal/AttributeServices.cs -src/ComponentModel/System/Lazy.cs -src/ComponentModel/System/LazyOfTTMetadata.cs -src/ComponentModel/System/ComponentModel/Composition/MetadataViewGenerator.cs -src/ComponentModel/System/ComponentModel/Composition/ErrorBuilder.cs -src/ComponentModel/System/ComponentModel/Composition/ExportServices.DisposableLazy.cs -src/ComponentModel/System/ComponentModel/Composition/MetadataViewProvider.cs -src/ComponentModel/System/ComponentModel/Composition/PartCreatorOfTTMetadata.cs -src/ComponentModel/System/ComponentModel/Composition/PartLifetimeContextOfT.cs -src/ComponentModel/System/ComponentModel/Composition/ImportManyAttribute.cs -src/ComponentModel/System/ComponentModel/Composition/IAttributedImport.cs -src/ComponentModel/System/ComponentModel/Composition/IPartImportsSatisfiedNotification.cs -src/ComponentModel/System/ComponentModel/Composition/MetadataAttributeAttribute.cs -src/ComponentModel/System/ComponentModel/Composition/ContractNameServices.cs -src/ComponentModel/System/ComponentModel/Composition/CompositionResultOfT.cs -src/ComponentModel/System/ComponentModel/Composition/PartNotDiscoverableAttribute.cs -src/ComponentModel/System/ComponentModel/Composition/ExportMetadataAttribute.cs -src/ComponentModel/System/ComponentModel/Composition/CompositionErrorDebuggerProxy.cs -src/ComponentModel/System/ComponentModel/Composition/ConstraintServices.cs -src/ComponentModel/System/ComponentModel/Composition/ExportAttribute.cs -src/ComponentModel/System/ComponentModel/Composition/CreationPolicy.cs -src/ComponentModel/System/ComponentModel/Composition/ImportingConstructorAttribute.cs -src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs -src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscovery.cs -src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/PartMetadataAttribute.cs -src/ComponentModel/System/ComponentModel/Composition/CompositionErrorId.cs -src/ComponentModel/System/ComponentModel/Composition/MetadataServices.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionField.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorMemberImportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionExtensions.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMember.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorExportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionImportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingParameter.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMethod.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorParameterImportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionWritableMember.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionParameter.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberImportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionItemType.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingItem.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ExportingMember.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionParameterImportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberExportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportType.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionType.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionItem.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/IReflectionPartCreationInfo.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/DisposableReflectionComposablePart.cs -src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionProperty.cs -src/ComponentModel/System/ComponentModel/Composition/InheritedExportAttribute.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/ImportCardinality.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartException.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElementExtensions.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePart.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxy.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElementDebuggerProxy.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/ImportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/ICompositionElement.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/SerializableCompositionElement.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/ExportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/Export.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElement.cs -src/ComponentModel/System/ComponentModel/Composition/Primitives/IPartCreatorImportDefinition.cs -src/ComponentModel/System/ComponentModel/Composition/ICompositionError.cs -src/ComponentModel/System/ComponentModel/Composition/Diagnostics/TraceWriter.cs -src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTraceSource.cs -src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTrace.cs -src/ComponentModel/System/ComponentModel/Composition/Diagnostics/TraceSourceTraceWriter.cs -src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTraceId.cs -src/ComponentModel/System/ComponentModel/Composition/Diagnostics/SilverlightTraceWriter.cs -src/ComponentModel/System/ComponentModel/Composition/ExceptionBuilder.cs -src/ComponentModel/System/ComponentModel/Composition/CompositionResult.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/TypeCatalog.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogChangeProxy.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/AtomicComposition.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionBatch.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/INotifyComposablePartCatalogChanged.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionConstants.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/AggregateCatalog.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.EngineContext.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/AtomicCompositionExtensions.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportsChangeEventArgs.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartCatalogChangeEventArgs.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionContainer.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.RecompositionManager.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartExportProvider.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.DirectoryCatalogDebuggerProxy.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionLock.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxy.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.PartCreatorExport.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/AggregateExportProvider.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.PartManager.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionBatch.SingleExportComposablePart.cs -src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionServices.cs -src/ComponentModel/System/ComponentModel/Composition/ChangeRejectedException.cs -src/ComponentModel/System/ComponentModel/Composition/CompositionContractMismatchException.cs -src/ComponentModel/System/ComponentModel/Composition/CompositionError.cs -src/ComponentModel/System/ComponentModel/Composition/ICompositionService.cs -src/ComponentModel/System/ComponentModel/Composition/ExportServices.cs -src/ComponentModel/System/ComponentModel/Composition/AttributedModelServices.cs -src/ComponentModel/System/ComponentModel/Composition/PartCreatorOfT.cs -src/ComponentModel/System/ComponentModel/Composition/PartCreationPolicyAttribute.cs -src/ComponentModel/System/ComponentModel/Composition/ExportCardinalityCheckResult.cs -src/ComponentModel/System/ComponentModel/Composition/ImportAttribute.cs -src/ComponentModel/System/ComponentModel/Composition/ImportCardinalityMismatchException.cs -src/ComponentModel/System/ComponentModel/Composition/CompositionException.cs -src/ComponentModel/System/Tuple.cs -src/ComponentModel/Strings.Designer.cs \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/.gitattributes deleted file mode 100644 index c538ba30d2b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/AssemblyInfo.cs -crlf -/StringsTests.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/AssemblyInfo.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/AssemblyInfo.cs deleted file mode 100644 index 80dfc55444c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ -[assembly: System.CLSCompliant(true)] -[assembly: System.Reflection.AssemblyTitle("System.ComponentModel.Composition.UnitTests")] -[assembly: System.Reflection.AssemblyCopyright("(c) Microsoft Corporation. All rights reserved.")] -[assembly: System.Reflection.AssemblyVersion("2010.02.11")] diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/ComponentModelUnitTest.csproj b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/ComponentModelUnitTest.csproj deleted file mode 100644 index 2a60f5d5458..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/ComponentModelUnitTest.csproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - Migrated rules for ComponentModelUnitTest.ruleset - - - - ..\..\bin - $(DefineConstants);TRACE - 1570;1572;1573;1591;1699 - - - 9.0.30729 - 2.0 - {82EFB8F9-4130-4275-A26A-9F4C748C1FFB} - FULLCLR;SILVERLIGHT - Library - Properties - - - System.ComponentModel.Composition.UnitTests - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - ;1699;1570;1572;1573;1591;0414 - v3.5 - - - - - dogfood - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - true - - - - False - ..\..\..\..\..\..\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll - - - - - - - {1BBA5101-D4F0-48B8-A5D6-7B23A099DCE3} - ComponentModel - - - {35FBE8A0-D87E-4991-B3FC-2A77807DEC85} - UnitTestFramework - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - Microsoft .NET Framework 4 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/.gitattributes deleted file mode 100644 index 6562b26af9d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/AssumesTests.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/AssumesTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/AssumesTests.cs deleted file mode 100644 index 6286722b4db..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/AssumesTests.cs +++ /dev/null @@ -1,301 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.Collections.Generic; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -#if !SILVERLIGHT -using System.Runtime.Serialization; -#endif - -namespace Microsoft.Internal -{ - [TestClass] - public class AssumesTests - { - [TestMethod] - public void NotNullOfT_NullAsValueArgument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNull((string)null); - }); - } - - [TestMethod] - public void NotNullOfT1T2_NullAsValue1Argument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNull((string)null, "Value"); - }); - } - - [TestMethod] - public void NotNullOfT1T2_NullAsValue2Argument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNull("Value", (string)null); - }); - } - - [TestMethod] - public void NotNullOfT1T2_NullAsValue1ArgumentAndValue2Argument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNull((string)null, (string)null); - }); - } - - [TestMethod] - public void NotNullOfT1T2T3_NullAsValue1Argument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNull((string)null, "Value", "Value"); - }); - } - - [TestMethod] - public void NotNullOfT1T2T3_NullAsValue2Argument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNull("Value", (string)null, "Value"); - }); - } - - [TestMethod] - public void NotNullOfT1T2T3_NullAsValue3Argument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNull("Value", "Value", (string)null); - }); - } - - [TestMethod] - public void NotNullOfT1T2T3_NullAsValue1ArgumentAndValue2Argument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNull((string)null, (string)null, "Value"); - }); - } - - [TestMethod] - public void NotNullOfT1T2T3_NullAsValue1ArgumentAnd3_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNull((string)null, "Value", (string)null); - }); - } - - [TestMethod] - public void NotNullOfT1T2T3_NullAsValue2ArgumentAndValue3Argument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNull("Value", (string)null, (string)null); - }); - } - - [TestMethod] - public void NotNullOfT_ValueAsValueArgument_ShouldNotThrow() - { - Assumes.NotNull("Value"); - } - - [TestMethod] - public void NotNullOfT1T2_ValueAsValue1ArgumentAndValue2Argument_ShouldNotThrow() - { - Assumes.NotNull("Value", "Value"); - } - - [TestMethod] - public void NotNullOfT1T2T3_ValueAsValue1ArgumentAndValue2ArgumentAndValue3Argument_ShouldNotThrow() - { - Assumes.NotNull("Value", "Value", "Value"); - } - - [TestMethod] - public void NullOfT_NullAsValueArgument_ShouldNotThrow() - { - Assumes.Null((string)null); - } - - [TestMethod] - public void NullOfT_ValueAsValueArgument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.Null("Value"); - }); - } - - [TestMethod] - public void NotNullOrEmpty_NullAsValueArgument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNullOrEmpty((string)null); - }); - } - - [TestMethod] - public void NotNullOrEmpty_EmptyAsValueArgument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.NotNullOrEmpty(""); - }); - } - - [TestMethod] - public void NotNullOrEmpty_ValueAsValueArgument_ShouldNotThrow() - { - var expectations = new List(); - expectations.Add(" "); - expectations.Add(" "); - expectations.Add(" "); - expectations.Add("Value"); - - foreach (var e in expectations) - { - Assumes.NotNullOrEmpty(e); - } - } - - [TestMethod] - public void IsTrue1_FalseAsConditionArgument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.IsTrue(false); - }); - } - - [TestMethod] - public void IsTrue2_FalseAsConditionArgument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.IsTrue(false, "Message"); - }); - } - - [TestMethod] - public void IsTrue1_TrueAsConditionArgument_ShouldNotThrow() - { - Assumes.IsTrue(true); - } - - [TestMethod] - public void IsTrue2_TrueAsConditionArgument_ShouldNotThrow() - { - Assumes.IsTrue(true, "Message"); - } - - [TestMethod] - public void IsFalse1_TrueAsConditionArgument_ShouldThrowInternalErrorException() - { - Throws(() => - { - Assumes.IsFalse(true); - }); - } - - [TestMethod] - public void IsFalse1_FalseAsConditionArgument_ShouldNotThrow() - { - Assumes.IsFalse(false); - } - - [TestMethod] - public void NotReachable_ShouldAlwaysThrow() - { - Throws(() => - { - Assumes.NotReachable(); - }); - } - - [TestMethod] - public void Fail_ShouldThrowInternalErrorException() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - Throws(() => - { - Assumes.Fail(e); - }); - } - } - - private static void Throws(Action action) - { - try - { - action(); - Assert.Fail(); - } - catch (Exception ex) - { - Type exceptionType = ex.GetType(); - - // The exception should not be a - // publicily catchable exception - Assert.IsFalse(exceptionType.IsVisible); - } - } - -#if !SILVERLIGHT - - [TestMethod] - public void Message_CanBeSerialized() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = CreateInternalErrorException(e); - - var result = SerializationTestServices.RoundTrip(exception); - - Assert.AreEqual(exception.Message, result.Message); - } - } - -#endif - - private static Exception CreateInternalErrorException() - { - return CreateInternalErrorException((string)null); - } - - private static Exception CreateInternalErrorException(string message) - { - Exception exception = null; - - try - { - Assumes.Fail(message); - } - catch (Exception ex) - { - exception = ex; - } - - Assert.IsNotNull(exception); - return exception; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/.gitattributes deleted file mode 100644 index 1496b702476..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -/ConditionalWeakTableTests.cs -crlf -/ReadOnlyDictionaryDebuggerProxyTests.cs -crlf -/ReadOnlyDictionaryTests.cs -crlf -/WeakReferenceCollectionTests.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/ConditionalWeakTableTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/ConditionalWeakTableTests.cs deleted file mode 100644 index 66e52344156..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/ConditionalWeakTableTests.cs +++ /dev/null @@ -1,226 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Microsoft.Internal.Collections -{ - [TestClass] - public class ConditionalWeakTableTests - { - [TestMethod] - public void Add_KeyShouldBeCollected() - { - var obj = new object(); - var cwt = new ConditionalWeakTable(); - - cwt.Add(obj, new object()); - - var wr = new WeakReference(obj); - - obj = null; - - GC.Collect(); - GC.WaitForPendingFinalizers(); - - Assert.IsNull(wr.Target, "Key should be collected now!"); - - GC.KeepAlive(cwt); - } - - [TestMethod] - public void Add_KeyHeld_ValueShouldNotBeCollected() - { - var obj = new object(); - var str = new StringBuilder(); - var cwt = new ConditionalWeakTable(); - - var wrKey = new WeakReference(obj); - var wrValue = new WeakReference(str); - - cwt.Add(obj, str); - - str = null; - - GC.Collect(); - GC.WaitForPendingFinalizers(); - - // Should still have both references - Assert.IsNotNull(wrKey.Target, "Key should NOT be collected yet!"); - Assert.IsNotNull(wrValue.Target, "Value should NOT be collected yet!"); - - GC.KeepAlive(obj); - GC.KeepAlive(cwt); - } - -#if CLR40 - [TestMethod] - public void Add_KeyCollected_ValueShouldBeCollected() - { - var obj = new object(); - var str = new StringBuilder(); - var cwt = new ConditionalWeakTable(); - - cwt.Add(obj, str); - - var wrKey = new WeakReference(obj); - var wrValue = new WeakReference(str); - str = null; - obj = null; - - GC.Collect(); - GC.WaitForPendingFinalizers(); - - Assert.IsNull(wrKey.Target, "Key should be collected now!"); - Assert.IsNull(wrValue.Target, "Value should be collected now!"); - - GC.KeepAlive(cwt); - } -#endif - - [TestMethod] - public void Remove_ValidKey_ShouldReturnTrue() - { - var obj = new object(); - var obj2 = new object(); - var cwt = new ConditionalWeakTable(); - - cwt.Add(obj, obj2); - - Assert.IsTrue(cwt.Remove(obj)); - } - - [TestMethod] - public void Remove_InvalidKey_ShouldReturnTrue() - { - var obj = new object(); - var obj2 = new object(); - var cwt = new ConditionalWeakTable(); - - cwt.Add(obj, obj2); - - Assert.IsFalse(cwt.Remove(obj2)); - } - - [TestMethod] - public void TryGetValue_ValidKey_ShouldReturnTrueAndValue() - { - var obj = new object(); - var obj2 = new object(); - var cwt = new ConditionalWeakTable(); - - cwt.Add(obj, obj2); - - object obj3; - Assert.IsTrue(cwt.TryGetValue(obj, out obj3), "Should find a value with the key!"); - Assert.AreEqual(obj2, obj3); - } - - [TestMethod] - public void TryGetValue_InvalidKey_ShouldReturnFalseAndNull() - { - var obj = new object(); - var obj2 = new object(); - var cwt = new ConditionalWeakTable(); - - cwt.Add(obj, obj2); - - object obj3; - Assert.IsFalse(cwt.TryGetValue(obj2, out obj3), "Should NOT find a value with the key!"); - Assert.IsNull(obj3); - } - -#if !CLR40 - [TestMethod] - public void Add_KeyValueSame_KeyShouldNotBeCollected() - { - // Dev10:556089 - This test demonstrations a bug in our implementation - // of ConditionalWeakTable which needs CLR 4 support to fix so once - // we switch to the CLR 4 version of ConditionalWeakTable this should go away. - - var obj = new object(); - var cwt = new ConditionalWeakTable(); - - cwt.Add(obj, obj); - - var wrKey = new WeakReference(obj); - obj = null; - - GC.Collect(); - GC.WaitForPendingFinalizers(); - - Assert.IsNotNull(wrKey.Target, "Key should NOT be collected yet!"); - - // Apply pressure to ensure they still don't go away. - ApplyMemoryPressureOnConditionalWeakTable(cwt); - - Assert.IsNotNull(wrKey.Target, "Key should NOT be collected yet!"); - - GC.KeepAlive(cwt); - } - - public class ObjectHolder - { - public object Obj { get; set; } - public ObjectHolder() { } - public ObjectHolder(object obj) - { - Obj = obj; - } - } - - [TestMethod] - public void Add_ValueReferencesKey_KeyAndValueShouldNotBeCollected() - { - // Dev10:556089 - This test demonstrations a bug in our implementation - // of ConditionalWeakTable which needs CLR 4 support to fix so once - // we switch to the CLR 4 version of ConditionalWeakTable this should go away. - - var obj = new object(); - var holder = new ObjectHolder(obj); - var cwt = new ConditionalWeakTable(); - - cwt.Add(obj, holder); - - var wrKey = new WeakReference(obj); - var wrValue = new WeakReference(holder); - holder = null; - obj = null; - - GC.Collect(); - GC.WaitForPendingFinalizers(); - - Assert.IsNotNull(wrKey.Target, "Key should NOT be collected yet!"); - Assert.IsNotNull(wrValue.Target, "Value should NOT be collected now!"); - - // Apply pressure to ensure they still don't go away. - ApplyMemoryPressureOnConditionalWeakTable(cwt); - - Assert.IsNotNull(wrKey.Target, "Key should NOT be collected yet!"); - Assert.IsNotNull(wrValue.Target, "Value should NOT be collected now!"); - - GC.KeepAlive(cwt); - } - - private void ApplyMemoryPressureOnConditionalWeakTable(ConditionalWeakTable table) - where T : class, new() - where V : class, new() - { - // Adding 100 items should do it. - for (int i = 0; i < 100; i++) - { - table.Add(new T(), new V()); - } - - GC.Collect(); - GC.WaitForPendingFinalizers(); - } -#endif //!CLR40 - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/ReadOnlyDictionaryDebuggerProxyTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/ReadOnlyDictionaryDebuggerProxyTests.cs deleted file mode 100644 index d0068e24d90..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/ReadOnlyDictionaryDebuggerProxyTests.cs +++ /dev/null @@ -1,76 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Microsoft.Internal.Collections -{ - [TestClass] - public class ReadOnlyDictionaryDebuggerProxyTests - { - [TestMethod] - public void Constructor_NullAsDictionaryArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("dictionary", () => - { - new ReadOnlyDictionaryDebuggerProxy((ReadOnlyDictionary)null); - }); - } - - [TestMethod] - public void Constructor_EmptyDictionaryAsDictionaryArgument_ShouldSetItemsPropertyToEmptyEnumerable() - { - var dictionary = CreateReadOnlyDictionary(); - - var proxy = new ReadOnlyDictionaryDebuggerProxy(dictionary); - - EnumerableAssert.IsEmpty(proxy.Items); - } - - [TestMethod] - public void Constructor_ValueAsDictionaryArgument_ShouldSetItemsProperty() - { - var expectations = Expectations.GetMetadata(); - - foreach (var e in expectations) - { - var proxy = new ReadOnlyDictionaryDebuggerProxy(CreateReadOnlyDictionary(e)); - - EnumerableAssert.AreEqual(e, proxy.Items); - } - } - - [TestMethod] - public void Items_ShouldNotCacheUnderlyingItems() - { - var dictionary = new Dictionary(); - dictionary.Add("Name", "Value"); - - var proxy = new ReadOnlyDictionaryDebuggerProxy(CreateReadOnlyDictionary(dictionary)); - - EnumerableAssert.AreEqual(dictionary, proxy.Items); - - dictionary.Add("AnotherName", "Value"); - - EnumerableAssert.AreEqual(dictionary, proxy.Items); - - dictionary.Add("AndAnotherName", "Value"); - - EnumerableAssert.AreEqual(dictionary, proxy.Items); - } - - private static ReadOnlyDictionary CreateReadOnlyDictionary() - { - return CreateReadOnlyDictionary(null); - } - - private static ReadOnlyDictionary CreateReadOnlyDictionary(IDictionary dictionary) - { - return new ReadOnlyDictionary(dictionary); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/ReadOnlyDictionaryTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/ReadOnlyDictionaryTests.cs deleted file mode 100644 index bad8b195370..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/ReadOnlyDictionaryTests.cs +++ /dev/null @@ -1,214 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Microsoft.Internal.Collections -{ - [TestClass] - public class ReadOnlyDictionaryTests - { - [TestMethod] - public void Constructor_NullAsDictionaryArgument_ShouldCreateEmptyDictionary() - { - var dictionary = new ReadOnlyDictionary(null); - - EnumerableAssert.IsEmpty(dictionary); - } - - [TestMethod] - public void Constructor_WritableDictionaryAsDictionaryArgument_ShouldPopulateCollection() - { - var dictionary = GetWritableDictionaryWithData(); - var readOnlyDictionary = new ReadOnlyDictionary(dictionary); - - EnumerableAssert.AreEqual(dictionary, readOnlyDictionary); - } - - [TestMethod] - public void Add1_ShouldThrowNotSupported() - { - var dictionary = GetReadOnlyDictionaryWithData(); - - ExceptionAssert.Throws(() => - { - dictionary.Add(new KeyValuePair("Key", "Value")); - }); - } - - [TestMethod] - public void Add2_ShouldThrowNotSupported() - { - var dictionary = GetReadOnlyDictionaryWithData(); - - ExceptionAssert.Throws(() => - { - dictionary.Add("Key", "Value"); - }); - } - - [TestMethod] - public void Clear_ShouldThrowNotSupported() - { - var dictionary = GetReadOnlyDictionaryWithData(); - - ExceptionAssert.Throws(() => - { - dictionary.Clear(); - }); - } - - [TestMethod] - public void Remove1_ShouldThrowNotSupported() - { - var dictionary = GetReadOnlyDictionaryWithData(); - - ExceptionAssert.Throws(() => - { - dictionary.Remove("Value"); - }); - } - - [TestMethod] - public void Remove2_ShouldThrowNotSupported() - { - var dictionary = GetReadOnlyDictionaryWithData(); - - ExceptionAssert.Throws(() => - { - dictionary.Remove(new KeyValuePair("Key", "Value")); - }); - } - - [TestMethod] - public void ItemSet_ShouldThrowNotSupported() - { - var dictionary = GetReadOnlyDictionaryWithData(); - - ExceptionAssert.Throws(() => - { - dictionary["Key"] = "Value"; - }); - } - - [TestMethod] - public void Keys_ShouldReturnWrappedDictionaryKeys() - { - var dictionary = GetWritableDictionaryWithData(); - var readOnlyDictionary = GetReadOnlyDictionary(dictionary); - - EnumerableAssert.AreEqual(readOnlyDictionary.Keys, dictionary.Keys); - } - - [TestMethod] - public void Values_ShouldReturnWrappedDictionaryValues() - { - var dictionary = GetWritableDictionaryWithData(); - var readOnlyDictionary = GetReadOnlyDictionary(dictionary); - - EnumerableAssert.AreEqual(readOnlyDictionary.Values, readOnlyDictionary.Values); - } - - [TestMethod] - public void IsReadOnly_ShouldAlwaysBeTrue() - { - var dictionary = GetWritableDictionaryWithData(); - var readOnlyDictionary = GetReadOnlyDictionary(dictionary); - - Assert.IsFalse(dictionary.IsReadOnly); - Assert.IsTrue(readOnlyDictionary.IsReadOnly); - } - - [TestMethod] - public void Count_ShouldReturnWrappedDictionaryCount() - { - var dictionary = GetWritableDictionaryWithData(); - var readOnlyDictionary = GetReadOnlyDictionary(dictionary); - - Assert.AreEqual(dictionary.Count, readOnlyDictionary.Count); - } - - [TestMethod] - public void ContainsKey() - { - var dictionary = GetWritableDictionaryWithData(); - var readOnlyDictionary = GetReadOnlyDictionary(dictionary); - - Assert.IsTrue(readOnlyDictionary.ContainsKey("Key1")); - Assert.IsFalse(readOnlyDictionary.ContainsKey("InvalidKey")); - } - - [TestMethod] - public void Contains() - { - var dictionary = GetWritableDictionaryWithData(); - var readOnlyDictionary = GetReadOnlyDictionary(dictionary); - - Assert.IsTrue(readOnlyDictionary.Contains(new KeyValuePair("Key1", "Value1"))); - Assert.IsFalse(readOnlyDictionary.Contains(new KeyValuePair("InvalidKey", "Value1"))); - Assert.IsFalse(readOnlyDictionary.Contains(new KeyValuePair("Key1", "InvalidValue"))); - } - - [TestMethod] - public void CopyTo() - { - var dictionary = GetWritableDictionaryWithData(); - var readOnlyDictionary = GetReadOnlyDictionary(dictionary); - KeyValuePair[] destination = new KeyValuePair [readOnlyDictionary.Count]; - readOnlyDictionary.CopyTo(destination, 0); - EnumerableAssert.AreEqual(readOnlyDictionary, destination); - } - - [TestMethod] - public void GetEnumerator() - { - var dictionary = GetWritableDictionaryWithData(); - var readOnlyDictionary = GetReadOnlyDictionary(dictionary); - IEnumerable> genericEnumerable = readOnlyDictionary; - EnumerableAssert.AreEqual(genericEnumerable, dictionary); - IEnumerable weakEnumerable = (IEnumerable)readOnlyDictionary; - EnumerableAssert.AreEqual(weakEnumerable, dictionary); - } - - [TestMethod] - public void Item() - { - var dictionary = GetWritableDictionaryWithData(); - var readOnlyDictionary = GetReadOnlyDictionary(dictionary); - Assert.AreEqual("Value1", readOnlyDictionary["Key1"], "Expecting to read wrapped value"); - } - - [TestMethod] - public void TryGetValue() - { - var dictionary = GetWritableDictionaryWithData(); - var readOnlyDictionary = GetReadOnlyDictionary(dictionary); - object result; - bool ret = readOnlyDictionary.TryGetValue("Key1", out result); - Assert.IsTrue(ret, "Expecting TryGetExportedValue to return true for wrapped key"); - Assert.AreEqual("Value1", result, "Expecting TryGetExportedValue to return wrapped value"); - } - - private static IDictionary GetReadOnlyDictionaryWithData() - { - return GetReadOnlyDictionary(GetWritableDictionaryWithData()); - } - - private static IDictionary GetReadOnlyDictionary(IDictionary dictionary) - { - return new ReadOnlyDictionary(dictionary); - } - - private static IDictionary GetWritableDictionaryWithData() - { - IDictionary dictionary = new Dictionary(); - dictionary.Add("Key1", "Value1"); - dictionary.Add("Key2", 42); - return dictionary; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/WeakReferenceCollectionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/WeakReferenceCollectionTests.cs deleted file mode 100644 index 2c65224df26..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/Microsoft/Internal/Collections/WeakReferenceCollectionTests.cs +++ /dev/null @@ -1,104 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Microsoft.Internal.Collections -{ - [TestClass] - public class WeakReferenceCollectionTests - { - [TestMethod] - public void Add_ObjectShouldGetCollected() - { - var obj = new object(); - var wrc = new WeakReferenceCollection(); - - wrc.Add(obj); - - var wr = new WeakReference(obj); - obj = null; - - Assert.IsNotNull(wr.Target, "Object should NOT have been collected yet!"); - - GC.Collect(); - GC.WaitForPendingFinalizers(); - - Assert.IsNull(wr.Target, "Object should have been collected!"); - - GC.KeepAlive(wrc); - } - - [TestMethod] - public void Remove_ObjectShouldGetRemoved() - { - var obj = new object(); - var wrc = new WeakReferenceCollection(); - - wrc.Add(obj); - - Assert.AreEqual(1, wrc.AliveItemsToList().Count, "Should have 1 item!"); - - wrc.Remove(obj); - - Assert.AreEqual(0, wrc.AliveItemsToList().Count, "Should have 0 item!"); - } - - [TestMethod] - public void AliveItemsToList_ShouldReturnAllItems() - { - var list = new object[] {new object(), new object(), new object()}; - var wrc = new WeakReferenceCollection(); - - foreach (object obj in list) - { - wrc.Add(obj); - } - - Assert.AreEqual(list.Length, wrc.AliveItemsToList().Count, "Should have same number of items!"); - } - - [TestMethod] - public void AliveItemsToList_ShouldReturnAllAliveItems() - { - var list = new object[] { new object(), new object(), new object() }; - var wrc = new WeakReferenceCollection(); - - var obj1 = new object(); - wrc.Add(obj1); - - foreach (object obj in list) - { - wrc.Add(obj); - } - - var obj2 = new object(); - wrc.Add(obj2); - - Assert.AreEqual(list.Length + 2, wrc.AliveItemsToList().Count, "Should have same number of items!"); - - obj1 = obj2 = null; - - GC.Collect(); - GC.WaitForPendingFinalizers(); - - var aliveItems = wrc.AliveItemsToList(); - Assert.AreEqual(list.Length, aliveItems.Count, "Should have 2 less items!"); - - Assert.AreEqual(list[0], aliveItems[0]); - Assert.AreEqual(list[1], aliveItems[1]); - Assert.AreEqual(list[2], aliveItems[2]); - } - - [TestMethod] - public void AliveItemsToList_ShouldReturnEmpty() - { - var wrc = new WeakReferenceCollection(); - Assert.AreEqual(0, wrc.AliveItemsToList().Count, "Should have 0 items!"); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/StringsTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/StringsTests.cs deleted file mode 100644 index aec6ad248fa..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/StringsTests.cs +++ /dev/null @@ -1,123 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.Internal; -using System.Threading; -using System.Globalization; - -namespace System -{ - [TestClass] - public class StringsTests - { - [TestMethod] - public void PropertiesAreInsyncWithResources() - { - var properties = GetStringProperties(); - - Assert.IsTrue(properties.Length > 0, "Expected to find at least one string property in Strings.cs."); - - foreach (PropertyInfo property in properties) - { - object value = property.GetValue(null, (object[])null); - - Assert.IsNotNull(value, "Property '{0}' does not have an associated string in Strings.resx.", property.Name); - } - } - - private static PropertyInfo[] GetStringProperties() - { - PropertyInfo[] properties = typeof(Strings).GetProperties(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static); - - return properties.Where(property => - { - return !CanIgnore(property); - - }).ToArray(); - } - - private static bool CanIgnore(PropertyInfo property) - { - switch (property.Name) - { - case "Culture": - case "ResourceManager": - return true; - } - - return false; - } - -#if !SILVERLIGHT - [TestMethod] - public void LocalizedResourcesArePickedUpBasedOnThreadCulture() - { - // verify each property against an en-US resource manager - bool wasVerified = false; - bool areLocalizedCLRResourcesAvailable = AreLocalizedCLRResourcesAvailable(); - foreach (var stringsPropInfo in GetStringProperties()) - { - string referenceValue = String.Empty; - PerformOnEnUsThread(() => - { - referenceValue = (string)stringsPropInfo.GetValue(null, (object[])null); - }); - string actualValue = (string)stringsPropInfo.GetValue(null, (object[])null); - - // determine if LangPacks are installed for the the CurrentUICulture. If not, default to english - if (areLocalizedCLRResourcesAvailable) - { - Assert.AreNotEqual(referenceValue, actualValue, "Failed to pick up localized resources for UI culture '{0}'", Thread.CurrentThread.CurrentUICulture.Name); - } - else - { - Assert.AreEqual(referenceValue, actualValue); - } - - wasVerified = true; - } - - Assert.IsTrue(wasVerified); - } - - - private bool AreLocalizedCLRResourcesAvailable() - { - if (Thread.CurrentThread.CurrentUICulture.LCID == 1033) // en-US - { - return false; - } - - object regValue = Microsoft.Win32.Registry.GetValue( - GetRegPath(), - "Install", - 0); - - return (regValue != null) && ((int)regValue == 1); - } - - private string GetRegPath() - { - var path = String.Format( - @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v{0}\Client\{1}", - typeof(string).Assembly.GetName().Version.Major, - Thread.CurrentThread.CurrentUICulture.LCID); - - return path; - } - - private static void PerformOnEnUsThread(Action action) - { - Thread enUsThread = new Thread(new ThreadStart(action)); - enUsThread.CurrentUICulture = new CultureInfo("en-US"); - enUsThread.Start(); - enUsThread.Join(); - } -#endif - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/.gitattributes deleted file mode 100644 index 92b4bafc804..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/LazyOfTTMetadataTests.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/.gitattributes deleted file mode 100644 index f8ca5608c10..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/.gitattributes +++ /dev/null @@ -1,51 +0,0 @@ -/AdvancedValueComposition.cs -crlf -/AggregateExportProviderTest.cs -crlf -/AttributedModelServicesTests.cs -crlf -/CardinalityMismatchExceptionTests.cs -crlf -/ComponentModelTestTypes.cs -crlf -/ComponentServicesTests.cs -crlf -/ComposablePartCatalogExtensions.cs -crlf -/ComposablePartDefinitionTests.cs -crlf -/ComposablePartExceptionTests.cs -crlf -/ComposablePartExtensibilityTests.cs -crlf -/ComposablePartTests.cs -crlf -/CompositionContainerCollectionTests.cs -crlf -/CompositionContainerExtensibilityTests.cs -crlf -/CompositionContainerExtensions.cs -crlf -/CompositionContainerImportTests.cs -crlf -/CompositionContainerTests.cs -crlf -/CompositionErrorDebuggerProxyTests.cs -crlf -/CompositionErrorIdTests.cs -crlf -/CompositionErrorTests.cs -crlf -/CompositionExceptionTests.cs -crlf -/CompositionResultOfTTest.cs -crlf -/CompositionResultTest.cs -crlf -/CompositionServiceExtensionsTests.cs -crlf -/CompositionServiceProxy.cs -crlf -/CompositionServicesTests.cs -crlf -/ConcreteComposablePart.cs -crlf -/ConstraintServicesTests.cs -crlf -/ContractBasedImportDefinitionTests.cs -crlf -/ContractMismatchExceptionTests.cs -crlf -/DynamicMetadata.cs -crlf -/Expectations.cs -crlf -/ExportAttributeTests.cs -crlf -/ExportCollectionTests.cs -crlf -/ExportDefinitionTests.cs -crlf -/ExportMetadataAttributeTests.cs -crlf -/ExportProviderTests.cs -crlf -/ExportTests.cs -crlf -/ExportableAttributeTests.cs -crlf -/GenerationServicesTests.cs -crlf -/ImportAttributeTests.cs -crlf -/ImportDefinitionTests.cs -crlf -/ImportingComposablePart.cs -crlf -/ImportingConstructorAttributeTests.cs -crlf -/InitializationScopeTests.cs -crlf -/MetadataAttributeAttributeTests.cs -crlf -/MetadataTests.cs -crlf -/MetadataViewProviderTests.cs -crlf -/MicroExport.cs -crlf -/PartCreationPolicyAttributeTests.cs -crlf -/PartMetadataAttributeTests.cs -crlf -/SampleComponents.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AdvancedValueComposition.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AdvancedValueComposition.cs deleted file mode 100644 index b46d7557508..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AdvancedValueComposition.cs +++ /dev/null @@ -1,275 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.UnitTesting; -using System.ComponentModel.Composition.AttributedModel; -using System.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class AdvancedValueComposition - { - [TestMethod] - public void RepeatedContainerUse() - { - var container = ContainerFactory.Create(); - TrivialExporter e = new TrivialExporter(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(e); - container.Compose(batch); - - batch = new CompositionBatch(); - batch.AddPart(new TrivialImporter()); - container.Compose(batch); - - Assert.IsTrue(e.done, "Initialization of importer should have set the done flag on E"); - } - - [TestMethod] - public void FunctionsFieldsAndProperties() - { - Consumer c; - var container = ContainerFactory.Create(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new RealAddProvider()); - batch.AddPart(c = new Consumer()); - container.Compose(batch); - - Assert.AreEqual(3, c.op(c.a, c.b), "1 + 2 == 3"); - } - [TestMethod] - public void FunctionsFieldsAndProperties2() - { - Consumer c; - var container = ContainerFactory.Create(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new SubtractProvider()); - batch.AddPart(c = new Consumer()); - container.Compose(batch); - - Assert.AreEqual(-1, c.op(c.a, c.b), "1 - 2 == -1"); - } - - [TestMethod] - public void FunctionsFieldsAndProperties2_WithCatalog() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - - ConsumerOfMultiple c = new ConsumerOfMultiple(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(c); - container.Compose(batch); - - foreach (var export in c.opInfo) - { - if ((string)export.Metadata["Var1"] == "add") - { - Assert.AreEqual(3, export.Value(1, 2), "1 + 2 == 3"); - } - else if ((string)export.Metadata["Var1"] == "sub") - { - Assert.AreEqual(-1, export.Value(1, 2), "1 - 2 == -1"); - } - else - { - Assert.Fail("Unexpected value"); - } - } - } - -#if !SILVERLIGHT - // Silverlight doesn't support strongly typed metadata - [TestMethod] - public void FunctionsFieldsAndProperties2_StronglyTypedMetadata() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - - var exports = container.GetExports, IExportableTest>("Add"); - - foreach (var export in exports) - { - if (export.Metadata.Var1 == "add") - { - Assert.AreEqual(3, export.Value(1, 2), "1 + 2 == 3"); - } - else if (export.Metadata.Var1 == "sub") - { - Assert.AreEqual(-1, export.Value(1, 2), "1 - 2 == -1"); - } - else - { - Assert.Fail("Unexpected value"); - } - } - } - - [TestMethod] - public void InAdditionToCatalogTest() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - - IDictionary multMetadata = new Dictionary(); - multMetadata["Var1"]= "mult"; - multMetadata[CompositionConstants.ExportTypeIdentityMetadataName] = AttributedModelServices.GetTypeIdentity(typeof(Func)); - var basicValue = ExportFactory.Create("Add", multMetadata, (() => (Func)delegate(int a, int b) { return a * b; })); - - CompositionBatch batch = new CompositionBatch(); - batch.AddExport(basicValue); - container.Compose(batch); - - var exports = container.GetExports, IExportableTest>("Add"); - - Assert.AreEqual(3, exports.Count(), "There should be 3 entries for 'Add'"); - - foreach (var export in exports) - { - if (export.Metadata.Var1 == "mult") - { - Assert.AreEqual(2, export.Value(1, 2), "1 * 2 == 2"); - } - else if (export.Metadata.Var1 == "add") - { - Assert.AreEqual(3, export.Value(1, 2), "1 + 2 == 3"); - } - else if (export.Metadata.Var1 == "sub") - { - Assert.AreEqual(-1, export.Value(1, 2), "1 - 2 == -1"); - } - else - { - Assert.Fail("Unexpected value"); - } - } - } - - [TestMethod] - public void CollectionMetadataPropertyTest() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - var export = container.GetExport(); - - Assert.IsNotNull(export.Metadata, "Should have metadata"); - Assert.IsNotNull(export.Metadata.Values, "MetadataView should have collection of values"); - Assert.AreEqual(export.Metadata.Values.Count(), 3, "Should have 3 elements"); - Assert.AreEqual(export.Metadata.Values.First(), "One", "First should be 'One'"); - Assert.AreEqual(export.Metadata.Values.Skip(1).First(), "two", "First should be 'two'"); - Assert.AreEqual(export.Metadata.Values.Skip(2).First(), "3", "First should be '3'"); - } -#endif //!SIVLERLIGHT - - [TestMethod] - public void ImportExportSansNameTest() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - - UnnamedImportAndExport unnamed = container.GetExportedValue(); - Assert.IsNotNull(unnamed, "Should have found UnnamedImportAndExport component"); - Assert.IsNotNull(unnamed.ImportedValue, "Component's unnamed import should have been fulfilled"); - } - - [TestMethod] - public void MultipleInstantiationOfStaticCatalogItem() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - var unnamedVI = container.GetExport(); - - StaticExport first = unnamedVI.Value; - StaticExport second = unnamedVI.Value; - - Assert.IsNotNull(first, "Should have created an instance"); - Assert.IsNotNull(second, "Should have created a second instance"); - Assert.IsTrue(object.ReferenceEquals(first, second), "Instances should be the same"); - - var exports = container.GetExports(); - - Assert.AreEqual(1, exports.Count(), "There should still only be one exported value"); - } - - [TestMethod] - public void MultipleInstantiationOfNonStaticCatalogItem() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - var export1 = container.GetExport(); - var export2 = container.GetExport(); - - NonStaticExport first = export1.Value; - NonStaticExport second = export2.Value; - - Assert.IsNotNull(first, "Should have created an instance"); - Assert.IsNotNull(second, "Should have created a second instance"); - Assert.IsFalse(object.ReferenceEquals(first, second), "Instances should be different"); - } - - [TestMethod] - public void ImportIntoUntypedExportTest() - { - var container = ContainerFactory.Create(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("untyped", 42); - - var u = new UntypedExportImporter(); - var rb = AttributedModelServices.CreatePart(u); - - batch.AddPart(rb); - container.Compose(batch); - - Assert.AreEqual(42, u.Export.Value); - - var us = new UntypedExportsImporter(); - batch = new CompositionBatch(); - batch.AddExportedValue("untyped", 19); - batch.RemovePart(rb); - batch.AddPart(us); - container.Compose(batch); - - Assert.IsNotNull(us.Exports, "Should have an enumeration"); - Assert.AreEqual(2, us.Exports.Count(), "Should have 2 values"); - } - - [TestMethod] - public void ImportIntoDerivationOfExportException() - { - var container = ContainerFactory.Create(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("derived", typeof(DerivedExport), 42); - var d = new DerivedExportImporter(); - batch.AddPart(d); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportIntoDerivationOfExportsException() - { - var container = ContainerFactory.Create(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("derived", typeof(DerivedExport), 42); - var d = new DerivedExportsImporter(); - batch.AddPart(d); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AggregateExportProviderTest.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AggregateExportProviderTest.cs deleted file mode 100644 index 464e82ac8dc..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AggregateExportProviderTest.cs +++ /dev/null @@ -1,100 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Primitives; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.Threading; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Hosting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class AggregateExportProviderTests - { - [TestMethod] - public void Constructor1_NullAsProvidersArgument_ShouldSetProvidersPropertyToEmpty() - { - var provider = new AggregateExportProvider((ExportProvider[])null); - - EnumerableAssert.IsEmpty(provider.Providers); - } - - [TestMethod] - public void Constructor2_NullAsProvidersArgument_ShouldSetProvidersPropertyToEmpty() - { - var provider = new AggregateExportProvider((IEnumerable)null); - - EnumerableAssert.IsEmpty(provider.Providers); - } - - [TestMethod] - public void Constructor1_EmptyArrayAsProvidersArgument_ShouldSetProvidersPropertyToEmpty() - { - var provider = new AggregateExportProvider(new ExportProvider[0]); - - EnumerableAssert.IsEmpty(provider.Providers); - } - - [TestMethod] - public void Constructor2_EmptyArrayAsProvidersArgument_ShouldSetProvidersPropertyToEmpty() - { - var provider = new AggregateExportProvider((IEnumerable)new ExportProvider[0]); - - EnumerableAssert.IsEmpty(provider.Providers); - } - - [TestMethod] - public void Constructor2_EmptyEnumerableAsProvidersArgument_ShouldSetProvidersPropertyToEmpty() - { - var provider = new AggregateExportProvider(Enumerable.Empty()); - - EnumerableAssert.IsEmpty(provider.Providers); - } - - [TestMethod] - public void Constructor1_ArrayAsProvidersArgument_ShouldNotAllowModificationAfterConstruction() - { - var providers = new ExportProvider[] { ExportProviderFactory.Create() }; - var provider = new AggregateExportProvider(providers); - - providers[0] = null; - - Assert.IsNotNull(provider.Providers[0]); - } - - [TestMethod] - public void Constructor2_ArrayAsProvidersArgument_ShouldNotAllowModificationAfterConstruction() - { - var providers = new ExportProvider[] { ExportProviderFactory.Create() }; - var provider = new AggregateExportProvider((IEnumerable)providers); - - providers[0] = null; - - Assert.IsNotNull(provider.Providers[0]); - } - - [TestMethod] - public void Providers_WhenDisposed_ShouldThrowObjectDisposed() - { - var provider = CreateAggregateExportProvider(); - provider.Dispose(); - - ExceptionAssert.ThrowsDisposed(provider, () => - { - var providers = provider.Providers; - }); - } - - private AggregateExportProvider CreateAggregateExportProvider() - { - return new AggregateExportProvider(Enumerable.Empty()); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/.gitattributes deleted file mode 100644 index 3e0ba3aed3f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -/AllowNonPublicCompositionTests.cs -crlf -/AttributedModelCompositionTests.cs -crlf -/AttributedModelDiscoveryTests.cs -crlf -/INotifyImportTests.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/AllowNonPublicCompositionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/AllowNonPublicCompositionTests.cs deleted file mode 100644 index 0771d89264a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/AllowNonPublicCompositionTests.cs +++ /dev/null @@ -1,288 +0,0 @@ -#if !SILVERLIGHT - -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class AllowNonPublicCompositionTests - { - [TestMethod] - public void PublicFromPublic() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - var importer = new AllPublicImportOnly(); - batch.AddPart(importer); - batch.AddPart(new AllPublicExportOnly() { ExportA = 5, ExportB = 10 }); - container.Compose(batch); - - Assert.AreEqual(5, importer.ImportA); - Assert.AreEqual(10, importer.ImportB); - } - [TestMethod] - public void PublicToSelf() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - var importer = new AllPublic() { ExportA = 5, ExportB = 10 }; - batch.AddPart(importer); - container.Compose(batch); - - Assert.AreEqual(5, importer.ImportA); - Assert.AreEqual(10, importer.ImportB); - } - [TestMethod] - public void PublicFromPrivate() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - var importer = new AllPublicImportOnly(); - batch.AddPart(importer); - batch.AddPart(new AllPrivateExportOnly(5, 10)); - container.Compose(batch); - - Assert.AreEqual(5, importer.ImportA); - Assert.AreEqual(10, importer.ImportB); - } - [TestMethod] - public void PrivateFromPublic() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - var importer = new AllPrivateImportOnly(); - batch.AddPart(importer); - batch.AddPart(new AllPublicExportOnly() { ExportA = 5, ExportB = 10 }); - container.Compose(batch); - - Assert.AreEqual(5, importer.PublicImportA); - Assert.AreEqual(10, importer.PublicImportB); - } - [TestMethod] - public void PrivateToSelf() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - var importer = new AllPrivate(5, 10); - batch.AddPart(importer); - container.Compose(batch); - - Assert.AreEqual(5, importer.PublicImportA); - Assert.AreEqual(10, importer.PublicImportB); - } - [TestMethod] - public void PrivateData() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - var importer = new PrivateDataImportExport(5); - batch.AddPart(importer); - container.Compose(batch); - - Assert.AreEqual(5, importer.X); - } - [TestMethod] - public void TestPublicImportsExpectingPublicExportsFromCatalog() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - container.GetExportedValue().VerifyIsBound(); - } - [TestMethod] - public void TestInternalImportsExpectingPublicExportsFromCatalog() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - container.GetExportedValue().VerifyIsBound(); - } - [TestMethod] - public void TestPublicImportsExpectingInternalExportsFromCatalog() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - container.GetExportedValue().VerifyIsBound(); - } - [TestMethod] - public void TestInternalImportsExpectingInternalExportsFromCatalog() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - container.GetExportedValue().VerifyIsBound(); - } - [TestMethod] - public void TestPublicImportsExpectingProtectedExportsFromCatalog() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - container.GetExportedValue().VerifyIsBound(); - } - [TestMethod] - public void TestInternalImportsExpectingProtectedExportsFromCatalog() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - container.GetExportedValue().VerifyIsBound(); - } - [TestMethod] - public void TestPublicImportsExpectingProtectedInternalExportsFromCatalog() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - container.GetExportedValue().VerifyIsBound(); - } - [TestMethod] - public void TestInternalImportsExpectingProtectedInternalExportsFromCatalog() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - container.GetExportedValue().VerifyIsBound(); - } - [TestMethod] - public void TestPublicImportsExpectingPrivateExportsFromCatalog() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - container.GetExportedValue().VerifyIsBound(); - } - [TestMethod] - public void TestInternalImportsExpectingPrivateExportsFromCatalog() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - container.GetExportedValue().VerifyIsBound(); - } - } - - public interface IData { int X { get; set; } } - - public class PrivateDataImportExportWithContract - { - public PrivateDataImportExportWithContract(int x) - { - Out = new PrivateDataType() { X = x }; - } - public int X { get { return In.X; } } - [Export("a")] - PrivateDataType Out { get; set; } - [Import("a")] - IData In { get; set; } - } - - public class PrivateDataImportExport - { - public PrivateDataImportExport(int x) - { - Out = new PrivateDataType() { X = x }; - } - public int X { get { return In.X; } } - [Export] - PrivateDataType Out { get; set; } - [Import] - PrivateDataType In { get; set; } - } - - class PrivateDataType - { - public int X { get; set; } - } - - public class AllPrivateNoAttribute - { - public AllPrivateNoAttribute(int exportA, int exportB) { ExportA = exportA; ExportB = exportB; } - - public int PublicImportA { get { return ImportA; } } - public int PublicImportB { get { return ImportB; } } - - [Import("a")] - int ImportA { get; set; } - [Import("b")] - int ImportB { get; set; } - [Export("a")] - int ExportA { get; set; } - [Export("b")] - int ExportB { get; set; } - } - public class AllPrivateNoAttributeImportOnly - { - public int PublicImportA { get { return ImportA; } } - public int PublicImportB { get { return ImportB; } } - - [Import("a")] - int ImportA { get; set; } - [Import("b")] - int ImportB { get; set; } - } - - public class AllPrivate - { - public AllPrivate(int exportA, int exportB) { ExportA = exportA; ExportB = exportB; } - - public int PublicImportA { get { return ImportA; } } - public int PublicImportB { get { return ImportB; } } - - [Import("a")] - int ImportA { get; set; } - [Import("b")] - int ImportB { get; set; } - [Export("a")] - int ExportA { get; set; } - [Export("b")] - int ExportB { get; set; } - } - - public class AllPrivateImportOnly - { - public int PublicImportA { get { return ImportA; } } - public int PublicImportB { get { return ImportB; } } - - [Import("a")] - int ImportA { get; set; } - [Import("b")] - int ImportB { get; set; } - } - - public class AllPrivateExportOnly - { - public AllPrivateExportOnly(int exportA, int exportB) { ExportA = exportA; ExportB = exportB; } - - [Export("a")] - int ExportA { get; set; } - [Export("b")] - int ExportB { get; set; } - } - - public class AllPublic - { - [Import("a")] - public int ImportA { get; set; } - [Import("b")] - public int ImportB { get; set; } - [Export("a")] - public int ExportA { get; set; } - [Export("b")] - public int ExportB { get; set; } - } - public class AllPublicImportOnly - { - [Import("a")] - public int ImportA { get; set; } - [Import("b")] - public int ImportB { get; set; } - } - public class AllPublicExportOnly - { - [Export("a")] - public int ExportA { get; set; } - [Export("b")] - public int ExportB { get; set; } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/AttributedModelCompositionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/AttributedModelCompositionTests.cs deleted file mode 100644 index 4a6adca7781..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/AttributedModelCompositionTests.cs +++ /dev/null @@ -1,465 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Linq; -using System.ComponentModel.Composition.Factories; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.UnitTesting; - -namespace System.ComponentModel.Composition.AttributedModel -{ - [TestClass] - public class AttributedModelCompositionTests - { - [TestMethod] - public void PartContainingOnlyStaticExports_ShouldNotCauseInstanceToBeCreated() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(HasOnlyStaticExports)); - - Assert.AreEqual("Field", container.GetExportedValue("Field")); - Assert.AreEqual("Property", container.GetExportedValue("Property")); - Assert.IsNotNull("Method", container.GetExportedValue>("Method")()); - - Assert.IsFalse(HasOnlyStaticExports.InstanceCreated); - } - - [TestMethod] - public void ExportOnAbstractBase_DoesNotReturnNull() - { // 499393 - Classes inheriting from an exported - // abstract class are exported as 'null' - - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - var definition = PartDefinitionFactory.CreateAttributed(typeof(Derived)); - batch.AddPart(definition.CreatePart()); - container.Compose(batch); - - Assert.IsNotNull(container.GetExportedValueOrDefault()); - } - - [TestMethod] - public void ReadOnlyFieldImport_ShouldThrowComposition() - { - var importer = PartFactory.CreateAttributed(new ReadOnlyPropertyImport()); - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddExportedValue("readonly", "new value"); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotActivate, - ErrorId.ReflectionModel_ImportNotWritable, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ReadOnlyPropertyImport_ShouldThrowComposition() - { - var importer = PartFactory.CreateAttributed(new ReadOnlyPropertyImport()); - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddExportedValue("readonly", "new value"); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotActivate, - ErrorId.ReflectionModel_ImportNotWritable, RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void WriteOnlyPropertyExport_ShouldThrowComposition() - { - var importer = PartFactory.CreateAttributed(new WriteOnlyPropertyExport()); - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - container.Compose(batch); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, ErrorId.ReflectionModel_ExportNotReadable, () => - { - container.GetExportedValue("writeonly"); - }); - } - - [TestMethod] - public void ImportValueMismatchFromInt32ToDateTime() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new ImportValueTypes()); - batch.AddExportedValue("DateTime", typeof(DateTime), 42); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportValueMismatchFromInt16ToInt32() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new ImportValueTypes()); - batch.AddExportedValue("Int32", typeof(Int32), (short)10); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - - } - - [TestMethod] - public void ImportValueMismatchFromInt32ToInt16() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new ImportValueTypes()); - batch.AddExportedValue("Int16", typeof(Int16), (int)10); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportValueMismatchFromInt32ToUInt32() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new ImportValueTypes()); - batch.AddExportedValue("UInt32", typeof(UInt32), (int)10); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportValueMismatchFromUInt32ToInt32() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new ImportValueTypes()); - batch.AddExportedValue("Int32", typeof(Int32), (uint)10); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportValueMismatchFromInt32ToInt64() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new ImportValueTypes()); - batch.AddExportedValue("Int64", typeof(Int64), (int)10); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportValueMismatchFromSingleToDouble() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new ImportValueTypes()); - batch.AddExportedValue("Double", typeof(Double), (float)10); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportValueMismatchFromDoubleToSingle() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new ImportValueTypes()); - batch.AddExportedValue("Single", typeof(Single), (double)10); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportValueMismatchFromSingleToInt32() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new ImportValueTypes()); - batch.AddExportedValue("Int32", typeof(Int32), (float)10); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportValueMismatchFromInt32ToSingle() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new ImportValueTypes()); - batch.AddExportedValue("Single", typeof(Single), (int)10); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void MemberExports() - { - var exporter = PartFactory.CreateAttributed(new ObjectWithMemberExports()); - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(exporter); - container.Compose(batch); - - var filedExports = container.GetExports("field"); - ExportsAssert.AreEqual(filedExports, 1, 5); - - var readonlyExports = container.GetExports("readonly"); - ExportsAssert.AreEqual(readonlyExports, 2, 6); - - var propertyExports = container.GetExports("property"); - ExportsAssert.AreEqual(propertyExports, 3, 7); - - var methodExports = container.GetExportedValues>("func").Select(f => f(0)); - EnumerableAssert.AreEqual(methodExports, 4, 8); - } - - [TestMethod] - public void TestExportedValueCachesValue() - { - var container = ContainerFactory.Create(); - var exporter = new ExportsMutableProperty(); - exporter.Property = "Value1"; - - container.ComposeParts(exporter); - - Assert.AreEqual("Value1", container.GetExportedValue("Property")); - - exporter.Property = "Value2"; - - // Exported value should have been cached and so it shouldn't change - Assert.AreEqual("Value1", container.GetExportedValue("Property")); - } - - [TestMethod] - [WorkItem(739354)] - [Ignore] - public void TestExportedValueCachesNullValue() - { - var container = ContainerFactory.Create(); - var exporter = new ExportsMutableProperty(); - exporter.Property = null; - - container.ComposeParts(exporter); - - Assert.IsNull(container.GetExportedValue("Property")); - - exporter.Property = "Value1"; - - // Exported value should have been cached and so it shouldn't change - Assert.IsNull(container.GetExportedValue("Property")); - } - - public class ExportsMutableProperty - { - [Export("Property")] - public string Property { get; set; } - } - - public class ReadOnlyFieldImport - { - [Import("readonly")] - public readonly string Value = "Value"; - } - - public class ReadOnlyPropertyImport - { - [Import("readonly")] - public string Value - { - get { return "Value"; } - } - } - - public class WriteOnlyPropertyExport - { - [Export("writeonly")] - public string Value - { - set { } - } - } - - public class ObjectWithMemberExports - { - [Export("field")] - public static int staticField = 1; - - [Export("readonly")] - public static readonly int staticReadonly = 2; - - [Export("property")] - public static int StaticProperty { get { return 3; } } - - [Export("func")] - public static int StaticMethod(int arg1) { return 4; } - - [Export("field")] - public int instanceField = 5; - - [Export("readonly")] - public readonly int instanceReadonly = 6; - - [Export("property")] - public int InstanceProperty { get { return 7; } } - - [Export("func")] - public int InstanceMethod(int arg1) { return 8; } - } - - public class HasOnlyStaticExports - { - public static bool InstanceCreated; - - public HasOnlyStaticExports() - { - InstanceCreated = true; - } - - [Export("Field")] - public static string Field = "Field"; - - [Export("Property")] - public static string Property - { - get { return "Property"; } - } - - [Export("Method")] - public static string Method() - { - return "Method"; - } - } - - [InheritedExport(typeof(Base))] - public abstract class Base - { - } - - [Export(typeof(Derived))] - public class Derived : Base - { - } - - public class ImportValueTypes - { - [Import("Int16", AllowDefault = true)] - public short Int16 - { - get; - set; - } - - [Import("Int32", AllowDefault = true)] - public int Int32 - { - get; - set; - } - - [Import("UInt32", AllowDefault = true)] - [CLSCompliant(false)] - public uint UInt32 - { - get; - set; - } - - [Import("Int64", AllowDefault = true)] - public long Int64 - { - get; - set; - } - - [Import("Single", AllowDefault = true)] - public float Single - { - get; - set; - } - - [Import("Double", AllowDefault = true)] - public double Double - { - get; - set; - } - - [Import("DateTime", AllowDefault = true)] - public DateTime DateTime - { - get; - set; - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscoveryTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscoveryTests.cs deleted file mode 100644 index 15a214662b2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscoveryTests.cs +++ /dev/null @@ -1,345 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.ReflectionModel; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.UnitTesting; -using System.Linq; -using System.Reflection; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.AttributedModel -{ - [TestClass] - public class AttributedModelDiscoveryTests - { - [TestMethod] - public void CreatePartDefinition_TypeWithExports_ShouldHaveMultipleExports() - { - var definition = CreateDefinition(typeof(PublicComponentWithPublicExports)); - EnumerableAssert.AreEqual(definition.ExportDefinitions.Select(e => e.ContractName), "PublicField", "PublicProperty", "PublicDelegate"); - } - - public abstract class BaseClassWithPropertyExports - { - [Export("MyPropBase")] - public virtual int MyProp { get; set; } - } - - public class DerivedClassWithInheritedPropertyExports : BaseClassWithPropertyExports - { - public override int MyProp { get; set; } - } - - [WorkItem(551341)] - [TestMethod] - public void ShowIssueWithVirtualPropertiesInReflectionAPI() - { - PropertyInfo propInfo = typeof(BaseClassWithPropertyExports).GetProperty("MyProp"); - - // pi.GetCustomAttributes does not find the inherited attributes - var c1 = propInfo.GetCustomAttributes(true); - - // Attribute.GetCustomAttributes does find the inherited attributes - var c2 = Attribute.GetCustomAttributes(propInfo, true); - - // This seems like it should be a bug in the reflection API's... - Assert.AreNotEqual(c1, c2); - } - - [TestMethod] - public void CreatePartDefinition_TypeWithImports_ShouldHaveMultipleImports() - { - var definition = CreateDefinition(typeof(PublicImportsExpectingPublicExports)); - EnumerableAssert.AreEqual(definition.ImportDefinitions.Cast() - .Select(i => i.ContractName), "PublicField", "PublicProperty", "PublicDelegate", "PublicIGetString"); - } - - public class AnyImplicitExport - { - - } - - [TestMethod] - public void CreatePartDefinition_AnyType_ShouldHaveMetadataWithAnyImplicitCreationPolicy() - { - var definition = CreateDefinition(typeof(AnyImplicitExport)); - - Assert.AreEqual(CreationPolicy.Any, definition.Metadata.GetValue(CompositionConstants.PartCreationPolicyMetadataName)); - } - - [PartCreationPolicy(CreationPolicy.Any)] - public class AnyExport - { - - } - - [TestMethod] - public void CreatePartDefinition_AnyType_ShouldHaveMetadataWithAnyCreationPolicy() - { - var definition = CreateDefinition(typeof(AnyExport)); - - Assert.AreEqual(CreationPolicy.Any, definition.Metadata.GetValue(CompositionConstants.PartCreationPolicyMetadataName)); - } - - - [PartCreationPolicy(CreationPolicy.Shared)] - public class SharedExport - { - - } - - [TestMethod] - public void CreatePartDefinition_SharedType_ShouldHaveMetadataWithSharedCreationPolicy() - { - var definition = CreateDefinition(typeof(SharedExport)); - - Assert.AreEqual(CreationPolicy.Shared, definition.Metadata.GetValue(CompositionConstants.PartCreationPolicyMetadataName)); - } - - [PartCreationPolicy(CreationPolicy.NonShared)] - public class NonSharedExport - { - - } - - [TestMethod] - public void CreatePartDefinition_NonSharedType_ShouldHaveMetadataWithNonSharedCreationPolicy() - { - var definition = CreateDefinition(typeof(NonSharedExport)); - - Assert.AreEqual(CreationPolicy.NonShared, definition.Metadata.GetValue(CompositionConstants.PartCreationPolicyMetadataName)); - } - - [PartMetadata(CompositionConstants.PartCreationPolicyMetadataName, CreationPolicy.NonShared)] - [PartMetadata("ShouldNotBeIgnored", "Value")] - public class PartWithIgnoredMetadata - { - } - - [TestMethod] - public void CreatePartDefinition_SharedTypeMarkedWithNonSharedMetadata_ShouldHaveMetadatWithSharedCreationPolicy() - { - // Type should just contain all the default settings of Shared - var definition = CreateDefinition(typeof(PartWithIgnoredMetadata)); - - // CompositionConstants.PartCreationPolicyMetadataName should be ignored - Assert.AreNotEqual(CreationPolicy.NonShared, definition.Metadata.GetValue(CompositionConstants.PartCreationPolicyMetadataName)); - - // Key ShouldNotBeIgnored should actully be in the dictionary - Assert.AreEqual("Value", definition.Metadata["ShouldNotBeIgnored"]); - } - - [PartMetadata("BaseOnlyName", 1)] - [PartMetadata("OverrideName", 2)] - public class BasePartWithMetdata - { - - } - - [PartMetadata("DerivedOnlyName", 3)] - [PartMetadata("OverrideName", 4)] - public class DerivedPartWithMetadata : BasePartWithMetdata - { - - } - - [TestMethod] - public void CreatePartDefinition_InheritedPartMetadata_ShouldNotContainPartMetadataFromBase() - { - var definition = CreateDefinition(typeof(DerivedPartWithMetadata)); - - Assert.IsFalse(definition.Metadata.ContainsKey("BaseOnlyName"), "Should not inherit part metadata from base."); - Assert.AreEqual(3, definition.Metadata["DerivedOnlyName"]); - Assert.AreEqual(4, definition.Metadata["OverrideName"]); - } - - [TestMethod] - public void CreatePartDefinition_NoMarkedOrDefaultConstructorAsPartTypeArgument_ShouldSetConstructorToNull() - { - var definition = CreateDefinition(typeof(ClassWithNoMarkedOrDefaultConstructor)); - - Assert.IsNull(definition.GetConstructor()); - } - - [TestMethod] - public void CreatePartDefinition_MultipleMarkedConstructorsAsPartTypeArgument_ShouldSetConstructors() - { - var definition = CreateDefinition(typeof(ClassWithMultipleMarkedConstructors)); - - Assert.IsNull(definition.GetConstructor()); - } - - [TestMethod] - public void CreatePartDefinition_OneMarkedConstructorsAsPartTypeArgument_ShouldSetConstructorToMarked() - { - var definition = CreateDefinition(typeof(SimpleConstructorInjectedObject)); - - ConstructorInfo constructor = definition.GetConstructor(); - Assert.IsNotNull(constructor); - Assert.AreEqual(typeof(SimpleConstructorInjectedObject).GetConstructors()[0], constructor); - Assert.AreEqual(constructor.GetParameters().Length, definition.ImportDefinitions.OfType().Count()); - } - - [TestMethod] - public void CreatePartDefinition_OneDefaultConstructorAsPartTypeArgument_ShouldSetConstructorToDefault() - { - var definition = CreateDefinition(typeof(PublicComponentWithPublicExports)); - - ConstructorInfo constructor = definition.GetConstructor(); - Assert.IsNotNull(constructor); - - EnumerableAssert.IsEmpty(constructor.GetParameters()); - EnumerableAssert.IsEmpty(definition.ImportDefinitions.OfType()); - } - - [TestMethod] - public void CreatePartDefinition_OneMarkedAndOneDefaultConstructorsAsPartTypeArgument_ShouldSetConstructorToMarked() - { - var definition = CreateDefinition(typeof(ClassWithOneMarkedAndOneDefaultConstructor)); - var marked = typeof(ClassWithOneMarkedAndOneDefaultConstructor).GetConstructors()[0]; - Assert.IsTrue(marked.IsDefined(typeof(ImportingConstructorAttribute), false)); - - ConstructorInfo constructor = definition.GetConstructor(); - Assert.IsNotNull(constructor); - - Assert.AreEqual(marked, constructor); - Assert.AreEqual(marked.GetParameters().Length, definition.ImportDefinitions.OfType().Count()); - } - - [TestMethod] - public void CreatePartDefinition_NoConstructorBecauseStatic_ShouldHaveNullConstructor() - { - var definition = CreateDefinition(typeof(StaticExportClass)); - - ConstructorInfo constructor = definition.GetConstructor(); - Assert.IsNull(constructor); - - EnumerableAssert.IsEmpty(definition.ImportDefinitions.OfType()); - } - - [TestMethod] - public void CreatePartDefinition_TwoZeroParameterConstructors_ShouldPickNonStaticOne() - { - var definition = CreateDefinition(typeof(ClassWithTwoZeroParameterConstructors)); - - ConstructorInfo constructor = definition.GetConstructor(); - Assert.IsNotNull(constructor); - Assert.IsFalse(constructor.IsStatic); - - EnumerableAssert.IsEmpty(definition.ImportDefinitions.OfType()); - } - - [TestMethod] - public void IsDiscoverable() - { - var expectations = new ExpectationCollection(); - expectations.Add(typeof(ClassWithTwoZeroParameterConstructors), true); - expectations.Add(typeof(SimpleConstructorInjectedObject), true); - expectations.Add(typeof(StaticExportClass), true); - expectations.Add(typeof(PublicComponentWithPublicExports), true); - expectations.Add(typeof(ClassWithMultipleMarkedConstructors), true); - expectations.Add(typeof(ClassWithNoMarkedOrDefaultConstructor), true); - expectations.Add(typeof(ClassWhichOnlyHasDefaultConstructor), false); - expectations.Add(typeof(ClassWithOnlyHasImportingConstructorButInherits), true); - expectations.Add(typeof(ClassWithOnlyHasMultipleImportingConstructorButInherits), true); - - foreach (var e in expectations) - { - var definition = AttributedModelDiscovery.CreatePartDefinitionIfDiscoverable(e.Input, (ICompositionElement)null); - - bool result = (definition != null); - - Assert.AreEqual(e.Output, result); - } - } - - [TestMethod] - public void CreatePartDefinition_EnsureIsDiscoverable() - { - var expectations = new ExpectationCollection(); - expectations.Add(typeof(ClassWithTwoZeroParameterConstructors), true); - expectations.Add(typeof(SimpleConstructorInjectedObject), true); - expectations.Add(typeof(StaticExportClass), true); - expectations.Add(typeof(PublicComponentWithPublicExports), true); - expectations.Add(typeof(ClassWithMultipleMarkedConstructors), true); - expectations.Add(typeof(ClassWithNoMarkedOrDefaultConstructor), true); - expectations.Add(typeof(ClassWhichOnlyHasDefaultConstructor), false); - expectations.Add(typeof(ClassWithOnlyHasImportingConstructorButInherits), true); - expectations.Add(typeof(ClassWithOnlyHasMultipleImportingConstructorButInherits), true); - - foreach (var e in expectations) - { - var definition = AttributedModelServices.CreatePartDefinition(e.Input, null, true); - - bool result = (definition != null); - - Assert.AreEqual(e.Output, result); - } - } - - [TestMethod] - public void CreatePartDefinition_NotEnsureIsDiscoverable() - { - var expectations = new ExpectationCollection(); - expectations.Add(typeof(ClassWithTwoZeroParameterConstructors), true); - expectations.Add(typeof(SimpleConstructorInjectedObject), true); - expectations.Add(typeof(StaticExportClass), true); - expectations.Add(typeof(PublicComponentWithPublicExports), true); - expectations.Add(typeof(ClassWithMultipleMarkedConstructors), true); - expectations.Add(typeof(ClassWithNoMarkedOrDefaultConstructor), true); - expectations.Add(typeof(ClassWhichOnlyHasDefaultConstructor), false); - expectations.Add(typeof(ClassWithOnlyHasImportingConstructorButInherits), true); - expectations.Add(typeof(ClassWithOnlyHasMultipleImportingConstructorButInherits), true); - - foreach (var e in expectations) - { - var definition = AttributedModelServices.CreatePartDefinition(e.Input, null, false); - Assert.IsNotNull(definition); - } - } - - [TestMethod] - public void CreatePart_ObjectInstance_ShouldProduceSharedPart() - { - var part = AttributedModelServices.CreatePart(typeof(MyExport)); - - Assert.AreEqual(CreationPolicy.Shared, part.Metadata.GetValue(CompositionConstants.PartCreationPolicyMetadataName)); - } - - - private ReflectionComposablePartDefinition CreateDefinition(Type type) - { - var definition = AttributedModelDiscovery.CreatePartDefinition(type, null, false, ElementFactory.Create()); - - Assert.AreEqual(type, definition.GetPartType()); - - return definition; - } - - [InheritedExport] - [InheritedExport] - [InheritedExport] - [Export] - [InheritedExport] - [InheritedExport] - [InheritedExport] - public class DuplicateMixedExporter1 - { - } - - [TestMethod] - [WorkItem(710352)] - public void MixedDuplicateExports_ShouldOnlyCollapseInheritedExport() - { - var def = AttributedModelServices.CreatePartDefinition(typeof(DuplicateMixedExporter1), null); - Assert.AreEqual(2, def.ExportDefinitions.Count(), "Should have 1 from the Export and only 1 collapsed InhertedExport"); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/INotifyImportTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/INotifyImportTests.cs deleted file mode 100644 index 4e08d0fece3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModel/INotifyImportTests.cs +++ /dev/null @@ -1,608 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.AttributedModel -{ - [TestClass()] - public class INotifyImportTests - { - [Export(typeof(PartWithoutImports))] - public class PartWithoutImports : IPartImportsSatisfiedNotification - { - public bool ImportsSatisfiedInvoked { get; private set; } - public void OnImportsSatisfied() - { - this.ImportsSatisfiedInvoked = true; - } - } - - [TestMethod] - public void ImportsSatisfiedOnComponentWithoutImports() - { - CompositionContainer container = ContainerFactory.CreateWithAttributedCatalog(typeof(PartWithoutImports)); - - PartWithoutImports partWithoutImports = container.GetExportedValue(); - Assert.IsNotNull(partWithoutImports); - - Assert.IsTrue(partWithoutImports.ImportsSatisfiedInvoked); - - } - - [TestMethod()] - public void ImportCompletedTest() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - var entrypoint = new UpperCaseStringComponent(); - - batch.AddParts(new LowerCaseString("abc"), entrypoint); - container.Compose(batch); - - batch = new CompositionBatch(); - batch.AddParts(new object()); - container.Compose(batch); - - Assert.AreEqual(entrypoint.LowerCaseStrings.Count, 1); - Assert.AreEqual(entrypoint.ImportCompletedCallCount, 1); - Assert.AreEqual(entrypoint.UpperCaseStrings.Count, 1); - Assert.AreEqual(entrypoint.LowerCaseStrings[0].Value.String, "abc"); - Assert.AreEqual(entrypoint.UpperCaseStrings[0], "ABC"); - } - - [TestMethod] - public void ImportCompletedWithRecomposing() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - var entrypoint = new UpperCaseStringComponent(); - - batch.AddParts(new LowerCaseString("abc"), entrypoint); - container.Compose(batch); - - Assert.AreEqual(entrypoint.LowerCaseStrings.Count, 1); - Assert.AreEqual(entrypoint.ImportCompletedCallCount, 1); - Assert.AreEqual(entrypoint.UpperCaseStrings.Count, 1); - Assert.AreEqual(entrypoint.LowerCaseStrings[0].Value.String, "abc"); - Assert.AreEqual(entrypoint.UpperCaseStrings[0], "ABC"); - - // Add another component to verify recomposing - batch = new CompositionBatch(); - batch.AddParts(new LowerCaseString("def")); - container.Compose(batch); - - Assert.AreEqual(entrypoint.LowerCaseStrings.Count, 2); - Assert.AreEqual(entrypoint.ImportCompletedCallCount, 2); - Assert.AreEqual(entrypoint.UpperCaseStrings.Count, 2); - Assert.AreEqual(entrypoint.LowerCaseStrings[1].Value.String, "def"); - Assert.AreEqual(entrypoint.UpperCaseStrings[1], "DEF"); - - // Verify that adding a random component doesn't cause - // the OnImportsSatisfied to be called again. - batch = new CompositionBatch(); - batch.AddParts(new object()); - container.Compose(batch); - - Assert.AreEqual(entrypoint.LowerCaseStrings.Count, 2); - Assert.AreEqual(entrypoint.ImportCompletedCallCount, 2); - Assert.AreEqual(entrypoint.UpperCaseStrings.Count, 2); - } - - [TestMethod] - [Ignore] - [WorkItem(700940)] - public void ImportCompletedUsingSatisfyImportsOnce() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - var entrypoint = new UpperCaseStringComponent(); - var entrypointPart = AttributedModelServices.CreatePart(entrypoint); - - batch.AddParts(new LowerCaseString("abc")); - container.Compose(batch); - container.SatisfyImportsOnce(entrypointPart); - - Assert.AreEqual(1, entrypoint.LowerCaseStrings.Count); - Assert.AreEqual(1, entrypoint.ImportCompletedCallCount); - Assert.AreEqual(1, entrypoint.UpperCaseStrings.Count); - Assert.AreEqual("abc", entrypoint.LowerCaseStrings[0].Value.String); - Assert.AreEqual("ABC", entrypoint.UpperCaseStrings[0]); - - batch = new CompositionBatch(); - batch.AddParts(new object()); - container.Compose(batch); - container.SatisfyImportsOnce(entrypointPart); - - Assert.AreEqual(1, entrypoint.LowerCaseStrings.Count); - Assert.AreEqual(1, entrypoint.ImportCompletedCallCount); - Assert.AreEqual(1, entrypoint.UpperCaseStrings.Count); - Assert.AreEqual("abc", entrypoint.LowerCaseStrings[0].Value.String); - Assert.AreEqual("ABC", entrypoint.UpperCaseStrings[0]); - - batch.AddParts(new LowerCaseString("def")); - container.Compose(batch); - container.SatisfyImportsOnce(entrypointPart); - - Assert.AreEqual(2, entrypoint.LowerCaseStrings.Count); - Assert.AreEqual(2, entrypoint.ImportCompletedCallCount); - Assert.AreEqual(2, entrypoint.UpperCaseStrings.Count); - Assert.AreEqual("abc", entrypoint.LowerCaseStrings[0].Value.String); - Assert.AreEqual("ABC", entrypoint.UpperCaseStrings[0]); - Assert.AreEqual("def", entrypoint.LowerCaseStrings[1].Value.String); - Assert.AreEqual("DEF", entrypoint.UpperCaseStrings[1]); - } - - [TestMethod] - [Ignore] - [WorkItem(654513)] - public void ImportCompletedCalledAfterAllImportsAreFullyComposed() - { - int importSatisfationCount = 0; - var importer1 = new MyEventDrivenFullComposedNotifyImporter1(); - var importer2 = new MyEventDrivenFullComposedNotifyImporter2(); - - Action verificationAction = (object sender, EventArgs e) => - { - Assert.IsTrue(importer1.AreAllImportsFullyComposed); - Assert.IsTrue(importer2.AreAllImportsFullyComposed); - ++importSatisfationCount; - }; - - importer1.ImportsSatisfied += new EventHandler(verificationAction); - importer2.ImportsSatisfied += new EventHandler(verificationAction); - - // importer1 added first - var batch = new CompositionBatch(); - batch.AddParts(importer1, importer2); - - var container = ContainerFactory.Create(); - container.ComposeExportedValue(container); - container.Compose(batch); - Assert.AreEqual(2, importSatisfationCount); - - // importer2 added first - importSatisfationCount = 0; - batch = new CompositionBatch(); - batch.AddParts(importer2, importer1); - - container = ContainerFactory.Create(); - container.ComposeExportedValue(container); - container.Compose(batch); - Assert.AreEqual(2, importSatisfationCount); - } - - [TestMethod] - public void ImportCompletedAddPartAndBindComponent() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(new CallbackImportNotify(delegate - { - batch = new CompositionBatch(); - batch.AddPart(new object()); - container.Compose(batch); - })); - - container.Compose(batch); - } - - [TestMethod] - public void ImportCompletedChildNeedsParentContainer() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var parent = new CompositionContainer(cat); - - CompositionBatch parentBatch = new CompositionBatch(); - CompositionBatch childBatch = new CompositionBatch(); - CompositionBatch child2Batch = new CompositionBatch(); - - parentBatch.AddExportedValue(parent); - parent.Compose(parentBatch); - var child = new CompositionContainer(parent); - var child2 = new CompositionContainer(parent); - - var parentImporter = new MyNotifyImportImporter(parent); - var childImporter = new MyNotifyImportImporter(child); - var child2Importer = new MyNotifyImportImporter(child2); - - parentBatch = new CompositionBatch(); - parentBatch.AddPart(parentImporter); - childBatch.AddPart(childImporter); - child2Batch.AddPart(child2Importer); - - parent.Compose(parentBatch); - child.Compose(childBatch); - child2.Compose(child2Batch); - - - Assert.AreEqual(1, parentImporter.ImportCompletedCallCount); - Assert.AreEqual(1, childImporter.ImportCompletedCallCount); - Assert.AreEqual(1, child2Importer.ImportCompletedCallCount); - - MyNotifyImportExporter parentExporter = parent.GetExportedValue("MyNotifyImportExporter"); - Assert.AreEqual(1, parentExporter.ImportCompletedCallCount); - - MyNotifyImportExporter childExporter = child.GetExportedValue("MyNotifyImportExporter"); - Assert.AreEqual(1, childExporter.ImportCompletedCallCount); - - MyNotifyImportExporter child2Exporter = child2.GetExportedValue("MyNotifyImportExporter"); - Assert.AreEqual(1, child2Exporter.ImportCompletedCallCount); - } - - [TestMethod] - public void ImportCompletedChildDoesnotNeedParentContainer() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var parent = new CompositionContainer(cat); - - CompositionBatch parentBatch = new CompositionBatch(); - CompositionBatch childBatch = new CompositionBatch(); - - parentBatch.AddExportedValue(parent); - parent.Compose(parentBatch); - - var child = new CompositionContainer(parent); - - var parentImporter = new MyNotifyImportImporter(parent); - var childImporter = new MyNotifyImportImporter(child); - - parentBatch = new CompositionBatch(); - parentBatch.AddPart(parentImporter); - - childBatch.AddParts(childImporter, new MyNotifyImportExporter()); - - child.Compose(childBatch); - - Assert.AreEqual(0, parentImporter.ImportCompletedCallCount); - Assert.AreEqual(1, childImporter.ImportCompletedCallCount); - - // Parent will become bound at this point. - MyNotifyImportExporter parentExporter = parent.GetExportedValue("MyNotifyImportExporter"); - parent.Compose(parentBatch); - Assert.AreEqual(1, parentImporter.ImportCompletedCallCount); - Assert.AreEqual(1, parentExporter.ImportCompletedCallCount); - - MyNotifyImportExporter childExporter = child.GetExportedValue("MyNotifyImportExporter"); - Assert.AreEqual(1, childExporter.ImportCompletedCallCount); - } - - [TestMethod] - public void ImportCompletedBindChildIndirectlyThroughParentContainerBind() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var parent = new CompositionContainer(cat); - - CompositionBatch parentBatch = new CompositionBatch(); - CompositionBatch childBatch = new CompositionBatch(); - - parentBatch.AddExportedValue(parent); - parent.Compose(parentBatch); - var child = new CompositionContainer(parent); - - var parentImporter = new MyNotifyImportImporter(parent); - var childImporter = new MyNotifyImportImporter(child); - - parentBatch = new CompositionBatch(); - parentBatch.AddPart(parentImporter); - childBatch.AddParts(childImporter, new MyNotifyImportExporter()); - - parent.Compose(parentBatch); - child.Compose(childBatch); - - Assert.AreEqual(1, parentImporter.ImportCompletedCallCount); - Assert.AreEqual(1, childImporter.ImportCompletedCallCount); - - MyNotifyImportExporter parentExporter = parent.GetExportedValue("MyNotifyImportExporter"); - Assert.AreEqual(1, parentExporter.ImportCompletedCallCount); - - MyNotifyImportExporter childExporter = child.GetExportedValue("MyNotifyImportExporter"); - Assert.AreEqual(1, childExporter.ImportCompletedCallCount); - } - - [TestMethod] - public void ImportCompletedGetExportedValueLazy() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - CompositionContainer container = new CompositionContainer(cat); - - NotifyImportExportee.InstanceCount = 0; - NotifyImportExportsLazy notifyee = container.GetExportedValue("NotifyImportExportsLazy"); - Assert.IsNotNull(notifyee, "Expecting bound type"); - Assert.IsNotNull(notifyee.Imports, "Expecting Imports to be populated"); - Assert.IsTrue(notifyee.NeedRefresh, "Expecting import to put class in pending state"); - Assert.AreEqual(3, notifyee.Imports.Count, "Expecting 3 Exports before filtering"); - Assert.AreEqual(0, NotifyImportExportee.InstanceCount, "Not instance expected before pull"); - Assert.AreEqual(0, notifyee.realImports.Count, "Expecting collection to be empty before pull"); - Assert.AreEqual(2, notifyee.RealImports.Count, "Expecting 2 real values after pull"); - Assert.AreEqual(1, notifyee.RealImports[0].Id, "Expecting distinct activated instance"); - Assert.AreEqual(3, notifyee.RealImports[1].Id, "Expecting distinct activated instance"); - Assert.AreEqual(2, NotifyImportExportee.InstanceCount, "2 instances expected after pull"); - } - - [TestMethod] - public void ImportCompletedGetExportedValueEager() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - CompositionContainer container = new CompositionContainer(cat); - - NotifyImportExportee.InstanceCount = 0; - var notifyee = container.GetExportedValue("NotifyImportExportsEager"); - Assert.IsNotNull(notifyee, "Expecting bound type"); - Assert.IsNotNull(notifyee.Imports, "Expecting Imports to be populated"); - Assert.AreEqual(3, notifyee.Imports.Count, "Expecting 3 Exports before filtering"); - Assert.AreEqual(2, NotifyImportExportee.InstanceCount, "Expecting concrete instances already pulled"); - Assert.AreEqual(2, notifyee.realImports.Count, "Expecting collection to be populated"); - Assert.AreEqual(2, notifyee.RealImports.Count, "Expecting 2 real values after import"); - Assert.AreEqual(1, notifyee.RealImports[0].Id, "Expecting distinct activated instance"); - Assert.AreEqual(3, notifyee.RealImports[1].Id, "Expecting distinct activated instance"); - Assert.AreEqual(2, NotifyImportExportee.InstanceCount, "Expecting no more instances after read"); - } - } - - public class NotifyImportExportee - { - public NotifyImportExportee(int id) - { - Id = id; - InstanceCount++; - } - - public int Id { get; set; } - - public static int InstanceCount { get; set; } - } - - public class NotifyImportExporter - { - - public NotifyImportExporter() - { - } - - [Export()] - [ExportMetadata("Filter", false)] - public NotifyImportExportee Export1 - { - get - { - return new NotifyImportExportee(1); - } - } - - [Export()] - [ExportMetadata("Filter", true)] - public NotifyImportExportee Export2 - { - get - { - return new NotifyImportExportee(2); - } - } - - [Export()] - [ExportMetadata("Filter", false)] - public NotifyImportExportee Export3 - { - get - { - return new NotifyImportExportee(3); - } - } - - } - - [Export("NotifyImportExportsLazy")] - public class NotifyImportExportsLazy : IPartImportsSatisfiedNotification - { - public NotifyImportExportsLazy() - { - NeedRefresh = false; - } - - [ImportMany(typeof(NotifyImportExportee))] - public Collection>> Imports { get; set; } - - public bool NeedRefresh { get; set; } - - public void OnImportsSatisfied() - { - NeedRefresh = true; - } - - internal Collection realImports = new Collection(); - - public Collection RealImports - { - get - { - if (NeedRefresh) - { - realImports.Clear(); - foreach (var import in Imports) - { - if (!((bool)import.Metadata["Filter"])) - { - realImports.Add(import.Value); - } - } - NeedRefresh = false; - } - return realImports; - } - } - } - - [Export("NotifyImportExportsEager")] - public class NotifyImportExportsEager : IPartImportsSatisfiedNotification - { - public NotifyImportExportsEager() - { - } - - [ImportMany] - public Collection>> Imports { get; set; } - - public void OnImportsSatisfied() - { - realImports.Clear(); - foreach (var import in Imports) - { - if (!((bool)import.Metadata["Filter"])) - { - realImports.Add(import.Value); - } - } - } - - internal Collection realImports = new Collection(); - - public Collection RealImports - { - get - { - return realImports; - } - } - } - - public class MyEventDrivenNotifyImporter : IPartImportsSatisfiedNotification - { - [Import] - public ICompositionService ImportSomethingSoIGetImportCompletedCalled { get; set; } - - public event EventHandler ImportsSatisfied; - - public void OnImportsSatisfied() - { - if (this.ImportsSatisfied != null) - { - this.ImportsSatisfied(this, new EventArgs()); - } - } - } - - [Export] - public class MyEventDrivenFullComposedNotifyImporter1 : MyEventDrivenNotifyImporter - { - [Import] - public MyEventDrivenFullComposedNotifyImporter2 FullyComposedImport { get; set; } - - public bool AreAllImportsSet - { - get - { - return (this.ImportSomethingSoIGetImportCompletedCalled != null) - && (this.FullyComposedImport != null); - } - } - - public bool AreAllImportsFullyComposed - { - get - { - return this.AreAllImportsSet && this.FullyComposedImport.AreAllImportsSet; - } - } - } - - [Export] - public class MyEventDrivenFullComposedNotifyImporter2 : MyEventDrivenNotifyImporter - { - [Import] - public MyEventDrivenFullComposedNotifyImporter1 FullyComposedImport { get; set; } - - public bool AreAllImportsSet - { - get - { - return (this.ImportSomethingSoIGetImportCompletedCalled != null) - && (this.FullyComposedImport != null); - } - } - - public bool AreAllImportsFullyComposed - { - get - { - return this.AreAllImportsSet && this.FullyComposedImport.AreAllImportsSet; - } - } - } - - [Export("MyNotifyImportExporter")] - public class MyNotifyImportExporter : IPartImportsSatisfiedNotification - { - [Import] - public ICompositionService ImportSomethingSoIGetImportCompletedCalled { get; set; } - - public int ImportCompletedCallCount { get; set; } - public void OnImportsSatisfied() - { - ImportCompletedCallCount++; - } - } - - public class MyNotifyImportImporter : IPartImportsSatisfiedNotification - { - private CompositionContainer container; - public MyNotifyImportImporter(CompositionContainer container) - { - this.container = container; - } - [Import("MyNotifyImportExporter")] - public MyNotifyImportExporter MyNotifyImportExporter { get; set; } - - public int ImportCompletedCallCount { get; set; } - public void OnImportsSatisfied() - { - ImportCompletedCallCount++; - } - } - - [Export("LowerCaseString")] - public class LowerCaseString - { - public string String { get; private set; } - public LowerCaseString(string s) - { - String = s.ToLower(); - } - } - - public class UpperCaseStringComponent : IPartImportsSatisfiedNotification - { - public UpperCaseStringComponent() - { - UpperCaseStrings = new List(); - } - Collection> lowerCaseString = new Collection>(); - - [ImportMany("LowerCaseString", AllowRecomposition = true)] - public Collection> LowerCaseStrings { - get { return lowerCaseString; } - set { lowerCaseString = value; } - } - - public List UpperCaseStrings { get; set; } - - public int ImportCompletedCallCount { get; set; } - - // This method gets called whenever a bind is completed and any of - // of the imports have changed, but ar safe to use now. - public void OnImportsSatisfied() - { - UpperCaseStrings.Clear(); - foreach (var i in LowerCaseStrings) - UpperCaseStrings.Add(i.Value.String.ToUpper()); - - ImportCompletedCallCount++; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModelServicesTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModelServicesTests.cs deleted file mode 100644 index c7b7af5ca6a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/AttributedModelServicesTests.cs +++ /dev/null @@ -1,161 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Diagnostics; -using System.ComponentModel.Composition.Factories; -using System.Diagnostics; -using System.Linq; -using System.UnitTesting; - -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.ComponentModel.Composition.Extensibility; - -namespace System.ComponentModel.Composition.AttributedModel -{ - [TestClass] - public class AttributedModelServicesTests - { - [TestMethod] - public void CreatePartDefinition1_NullAsType_ShouldThrowArgumentNull() - { - var origin = ElementFactory.Create(); - - ExceptionAssert.ThrowsArgumentNull("type", () => - { - AttributedModelServices.CreatePartDefinition((Type)null, origin); - }); - } - - [TestMethod] - public void CreatePartDefinition2_NullAsType_ShouldThrowArgumentNull() - { - var origin = ElementFactory.Create(); - - ExceptionAssert.ThrowsArgumentNull("type", () => - { - AttributedModelServices.CreatePartDefinition((Type)null, origin, false); - }); - } - -#if !SILVERLIGHT - - [TestMethod] - public void CreatePartDefinition2_TypeMarkedWithPartNotDiscoverableAttribute_ShouldTraceInformation() - { - var types = GetTypesMarkedWithPartNotDiscoverableAttribute(); - - foreach (Type type in types) - { - using (TraceContext context = new TraceContext(SourceLevels.Information)) - { - AttributedModelServices.CreatePartDefinition(type, null, true); - - Assert.IsNotNull(context.LastTraceEvent); - Assert.AreEqual(context.LastTraceEvent.EventType, TraceEventType.Information); - Assert.AreEqual(context.LastTraceEvent.Id, TraceId.Discovery_DefinitionMarkedWithPartNotDiscoverableAttribute); - } - } - } - - [TestMethod] - public void CreatePartDefinition2_OpenGenericType_ShouldTraceInformation() - { - var types = GetOpenGenericTypes(); - - foreach (Type type in types) - { - using (TraceContext context = new TraceContext(SourceLevels.Information)) - { - AttributedModelServices.CreatePartDefinition(type, null, true); - - Assert.IsNotNull(context.LastTraceEvent); - Assert.AreEqual(context.LastTraceEvent.EventType, TraceEventType.Information); - Assert.AreEqual(context.LastTraceEvent.Id, TraceId.Discovery_DefinitionContainsGenericParameters); - } - } - } - - [TestMethod] - public void CreatePartDefinition2_TypeWithNoExports_ShouldTraceInformation() - { - var types = GetTypesWithNoExports(); - - foreach (Type type in types) - { - using (TraceContext context = new TraceContext(SourceLevels.Information)) - { - var result = AttributedModelServices.CreatePartDefinition(type, null, true); - - Assert.IsNotNull(context.LastTraceEvent); - Assert.AreEqual(context.LastTraceEvent.EventType, TraceEventType.Information); - Assert.AreEqual(context.LastTraceEvent.Id, TraceId.Discovery_DefinitionContainsNoExports); - } - } - } - - private static IEnumerable GetTypesMarkedWithPartNotDiscoverableAttribute() - { - yield return typeof(ClassMarkedWithPartNotDiscoverableAttribute); - yield return typeof(ClassMarkedWithPartNotDiscoverableAttribute<>); - } - - private static IEnumerable GetOpenGenericTypes() - { - yield return typeof(OpenGenericType<>); - } - - private static IEnumerable GetTypesWithNoExports() - { - yield return typeof(ClassWithNoExports); - yield return typeof(ClassWithOnlyFieldImport); - yield return typeof(ClassWithOnlyPropertyImport); - yield return typeof(ClassWithOnlyParameterImport); - } - - public class ClassWithNoExports - { - } - - public class ClassWithOnlyFieldImport - { - [Import] - public string Field; - } - - public class ClassWithOnlyPropertyImport - { - [Import] - public string Property - { - get; - set; - } - } - - public class ClassWithOnlyParameterImport - { - [ImportingConstructor] - public ClassWithOnlyParameterImport(string parameter) - { - } - } - - public class OpenGenericType - { - } - - [PartNotDiscoverable] - public class ClassMarkedWithPartNotDiscoverableAttribute - { - } - - [PartNotDiscoverable] - public class ClassMarkedWithPartNotDiscoverableAttribute - { - } -#endif - - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CardinalityMismatchExceptionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CardinalityMismatchExceptionTests.cs deleted file mode 100644 index 39a8a58aae5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CardinalityMismatchExceptionTests.cs +++ /dev/null @@ -1,169 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -#if !SILVERLIGHT -using System.Runtime.Serialization; -#endif - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CardinalityMismatchExceptionTests - { - [TestMethod] - public void Constructor1_ShouldSetMessagePropertyToDefault() - { - var exception = new ImportCardinalityMismatchException(); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor2_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new ImportCardinalityMismatchException((string)null); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor3_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new ImportCardinalityMismatchException((string)null, new Exception()); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor2_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new ImportCardinalityMismatchException(e); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor3_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new ImportCardinalityMismatchException(e, new Exception()); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor1_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ImportCardinalityMismatchException(); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor2_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ImportCardinalityMismatchException("Message"); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor3_NullAsInnerExceptionArgument_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ImportCardinalityMismatchException("Message", (Exception)null); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor3_ValueAsInnerExceptionArgument_ShouldSetInnerExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var exception = new ImportCardinalityMismatchException("Message", e); - - Assert.AreSame(e, exception.InnerException); - } - } - -#if !SILVERLIGHT - - [TestMethod] - public void Constructor4_NullAsInfoArgument_ShouldThrowArgumentNull() - { - var context = new StreamingContext(); - - ExceptionAssert.ThrowsArgument("info", () => - { - SerializationTestServices.Create((SerializationInfo)null, context); - }); - } - - [TestMethod] - public void InnerException_CanBeSerialized() - { - var expectations = Expectations.GetInnerExceptionsWithNull(); - - foreach (var e in expectations) - { - var exception = CreateCardinalityMismatchException(e); - - var result = SerializationTestServices.RoundTrip(exception); - - ExtendedAssert.IsInstanceOfSameType(exception.InnerException, result.InnerException); - } - } - - [TestMethod] - public void Message_CanBeSerialized() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = CreateCardinalityMismatchException(e); - - var result = SerializationTestServices.RoundTrip(exception); - - Assert.AreEqual(exception.Message, result.Message); - } - } - -#endif - - private static ImportCardinalityMismatchException CreateCardinalityMismatchException() - { - return CreateCardinalityMismatchException((string)null, (Exception)null); - } - - private static ImportCardinalityMismatchException CreateCardinalityMismatchException(string message) - { - return CreateCardinalityMismatchException(message, (Exception)null); - } - - private static ImportCardinalityMismatchException CreateCardinalityMismatchException(Exception innerException) - { - return CreateCardinalityMismatchException((string)null, innerException); - } - - private static ImportCardinalityMismatchException CreateCardinalityMismatchException(string message, Exception innerException) - { - return new ImportCardinalityMismatchException(message, innerException); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComponentModelTestTypes.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComponentModelTestTypes.cs deleted file mode 100644 index acef102c738..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComponentModelTestTypes.cs +++ /dev/null @@ -1,138 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition; - -namespace System.ComponentModel.Composition -{ - public class CallbackExecuteCodeDuringCompose - { - public CallbackExecuteCodeDuringCompose(Action callback) - { - this.callback = callback; - } - - [Export("MyOwnCallbackContract")] - public string ExportValue - { - get - { - callback(); - return string.Empty; - } - } - - [Import("MyOwnCallbackContract")] - public string ImportValue { get; set; } - private Action callback; - } - - public class CallbackImportNotify : IPartImportsSatisfiedNotification - { - private Action callback; - public CallbackImportNotify(Action callback) - { - this.callback = callback; - } - - [Import(AllowDefault=true)] - public ICompositionService ImportSomethingSoIGetImportCompletedCalled { get; set; } - - public void OnImportsSatisfied() - { - this.callback(); - } - } - - public class ExportValueTypeFactory - { - [Export("{AssemblyCatalogResolver}FactoryValueType")] - public int Value - { - get - { - return 18; - } - } - } - - - public class ExportValueTypeSingleton - { - [Export("{AssemblyCatalogResolver}SingletonValueType")] - public int Value - { - get - { - return 17; - } - } - } - - - public class Int32CollectionImporter - { - - public Int32CollectionImporter() - { - Values = new Collection(); - } - - [ImportMany("Value")] - public Collection Values { get; private set; } - } - - [PartNotDiscoverable] - public class Int32Exporter - { - - public Int32Exporter(int value) - { - Value = value; - } - - [Export("Value")] - public int Value { get; set; } - - } - - [PartNotDiscoverable] - public class Int32ExporterInternal - { - - public Int32ExporterInternal(int value) - { - Value = value; - } - - [Export("Value")] - public int Value { get; set; } - - } - - public class Int32Importer - { - - public Int32Importer() - { - } - - [Import("Value", AllowRecomposition = true)] - public int Value { get; set; } - } - - public class Int32ImporterInternal - { - - public Int32ImporterInternal() - { - } - - [Import("Value")] - public int Value { get; set; } - } - - -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComponentServicesTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComponentServicesTests.cs deleted file mode 100644 index 5017463ef3c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComponentServicesTests.cs +++ /dev/null @@ -1,128 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Linq; -using System.Linq.Expressions; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.UnitTesting; -using System.ComponentModel.Composition.Hosting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ComponentServicesTests - { - [TestMethod] - public void GetValuesByType() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - - var container = new CompositionContainer(cat); - - string itestName = AttributedModelServices.GetContractName(typeof(ITest)); - - var e1 = container.GetExportedValues(); - var e2 = container.GetExports(itestName); - - Assert.IsInstanceOfType(e1.First(), typeof(T1), "First should be T1"); - Assert.IsInstanceOfType(e1.Skip(1).First(), typeof(T2), "Second should be T2"); - - Assert.IsInstanceOfType(e2.First().Value, typeof(T1), "First should be T1"); - Assert.IsInstanceOfType(e2.Skip(1).First().Value, typeof(T2), "Second should be T2"); - - CompositionContainer childContainer = new CompositionContainer(container); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new T1()); - container.Compose(batch); - var t1 = childContainer.GetExportedValue(); - var t2 = childContainer.GetExport(itestName); - - Assert.IsInstanceOfType(t1, typeof(T1), "First (resolved) should be T1"); - Assert.IsInstanceOfType(t2.Value, typeof(T1), "First (resolved) should be T1"); - } - - [TestMethod] - public void GetValueTest() - { - var container = ContainerFactory.Create(); - ITest t = new T1(); - string name = AttributedModelServices.GetContractName(typeof(ITest)); - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue(name, t); - container.Compose(batch); - ITest value = container.GetExportedValue(); - Assert.AreEqual(t, value, "TryGetExportedValue should return t (by type)"); - value = container.GetExportedValue(name); - Assert.AreEqual(t, value, "TryGetExportedValue should return t (given name)"); - } - - [TestMethod] - public void GetValuesTest() - { - var container = ContainerFactory.Create(); - ITest t = new T1(); - string name = AttributedModelServices.GetContractName(typeof(ITest)); - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue(name, t); - container.Compose(batch); - IEnumerable values = container.GetExportedValues(); - Assert.AreEqual(t, values.First(), "TryGetExportedValues should return t (by type)"); - values = container.GetExportedValues(name); - Assert.AreEqual(t, values.First(), "TryGetExportedValues should return t (by name)"); - } - - - - [TestMethod] - public void NoResolverExceptionTest() - { - var container = ContainerFactory.Create(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new MultiExport()); - batch.AddPart(new SingleImport()); - - CompositionAssert.ThrowsChangeRejectedError(ErrorId.ImportEngine_PartCannotSetImport, ErrorId.ImportEngine_ImportCardinalityMismatch, RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - } - - public class MultiExport - { - [Export("Multi")] - [ExportMetadata("Value", "One")] - public int M1 { get { return 1; } } - - [Export("Multi")] - [ExportMetadata("Value", "Two")] - public int M2 { get { return 2; } } - - [Export("Multi")] - [ExportMetadata("Value", "Three")] - public int M3 { get { return 3; } } - } - - public interface ITest - { - void Do(); - } - - [Export(typeof(ITest))] - public class T1 : ITest - { - public void Do() { } - } - - [Export(typeof(ITest))] - public class T2 : ITest - { - public void Do() { } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartCatalogExtensions.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartCatalogExtensions.cs deleted file mode 100644 index 019f9e0ba5a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartCatalogExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.IO; -using System.Linq.Expressions; -using System.UnitTesting; -using System.Reflection; - -namespace System.ComponentModel.Composition -{ - internal static class ComposablePartCatalogExtensions - { - public static IEnumerable> GetExports(this ComposablePartCatalog catalog, Expression> constraint) - { - var import = ImportDefinitionFactory.Create(constraint); - return catalog.GetExports(import); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartDefinitionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartDefinitionTests.cs deleted file mode 100644 index cdf484ee5b1..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartDefinitionTests.cs +++ /dev/null @@ -1,44 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Linq; -using System.Reflection; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; -using System.ComponentModel.Composition.Factories; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ComposablePartDefinitionTests - { - [TestMethod] - public void Constructor1_ShouldNotThrow() - { - PartDefinitionFactory.Create(); - } - - [TestMethod] - public void Constructor1_ShouldSetMetadataPropertyToEmptyDictionary() - { - var definition = PartDefinitionFactory.Create(); - - EnumerableAssert.IsEmpty(definition.Metadata); - } - - [TestMethod] - public void Constructor1_ShouldSetMetadataPropertyToReadOnlyDictionary() - { - var definition = PartDefinitionFactory.Create(); - - ExceptionAssert.Throws(() => - { - definition.Metadata["Value"] = "Value"; - }); - } - } -} - diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartExceptionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartExceptionTests.cs deleted file mode 100644 index f56a866f973..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartExceptionTests.cs +++ /dev/null @@ -1,690 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.UnitTesting; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -#if !SILVERLIGHT -using System.Runtime.Serialization; -#endif - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionPartExceptionTests - { - [TestMethod] - public void Constructor1_ShouldSetMessagePropertyToDefault() - { - var exception = new ComposablePartException(); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor2_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new ComposablePartException((string)null); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor3_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new ComposablePartException((string)null, ElementFactory.Create()); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor4_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new ComposablePartException((string)null, new Exception()); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor5_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new ComposablePartException((string)null, ElementFactory.Create(), new Exception()); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor6_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, (string)null); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor7_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, (string)null, new Exception()); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor8_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, (string)null, ElementFactory.Create()); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor9_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, (string)null, ElementFactory.Create(), new Exception()); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor2_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(e); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor3_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(e, ElementFactory.Create()); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor4_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(e, new Exception()); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor5_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(e, ElementFactory.Create(), new Exception()); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor6_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, e); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor7_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, e, new Exception()); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor8_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, e, ElementFactory.Create()); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor9_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, e, ElementFactory.Create(), new Exception()); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor1_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ComposablePartException(); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor2_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ComposablePartException("Message"); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor3_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ComposablePartException("Message", ElementFactory.Create()); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor4_NullAsInnerExceptionArgument_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ComposablePartException("Message", (Exception)null); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor5_NullAsInnerExceptionArgument_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ComposablePartException("Message", ElementFactory.Create(), (Exception)null); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor6_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message"); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor7_NullAsInnerExceptionArgument_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", (Exception)null); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor8_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", ElementFactory.Create()); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor9_NullAsInnerExceptionArgument_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", ElementFactory.Create(), (Exception)null); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor4_ValueAsInnerExceptionArgument_ShouldSetInnerExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException("Message", e); - - Assert.AreSame(e, exception.InnerException); - } - } - - [TestMethod] - public void Constructor5_ValueAsInnerExceptionArgument_ShouldSetInnerExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException("Message", ElementFactory.Create(), e); - - Assert.AreSame(e, exception.InnerException); - } - } - - [TestMethod] - public void Constructor7_ValueAsInnerExceptionArgument_ShouldSetInnerExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", e); - - Assert.AreSame(e, exception.InnerException); - } - } - - [TestMethod] - public void Constructor9_ValueAsInnerExceptionArgument_ShouldSetInnerExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", ElementFactory.Create(), e); - - Assert.AreSame(e, exception.InnerException); - } - } - - [TestMethod] - public void Constructor1_ShouldSetICompositionErrorIdPropertyToCompositionErrorIdUnknown() - { - var exception = (ICompositionError)new ComposablePartException(); - - Assert.AreEqual(CompositionErrorId.Unknown, exception.Id); - } - - [TestMethod] - public void Constructor2_ShouldSetICompositionErrorIdPropertyToCompositionErrorIdUnknown() - { - var exception = (ICompositionError)new ComposablePartException("Message"); - - Assert.AreEqual(CompositionErrorId.Unknown, exception.Id); - } - - [TestMethod] - public void Constructor3_ShouldSetICompositionErrorIdPropertyToCompositionErrorIdUnknown() - { - var exception = (ICompositionError)new ComposablePartException("Message", ElementFactory.Create()); - - Assert.AreEqual(CompositionErrorId.Unknown, exception.Id); - } - - [TestMethod] - public void Constructor4_ShouldSetICompositionErrorIdPropertyToCompositionErrorIdUnknown() - { - var exception = (ICompositionError)new ComposablePartException("Message", new Exception()); - - Assert.AreEqual(CompositionErrorId.Unknown, exception.Id); - } - - [TestMethod] - public void Constructor5_ShouldSetICompositionErrorIdPropertyToCompositionErrorIdUnknown() - { - var exception = (ICompositionError)new ComposablePartException("Message", ElementFactory.Create(), new Exception()); - - Assert.AreEqual(CompositionErrorId.Unknown, exception.Id); - } - - [TestMethod] - public void Constructor6_ValueAsIdArgument_ShouldSetICompositionErrorIdProperty() - { - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var exception = (ICompositionError)new ComposablePartException(e, "Message"); - - Assert.AreEqual(e, exception.Id); - } - } - - [TestMethod] - public void Constructor7_ValueAsIdArgument_ShouldSetICompositionErrorIdProperty() - { - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var exception = (ICompositionError)new ComposablePartException(e, "Message", new Exception()); - - Assert.AreEqual(e, exception.Id); - } - } - - [TestMethod] - public void Constructor8_ValueAsIdArgument_ShouldSetICompositionErrorIdProperty() - { - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var exception = (ICompositionError)new ComposablePartException(e, "Message", ElementFactory.Create()); - - Assert.AreEqual(e, exception.Id); - } - } - - [TestMethod] - public void Constructor9_ValueAsIdArgument_ShouldSetICompositionErrorIdProperty() - { - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var exception = (ICompositionError)new ComposablePartException(e, "Message", ElementFactory.Create(), new Exception()); - - Assert.AreEqual(e, exception.Id); - } - } - - [TestMethod] - public void Constructor1_ShouldSetElementPropertyToNull() - { - var exception = new ComposablePartException(); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor2_ShouldSetElementPropertyToNull() - { - var exception = new ComposablePartException("Message"); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor3_NullAsElementArgument_ShouldSetElementPropertyToNull() - { - var exception = new ComposablePartException("Message", (ICompositionElement)null); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor4_ShouldSetElementPropertyToNull() - { - var exception = new ComposablePartException("Message", new Exception()); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor5_NullAsElementArgument_ShouldSetElementPropertyToNull() - { - var exception = new ComposablePartException("Message", (ICompositionElement)null, new Exception()); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor6_ShouldSetElementPropertyToNull() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message"); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor7_ShouldSetElementPropertyToNull() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", new Exception()); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor8_NullAsElementArgument_ShouldSetElementPropertyToNull() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", (ICompositionElement)null); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor9_NullAsElementArgument_ShouldSetElementPropertyToNull() - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", (ICompositionElement)null, new Exception()); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor3_ValueAsElementArgument_ShouldSetElementProperty() - { - var expectations = Expectations.GetCompositionElements(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException("Message", (ICompositionElement)e); - - Assert.AreSame(e, exception.Element); - } - } - - [TestMethod] - public void Constructor5_ValueAsElementArgument_ShouldSetElementProperty() - { - var expectations = Expectations.GetCompositionElements(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException("Message", (ICompositionElement)e, new Exception()); - - Assert.AreSame(e, exception.Element); - } - } - - [TestMethod] - public void Constructor8_ValueAsElementArgument_ShouldSetElementProperty() - { - var expectations = Expectations.GetCompositionElements(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", (ICompositionElement)e); - - Assert.AreSame(e, exception.Element); - } - } - - [TestMethod] - public void Constructor9_ValueAsElementArgument_ShouldSetElementProperty() - { - var expectations = Expectations.GetCompositionElements(); - - foreach (var e in expectations) - { - var exception = new ComposablePartException(CompositionErrorId.Unknown, "Message", (ICompositionElement)e, new Exception()); - - Assert.AreSame(e, exception.Element); - } - } - -#if !SILVERLIGHT - - [TestMethod] - public void Constructor10_NullAsInfoArgument_ShouldThrowArgumentNull() - { - var context = new StreamingContext(); - - ExceptionAssert.ThrowsArgument("info", () => - { - SerializationTestServices.Create((SerializationInfo)null, context); - }); - } - - [TestMethod] - public void Constructor10_SerializationInfoWithMissingIdEntryAsInfoArgument_ShouldThrowSerialization() - { - var info = SerializationTestServices.CreateSerializationInfoRemovingMember("Id"); - var context = new StreamingContext(); - - ExceptionAssert.ThrowsSerialization("Id", () => - { - SerializationTestServices.Create(info, context); - }); - } - - [TestMethod] - public void Constructor10_SerializationInfoWithMissingElementEntryAsInfoArgument_ShouldThrowSerialization() - { - var info = SerializationTestServices.CreateSerializationInfoRemovingMember("Element"); - var context = new StreamingContext(); - - ExceptionAssert.ThrowsSerialization("Element", () => - { - SerializationTestServices.Create(info, context); - }); - } - - [TestMethod] - public void Constructor10_SerializationInfoWithWrongTypeForIdEntryAsInfoArgument_ShouldThrowInvalidCast() - { - var info = SerializationTestServices.CreateSerializationInfoReplacingMember("Id", "InvalidValue"); - var context = new StreamingContext(); - - ExceptionAssert.Throws(() => - { - SerializationTestServices.Create(info, context); - }); - } - - [TestMethod] - public void Constructor10_SerializationInfoWithWrongTypeForElementEntryAsInfoArgument_ShouldThrowInvalidCast() - { - var info = SerializationTestServices.CreateSerializationInfoReplacingMember("Element", 10); - var context = new StreamingContext(); - - ExceptionAssert.Throws(() => - { - SerializationTestServices.Create(info, context); - }); - } - - [TestMethod] - public void Id_CanBeSerialized() - { - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var exception = (ICompositionError)CreateComposablePartException(e); - - var result = (ICompositionError)SerializationTestServices.RoundTrip(exception); - - Assert.AreEqual(exception.Id, result.Id); - } - } - - [TestMethod] - public void Element_CanBeSerialized() - { - var expectations = Expectations.GetCompositionElementsWithNull(); - - foreach (var e in expectations) - { - var exception = CreateComposablePartException(e); - - var result = SerializationTestServices.RoundTrip(exception); - - ElementAssert.AreEqual(exception.Element, result.Element); - } - } - - [TestMethod] - public void InnerException_CanBeSerialized() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var exception = CreateComposablePartException(e); - - var result = SerializationTestServices.RoundTrip(exception); - - ExtendedAssert.IsInstanceOfSameType(exception.InnerException, result.InnerException); - } - } - - [TestMethod] - public void Message_CanBeSerialized() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = CreateComposablePartException(e); - - var result = SerializationTestServices.RoundTrip(exception); - - Assert.AreEqual(exception.Message, result.Message); - } - } - -#endif - - private static ComposablePartException CreateComposablePartException() - { - return CreateComposablePartException(CompositionErrorId.Unknown, (string)null, (ICompositionElement)null, (Exception)null); - } - - private static ComposablePartException CreateComposablePartException(string message) - { - return CreateComposablePartException(CompositionErrorId.Unknown, message, (ICompositionElement)null, (Exception)null); - } - - private static ComposablePartException CreateComposablePartException(CompositionErrorId id) - { - return CreateComposablePartException(CompositionErrorId.Unknown, (string)null, (ICompositionElement)null, (Exception)null); - } - - private static ComposablePartException CreateComposablePartException(ICompositionElement element) - { - return CreateComposablePartException(CompositionErrorId.Unknown, (string)null, element, (Exception)null); - } - - private static ComposablePartException CreateComposablePartException(Exception innerException) - { - return CreateComposablePartException(CompositionErrorId.Unknown, (string)null, (ICompositionElement)null, innerException); - } - - private static ComposablePartException CreateComposablePartException(CompositionErrorId id, string message, ICompositionElement element, Exception innerException) - { - return new ComposablePartException(id, message, element, innerException); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartExtensibilityTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartExtensibilityTests.cs deleted file mode 100644 index a1950429b7e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartExtensibilityTests.cs +++ /dev/null @@ -1,292 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Linq; -using System.Reflection; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.UnitTesting; -using System.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ComposablePartExtensibilityTests - { - [TestMethod] - public void PhaseTest() - { - CompositionContainer container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - var part = new OrderingTestComposablePart(); - part.AddImport("Import1", ImportCardinality.ExactlyOne, true, false); - part.AddExport("Export1", 1); - part.CallOrder.Enqueue("Import:Import1"); - part.CallOrder.Enqueue("OnComposed"); - - batch.AddExportedValue("Import1", 20); - batch.AddPart(part); - container.Compose(batch); - - // Export shouldn't be called until it is pulled on by someone. - var export = container.GetExport("Export1"); - - part.CallOrder.Enqueue("Export:Export1"); - Assert.AreEqual(1, export.Value); - - Assert.IsTrue(part.CallOrder.Count == 0); - } - - [TestMethod] - public void ImportTest() - { - var exporter = new TestExportBinder(); - var importer = new TestImportBinder(); - - CompositionContainer container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(importer); - batch.AddPart(exporter); - container.Compose(batch); - - ExportsAssert.AreEqual(importer.SetImports["single"], 42); - ExportsAssert.AreEqual(importer.SetImports["multi"], 1, 2, 3); - } - - [TestMethod] - public void ConstructorInjectionSimpleCase() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new ConstructorInjectionComposablePart(typeof(Foo))); - batch.AddExportedValue(new Bar("Bar Value")); - container.Compose(batch); - - var import = container.GetExport(); - var foo = import.Value; - - Assert.AreEqual("Bar Value", foo.Bar.Value); - } - - [TestMethod] - public void ConstructorInjectionCycle() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new ConstructorInjectionComposablePart(typeof(AClass))); - batch.AddPart(new ConstructorInjectionComposablePart(typeof(BClass))); - - CompositionAssert.ThrowsErrors(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ImportEngine_PartCannotSetImport, RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - } - - internal class OrderingTestComposablePart : ConcreteComposablePart - { - public Queue CallOrder = new Queue(); - - public OrderingTestComposablePart() - { - } - - public new void AddExport(string contractName, object value) - { - var export = ExportFactory.Create(contractName, () => - { - this.OnGetExport(contractName); return value; - }); - - base.AddExport(export); - } - - private void OnGetExport(string contractName) - { - Assert.AreEqual("Export:" + contractName, CallOrder.Dequeue()); - } - - public override void SetImport(ImportDefinition definition, IEnumerable exports) - { - ContractBasedImportDefinition contractBasedImportDefinition = (ContractBasedImportDefinition)definition; - Assert.AreEqual("Import:" + contractBasedImportDefinition.ContractName, CallOrder.Dequeue()); - base.SetImport(definition, exports); - } - - public override void Activate() - { - Assert.AreEqual("OnComposed", CallOrder.Dequeue()); - base.Activate(); - } - } - - internal class TestExportBinder : ConcreteComposablePart - { - public TestExportBinder() - { - AddExport("single", 42); - AddExport("multi", 1); - AddExport("multi", 2); - AddExport("multi", 3); - } - } - - internal class TestImportBinder : ConcreteComposablePart - { - public TestImportBinder() - { - AddImport("single", ImportCardinality.ExactlyOne, true, false); - AddImport("multi", ImportCardinality.ZeroOrMore, true, false); - } - } - - public class Foo - { - public Foo(IBar bar) - { - Bar = bar; - } - - public IBar Bar { get; private set; } - } - - public interface IBar - { - string Value { get; } - } - - public class Bar : IBar - { - public Bar(string value) - { - Value = value; - } - public string Value { get; private set; } - } - - public class FooBar - { - [Import("Foo")] - public Foo Foo { get; set; } - } - - public class AClass - { - public AClass(BClass b) - { - } - - public BClass B { get; private set; } - } - - public class BClass - { - public BClass(AClass a) - { - this.A = a; - } - - public AClass A { get; private set; } - } - - internal class ConstructorInjectionComposablePart : ConcreteComposablePart - { - private Type _type; - private ConstructorInfo _constructor; - private Dictionary _imports; - private bool currentlyExecuting = false; - - public ConstructorInjectionComposablePart(Type type) - { - this._type = type; - - // Note that this just blindly takes the first constructor... - this._constructor = this._type.GetConstructors().FirstOrDefault(); - Assert.IsNotNull(this._constructor); - - foreach (var param in this._constructor.GetParameters()) - { - string name = AttributedModelServices.GetContractName(param.ParameterType); - AddImport(name, ImportCardinality.ExactlyOne, true, true); - } - - string contractName = AttributedModelServices.GetContractName(type); - string typeIdentity = AttributedModelServices.GetTypeIdentity(type); - var metadata = new Dictionary(); - metadata.Add(CompositionConstants.ExportTypeIdentityMetadataName, typeIdentity); - - Export composableExport = ExportFactory.Create( - contractName, - metadata, - GetInstance); - this.AddExport(composableExport); - - this._imports = new Dictionary(); - } - - private object GetInstance() - { - var result = CompositionResult.SucceededResult; - - // We only need this guard if we are pulling on the lazy exports during this call - // but if we do the pulling in SetImport it isn't needed. - //if (currentlyExecuting) - //{ - // var issue = CompositionError.Create("CM:CreationCycleDetected", - // "This failed because there is a creation cycle"); - // return result.MergeIssue(issue).ToResult(null); - //} - - try - { - currentlyExecuting = true; - - List constructorArgs = new List(); - - foreach (ImportDefinition import in this.ImportDefinitions - .Where(i => i.IsPrerequisite)) - { - object importValue; - if (!this._imports.TryGetValue(import, out importValue)) - { - result = result.MergeError(CompositionError.Create(CompositionErrorId.ImportNotSetOnPart, - "The import '{0}' is required for construction of '{1}'", import.ToString(), _type.FullName)); - - continue; - } - - constructorArgs.Add(importValue); - } - - if (!result.Succeeded) - { - throw new CompositionException(result.Errors); - } - - object obj = this._constructor.Invoke(constructorArgs.ToArray()); - - return obj; - } - finally - { - currentlyExecuting = false; - } - } - - public override void SetImport(ImportDefinition definition, IEnumerable exports) - { - _imports[definition] = exports.First().Value; - } - } -} - diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartTests.cs deleted file mode 100644 index bab987db6f3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ComposablePartTests.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Factories; -using System.Linq; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ComposablePartTests - { - [TestMethod] - public void Constructor1_ShouldSetMetadataPropertyToEmptyDictionary() - { - var part = PartFactory.Create(); - - EnumerableAssert.IsEmpty(part.Metadata); - } - - [TestMethod] - public void Constructor1_ShouldSetMetadataPropertyToReadOnlyDictionary() - { - var part = PartFactory.Create(); - - ExceptionAssert.Throws(() => - { - part.Metadata["Value"] = "Value"; - }); - } - - [TestMethod] - public void OnComposed_DoesNotThrow() - { - var part = PartFactory.Create(); - part.Activate(); - } - - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerCollectionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerCollectionTests.cs deleted file mode 100644 index 1f4b0233ede..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerCollectionTests.cs +++ /dev/null @@ -1,929 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.UnitTesting; -using System.ComponentModel.Composition.UnitTesting; -using System.ComponentModel.Composition.Hosting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionContainerCollectionTests - { - public class SupportedImportCollectionAssignments - { - // Fields - [ImportMany("Value")] - public IEnumerable IEnumerableOfTField; - - [ImportMany("Value")] - public IEnumerable IEnumerableOfObjectField; - - [ImportMany("Value")] - public T[] ArrayOfTField; - - [ImportMany("Value")] - public object[] ArrayOfObjectField; - - [ImportMany("Value")] - public IEnumerable IEnumerableOfTProperty { get; set; } - - [ImportMany("Value")] - public IEnumerable IEnumerableOfObjectProperty { get; set; } - - [ImportMany("Value")] - public T[] ArrayOfTProperty { get; set; } - - [ImportMany("Value")] - public object[] ArrayOfObjectProperty { get; set; } - - public void VerifyImports(params T[] expectedValues) - { - // Fields - EnumerableAssert.AreEqual(IEnumerableOfTField, expectedValues); - EnumerableAssert.AreEqual(IEnumerableOfObjectField, expectedValues.Cast()); - EnumerableAssert.AreEqual(ArrayOfTField, expectedValues); - EnumerableAssert.AreEqual(ArrayOfObjectField, expectedValues.Cast()); - - // Properties - EnumerableAssert.AreEqual(IEnumerableOfTProperty, expectedValues); - EnumerableAssert.AreEqual(IEnumerableOfObjectProperty, expectedValues.Cast()); - EnumerableAssert.AreEqual(ArrayOfTProperty, expectedValues); - EnumerableAssert.AreEqual(ArrayOfObjectProperty, expectedValues.Cast()); - } - } - - [TestMethod] - public void ValidateSupportedImportCollectionAssignments() - { - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - - var importer = new SupportedImportCollectionAssignments(); - - batch.AddPart(importer); - batch.AddExportedValue("Value", 21); - batch.AddExportedValue("Value", 32); - batch.AddExportedValue("Value", 43); - - container.Compose(batch); - - importer.VerifyImports(21, 32, 43); - } - - public class SupportedImportCollectionMutation - { - public SupportedImportCollectionMutation() - { - ICollectionOfTReadOnlyField = new List(); - ListOfTReadOnlyField = new List(); - CollectionOfTField = new Collection(); - CollectionOfTReadOnlyField = new Collection(); - - _iCollectionOfTReadOnlyProperty = new List(); - _listOfTReadOnlyProperty = new List(); - CollectionOfTProperty = new Collection(); - _collectionOfTReadOnlyProperty = new Collection(); - -#if !SILVERLIGHT - ObservableCollectionOfTReadOnlyField = new ObservableCollection(); - _observableCollectionOfTReadOnlyProperty = new ObservableCollection(); -#endif // !SILVERLIGHT - } - - [ImportMany("Value")] - public readonly ICollection ICollectionOfTReadOnlyField; - - [ImportMany("Value")] - public List ListOfTField; - - [ImportMany("Value")] - public readonly List ListOfTReadOnlyField; - - [ImportMany("Value")] - public Collection CollectionOfTField; - - [ImportMany("Value")] - public Collection CollectionOfObjectField; - - [ImportMany("Value")] - public readonly Collection CollectionOfTReadOnlyField; - - [ImportMany("Value")] - public ICollection ICollectionOfTReadOnlyProperty { get { return _iCollectionOfTReadOnlyProperty; } } - private ICollection _iCollectionOfTReadOnlyProperty; - - [ImportMany("Value")] - public List ListOfTProperty { get; set; } - - [ImportMany("Value")] - public List ListOfTReadOnlyProperty { get { return _listOfTReadOnlyProperty; } } - private readonly List _listOfTReadOnlyProperty; - - [ImportMany("Value")] - public Collection CollectionOfTProperty { get; set; } - - [ImportMany("Value")] - public Collection CollectionOfTReadOnlyProperty { get { return _collectionOfTReadOnlyProperty; } } - private readonly Collection _collectionOfTReadOnlyProperty; - -#if !SILVERLIGHT - [ImportMany("Value")] - public ObservableCollection ObservableCollectionOfTField; - - [ImportMany("Value")] - public readonly ObservableCollection ObservableCollectionOfTReadOnlyField; - - [ImportMany("Value")] - public ObservableCollection ObservableCollectionOfTProperty { get; set; } - - [ImportMany("Value")] - public ObservableCollection ObservableCollectionOfTReadOnlyProperty { get { return _observableCollectionOfTReadOnlyProperty; } } - private readonly ObservableCollection _observableCollectionOfTReadOnlyProperty; -#endif // !SILVERLIGHT - - public void VerifyImports(params T[] expectedValues) - { - EnumerableAssert.AreEqual(ICollectionOfTReadOnlyField, expectedValues); - EnumerableAssert.AreEqual(ListOfTField, expectedValues); - EnumerableAssert.AreEqual(ListOfTReadOnlyField, expectedValues); - EnumerableAssert.AreEqual(CollectionOfTField, expectedValues); - EnumerableAssert.AreEqual(CollectionOfTReadOnlyField, expectedValues); - - EnumerableAssert.AreEqual(ICollectionOfTReadOnlyProperty, expectedValues); - EnumerableAssert.AreEqual(ListOfTProperty, expectedValues); - EnumerableAssert.AreEqual(ListOfTReadOnlyProperty, expectedValues); - EnumerableAssert.AreEqual(CollectionOfTProperty, expectedValues); - EnumerableAssert.AreEqual(CollectionOfTReadOnlyProperty, expectedValues); - -#if !SILVERLIGHT - EnumerableAssert.AreEqual(ObservableCollectionOfTField, expectedValues); - EnumerableAssert.AreEqual(ObservableCollectionOfTReadOnlyField, expectedValues); - EnumerableAssert.AreEqual(ObservableCollectionOfTProperty, expectedValues); - EnumerableAssert.AreEqual(ObservableCollectionOfTReadOnlyProperty, expectedValues); -#endif // !SILVERLIGHT - } - } - - [TestMethod] - public void ValidateSupportedImportCollectionMutation() - { - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - - var importer = new SupportedImportCollectionMutation(); - - batch.AddPart(importer); - batch.AddExportedValue("Value", 21); - batch.AddExportedValue("Value", 32); - batch.AddExportedValue("Value", 43); - - container.Compose(batch); - - importer.VerifyImports(21, 32, 43); - } - - public class ImportCollectionNullValue - { - [ImportMany("Value")] - public List NullValue { get; set; } - } - - public class NamelessImporter - { - [ImportMany] - public int[] ReadWriteIList { get; set; } - - [ImportMany] - public Collection> ReadWriteMetadata { get; set; } - } - - public class NamelessExporter - { - public NamelessExporter(int value) - { - Value = value; - } - - [Export] - public int Value { get; set; } - } - - [TestMethod] - public void ImportCollectionsNameless() - { - // Verifing that the contract name gets the correct value - var container = ContainerFactory.Create(); - NamelessImporter importer = new NamelessImporter(); - NamelessExporter exporter42 = new NamelessExporter(42); - NamelessExporter exporter0 = new NamelessExporter(0); - - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(importer, exporter42, exporter0); - container.Compose(batch); - - EnumerableAssert.AreEqual(importer.ReadWriteIList, 42, 0); - } - - public class InvalidImporterReadOnlyEnumerable - { - IEnumerable readOnlyEnumerable = new List(); - - [ImportMany("Value")] - public IEnumerable ReadOnlyEnumerable - { - get - { - return readOnlyEnumerable; - } - } - } - - [TestMethod] - public void ImportCollectionsExceptionReadOnlyEnumerable() - { - ExpectedErrorOnPartActivate(new InvalidImporterReadOnlyEnumerable(), - ErrorId.ReflectionModel_ImportCollectionNotWritable); - } - - public class ImporterWriteOnlyExportCollection - { - [ImportMany("Value")] - public Collection> WriteOnlyExportCollection - { - set { PublicExportCollection = value; } - } - - public Collection> PublicExportCollection { get; set; } - } - - [TestMethod] - public void ImportCollections_WriteOnlyExportCollection() - { - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - - var importer = new ImporterWriteOnlyExportCollection(); - - List values = new List() { 21, 32, 43 }; - - batch.AddPart(importer); - values.ForEach(v => batch.AddExportedValue("Value", v)); - - container.Compose(batch); - - EnumerableAssert.AreEqual(values, importer.PublicExportCollection.Select(export => export.Value)); - } - - public class ImporterWriteOnlyIEnumerableOfT - { - [ImportMany("Value")] - public IEnumerable WriteOnlyIEnumerable - { - set { PublicIEnumerable = value; } - } - - public IEnumerable PublicIEnumerable { get; set; } - } - - [TestMethod] - public void ImportCollections_WriteOnlyIEnumerableOfT() - { - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - - var importer = new ImporterWriteOnlyIEnumerableOfT(); - - List values = new List() { 21, 32, 43 }; - - batch.AddPart(importer); - values.ForEach(v => batch.AddExportedValue("Value", v)); - - container.Compose(batch); - - EnumerableAssert.AreEqual(values, importer.PublicIEnumerable); - } - - public class ImporterWriteOnlyArray - { - [ImportMany("Value")] - public int[] WriteOnlyArray - { - set { PublicArray = value; } - } - - public int[] PublicArray { get; set; } - } - - [TestMethod] - public void ImportCollections_WriteOnlyArray() - { - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - - var importer = new ImporterWriteOnlyArray(); - - List values = new List() { 21, 32, 43 }; - - batch.AddPart(importer); - values.ForEach(v => batch.AddExportedValue("Value", v)); - - container.Compose(batch); - - EnumerableAssert.AreEqual(values, importer.PublicArray); - } - - public class InvalidImporterNonCollection - { - [Import("Value")] - public int Value { get; set; } - } - - [TestMethod] - public void ImportCollectionsExceptionNonCollection() - { - ExpectedChangeRejectedErrorOnSetImport(new InvalidImporterNonCollection(), - ErrorId.ImportEngine_ImportCardinalityMismatch); - } - - public class InvalidImporterNonAssignableCollection - { - [ImportMany("Value", typeof(int))] - public IEnumerable StringCollection { get; set; } - } - - [TestMethod] - public void ImportCollectionsExceptionNonAssignableCollection() - { - ExpectedErrorOnSetImport(new InvalidImporterNonAssignableCollection(), - ErrorId.ReflectionModel_ImportNotAssignableFromExport); - } - - public class InvalidImporterNullReadOnlyICollection - { - ICollection readOnlyICollection = null; - - [ImportMany("Value")] - public ICollection Values { get { return readOnlyICollection; } } - } - - [TestMethod] - public void ImportCollectionsExceptionNullReadOnlyICollection() - { - ExpectedErrorOnPartActivate(new InvalidImporterNullReadOnlyICollection(), - ErrorId.ReflectionModel_ImportCollectionNull); - } - - public class ImporterWeakIEnumerable - { - public ImporterWeakIEnumerable() - { - ReadWriteEnumerable = new IntCollection(); - } - - [ImportMany("Value")] - public IntCollection ReadWriteEnumerable { get; set; } - - public class IntCollection : IEnumerable - { - List ints = new List(); - public void Add(int item) { ints.Add(item); } - public void Clear() { ints.Clear(); } - public bool Remove(int item) { return ints.Remove(item); } - public IEnumerator GetEnumerator() { return ints.GetEnumerator(); } - } - } - - [TestMethod] - public void ImportCollectionsExceptionWeakCollectionNotSupportingICollectionOfT() - { - ExpectedErrorOnPartActivate(new ImporterWeakIEnumerable(), - ErrorId.ReflectionModel_ImportCollectionNotWritable); - } - - public class ImporterThrowsOnGetting - { - [ImportMany("Value")] - public List Value - { - get - { - throw new NotSupportedException(); - } - } - } - - [TestMethod] - public void ImportCollectionsExceptionGettingValue() - { - var container = ContainerFactory.Create(); - ImporterThrowsOnGetting importer = new ImporterThrowsOnGetting(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddExportedValue("Value", 42); - batch.AddExportedValue("Value", 0); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotActivate, - ErrorId.ReflectionModel_ImportCollectionGetThrewException, RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - public class CustomCollectionThrowsDuringConstruction : Collection - { - public CustomCollectionThrowsDuringConstruction() - { - throw new NotSupportedException(); - } - } - - public class ImportCustomCollectionThrowsDuringConstruction - { - public ImportCustomCollectionThrowsDuringConstruction() - { - } - - [ImportMany("Value")] - public CustomCollectionThrowsDuringConstruction Values { get; set; } - } - - [TestMethod] - public void ImportCollections_ImportTypeThrowsOnConstruction() - { - ExpectedErrorOnPartActivate(new ImportCustomCollectionThrowsDuringConstruction(), - ErrorId.ReflectionModel_ImportCollectionConstructionThrewException); - } - - public class CustomCollectionThrowsDuringClear : Collection - { - protected override void ClearItems() - { - throw new NotSupportedException(); - } - } - - public class ImportCustomCollectionThrowsDuringClear - { - public ImportCustomCollectionThrowsDuringClear() - { - } - - [ImportMany("Value")] - public CustomCollectionThrowsDuringClear Values { get; set; } - } - - [TestMethod] - public void ImportCollections_ImportTypeThrowsOnClear() - { - ExpectedErrorOnPartActivate(new ImportCustomCollectionThrowsDuringClear(), - ErrorId.ReflectionModel_ImportCollectionClearThrewException); - } - - public class CustomCollectionThrowsDuringAdd : Collection - { - protected override void InsertItem(int index, int item) - { - throw new NotSupportedException(); - } - } - - public class ImportCustomCollectionThrowsDuringAdd - { - public ImportCustomCollectionThrowsDuringAdd() - { - } - - [ImportMany("Value")] - public CustomCollectionThrowsDuringAdd Values { get; set; } - } - - [TestMethod] - public void ImportCollections_ImportTypeThrowsOnAdd() - { - ExpectedErrorOnPartActivate(new ImportCustomCollectionThrowsDuringAdd(), - ErrorId.ReflectionModel_ImportCollectionAddThrewException); - } - - public class CustomCollectionThrowsDuringIsReadOnly : ICollection - { - void ICollection.Add(int item) - { - throw new NotImplementedException(); - } - - void ICollection.Clear() - { - throw new NotImplementedException(); - } - - bool ICollection.Contains(int item) - { - throw new NotImplementedException(); - } - - void ICollection.CopyTo(int[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - int ICollection.Count - { - get { throw new NotImplementedException(); } - } - - bool ICollection.IsReadOnly - { - get { throw new NotSupportedException(); } - } - - bool ICollection.Remove(int item) - { - throw new NotImplementedException(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - throw new NotImplementedException(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - throw new NotImplementedException(); - } - } - - public class ImportCustomCollectionThrowsDuringIsReadOnly - { - public ImportCustomCollectionThrowsDuringIsReadOnly() - { - Values = new CustomCollectionThrowsDuringIsReadOnly(); - } - - [ImportMany("Value")] - public CustomCollectionThrowsDuringIsReadOnly Values { get; set; } - } - - [TestMethod] - public void ImportCollections_ImportTypeThrowsOnIsReadOnly() - { - ExpectedErrorOnPartActivate(new ImportCustomCollectionThrowsDuringIsReadOnly(), - ErrorId.ReflectionModel_ImportCollectionIsReadOnlyThrewException); - } - - public class CollectionTypeWithNoIList : ICollection - { - private int _count = 0; - public CollectionTypeWithNoIList() - { - - } - - public void Add(T item) - { - // Do Nothing - this._count++; - } - - public void Clear() - { - // Do Nothings - } - - public bool Contains(T item) - { - throw new NotImplementedException(); - } - - public void CopyTo(T[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - public int Count - { - get { return this._count; } - } - - public bool IsReadOnly - { - get { return false; } - } - - public bool Remove(T item) - { - throw new NotImplementedException(); - } - - public IEnumerator GetEnumerator() - { - throw new NotImplementedException(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - throw new NotImplementedException(); - } - } - - public class ImportCollectionWithNoIList - { - [ImportMany("Value")] - public CollectionTypeWithNoIList Values { get; set; } - } - - [TestMethod] - public void ImportCollections_NoIList_ShouldWorkFine() - { - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - var importer = new ImportCollectionWithNoIList(); - batch.AddPart(importer); - batch.AddExportedValue("Value", 42); - batch.AddExportedValue("Value", 0); - - container.Compose(batch); - - Assert.AreEqual(2, importer.Values.Count); - } - - public class CollectionWithMultipleInterfaces : ICollection, ICollection - { - private int _count = 0; - public CollectionWithMultipleInterfaces() - { - - } - - #region ICollection Members - - void ICollection.Add(int item) - { - throw new NotImplementedException(); - } - - void ICollection.Clear() - { - throw new NotImplementedException(); - } - - bool ICollection.Contains(int item) - { - throw new NotImplementedException(); - } - - void ICollection.CopyTo(int[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - int ICollection.Count - { - get { throw new NotImplementedException(); } - } - - bool ICollection.IsReadOnly - { - get { throw new NotImplementedException(); } - } - - bool ICollection.Remove(int item) - { - throw new NotImplementedException(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - throw new NotImplementedException(); - } - - #endregion - - #region IEnumerable Members - - IEnumerator IEnumerable.GetEnumerator() - { - throw new NotImplementedException(); - } - - #endregion - - #region ICollection Members - - void ICollection.Add(string item) - { - throw new NotImplementedException(); - } - - void ICollection.Clear() - { - throw new NotImplementedException(); - } - - bool ICollection.Contains(string item) - { - throw new NotImplementedException(); - } - - void ICollection.CopyTo(string[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - int ICollection.Count - { - get { throw new NotImplementedException(); } - } - - bool ICollection.IsReadOnly - { - get { throw new NotImplementedException(); } - } - - bool ICollection.Remove(string item) - { - throw new NotImplementedException(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - throw new NotImplementedException(); - } - - #endregion - } - - public class ImportCollectionWithMultipleInterfaces - { - [ImportMany("Value")] - public CollectionWithMultipleInterfaces Values { get; set; } - } - - [TestMethod] - public void ImportCollections_MultipleICollections_ShouldCauseNotWriteable() - { - ExpectedErrorOnPartActivate(new ImportCollectionWithMultipleInterfaces(), - ErrorId.ReflectionModel_ImportCollectionNotWritable); - } - - public class ImportManyNonCollectionTypeString - { - [ImportMany("Value")] - public string Foo { get; set; } - } - - [TestMethod] - public void ImportManyOnNonCollectionTypeString_ShouldCauseNotWritable() - { - ExpectedErrorOnPartActivate(new ImportManyNonCollectionTypeString(), - ErrorId.ReflectionModel_ImportCollectionNotWritable); - } - - public class ImportManyNonCollectionTypeObject - { - [ImportMany("Value")] - public object Foo { get; set; } - } - - [TestMethod] - public void ImportManyOnNonCollectionTypeObject_ShouldCauseNotWritable() - { - ExpectedErrorOnPartActivate(new ImportManyNonCollectionTypeObject(), - ErrorId.ReflectionModel_ImportCollectionNotWritable); - } - -#if !SILVERLIGHT - // SILVERLIGHT doesn't have SetEnvironmentVariable set in this test. - public class ExportADictionaryObject - { - [Export] - public IDictionary MyDictionary - { - get - { - var dictionary = new Dictionary(); - dictionary.Add("a", 42); - dictionary.Add("b", "c"); - return dictionary; - } - } - } - - public class ImportADictionaryObject - { - [Import] - public IDictionary MyDictionary { get; set; } - } - - [TestMethod] - public void ImportDictionaryAsSingleObject() - { - // Set variable to ensure the hack is turned off. - Environment.SetEnvironmentVariable("ONLY_ALLOW_IMPORTMANY", "1"); - - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - var importer = new ImportADictionaryObject(); - var exporter = new ExportADictionaryObject(); - - batch.AddPart(importer); - batch.AddPart(exporter); - container.Compose(batch); - - Assert.AreEqual(2, importer.MyDictionary.Count); - } - - public class ExportACollectionObject - { - [Export] - public Collection MyCollection - { - get - { - var collection = new Collection(); - collection.Add("a"); - collection.Add("b"); - return collection; - } - } - } - - public class ImportACollectionObject - { - [Import] - public Collection MyCollection { get; set; } - } - - [TestMethod] - public void ImportCollectionAsSingleObject() - { - // Set variable to ensure the hack is turned off. - Environment.SetEnvironmentVariable("ONLY_ALLOW_IMPORTMANY", "1"); - - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - var importer = new ImportACollectionObject(); - var exporter = new ExportACollectionObject(); - - batch.AddPart(importer); - batch.AddPart(exporter); - container.Compose(batch); - - Assert.AreEqual(2, importer.MyCollection.Count); - } -#endif - - public void ExpectedErrorOnPartActivate(object importer, ErrorId expectedErrorId) - { - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddExportedValue("Value", 42); - batch.AddExportedValue("Value", 0); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotActivate, - expectedErrorId, RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - public void ExpectedErrorOnSetImport(object importer, ErrorId expectedErrorId) - { - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddExportedValue("Value", 42); - batch.AddExportedValue("Value", 0); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - expectedErrorId, RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - public void ExpectedChangeRejectedErrorOnSetImport(object importer, ErrorId expectedErrorId) - { - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddExportedValue("Value", 42); - batch.AddExportedValue("Value", 0); - - CompositionAssert.ThrowsChangeRejectedError(ErrorId.ImportEngine_PartCannotSetImport, - expectedErrorId, RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerCycleTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerCycleTests.cs deleted file mode 100644 index d7c0a685587..00000000000 Binary files a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerCycleTests.cs and /dev/null differ diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs deleted file mode 100644 index f088200809b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensibilityTests.cs +++ /dev/null @@ -1,81 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.Linq; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionContainerExtensibilityTests - { - [TestMethod] - public void Dispose_DoesNotThrow() - { - var container = CreateCustomCompositionContainer(); - container.Dispose(); - } - - [TestMethod] - public void DerivedCompositionContainer_CanExportItself() - { - var container = CreateCustomCompositionContainer(); - container.AddAndComposeExportedValue(container); - - Assert.AreSame(container, container.GetExportedValue()); - } - - [TestMethod] - public void ICompositionService_CanBeExported() - { - var container = CreateCustomCompositionContainer(); - container.AddAndComposeExportedValue(container); - - Assert.AreSame(container, container.GetExportedValue()); - } - - [TestMethod] - public void CompositionContainer_CanBeExported() - { - var container = CreateCustomCompositionContainer(); - container.AddAndComposeExportedValue(container); - - Assert.AreSame(container, container.GetExportedValue()); - } - - [TestMethod] - public void CanBeCollectedAfterDispose() - { - AggregateExportProvider exportProvider = new AggregateExportProvider(); - var catalog = new AggregateCatalog(CatalogFactory.CreateDefaultAttributed()); - var container = new CompositionContainer(catalog, exportProvider); - - WeakReference weakContainer = new WeakReference(container); - container.Dispose(); - container = null; - - GC.Collect(); - GC.WaitForPendingFinalizers(); - - Assert.IsFalse(weakContainer.IsAlive); - - GC.KeepAlive(exportProvider); - GC.KeepAlive(catalog); - } - - private CustomCompositionContainer CreateCustomCompositionContainer() - { - return new CustomCompositionContainer(); - } - - // Type needs to be public otherwise container.GetExportedValue - // fails on Silverlight because it cannot construct a Lazy factory. - public class CustomCompositionContainer : CompositionContainer - { - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensions.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensions.cs deleted file mode 100644 index 3a5af3d9e0e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerExtensions.cs +++ /dev/null @@ -1,86 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Linq; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - internal static class CompositionContainerExtensions - { - public static bool IsPresent(this ExportProvider container) - { - try - { - container.GetExportedValue(); - return true; - } - catch (ImportCardinalityMismatchException) - { - return false; - } - } - - public static bool IsPresent(this ExportProvider container, string contractName) - { - try - { - container.GetExportedValue(contractName); - return true; - } - catch (ImportCardinalityMismatchException) - { - return false; - } - } - - public static void AddAndComposeExportedValue(this CompositionContainer container, T exportedValue) - { - var batch = new CompositionBatch(); - batch.AddExportedValue(exportedValue); - container.Compose(batch); - } - - public static void AddAndComposeExportedValue(this CompositionContainer container, string contractName, T exportedValue) - { - var batch = new CompositionBatch(); - batch.AddExportedValue(contractName, exportedValue); - container.Compose(batch); - } - - public static void AddParts(this CompositionBatch batch, params object[] parts) - { - foreach (object instance in parts) - { - ComposablePart part = instance as ComposablePart; - if (part != null) - { - batch.AddPart(part); - } - else - { - batch.AddPart((object)instance); - } - } - } - - public static ComposablePart AddExportedValue(this CompositionBatch batch, string contractName, Type contractType, object exportedValue) - { - string typeIdentity = AttributedModelServices.GetTypeIdentity(contractType); - - IDictionary metadata = null; - - if (typeIdentity != null) - { - metadata = new Dictionary(); - metadata.Add(CompositionConstants.ExportTypeIdentityMetadataName, typeIdentity); - } - - return batch.AddExport(new Export(contractName, metadata, () => exportedValue)); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerImportTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerImportTests.cs deleted file mode 100644 index 3c99bdc85a9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerImportTests.cs +++ /dev/null @@ -1,769 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.UnitTesting; -using System.Linq; -using System.Runtime.InteropServices; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionContainerImportTests - { - // Exporting collectin values is not supported - [TestMethod] - public void ImportValues() - { - var container = ContainerFactory.Create(); - Importer importer = new Importer(); - Exporter exporter42 = new Exporter(42); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddPart(exporter42); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ReflectionModel_ImportNotAssignableFromExport, RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportSingle() - { - var container = ContainerFactory.Create(); - var importer = new Int32Importer(); - var exporter = new Int32Exporter(42); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddPart(exporter); - container.Compose(batch); - - Assert.AreEqual(42, importer.Value, "Expecting value to be imported"); - - } - - [TestMethod] - public void ImportSingleFromInternal() - { - var container = ContainerFactory.Create(); - var importer = new Int32Importer(); - var exporter = new Int32ExporterInternal(42); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddPart(exporter); - container.Compose(batch); - - Assert.AreEqual(42, importer.Value, "Expecting value to be imported"); - } - - [TestMethod] - public void ImportSingleToInternal() - { - var container = ContainerFactory.Create(); - var importer = new Int32ImporterInternal(); - var exporter = new Int32Exporter(42); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddPart(exporter); - container.Compose(batch); - - Assert.AreEqual(42, importer.Value, "Expecting value to be imported"); - } - - [TestMethod] - public void ImportSingleIntoCollection() - { - var container = ContainerFactory.Create(); - var importer = new Int32CollectionImporter(); - var exporter = new Int32Exporter(42); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddPart(exporter); - container.Compose(batch); - - EnumerableAssert.AreEqual(importer.Values, 42); - } - - [TestMethod] - public void ImportValuesNameless() - { - var container = ContainerFactory.Create(); - ImporterNameless importer; - ExporterNameless exporter42 = new ExporterNameless(42); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer = new ImporterNameless()); - batch.AddPart(exporter42); - container.Compose(batch); - - Assert.AreEqual(42, importer.ValueReadWrite); - Assert.AreEqual(42, importer.MetadataReadWrite.Value); - } - - [TestMethod] - public void ImportValueExceptionMissing() - { - var container = ContainerFactory.Create(); - Importer importer; - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer = new Importer()); - - CompositionAssert.ThrowsChangeRejectedError(ErrorId.ImportEngine_PartCannotSetImport, - ErrorId.ImportEngine_ImportCardinalityMismatch, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportValueExceptionMultiple() - { - var container = ContainerFactory.Create(); - Importer importer = new Importer(); - Exporter exporter42 = new Exporter(42); - Exporter exporter6 = new Exporter(6); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddPart(exporter42); - batch.AddPart(exporter6); - - CompositionAssert.ThrowsChangeRejectedError(ErrorId.ImportEngine_PartCannotSetImport, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportValueExceptionSetterException() - { - var container = ContainerFactory.Create(); - ImporterInvalidSetterException importer = new ImporterInvalidSetterException(); - Exporter exporter42 = new Exporter(42); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddPart(exporter42); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotActivate, - ErrorId.ReflectionModel_ImportThrewException, - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ImportValueExceptionLazily() - { - var catalog = new AssemblyCatalog(typeof(ImportImporterInvalidSetterExceptionLazily).Assembly); - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(ImportImporterInvalidSetterExceptionLazily), typeof(ImporterInvalidSetterException)); - var invalidLazy = container.GetExportedValue(); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, - ErrorId.ImportEngine_PartCannotActivate, - ErrorId.ReflectionModel_ImportThrewException, RetryMode.DoNotRetry, () => - { - var value = invalidLazy.Value.Value; - }); - } - -#if !SILVERLIGHT - - [TestMethod] - public void ImportValueComComponent() - { - CTaskScheduler scheduler = new CTaskScheduler(); - - try - { - var container = ContainerFactory.Create(); - var importer = new ImportComComponent(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(importer); - batch.AddExportedValue("TaskScheduler", (ITaskScheduler)scheduler); - - container.Compose(batch); - - Assert.AreEqual(scheduler, importer.TaskScheduler); - } - finally - { - Marshal.ReleaseComObject(scheduler); - } - } - - [TestMethod] - public void DelayImportValueComComponent() - { - CTaskScheduler scheduler = new CTaskScheduler(); - - try - { - var container = ContainerFactory.Create(); - var importer = new DelayImportComComponent(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(importer); - batch.AddExportedValue("TaskScheduler", (ITaskScheduler)scheduler); - - container.Compose(batch); - - Assert.AreEqual(scheduler, importer.TaskScheduler.Value); - } - finally - { - Marshal.ReleaseComObject(scheduler); - } - } -#endif - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfValueTypesAreBoundToDefaultWhenNotSatisfied() - { - var container = ContainerFactory.Create(); - var importer = new OptionalImport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - container.Compose(batch); - - Assert.AreEqual(1, importer.ValueTypeSetCount); - Assert.AreEqual(0, importer.ValueType); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfNullableValueTypesAreBoundToDefaultWhenNotSatisfied() - { - var container = ContainerFactory.Create(); - var importer = new OptionalImport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - container.Compose(batch); - - Assert.AreEqual(1, importer.NullableValueTypeSetCount); - Assert.IsNull(importer.NullableValueType); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfReferenceTypesAreBoundToDefaultWhenNotSatisfied() - { - var container = ContainerFactory.Create(); - var importer = new OptionalImport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - container.Compose(batch); - - Assert.AreEqual(1, importer.ReferenceTypeSetCount); - Assert.IsNull(importer.ReferenceType); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfExportValueTypesAreBoundToDefaultWhenNotSatisfied() - { - var container = ContainerFactory.Create(); - var importer = new OptionalExport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - container.Compose(batch); - - Assert.AreEqual(1, importer.ValueTypeSetCount); - Assert.IsNull(importer.ValueType); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfExportNullableValueTypesAreBoundToDefaultWhenNotSatisfied() - { - var container = ContainerFactory.Create(); - var importer = new OptionalExport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - container.Compose(batch); - - Assert.AreEqual(1, importer.NullableValueTypeSetCount); - Assert.IsNull(importer.NullableValueType); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfExportReferenceTypesAreBoundToDefaultWhenNotSatisfied() - { - var container = ContainerFactory.Create(); - var importer = new OptionalExport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - container.Compose(batch); - - Assert.AreEqual(1, importer.ReferenceTypeSetCount); - Assert.IsNull(importer.ReferenceType); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfValueTypesAreReboundToDefaultWhenExportIsRemoved() - { - var container = ContainerFactory.Create(); - var importer = new OptionalImport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - var key = batch.AddExportedValue("ValueType", 10); - - container.Compose(batch); - - Assert.AreEqual(1, importer.ValueTypeSetCount); - Assert.AreEqual(10, importer.ValueType); - - batch = new CompositionBatch(); - batch.RemovePart(key); - container.Compose(batch); - - Assert.AreEqual(2, importer.ValueTypeSetCount); - Assert.AreEqual(0, importer.ValueType); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfNullableValueTypesAreReboundToDefaultWhenExportIsRemoved() - { - var container = ContainerFactory.Create(); - var importer = new OptionalImport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - var key = batch.AddExportedValue("NullableValueType", 10); - - container.Compose(batch); - Assert.AreEqual(1, importer.NullableValueTypeSetCount); - Assert.AreEqual(10, importer.NullableValueType); - - batch = new CompositionBatch(); - batch.RemovePart(key); - container.Compose(batch); - - Assert.AreEqual(2, importer.NullableValueTypeSetCount); - Assert.IsNull(importer.NullableValueType); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfReferenceTypesAreReboundToDefaultWhenExportIsRemoved() - { - var container = ContainerFactory.Create(); - var importer = new OptionalImport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - var key = batch.AddExportedValue("ReferenceType", "Bar"); - - container.Compose(batch); - Assert.AreEqual(1, importer.ReferenceTypeSetCount); - Assert.AreEqual("Bar", importer.ReferenceType); - - batch = new CompositionBatch(); - batch.RemovePart(key); - container.Compose(batch); - - Assert.AreEqual(2, importer.ReferenceTypeSetCount); - Assert.IsNull(importer.ReferenceType); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfExportValueTypesAreReboundToDefaultWhenExportIsRemoved() - { - var container = ContainerFactory.Create(); - var importer = new OptionalExport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - var key = batch.AddExportedValue("ValueType", 10); - - container.Compose(batch); - - Assert.AreEqual(1, importer.ValueTypeSetCount); - Assert.AreEqual(10, importer.ValueType.Value); - - batch = new CompositionBatch(); - batch.RemovePart(key); - container.Compose(batch); - - Assert.AreEqual(2, importer.ValueTypeSetCount); - Assert.IsNull(importer.ValueType); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfExportNullableValueTypesAreReboundToDefaultWhenExportIsRemoved() - { - var container = ContainerFactory.Create(); - var importer = new OptionalExport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - var key = batch.AddExportedValue("NullableValueType", 10); - - container.Compose(batch); - Assert.AreEqual(1, importer.NullableValueTypeSetCount); - Assert.AreEqual(10, importer.NullableValueType.Value); - - batch = new CompositionBatch(); - batch.RemovePart(key); - container.Compose(batch); - - Assert.AreEqual(2, importer.NullableValueTypeSetCount); - Assert.IsNull(importer.NullableValueType); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfExportReferenceTypesAreReboundToDefaultWhenExportIsRemoved() - { - var container = ContainerFactory.Create(); - var importer = new OptionalExport(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - var key = batch.AddExportedValue("ReferenceType", "Bar"); - - container.Compose(batch); - Assert.AreEqual(1, importer.ReferenceTypeSetCount); - Assert.AreEqual("Bar", importer.ReferenceType.Value); - - batch = new CompositionBatch(); - batch.RemovePart(key); - container.Compose(batch); - - Assert.AreEqual(2, importer.ReferenceTypeSetCount); - Assert.IsNull(importer.ReferenceType); - } - - public class OptionalImport - { - public int ValueTypeSetCount; - public int NullableValueTypeSetCount; - public int ReferenceTypeSetCount; - - private int _valueType; - private int? _nullableValueType; - private string _referenceType; - - [Import("ValueType", AllowDefault = true, AllowRecomposition = true)] - public int ValueType - { - get { return _valueType; } - set - { - ValueTypeSetCount++; - _valueType = value; - } - } - - [Import("NullableValueType", AllowDefault = true, AllowRecomposition = true)] - public int? NullableValueType - { - get { return _nullableValueType; } - set - { - NullableValueTypeSetCount++; - _nullableValueType = value; - } - } - - [Import("ReferenceType", AllowDefault = true, AllowRecomposition = true)] - public string ReferenceType - { - get { return _referenceType; } - set - { - ReferenceTypeSetCount++; - _referenceType = value; - } - } - } - - public class OptionalExport - { - public int ValueTypeSetCount; - public int NullableValueTypeSetCount; - public int ReferenceTypeSetCount; - - private Lazy _valueType; - private Lazy _nullableValueType; - private Lazy _referenceType; - - [Import("ValueType", AllowDefault = true, AllowRecomposition = true)] - public Lazy ValueType - { - get { return _valueType; } - set - { - ValueTypeSetCount++; - _valueType = value; - } - } - - [Import("NullableValueType", AllowDefault = true, AllowRecomposition = true)] - public Lazy NullableValueType - { - get { return _nullableValueType; } - set - { - NullableValueTypeSetCount++; - _nullableValueType = value; - } - } - - [Import("ReferenceType", AllowDefault = true, AllowRecomposition = true)] - public Lazy ReferenceType - { - get { return _referenceType; } - set - { - ReferenceTypeSetCount++; - _referenceType = value; - } - } - } - - private class DelayDuckImporter - { - [Import("Duck")] - public Lazy Duck - { - get; - set; - } - } - - private class DuckImporter - { - [Import("Duck")] - public IDuck Duck - { - get; - set; - } - } - - public class QuackLikeADuck - { - public virtual string Quack() - { - return "Quack"; - } - } - - public interface IDuck - { - string Quack(); - } - - #if !SILVERLIGHT - - [ComImport] - [Guid("148BD52A-A2AB-11CE-B11F-00AA00530503")] - private class CTaskScheduler - { // This interface doesn't implement - // ITaskScheduler deliberately - } - - [Guid("148BD527-A2AB-11CE-B11F-00AA00530503")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - private interface ITaskScheduler - { - void FakeMethod(); - } - - private class ImportComComponent - { - [Import("TaskScheduler")] - public ITaskScheduler TaskScheduler - { - get; - set; - } - } - - private class DelayImportComComponent - { - [Import("TaskScheduler")] - public Lazy TaskScheduler - { - get; - set; - } - } - -#endif - - public class Importer - { - public Importer() - { - } - - [Import("Value")] - public int ValueReadWrite { get; set; } - - [ImportMany("Value")] - public IList SingleValueCollectionReadWrite { get; set; } - - [Import("EmptyValue", AllowDefault = true)] - public int ValueEmptyOptional { get; set; } - - [ImportMany("CollectionValue", typeof(IList))] - public IList ValueCollection { get; set; } - - } - - public class ImporterNameless - { - - public ImporterNameless() - { - } - - [Import] - public int ValueReadWrite { get; set; } - - [Import] - public Lazy MetadataReadWrite { get; set; } - - } - - public class ImporterInvalidWrongType - { - [Import("Value")] - public DateTime ValueReadWrite { get; set; } - } - - [Export] - public class ImporterInvalidSetterException - { - [ImportMany("Value")] - public IEnumerable ValueReadWrite { get { return null; } set { throw new InvalidOperationException(); } } - } - - [Export] - public class ImportImporterInvalidSetterExceptionLazily - { - [Import] - public Lazy Value { get; set; } - } - - - [PartNotDiscoverable] - public class Exporter - { - List collectionValue = new List(); - - public Exporter(int value) - { - Value = value; - } - - [Export("Value")] - public int Value { get; set; } - - - [Export("CollectionValue")] - public IList CollectionValue { get { return collectionValue; } } - - } - - public class ExporterNameless - { - - public ExporterNameless(int value) - { - Value = value; - } - - [Export] - public int Value { get; set; } - - } - - public class ExportsString - { - [Export] - public string ExportedString = "Test"; - } - - public class ExportsInvalidListOfExportOfString - { - [Export(typeof(List>))] - public string ExportedString = "Test"; - } - - public class ExportsValidListOfExportOfString - { - [Export(typeof(List>))] - public List> ExportedString = new List>(); - } - - [Export] - public class ImportsListOfExportOfString - { - [Import(AllowDefault = true)] - public List> ExportedList { get; set; } - } - - [TestMethod] - public void ImportListOfExportWithOnlySingleElementsAvailable_ShouldNotFindExport() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(ExportsString), typeof(ImportsListOfExportOfString)); - var importer = container.GetExportedValue(); - Assert.IsNull(importer.ExportedList); - - var part = AttributedModelServices.CreatePartDefinition(typeof(ImportsListOfExportOfString), null); - var contract = AttributedModelServices.GetContractName(typeof(List>)); - Assert.AreEqual(contract, ((ContractBasedImportDefinition)part.ImportDefinitions.First()).ContractName); - } - - [TestMethod] - public void ImportListOfExportWithInvalidCollectionAvailable_ShouldThrowMismatch() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(ExportsInvalidListOfExportOfString), typeof(ImportsListOfExportOfString)); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - container.GetExportedValue()); - } - - [TestMethod] - public void ImportListOfExportWithValidCollectionAvailable_ShouldSatisfyImport() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(ExportsValidListOfExportOfString), typeof(ImportsListOfExportOfString)); - var importer = container.GetExportedValue(); - Assert.AreEqual(0, importer.ExportedList.Count); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerTests.cs deleted file mode 100644 index ac10766e048..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionContainerTests.cs +++ /dev/null @@ -1,2998 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Linq; -using System.Linq.Expressions; -using System.Runtime.Serialization; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.UnitTesting; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionContainerTests - { - [TestMethod] - public void Constructor2_ArrayWithNullElementAsProvidersArgument_ShouldThrowArgumentException() - { - ExceptionAssert.ThrowsArgument("providers", () => - { - new CompositionContainer(new ExportProvider[] { null }); - }); - } - - [TestMethod] - public void Constructor3_ArrayWithNullElementAsProvidersArgument_ShouldThrowArgumentException() - { - var catalog = CatalogFactory.Create(); - - ExceptionAssert.ThrowsArgument("providers", () => - { - new CompositionContainer(catalog, new ExportProvider[] { null }); - }); - } - - [TestMethod] - public void Constructor2_ArrayAsProvidersArgument_ShouldNotAllowModificationAfterConstruction() - { - var providers = new ExportProvider[] { ExportProviderFactory.Create() }; - var container = new CompositionContainer(providers); - - providers[0] = null; - - Assert.IsNotNull(container.Providers[0]); - } - - [TestMethod] - public void Constructor3_ArrayAsProvidersArgument_ShouldNotAllowModificationAfterConstruction() - { - var providers = new ExportProvider[] { ExportProviderFactory.Create() }; - var container = new CompositionContainer(CatalogFactory.Create(), providers); - - providers[0] = null; - - Assert.IsNotNull(container.Providers[0]); - } - - [TestMethod] - public void Constructor1_ShouldSetProvidersPropertyToEmptyCollection() - { - var container = new CompositionContainer(); - - EnumerableAssert.IsEmpty(container.Providers); - } - - [TestMethod] - public void Constructor2_EmptyArrayAsProvidersArgument_ShouldSetProvidersPropertyToEmpty() - { - var container = new CompositionContainer(new ExportProvider[0]); - - EnumerableAssert.IsEmpty(container.Providers); - } - - [TestMethod] - public void Constructor3_EmptyArrayAsProvidersArgument_ShouldSetProvidersPropertyToEmpty() - { - var container = new CompositionContainer(CatalogFactory.Create(), new ExportProvider[0]); - - EnumerableAssert.IsEmpty(container.Providers); - } - - [TestMethod] - public void Constructor1_ShouldSetCatalogPropertyToNull() - { - var container = new CompositionContainer(); - - Assert.IsNull(container.Catalog); - } - - [TestMethod] - public void Constructor2_ShouldSetCatalogPropertyToNull() - { - var container = new CompositionContainer(new ExportProvider[0]); - - Assert.IsNull(container.Catalog); - } - - [TestMethod] - public void Constructor3_NullAsCatalogArgument_ShouldSetCatalogPropertyToNull() - { - var container = new CompositionContainer((ComposablePartCatalog)null, new ExportProvider[0]); - - Assert.IsNull(container.Catalog); - } - - [TestMethod] - public void Constructor3_ValueAsCatalogArgument_ShouldSetCatalogProperty() - { - var expectations = Expectations.GetCatalogs(); - - foreach (var e in expectations) - { - var container = new CompositionContainer(e, new ExportProvider[0]); - - Assert.AreSame(e, container.Catalog); - } - } - - [TestMethod] - public void Catalog_WhenDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - var catalog = container.Catalog; - }); - } - - [TestMethod] - public void Providers_WhenDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - var providers = container.Providers; - }); - } - - [TestMethod] - [Ignore] - [WorkItem(579990)] // NullReferenceException - public void ExportsChanged_Add_WhenDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.ExportsChanged += (o, s) => { }; - }); - } - - [TestMethod] - [Ignore] - [WorkItem(579990)] // NullReferenceException - public void ExportsChanged_Remove_WhenDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.ExportsChanged -= (o, s) => { }; - }); - } - - [TestMethod] - public void AddPart1_ImportOnlyPart_ShouldNotGetGarbageCollected() - { - var container = CreateCompositionContainer(); - - var import = PartFactory.CreateImporter("Value", ImportCardinality.ZeroOrMore); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(import); - container.Compose(batch); - - var weakRef = new WeakReference(import); - import = null; - - GC.Collect(); - GC.WaitForPendingFinalizers(); - - Assert.IsNotNull(weakRef.Target, "Import only part should not have been collected!"); - - GC.KeepAlive(container); - } - - [TestMethod] - public void Compose_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - CompositionBatch batch = new CompositionBatch(); - ExceptionAssert.ThrowsDisposed(container, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void GetExportOfT1_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExport(); - }); - } - - [TestMethod] - public void GetExportOfT2_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExport("Contract"); - }); - } - - [TestMethod] - public void GetExportOfTTMetadataView1_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExport(); - }); - } - - [TestMethod] - public void GetExportOfTTMetadataView2_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExport("Contract"); - }); - } - - [TestMethod] - public void GetExports1_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - var definition = ImportDefinitionFactory.Create(); - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExports(definition); - }); - } - - [TestMethod] - public void GetExports2_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExports(typeof(string), typeof(object), "Contract"); - }); - } - - [TestMethod] - public void GetExportsOfT1_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExports(); - }); - } - - [TestMethod] - public void GetExportsOfT2_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExports("Contract"); - }); - } - - [TestMethod] - public void GetExportsOfTTMetadataView1_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExports(); - }); - } - - [TestMethod] - public void GetExportsOfTTMetadataView2_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExports("Contract"); - }); - } - - [TestMethod] - public void GetExportedValueOfT1_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExportedValue(); - }); - } - - - [TestMethod] - public void GetExportedValueOfT2_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExportedValue("Contract"); - }); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT1_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExportedValueOrDefault(); - }); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT2_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExportedValueOrDefault("Contract"); - }); - } - - [TestMethod] - public void GetExportedValuesOfT1_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExportedValues(); - }); - } - - [TestMethod] - public void GetExportedValuesOfT2_WhenContainerDisposed_ShouldThrowObjectDisposed() - { - var container = CreateCompositionContainer(); - container.Dispose(); - - ExceptionAssert.ThrowsDisposed(container, () => - { - container.GetExportedValues("Contract"); - }); - } - - [TestMethod] - public void GetExports1_NullAsImportDefinitionArgument_ShouldThrowArgumentNull() - { - var container = CreateCompositionContainer(); - - ExceptionAssert.ThrowsArgument("definition", () => - { - container.GetExports((ImportDefinition)null); - }); - } - - [TestMethod] - public void GetExports2_NullAsTypeArgument_ShouldThrowArgumentNull() - { - var container = CreateCompositionContainer(); - - ExceptionAssert.ThrowsArgument("type", () => - { - container.GetExports((Type)null, typeof(string), "ContractName"); - }); - } - - [TestMethod] - public void GetExportOfT1_AskingForContractThatDoesNotExist_ShouldThrowCardinalityMismatch() - { - var container = CreateCompositionContainer(); - - ExceptionAssert.Throws(() => - { - container.GetExport(); - }); - } - - [TestMethod] - public void GetExportOfT2_AskingForContractThatDoesNotExist_ShouldThrowCardinalityMismatch() - { - var container = CreateCompositionContainer(); - - ExceptionAssert.Throws(() => - { - container.GetExport("Contract"); - }); - } - - [TestMethod] - public void GetExportOfTTMetadataView1_AskingForContractThatDoesNotExist_ShouldThrowCardinalityMismatch() - { - var container = CreateCompositionContainer(); - - ExceptionAssert.Throws(() => - { - container.GetExport(); - }); - } - - [TestMethod] - public void GetExportOfTTMetadataView2_AskingForContractThatDoesNotExist_ShouldThrowCardinalityMismatch() - { - var container = CreateCompositionContainer(); - - ExceptionAssert.Throws(() => - { - container.GetExport("Contract"); - }); - } - - [TestMethod] - public void GetExports1_DefinitionAskingForExactlyOneContractThatDoesNotExist_ShouldThrowCardinalityMismatch() - { - var container = CreateCompositionContainer(); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ExactlyOne); - - ExceptionAssert.Throws(() => - { - container.GetExports(definition); - }); - } - - [TestMethod] - public void GetExports1_DefinitionAskingForExactlyZeroOrOneContractThatDoesNotExist_ShouldReturnEmpty() - { - var container = CreateCompositionContainer(); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ZeroOrOne); - - var exports = container.GetExports(definition); - - EnumerableAssert.IsEmpty(exports); - } - - [TestMethod] - public void GetExports1_DefinitionAskingForExactlyZeroOrMoreContractThatDoesNotExist_ShouldReturnEmpty() - { - var container = CreateCompositionContainer(); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ZeroOrMore); - - var exports = container.GetExports(definition); - - EnumerableAssert.IsEmpty(exports); - } - - [TestMethod] - public void GetExports2_AskingForContractThatDoesNotExist_ShouldReturnNoExports() - { - var container = CreateCompositionContainer(); - - var exports = container.GetExports(typeof(string), (Type)null, "Contract"); - - EnumerableAssert.IsEmpty(exports); - } - - [TestMethod] - public void GetExportsOfT1_AskingForContractThatDoesNotExist_ShouldReturnEmpty() - { - var container = CreateCompositionContainer(); - - var exports = container.GetExports(); - - EnumerableAssert.IsEmpty(exports); - } - - [TestMethod] - public void GetExportsOfT2_AskingForContractThatDoesNotExist_ShouldReturnEmpty() - { - var container = CreateCompositionContainer(); - - var exports = container.GetExports("Contract"); - - EnumerableAssert.IsEmpty(exports); - } - - [TestMethod] - public void GetExportsOfTTMetadataView1_AskingForContractThatDoesNotExist_ShouldReturnEmpty() - { - var container = CreateCompositionContainer(); - - var exports = container.GetExports(); - - EnumerableAssert.IsEmpty(exports); - } - - [TestMethod] - public void GetExportsOfTTMetadataView2_AskingForContractThatDoesNotExist_ShouldReturnEmpty() - { - var container = CreateCompositionContainer(); - - var exports = container.GetExports("Contract"); - - EnumerableAssert.IsEmpty(exports); - } - - [TestMethod] - public void GetExportedValueOfT1_AskingForContractThatDoesNotExist_ShouldThrowCardinalityMismatch() - { - var container = CreateCompositionContainer(); - - ExceptionAssert.Throws(() => - { - container.GetExportedValue(); - }); - } - - [TestMethod] - public void GetExportedValueOfT2_AskingForContractThatDoesNotExist_ShouldThrowCardinalityMismatch() - { - var container = CreateCompositionContainer(); - - ExceptionAssert.Throws(() => - { - container.GetExportedValue("Contract"); - }); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT1_AskingForStringContractThatDoesNotExist_ShouldReturnNull() - { - var container = CreateCompositionContainer(); - - var exportedValue = container.GetExportedValueOrDefault(); - - Assert.IsNull(exportedValue); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT2_AskingForStringContractThatDoesNotExist_ShouldReturnNull() - { - var container = CreateCompositionContainer(); - - var exportedValue = container.GetExportedValueOrDefault("Contract"); - - Assert.IsNull(exportedValue); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT1_AskingForInt32ContractThatDoesNotExist_ShouldReturnZero() - { - var container = CreateCompositionContainer(); - - var exportedValue = container.GetExportedValueOrDefault(); - - Assert.AreEqual(0, exportedValue); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT2_AskingForInt32ContractThatDoesNotExist_ShouldReturnZero() - { - var container = CreateCompositionContainer(); - - var exportedValue = container.GetExportedValueOrDefault("Contract"); - - Assert.AreEqual(0, exportedValue); - } - - [TestMethod] - public void GetExportedValuesOfT1_AskingForContractThatDoesNotExist_ShouldReturnEmpty() - { - var container = CreateCompositionContainer(); - - var exports = container.GetExportedValues(); - - EnumerableAssert.IsEmpty(exports); - } - - [TestMethod] - public void GetExportedValuesOfT2_AskingForContractThatDoesNotExist_ShouldReturnEmpty() - { - var container = CreateCompositionContainer(); - - var exports = container.GetExports("Contract"); - - EnumerableAssert.IsEmpty(exports); - } - - [TestMethod] - public void GetExportOfT1_AskingForContractWithOneExport_ShouldReturnExport() - { - var container = ContainerFactory.Create(new MicroExport(ContractFromType(typeof(String)), "Value")); - - var export = container.GetExport(); - - Assert.AreEqual("Value", export.Value); - } - - [TestMethod] - public void GetExportOfT2_AskingForContractWithOneExport_ShouldReturnExport() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value")); - - var export = container.GetExport("Contract"); - - Assert.AreEqual("Value", export.Value); - } - - [TestMethod] - public void GetExportOfTTMetadataView1_AskingForContractWithOneExport_ShouldReturnExport() - { - var container = ContainerFactory.Create(new MicroExport(ContractFromType(typeof(String)), "Value")); - - var export = container.GetExport(); - - Assert.AreEqual("Value", export.Value); - } - - [TestMethod] - public void GetExportOfTTMetadataView2_AskingForContractWithOneExport_ShouldReturnExport() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value")); - - var export = container.GetExport("Contract"); - - Assert.AreEqual("Value", export.Value); - } - - [TestMethod] - public void GetExports1_AskingForExactlyOneContractWithOneExport_ShouldReturnExport() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value")); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ExactlyOne); - - var exports = container.GetExports(definition); - - ExportsAssert.AreEqual(exports, "Value"); - } - - [TestMethod] - public void GetExports1_AskingForZeroOrOneContractWithOneExport_ShouldReturnExport() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value")); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ZeroOrOne); - - var exports = container.GetExports(definition); - - ExportsAssert.AreEqual(exports, "Value"); - } - - [TestMethod] - public void GetExports1_AskingForZeroOrMoreContractWithOneExport_ShouldReturnExport() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value")); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ZeroOrMore); - - var exports = container.GetExports(definition); - - ExportsAssert.AreEqual(exports, "Value"); - } - - [TestMethod] - public void GetExports2_AskingForContractWithOneExport_ShouldReturnOneExport() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value")); - - var exports = container.GetExports(typeof(string), (Type)null, "Contract"); - - ExportsAssert.AreEqual(exports, "Value"); - } - - [TestMethod] - public void GetExportsOfT1_AskingForContractWithOneExport_ShouldReturnOneExport() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), "Value")); - - var exports = container.GetExports(); - - ExportsAssert.AreEqual(exports, "Value"); - } - - [TestMethod] - public void GetExportsOfT2_AskingForContractWithOneExport_ShouldReturnOneExport() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value")); - - var exports = container.GetExports("Contract"); - - ExportsAssert.AreEqual(exports, "Value"); - } - - [TestMethod] - public void GetExportsOfTTMetadataView1_AskingForContractWithOneExport_ShouldReturnOneExport() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), "Value")); - - var exports = container.GetExports(); - - ExportsAssert.AreEqual(exports, "Value"); - } - - [TestMethod] - public void GetExportsOfTTMetadataView2_AskingForContractWithOneExport_ShouldReturnOneExport() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value")); - - var exports = container.GetExports("Contract"); - - ExportsAssert.AreEqual(exports, "Value"); - } - - [TestMethod] - public void GetExportedValueOfT1_AskingForContractWithOneExport_ShouldReturnExport() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), "Value")); - - var exportedValue = container.GetExportedValue(); - - Assert.AreEqual("Value", exportedValue); - } - - [TestMethod] - public void GetExportedValueOfT2_AskingForContractWithOneExport_ShouldReturnExport() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value")); - - var exportedValue = container.GetExportedValue("Contract"); - - Assert.AreEqual("Value", exportedValue); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT1_AskingForContractWithOneExport_ShouldReturnExport() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), "Value")); - - var exportedValue = container.GetExportedValueOrDefault(); - - Assert.AreEqual("Value", exportedValue); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT2_AskingForContractWithOneExport_ShouldReturnExport() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value")); - - var exportedValue = container.GetExportedValueOrDefault("Contract"); - - Assert.AreEqual("Value", exportedValue); - } - - [TestMethod] - public void GetExportedValuesOfT1_AskingForContractWithOneExport_ShouldReturnOneExport() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), "Value")); - - var exportedValues = container.GetExportedValues(); - - EnumerableAssert.AreEqual(exportedValues, "Value"); - } - - [TestMethod] - public void GetExportedValuesOfT2_AskingForContractWithOneExport_ShouldReturnOneExport() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value")); - - var exportedValues = container.GetExportedValues("Contract"); - - EnumerableAssert.AreEqual(exportedValues, "Value"); - } - - [TestMethod] - public void GetExportOfT1_AskingForContractWithMultipleExports_ShouldThrowCardinalityMismatch() - { - var container = ContainerFactory.Create(new MicroExport(ContractFromType(typeof(String)), "Value1", "Value2")); - - ExceptionAssert.Throws(() => - { - container.GetExport(); - }); - } - - [TestMethod] - public void GetExportOfT2_AskingForContractWithMultipleExports_ShouldThrowCardinalityMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value1", "Value2")); - - ExceptionAssert.Throws(() => - { - container.GetExport("Contract"); - }); - } - - [TestMethod] - public void GetExportOfTTMetadataView1_AskingForContractWithMultipleExports_ShouldThrowCardinalityMismatch() - { - var container = ContainerFactory.Create(new MicroExport(ContractFromType(typeof(String)), "Value1", "Value2")); - - ExceptionAssert.Throws(() => - { - container.GetExport(); - }); - } - - [TestMethod] - public void GetExportOfTTMetadataView2_AskingForContractWithMultipleExports_ShouldThrowCardinalityMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value1", "Value2")); - - ExceptionAssert.Throws(() => - { - container.GetExport("Contract"); - }); - } - - [TestMethod] - public void GetExports1_AskingForExactlyOneContractWithMultipleExports_ShouldThrowCardinalityMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value1", "Value2")); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ExactlyOne); - - ExceptionAssert.Throws(() => - { - container.GetExports(definition); - }); - } - - [TestMethod] - public void GetExports1_AskingForZeroOrOneContractWithMultipleExports_ShouldReturnZero() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value1", "Value2")); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ZeroOrOne); - - Assert.AreEqual(0, container.GetExports(definition).Count()); - } - - [TestMethod] - public void GetExports1_AskingForZeroOrMoreContractWithMultipleExports_ShouldReturnMultipleExports() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value1", "Value2")); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ZeroOrMore); - - var exports = container.GetExports(definition); - - ExportsAssert.AreEqual(exports, "Value1", "Value2"); - } - - [TestMethod] - public void GetExports2_AskingForContractWithMultipleExports_ShouldReturnMultipleExports() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value1", "Value2")); - - var exports = container.GetExports(typeof(string), (Type)null, "Contract"); - - ExportsAssert.AreEqual(exports, "Value1", "Value2"); - } - - [TestMethod] - public void GetExportsOfT1_AskingForContractWithMultipleExports_ShouldReturnMultipleExports() - { - var container = ContainerFactory.Create(new MicroExport(typeof(String), "Value1", "Value2")); - - var exports = container.GetExports(); - - ExportsAssert.AreEqual(exports, "Value1", "Value2"); - } - - [TestMethod] - public void GetExportsOfT2_AskingForContractWithMultipleExports_ShouldReturnMultipleExports() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value1", "Value2")); - - var exports = container.GetExports("Contract"); - - ExportsAssert.AreEqual(exports, "Value1", "Value2"); - } - - [TestMethod] - public void GetExportsOfTTMetadataView1_AskingForContractWithMultipleExports_ShouldReturnMultipleExports() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), "Value1", "Value2")); - - var exports = container.GetExports(); - - ExportsAssert.AreEqual(exports, "Value1", "Value2"); - } - - [TestMethod] - public void GetExportsOfTTMetadataView2_AskingForContractWithMultipleExports_ShouldReturnMultipleExports() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value1", "Value2")); - - var exports = container.GetExports("Contract"); - - ExportsAssert.AreEqual(exports, "Value1", "Value2"); - } - - [TestMethod] - public void GetExportedValueOfT1_AskingForContractWithMultipleExports_ShouldThrowCardinalityMismatch() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), "Value1", "Value2")); - - ExceptionAssert.Throws(() => - { - container.GetExportedValue(); - }); - } - - [TestMethod] - public void GetExportedValueOfT2_AskingForContractWithMultipleExports_ShouldThrowCardinalityMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value1", "Value2")); - - ExceptionAssert.Throws(() => - { - container.GetExportedValue("Contract"); - }); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT1_AskingForContractWithMultipleExports_ShouldReturnZero() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), "Value1", "Value2")); - - Assert.IsNull(container.GetExportedValueOrDefault()); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT2_AskingForContractWithMultipleExports_ShouldReturnZero() - { - var container = ContainerFactory.Create(new MicroExport("Contract", "Value1", "Value2")); - - Assert.IsNull(container.GetExportedValueOrDefault("Contract")); - } - - [TestMethod] - public void GetExportedValuesOfT1_AskingForContractWithMultipleExports_ShouldReturnMultipleExports() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), "Value1", "Value2")); - - var exportedValues = container.GetExportedValues(); - - EnumerableAssert.AreEqual(exportedValues, "Value1", "Value2"); - } - - [TestMethod] - public void GetExportedValuesOfT2_AskingForContractWithMultipleExports_ShouldReturnMultipleExports() - { - var container = ContainerFactory.Create(new MicroExport("Contract", typeof(string), "Value1", "Value2")); - - var exportedValues = container.GetExportedValues("Contract"); - - EnumerableAssert.AreEqual(exportedValues, "Value1", "Value2"); - } - - [TestMethod] - public void GetExports1_AskingForExactlyOneAndAll_ShouldThrowCardinalityMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract1", "Value1", "Value2", "Value3"), - new MicroExport("Contract2", "Value4", "Value5", "Value6")); - - var definition = ImportDefinitionFactory.Create(import => true, ImportCardinality.ExactlyOne); - - ExceptionAssert.Throws(() => - { - container.GetExports(definition); - }); - } - - [TestMethod] - public void GetExports1_AskingForZeroOrOneAndAll_ShouldReturnZero() - { - var container = ContainerFactory.Create(new MicroExport("Contract1", "Value1", "Value2", "Value3"), - new MicroExport("Contract2", "Value4", "Value5", "Value6")); - - var definition = ImportDefinitionFactory.Create(import => true, ImportCardinality.ZeroOrOne); - - Assert.AreEqual(0, container.GetExports(definition).Count()); - } - - [TestMethod] - public void GetExports1_AskingForZeroOrMoreAndAll_ShouldReturnAll() - { - var container = ContainerFactory.Create(new MicroExport("Contract1", "Value1", "Value2", "Value3"), - new MicroExport("Contract2", "Value4", "Value5", "Value6")); - - var definition = ImportDefinitionFactory.Create(import => true, ImportCardinality.ZeroOrMore); - - var exports = container.GetExports(definition); - - ExportsAssert.AreEqual(exports, "Value1", "Value2", "Value3", - "Value4", "Value5", "Value6"); - } - - [TestMethod] - public void GetExportOfT1_StringAsTTypeArgumentAskingForContractWithOneObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), new object())); - - var export = container.GetExport(); - - ExceptionAssert.Throws(() => - { - var value = export.Value; - }); - } - - [TestMethod] - public void GetExportOfT2_StringAsTTypeArgumentAskingForContractWithOneObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", typeof(string), new object())); - - var export = container.GetExport("Contract"); - - ExceptionAssert.Throws(() => - { - var value = export.Value; - }); - } - - [TestMethod] - public void GetExportOfTTMetadataView1_StringAsTTypeArgumentAskingForContractWithOneObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), new object())); - - var export = container.GetExport(); - - ExceptionAssert.Throws(() => - { - var value = export.Value; - }); - } - - [TestMethod] - public void GetExportOfTTMetadataView2_StringAsTTypeArgumentAskingForContractWithOneObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", typeof(string), new object())); - - var export = container.GetExport("Contract"); - - ExceptionAssert.Throws(() => - { - var value = export.Value; - }); - } - - [TestMethod] - public void GetExports2_StringAsTTypeArgumentAskingForContractWithOneObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", typeof(string), new object())); - - var exports = container.GetExports(typeof(string), (Type)null, "Contract"); - - Assert.AreEqual(1, exports.Count()); - - var export = exports.ElementAt(0); - - ExceptionAssert.Throws(() => - { - var value = export.Value; - }); - } - - [TestMethod] - public void GetExportsOfT1_StringAsTTypeArgumentAskingForContractWithOneObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), new object())); - - var exports = container.GetExports(); - - Assert.AreEqual(1, exports.Count()); - - var export = exports.ElementAt(0); - - ExceptionAssert.Throws(() => - { - var value = export.Value; - }); - } - - [TestMethod] - public void GetExportsOfT2_StringAsTTypeArgumentAskingForContractWithOneObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", typeof(string), new object())); - - var exports = container.GetExports("Contract"); - - Assert.AreEqual(1, exports.Count()); - - var export = exports.ElementAt(0); - - ExceptionAssert.Throws(() => - { - var value = export.Value; - }); - } - - [TestMethod] - public void GetExportsOfTTMetadataView1_StringAsTTypeArgumentAskingForContractWithOneObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), new object())); - - var exports = container.GetExports(); - - Assert.AreEqual(1, exports.Count()); - - var export = exports.ElementAt(0); - - ExceptionAssert.Throws(() => - { - var value = export.Value; - }); - } - - [TestMethod] - public void GetExportsOfTTMetadataView2_StringAsTTypeArgumentAskingForContractWithOneObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", typeof(string), new object())); - - var exports = container.GetExports("Contract"); - - Assert.AreEqual(1, exports.Count()); - - var export = exports.ElementAt(0); - - ExceptionAssert.Throws(() => - { - var value = export.Value; - }); - } - - [TestMethod] - public void GetExportedValueOfT1_StringAsTTypeArgumentAskingForContractWithObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), new object())); - - ExceptionAssert.Throws(() => - { - container.GetExportedValue(); - }); - } - - [TestMethod] - public void GetExportedValueOfT2_StringAsTTypeArgumentAskingForContractWithObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", typeof(string), new object())); - - ExceptionAssert.Throws(() => - { - container.GetExportedValue("Contract"); - }); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT1_StringAsTTypeArgumentAskingForContractWithObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), new object())); - - ExceptionAssert.Throws(() => - { - container.GetExportedValueOrDefault(); - }); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT2_StringAsTTypeArgumentAskingForContractWithObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", typeof(string), new object())); - - ExceptionAssert.Throws(() => - { - container.GetExportedValueOrDefault("Contract"); - }); - } - - [TestMethod] - public void GetExportedValuesOfT1_StringAsTTypeArgumentAskingForContractWithOneObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport(typeof(string), new object())); - - ExceptionAssert.Throws(() => - { - container.GetExportedValues(); - }); - } - - [TestMethod] - public void GetExportedValuesOfT2_StringAsTTypeArgumentAskingForContractWithOneObjectExport_ShouldThrowContractMismatch() - { - var container = ContainerFactory.Create(new MicroExport("Contract", typeof(string), new object())); - - ExceptionAssert.Throws(() => - { - container.GetExportedValues("Contract"); - }); - } - - - [TestMethod] - public void GetExportOfT1_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent); - - var export = child.GetExport(); - - Assert.AreEqual("Parent", export.Value); - } - - [TestMethod] - public void GetExportOfT2_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent); - - var export = child.GetExport("Contract"); - - Assert.AreEqual("Parent", export.Value); - } - - [TestMethod] - public void GetExportOfTTMetadataView1_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent); - - var export = child.GetExport(); - - Assert.AreEqual("Parent", export.Value); - } - - [TestMethod] - public void GetExportOfTTMetadataView2_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent); - - var export = child.GetExport("Contract"); - - Assert.AreEqual("Parent", export.Value); - } - - [TestMethod] - public void GetExports1_AskingForExactlyOneContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ExactlyOne); - - var exports = child.GetExports(definition); - - ExportsAssert.AreEqual(exports, "Parent"); - } - - [TestMethod] - public void GetExports1_AskingForZeroOrOneContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ZeroOrOne); - - var exports = child.GetExports(definition); - - ExportsAssert.AreEqual(exports, "Parent"); - } - - [TestMethod] - public void GetExports1_AskingForZeroOrMoreContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ZeroOrMore); - - var exports = child.GetExports(definition); - - ExportsAssert.AreEqual(exports, "Parent"); - } - - [TestMethod] - public void GetExports2_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent); - - var exports = child.GetExports(typeof(string), (Type)null, "Contract"); - - ExportsAssert.AreEqual(exports, "Parent"); - } - - [TestMethod] - public void GetExportsOfT1_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent); - - var exports = child.GetExports(); - - ExportsAssert.AreEqual(exports, "Parent"); - } - - [TestMethod] - public void GetExportsOfT2_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent); - - var exports = child.GetExports("Contract"); - - ExportsAssert.AreEqual(exports, "Parent"); - } - - [TestMethod] - public void GetExportsOfTTMetadataView1_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent); - - var exports = child.GetExports(); - - ExportsAssert.AreEqual(exports, "Parent"); - } - - [TestMethod] - public void GetExportsOfTTMetadataView2_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent); - - var exports = child.GetExports("Contract"); - - ExportsAssert.AreEqual(exports, "Parent"); - } - - [TestMethod] - public void GetExportedValueOfT1_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent); - - var exportedValue = child.GetExportedValue(); - - Assert.AreEqual("Parent", exportedValue); - } - - [TestMethod] - public void GetExportedValueOfT2_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent); - - var exportedValue = child.GetExportedValue("Contract"); - - Assert.AreEqual("Parent", exportedValue); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT1_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent); - - var exportedValue = child.GetExportedValueOrDefault(); - - Assert.AreEqual("Parent", exportedValue); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT2_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent); - - var exportedValue = child.GetExportedValueOrDefault("Contract"); - - Assert.AreEqual("Parent", exportedValue); - } - - [TestMethod] - public void GetExportedValuesOfT1_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent); - - var exportedValues = child.GetExportedValues(); - - EnumerableAssert.AreEqual(exportedValues, "Parent"); - } - - [TestMethod] - public void GetExportedValuesOfT2_AskingForContractFromChildWithExportInParentContainer_ShouldReturnExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent); - - var exportedValues = child.GetExportedValues("Contract"); - - EnumerableAssert.AreEqual(exportedValues, "Parent"); - } - - [TestMethod] - public void GetExportOfT1_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnChildExport() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport(typeof(string), "Child")); - - var export = child.GetExport(); - - Assert.AreEqual("Child", export.Value); - } - - [TestMethod] - public void GetExportOfT2_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnChildExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport("Contract", "Child")); - - var export = child.GetExport("Contract"); - - Assert.AreEqual("Child", export.Value); - } - - [TestMethod] - public void GetExportOfTTMetadataView1_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnChildExport() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport(typeof(string), "Child")); - - var export = child.GetExport(); - - Assert.AreEqual("Child", export.Value); - } - - [TestMethod] - public void GetExportOfTTMetadataView2_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnChildExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport("Contract", "Child")); - - var export = child.GetExport("Contract"); - - Assert.AreEqual("Child", export.Value); - } - - [TestMethod] - public void GetExports1_AskingForExactlyOneContractWithExportInBothParentAndChildContainers_ShouldReturnChildExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport("Contract", "Child")); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ExactlyOne); - - var exports = child.GetExports(definition); - - ExportsAssert.AreEqual(exports, "Child"); - } - - [TestMethod] - public void GetExports1_AskingForZeroOrOneContractWithExportInBothParentAndChildContainers_ShouldReturnChildExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport("Contract", "Child")); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ZeroOrOne); - - var exports = child.GetExports(definition); - - ExportsAssert.AreEqual(exports, "Child"); - } - - [TestMethod] - public void GetExports1_AskingForZeroOrMoreContractWithExportInBothParentAndChildContainers_ShouldReturnBothExports() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport("Contract", "Child")); - - var definition = ImportDefinitionFactory.Create("Contract", ImportCardinality.ZeroOrMore); - - var exports = child.GetExports(definition); - - ExportsAssert.AreEqual(exports, "Child", "Parent"); - } - - [TestMethod] - public void GetExports2_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnBothExports() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport("Contract", "Child")); - - var exports = child.GetExports(typeof(string), (Type)null, "Contract"); - - ExportsAssert.AreEqual(exports, "Child", "Parent"); - } - - [TestMethod] - public void GetExportsOfT1_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnBothExports() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport(typeof(string), "Child")); - - var exports = child.GetExports(); - - ExportsAssert.AreEqual(exports, "Child", "Parent"); - } - - [TestMethod] - public void GetExportsOfT2_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnBothExports() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport("Contract", "Child")); - - var exports = child.GetExports("Contract"); - - ExportsAssert.AreEqual(exports, "Child", "Parent"); - } - - [TestMethod] - public void GetExportsOfTTMetadataView1_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnBothExports() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport(typeof(string), "Child")); - - - var exports = child.GetExports(); - - ExportsAssert.AreEqual(exports, "Child", "Parent"); - } - - [TestMethod] - public void GetExportsOfTTMetadataView2_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnBothExports() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport("Contract", "Child")); - - var exports = child.GetExports("Contract"); - - ExportsAssert.AreEqual(exports, "Child", "Parent"); - } - - [TestMethod] - public void GetExportedValueOfT1_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnChildExport() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport(typeof(string), "Child")); - - var exportedValue = child.GetExportedValue(); - - Assert.AreEqual("Child", exportedValue); - } - - [TestMethod] - public void GetExportedValueOfT2_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnChildExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport("Contract", "Child")); - - var exportedValue = child.GetExportedValue("Contract"); - - Assert.AreEqual("Child", exportedValue); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT1_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnChildExport() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport(typeof(string), "Child")); - - var exportedValue = child.GetExportedValueOrDefault(); - - Assert.AreEqual("Child", exportedValue); - } - - [TestMethod] - public void GetExportedValueOrDefaultOfT2_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnChildExport() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport("Contract", "Child")); - - var exportedValue = child.GetExportedValueOrDefault("Contract"); - - Assert.AreEqual("Child", exportedValue); - } - - [TestMethod] - public void GetExportedValuesOfT1_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnBothExports() - { - var parent = ContainerFactory.Create(new MicroExport(typeof(string), "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport(typeof(string), "Child")); - - var exportedValues = child.GetExportedValues(); - - EnumerableAssert.AreEqual(exportedValues, "Child", "Parent"); - } - - [TestMethod] - public void GetExportedValuesOfT2_AskingForContractWithExportInBothParentAndChildContainers_ShouldReturnBothExports() - { - var parent = ContainerFactory.Create(new MicroExport("Contract", "Parent")); - var child = ContainerFactory.Create(parent, new MicroExport("Contract", "Child")); - - var exportedValues = child.GetExportedValues("Contract"); - - EnumerableAssert.AreEqual(exportedValues, "Child", "Parent"); - } - - [TestMethod] - public void GetExportOfTTMetadataView1_TypeAsMetadataViewTypeArgument_IsUsedAsMetadataConstraint() - { - var metadata = new Dictionary(); - metadata.Add("Metadata1", "MetadataValue1"); - metadata.Add("Metadata2", "MetadataValue2"); - metadata.Add("Metadata3", "MetadataValue3"); - - var container = ContainerFactory.Create(new MicroExport("Another", metadata, "Value1"), - new MicroExport(typeof(string), metadata, "Value1"), - new MicroExport(typeof(string), "Value2")); - - var export = container.GetExport(); - var metadataExport = (Lazy)export; - - Assert.AreEqual("Value1", metadataExport.Value); - Assert.AreEqual("MetadataValue1", metadataExport.Metadata.Metadata1); - Assert.AreEqual("MetadataValue2", metadataExport.Metadata.Metadata2); - Assert.AreEqual("MetadataValue3", metadataExport.Metadata.Metadata3); - } - - [TestMethod] - public void GetExportOfTTMetadataView2_TypeAsMetadataViewTypeArgument_IsUsedAsMetadataConstraint() - { - var metadata = new Dictionary(); - metadata.Add("Metadata1", "MetadataValue1"); - metadata.Add("Metadata2", "MetadataValue2"); - metadata.Add("Metadata3", "MetadataValue3"); - - var container = ContainerFactory.Create(new MicroExport("Another", metadata, "Value1"), - new MicroExport("Contract", metadata, "Value1"), - new MicroExport("Contract", "Value2")); - - var export = container.GetExport("Contract"); - var metadataExport = (Lazy)export; - - Assert.AreEqual("Value1", metadataExport.Value); - Assert.AreEqual("MetadataValue1", metadataExport.Metadata.Metadata1); - Assert.AreEqual("MetadataValue2", metadataExport.Metadata.Metadata2); - Assert.AreEqual("MetadataValue3", metadataExport.Metadata.Metadata3); - } - - [TestMethod] - public void GetExports1_TypeAsMetadataViewTypeArgument_IsUsedAsMetadataConstraint() - { - var metadata = new Dictionary(); - metadata.Add("Metadata1", "MetadataValue1"); - metadata.Add("Metadata2", "MetadataValue2"); - metadata.Add("Metadata3", "MetadataValue3"); - - var container = ContainerFactory.Create(new MicroExport("Another", metadata, "Value1"), - new MicroExport("Contract", metadata, "Value1"), - new MicroExport("Contract", "Value2")); - - var definition = ImportDefinitionFactory.Create( - "Contract", - new Dictionary { { "Metadata1", typeof(object) }, { "Metadata2", typeof(object) }, { "Metadata3", typeof(object) } } - ); - - var exports = container.GetExports(definition); - - Assert.AreEqual(1, exports.Count()); - - var export = exports.First(); - - Assert.AreEqual("Value1", export.Value); - EnumerableAssert.AreEqual(metadata, export.Metadata); - } - - [TestMethod] - public void GetExports2_TypeAsMetadataViewTypeArgument_IsUsedAsMetadataConstraint() - { - var metadata = new Dictionary(); - metadata.Add("Metadata1", "MetadataValue1"); - metadata.Add("Metadata2", "MetadataValue2"); - metadata.Add("Metadata3", "MetadataValue3"); - - var container = ContainerFactory.Create(new MicroExport("Another", metadata, "Value1"), - new MicroExport("Contract", metadata, "Value1"), - new MicroExport("Contract", "Value2")); - - var exports = container.GetExports(typeof(string), typeof(IMetadataView), "Contract"); - - Assert.AreEqual(1, exports.Count()); - - var export = exports.First(); - IMetadataView exportMetadata = export.Metadata as IMetadataView; - - Assert.AreEqual("Value1", export.Value); - Assert.IsNotNull(exportMetadata); - - Assert.AreEqual("MetadataValue1", exportMetadata.Metadata1); - Assert.AreEqual("MetadataValue2", exportMetadata.Metadata2); - Assert.AreEqual("MetadataValue3", exportMetadata.Metadata3); - } - - [TestMethod] - public void GetExportsOfTTMetadataView1_TypeAsMetadataViewTypeArgument_IsUsedAsMetadataConstraint() - { - var metadata = new Dictionary(); - metadata.Add("Metadata1", "MetadataValue1"); - metadata.Add("Metadata2", "MetadataValue2"); - metadata.Add("Metadata3", "MetadataValue3"); - - var container = ContainerFactory.Create(new MicroExport("Another", metadata, "Value1"), - new MicroExport(typeof(string), metadata, "Value1"), - new MicroExport(typeof(string), "Value2")); - - var exports = container.GetExports(); - - Assert.AreEqual(1, exports.Count()); - - var export = (Lazy)exports.First(); - - Assert.AreEqual("Value1", export.Value); - Assert.AreEqual("MetadataValue1", export.Metadata.Metadata1); - Assert.AreEqual("MetadataValue2", export.Metadata.Metadata2); - Assert.AreEqual("MetadataValue3", export.Metadata.Metadata3); - } - - [TestMethod] - public void GetExportsOfTTMetadataView2_TypeAsMetadataViewTypeArgument_IsUsedAsMetadataConstraint() - { - var metadata = new Dictionary(); - metadata.Add("Metadata1", "MetadataValue1"); - metadata.Add("Metadata2", "MetadataValue2"); - metadata.Add("Metadata3", "MetadataValue3"); - - var container = ContainerFactory.Create(new MicroExport("Another", metadata, "Value1"), - new MicroExport("Contract", metadata, "Value1"), - new MicroExport("Contract", "Value2")); - - var exports = container.GetExports("Contract"); - - Assert.AreEqual(1, exports.Count()); - - var export = (Lazy)exports.First(); - - Assert.AreEqual("Value1", export.Value); - Assert.AreEqual("MetadataValue1", export.Metadata.Metadata1); - Assert.AreEqual("MetadataValue2", export.Metadata.Metadata2); - Assert.AreEqual("MetadataValue3", export.Metadata.Metadata3); - } - - - [TestMethod] - public void GetExports1_AskingForExactlyOneAndAllWhenContainerEmpty_ShouldThrowCardinalityMismatch() - { - var container = CreateCompositionContainer(); - - var definition = ImportDefinitionFactory.Create(export => true, ImportCardinality.ExactlyOne); - - ExceptionAssert.Throws(() => - { - container.GetExports(definition); - }); - } - - [TestMethod] - public void GetExports1_AskingForZeroOrOneAndAllWhenContainerEmpty_ShouldReturnEmpty() - { - var container = CreateCompositionContainer(); - - var definition = ImportDefinitionFactory.Create(export => true, ImportCardinality.ZeroOrOne); - - var exports = container.GetExports(definition); - - EnumerableAssert.IsEmpty(exports); - } - - [TestMethod] - public void GetExports1_AskingForExactlyOneAndAllWhenContainerEmpty_ShouldReturnEmpty() - { - var container = CreateCompositionContainer(); - - var definition = ImportDefinitionFactory.Create(export => true, ImportCardinality.ZeroOrMore); - - var exports = container.GetExports(definition); - - EnumerableAssert.IsEmpty(exports); - } - - [TestMethod] - [Ignore] - [WorkItem(465976)] - public void RemovePart_PartNotInContainerAsPartArgument_ShouldNotCauseImportsToBeRebound() - { - const string contractName = "Contract"; - - var exporter = PartFactory.CreateExporter(new MicroExport(contractName, 1)); - var importer = PartFactory.CreateImporter(contractName); - var container = ContainerFactory.Create(exporter, importer); - - - Assert.AreEqual(1, importer.Value); - Assert.AreEqual(1, importer.ImportSatisfiedCount); - - var doesNotExistInContainer = PartFactory.CreateExporter(new MicroExport(contractName, 2)); - - CompositionBatch batch = new CompositionBatch(); - batch.RemovePart(doesNotExistInContainer); - container.Compose(batch); - - Assert.AreEqual(1, importer.ImportSatisfiedCount); - } - - [TestMethod] - [Ignore] - [WorkItem(436847)] - public void RemovePart_PartInContainerQueueAsPartArgument_ShouldNotLeavePartInContainer() - { - const string contractName = "Contract"; - - var exporter = PartFactory.CreateExporter(new MicroExport(contractName, 1)); - var importer = PartFactory.CreateImporter(contractName); - var container = ContainerFactory.Create(exporter, importer); - - CompositionBatch batch = new CompositionBatch(); - batch.RemovePart(exporter); - container.Compose(batch); - - Assert.IsNull(importer.Value); - Assert.AreEqual(2, importer.ImportSatisfiedCount); - } - - [TestMethod] - public void RemovePart_PartAlreadyRemovedAsPartArgument_ShouldNotThrow() - { - var exporter = PartFactory.CreateExporter(new MicroExport("Contract", 1)); - var container = ContainerFactory.Create(exporter); - - Assert.AreEqual(1, container.GetExportedValue("Contract")); - - CompositionBatch batch = new CompositionBatch(); - batch.RemovePart(exporter); - container.Compose(batch); - - Assert.IsFalse(container.IsPresent("Contract")); - - batch = new CompositionBatch(); - batch.RemovePart(exporter); - container.Compose(batch); - - Assert.IsFalse(container.IsPresent("Contract")); - } - - [TestMethod] - public void TryComposeSimple() - { - var container = CreateCompositionContainer(); - Int32Importer importer = new Int32Importer(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(importer, new Int32Exporter(42)); - container.Compose(batch); - - Assert.AreEqual(42, importer.Value, "Expected value imported from export"); - } - - [TestMethod] - public void TryComposeSimpleFail() - { - var container = CreateCompositionContainer(); - Int32Importer importer = new Int32Importer(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(importer); - - CompositionAssert.ThrowsChangeRejectedError(ErrorId.ImportEngine_PartCannotSetImport, ErrorId.ImportEngine_ImportCardinalityMismatch, RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - - Assert.AreEqual(0, importer.Value, "Expected default value to remain"); - } - - [TestMethod] - public void ComposeDisposableChildContainer() - { - var outerContainer = CreateCompositionContainer(); - Int32Importer outerImporter = new Int32Importer(); - - CompositionBatch outerBatch = new CompositionBatch(); - var key = outerBatch.AddExportedValue("Value", 42); - outerBatch.AddPart(outerImporter); - outerContainer.Compose(outerBatch); - Assert.AreEqual(42, outerImporter.Value, "Expected value imported from export"); - - Int32Importer innerImporter = new Int32Importer(); - var innerContainer = new CompositionContainer(outerContainer); - CompositionBatch innerBatch = new CompositionBatch(); - innerBatch.AddPart(innerImporter); - - innerContainer.Compose(innerBatch); - Assert.AreEqual(42, innerImporter.Value, "Expected value imported from export"); - Assert.AreEqual(42, outerImporter.Value, "Expected value imported from export"); - - outerBatch = new CompositionBatch(); - outerBatch.RemovePart(key); - key = outerBatch.AddExportedValue("Value", -5); - outerContainer.Compose(outerBatch); - Assert.AreEqual(-5, innerImporter.Value, "Expected update value imported from export"); - Assert.AreEqual(-5, outerImporter.Value, "Expected updated value imported from export"); - - innerContainer.Dispose(); - outerBatch = new CompositionBatch(); - outerBatch.RemovePart(key); - key = outerBatch.AddExportedValue("Value", 500); - outerContainer.Compose(outerBatch); - Assert.AreEqual(500, outerImporter.Value, "Expected updated value imported from export"); - Assert.AreEqual(-5, innerImporter.Value, "Expected value not updated"); - } - - [TestMethod] - public void RemoveValueTest() - { - var container = CreateCompositionContainer(); - CompositionBatch batch = new CompositionBatch(); - - var key = batch.AddExportedValue("foo", "hello"); - container.Compose(batch); - var result = container.GetExportedValue("foo"); - Assert.AreEqual("hello", result, "Should get the correct value"); - - batch = new CompositionBatch(); - batch.RemovePart(key); - container.Compose(batch); - - Assert.IsFalse(container.IsPresent("foo")); - - batch = new CompositionBatch(); - batch.RemovePart(key); // Remove should be idempotent - container.Compose(batch); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfValueTypeBoundToDefaultValueShouldNotAffectAvailableValues() - { - var container = CreateCompositionContainer(); - var importer = new OptionalImporter(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - container.Compose(batch); - - Assert.AreEqual(0, importer.ValueType); - - ExceptionAssert.Throws(() => - { - container.GetExportedValue("ValueType"); - }); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfNullableValueTypeBoundToDefaultValueShouldNotAffectAvailableValues() - { - var container = CreateCompositionContainer(); - var importer = new OptionalImporter(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - container.Compose(batch); - - Assert.IsNull(importer.NullableValueType); - - ExceptionAssert.Throws(() => - { - container.GetExportedValue("NullableValueType"); - }); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void OptionalImportsOfReferenceTypeBoundToDefaultValueShouldNotAffectAvailableValues() - { - var container = CreateCompositionContainer(); - var importer = new OptionalImporter(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - container.Compose(batch); - - Assert.IsNull(importer.ReferenceType); - - ExceptionAssert.Throws(() => - { - container.GetExportedValue("ReferenceType"); - }); - } - - [TestMethod] - public void ExportsChanged_ExportNothing_ShouldNotFireExportsChanged() - { - var container = CreateCompositionContainer(); - - container.ExportsChanged += (sender, args) => - { - Assert.Fail("Event should not be fired!"); - }; - - CompositionBatch batch = new CompositionBatch(); - container.Compose(batch); - } - - [TestMethod] - public void ExportsChanged_ExportAdded_ShouldFireExportsChanged() - { - var container = CreateCompositionContainer(); - IEnumerable changedNames = null; - - container.ExportsChanged += (sender, args) => - { - Assert.AreSame(container, sender); - Assert.IsNull(changedNames, "Ensure this event only fires once!"); - Assert.IsNotNull(args.AddedExports); - Assert.IsNotNull(args.RemovedExports); - Assert.IsNotNull(args.ChangedContractNames); - changedNames = args.ChangedContractNames; - }; - - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("MyExport", new object()); - container.Compose(batch); - - EnumerableAssert.AreEqual(changedNames, "MyExport"); - } - - [TestMethod] - public void ExportsChanged_ExportRemoved_ShouldFireExportsChanged() - { - var container = CreateCompositionContainer(); - IEnumerable changedNames = null; - - CompositionBatch batch = new CompositionBatch(); - var part = batch.AddExportedValue("MyExport", new object()); - container.Compose(batch); - - container.ExportsChanged += (sender, args) => - { - Assert.AreSame(container, sender); - Assert.IsNull(changedNames, "Ensure this event only fires once!"); - Assert.IsNotNull(args.AddedExports); - Assert.IsNotNull(args.RemovedExports); - Assert.IsNotNull(args.ChangedContractNames); - changedNames = args.ChangedContractNames; - }; - - batch = new CompositionBatch(); - batch.RemovePart(part); - container.Compose(batch); - - EnumerableAssert.AreEqual(changedNames, "MyExport"); - } - - [TestMethod] - public void ExportsChanged_ExportAddAnother_ShouldFireExportsChanged() - { - var container = CreateCompositionContainer(); - IEnumerable changedNames = null; - - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("MyExport", new object()); - container.Compose(batch); - - container.ExportsChanged += (sender, args) => - { - Assert.AreSame(container, sender); - Assert.IsNull(changedNames, "Ensure this event only fires once!"); - Assert.IsNotNull(args.AddedExports); - Assert.IsNotNull(args.RemovedExports); - Assert.IsNotNull(args.ChangedContractNames); - changedNames = args.ChangedContractNames; - }; - - batch = new CompositionBatch(); - // Adding another should cause an update. - batch.AddExportedValue("MyExport", new object()); - container.Compose(batch); - - - EnumerableAssert.AreEqual(changedNames, "MyExport"); - } - - [TestMethod] - public void ExportsChanged_AddExportOnParent_ShouldFireExportsChangedOnBoth() - { - var parent = CreateCompositionContainer(); - var child = new CompositionContainer(parent); - - IEnumerable parentNames = null; - parent.ExportsChanged += (sender, args) => - { - Assert.AreSame(parent, sender); - parentNames = args.ChangedContractNames; - }; - - IEnumerable childNames = null; - child.ExportsChanged += (sender, args) => - { - Assert.AreSame(child, sender); - childNames = args.ChangedContractNames; - }; - - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("MyExport", new object()); - parent.Compose(batch); - - EnumerableAssert.AreEqual(parentNames, "MyExport"); - EnumerableAssert.AreEqual(childNames, "MyExport"); - } - - - [TestMethod] - public void ExportsChanged_AddExportOnChild_ShouldFireExportsChangedOnChildOnly() - { - var parent = CreateCompositionContainer(); - var child = new CompositionContainer(parent); - - parent.ExportsChanged += (sender, args) => - { - Assert.Fail("Should not fire on parent container!!"); - }; - - IEnumerable childNames = null; - child.ExportsChanged += (sender, args) => - { - Assert.AreSame(child, sender); - childNames = args.ChangedContractNames; - }; - - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("MyExport2", new object()); - child.Compose(batch); - - EnumerableAssert.AreEqual(childNames, "MyExport2"); - } - - - [TestMethod] - public void Dispose_BeforeCompose_CanBeCallMultipleTimes() - { - var container = ContainerFactory.Create(PartFactory.Create(), PartFactory.Create()); - container.Dispose(); - container.Dispose(); - container.Dispose(); - } - - [TestMethod] - public void Dispose_AfterCompose_CanBeCallMultipleTimes() - { - var container = ContainerFactory.Create(PartFactory.Create(), PartFactory.Create()); - container.Dispose(); - container.Dispose(); - container.Dispose(); - } - - [TestMethod] - public void Dispose_CallsGCSuppressFinalize() - { - bool finalizerCalled = false; - - var container = ContainerFactory.CreateDisposable(disposing => - { - if (!disposing) - { - finalizerCalled = true; - } - - }); - - container.Dispose(); - - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); - - Assert.IsFalse(finalizerCalled); - } - - [TestMethod] - public void Dispose_CallsDisposeBoolWithTrue() - { - var container = ContainerFactory.CreateDisposable(disposing => - { - Assert.IsTrue(disposing); - }); - - container.Dispose(); - } - - [TestMethod] - public void Dispose_CallsDisposeBoolOnce() - { - int disposeCount = 0; - - var container = ContainerFactory.CreateDisposable(disposing => - { - disposeCount++; - }); - - container.Dispose(); - - Assert.AreEqual(1, disposeCount); - } - - [TestMethod] - public void Dispose_ContainerAsExportedValue_CanBeDisposed() - { - using (var container = CreateCompositionContainer()) - { - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue(container); - container.Compose(batch); - } - } - - [TestMethod] - public void Dispose_ContainerAsPart_CanBeDisposed() - { // Tests that when we re-enter CompositionContainer.Dispose, that we don't - // stack overflow. - - using (var container = CreateCompositionContainer()) - { - var part = PartFactory.CreateExporter(new MicroExport(typeof(ICompositionService), container)); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(part); - container.Compose(batch); - - Assert.AreSame(container, container.GetExportedValue()); - } - } - - [TestMethod] - public void ICompositionService_ShouldNotBeImplicitlyExported() - { - var container = CreateCompositionContainer(); - - Assert.IsFalse(container.IsPresent()); - } - - [TestMethod] - public void CompositionContainer_ShouldNotBeImplicitlyExported() - { - var container = CreateCompositionContainer(); - - Assert.IsFalse(container.IsPresent()); - } - - [TestMethod] - public void ICompositionService_ShouldNotBeImplicitlyImported() - { - var importer = PartFactory.CreateImporter(); - var container = ContainerFactory.Create(importer); - - Assert.IsNull(importer.Value); - } - - [TestMethod] - public void CompositionContainer_ShouldNotBeImplicitlyImported() - { - var importer = PartFactory.CreateImporter(); - var container = ContainerFactory.Create(importer); - - Assert.IsNull(importer.Value); - } - - [TestMethod] - public void ICompositionService_CanBeExported() - { - var container = CreateCompositionContainer(); - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue(container); - container.Compose(batch); - - Assert.AreSame(container, container.GetExportedValue()); - } - - [TestMethod] - public void CompositionContainer_CanBeExported() - { - var container = CreateCompositionContainer(); - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue(container); - container.Compose(batch); - - Assert.AreSame(container, container.GetExportedValue()); - } - - [TestMethod] - public void ReleaseExport_Null_ShouldThrowArugmentNull() - { - var container = CreateCompositionContainer(); - - ExceptionAssert.ThrowsArgument("export", - () => container.ReleaseExport(null)); - } - - [TestMethod] - public void ReleaseExports_Null_ShouldThrowArgumentNull() - { - var container = CreateCompositionContainer(); - - ExceptionAssert.ThrowsArgument("exports", - () => container.ReleaseExports(null)); - } - - [TestMethod] - public void ReleaseExports_ElementNull_ShouldThrowArgument() - { - var container = CreateCompositionContainer(); - - ExceptionAssert.ThrowsArgument("exports", - () => container.ReleaseExports(new Export[] { null })); - } - - public class OptionalImporter - { - [Import("ValueType", AllowDefault = true)] - public int ValueType - { - get; - set; - } - - [Import("NullableValueType", AllowDefault = true)] - public int? NullableValueType - { - get; - set; - } - - [Import("ReferenceType", AllowDefault = true)] - public string ReferenceType - { - get; - set; - } - } - - public class ExportSimpleIntWithException - { - [Export("SimpleInt")] - public int SimpleInt { get { throw new NotImplementedException(); } } - } - - [TestMethod] - public void TryGetValueWithCatalogVerifyExecptionDuringGet() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, ErrorId.ReflectionModel_ExportThrewException, () => - { - container.GetExportedValue("SimpleInt"); - }); - } - - [TestMethod] - public void TryGetExportedValueWhileLockedForNotify() - { - var container = CreateCompositionContainer(); - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(new CallbackImportNotify(delegate - { - container.GetExportedValueOrDefault(); - })); - - container.Compose(batch); - } - - [TestMethod] - public void RawExportTests() - { - var container = CreateCompositionContainer(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("foo", 1); - container.Compose(batch); - - Lazy export = container.GetExport("foo"); - - Assert.AreEqual(1, export.Value, "Should be the value I put in..."); - } - - [TestMethod] - [Ignore] - [WorkItem(468388)] - public void ContainerXGetXTest() - { - CompositionContainer container = CreateCompositionContainer(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new MyExporterWithNoFoo()); - container.Compose(batch); - ContainerXGetExportBoundValue(container); - } - - [TestMethod] - [Ignore] - [WorkItem(468388)] - public void ContainerXGetXByComponentCatalogTest() - { - CompositionContainer container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - ContainerXGetExportBoundValue(container); - } - - private void ContainerXGetExportBoundValue(CompositionContainer container) - { - Assert.Fail("This scenario (required metadata warnings) no longer works, see 468388"); - - //string[] required = new string[] { "Foo" }; - //string[] RequiredMetadataNotFound = new string[] { CompositionIssueId.RequiredMetadataNotFound, CompositionIssueId.CardinalityMismatch }; - //container.TryGetExport().VerifyFailure(CompositionIssueId.CardinalityMismatch); - //container.TryGetExport(required).VerifyFailure(CompositionIssueId.CardinalityMismatch); - //container.TryGetExport("MyExporterWithNoFoo").VerifySuccess(); - //container.TryGetExport("MyExporterWithNoFoo", required).VerifyFailure(RequiredMetadataNotFound); - //container.TryGetExports().VerifyFailure(CompositionIssueId.CardinalityMismatch); - //container.TryGetExports(required).VerifyFailure(CompositionIssueId.CardinalityMismatch); - //container.TryGetExports("MyExporterWithNoFoo").VerifySuccess(); - //container.TryGetExports("MyExporterWithNoFoo", required).VerifyFailure(RequiredMetadataNotFound); - //container.TryGetExportedValue().VerifyFailure(CompositionIssueId.CardinalityMismatch); - //container.TryGetExportedValue(required).VerifyFailure(CompositionIssueId.CardinalityMismatch); - //container.TryGetExportedValue("MyExporterWithNoFoo").VerifySuccess(); - //container.TryGetExportedValue("MyExporterWithNoFoo", required).VerifyFailure(RequiredMetadataNotFound); - //container.TryGetExportedValues().VerifyFailure(CompositionIssueId.CardinalityMismatch); - //container.TryGetExportedValues(required).VerifyFailure(CompositionIssueId.CardinalityMismatch); - //container.TryGetExportedValues("MyExporterWithNoFoo").VerifySuccess(); - //container.TryGetExportedValues("MyExporterWithNoFoo", required).VerifyFailure(RequiredMetadataNotFound); - - ExceptionAssert.Throws(() => container.GetExportedValue()); - Assert.IsNotNull(container.GetExportedValue("MyExporterWithNoFoo")); - } - - [Export("MyExporterWithNoFoo")] - public class MyExporterWithNoFoo - { - } - - [Export("MyExporterWithFoo")] - [ExportMetadata("Foo", "Foo value")] - public class MyExporterWithFoo - { - } - - [Export("MyExporterWithFooBar")] - [ExportMetadata("Foo", "Foo value")] - [ExportMetadata("Bar", "Bar value")] - public class MyExporterWithFooBar - { - } - -#if !SILVERLIGHT - // Silverlight doesn't support strongly typed metadata - [TestMethod] - public void ConverterExportTests() - { - var container = CreateCompositionContainer(); - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("foo", 1); - container.Compose(batch); - - var export = container.GetExport>("foo"); - Assert.AreEqual(1, export.Value, "Should be the value I put in..."); - Assert.IsNotNull(export.Metadata, "Should have metadata (as an object)"); - } - -#endif //!SILVERLIGHT - - [TestMethod] - public void RemoveFromWrongContainerTest() - { - CompositionContainer d1 = CreateCompositionContainer(); - CompositionContainer d2 = CreateCompositionContainer(); - - CompositionBatch batch1 = new CompositionBatch(); - var valueKey = batch1.AddExportedValue("a", 1); - d1.Compose(batch1); - - CompositionBatch batch2 = new CompositionBatch(); - batch2.RemovePart(valueKey); - // removing entry from wrong container, shoudl be a no-op - d2.Compose(batch2); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void AddPartSimple() - { - var container = CreateCompositionContainer(); - var importer = new Int32Importer(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - batch.AddPart(new Int32Exporter(42)); - container.Compose(batch); - - Assert.AreEqual(42, importer.Value, "Expected value imported from export"); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void AddPart() - { - var container = CreateCompositionContainer(); - Int32Importer importer = new Int32Importer(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(AttributedModelServices.CreatePart(importer)); - batch.AddPart(new Int32Exporter(42)); - container.Compose(batch); - - Assert.AreEqual(42, importer.Value, "Expected value imported from export"); - } - - [TestMethod] - public void ComposeReentrantChildContainerDisposed() - { - var container = CreateCompositionContainer(); - Int32Importer outerImporter = new Int32Importer(); - Int32Importer innerImporter = new Int32Importer(); - Int32Exporter exporter = new Int32Exporter(42); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(exporter); - container.Compose(batch); - CallbackExecuteCodeDuringCompose callback = new CallbackExecuteCodeDuringCompose(() => - { - using (CompositionContainer innerContainer = new CompositionContainer(container)) - { - CompositionBatch nestedBatch = new CompositionBatch(); - nestedBatch.AddPart(innerImporter); - innerContainer.Compose(nestedBatch); - } - Assert.AreEqual(42, innerImporter.Value, "Expected value imported from export"); - }); - - batch = new CompositionBatch(); - batch.AddParts(outerImporter, callback); - container.Compose(batch); - - Assert.AreEqual(42, outerImporter.Value, "Expected value imported from export"); - Assert.AreEqual(42, innerImporter.Value, "Expected value imported from export"); - } - - [TestMethod] - public void ComposeSimple() - { - var container = CreateCompositionContainer(); - Int32Importer importer = new Int32Importer(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(importer, new Int32Exporter(42)); - container.Compose(batch); - - Assert.AreEqual(42, importer.Value, "Expected value imported from export"); - } - - [TestMethod] - public void ComposeSimpleFail() - { - var container = CreateCompositionContainer(); - Int32Importer importer = new Int32Importer(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - - CompositionAssert.ThrowsChangeRejectedError(ErrorId.ImportEngine_PartCannotSetImport, // Cannot set Int32Importer.Value because - ErrorId.ImportEngine_ImportCardinalityMismatch, // No exports are present that match contract - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void ExceptionDuringNotify() - { - var container = CreateCompositionContainer(); - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(new CallbackImportNotify(delegate - { - throw new InvalidOperationException(); - })); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotActivate, // Cannot activate CallbackImportNotify because - ErrorId.ReflectionModel_PartOnImportsSatisfiedThrewException, // OnImportsSatisfied threw an exception - RetryMode.DoNotRetry, () => - { - container.Compose(batch); - }); - } - - [TestMethod] - public void NeutralComposeWhileNotified() - { - var container = CreateCompositionContainer(); - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(new CallbackImportNotify(delegate - { - // Is this really a supported scenario? - container.Compose(batch); - })); - - container.Compose(batch); - } - public class PartWithReentrantCompose : ComposablePart - { - private CompositionContainer _container; - - public PartWithReentrantCompose(CompositionContainer container) - { - this._container = container; - } - - public override IEnumerable ExportDefinitions - { - get - { - this._container.ComposeExportedValue("ExportedString"); - return Enumerable.Empty(); - } - } - - public override IEnumerable ImportDefinitions - { - get - { - return Enumerable.Empty(); - } - } - - public override object GetExportedValue(ExportDefinition definition) - { - throw new NotImplementedException(); - } - - public override void SetImport(ImportDefinition definition, IEnumerable exports) - { - throw new NotImplementedException(); - } - } - - [Export] - public class SimpleExporter - { - - } - - [TestMethod] - public void ThreadSafeCompositionContainer() - { - TypeCatalog catalog = new TypeCatalog(typeof(SimpleExporter)); - - CompositionContainer container = new CompositionContainer(catalog, true); - Int32Importer importer = new Int32Importer(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(importer, new Int32Exporter(42)); - container.Compose(batch); - - Assert.IsNotNull(container.GetExportedValue()); - Assert.AreEqual(42, importer.Value, "Expected value imported from export"); - - container.Dispose(); - - } - - [TestMethod] - public void ReentrantencyDisabledWhileComposing() - { - var container = CreateCompositionContainer(); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new PartWithReentrantCompose(container)); - - ExceptionAssert.Throws(() => - container.Compose(batch)); - } - private static Expression> ConstraintFromContract(string contractName) - { - return ConstraintFactory.Create(contractName); - } - - private static string ContractFromType(Type type) - { - return AttributedModelServices.GetContractName(type); - } - - private static CompositionContainer CreateCompositionContainer() - { - return new CompositionContainer(); - } - - public interface IMetadataView - { - string Metadata1 - { - get; - } - - string Metadata2 - { - get; - } - - string Metadata3 - { - get; - } - } - - [TestMethod] - public void ComposeExportedValueOfT_NullStringAsExportedValueArgument_VerifyCanPullOnValue() - { - var container = CreateCompositionContainer(); - - var expectation = (string)null; - container.ComposeExportedValue(expectation); - var actualValue = container.GetExportedValue(); - - Assert.AreEqual(expectation, actualValue); - } - - [TestMethod] - public void ComposeExportedValueOfT_StringAsExportedValueArgument_VerifyCanPullOnValue() - { - var expectations = new List(); - expectations.Add((string)null); - expectations.Add(String.Empty); - expectations.Add("Value"); - - foreach (var expectation in expectations) - { - var container = CreateCompositionContainer(); - container.ComposeExportedValue(expectation); - var actualValue = container.GetExportedValue(); - - Assert.AreEqual(expectation, actualValue); - } - } - - [TestMethod] - public void ComposeExportedValueOfT_StringAsIEnumerableOfCharAsExportedValueArgument_VerifyCanPullOnValue() - { - var expectations = new List(); - expectations.Add((string)null); - expectations.Add(String.Empty); - expectations.Add("Value"); - - foreach (var expectation in expectations) - { - var container = CreateCompositionContainer(); - container.ComposeExportedValue>(expectation); - var actualValue = container.GetExportedValue>(); - - Assert.AreEqual(expectation, actualValue); - } - } - - [TestMethod] - public void ComposeExportedValueOfT_ObjectAsExportedValueArgument_VerifyCanPullOnValue() - { - var expectations = new List(); - expectations.Add((string)null); - expectations.Add(String.Empty); - expectations.Add("Value"); - expectations.Add(42); - expectations.Add(new object()); - - foreach (var expectation in expectations) - { - var container = CreateCompositionContainer(); - container.ComposeExportedValue(expectation); - var actualValue = container.GetExportedValue(); - - Assert.AreEqual(expectation, actualValue); - } - } - - [TestMethod] - public void ComposeExportedValueOfT_ExportedValue_ExportedUnderDefaultContractName() - { - string expectedContractName = AttributedModelServices.GetContractName(typeof(string)); - var container = CreateCompositionContainer(); - container.ComposeExportedValue("Value"); - - var importDefinition = new ImportDefinition(ed => true, null, ImportCardinality.ZeroOrMore, false, false); - var exports = container.GetExports(importDefinition); - Assert.AreEqual(1, exports.Count()); - Assert.AreEqual(expectedContractName, exports.Single().Definition.ContractName); - } - - [TestMethod] - public void ComposeExportedValueOfT_ExportedValue_ExportContainsEmptyMetadata() - { - var container = CreateCompositionContainer(); - container.ComposeExportedValue("Value"); - - var importDefinition = new ImportDefinition(ed => true, null, ImportCardinality.ZeroOrMore, false, false); - var exports = container.GetExports(importDefinition); - Assert.AreEqual(1, exports.Count()); - Assert.AreEqual(1, exports.Single().Metadata.Count); // contains type identity - } - - [TestMethod] - public void ComposeExportedValueOfT_ExportedValue_LazyContainsEmptyMetadata() - { - var container = CreateCompositionContainer(); - container.ComposeExportedValue("Value"); - - var lazy = container.GetExport>(); - Assert.AreEqual(1, lazy.Metadata.Count); // contains type identity - } - - [TestMethod] - public void ComposeExportedValueOfT_ExportedValue_ImportsAreNotDiscovered() - { - var container = CreateCompositionContainer(); - var importer = new PartWithRequiredImport(); - - container.ComposeExportedValue(importer); - - var importDefinition = new ImportDefinition(ed => true, null, ImportCardinality.ZeroOrMore, false, false); - var exports = container.GetExports(importDefinition); - Assert.AreEqual(1, exports.Count()); // we only get one if the import was not discovered since the import is not satisfied - } - - [TestMethod] - public void ComposeExportedValueOfT_NullAsContractName_ThrowsArgumentNullException() - { - var container = CreateCompositionContainer(); - ExceptionAssert.ThrowsArgument("contractName", () => - container.ComposeExportedValue((string)null, "Value")); - } - - [TestMethod] - public void ComposeExportedValueOfT_EmptyStringAsContractName_ThrowsArgumentException() - { - var container = CreateCompositionContainer(); - ExceptionAssert.ThrowsArgument("contractName", () => - container.ComposeExportedValue(String.Empty, "Value")); - } - - [TestMethod] - public void ComposeExportedValueOfT_ValidContractName_ValidExportedValue_VerifyCanPullOnValue() - { - var expectations = new List>(); - expectations.Add(new Tuple(" ", (string)null)); - expectations.Add(new Tuple(" ", String.Empty)); - expectations.Add(new Tuple(" ", "Value")); - expectations.Add(new Tuple("ContractName", (string)null)); - expectations.Add(new Tuple("ContractName", String.Empty)); - expectations.Add(new Tuple("ContractName", "Value")); - - foreach (var expectation in expectations) - { - var container = CreateCompositionContainer(); - container.ComposeExportedValue(expectation.Item1, expectation.Item2); - var actualValue = container.GetExportedValue(expectation.Item1); - - Assert.AreEqual(expectation.Item2, actualValue); - - ExceptionAssert.Throws(() => - container.GetExportedValue()); - } - } - - [TestMethod] - public void ComposeExportedValueOfT_ValidContractName_ExportedValue_ExportedUnderSpecifiedContractName() - { - string expectedContractName = "ContractName"; - var container = CreateCompositionContainer(); - container.ComposeExportedValue(expectedContractName, "Value"); - - var importDefinition = new ImportDefinition(ed => true, null, ImportCardinality.ZeroOrMore, false, false); - var exports = container.GetExports(importDefinition); - Assert.AreEqual(1, exports.Count()); - Assert.AreEqual(expectedContractName, exports.Single().Definition.ContractName); - } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void ComposeExportedValueOfT_ValidContractName_ExportedValue_ExportContainsEmptyMetadata() - { - string expectedContractName = "ContractName"; - var container = CreateCompositionContainer(); - container.ComposeExportedValue(expectedContractName, "Value"); - - var importDefinition = new ImportDefinition(ed => ed.ContractName == expectedContractName, null, ImportCardinality.ZeroOrMore, false, false); - var exports = container.GetExports(importDefinition); - Assert.AreEqual(1, exports.Count()); - Assert.AreEqual(1, exports.Single().Metadata.Count); // contains type identity - } - - [TestMethod] - public void ComposeExportedValueOfT_ValidContractName_ExportedValue_ImportsAreNotDiscovered() - { - var container = CreateCompositionContainer(); - var importer = new PartWithRequiredImport(); - - container.ComposeExportedValue("ContractName", importer); - - var importDefinition = new ImportDefinition(ed => true, null, ImportCardinality.ZeroOrMore, false, false); - var exports = container.GetExports(importDefinition); - Assert.AreEqual(1, exports.Count()); // we only get one if the import was not discovered since the import is not satisfied - } - - [TestMethod] - public void TestExportedValueCachesNullValue() - { - var container = ContainerFactory.Create(); - var exporter = new ExportsMutableProperty(); - exporter.Property = null; - container.ComposeParts(exporter); - Assert.IsNull(container.GetExportedValue("Property")); - exporter.Property = "Value1"; - // Exported value should have been cached and so it shouldn't change - Assert.IsNull(container.GetExportedValue("Property")); - } - public class ExportsMutableProperty - { - [Export("Property")] - public string Property { get; set; } - } - - - public class PartWithRequiredImport - { - [Import] - public object Import { get; set; } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionErrorDebuggerProxyTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionErrorDebuggerProxyTests.cs deleted file mode 100644 index e154ccd77d3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionErrorDebuggerProxyTests.cs +++ /dev/null @@ -1,71 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionErrorDebuggerProxyTests - { - [TestMethod] - public void Constructor_NullAsErrorArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("error", () => - { - new CompositionErrorDebuggerProxy((CompositionError)null); - }); - } - - [TestMethod] - public void Constructor_ValueAsErrorArgument_ShouldSetExceptionProperty() - { - var expectations = Expectations.GetInnerExceptionsWithNull(); - - foreach (var e in expectations) - { - var error = ErrorFactory.Create(e); - - var proxy = new CompositionErrorDebuggerProxy(error); - - Assert.AreSame(error.Exception, proxy.Exception); - } - } - - [TestMethod] - public void Constructor_ValueAsErrorArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var error = ErrorFactory.Create(e); - - var proxy = new CompositionErrorDebuggerProxy(error); - - Assert.AreSame(error.Description, proxy.Description); - } - } - - [TestMethod] - public void Constructor_ValueAsErrorArgument_ShouldSetElementProperty() - { - var expectations = Expectations.GetCompositionElementsWithNull(); - - foreach (var e in expectations) - { - var error = ErrorFactory.Create(e); - - var proxy = new CompositionErrorDebuggerProxy(error); - - Assert.AreSame(error.Element, proxy.Element); - } - } - - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionErrorIdTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionErrorIdTests.cs deleted file mode 100644 index a1ac6f022b5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionErrorIdTests.cs +++ /dev/null @@ -1,20 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.UnitTesting; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionErrorIdTests - { - [TestMethod] - public void CompositionErrorIdsAreInSyncWithErrorIds() - { - ExtendedAssert.EnumsContainSameValues(); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionErrorTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionErrorTests.cs deleted file mode 100644 index 46443646017..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionErrorTests.cs +++ /dev/null @@ -1,533 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Linq; -using System.UnitTesting; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -#if !SILVERLIGHT -using System.Runtime.Serialization; -#endif - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionErrorTests - { - [TestMethod] - public void Constructor1_NullAsMessageArgument_ShouldSetMessagePropertyToEmptyString() - { - var error = new CompositionError((string)null); - - Assert.AreEqual("", error.Description); - } - - [TestMethod] - public void Constructor2_NullAsMessageArgument_ShouldSetMessagePropertyToEmptyString() - { - var error = new CompositionError((string)null, ElementFactory.Create()); - - Assert.AreEqual("", error.Description); - } - - [TestMethod] - public void Constructor3_NullAsMessageArgument_ShouldSetMessagePropertyToEmptyString() - { - var error = new CompositionError((string)null, new Exception()); - - Assert.AreEqual("", error.Description); - } - - [TestMethod] - public void Constructor4_NullAsMessageArgument_ShouldSetMessagePropertyToEmptyString() - { - var error = new CompositionError((string)null, ElementFactory.Create(), new Exception()); - - Assert.AreEqual("", error.Description); - } - - [TestMethod] - public void Constructor5_NullAsMessageArgument_ShouldSetMessagePropertyToEmptyString() - { - var error = new CompositionError(CompositionErrorId.Unknown, (string)null, ElementFactory.Create(), new Exception()); - - Assert.AreEqual("", error.Description); - } - - [TestMethod] - public void Constructor1_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new CompositionError(e); - - Assert.AreEqual(e, exception.Description); - } - } - - [TestMethod] - public void Constructor2_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new CompositionError(e, ElementFactory.Create()); - - Assert.AreEqual(e, exception.Description); - } - } - - [TestMethod] - public void Constructor3_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new CompositionError(e, new Exception()); - - Assert.AreEqual(e, exception.Description); - } - } - - [TestMethod] - public void Constructor4_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new CompositionError(e, ElementFactory.Create(), new Exception()); - - Assert.AreEqual(e, exception.Description); - } - } - - [TestMethod] - public void Constructor5_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new CompositionError(CompositionErrorId.Unknown, e, ElementFactory.Create(), new Exception()); - - Assert.AreEqual(e, exception.Description); - } - } - - [TestMethod] - public void Constructor1_ShouldSetExceptionPropertyToNull() - { - var error = new CompositionError("Description"); - - Assert.IsNull(error.Exception); - } - - [TestMethod] - public void Constructor2_ShouldSetExceptionPropertyToNull() - { - var error = new CompositionError("Description", ElementFactory.Create()); - - Assert.IsNull(error.Exception); - } - - [TestMethod] - public void Constructor3_NullAsExceptionArgument_ShouldSetExceptionPropertyToNull() - { - var error = new CompositionError("Description", (Exception)null); - - Assert.IsNull(error.Exception); - } - - [TestMethod] - public void Constructor4_NullAsExceptionArgument_ShouldSetExceptionPropertyToNull() - { - var error = new CompositionError("Description", ElementFactory.Create(), (Exception)null); - - Assert.IsNull(error.Exception); - } - - [TestMethod] - public void Constructor5_NullAsExceptionArgument_ShouldSetExceptionPropertyToNull() - { - var error = new CompositionError(CompositionErrorId.Unknown, "Description", ElementFactory.Create(), (Exception)null); - - Assert.IsNull(error.Exception); - } - - [TestMethod] - public void Constructor3_ValueAsExceptionArgument_ShouldSetExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var error = new CompositionError("Description", e); - - Assert.AreSame(e, error.Exception); - } - } - - [TestMethod] - public void Constructor4_ValueAsExceptionArgument_ShouldSetExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var error = new CompositionError("Description", ElementFactory.Create(), e); - - Assert.AreSame(e, error.Exception); - } - } - - [TestMethod] - public void Constructor5_ValueAsExceptionArgument_ShouldSetExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var error = new CompositionError(CompositionErrorId.Unknown, "Description", ElementFactory.Create(), e); - - Assert.AreSame(e, error.Exception); - } - } - - [TestMethod] - public void Constructor1_ShouldSetInnerExceptionPropertyToNull() - { - var error = new CompositionError("Description"); - - Assert.IsNull(((ICompositionError)error).InnerException); - } - - [TestMethod] - public void Constructor2_ShouldSetInnerExceptionPropertyToNull() - { - var error = new CompositionError("Description", ElementFactory.Create()); - - Assert.IsNull(((ICompositionError)error).InnerException); - } - - [TestMethod] - public void Constructor3_NullAsExceptionArgument_ShouldSetInnerExceptionPropertyToNull() - { - var error = new CompositionError("Description", (Exception)null); - - Assert.IsNull(((ICompositionError)error).InnerException); - } - - [TestMethod] - public void Constructor4_NullAsExceptionArgument_ShouldSetInnerExceptionPropertyToNull() - { - var error = new CompositionError("Description", ElementFactory.Create(), (Exception)null); - - Assert.IsNull(((ICompositionError)error).InnerException); - } - - [TestMethod] - public void Constructor5_NullAsExceptionArgument_ShouldSetInnerExceptionPropertyToNull() - { - var error = new CompositionError(CompositionErrorId.Unknown, "Description", ElementFactory.Create(), (Exception)null); - - Assert.IsNull(((ICompositionError)error).InnerException); - } - - [TestMethod] - public void Constructor3_ValueAsExceptionArgument_ShouldSetInnerExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var error = new CompositionError("Description", e); - - Assert.AreSame(e, ((ICompositionError)error).InnerException); - } - } - - [TestMethod] - public void Constructor4_ValueAsExceptionArgument_ShouldSetInnerExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var error = new CompositionError("Description", ElementFactory.Create(), e); - - Assert.AreSame(e, ((ICompositionError)error).InnerException); - } - } - - [TestMethod] - public void Constructor1_ShouldSetICompositionErrorIdPropertyToCompositionErrorIdUnknown() - { - var error = new CompositionError("Description"); - - Assert.AreEqual(CompositionErrorId.Unknown, ((ICompositionError)error).Id); - } - - [TestMethod] - public void Constructor2_ShouldSetICompositionErrorIdPropertyToCompositionErrorIdUnknown() - { - var error = new CompositionError("Description", ElementFactory.Create()); - - Assert.AreEqual(CompositionErrorId.Unknown, ((ICompositionError)error).Id); - } - - [TestMethod] - public void Constructor3_ShouldSetICompositionErrorIdPropertyToCompositionErrorIdUnknown() - { - var error = new CompositionError("Description", new Exception()); - - Assert.AreEqual(CompositionErrorId.Unknown, ((ICompositionError)error).Id); - } - - [TestMethod] - public void Constructor4_ShouldSetICompositionErrorIdPropertyToCompositionErrorIdUnknown() - { - var error = new CompositionError("Description", ElementFactory.Create(), new Exception()); - - Assert.AreEqual(CompositionErrorId.Unknown, ((ICompositionError)error).Id); - } - - [TestMethod] - public void Constructor5_ValueAsIdArgument_ShouldSetICompositionErrorIdProperty() - { - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var error = new CompositionError(e, "Description", ElementFactory.Create(), new Exception()); - - Assert.AreEqual(e, ((ICompositionError)error).Id); - } - } - - [TestMethod] - public void Constructor1_ShouldSetElementPropertyToNull() - { - var exception = new CompositionError("Description"); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor2_NullAsElementArgument_ShouldSetElementPropertyToNull() - { - var exception = new CompositionError("Description", (ICompositionElement)null); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor3_ShouldSetElementPropertyToNull() - { - var exception = new CompositionError("Description", new Exception()); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor4_NullAsElementArgument_ShouldSetElementPropertyToNull() - { - var exception = new CompositionError("Description", (ICompositionElement)null, new Exception()); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor5_NullAsElementArgument_ShouldSetElementPropertyToNull() - { - var exception = new CompositionError(CompositionErrorId.Unknown, "Description", (ICompositionElement)null, new Exception()); - - Assert.IsNull(exception.Element); - } - - [TestMethod] - public void Constructor2_ValueAsElementArgument_ShouldSetElementProperty() - { - var expectations = Expectations.GetCompositionElements(); - - foreach (var e in expectations) - { - var exception = new CompositionError("Description", (ICompositionElement)e); - - Assert.AreSame(e, exception.Element); - } - } - - [TestMethod] - public void Constructor4_ValueAsElementArgument_ShouldSetElementProperty() - { - var expectations = Expectations.GetCompositionElements(); - - foreach (var e in expectations) - { - var exception = new CompositionError("Description", (ICompositionElement)e, new Exception()); - - Assert.AreSame(e, exception.Element); - } - } - - [TestMethod] - public void Constructor5_ValueAsElementArgument_ShouldSetElementProperty() - { - var expectations = Expectations.GetCompositionElements(); - - foreach (var e in expectations) - { - var exception = new CompositionError(CompositionErrorId.Unknown, "Description", (ICompositionElement)e, new Exception()); - - Assert.AreSame(e, exception.Element); - } - } - - [TestMethod] - public void ToString_ShouldReturnMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var error = CreateCompositionError(e); - - Assert.AreEqual(error.Description, error.ToString()); - } - } - -#if !SILVERLIGHT - - [TestMethod] - public void ICompositionErrorId_CanBeSerialized() - { - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var error = (ICompositionError)CreateCompositionError(e); - - var result = SerializationTestServices.RoundTrip(error); - - Assert.AreEqual(error.Id, result.Id); - } - } - - [TestMethod] - public void Exception_CanBeSerialized() - { - var expectations = Expectations.GetInnerExceptionsWithNull(); - - foreach (var e in expectations) - { - var error = CreateCompositionError(e); - - var result = SerializationTestServices.RoundTrip(error); - - ExtendedAssert.IsInstanceOfSameType(error.Exception, result.Exception); - } - } - - [TestMethod] - public void Message_CanBeSerialized() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var error = CreateCompositionError(e); - - var result = SerializationTestServices.RoundTrip(error); - - Assert.AreEqual(error.Description, result.Description); - } - } - -#endif - - private static CompositionError CreateCompositionError() - { - return CreateCompositionError(CompositionErrorId.Unknown, (string)null, (ICompositionElement)null, (Exception)null); - } - - private static CompositionError CreateCompositionError(string message) - { - return CreateCompositionError(CompositionErrorId.Unknown, message, (ICompositionElement)null, (Exception)null); - } - - private static CompositionError CreateCompositionError(CompositionErrorId id) - { - return CreateCompositionError(id, (string)null, (ICompositionElement)null, (Exception)null); - } - - private static CompositionError CreateCompositionError(Exception exception) - { - return CreateCompositionError(CompositionErrorId.Unknown, (string)null, (ICompositionElement)null, exception); - } - - private static CompositionError CreateCompositionError(ICompositionElement element) - { - return CreateCompositionError(CompositionErrorId.Unknown, (string)null, element, (Exception)null); - } - - private static CompositionError CreateCompositionError(CompositionErrorId id, string message, ICompositionElement element, Exception exception) - { - return new CompositionError(id, message, element, exception); - } - - private static CompositionError CreateCompositionError(params string[] messages) - { - CompositionError error = null; - foreach (string message in messages.Reverse()) - { - CompositionException exception = null; - if (error != null) - { - exception = CreateCompositionException(error); - } - - error = ErrorFactory.Create(message, exception); - } - - return error; - } - - private static CompositionError CreateCompositionErrorWithException(params string[] messages) - { - Exception innerException = null; - foreach (string message in messages.Skip(1).Reverse()) - { - innerException = new Exception(message, innerException); - } - - return new CompositionError(messages[0], innerException); - } - - private static CompositionError CreateCompostionErrorWithCompositionException(string message1, string message2) - { - var exception = CreateCompositionException(new Exception(message2)); - - return new CompositionError(message1, exception); - } - - private static CompositionException CreateCompositionException(CompositionError error) - { - return new CompositionException(error); - } - - private static CompositionException CreateCompositionException(Exception innerException) - { - return new CompositionException("Description", innerException, null); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionExceptionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionExceptionTests.cs deleted file mode 100644 index af9d9b05b04..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionExceptionTests.cs +++ /dev/null @@ -1,680 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Security; -using System.Security.Permissions; -using System.Text; -using System.ComponentModel.Composition.Primitives; -using System.UnitTesting; -using Microsoft.Internal; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -#if !SILVERLIGHT -using System.Runtime.Serialization; -using System.Security.Policy; -#endif - -namespace System.ComponentModel.Composition -{ - [TestClass][Serializable] - public class CompositionExceptionTests - { -#if !SILVERLIGHT - public delegate void Work(int index); - - public class Worker : MarshalByRefObject - { - public static ExpectationCollection, string> expectations = new ExpectationCollection, string>(); - static Worker() - { - expectations.Add(ErrorFactory.CreateFromDsl("Error"), "1 Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error|Error"), "1 Error|2 Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error|Error|Error"), "1 Error|2 Error|3 Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error)"), "1 Error|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error|Error)"), "1 Error|Error|2 Error|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error|Error|Error)"), "1 Error|Error|2 Error|Error|3 Error|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error(Exception))"), "1 Exception|Error|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error|Exception)"), "1 Error|Error|2 Exception|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Exception)"), "1 Exception|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Exception(Exception))"), "1 Exception|Exception|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error(Exception)|Error)"), "1 Exception|Error|Error|2 Error|Error"); - } - - public Work Action; - - internal void DoWork(int index) - { - Action(index); - } - - } - -#endif - - [TestMethod] - public void Constructor1_ShouldSetMessagePropertyToDefault() - { - var exception = new CompositionException(); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor2_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new CompositionException((string)null); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor3_EmptyEnumerableAsErrorsArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new CompositionException(Enumerable.Empty()); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor4_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new CompositionException((string)null, new Exception()); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor5_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new CompositionException((string)null, new Exception(), Enumerable.Empty()); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor2_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new CompositionException(e); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor4_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new CompositionException(e, new Exception()); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor5_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new CompositionException(e, new Exception(), Enumerable.Empty()); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor1_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new CompositionException(); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor2_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new CompositionException("Message"); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor3_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new CompositionException(Enumerable.Empty()); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor4_NullAsInnerExceptionArgument_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new CompositionException("Message", (Exception)null); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor5_NullAsInnerExceptionArgument_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new CompositionException("Message", (Exception)null, Enumerable.Empty()); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor4_ValueAsInnerExceptionArgument_ShouldSetInnerExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var exception = new CompositionException("Message", e); - - Assert.AreSame(e, exception.InnerException); - } - } - - [TestMethod] - public void Constructor5_ValueAsInnerExceptionArgument_ShouldSetInnerExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var exception = new CompositionException("Message", e, Enumerable.Empty()); - - Assert.AreSame(e, exception.InnerException); - } - } - - [TestMethod] - public void Constructor2_ArrayWithNullAsErrorsArgument_ShouldThrowArgument() - { - var errors = new CompositionError[] { null }; - - ExceptionAssert.ThrowsArgument("errors", () => - { - new CompositionException(errors); - }); - } - - [TestMethod] - public void Constructor5_ArrayWithNullAsErrorsArgument_ShouldThrowArgument() - { - var errors = new CompositionError[] { null }; - - ExceptionAssert.ThrowsArgument("errors", () => - { - new CompositionException("Message", new Exception(), errors); - }); - } - - [TestMethod] - public void Constructor1_ShouldSetErrorsPropertyToEmpty() - { - var exception = new CompositionException(); - - EnumerableAssert.IsEmpty(exception.Errors); - } - - [TestMethod] - public void Constructor2_NullAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var exception = new CompositionException((IEnumerable)null); - - EnumerableAssert.IsEmpty(exception.Errors); - } - - [TestMethod] - public void Constructor2_EmptyEnumerableAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var exception = new CompositionException(Enumerable.Empty()); - - EnumerableAssert.IsEmpty(exception.Errors); - } - - [TestMethod] - public void Constructor2_ValueAsErrorsArgument_ShouldSetErrorsProperty() - { - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var exception = new CompositionException(e); - - EnumerableAssert.AreSequenceSame(e, exception.Errors); - } - } - - [TestMethod] - public void Constructor2_ArrayAsAsErrorsArgument_ShouldNotAllowModificationAfterConstruction() - { - var error = CreateCompositionError(); - var errors = new CompositionError[] { error }; - - var exception = new CompositionException(errors); - - errors[0] = null; - - EnumerableAssert.AreEqual(exception.Errors, error); - } - - [TestMethod] - public void Constructor3_ShouldSetErrorsPropertyToEmpty() - { - var exception = new CompositionException(); - - EnumerableAssert.IsEmpty(exception.Errors); - } - - [TestMethod] - public void Constructor4_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var exception = new CompositionException("Message", new Exception()); - - EnumerableAssert.IsEmpty(exception.Errors); - } - - [TestMethod] - public void Constructor5_NullAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var exception = new CompositionException("Message", new Exception(), (IEnumerable)null); - - EnumerableAssert.IsEmpty(exception.Errors); - } - - [TestMethod] - public void Constructor5_EmptyEnumerableAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var exception = new CompositionException("Message", new Exception(), Enumerable.Empty()); - - EnumerableAssert.IsEmpty(exception.Errors); - } - - [TestMethod] - public void Constructor5_ValueAsErrorsArgument_ShouldSetErrorsProperty() - { - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var exception = new CompositionException("Message", new Exception(), e); - - EnumerableAssert.AreSequenceSame(e, exception.Errors); - } - } - - [TestMethod] - public void Constructor5_ArrayAsAsErrorsArgument_ShouldNotAllowModificationAfterConstruction() - { - var error = CreateCompositionError(); - var errors = new CompositionError[] { error }; - - var exception = new CompositionException("Message", new Exception(), errors); - - errors[0] = null; - - EnumerableAssert.AreEqual(exception.Errors, error); - } - - [TestMethod] - public void Message_ShouldIncludeElementGraph() - { - var expectations = new ExpectationCollection(); - CompositionError error = null; - - error = CreateCompositionErrorWithElementChain(1); - expectations.Add(error, GetElementGraphString(error)); - - error = CreateCompositionErrorWithElementChain(2); - expectations.Add(error, GetElementGraphString(error)); - - error = CreateCompositionErrorWithElementChain(3); - expectations.Add(error, GetElementGraphString(error)); - - error = CreateCompositionErrorWithElementChain(10); - expectations.Add(error, GetElementGraphString(error)); - - - foreach (var e in expectations) - { - var exception = CreateCompositionException(new CompositionError[] { e.Input }); - - string result = exception.ToString(); - string expected = FixMessage(e.Output); - StringAssert.Contains(result, expected); - } - } - -#if !SILVERLIGHT && CLR40 - [TestMethod] - public void Message_ShouldIncludeElementGraphAccrossAppDomain() - { - PermissionSet ps = new PermissionSet(PermissionState.None); - ps.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); - ps.AddPermission(new ReflectionPermission(ReflectionPermissionFlag.MemberAccess)); - - //Create a new sandboxed domain - AppDomainSetup setup = AppDomain.CurrentDomain.SetupInformation; - AppDomain newDomain = AppDomain.CreateDomain("test domain", null, setup, ps); - - Worker remoteWorker = (Worker)newDomain.CreateInstanceAndUnwrap( - Assembly.GetExecutingAssembly().FullName, - typeof(Worker).FullName); - - var expectationIndex = new int[] { 1, 2, 3, 10}; - - var expectations = new ExpectationCollection(); - CompositionError error = null; - - error = CreateCompositionErrorWithElementChain(1); - expectations.Add(error, GetElementGraphString(error)); - - error = CreateCompositionErrorWithElementChain(2); - expectations.Add(error, GetElementGraphString(error)); - - error = CreateCompositionErrorWithElementChain(3); - expectations.Add(error, GetElementGraphString(error)); - - error = CreateCompositionErrorWithElementChain(10); - expectations.Add(error, GetElementGraphString(error)); - - int index = 0; - foreach (var e in expectations) - { - try - { - remoteWorker.Action = (int x) => - { - var lclExpectations = new ExpectationCollection(); - - var lclError = CreateCompositionErrorWithElementChain(x); - lclExpectations.Add(lclError, GetElementGraphString(lclError)); - - var ce = CreateCompositionException(new CompositionError[] { lclExpectations[0].Input }); - throw ce; - }; - remoteWorker.DoWork(expectationIndex[index]); - } - catch (CompositionException compositionException) - { - string result = compositionException.ToString(); - string expected = FixMessage(e.Output); - StringAssert.Contains(result, expected); - } - catch (Exception exception) - { - Assert.Fail(exception.ToString()); - } - ++index; - } - } -#endif - [TestMethod] - public void Message_ShouldIncludeErrors() - { - var expectations = new ExpectationCollection, string>(); - expectations.Add(ErrorFactory.CreateFromDsl("Error"), "1 Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error|Error"), "1 Error|2 Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error|Error|Error"), "1 Error|2 Error|3 Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error)"), "1 Error|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error|Error)"), "1 Error|Error|2 Error|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error|Error|Error)"), "1 Error|Error|2 Error|Error|3 Error|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error(Exception))"), "1 Exception|Error|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error|Exception)"), "1 Error|Error|2 Exception|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Exception)"), "1 Exception|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Exception(Exception))"), "1 Exception|Exception|Error"); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error(Exception)|Error)"), "1 Exception|Error|Error|2 Error|Error"); - - foreach (var e in expectations) - { - var exception = CreateCompositionException(e.Input); - - AssertMessage(exception, e.Output.Split('|')); - } - } - -#if !SILVERLIGHT && CLR40 - [TestMethod] - public void Message_ShouldIncludeErrorsAccrossAppDomain() - { - PermissionSet ps = new PermissionSet(PermissionState.None); - ps.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); - ps.AddPermission(new ReflectionPermission(ReflectionPermissionFlag.MemberAccess)); - - //Create a new sandboxed domain - AppDomainSetup setup = AppDomain.CurrentDomain.SetupInformation; - AppDomain newDomain = AppDomain.CreateDomain("test domain", null, setup, ps); - - Worker remoteWorker = (Worker)newDomain.CreateInstanceAndUnwrap( - Assembly.GetExecutingAssembly().FullName, - typeof(Worker).FullName); - - int index = 0; - foreach (var expectation in Worker.expectations) - { - try - { - remoteWorker.Action = (int x) => - { - Exception e = CreateCompositionException(Worker.expectations[x].Input); - throw e; - }; - - remoteWorker.DoWork(index); - } - catch(CompositionException e) - { - AssertMessage(e, expectation.Output.Split('|')); - } - catch(Exception e) - { - Assert.Fail(e.ToString()); - } - ++index; - } - } -#endif - [TestMethod] - public void Messsage_ShouldIncludeCountOfRootCauses() - { - var expectations = new ExpectationCollection, int>(); - expectations.Add(ErrorFactory.CreateFromDsl("Error"), 1); - expectations.Add(ErrorFactory.CreateFromDsl("Error|Error"), 2); - expectations.Add(ErrorFactory.CreateFromDsl("Error|Error|Error"), 3); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error)"), 1); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error)|Error(Error)"), 2); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error|Error)"), 2); - expectations.Add(ErrorFactory.CreateFromDsl("Error(Error|Error|Exception)"), 3); - - foreach (var e in expectations) - { - var exception = CreateCompositionException(e.Input); - - AssertMessage(exception, e.Output, CultureInfo.CurrentCulture); - } - } - - [TestMethod] - public void Message_ShouldFormatCountOfRootCausesUsingTheCurrentCulture() - { - var cultures = Expectations.GetCulturesForFormatting(); - - foreach (var culture in cultures) - { - using (new CurrentCultureContext(culture)) - { - var errors = CreateCompositionErrors(1000); - var exception = CreateCompositionException(errors); - AssertMessage(exception, 1000, culture); - - errors = CreateCompositionErrors(1); - exception = CreateCompositionException(errors); - AssertMessage(exception, 1, culture); - } - } - } - -#if !SILVERLIGHT && CLR40 - - [TestMethod] - public void Message_CanBeSerialized() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = CreateCompositionException(e); - - var result = SerializationTestServices.RoundTrip(exception); - - Assert.AreEqual(exception.Message, result.Message); - } - } - - [TestMethod] - public void Errors_CanBeSerialized() - { - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var exception = CreateCompositionException(e); - - var result = SerializationTestServices.RoundTrip(exception); - - EnumerableAssert.AreSequenceEqual(exception.Errors, result.Errors, (index, expected, actual) => - { - CompositionAssert.AreEqual(expected, actual); - }); - } - } - -#endif - private string GetElementGraphString(CompositionError error) - { - StringBuilder writer = new StringBuilder(); - ICompositionElement element = error.Element; - writer.AppendFormat(CultureInfo.CurrentCulture, Strings.CompositionException_ElementPrefix, element.DisplayName); - - while ((element = element.Origin) != null) - { - writer.AppendFormat(CultureInfo.CurrentCulture, Strings.CompositionException_OriginFormat, Strings.CompositionException_OriginSeparator, element.DisplayName); - } - - return writer.ToString(); - } - - private void AssertMessage(CompositionException exception, int rootCauseCount, CultureInfo culture) - { - using (StringReader reader = new StringReader(exception.Message)) - { - string line = reader.ReadLine(); - - if (rootCauseCount == 1) - { - Assert.IsTrue(line.Contains(Strings.CompositionException_SingleErrorWithSinglePath)); - } - else - { - Assert.IsTrue( - line.Contains(string.Format(CultureInfo.CurrentCulture, Strings.CompositionException_SingleErrorWithMultiplePaths, rootCauseCount)) || - line.Contains(string.Format(CultureInfo.CurrentCulture, Strings.CompositionException_MultipleErrorsWithMultiplePaths, rootCauseCount)) - ); - } - } - } - - private void AssertMessage(CompositionException exception, string[] expected) - { - using (StringReader reader = new StringReader(exception.Message)) - { - // Skip header - reader.ReadLine(); - - foreach (string expect in expected) - { - // Skip blank line - reader.ReadLine(); - Assert.AreEqual(FixMessage(expect), reader.ReadLine()); - } - } - } - - private string FixMessage(string expect) - { - string fixedPrefix = expect.Replace("", Strings.CompositionException_ErrorPrefix + " "); - string fixedSeparator = fixedPrefix.Replace("", Strings.CompositionException_PathsCountSeparator); - return fixedSeparator.Replace("", Strings.CompositionException_OriginSeparator); - } - - private static CompositionError CreateCompositionError() - { - return CreateCompositionError("Description"); - } - - private static CompositionError CreateCompositionError(string message) - { - return new CompositionError(message); - } - - private static CompositionError CreateCompositionErrorWithElementChain(int count) - { - return new CompositionError("Description", ElementFactory.CreateChain(count)); - } - - private static CompositionError[] CreateCompositionErrors(int count) - { - CompositionError[] errors = new CompositionError[count]; - - for (int i = 0; i < count; i++) - { - errors[i] = CreateCompositionError("Description" + (i + 1)); - } - - return errors; - } - - private static CompositionException CreateCompositionException() - { - return CreateCompositionException((string)null, (Exception)null, (IEnumerable)null); - } - - private static CompositionException CreateCompositionException(string message) - { - return CreateCompositionException(message, (Exception)null, (IEnumerable)null); - } - - private static CompositionException CreateCompositionException(IEnumerable errors) - { - return CreateCompositionException((string)null, (Exception)null, errors); - } - - private static CompositionException CreateCompositionException(Exception innerException) - { - return CreateCompositionException((string)null, innerException, (IEnumerable)null); - } - - private static CompositionException CreateCompositionException(string message, Exception innerException, IEnumerable errors) - { - return new CompositionException(message, innerException, errors); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionResultOfTTest.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionResultOfTTest.cs deleted file mode 100644 index 98a2960c245..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionResultOfTTest.cs +++ /dev/null @@ -1,460 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.Linq; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionResultOfTTest - { - [TestMethod] - public void Constructor1_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult(); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor2_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult("Value"); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor3_NullAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult((CompositionError[])null); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor4_NullAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult((IEnumerable)null); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor5_NullAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult("Value", (IEnumerable)null); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor3_EmptyAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult(new CompositionError[0]); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor4_EmptyAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult(Enumerable.Empty()); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor5_EmptyAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult("Value", Enumerable.Empty()); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor3_ValuesAsErrorsArgument_ShouldSetErrorsProperty() - { - var errors = Expectations.GetCompositionErrors(); - - foreach (var e in errors) - { - var result = new CompositionResult(e.ToArray()); - - EnumerableAssert.AreEqual(e, result.Errors); - } - } - - [TestMethod] - public void Constructor4_ValuesAsErrorsArgument_ShouldSetErrorsProperty() - { - var errors = Expectations.GetCompositionErrors(); - - foreach (var e in errors) - { - var result = new CompositionResult(e); - - EnumerableAssert.AreEqual(e, result.Errors); - } - } - - [TestMethod] - public void Constructor5_ValuesAsErrorsArgument_ShouldSetErrorsProperty() - { - var errors = Expectations.GetCompositionErrors(); - - foreach (var e in errors) - { - var result = new CompositionResult("Value", e); - - EnumerableAssert.AreEqual(e, result.Errors); - } - } - - [TestMethod] - public void Constructor1_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult(); - - Assert.IsTrue(result.Succeeded); - } - - - [TestMethod] - public void Constructor2_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult("Value"); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor3_NullAsErrorsArgument_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult((CompositionError[])null); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor4_NullAsErrorsArgument_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult((IEnumerable)null); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor5_NullAsErrorsArgument_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult("Value", (IEnumerable)null); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor3_EmptyAsErrorsArgument_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult(new CompositionError[0]); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor4_EmptyAsErrorsArgument_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult(Enumerable.Empty()); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor5_EmptyAsErrorsArgument_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult("Value", Enumerable.Empty()); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor3_ValuesAsErrorsArgument_ShouldSetSucceededPropertyToTrueIfThereAreErrors() - { - var errors = Expectations.GetCompositionErrors(); - - foreach (var e in errors) - { - var result = new CompositionResult(e.ToArray()); - - if (e.Count() > 0) - { - Assert.IsFalse(result.Succeeded); - } - else - { - Assert.IsTrue(result.Succeeded); - } - } - } - - [TestMethod] - public void Constructor4_ValuesAsErrorsArgument_ShouldSetSucceededPropertyToTrueIfThereAreErrors() - { - var errors = Expectations.GetCompositionErrors(); - - foreach (var e in errors) - { - var result = new CompositionResult(e); - - if (e.Count() > 0) - { - Assert.IsFalse(result.Succeeded); - } - else - { - Assert.IsTrue(result.Succeeded); - } - } - } - - [TestMethod] - public void Constructor5_ValuesAsErrorsArgument_ShouldSetSucceededPropertyToTrueIfThereAreErrors() - { - var errors = Expectations.GetCompositionErrors(); - - foreach (var e in errors) - { - var result = new CompositionResult("Value", e); - - if (e.Count() > 0) - { - Assert.IsFalse(result.Succeeded); - } - else - { - Assert.IsTrue(result.Succeeded); - } - } - } - - [TestMethod] - public void ToResult_NullAsErrorsArgument_ShouldReturnResultWithEmptyErrorsProperty() - { - var result = CreateCompositionResult((IEnumerable)null); - - var copy = result.ToResult(); - - EnumerableAssert.IsEmpty(copy.Errors); - } - - [TestMethod] - public void ToResult_EmptyEnumerableAsErrorsArgument_ShouldReturnResultWithEmptyErrorsProperty() - { - var result = CreateCompositionResult(Enumerable.Empty()); - - var copy = result.ToResult(); - - EnumerableAssert.IsEmpty(copy.Errors); - } - - [TestMethod] - public void ToResult_ValueAsErrorsArgument_ShouldReturnResultWithErrorsPropertySet() - { - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var result = CreateCompositionResult(e); - - var copy = result.ToResult(); - - EnumerableAssert.AreSequenceSame(result.Errors, copy.Errors); - } - } - - [TestMethod] - public void ToResultOfT_NullAsErrorsArgument_ShouldReturnResultWithEmptyErrorsProperty() - { - var result = CreateCompositionResult((IEnumerable)null); - - var copy = result.ToResult(); - - EnumerableAssert.IsEmpty(copy.Errors); - } - - [TestMethod] - public void ToResultOfT_EmptyEnumerableAsErrorsArgument_ShouldReturnResultWithEmptyErrorsProperty() - { - var result = CreateCompositionResult(Enumerable.Empty()); - - var copy = result.ToResult(); - - EnumerableAssert.IsEmpty(copy.Errors); - } - - [TestMethod] - public void ToResultOfT_ValueAsErrorsArgument_ShouldReturnResultWithErrorsPropertySet() - { - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var result = CreateCompositionResult(e); - - var copy = result.ToResult(); - - EnumerableAssert.AreSequenceSame(result.Errors, copy.Errors); - } - } - - [TestMethod] - public void ToResultOfT_ReferenceValueAsValueArgument_ShouldReturnResultWithNullValueProperty() - { - var expectations = Expectations.GetObjectsReferenceTypes(); - - foreach (var e in expectations) - { - var result = CreateCompositionResult(e); - - var copy = result.ToResult(); - - Assert.IsNull(copy.Value); - } - } - - [TestMethod] - public void ToResultOfT_ValueTypeValueAsValueArgument_ShouldReturnResultWithNullValueProperty() - { - var expectations = Expectations.GetObjectsValueTypes(); - - foreach (var e in expectations) - { - var result = CreateCompositionResult(e); - - var copy = result.ToResult(); - - Assert.IsNull(copy.Value); - } - } - - [TestMethod] - public void Value_NullAsErrorsArgumentAndValueAsValueArgument_ShouldReturnValue() - { - var expectations = Expectations.GetObjectsReferenceTypes(); - - foreach (var e in expectations) - { - var result = CreateCompositionResult(e, (IEnumerable)null); - - Assert.AreEqual(e, result.Value); - } - } - - [TestMethod] - public void Value_EmptyEnumerableAsErrorsArgumentAndValueAsValueArgument_ShouldReturnValue() - { - var expectations = Expectations.GetObjectsReferenceTypes(); - - foreach (var e in expectations) - { - var result = CreateCompositionResult(e, Enumerable.Empty()); - - Assert.AreEqual(e, result.Value); - } - } - - [TestMethod] - public void Value_SingleValueAsErrorsArgument_ShouldThrowComposition() - { - var errorIds = Expectations.GetEnumValues(); - - foreach (var errorId in errorIds) - { - var result = CreateCompositionResult(errorId); - - CompositionAssert.ThrowsError((ErrorId)errorId, () => - { - var value = result.Value; - }); - } - } - - [TestMethod] - public void Value_TwoSameValuesAsErrorsArgument_ShouldThrowComposition() - { - var errorIds = Expectations.GetEnumValues(); - - foreach (var errorId in errorIds) - { - var result = CreateCompositionResult(errorId, errorId); - - CompositionAssert.ThrowsErrors((ErrorId)errorId, (ErrorId)errorId, () => - { - var value = result.Value; - }); - } - } - - [TestMethod] - public void Value_TwoDifferentValuesAsErrorsArgument_ShouldThrowComposition() - { - var errorIds1 = Expectations.GetEnumValues(); - var errorIds2 = Expectations.GetEnumValues(); - - for (int i = 0; i < errorIds1.Count(); i++) - { - var errorId1 = errorIds1.ElementAt(i); - var errorId2 = errorIds1.ElementAt(errorIds2.Count() - 1 - i); - - var result = CreateCompositionResult(errorId1, errorId2); - - CompositionAssert.ThrowsErrors((ErrorId)errorId1, (ErrorId)errorId2, () => - { - var value = result.Value; - }); - } - } - - private CompositionResult CreateCompositionResult(params CompositionErrorId[] errorIds) - { - return new CompositionResult(errorIds.Select(id => - { - return ErrorFactory.Create(id); - })); - } - - private CompositionResult CreateCompositionResult(int count) - { - var expectations = Expectations.GetEnumValues(); - - List errors = new List(); - - foreach (var e in expectations.Take(count)) - { - errors.Add(ErrorFactory.Create(e)); - } - - return CreateCompositionResult(errors); - } - - private CompositionResult CreateCompositionResult(IEnumerable errors) - { - return new CompositionResult(errors); - } - - private CompositionResult CreateCompositionResult(T value) - { - return new CompositionResult(value); - } - - private CompositionResult CreateCompositionResult(T value, IEnumerable errors) - { - return new CompositionResult(value, errors); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionResultTest.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionResultTest.cs deleted file mode 100644 index 7231c46aa7b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionResultTest.cs +++ /dev/null @@ -1,494 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.UnitTesting; -using System.Linq; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Factories; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionResultTest - { - [TestMethod] - public void Constructor1_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult(); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor2_NullAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult((CompositionError[])null); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor3_NullAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult((IEnumerable)null); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor2_EmptyAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult(new CompositionError[0]); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor3_EmptyAsErrorsArgument_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var result = new CompositionResult(Enumerable.Empty()); - - EnumerableAssert.IsEmpty(result.Errors); - } - - [TestMethod] - public void Constructor2_ValuesAsErrorsArgument_ShouldSetErrorsProperty() - { - var errors = Expectations.GetCompositionErrors(); - - foreach (var e in errors) - { - var result = new CompositionResult(e.ToArray()); - - EnumerableAssert.AreEqual(e, result.Errors); - } - } - - [TestMethod] - public void Constructor3_ValuesAsErrorsArgument_ShouldSetErrorsProperty() - { - var errors = Expectations.GetCompositionErrors(); - - foreach (var e in errors) - { - var result = new CompositionResult(e); - - EnumerableAssert.AreEqual(e, result.Errors); - } - } - - [TestMethod] - public void Constructor1_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult(); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor2_NullAsErrorsArgument_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult((CompositionError[])null); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor3_NullAsErrorsArgument_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult((IEnumerable)null); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor2_EmptyAsErrorsArgument_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult(new CompositionError[0]); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor3_EmptyAsErrorsArgument_ShouldSetSucceededPropertyToTrue() - { - var result = new CompositionResult(Enumerable.Empty()); - - Assert.IsTrue(result.Succeeded); - } - - [TestMethod] - public void Constructor2_ValuesAsErrorsArgument_ShouldSetSucceededPropertyToTrueIfThereAreErrors() - { - var errors = Expectations.GetCompositionErrors(); - - foreach (var e in errors) - { - var result = new CompositionResult(e.ToArray()); - - if (e.Count() > 0) - { - Assert.IsFalse(result.Succeeded); - } - else - { - Assert.IsTrue(result.Succeeded); - } - } - } - - [TestMethod] - public void Constructor3_ValuesAsErrorsArgument_ShouldSetSucceededPropertyToTrueIfThereAreErrors() - { - var errors = Expectations.GetCompositionErrors(); - - foreach (var e in errors) - { - var result = new CompositionResult(e); - - if (e.Count() > 0) - { - Assert.IsFalse(result.Succeeded); - } - else - { - Assert.IsTrue(result.Succeeded); - } - } - } - - [TestMethod] - public void MergeResult_ResultWithNullErrorsAsResultArgument_ShouldReturnResultWithSameErrors() - { - var emptyResult = CreateCompositionResult((IEnumerable)null); - - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var result = CreateCompositionResult(e); - - var mergedResult = result.MergeResult(emptyResult); - - CompositionAssert.AreEqual(result, mergedResult); - } - } - - [TestMethod] - public void MergeResult_ResultWithEmptyErrorsAsResultArgument_ShouldReturnResultWithSameErrors() - { - var emptyResult = CreateCompositionResult(Enumerable.Empty()); - - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var result = CreateCompositionResult(e); - - var mergedResult = result.MergeResult(emptyResult); - - CompositionAssert.AreEqual(result, mergedResult); - } - } - - [TestMethod] - public void MergeResult_ResultWithErrorsAsResultArgument_ShouldReturnResultWithCombinedErrors() - { - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var result1 = CreateCompositionResult(e); - var result2 = CreateCompositionResult(e); - - var mergedResult = result1.MergeResult(result2); - var mergedErrors = result1.Errors.Concat(result2.Errors); - - EnumerableAssert.AreSequenceSame(mergedErrors, mergedResult.Errors); - Assert.AreEqual(mergedResult.Succeeded, result1.Succeeded | result2.Succeeded); - } - } - - [TestMethod] - public void MergeError_ValueAsErrorArgumentWhenMergedWithResultWithNullErrors_ShouldReturnResultWithCombinedErrors() - { - var result = CreateCompositionResult((IEnumerable)null); - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var error = ErrorFactory.Create(e); - - var mergedResult = result.MergeError(error); - var mergedErrors = result.Errors.Concat(new CompositionError[] { error }); - - EnumerableAssert.AreSequenceSame(mergedErrors, mergedResult.Errors); - Assert.IsFalse(mergedResult.Succeeded); - } - } - - [TestMethod] - public void MergeError_ValueAsErrorArgumentWhenMergedWithResultWithEmptyErrors_ShouldReturnResultWithCombinedErrors() - { - var result = CreateCompositionResult(Enumerable.Empty()); - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var error = ErrorFactory.Create(e); - - var mergedResult = result.MergeError(error); - var mergedErrors = result.Errors.Concat(new CompositionError[] { error }); - - EnumerableAssert.AreSequenceSame(mergedErrors, mergedResult.Errors); - Assert.IsFalse(mergedResult.Succeeded); - } - } - - [TestMethod] - public void MergeError_ValueAsErrorArgumentWhenMergedWithResultWithErrors_ShouldReturnResultWithCombinedErrors() - { - var result = CreateCompositionResult(2); - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var error = ErrorFactory.Create(e); - - var mergedResult = result.MergeError(error); - var mergedErrors = result.Errors.Concat(new CompositionError[] { error }); - - EnumerableAssert.AreSequenceSame(mergedErrors, mergedResult.Errors); - Assert.IsFalse(mergedResult.Succeeded); - } - } - - [TestMethod] - public void MergeErrors_ValueAsErrorArgumentWhenMergedWithResultWithNullErrors_ShouldReturnResultWithCombinedErrors() - { - var result = CreateCompositionResult((IEnumerable)null); - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var mergedResult = result.MergeErrors(e); - var mergedErrors = result.Errors.Concat(e); - - EnumerableAssert.AreSequenceSame(mergedErrors, mergedResult.Errors); - Assert.AreEqual(!e.Any(), mergedResult.Succeeded); - } - } - - [TestMethod] - public void MergeErrors_ValueAsErrorArgumentWhenMergedWithResultWithEmptyErrors_ShouldReturnResultWithCombinedErrors() - { - var result = CreateCompositionResult(Enumerable.Empty()); - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var mergedResult = result.MergeErrors(e); - var mergedErrors = result.Errors.Concat(e); - - EnumerableAssert.AreSequenceSame(mergedErrors, mergedResult.Errors); - Assert.AreEqual(!e.Any(), mergedResult.Succeeded); - } - } - - [TestMethod] - public void MergeErrors_ValueAsErrorArgumentWhenMergedWithResultWithErrors_ShouldReturnResultWithCombinedErrors() - { - var result = CreateCompositionResult(2); - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var mergedResult = result.MergeErrors(e); - var mergedErrors = result.Errors.Concat(e); - - EnumerableAssert.AreSequenceSame(mergedErrors, mergedResult.Errors); - Assert.IsFalse(mergedResult.Succeeded); - } - } - - [TestMethod] - public void ThrowOnErrors_NullAsErrorsArgument_ShouldNotThrow() - { - var result = CreateCompositionResult((IEnumerable)null); - - result.ThrowOnErrors(); - } - - [TestMethod] - public void ThrowOnErrors_EmptyEnumerableAsErrorsArgument_ShouldNotThrow() - { - var result = CreateCompositionResult(Enumerable.Empty()); - - result.ThrowOnErrors(); - } - - [TestMethod] - public void ThrowOnErrors_SingleValueAsErrorsArgument_ShouldThrowComposition() - { - var errorIds = Expectations.GetEnumValues(); - - foreach (var errorId in errorIds) - { - var result = CreateCompositionResult(errorId); - - CompositionAssert.ThrowsError((ErrorId)errorId, () => - { - result.ThrowOnErrors(); - }); - } - } - - [TestMethod] - public void ThrowOnErrors_TwoSameValuesAsErrorsArgument_ShouldThrowComposition() - { - var errorIds = Expectations.GetEnumValues(); - - foreach (var errorId in errorIds) - { - var result = CreateCompositionResult(errorId, errorId); - - CompositionAssert.ThrowsErrors((ErrorId)errorId, (ErrorId)errorId, () => - { - result.ThrowOnErrors(); - }); - } - } - - [TestMethod] - public void ThrowOnErrors_TwoDifferentValuesAsErrorsArgument_ShouldThrowComposition() - { - var errorIds1 = Expectations.GetEnumValues(); - var errorIds2 = Expectations.GetEnumValues(); - - for (int i = 0; i < errorIds1.Count(); i++) - { - var errorId1 = errorIds1.ElementAt(i); - var errorId2 = errorIds1.ElementAt(errorIds2.Count() - 1 - i); - - var result = CreateCompositionResult(errorId1, errorId2); - - CompositionAssert.ThrowsErrors((ErrorId)errorId1, (ErrorId)errorId2, () => - { - result.ThrowOnErrors(); - }); - } - } - - [TestMethod] - public void ToResultOfT_NullAsErrorsArgument_ShouldReturnResultWithEmptyErrorsProperty() - { - var result = CreateCompositionResult((IEnumerable)null); - - var copy = result.ToResult("Value"); - - EnumerableAssert.IsEmpty(copy.Errors); - } - - [TestMethod] - public void ToResultOfT_EmptyEnumerableAsErrorsArgument_ShouldReturnResultWithEmptyErrorsProperty() - { - var result = CreateCompositionResult(Enumerable.Empty()); - - var copy = result.ToResult("Value"); - - EnumerableAssert.IsEmpty(copy.Errors); - } - - [TestMethod] - public void ToResultOfT_ValueAsErrorsArgument_ShouldReturnResultWithErrorsPropertySet() - { - var expectations = Expectations.GetCompositionErrors(); - - foreach (var e in expectations) - { - var result = CreateCompositionResult(e); - - var copy = result.ToResult("Value"); - - EnumerableAssert.AreSequenceSame(result.Errors, copy.Errors); - } - } - - [TestMethod] - public void ToResultOfT_ReferenceValueAsValueArgument_ShouldReturnResultWithValuePropertySet() - { - var expectations = Expectations.GetObjectsReferenceTypes(); - - foreach (var e in expectations) - { - var result = CreateCompositionResult(); - - var copy = result.ToResult(e); - - Assert.AreSame(e, copy.Value); - } - } - - [TestMethod] - public void ToResultOfT_ValueTypeValueAsValueArgument_ShouldReturnResultWithValuePropertySet() - { - var expectations = Expectations.GetObjectsValueTypes(); - - foreach (var e in expectations) - { - var result = CreateCompositionResult(); - - var copy = result.ToResult(e); - - Assert.AreEqual(e, copy.Value); - } - } - - [TestMethod] - public void SucceededResult_ShouldSetSuccessPropertyToTrue() - { - var succeeded = CompositionResult.SucceededResult.Succeeded; - - Assert.IsTrue(succeeded); - } - - [TestMethod] - public void SucceededResult_ShouldSetErrorsPropertyToEmptyEnumerable() - { - var errors = CompositionResult.SucceededResult.Errors; - - EnumerableAssert.IsEmpty(errors); - } - - private CompositionResult CreateCompositionResult(params CompositionErrorId[] errorIds) - { - return new CompositionResult(errorIds.Select(id => - { - return ErrorFactory.Create(id); - })); - } - - private CompositionResult CreateCompositionResult(int count) - { - var expectations = Expectations.GetEnumValues(); - - List errors = new List(); - - foreach (var e in expectations.Take(count)) - { - errors.Add(ErrorFactory.Create(e)); - } - - return CreateCompositionResult(errors); - } - - private CompositionResult CreateCompositionResult(IEnumerable errors) - { - return new CompositionResult(errors); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionServiceExtensionsTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionServiceExtensionsTests.cs deleted file mode 100644 index f611c10aebd..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionServiceExtensionsTests.cs +++ /dev/null @@ -1,150 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Factories; -using System.Linq; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.ReflectionModel; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionServiceExtensionsTests - { - [TestMethod] - public void SatisfyImports_BooleanOverride_PartAndFalseHaveBeenPassed() - { - MockCompositionService compositionService = new MockCompositionService(); - ComposablePart part = PartFactory.Create(); - - bool importsSatisfiedCalled = false; - compositionService.ImportsSatisfied += delegate(object sender, SatisfyImportsEventArgs e) - { - Assert.IsFalse(importsSatisfiedCalled); - Assert.AreEqual(part, e.Part); - importsSatisfiedCalled = true; - }; - - compositionService.SatisfyImportsOnce(part); - Assert.IsTrue(importsSatisfiedCalled); - } - - - [TestMethod] - public void SatisfyImports_AttributedOverride_NullAsCompositionService() - { - ICompositionService compositionService = null; - ExceptionAssert.ThrowsArgument("compositionService", () => - { - compositionService.SatisfyImportsOnce(new MockAttributedPart()); - }); - } - - [TestMethod] - public void SatisfyImports_AttributedOverride_NullAsAttributedPart() - { - MockCompositionService compositionService = new MockCompositionService(); - ExceptionAssert.ThrowsArgument("attributedPart", () => - { - compositionService.SatisfyImportsOnce((object)null); - }); - } - - [TestMethod] - public void SatisfyImports_AttributedOverride_PartAndFalseHaveBeenPassed() - { - MockCompositionService compositionService = new MockCompositionService(); - object attributedPart = new MockAttributedPart(); - - bool importsSatisfiedCalled = false; - compositionService.ImportsSatisfied += delegate(object sender, SatisfyImportsEventArgs e) - { - Assert.IsFalse(importsSatisfiedCalled); - Assert.IsTrue(e.Part is ReflectionComposablePart); - Assert.IsTrue(((ReflectionComposablePart)e.Part).Definition.GetPartType() == typeof(MockAttributedPart)); - importsSatisfiedCalled = true; - }; - - compositionService.SatisfyImportsOnce(attributedPart); - Assert.IsTrue(importsSatisfiedCalled); - } - - [TestMethod] - public void SatisfyImports_AttributedAndBooleanOverride_NullAsCompositionService() - { - ICompositionService compositionService = null; - ExceptionAssert.ThrowsArgument("compositionService", () => - { - compositionService.SatisfyImportsOnce(new MockAttributedPart()); - }); - } - - [TestMethod] - public void SatisfyImports_AttributedAndBooleanOverride_NullAsAttributedPart() - { - MockCompositionService compositionService = new MockCompositionService(); - ExceptionAssert.ThrowsArgument("attributedPart", () => - { - compositionService.SatisfyImportsOnce((object)null); - }); - } - - [TestMethod] - public void SatisfyImports_AttributedAndBooleanOverride_PartAndFalseHaveBeenPassed() - { - MockCompositionService compositionService = new MockCompositionService(); - object attributedPart = new MockAttributedPart(); - - bool importsSatisfiedCalled = false; - compositionService.ImportsSatisfied += delegate(object sender, SatisfyImportsEventArgs e) - { - Assert.IsFalse(importsSatisfiedCalled); - Assert.IsTrue(e.Part is ReflectionComposablePart); - Assert.IsTrue(((ReflectionComposablePart)e.Part).Definition.GetPartType() == typeof(MockAttributedPart)); - importsSatisfiedCalled = true; - }; - - compositionService.SatisfyImportsOnce(attributedPart); - Assert.IsTrue(importsSatisfiedCalled); - } - - internal class SatisfyImportsEventArgs : EventArgs - { - public SatisfyImportsEventArgs(ComposablePart part) - { - this.Part = part; - } - - public ComposablePart Part { get; private set; } - } - - internal class MockCompositionService : ICompositionService - { - public MockCompositionService() - { - } - - public void SatisfyImportsOnce(ComposablePart part) - { - if (this.ImportsSatisfied != null) - { - this.ImportsSatisfied.Invoke(this, new SatisfyImportsEventArgs(part)); - } - } - - public event EventHandler ImportsSatisfied; - } - - public class MockAttributedPart - { - public MockAttributedPart() - { - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionServiceProxy.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionServiceProxy.cs deleted file mode 100644 index db50ffd3674..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionServiceProxy.cs +++ /dev/null @@ -1,24 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - internal class CompositionServiceProxy : ICompositionService - { - private readonly CompositionContainer _container; - - public CompositionServiceProxy(CompositionContainer container) - { - this._container = container; - } - - public void SatisfyImportsOnce(ComposablePart part) - { - this._container.SatisfyImportsOnce(part); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionServicesTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionServicesTests.cs deleted file mode 100644 index b8ee4c4bd6d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/CompositionServicesTests.cs +++ /dev/null @@ -1,117 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Hosting; -using System.Text; -using Microsoft.Internal; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; -using Tests.Integration; -using System.Reflection; -using System.Reflection.Emit; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionServicesTests - { - private static readonly Type NonGenericType = typeof(int); - - [TestMethod] - public void GetContractName_NullAsTypeArgument_ThrowsArgumentNull() - { - ExceptionAssert.ThrowsArgument("type", () => - { - AttributedModelServices.GetContractName((Type)null); - }); - } - - [TestMethod] - [Description("Verifies adding custom modifiers to contract name.")] - public void ContractNameServicesAddCustomModifiersTest() - { - Type[] modifiers = new Type[] { typeof(int), typeof(List), typeof(double) }; - StringBuilder typeName = new StringBuilder(); - ContractNameServices.WriteCustomModifiers(typeName, "test", modifiers); - Assert.AreEqual( - string.Format(" {0}(System.Int32,System.Collections.Generic.List(System.Int32),System.Double)", "test"), - typeName.ToString(), - "Expecting correct modifiers text."); - } - - [TestMethod] - [Description("Verifies CompositionServices.GetDefaultContractName method.")] - public void GetDefaultContractNameTest() - { - ExpectationCollection expectations = new ExpectationCollection(); - - expectations.Add(typeof(string), "System.String"); - expectations.Add(typeof(int?), "System.Nullable(System.Int32)"); - expectations.Add(typeof(NestedParent.NestedChild), "System.ComponentModel.Composition.NestedParent+NestedChild"); - expectations.Add(typeof(int[,]), "System.Int32[,]"); - expectations.Add(typeof(int[,][][]), "System.Int32[,][][]"); - expectations.Add(typeof(Array[,][][]).MakePointerType(), "System.Array[,][][]*"); - expectations.Add(typeof(int).MakePointerType(), "System.Int32*"); - expectations.Add(typeof(int).MakePointerType().MakeArrayType(3).MakeArrayType().MakePointerType(), "System.Int32*[][,,]*"); - expectations.Add(typeof(int).MakeByRefType(), "System.Int32&"); - expectations.Add(typeof(int).MakePointerType().MakeArrayType(4).MakeArrayType().MakeByRefType(), "System.Int32*[][,,,]&"); - expectations.Add(typeof(List<>), "System.Collections.Generic.List()"); - expectations.Add(typeof(Dictionary), "System.Collections.Generic.Dictionary(System.Int32,System.Double)"); - expectations.Add(typeof(Dictionary,double>), "System.Collections.Generic.Dictionary(System.Collections.Generic.Dictionary(System.Int32,System.Double),System.Double)"); - expectations.Add(typeof(GenericContract1.GenericContract2.GenericContract3), "System.ComponentModel.Composition.GenericContract1(System.Int32)+GenericContract2+GenericContract3(System.Double)"); - expectations.Add(typeof(GenericContract4.GenericContract5.GenericContract6), "System.ComponentModel.Composition.GenericContract4(System.Int32,System.Double)+GenericContract5(System.Double,System.Int32)+GenericContract6(System.Int32,System.Double)"); - expectations.Add(typeof(GenericContract4<,>.GenericContract5<,>.GenericContract6<,>), "System.ComponentModel.Composition.GenericContract4(,)+GenericContract5(,)+GenericContract6(,)"); - expectations.Add(typeof(GenericContract7), "System.ComponentModel.Composition.GenericContract7"); - expectations.Add(typeof(GenericContract8), "System.ComponentModel.Composition.GenericContract8(System.Int32)"); - expectations.Add(typeof(GenericContract4.GenericContract5[][,,,,]), "System.ComponentModel.Composition.GenericContract4(System.Int32,System.Double)+GenericContract5(System.Double,System.Int32)[][,,,,]"); - expectations.Add(typeof(GenericContract4.GenericContract5).MakePointerType(), "System.ComponentModel.Composition.GenericContract4(System.Int32,System.Double)+GenericContract5(System.Double,System.Int32)*"); - expectations.Add(typeof(GenericContract4.GenericContract5[][,]).MakePointerType().MakeArrayType(4), "System.ComponentModel.Composition.GenericContract4(System.Int32,System.Double)+GenericContract5(System.Double,System.Int32)[][,]*[,,,]"); expectations.Add(typeof(OuterClassWithGenericNested.GenericNested), "System.ComponentModel.Composition.OuterClassWithGenericNested+GenericNested(System.Int32)"); - expectations.Add(typeof(Delegate), "System.Delegate"); - expectations.Add(typeof(MulticastDelegate), "System.MulticastDelegate"); - expectations.Add(typeof(Action), "System.Void()"); - expectations.Add(typeof(Func>), "System.Func(System.String)()"); - expectations.Add(typeof(DelegateCompositionTests.DoWorkDelegate), "System.Object(System.Int32,System.Object&,System.String&)"); - expectations.Add(typeof(DelegateCompositionTests.DelegateOneArg), "System.Int32(System.Int32)"); - expectations.Add(typeof(DelegateCompositionTests.DelegateTwoArgs), "System.Int32(System.Int32,System.Int32)"); - expectations.Add(typeof(DelegateCompositionTests.SimpleDelegate), "System.Int32()"); - expectations.Add(typeof(DelegateCompositionTests.ActionWith9Args), "System.Void(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)"); - expectations.Add(typeof(DelegateCompositionTests.FuncWith9Args), "System.Int32(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)"); - expectations.Add(EmitGenericType("MyGeneratedType", typeof(int)), "MyGeneratedType(System.Int32)"); - expectations.Add(EmitGenericType("MyGeneratedType`1", typeof(string)), "MyGeneratedType(System.String)"); - expectations.Add(EmitGenericType("_name_", typeof(List<>)), "_name_(System.Collections.Generic.List())"); - - // This particular case can clash with the name generation for methods because we use () for both generics and methods - // we may want to fix this clash by changing the generic markers but it is likely to be very rare. - expectations.Add(EmitGenericType("System.Void", typeof(int)), "System.Void(System.Int32)"); - - foreach (var e in expectations) - { - string typeIdentity = AttributedModelServices.GetTypeIdentity(e.Input); - Assert.AreEqual(e.Output, typeIdentity); - } - - // Do it again to excerise the cache. - foreach (var e in expectations) - { - string typeIdentity = AttributedModelServices.GetTypeIdentity(e.Input); - Assert.AreEqual(e.Output, typeIdentity); - } - } - - public Type EmitGenericType(string typeName, Type genericArgumentType) - { - var assemblyName = new AssemblyName("EmittedTestAssembly"); - var assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); - var moduleBuilder = assemblyBuilder.DefineDynamicModule("EmittedTestModule"); - var typeBuilder = moduleBuilder.DefineType(typeName, TypeAttributes.Public); - - GenericTypeParameterBuilder T = typeBuilder.DefineGenericParameters(new string[] { "T" })[0]; - typeBuilder.SetCustomAttribute(new CustomAttributeBuilder(typeof(ExportAttribute).GetConstructor(Type.EmptyTypes), new object[0])); - - return typeBuilder.CreateType().MakeGenericType(genericArgumentType); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ConcreteComposablePart.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ConcreteComposablePart.cs deleted file mode 100644 index e436fc36709..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ConcreteComposablePart.cs +++ /dev/null @@ -1,93 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Linq; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - internal class ConcreteComposablePart : ComposablePart, IDisposable - { - private readonly List _exports = new List(); - private readonly List _imports = new List(); - private readonly IDictionary> _setImports = new Dictionary>(); - - public ConcreteComposablePart() - { - } - - public override IDictionary Metadata - { - get { return MetadataServices.EmptyMetadata; } - } - - public IDictionary> SetImports - { - get { return this._setImports; } - } - - public override IEnumerable ExportDefinitions - { - get { return this._exports.Select(export => export.Definition); } - } - - public override IEnumerable ImportDefinitions - { - get { return this._imports; } - } - - public ImportDefinition AddImport(string contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite) - { - var import = ImportDefinitionFactory.CreateDefault(contractName, cardinality, isRecomposable, isPrerequisite); - - this.AddImport(import); - return import; - } - - public void AddImport(ImportDefinition import) - { - this._imports.Add(import); - } - - public void AddExport(string contractName, object value) - { - this.AddExport(ExportFactory.Create(contractName, () => value)); - } - - public void AddExport(Export export) - { - this._exports.Add(export); - } - - public override object GetExportedValue(ExportDefinition definition) - { - Export export = _exports.First(e => e.Definition == definition); - - return export.Value; - } - - public override void SetImport(ImportDefinition definition, IEnumerable exports) - { - ContractBasedImportDefinition contractBasedDefinition = (ContractBasedImportDefinition)definition; - this._setImports[contractBasedDefinition.ContractName] = exports; - - foreach (Export export in exports) - { - var value = export.Value; - } - } - - void IDisposable.Dispose() - { - foreach (var disposable in _exports.Select(export => export.Value).OfType()) - { - disposable.Dispose(); - } - } - } -} - diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ConstraintServicesTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ConstraintServicesTests.cs deleted file mode 100644 index 9ef33a3f852..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ConstraintServicesTests.cs +++ /dev/null @@ -1,327 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.Linq.Expressions; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.ReflectionModel; -using System.Reflection; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ConstraintServicesTests - { - [TestMethod] - public void TypeIdentityConstraint_ValidMatchingExportDef_ShouldMatch() - { - var contractName = "MyContract"; - var typeIdentity = AttributedModelServices.GetTypeIdentity(typeof(ConstraintServicesTests)); - var metadata = new Dictionary(); - metadata.Add(CompositionConstants.ExportTypeIdentityMetadataName, typeIdentity); - - var exportDefinition = new ExportDefinition(contractName, metadata); - - var constraint = ConstraintServices.CreateConstraint(contractName, typeIdentity, null, CreationPolicy.Any); - - var predicate = constraint.Compile(); - - Assert.IsTrue(predicate(exportDefinition)); - } - - [TestMethod] - public void TypeIdentityConstraint_ValidNonMatchingExportDef_ShouldNotMatch() - { - var contractName = "MyContract"; - var typeIdentity = AttributedModelServices.GetTypeIdentity(typeof(ConstraintServicesTests)); - var metadata = new Dictionary(); - metadata.Add(CompositionConstants.ExportTypeIdentityMetadataName, typeIdentity + "Another Identity"); - - var exportDefinition = new ExportDefinition(contractName, metadata); - - var constraint = ConstraintServices.CreateConstraint(contractName, typeIdentity, null, CreationPolicy.Any); - - var predicate = constraint.Compile(); - - Assert.IsFalse(predicate(exportDefinition)); - } - - [TestMethod] - public void TypeIdentityConstraint_InvalidExportDef_ShouldNotMatch() - { - var contractName = "MyContract"; - var typeIdentity = AttributedModelServices.GetTypeIdentity(typeof(ConstraintServicesTests)); - var metadata = new Dictionary(); - - var exportDefinition = new ExportDefinition(contractName, metadata); - - var constraint = ConstraintServices.CreateConstraint(contractName, typeIdentity, null, CreationPolicy.Any); - - var predicate = constraint.Compile(); - - Assert.IsFalse(predicate(exportDefinition)); - } - - [TestMethod] - public void CreationPolicyConstraint_ValidMatchingCreationPolicy_ShouldMatch() - { - var contractName = "MyContract"; - var metadata = new Dictionary(); - metadata.Add(CompositionConstants.PartCreationPolicyMetadataName, CreationPolicy.Shared); - - var exportDefinition = new ExportDefinition(contractName, metadata); - - var constraint = ConstraintServices.CreateConstraint(contractName, null, null, CreationPolicy.Shared); - - var predicate = constraint.Compile(); - - Assert.IsTrue(predicate(exportDefinition)); - } - - [TestMethod] - public void CreationPolicyConstraint_ValidNonMatchingCreationPolicy_ShouldNotMatch() - { - var contractName = "MyContract"; - var metadata = new Dictionary(); - metadata.Add(CompositionConstants.PartCreationPolicyMetadataName, CreationPolicy.NonShared); - - var exportDefinition = new ExportDefinition(contractName, metadata); - - var constraint = ConstraintServices.CreateConstraint(contractName, null, null, CreationPolicy.Shared); - - var predicate = constraint.Compile(); - - Assert.IsFalse(predicate(exportDefinition)); - } - - [TestMethod] - public void CreationPolicyConstraint_InvalidCreationPolicy_ShouldNotMatch() - { - var contractName = "MyContract"; - var metadata = new Dictionary(); - metadata.Add(CompositionConstants.PartCreationPolicyMetadataName, "Shared"); - - var exportDefinition = new ExportDefinition(contractName, metadata); - - var constraint = ConstraintServices.CreateConstraint(contractName, null, null, CreationPolicy.Shared); - - var predicate = constraint.Compile(); - - Assert.IsFalse(predicate(exportDefinition)); - } - - [TestMethod] - public void CreationPolicyConstraint_NoCreationPolicy_ShouldNotMatch() - { - var contractName = "MyContract"; - var metadata = new Dictionary(); - - var exportDefinition = new ExportDefinition(contractName, metadata); - - var constraint = ConstraintServices.CreateConstraint(contractName, null, null, CreationPolicy.Shared); - - var predicate = constraint.Compile(); - - Assert.IsTrue(predicate(exportDefinition)); - } - - [TestMethod] - public void PartCreatorConstraint_ShouldMatchPartCreatorExportDefinition() - { - var partCreatorImportDef = ReflectionModelServices.CreateImportDefinition( - new LazyMemberInfo(MemberTypes.Field, () => new MemberInfo[] { typeof(ConstraintServicesTests) }), - "Foo", - "Foo", - new KeyValuePair[] { new KeyValuePair("MDKey", typeof(string)) }, - ImportCardinality.ZeroOrMore, - false, - CreationPolicy.Any, - true, // IsPartCreator - null); - - var metadata = new Dictionary(); - metadata["MDKey"] = "MDValue"; - metadata[CompositionConstants.ExportTypeIdentityMetadataName] = "Foo"; - - var productExportDefinition = new ExportDefinition("Foo", metadata); - - metadata = new Dictionary(metadata); - metadata[CompositionConstants.ExportTypeIdentityMetadataName] = CompositionConstants.PartCreatorTypeIdentity; - metadata[CompositionConstants.ProductDefinitionMetadataName] = productExportDefinition; - - var exportDefinition = new ExportDefinition(CompositionConstants.PartCreatorContractName, metadata); - - var predicate = partCreatorImportDef.Constraint.Compile(); - Assert.IsTrue(partCreatorImportDef.IsConstraintSatisfiedBy(exportDefinition)); - Assert.IsTrue(predicate(exportDefinition)); - } - - [TestMethod] - public void TryParseConstraint_ConstraintFromCreateConstraintAsConstraintArgument1_CanParse() - { - var expectations = Expectations.GetContractNamesWithEmpty(); - - foreach (var e in expectations) - { - var constraint = ConstraintServices.CreateConstraint((string)e, null, null, CreationPolicy.Any); - - AssertCanParse(constraint, e, new Dictionary()); - } - } - - [TestMethod] - public void TryParseConstraint_ConstraintFromCreateConstraintAsConstraintArgument2_CanParse() - { - var expectations = Expectations.GetRequiredMetadata(); - - foreach (var e in expectations) - { - var constraint = ConstraintServices.CreateConstraint((IEnumerable>)e); - - AssertCanParse(constraint, (string)null, e); - } - } - - [TestMethod] - public void TryParseConstraint_ConstraintFromCreateConstraintAsConstraintArgument3_CanParse() - { - var contractNames = Expectations.GetContractNames(); - var metadataValues = Expectations.GetRequiredMetadata(); - - foreach (var contractName in contractNames) - { - foreach (var metadataValue in metadataValues) - { - var constraint = ConstraintServices.CreateConstraint(contractName, null, metadataValue, CreationPolicy.Any); - - AssertCanParse(constraint, contractName, metadataValue); - } - } - } - - [TestMethod] - public void TryParseConstraint_ContractNameOperatorEqualsAsConstraintArgument_CanParse() - { - var expectations = new ExpectationCollection>, string>(); - expectations.Add(item => item.ContractName == "", ""); - expectations.Add(item => item.ContractName == " ", " "); - expectations.Add(item => item.ContractName == " ", " "); - expectations.Add(item => item.ContractName == "ContractName", "ContractName"); - expectations.Add(item => item.ContractName == "contractName", "contractName"); - expectations.Add(item => item.ContractName == "{ContractName}", "{ContractName}"); - expectations.Add(item => item.ContractName == "{ContractName}Name", "{ContractName}Name"); - expectations.Add(item => item.ContractName == "System.Windows.Forms.Control", "System.Windows.Forms.Control"); - expectations.Add(item => item.ContractName == "{System.Windows.Forms}Control", "{System.Windows.Forms}Control"); - - foreach (var e in expectations) - { - AssertCanParse(e.Input, e.Output, new Dictionary()); - } - } - - [TestMethod] - public void TryParseConstraint_MetadataContainsKeyAsConstraintArgument_CanParse() - { - var expectations = new ExpectationCollection>, Dictionary>(); - expectations.Add( - item => typeof(string).IsInstanceOfType(item.Metadata[""]), - new Dictionary{ {"", typeof(string) }}); - expectations.Add( - item => typeof(string).IsInstanceOfType(item.Metadata["value"]), - new Dictionary{ {"value", typeof(string) } }); - expectations.Add( - item => typeof(string).IsInstanceOfType(item.Metadata["Value"]), - new Dictionary{ {"Value", typeof(string) } }); - expectations.Add( - item => typeof(string).IsInstanceOfType(item.Metadata["Value"]) && typeof(int).IsInstanceOfType(item.Metadata["value"]), - new Dictionary{ {"Value", typeof(string)}, {"value", typeof(int) }}); - expectations.Add( - item => typeof(string).IsInstanceOfType(item.Metadata["Value"]) && typeof(int).IsInstanceOfType(item.Metadata["value"]) && typeof(object).IsInstanceOfType(item.Metadata["Metadata"]), - new Dictionary{ {"Value", typeof(string)}, {"value", typeof(int)}, {"Metadata", typeof(object) } }); - - foreach (var e in expectations) - { - AssertCanParse(e.Input, (string)null, e.Output); - } - } - - [TestMethod] - public void TryParseConstraint_ContractNameOperatorEqualsAndMetadataContainsKeyAsConstraintArgumen_CanParse() - { - var expectations = new ExpectationCollection>, KeyValuePair[]>(); - expectations.Add( - item => item.ContractName == "ContractName" && typeof(string).IsInstanceOfType(item.Metadata[""]), - new KeyValuePair[] { new KeyValuePair("", typeof(string)) }); - expectations.Add( - item => item.ContractName == "ContractName" && typeof(string).IsInstanceOfType(item.Metadata["value"]), - new KeyValuePair[] { new KeyValuePair("value", typeof(string)) }); - expectations.Add( - item => item.ContractName == "ContractName" && typeof(string).IsInstanceOfType(item.Metadata["Value"]), - new KeyValuePair[] { new KeyValuePair("Value", typeof(string)) }); - expectations.Add( - item => item.ContractName == "ContractName" && typeof(string).IsInstanceOfType(item.Metadata["Value"]) && typeof(int).IsInstanceOfType(item.Metadata["value"]), - new KeyValuePair[] { new KeyValuePair("Value", typeof(string)), new KeyValuePair("value", typeof(int)) }); - expectations.Add( - item => item.ContractName == "ContractName" && typeof(string).IsInstanceOfType(item.Metadata["Value"]) && typeof(int).IsInstanceOfType(item.Metadata["value"]) && typeof(object).IsInstanceOfType(item.Metadata["Metadata"]), - new KeyValuePair[] { new KeyValuePair("Value", typeof(string)), new KeyValuePair("value", typeof(int)), new KeyValuePair("Metadata", typeof(object)) }); - - foreach (var e in expectations) - { - AssertCanParse(e.Input, "ContractName", e.Output); - } - } - - - [TestMethod] - public void TryParseConstraint_ContractNameReverseOperatorEqualsAsConstraintArgument_CanParse() - { - var expectations = new ExpectationCollection>, string>(); - expectations.Add(item => "" == item.ContractName, ""); - expectations.Add(item => " " == item.ContractName, " "); - expectations.Add(item => " " == item.ContractName, " "); - expectations.Add(item => "ContractName" == item.ContractName, "ContractName"); - expectations.Add(item => "contractName" == item.ContractName, "contractName"); - expectations.Add(item => "{ContractName}" == item.ContractName, "{ContractName}"); - expectations.Add(item => "{ContractName}Name" == item.ContractName, "{ContractName}Name"); - expectations.Add(item => "System.Windows.Forms.Control" == item.ContractName, "System.Windows.Forms.Control"); - expectations.Add(item => "{System.Windows.Forms}Control" == item.ContractName, "{System.Windows.Forms}Control"); - - foreach (var e in expectations) - { - AssertCanParse(e.Input, e.Output, new Dictionary()); - } - } - - private static void AssertCanParse(Expression> constraint, string contractName, IEnumerable> requiredMetadata) - { - Assert.IsNotNull(constraint); - - string contractNameResult = null; - IEnumerable> requiredMetadataResult = null; - bool success = ContraintParser.TryParseConstraint(constraint, out contractNameResult, out requiredMetadataResult); - - Assert.IsTrue(success); - Assert.AreEqual(contractName, contractNameResult); - EnumerableAssert.AreEqual(requiredMetadata, requiredMetadataResult); - } - - private static void AssertCanNotParse(Expression> constraint) - { - Assert.IsNotNull(constraint); - - string contractNameResult; - IEnumerable> requiredMetadataResult; - - var success = ContraintParser.TryParseConstraint(constraint, out contractNameResult, out requiredMetadataResult); - Assert.IsFalse(success); - Assert.IsNull(contractNameResult); - Assert.IsNull(requiredMetadataResult); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ContractBasedImportDefinitionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ContractBasedImportDefinitionTests.cs deleted file mode 100644 index 19dd66bf5a6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ContractBasedImportDefinitionTests.cs +++ /dev/null @@ -1,370 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ -using System; -using System.ComponentModel.Composition; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Linq.Expressions; -using System.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.UnitTesting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.Hosting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ContractBasedImportDefinitionTests - { - [TestMethod] - public void Constructor1_ShouldSetRequiredMetadataPropertyToEmptyEnumerable() - { - var definition = new NoOverridesContractBasedImportDefinition(); - - EnumerableAssert.IsEmpty(definition.RequiredMetadata); - } - - [TestMethod] - public void Constructor1_ShouldSetCardinalityPropertyToExactlyOne() - { - var definition = new NoOverridesContractBasedImportDefinition(); - - Assert.AreEqual(ImportCardinality.ExactlyOne, definition.Cardinality); - } - - [TestMethod] - public void Constructor1_ShouldSetIsPrerequisitePropertyToTrue() - { - var definition = new NoOverridesContractBasedImportDefinition(); - - Assert.IsTrue(definition.IsPrerequisite); - } - - [TestMethod] - public void Constructor1_ShouldSetIsRecomposablePropertyToFalse() - { - var definition = new NoOverridesContractBasedImportDefinition(); - - Assert.IsFalse(definition.IsRecomposable); - } - - [TestMethod] - public void Constructor1_ShouldSetRequiredCreationPolicyToAny() - { - var definition = new NoOverridesContractBasedImportDefinition(); - - Assert.AreEqual(CreationPolicy.Any, definition.RequiredCreationPolicy); - } - - [TestMethod] - public void Constructor1_ShouldSetRequiredTypeIdentityToNull() - { - var definition = new NoOverridesContractBasedImportDefinition(); - - Assert.IsNull(definition.RequiredTypeIdentity); - } - - [TestMethod] - public void Constructor2_NullAsContractNameArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("contractName", () => - { - new ContractBasedImportDefinition((string)null, (string)null, Enumerable.Empty>(), ImportCardinality.ExactlyOne, false, false, CreationPolicy.Any); - }); - } - - [TestMethod] - public void Constructor2_EmptyStringAsContractNameArgument_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("contractName", () => - { - new ContractBasedImportDefinition("", (string)null, Enumerable.Empty>(), ImportCardinality.ExactlyOne, false, false, CreationPolicy.Any); - }); - } - - [TestMethod] - public void RequiredMetadata_ArrayWithNullKeyAsRequiredMetadataArgument_ShouldThrowInvalidOperation() - { - var requiredMetadata = new KeyValuePair[] { new KeyValuePair(null, typeof(object)) }; - - var import = new ContractBasedImportDefinition("requiredMetadata", (string)null, requiredMetadata, ImportCardinality.ExactlyOne, false, false, CreationPolicy.Any); - - ExceptionAssert.Throws(() => - { - var m = import.RequiredMetadata; - }); - } - - [TestMethod] - public void RequiredMetadata_ArrayWithNullValueAsRequiredMetadataArgument_ShouldThrowInvalidOperation() - { - var requiredMetadata = new KeyValuePair[] { new KeyValuePair("key", null) }; - var import = new ContractBasedImportDefinition("requiredMetadata", (string)null, requiredMetadata, ImportCardinality.ExactlyOne, false, false, CreationPolicy.Any); - - ExceptionAssert.Throws(() => - { - var m = import.RequiredMetadata; - }); - } - - - [TestMethod] - public void Constructor2_NullAsRequiredMetadataArgument_ShouldSetRequiredMetadataToEmptyEnumerable() - { - var definition = new ContractBasedImportDefinition("requiredMetadata", (string)null, (IEnumerable>)null, ImportCardinality.ExactlyOne, false, false, CreationPolicy.Any); - - EnumerableAssert.IsEmpty(definition.RequiredMetadata); - } - - [TestMethod] - public void Constructor2_OutOfRangeValueAsCardinalityArgument_ShouldThrowArgument() - { - var expectations = Expectations.GetInvalidEnumValues(); - - foreach (var e in expectations) - { - ExceptionAssert.ThrowsArgument("cardinality", () => - { - new ContractBasedImportDefinition((string)null, (string)null, Enumerable.Empty>(), e, false, false, CreationPolicy.Any); - }); - } - } - - [TestMethod] - public void Constructor2_ValueAsCardinalityArgument_ShouldSetCardinalityProperty() - { - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var definition = new ContractBasedImportDefinition("ContractName", (string)null, Enumerable.Empty>(), e, false, false, CreationPolicy.Any); - - Assert.AreEqual(e, definition.Cardinality); - } - } - - [TestMethod] - public void Constructor2_ValueAsContractNameArgument_ShouldSetContractNameProperty() - { - var expectations = Expectations.GetContractNames(); - - foreach (var e in expectations) - { - var definition = new ContractBasedImportDefinition(e, (string)null, Enumerable.Empty>(), ImportCardinality.ExactlyOne, false, false, CreationPolicy.Any); - - Assert.AreEqual(e, definition.ContractName); - } - } - - [TestMethod] - public void Constructor2_ValueAsRequiredMetadataArgument_ShouldSetRequiredMetadataProperty() - { - var expectations = Expectations.GetRequiredMetadataWithEmpty(); - - foreach (var e in expectations) - { - var definition = new ContractBasedImportDefinition("ContractName", (string)null, e, ImportCardinality.ExactlyOne, false, false, CreationPolicy.Any); - - EnumerableAssert.AreEqual(e, definition.RequiredMetadata); - } - } - - [TestMethod] - public void Constructor2_ValueAsIsRecomposableArgument_ShouldSetIsRecomposableProperty() - { - var expectations = Expectations.GetBooleans(); - - foreach (var e in expectations) - { - var definition = new ContractBasedImportDefinition("ContractName", (string)null, Enumerable.Empty>(), ImportCardinality.ExactlyOne, e, false, CreationPolicy.Any); - - Assert.AreEqual(e, definition.IsRecomposable); - } - } - - [TestMethod] - public void Constructor2_ValueAsIsPrerequisiteArgument_ShouldSetIsPrerequisiteProperty() - { - var expectations = Expectations.GetBooleans(); - - foreach (var e in expectations) - { - var definition = new ContractBasedImportDefinition("ContractName", (string)null, Enumerable.Empty>(), ImportCardinality.ExactlyOne, false, e, CreationPolicy.Any); - - Assert.AreEqual(e, definition.IsPrerequisite); - } - } - - [TestMethod] - public void Constructor2_ShouldSetRequiredCreationPolicyToAny() - { - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var definition = new ContractBasedImportDefinition("ContractName", (string)null, Enumerable.Empty>(), ImportCardinality.ExactlyOne, false, false, e); - - Assert.AreEqual(e, definition.RequiredCreationPolicy); - } - } - - [TestMethod] - public void Constraint_ShouldIncludeContractNameProperty() - { - var expectations = Expectations.GetContractNames(); - - foreach (var e in expectations) - { - var definition = new ContractBasedImportDefinition(e, (string)null, (IEnumerable>)null, ImportCardinality.ExactlyOne, true, false, CreationPolicy.Any); - - ConstraintAssert.Contains(definition.Constraint, e); - } - } - - [TestMethod] - public void Constraint_ShouldIncludeRequiredMetadataProperty() - { - var expectations = Expectations.GetRequiredMetadataWithEmpty(); - - foreach (var e in expectations) - { - var definition = new ContractBasedImportDefinition("ContractName", (string)null, e, ImportCardinality.ExactlyOne, true, false, CreationPolicy.Any); - - ConstraintAssert.Contains(definition.Constraint, "ContractName", e); - } - } - - [TestMethod] - public void Constraint_ShouldIncludeOverriddenContractNameProperty() - { - var expectations = Expectations.GetContractNames(); - - foreach (var e in expectations) - { - var definition = new DerivedContractBasedImportDefinition(e); - - ConstraintAssert.Contains(definition.Constraint, e); - } - } - - [TestMethod] - public void Constraint_ShouldIncludeOverriddenRequiredMetadata() - { - var expectations = Expectations.GetRequiredMetadataWithEmpty(); - - foreach (var e in expectations) - { - var definition = new DerivedContractBasedImportDefinition("ContractName", e); - - ConstraintAssert.Contains(definition.Constraint, "ContractName", e); - } - } - - [TestMethod] - public void IsConstraintSatisfiedBy_ContractNameMatch() - { - var export = CreateSimpleExport(); - var import = CreateSimpleImport("ContractName", "ContractName", new string[0], new Type[0]); - Assert.IsTrue(import.IsConstraintSatisfiedBy(export)); - } - - [TestMethod] - public void IsConstraintSatisfiedBy_ContractNameMismatch() - { - var export = CreateSimpleExport(); - var import = CreateSimpleImport("NonContractName", "ContractName", new string[0], new Type[0]); - Assert.IsFalse(import.IsConstraintSatisfiedBy(export)); - } - - [TestMethod] - public void IsConstraintSatisfiedBy_TypeIdentityMismatch() - { - var export = CreateSimpleExport(); - var import = CreateSimpleImport("ContractName", "NonContractName", new string[0], new Type[0]); - Assert.IsFalse(import.IsConstraintSatisfiedBy(export)); - } - - [TestMethod] - public void IsConstraintSatisfiedBy_MetadataMatch() - { - var export = CreateSimpleExport(); - var import = CreateSimpleImport("ContractName", "ContractName", new string[]{"Int", "String", "Type"}, new Type[]{typeof(int), typeof(string), typeof(Type)}); - Assert.IsTrue(import.IsConstraintSatisfiedBy(export)); - } - - [TestMethod] - public void IsConstraintSatisfiedBy_MetadataKeyMismatch() - { - var export = CreateSimpleExport(); - var import = CreateSimpleImport("ContractName", "ContractName", new string[] { "Int", "String1", "Type" }, new Type[] { typeof(int), typeof(string), typeof(Type) }); - Assert.IsFalse(import.IsConstraintSatisfiedBy(export)); - } - - [TestMethod] - public void IsConstraintSatisfiedBy_MetadataTypeMatch() - { - var export = CreateSimpleExport(); - var import = CreateSimpleImport("ContractName", "ContractName", new string[] { "Int", "String", "Type" }, new Type[] { typeof(int), typeof(string), typeof(int) }); - Assert.IsFalse(import.IsConstraintSatisfiedBy(export)); - } - - private static ExportDefinition CreateSimpleExport() - { - var metadata = new Dictionary(); - metadata.Add("Int", 42); - metadata.Add("String", "42"); - metadata.Add("Type", typeof(string)); - metadata.Add(CompositionConstants.ExportTypeIdentityMetadataName, "ContractName"); - return new ExportDefinition("ContractName", metadata); - } - - private static ContractBasedImportDefinition CreateSimpleImport(string contractName, string typeIdentity, string[] metadataKeys, Type[] metadataTypes) - { - Dictionary requiredMetadata = new Dictionary(); - Assert.AreEqual(metadataKeys.Length, metadataTypes.Length); - for(int i=0; i< metadataKeys.Length; i++) - { - requiredMetadata[metadataKeys[i]] = metadataTypes[i]; - } - return new ContractBasedImportDefinition(contractName, typeIdentity, requiredMetadata, ImportCardinality.ZeroOrMore, false, false, CreationPolicy.Any); - - } - - private class NoOverridesContractBasedImportDefinition : ContractBasedImportDefinition - { - public NoOverridesContractBasedImportDefinition() - { - } - } - - private class DerivedContractBasedImportDefinition : ContractBasedImportDefinition - { - private readonly string _contractName; - private readonly IEnumerable> _requiredMetadata; - - public DerivedContractBasedImportDefinition(string contractName) - { - _contractName = contractName; - } - - public DerivedContractBasedImportDefinition(string contractName, IEnumerable> requiredMetadata) - { - _contractName = contractName; - _requiredMetadata = requiredMetadata; - } - - public override string ContractName - { - get { return _contractName; } - } - - public override IEnumerable> RequiredMetadata - { - get { return _requiredMetadata; } - } - } - } -} - diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ContractMismatchExceptionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ContractMismatchExceptionTests.cs deleted file mode 100644 index ca3c5d672d3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ContractMismatchExceptionTests.cs +++ /dev/null @@ -1,174 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -#if !SILVERLIGHT -using System.Runtime.Serialization; -#endif - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ContractMismatchExceptionTests - { - [TestMethod] - public void Constructor1_ShouldSetMessagePropertyToDefault() - { - var exception = new CompositionContractMismatchException(); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor2_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new CompositionContractMismatchException((string)null); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor3_NullAsMessageArgument_ShouldSetMessagePropertyToDefault() - { - var exception = new CompositionContractMismatchException((string)null, new Exception()); - - ExceptionAssert.HasDefaultMessage(exception); - } - - [TestMethod] - public void Constructor2_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new CompositionContractMismatchException(e); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor3_ValueAsMessageArgument_ShouldSetMessageProperty() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = new CompositionContractMismatchException(e, new Exception()); - - Assert.AreEqual(e, exception.Message); - } - } - - [TestMethod] - public void Constructor1_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new CompositionContractMismatchException(); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor2_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new CompositionContractMismatchException("Message"); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor3_NullAsInnerExceptionArgument_ShouldSetInnerExceptionPropertyToNull() - { - var exception = new CompositionContractMismatchException("Message", (Exception)null); - - Assert.IsNull(exception.InnerException); - } - - [TestMethod] - public void Constructor3_ValueAsInnerExceptionArgument_ShouldSetInnerExceptionProperty() - { - var expectations = Expectations.GetInnerExceptions(); - - foreach (var e in expectations) - { - var exception = new CompositionContractMismatchException("Message", e); - - Assert.AreSame(e, exception.InnerException); - } - } - -#if !SILVERLIGHT - - [TestMethod] - public void Constructor4_NullAsInfoArgument_ShouldThrowArgumentNull() - { - var context = new StreamingContext(); - - ExceptionAssert.ThrowsArgument("info", () => - { - SerializationTestServices.Create((SerializationInfo)null, context); - }); - } - - [TestMethod] - public void InnerException_CanBeSerialized() - { - var expectations = Expectations.GetInnerExceptionsWithNull(); - - foreach (var e in expectations) - { - var exception = CreateContractMismatchException(e); - - var result = SerializationTestServices.RoundTrip(exception); - - ExtendedAssert.IsInstanceOfSameType(exception.InnerException, result.InnerException); - } - } - - [TestMethod] - public void Message_CanBeSerialized() - { - var expectations = Expectations.GetExceptionMessages(); - - foreach (var e in expectations) - { - var exception = CreateContractMismatchException(e); - - var result = SerializationTestServices.RoundTrip(exception); - - Assert.AreEqual(exception.Message, result.Message); - } - } - -#endif - - private static CompositionContractMismatchException CreateContractMismatchException() - { - return CreateContractMismatchException((string)null, (Exception)null); - } - - private static CompositionContractMismatchException CreateContractMismatchException(string message) - { - return CreateContractMismatchException(message, (Exception)null); - } - - private static CompositionContractMismatchException CreateContractMismatchExceptionFromId(string id) - { - return CreateContractMismatchException((string)null, (Exception)null); - } - - private static CompositionContractMismatchException CreateContractMismatchException(Exception innerException) - { - return CreateContractMismatchException((string)null, innerException); - } - - private static CompositionContractMismatchException CreateContractMismatchException(string message, Exception innerException) - { - return new CompositionContractMismatchException(message, innerException); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Diagnostics/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Diagnostics/.gitattributes deleted file mode 100644 index c78a36da4cb..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Diagnostics/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/CompositionTraceIdTests.cs -crlf -/CompositionTraceSourceTests.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Diagnostics/CompositionTraceIdTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Diagnostics/CompositionTraceIdTests.cs deleted file mode 100644 index 477237fcfdd..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Diagnostics/CompositionTraceIdTests.cs +++ /dev/null @@ -1,20 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.UnitTesting; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.Diagnostics -{ - [TestClass] - public class CompositionTraceIdTests - { - [TestMethod] - public void CompositionTraceIdsAreInSyncWithTraceIds() - { - ExtendedAssert.EnumsContainSameValues(); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Diagnostics/CompositionTraceSourceTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Diagnostics/CompositionTraceSourceTests.cs deleted file mode 100644 index 32f74b8ce7d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Diagnostics/CompositionTraceSourceTests.cs +++ /dev/null @@ -1,528 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Diagnostics; - -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; -using System.Collections.Generic; - -namespace System.ComponentModel.Composition.Diagnostics -{ - [TestClass] - public class ComposableTraceSourceTests - { -#if !SILVERLIGHT - [TestMethod] - public void CanWriteInformation_ShouldReturnFalseByDefault() - { - Assert.IsFalse(CompositionTraceSource.CanWriteInformation); - } - - [TestMethod] - public void CanWriteWarning_ShouldReturnTrueByDefault() - { - Assert.IsTrue(CompositionTraceSource.CanWriteWarning); - } - - [TestMethod] - public void CanWriteError_ShouldReturnTrueByDefault() - { - Assert.IsTrue(CompositionTraceSource.CanWriteError); - } - - [TestMethod] - public void CanWriteInformation_WhenSwitchLevelLessThanInformation_ShouldReturnFalse() - { - var levels = GetSourceLevelsLessThan(SourceLevels.Information); - foreach (var level in levels) - { - using (new TraceContext(level)) - { - Assert.IsFalse(CompositionTraceSource.CanWriteInformation); - } - } - } - - [TestMethod] - public void CanWriteInformation_WhenSwitchLevelGreaterThanOrEqualToInformation_ShouldReturnTrue() - { - var levels = GetSourceLevelsGreaterThanOrEqualTo(SourceLevels.Information); - foreach (var level in levels) - { - using (new TraceContext(level)) - { - Assert.IsTrue(CompositionTraceSource.CanWriteInformation); - } - } - } - - [TestMethod] - public void CanWriteWarning_WhenSwitchLevelLessThanWarning_ShouldReturnFalse() - { - var levels = GetSourceLevelsLessThan(SourceLevels.Warning); - foreach (var level in levels) - { - using (new TraceContext(level)) - { - Assert.IsFalse(CompositionTraceSource.CanWriteWarning); - } - } - } - - [TestMethod] - public void CanWriteWarning_WhenSwitchLevelGreaterThanOrEqualToWarning_ShouldReturnTrue() - { - var levels = GetSourceLevelsGreaterThanOrEqualTo(SourceLevels.Warning); - foreach (var level in levels) - { - using (new TraceContext(level)) - { - Assert.IsTrue(CompositionTraceSource.CanWriteWarning); - } - } - } - - [TestMethod] - public void CanWriteError_WhenSwitchLevelLessThanError_ShouldReturnFalse() - { - var levels = GetSourceLevelsLessThan(SourceLevels.Error); - foreach (var level in levels) - { - using (new TraceContext(level)) - { - Assert.IsFalse(CompositionTraceSource.CanWriteError); - } - } - } - - [TestMethod] - public void CanWriteError_WhenSwitchLevelGreaterThanOrEqualToError_ShouldReturnTrue() - { - var levels = GetSourceLevelsGreaterThanOrEqualTo(SourceLevels.Error); - foreach (var level in levels) - { - using (new TraceContext(level)) - { - Assert.IsTrue(CompositionTraceSource.CanWriteError); - } - } - } - - [TestMethod] - public void WriteInformation_WhenSwitchLevelLessThanInformation_ShouldThrowInternalError() - { - var levels = GetSourceLevelsLessThan(SourceLevels.Information); - foreach (var level in levels) - { - using (TraceContext context = new TraceContext(level)) - { - ThrowsInternalError(() => - { - CompositionTraceSource.WriteInformation(0, "format", "arguments"); - }); - } - } - } - - [TestMethod] - public void WriteInformation_WhenSwitchLevelGreaterThanOrEqualToInformation_ShouldWriteToTraceListener() - { - var levels = GetSourceLevelsGreaterThanOrEqualTo(SourceLevels.Information); - foreach (var level in levels) - { - using (TraceContext context = new TraceContext(level)) - { - CompositionTraceSource.WriteInformation(0, "format", "arguments"); - - Assert.IsNotNull(context.LastTraceEvent); - } - } - } - - [TestMethod] - public void WriteWarning_WhenSwitchLevelLessThanWarning_ShouldThrowInternalError() - { - var levels = GetSourceLevelsLessThan(SourceLevels.Warning); - foreach (var level in levels) - { - using (TraceContext context = new TraceContext(level)) - { - ThrowsInternalError(() => - { - CompositionTraceSource.WriteWarning(0, "format", "arguments"); - }); - } - } - } - - [TestMethod] - public void WriteWarning_WhenSwitchLevelGreaterThanOrEqualToWarning_ShouldWriteToTraceListener() - { - var levels = GetSourceLevelsGreaterThanOrEqualTo(SourceLevels.Information); - foreach (var level in levels) - { - using (TraceContext context = new TraceContext(level)) - { - CompositionTraceSource.WriteWarning(0, "format", "arguments"); - - Assert.IsNotNull(context.LastTraceEvent); - } - } - } - - [TestMethod] - public void WriteError_WhenSwitchLevelLessThanError_ShouldThrowInternalError() - { - var levels = GetSourceLevelsLessThan(SourceLevels.Error); - foreach (var level in levels) - { - using (TraceContext context = new TraceContext(level)) - { - ThrowsInternalError(() => - { - CompositionTraceSource.WriteError(0, "format", "arguments"); - }); - } - } - } - - [TestMethod] - public void WriteError_WhenSwitchLevelGreaterThanOrEqualToError_ShouldWriteToTraceListener() - { - var levels = GetSourceLevelsGreaterThanOrEqualTo(SourceLevels.Error); - foreach (var level in levels) - { - using (TraceContext context = new TraceContext(level)) - { - CompositionTraceSource.WriteError(0, "format", "arguments"); - - Assert.IsNotNull(context.LastTraceEvent); - } - } - } - - [TestMethod] - public void WriteInformation_ShouldWriteTraceEventTypeInformationToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Information)) - { - CompositionTraceSource.WriteInformation(0, "format", "arguments"); - - Assert.AreEqual(TraceEventType.Information, context.LastTraceEvent.EventType); - } - } - - [TestMethod] - public void WriteWarning_ShouldWriteTraceEventTypeWarningToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Warning)) - { - CompositionTraceSource.WriteWarning(0, "format", "arguments"); - - Assert.AreEqual(TraceEventType.Warning, context.LastTraceEvent.EventType); - } - } - - [TestMethod] - public void WriteError_ShouldWriteTraceEventTypeWarningToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Error)) - { - CompositionTraceSource.WriteError(0, "format", "arguments"); - - Assert.AreEqual(TraceEventType.Error, context.LastTraceEvent.EventType); - } - } - - [TestMethod] - public void WriteInformation_ShouldWriteCorrectSourceToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Information)) - { - CompositionTraceSource.WriteInformation(0, "format", "arguments"); - - Assert.AreEqual("System.ComponentModel.Composition", context.LastTraceEvent.Source); - } - } - - [TestMethod] - public void WriteWarning_ShouldWriteCorrectSourceToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Warning)) - { - CompositionTraceSource.WriteWarning(0, "format", "arguments"); - - Assert.AreEqual("System.ComponentModel.Composition", context.LastTraceEvent.Source); - } - } - - [TestMethod] - public void WriteError_ShouldWriteCorrectSourceToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Error)) - { - CompositionTraceSource.WriteError(0, "format", "arguments"); - - Assert.AreEqual("System.ComponentModel.Composition", context.LastTraceEvent.Source); - } - } - - [TestMethod] - public void WriteInformation_ValueAsTraceId_ShouldWriteIdToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Information)) - { - var expectations = Expectations.GetEnumValues(); - foreach (var e in expectations) - { - CompositionTraceSource.WriteInformation(e, "format", "arguments"); - - Assert.AreEqual(e, (CompositionTraceId)context.LastTraceEvent.Id); - } - } - } - - [TestMethod] - public void WriteWarning_ValueAsTraceId_ShouldWriteIdToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Warning)) - { - var expectations = Expectations.GetEnumValues(); - foreach (var e in expectations) - { - CompositionTraceSource.WriteWarning(e, "format", "arguments"); - - Assert.AreEqual(e, (CompositionTraceId)context.LastTraceEvent.Id); - } - } - } - - [TestMethod] - public void WriteError_ValueAsTraceId_ShouldWriteIdToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Error)) - { - var expectations = Expectations.GetEnumValues(); - foreach (var e in expectations) - { - CompositionTraceSource.WriteError(e, "format", "arguments"); - - Assert.AreEqual(e, (CompositionTraceId)context.LastTraceEvent.Id); - } - } - } - - [TestMethod] - public void WriteInformation_ValueAsFormat_ShouldWriteFormatToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Information)) - { - var expectations = Expectations.GetExceptionMessages(); - foreach (var e in expectations) - { - CompositionTraceSource.WriteInformation(0, e, "arguments"); - - Assert.AreEqual(e, context.LastTraceEvent.Format); - } - } - } - - [TestMethod] - public void WriteWarning_ValueAsFormat_ShouldWriteFormatToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Warning)) - { - var expectations = Expectations.GetExceptionMessages(); - foreach (var e in expectations) - { - CompositionTraceSource.WriteWarning(0, e, "arguments"); - - Assert.AreEqual(e, context.LastTraceEvent.Format); - } - } - } - - [TestMethod] - public void WriteError_ValueAsFormat_ShouldWriteFormatToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Error)) - { - var expectations = Expectations.GetExceptionMessages(); - foreach (var e in expectations) - { - CompositionTraceSource.WriteError(0, e, "arguments"); - - Assert.AreEqual(e, context.LastTraceEvent.Format); - } - } - } - - [TestMethod] - public void WriteInformation_ValueAsArgs_ShouldWriteArgsToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Information)) - { - var expectations = Expectations.GetObjectArraysWithNull(); - foreach (var e in expectations) - { - CompositionTraceSource.WriteInformation(0, "format", e); - - Assert.AreSame(e, context.LastTraceEvent.Args); - } - } - } - - [TestMethod] - public void WriteWarning_ValueAsArgs_ShouldWriteArgsToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Warning)) - { - var expectations = Expectations.GetObjectArraysWithNull(); - foreach (var e in expectations) - { - CompositionTraceSource.WriteWarning(0, "format", e); - - Assert.AreSame(e, context.LastTraceEvent.Args); - } - } - } - - [TestMethod] - public void WriteError_ValueAsArgs_ShouldWriteArgsToTraceListener() - { - using (var context = new TraceContext(SourceLevels.Error)) - { - var expectations = Expectations.GetObjectArraysWithNull(); - foreach (var e in expectations) - { - CompositionTraceSource.WriteError(0, "format", e); - - Assert.AreSame(e, context.LastTraceEvent.Args); - } - } - } - - private static IEnumerable GetSourceLevelsLessThan(SourceLevels level) - { - return GetOnSourceLevels(level, false); - } - - private static IEnumerable GetSourceLevelsGreaterThanOrEqualTo(SourceLevels level) - { - return GetOnSourceLevels(level, true); - } - - private static IEnumerable GetOnSourceLevels(SourceLevels sourceLevel, bool on) - { - // SourceSwitch determines if a particular level gets traced based on whether its bit is - // set in the current level. For example, if the current level was Warning (0000 0111), - // then Warning (0000 0111), Error (0000 0011), and Critical (0000 0001) all get traced. - - var levels = TestServices.GetEnumValues(); - - foreach (var level in levels) - { - if (level == 0) - continue; - - if (((level & sourceLevel) == sourceLevel) == on) - { - yield return level; - } - } - - if (!on) - { - yield return SourceLevels.Off; - } - } - - private static void ThrowsInternalError(Action action) - { - try - { - action(); - Assert.Fail(); - } - catch (Exception ex) - { - Type exceptionType = ex.GetType(); - - // The exception should not be a - // publicily catchable exception - Assert.IsFalse(exceptionType.IsVisible); - } - } -#endif - -#if SILVERLIGHT - [TestMethod] - public void CanWriteInformation_ShouldReturnFalse() - { - Assert.IsFalse(CompositionTraceSource.CanWriteInformation); - } - - [TestMethod] - public void CanWriteWarning_ShouldReturnDebuggerLogging() - { - Assert.AreEqual(CompositionTraceSource.CanWriteWarning, Debugger.IsLogging()); - } - - [TestMethod] - public void CanWriteError_ShouldReturnDebuggerLogging() - { - Assert.AreEqual(CompositionTraceSource.CanWriteError, Debugger.IsLogging()); - } - - [TestMethod] - public void CreateLogMessage_ContainsTraceEventType() - { - IEnumerable eventTypes = Expectations.GetEnumValues(); - - foreach(var eventType in eventTypes) - { - string message = SilverlightTraceWriter.CreateLogMessage(eventType, CompositionTraceId.Discovery_AssemblyLoadFailed, "Format"); - Assert.IsTrue(message.Contains(eventType.ToString()), "Should contain enum string of EventType"); - } - } - - [TestMethod] - public void CreateLogMessage_ContainsTraceIdAsInt() - { - IEnumerable traceIds = Expectations.GetEnumValues(); - - foreach(var traceId in traceIds) - { - string message = SilverlightTraceWriter.CreateLogMessage(SilverlightTraceWriter.TraceEventType.Information, traceId, "Format"); - Assert.IsTrue(message.Contains(((int)traceId).ToString()), "Should contain int version of TraceId"); - } - } - - [TestMethod] - public void CreateLogMessage_FormatNull_ThrowsArugmentNull() - { - ExceptionAssert.ThrowsArgumentNull("format", () => - SilverlightTraceWriter.CreateLogMessage(SilverlightTraceWriter.TraceEventType.Information, CompositionTraceId.Discovery_AssemblyLoadFailed, null)); - } - - [TestMethod] - public void CreateLogMessage_ArgumentsNull_ShouldCreateValidString() - { - string message = SilverlightTraceWriter.CreateLogMessage(SilverlightTraceWriter.TraceEventType.Information, CompositionTraceId.Discovery_AssemblyLoadFailed, "Format", null); - - Assert.IsFalse(string.IsNullOrEmpty(message)); - } - - [TestMethod] - public void CreateLogMessage_ArgumentsPassed_ShouldCreateValidString() - { - string message = SilverlightTraceWriter.CreateLogMessage(SilverlightTraceWriter.TraceEventType.Information, CompositionTraceId.Discovery_AssemblyLoadFailed, "{0}", 9999); - - Assert.IsTrue(message.Contains("9999")); - } -#endif - - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/DynamicMetadata.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/DynamicMetadata.cs deleted file mode 100644 index 14272bce8e7..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/DynamicMetadata.cs +++ /dev/null @@ -1,335 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.Composition; -using System.Linq; -using System.Reflection; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Hosting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class DynamicMetadata - { - [TestMethod] - public void SimpleAttachment() - { - MetadataStore.Container = new CompositionContainer(); - DynamicMetadataTestClass val = DynamicMetadataTestClass.Get("42"); - - var notYetAttached = TypeDescriptor.GetConverter(val); - Assert.IsFalse(notYetAttached.CanConvertFrom(typeof(string)), "The default type converter for DynamicMetadataTestClass shouldn't support round tripping"); - - MetadataStore.AddAttribute( - typeof(DynamicMetadataTestClass), - ( type, attributes) => - Enumerable.Concat( - attributes, - new Attribute[] { new TypeConverterAttribute(typeof(DynamicMetadataTestClassConverter)) } - ) - ); - var attached = TypeDescriptor.GetConverter(val); - Assert.IsTrue(attached.CanConvertFrom(typeof(string)), "The new type converter for DynamicMetadataTestClass should support round tripping"); - } - - [TestMethod] - public void LocalContainer() - { - var container1 = new CompositionContainer(); - TypeDescriptorServices dat = new TypeDescriptorServices(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(dat); - container1.Compose(batch); - MetadataStore.AddAttribute( - typeof(DynamicMetadataTestClass), - ( type, attributes) => - Enumerable.Concat( - attributes, - new Attribute[] { new TypeConverterAttribute(typeof(DynamicMetadataTestClassConverter)) } - ), - container1 - ); - DynamicMetadataTestClass val = DynamicMetadataTestClass.Get("42"); - - var notYetAttached = TypeDescriptor.GetConverter(val.GetType()); - Assert.IsFalse(notYetAttached.CanConvertFrom(typeof(string)), "The default type converter for DynamicMetadataTestClass shouldn't support round tripping"); - - var attached = dat.GetConverter(val.GetType()); - Assert.IsTrue(attached.CanConvertFrom(typeof(string)), "The new type converter for DynamicMetadataTestClass should support round tripping"); - } - - [TestMethod] - public void DualContainers() - { - var container1 = new CompositionContainer(); - TypeDescriptorServices dat1 = new TypeDescriptorServices(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(dat1); - container1.Compose(batch); - MetadataStore.AddAttribute( - typeof(DynamicMetadataTestClass), - ( type, attributes) => - Enumerable.Concat( - attributes, - new Attribute[] { new TypeConverterAttribute(typeof(DynamicMetadataTestClassConverter)) } - ), - container1 - ); - - - var container2 = new CompositionContainer(); - CompositionBatch batch2 = new CompositionBatch(); - TypeDescriptorServices dat2 = new TypeDescriptorServices(); - batch2.AddPart(dat2); - container2.Compose(batch2); - - DynamicMetadataTestClass val = DynamicMetadataTestClass.Get("42"); - - var attached1 = dat1.GetConverter(val.GetType()); - Assert.IsTrue(attached1.CanConvertFrom(typeof(string)), "The new type converter for DynamicMetadataTestClass should support round tripping"); - - var attached2 = dat2.GetConverter(val.GetType()); - Assert.IsFalse(attached2.CanConvertFrom(typeof(string)), "The default type converter for DynamicMetadataTestClass shouldn't support round tripping"); - } - - [TestCleanup] - public void ResetContainer() - { - MetadataStore.Container = null; - } - } - - - [Export] - public class TypeDescriptorServices - { - Dictionary providers = new Dictionary(); - - internal Dictionary Providers - { - get { return providers; } - set { providers = value; } - } - - public ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) - { - if (Providers.ContainsKey(objectType)) - { - return Providers[objectType].GetTypeDescriptor(objectType); - } - else - { - return null; - } - } - public void AddProvider(TypeDescriptionProvider provider, Type type) - { - Providers[type] = provider; - } - public TypeConverter GetConverter(Type type) - { - var ictd = GetTypeDescriptor(type, null); - if (ictd != null) - { - return ictd.GetConverter(); - } - else - { - return TypeDescriptor.GetConverter(type); - } - } - } - - public static class MetadataStore - { - public static CompositionContainer Container { get; set; } - static Dictionary registeredRedirect = new Dictionary(); - - public static void AddAttribute(Type target, Func, IEnumerable> provider) - { - AddAttribute(target, provider, MetadataStore.Container); - } - public static void AddAttribute(Type target, Func, IEnumerable> provider, CompositionContainer container) - { - ContainerUnawareProviderRedirect.GetRedirect(container)[target] = new MetadataStoreProvider(target, provider); - RegisterTypeDescriptorInterop(target); - } - private static void RegisterTypeDescriptorInterop(Type target) - { - if (!registeredRedirect.ContainsKey(target)) - { - var r = new ContainerUnawareProviderRedirect(target); - TypeDescriptor.AddProvider(r, target); - registeredRedirect[target] = r; - } - else - { - // force a uncache of the information from TypeDescriptor - // - TypeDescriptor.RemoveProvider(registeredRedirect[target], target); - TypeDescriptor.AddProvider(registeredRedirect[target], target); - } - } - public static TypeDescriptorServices GetTypeDescriptorServicesForContainer(CompositionContainer container) - { - if (container != null) - { - var result = container.GetExportedValueOrDefault(); - if (result == null) - { - var v = new TypeDescriptorServices(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(v); - container.Compose(batch); - return v; - } - - return result; - } - return null; - } - - private class ContainerUnawareProviderRedirect : TypeDescriptionProvider - { - public ContainerUnawareProviderRedirect(Type forType) - : base(TypeDescriptor.GetProvider(forType)) - { - } - public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) - { - var datd = GetTypeDescriptorServicesForContainer(MetadataStore.Container); - if (datd == null || !datd.Providers.ContainsKey(objectType)) - { - return base.GetTypeDescriptor(objectType, instance); - } - else - { - return datd.GetTypeDescriptor(objectType, instance); - } - } - - internal static Dictionary GetRedirect(CompositionContainer container) - { - TypeDescriptorServices v = GetTypeDescriptorServicesForContainer(container); - return v != null ? v.Providers : null; - } - } - - private class MetadataStoreProvider : TypeDescriptionProvider - { - Func, IEnumerable> provider; - public MetadataStoreProvider(Type forType, Func, IEnumerable> provider) - : base(TypeDescriptor.GetProvider(forType)) - { - this.provider = provider; - } - public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) - { - ICustomTypeDescriptor descriptor = base.GetTypeDescriptor(objectType, instance); - descriptor = new MetadataStoreTypeDescriptor(objectType, descriptor, provider); - return descriptor; - } - - } - - private class MetadataStoreTypeDescriptor : CustomTypeDescriptor - { - Type targetType; - Func, IEnumerable> provider; - public MetadataStoreTypeDescriptor(Type targetType, ICustomTypeDescriptor parent, Func, IEnumerable> provider) - : base(parent) - { - this.targetType = targetType; - this.provider = provider; - } - public override TypeConverter GetConverter() - { - TypeConverterAttribute attribute = (TypeConverterAttribute)GetAttributes()[typeof(TypeConverterAttribute)]; - if (attribute != null) - { - Type c = this.GetTypeFromName(attribute.ConverterTypeName); - if ((c != null) && typeof(TypeConverter).IsAssignableFrom(c)) - { - return (TypeConverter)Activator.CreateInstance(c); - } - } - return base.GetConverter(); - } - private Type GetTypeFromName(string typeName) - { - if ((typeName == null) || (typeName.Length == 0)) - { - return null; - } - int length = typeName.IndexOf(','); - Type type = null; - if (length == -1) - { - type = targetType.Assembly.GetType(typeName); - } - if (type == null) - { - type = Type.GetType(typeName); - } - if ((type == null) && (length != -1)) - { - type = Type.GetType(typeName.Substring(0, length)); - } - return type; - } - public override AttributeCollection GetAttributes() - { - var n = new List(); - foreach (var attr in provider(targetType, base.GetAttributes().OfType())) - { - n.Add(attr); - } - return new AttributeCollection(n.ToArray()); - } - } - } - - public class DynamicMetadataTestClass - { - int i; - - private DynamicMetadataTestClass(int i) - { - this.i = i; - } - - public override string ToString() - { - return i.ToString(); - } - - public static DynamicMetadataTestClass Get(string s) - { - return new DynamicMetadataTestClass(Int32.Parse(s)); - } - } - - public class DynamicMetadataTestClassConverter : TypeConverter - { - public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) - { - return sourceType == typeof(string); - } - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) - { - return ((DynamicMetadataTestClass)value).ToString(); - } - public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) - { - return DynamicMetadataTestClass.Get((string)value); - } - public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) - { - return destinationType == typeof(string); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Expectations.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Expectations.cs deleted file mode 100644 index 7dae8376ecf..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Expectations.cs +++ /dev/null @@ -1,336 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ -using System; -using System.Linq; -using System.UnitTesting; -using System.Collections.Generic; -using Microsoft.Internal.Collections; -using System.Reflection; -using System.Globalization; -using System.Collections.ObjectModel; -using System.Collections; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.ReflectionModel; -using System.Reflection.Emit; - -namespace System.ComponentModel.Composition -{ - internal static class Expectations - { - public static IEnumerable GetCulturesForFormatting() - { - yield return new CultureInfo("en-US"); // English (US) - yield return new CultureInfo("en-AU"); // English (Australian) - yield return new CultureInfo("en-CA"); // English (Canada) - yield return new CultureInfo("en-NZ"); // English (Great Britain) - yield return new CultureInfo("en-JM"); // English (Jamaica) - yield return new CultureInfo("pt-BR"); // Portuguese (Brazil) - yield return new CultureInfo("es-AR"); // Spanish (Argentina) - yield return new CultureInfo("ja-JP"); // Japanese (Japan) - yield return new CultureInfo("fr-FR"); // French (France) - yield return new CultureInfo("it-IT"); // Italian (Italy) - yield return new CultureInfo("de-DE"); // German (Germany) - yield return new CultureInfo("es-ES"); // Spanish (Spain) - yield return new CultureInfo("ko-KR"); // Korean (Korea) - yield return new CultureInfo("zh-TW"); // Chinese (Taiwan) - yield return new CultureInfo("zh-CN"); // Chinese (People's Republic of China) - } - - public static IEnumerable GetAssemblies() - { - yield return Assembly.GetExecutingAssembly(); - yield return Assembly.Load("mscorlib"); - } - - public static IEnumerable GetDisplayNames() - { - yield return ""; - yield return " "; - yield return " "; - yield return "DisplayName"; - yield return "displayname"; - yield return "This is the display name."; - } - - public static IEnumerable GetCompositionElements() - { - yield return ElementFactory.CreateChain(1); - yield return ElementFactory.CreateChain(2); - yield return ElementFactory.CreateChain(3); - yield return ElementFactory.CreateChain(5); - yield return ElementFactory.CreateChain(10); - } - - public static IEnumerable GetCompositionElementsWithNull() - { - foreach (var element in GetCompositionElements()) - { - yield return element; - } - - yield return null; - } - - public static IEnumerable GetCatalogs() - { - yield return CatalogFactory.Create(); - yield return CatalogFactory.CreateDefaultAttributed(); - } - - public static IEnumerable> GetCompositionErrors() - { - foreach (var value in GetEmptyCollections()) - { - yield return value; - } - - yield return new CompositionError[] { new CompositionError("") }; - yield return new CompositionError[] { new CompositionError(""), new CompositionError("Description") }; - yield return new CompositionError[] { new CompositionError(""), new CompositionError("Description"), ErrorFactory.Create(CompositionErrorId.InvalidExportMetadata, "Description", (Exception)null), ErrorFactory.Create(CompositionErrorId.Unknown, "Description", new Exception()) }; - } - - public static IEnumerable GetContractNames() - { - yield return " "; - yield return " "; - yield return "ContractName"; - yield return "contractName"; - yield return "{ContractName}"; - yield return "{ContractName}Name"; - yield return "System.Windows.Forms.Control"; - yield return "{System.Windows.Forms}Control"; - yield return "{9}Control"; - } - - public static IEnumerable GetContractNamesWithEmpty() - { - foreach (string contractName in GetContractNames()) - { - yield return contractName; - } - - yield return string.Empty; - } - - public static IEnumerable GetObjectsReferenceTypes() - { - yield return "Value"; - yield return new Collection(); - yield return new IEnumerable[0]; - } - - public static IEnumerable GetObjectsValueTypes() - { - yield return 10; - yield return 10.0; - yield return DayOfWeek.Wednesday; - } - - public static IEnumerable GetMetadataNames() - { - return GetContractNamesWithEmpty(); - } - - public static IEnumerable GetMetadataValues() - { - yield return null; - yield return string.Empty; - yield return ""; - yield return " "; - yield return " "; - yield return (Int32)1; - yield return (Byte)1; - yield return (Single)1.1; - yield return (Double)1.1; - yield return DayOfWeek.Wednesday; - } - - public static IEnumerable> GetRequiredMetadata() - { - yield return new Dictionary { { "", typeof(object) } }; - yield return new Dictionary { { " ", typeof(object) } }; - yield return new Dictionary { { " ", typeof(object) } }; - yield return new Dictionary { { " ", typeof(object) } }; - yield return new Dictionary { { "A", typeof(object) } }; - yield return new Dictionary { { "A", typeof(object) }, { "B", typeof(object) } }; - yield return new Dictionary { { "A", typeof(object) }, { "B", typeof(object) }, { "C", typeof(object) } }; - yield return new Dictionary { { "a", typeof(object) } }; - yield return new Dictionary { { "a", typeof(object) }, { "b", typeof(object) } }; - yield return new Dictionary { { "a", typeof(object) }, { "b", typeof(object) }, { "c", typeof(object) } }; - yield return new Dictionary { { "Metadata1", typeof(object) }, { "Metadata2", typeof(object) }, { "Metadata3", typeof(object) } }; - } - - public static IEnumerable> GetRequiredMetadataWithEmpty() - { - foreach (var requiredMetadata in GetRequiredMetadata()) - { - yield return requiredMetadata; - } - - yield return new Dictionary(); - } - - public static IEnumerable> GetMetadata() - { - yield return new ReadOnlyDictionary(null); - yield return new Dictionary(); - -#if !SILVERLIGHT - - yield return new SortedDictionary(); - yield return new SortedList(); - -#endif - var metadata = new Dictionary(); - metadata.Add("One", "Value"); - metadata.Add("Two", true); - metadata.Add("Three", 10); - metadata.Add("Four", 1.0); - metadata.Add("Five", null); - - yield return metadata; - } - - public static IEnumerable GetExceptionMessages() - { - yield return ""; - yield return " "; - yield return " "; - yield return "message"; - yield return "This is an error message."; - yield return "Line One." + Environment.NewLine + "Line Two."; - } - - public static IEnumerable GetInnerExceptions() - { - yield return new Exception(); - yield return new ArgumentException(); - yield return new SystemException(); -#if CLR40 - yield return new CompositionException(); - yield return new ImportCardinalityMismatchException(); -#endif - } - - public static IEnumerable GetInnerExceptionsWithNull() - { - foreach (var exception in GetInnerExceptions()) - { - yield return exception; - } - - yield return null; - } - - public static IEnumerable GetBooleans() - { - yield return false; - yield return true; - yield return false; - yield return true; - } - - public static IEnumerable GetAttributedDefinitions() - { - foreach (var type in GetAttributedTypes()) - { - yield return PartDefinitionFactory.CreateAttributed(type); - } - } - - public static IEnumerable GetTypes() - { - yield return typeof(void); - yield return typeof(Type); - yield return typeof(double); - yield return typeof(string); - yield return typeof(int); - yield return typeof(CompositionServices); - yield return typeof(ICompositionService); - } - - public static IEnumerable GetAttributedTypes() - { - foreach (Type type in typeof(Expectations).Assembly.GetTypes()) - { - var definition = AttributedModelDiscovery.CreatePartDefinitionIfDiscoverable(type, (ICompositionElement)null); - if (definition != null) - { - yield return type; - } - - } - } - - public static IEnumerable GetMembers() - { - yield return typeof(String).GetSingleMember("Length"); - yield return typeof(Int32).GetSingleMember("MaxValue"); - } - - public static IEnumerable GetEnumValues() where TEnum : struct - { - var values = TestServices.GetEnumValues(); - - foreach (TEnum value in values) - { - yield return value; - } - } - - public static IEnumerable GetInvalidEnumValues() where TEnum : struct - { - var bounds = GetEnumBounds(); - - yield return AddEnum(bounds.Item1, -3); - yield return AddEnum(bounds.Item1, -2); - yield return AddEnum(bounds.Item1, -1); - yield return AddEnum(bounds.Item2, 1); - yield return AddEnum(bounds.Item2, 2); - yield return AddEnum(bounds.Item2, 3); - yield return (TEnum)(object)(int.MinValue + 1); - yield return (TEnum)(object)int.MinValue; - yield return (TEnum)(object)int.MaxValue; - yield return (TEnum)(object)(int.MaxValue - 1); - } - - public static IEnumerable GetObjectArraysWithNull() - { - yield return null; - yield return new object[0]; - yield return new object[] { null }; - yield return new string[] { null }; - yield return new object[] { 1, "2", 3.0 }; - yield return new string[] { "1" }; - yield return new string[] { "1", "2" }; - yield return new string[] { "1", "2", "3" }; - } - - private static TEnum AddEnum(TEnum left, int right) where TEnum : struct - { - int intRight = (int)(object)left; - - return (TEnum)(object)(intRight + right); - } - - private static Tuple GetEnumBounds() where TEnum : struct - { - var values = TestServices.GetEnumValues(); - - return new Tuple(values.First(), values.Last()); - } - - private static IEnumerable> GetEmptyCollections() - { - yield return new T[0]; - yield return Enumerable.Empty(); - yield return new List(); - yield return new Collection(); - yield return new Dictionary().Keys; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportAttributeTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportAttributeTests.cs deleted file mode 100644 index 922fd66ef88..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportAttributeTests.cs +++ /dev/null @@ -1,63 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ExportAttributeTests - { - [TestMethod] - public void Constructor1_ShouldSetContractNamePropertyToEmptyString() - { - var attribute = new ExportAttribute(); - - Assert.IsNull(attribute.ContractName); - Assert.IsNull(attribute.ContractType); - } - - [TestMethod] - public void Constructor2_NullAsContractNameArgument_ShouldSetContractNamePropertyToEmptyString() - { - var attribute = new ExportAttribute((string)null); - - Assert.IsNull(attribute.ContractName); - Assert.IsNull(attribute.ContractType); - } - - [TestMethod] - public void Constructor3_NullAsContractTypeArgument_ShouldSetContractNamePropertyToEmptyString() - { - var attribute = new ExportAttribute((Type)null); - - Assert.IsNull(attribute.ContractName); - Assert.IsNull(attribute.ContractType); - } - - [TestMethod] - public void Constructor4_NullAsContractTypeArgument_ShouldSetContractNamePropertyToEmptyString() - { - var attribute = new ExportAttribute((string)null, (Type)null); - - Assert.IsNull(attribute.ContractName); - Assert.IsNull(attribute.ContractType); - } - - [TestMethod] - public void Constructor2_ValueAsContractNameArgument_ShouldSetContractNameProperty() - { - var expectations = Expectations.GetContractNamesWithEmpty(); - - foreach (var e in expectations) - { - var attribute = new ExportAttribute(e); - - Assert.AreEqual(e, attribute.ContractName); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportCollectionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportCollectionTests.cs deleted file mode 100644 index 40d8fbcdfea..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportCollectionTests.cs +++ /dev/null @@ -1,208 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Linq; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.UnitTesting; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ExportCollectionTests - { - public interface ICustomMetadata - { - bool PropertyName { get; } - } - - public class Importer - { - [ImportMany("Value")] - public Collection> CollectionPlain { get; set; } - - [ImportMany("Value")] - public Collection>> CollectionPlainRawMetadata { get; set; } - - [ImportMany("EmptyValue")] - public Collection> CollectionPlainEmpty { get; set; } - - [ImportMany("EmptyValue")] - public Collection>> CollectionPlainEmptyRawMetadata { get; set; } - - [ImportMany("Value")] - public Collection> CollectionTyped { get; set; } - - [ImportMany("Value")] - public Collection>> CollectionTypedRawMetadata { get; set; } - - [ImportMany("EmptyValue")] - public Collection> CollectionTypedEmpty { get; set; } - - [ImportMany("Value")] - public Collection> CollectionTypedMetadata { get; set; } - - [ImportMany("EmptyValue")] - public Collection> CollectionTypedMetadataEmpty { get; set; } - - [ImportMany("Value")] - public IEnumerable ReadWriteEnumerable { get; set; } - - [ImportMany("EmptyValue")] - public IEnumerable ReadWriteEnumerableEmpty { get; set; } - - [ImportMany("Value")] - public IEnumerable> MetadataUntypedEnumerable { get; set; } - - [ImportMany("Value")] - public IEnumerable>> MetadataUntypedEnumerableRawMetadata { get; set; } - - [ImportMany("EmptyValue")] - public IEnumerable> MetadataUntypedEnumerableEmpty { get; set; } - - [ImportMany("EmptyValue")] - public IEnumerable>> MetadataUntypedEnumerableEmptyRawMetadata { get; set; } - - [ImportMany("Value")] - public IEnumerable> MetadataTypedEnumerable { get; set; } - - [ImportMany("Value")] - public IEnumerable>> MetadataTypedEnumerableRawMetadata { get; set; } - - [ImportMany("EmptyValue")] - public IEnumerable> MetadataTypedEnumerableEmpty { get; set; } - - [ImportMany("Value")] - public IEnumerable> MetadataFullyTypedEnumerable { get; set; } - - [ImportMany("EmptyValue")] - public IEnumerable> MetadataFullyTypedEnumerableEmpty { get; set; } - - public void VerifyImport(params int[] expectedValues) - { - object[] untypedExpectedValues = expectedValues.Cast().ToArray(); - - ExportsAssert.AreEqual(CollectionPlain, untypedExpectedValues); - ExportsAssert.AreEqual(CollectionPlainRawMetadata, untypedExpectedValues); - EnumerableAssert.IsTrueForAll(CollectionPlainRawMetadata, i => true.Equals(i.Metadata["PropertyName"])); - EnumerableAssert.IsEmpty(CollectionPlainEmpty); - EnumerableAssert.IsEmpty(CollectionPlainEmptyRawMetadata); - - // Add a new Export to this collection to ensure that it doesn't - // modifiy the other collections because they should each have there - // own collection instance - CollectionPlain.Add(ExportFactory.Create("Value")); - - ExportsAssert.AreEqual(CollectionTyped, expectedValues); - ExportsAssert.AreEqual(CollectionTypedRawMetadata, expectedValues); - EnumerableAssert.IsTrueForAll(CollectionTypedRawMetadata, i => true.Equals(i.Metadata["PropertyName"])); - EnumerableAssert.IsEmpty(CollectionTypedEmpty); - - ExportsAssert.AreEqual(CollectionTypedMetadata, expectedValues); -#if !SILVERLIGHT // Silverlight doesn't support strongly typed metadata - EnumerableAssert.IsTrueForAll(CollectionTypedMetadata, i => true == i.Metadata.PropertyName); -#endif //!SILVERLIGHT - EnumerableAssert.IsEmpty(CollectionTypedMetadataEmpty); - - EnumerableAssert.AreEqual(ReadWriteEnumerable, expectedValues); - EnumerableAssert.IsEmpty(ReadWriteEnumerableEmpty); - - ExportsAssert.AreEqual(MetadataUntypedEnumerable, untypedExpectedValues); - ExportsAssert.AreEqual(MetadataUntypedEnumerableRawMetadata, untypedExpectedValues); - EnumerableAssert.IsTrueForAll(MetadataUntypedEnumerableRawMetadata, i => true.Equals(i.Metadata["PropertyName"])); - EnumerableAssert.IsEmpty(MetadataUntypedEnumerableEmpty); - EnumerableAssert.IsEmpty(MetadataUntypedEnumerableEmptyRawMetadata); - - ExportsAssert.AreEqual(MetadataTypedEnumerable, expectedValues); - ExportsAssert.AreEqual(MetadataTypedEnumerableRawMetadata, expectedValues); - EnumerableAssert.IsTrueForAll(MetadataTypedEnumerableRawMetadata, i => true.Equals(i.Metadata["PropertyName"])); - EnumerableAssert.IsEmpty(MetadataTypedEnumerableEmpty); - - ExportsAssert.AreEqual(MetadataFullyTypedEnumerable, expectedValues); -#if !SILVERLIGHT // Silverlight doesn't support strongly typed metadata - EnumerableAssert.IsTrueForAll(MetadataFullyTypedEnumerable, i => true == i.Metadata.PropertyName); -#endif //!SILVERLIGHT - EnumerableAssert.IsEmpty(MetadataFullyTypedEnumerableEmpty); - } - } - - public class ExporterDefault21 - { - public ExporterDefault21() { Value = 21; } - public ExporterDefault21(int v) { Value = v; } - - [Export("Value")] - [ExportMetadata("PropertyName", true)] - public int Value { get; set; } - } - - public class ExporterDefault42 - { - public ExporterDefault42() { Value = 42; } - public ExporterDefault42(int v) { Value = v; } - - [Export("Value")] - [ExportMetadata("PropertyName", true)] - public int Value { get; set; } - } - - - [TestMethod] - [TestProperty("Type", "Integration")] - public void ImportCollectionsFromContainerOnly() - { - var container = ContainerFactory.Create(); - Importer importer = new Importer(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(importer - , new ExporterDefault21() - , new ExporterDefault21(22) - , new ExporterDefault42() - , new ExporterDefault42(43)); - - container.Compose(batch); - - importer.VerifyImport(21, 22, 42, 43); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void ImportCollectionsFromCatalogOnly() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - Importer importer = new Importer(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(importer); - container.Compose(batch); - - importer.VerifyImport(21, 42); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void ImportCollectionsFormContainerAndCatalog() - { - var cat = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(cat); - Importer importer = new Importer(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddParts(importer - , new ExporterDefault21(22) - , new ExporterDefault42(43)); - - container.Compose(batch); - - importer.VerifyImport(22, 43, 21, 42); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportDefinitionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportDefinitionTests.cs deleted file mode 100644 index cb89ebf2945..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportDefinitionTests.cs +++ /dev/null @@ -1,186 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ExportDefinitionTests - { - [TestMethod] - public void Constructor1_ShouldSetMetadataPropertyToEmptyDictionary() - { - var definition = new DerivedExportDefinition(); - - EnumerableAssert.IsEmpty(definition.Metadata); - } - - [TestMethod] - public void Constructor1_ShouldSetMetadataPropertyToReadOnlyDictionary() - { - var definition = new DerivedExportDefinition(); - - ExceptionAssert.Throws(() => - { - definition.Metadata["Value"] = "Value"; - }); - } - - [TestMethod] - public void Constructor2_NullAsContractNameArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("contractName", () => - { - new ExportDefinition((string)null, new Dictionary()); - }); - } - - [TestMethod] - public void Constructor2_EmptyStringAsContractNameArgument_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("contractName", () => - { - new ExportDefinition(string.Empty, new Dictionary()); - }); - } - - [TestMethod] - public void Constructor2_ValueAsContractNameArgument_ShouldSetContractNameProperty() - { - var expectations = Expectations.GetContractNames(); - - foreach (var e in expectations) - { - var definition = new ExportDefinition(e, new Dictionary()); - - Assert.AreEqual(e, definition.ContractName); - } - } - - [TestMethod] - public void Constructor2_NullAsMetadataArgument_ShouldSetMetadataPropertyToEmptyDictionary() - { - var definition = new ExportDefinition("Contract", (IDictionary)null); ; - - EnumerableAssert.IsEmpty(definition.Metadata); - } - - [TestMethod] - public void Constructor2_NullAsMetadataArgument_ShouldSetMetadataPropertyToReadOnlyDictionary() - { - var definition = new ExportDefinition("Contract", (IDictionary)null); - - ExceptionAssert.Throws(() => - { - definition.Metadata["Value"] = "Value"; - }); - } - - [TestMethod] - public void Constructor2_WritableDictionaryAsMetadataArgument_ShouldSetMetadataPropertyToReadOnlyDictionary() - { - var definition = new ExportDefinition("Contract", new Dictionary()); - - ExceptionAssert.Throws(() => - { - definition.Metadata["Value"] = "Value"; - }); - } - - [TestMethod] - public void Constructor2_DictionaryAsMetadataArgument_ShouldSetMetadataProperty() - { - var expectations = Expectations.GetMetadata(); - - foreach (var e in expectations) - { - var definition = new ExportDefinition("Contract", e); - - EnumerableAssert.AreEqual(e, definition.Metadata); - } - } - - [TestMethod] - public void ContractName_WhenNotOverridden_ShouldThrowNotImplemented() - { - var definition = new DerivedExportDefinition(); - - ExceptionAssert.Throws(() => - { - var contractName = definition.ContractName; - }); - } - - [TestMethod] - public void ToString_WhenContractNameNotOverridden_ShouldThrowNotImplemented() - { - var definition = new DerivedExportDefinition(); - - ExceptionAssert.Throws(() => - { - definition.ToString(); - }); - } - - [TestMethod] - public void ToString_ShouldReturnContractNameProperty() - { - var expectations = Expectations.GetContractNames(); - - foreach (var e in expectations) - { - var definition = new ExportDefinition(e, new Dictionary()); - - Assert.AreEqual(e, definition.ToString()); - } - } - - [TestMethod] - public void ToString_ShouldReturnOverriddenContractNameProperty() - { - var expectations = Expectations.GetContractNamesWithEmpty(); - - foreach (var e in expectations) - { - var definition = new DerivedExportDefinition(() => e); - - Assert.AreEqual(e, definition.ToString()); - } - } - - private class DerivedExportDefinition : ExportDefinition - { - private readonly Func _contractNameGetter; - - public DerivedExportDefinition() - { - } - - public DerivedExportDefinition(Func contractNameGetter) - { - _contractNameGetter = contractNameGetter; - } - - public override string ContractName - { - get - { - if (_contractNameGetter != null) - { - return _contractNameGetter(); - } - - return base.ContractName; - } - } - } - } -} - diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportMetadataAttributeTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportMetadataAttributeTests.cs deleted file mode 100644 index 96ff3292d8f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportMetadataAttributeTests.cs +++ /dev/null @@ -1,70 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ExportMetadataAttributeTests - { - [TestMethod] - public void Constructor_NullAsNameArgument_ShouldSetNamePropertyToEmptyString() - { - var attribute = new ExportMetadataAttribute((string)null, "Value"); - - Assert.AreEqual(string.Empty, attribute.Name); - } - - [TestMethod] - public void Constructor_ShouldSetIsMultiplePropertyToFalse() - { - var attribute = new ExportMetadataAttribute("Name", "Value"); - - Assert.IsFalse(attribute.IsMultiple); - } - - [TestMethod] - public void Constructor_ValueAsNameArgument_ShouldSetNameProperty() - { - var expectations = Expectations.GetMetadataNames(); - - foreach (var e in expectations) - { - var attribute = new ExportMetadataAttribute(e, "Value"); - - Assert.AreEqual(e, attribute.Name); - } - } - - [TestMethod] - public void Constructor_ValueAsValueArgument_ShouldSetValueProperty() - { - var expectations = Expectations.GetMetadataValues(); - - foreach (var e in expectations) - { - var attribute = new ExportMetadataAttribute("Name", e); - - Assert.AreEqual(e, attribute.Value); - } - } - - [TestMethod] - public void IsMultiple_ValueAsValueArgument_ShouldSetPropert() - { - var expectations = Expectations.GetBooleans(); - - var attribute = new ExportMetadataAttribute("Name", "Value"); - - foreach (var e in expectations) - { - attribute.IsMultiple = e; - Assert.AreEqual(e, attribute.IsMultiple); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportProviderTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportProviderTests.cs deleted file mode 100644 index 56f03ec673c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportProviderTests.cs +++ /dev/null @@ -1,55 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Factories; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ExportProviderTests - { - [TestMethod] - public void GetExports2_NullAsDefinitionArgument_ShouldThrowArgumentNull() - { - var provider = ExportProviderFactory.Create(); - - ExceptionAssert.Throws(() => - { - provider.GetExports((ImportDefinition)null); - }); - } - - [TestMethod] - public void TryGetExports_NullAsDefinitionArgument_ShouldThrowArgumentNull() - { - var provider = ExportProviderFactory.Create(); - - ExceptionAssert.Throws(() => - { - IEnumerable exports; - provider.TryGetExports((ImportDefinition)null, null, out exports); - }); - } - - [TestMethod] - public void TryGetExports_NullAsDefinitionArgument_ShouldNotSetExportsArgument() - { - var provider = ExportProviderFactory.Create(); - - IEnumerable exports = new Export[0]; - IEnumerable results = exports; - - ExceptionAssert.Throws(() => - { - provider.TryGetExports((ImportDefinition)null, null, out results); - }); - - Assert.AreSame(exports, results); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportTests.cs deleted file mode 100644 index 44f43b83310..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportTests.cs +++ /dev/null @@ -1,439 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Factories; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ExportTests - { - [TestMethod] - public void Constructor1_ShouldNotThrow() - { - new NoOverridesExport(); - } - - [TestMethod] - public void Constructor2_NullAsExportedValueGetterArgument_ShouldThrowArgumentNull() - { - var definition = ExportDefinitionFactory.Create(); - - ExceptionAssert.ThrowsArgument("exportedValueGetter", () => - { - new Export(definition, (Func)null); - }); - } - - [TestMethod] - public void Constructor3_NullAsExportedValueGetterArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("exportedValueGetter", () => - { - new Export("ContractName", (Func)null); - }); - } - - [TestMethod] - public void Constructor4_NullAsExportedValueGetterArgument_ShouldThrowArgumentNull() - { - var metadata = new Dictionary(); - - ExceptionAssert.ThrowsArgument("exportedValueGetter", () => - { - new Export("ContractName", metadata, (Func)null); - }); - } - - [TestMethod] - public void Constructor2_NullAsDefinitionArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("definition", () => - { - new Export((ExportDefinition)null, () => null); - }); - } - - [TestMethod] - public void Constructor2_DefinitionAsDefinitionArgument_ShouldSetDefinitionProperty() - { - var definition = ExportDefinitionFactory.Create(); - - var export = new Export(definition, () => null); - - Assert.AreSame(definition, export.Definition); - } - - [TestMethod] - public void Constructor3_NullAsContractNameArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("contractName", () => - { - new Export((string)null, () => null); - }); - } - - [TestMethod] - public void Constructor4_NullAsContractNameArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("contractName", () => - { - new Export((string)null, new Dictionary(), () => null); - }); - } - - [TestMethod] - public void Constructor3_EmptyStringAsContractNameArgument_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("contractName", () => - { - new Export(string.Empty, () => null); - }); - } - - [TestMethod] - public void Constructor4_EmptyStringAsContractNameArgument_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("contractName", () => - { - new Export(string.Empty, new Dictionary(), () => null); - }); - } - - [TestMethod] - public void Constructor3_ValueAsContractNameArgument_ShouldSetDefinitionContractNameProperty() - { - var expectations = Expectations.GetContractNames(); - - foreach (var e in expectations) - { - var export = new Export(e, () => null); - - Assert.AreEqual(e, export.Definition.ContractName); - } - } - - - [TestMethod] - public void Constructor4_ValueAsContractNameArgument_ShouldSetDefinitionContractNameProperty() - { - var expectations = Expectations.GetContractNames(); - - foreach (var e in expectations) - { - var export = new Export(e, new Dictionary(), () => null); - - Assert.AreEqual(e, export.Definition.ContractName); - } - } - - [TestMethod] - public void Constructor3_ShouldSetMetadataPropertyToEmptyDictionary() - { - var export = new Export("ContractName", () => null); ; - - EnumerableAssert.IsEmpty(export.Metadata); - } - - [TestMethod] - public void Constructor4_NullAsMetadataArgument_ShouldSetMetadataPropertyToEmptyDictionary() - { - var export = new Export("ContractName", (IDictionary)null, () => null); ; - - EnumerableAssert.IsEmpty(export.Metadata); - } - - [TestMethod] - public void Constructor3_NullAsMetadataArgument_ShouldSetMetadataPropertyToReadOnlyDictionary() - { - var export = new Export("ContractName", () => null); - - ExceptionAssert.Throws(() => - { - export.Metadata["Value"] = "Value"; - }); - } - - [TestMethod] - public void Constructor4_NullAsMetadataArgument_ShouldSetMetadataPropertyToReadOnlyDictionary() - { - var export = new Export("ContractName", (IDictionary)null, () => null); - - ExceptionAssert.Throws(() => - { - export.Metadata["Value"] = "Value"; - }); - } - - [TestMethod] - public void Constructor4_WritableDictionaryAsMetadataArgument_ShouldSetMetadataPropertyToReadOnlyDictionary() - { - var export = new Export("ContractName", new Dictionary(), () => null); - - ExceptionAssert.Throws(() => - { - export.Metadata["Value"] = "Value"; - }); - } - - [TestMethod] - public void Constructor4_DictionaryAsMetadataArgument_ShouldSetMetadataProperty() - { - var expectations = Expectations.GetMetadata(); - - foreach (var e in expectations) - { - var export = new Export("ContractName", e, () => null); - - EnumerableAssert.AreEqual(e, export.Metadata); - } - } - - [TestMethod] - public void Constructor3_ShouldSetDefinitionMetadataPropertyToEmptyDictionary() - { - var export = new Export("ContractName", () => null); ; - - EnumerableAssert.IsEmpty(export.Definition.Metadata); - } - - [TestMethod] - public void Constructor4_NullAsMetadataArgument_ShouldSetDefinitionMetadataPropertyToEmptyDictionary() - { - var export = new Export("ContractName", (IDictionary)null, () => null); ; - - EnumerableAssert.IsEmpty(export.Definition.Metadata); - } - - [TestMethod] - public void Constructor3_ShouldSetDefinitionMetadataPropertyToReadOnlyDictionary() - { - var export = new Export("ContractName", () => null); - - ExceptionAssert.Throws(() => - { - export.Definition.Metadata["Value"] = "Value"; - }); - } - - [TestMethod] - public void Constructor4_NullAsMetadataArgument_ShouldSetDefinitionMetadataPropertyToReadOnlyDictionary() - { - var export = new Export("ContractName", (IDictionary)null, () => null); - - ExceptionAssert.Throws(() => - { - export.Definition.Metadata["Value"] = "Value"; - }); - } - - [TestMethod] - public void Constructor4_WritableDictionaryAsMetadataArgument_ShouldSetDefinitionMetadataPropertyToReadOnlyDictionary() - { - var export = new Export("ContractName", new Dictionary(), () => null); - - ExceptionAssert.Throws(() => - { - export.Definition.Metadata["Value"] = "Value"; - }); - } - - [TestMethod] - public void Constructor4_DictionaryAsMetadataArgument_ShouldSetDefinitionMetadataProperty() - { - var expectations = Expectations.GetMetadata(); - - foreach (var e in expectations) - { - var export = new Export("ContractName", e, () => null); - - EnumerableAssert.AreEqual(e, export.Definition.Metadata); - } - } - - [TestMethod] - public void Constructor2_FuncReturningAStringAsExportedValueGetter_ShouldBeReturnedByGetExportedValue() - { - var definition = ExportDefinitionFactory.Create(); - - var export = new Export(definition, () => "Value"); - - Assert.AreEqual("Value", export.Value); - } - - [TestMethod] - public void Constructor3_FuncReturningAStringAsExportedValueGetter_ShouldBeReturnedByGetExportedValue() - { - var export = new Export("ContractName", () => "Value"); - - Assert.AreEqual("Value", export.Value); - } - - [TestMethod] - public void Constructor4_FuncReturningAStringAsExportedValueGetter_ShouldBeReturnedByGetExportedValue() - { - var export = new Export("ContractName", new Dictionary(), () => "Value"); - - Assert.AreEqual("Value", export.Value); - } - - [TestMethod] - public void Constructor2_FuncReturningNullAsExportedValueGetter_ShouldBeReturnedByGetExportedValue() - { - var definition = ExportDefinitionFactory.Create(); - - var export = new Export(definition, () => null); - - Assert.IsNull(export.Value); - } - - [TestMethod] - public void Constructor3_FuncReturningNullAsExportedValueGetter_ShouldBeReturnedByGetExportedValue() - { - var export = new Export("ContractName", () => null); - - Assert.IsNull(export.Value); - } - - [TestMethod] - public void Constructor4_FuncReturningNullAsExportedValueGetter_ShouldBeReturnedByGetExportedValue() - { - var export = new Export("ContractName", new Dictionary(), () => null); - - Assert.IsNull(export.Value); - } - - [TestMethod] - public void Metadata_DerivedExportDefinition_ShouldReturnDefinitionMetadata() - { - var expectations = Expectations.GetMetadata(); - - foreach (var e in expectations) - { - var definition = ExportDefinitionFactory.Create("ContractName", e); - - var export = new DerivedExport(definition); - - EnumerableAssert.AreEqual(e, export.Metadata); - } - } - - [TestMethod] - public void Definition_WhenNotOverridden_ShouldThrowNotImplemented() - { - var export = new NoOverridesExport(); - - ExceptionAssert.Throws(() => - { - var definition = export.Definition; - }); - } - - [TestMethod] - public void Metadata_WhenDefinitionNotOverridden_ShouldThrowNotImplemented() - { - var export = new NoOverridesExport(); - - ExceptionAssert.Throws(() => - { - var definition = export.Metadata; - }); - } - - [TestMethod] - public void GetExportedValue_WhenGetExportedValueCoreNotOverridden_ShouldThrowNotImplemented() - { - var export = new NoOverridesExport(); - - ExceptionAssert.Throws(() => - { - var value = export.Value; - }); - } - - [TestMethod] - public void GetExportedValue_ShouldCacheExportedValueGetter() - { - int count = 0; - - var export = new Export("ContractName", () => - { - count++; - return count; - }); - - Assert.AreEqual(1, export.Value); - Assert.AreEqual(1, export.Value); - Assert.AreEqual(1, export.Value); - } - - - [TestMethod] - public void GetExportedValue_ShouldCacheOverrideGetExportedValueCore() - { - int count = 0; - - var export = new DerivedExport(() => - { - count++; - return count; - }); - - Assert.AreEqual(1, export.Value); - Assert.AreEqual(1, export.Value); - Assert.AreEqual(1, export.Value); - } - - [TestMethod] - public void GetExportedValue_ThrowingFuncAsObjectGetterArgument_ShouldThrow() - { - var exceptionToThrow = new Exception(); - - var export = new Export("ContractName", new Dictionary(), () => - { - throw exceptionToThrow; - }); - - ExceptionAssert.Throws(exceptionToThrow, RetryMode.Retry, () => - { - var value = export.Value; - }); - } - - - private class NoOverridesExport : Export - { - } - - private class DerivedExport : Export - { - private readonly Func _exportedValueGetter; - private readonly ExportDefinition _definition; - - public DerivedExport(ExportDefinition definition) - { - _definition = definition; - } - - public DerivedExport(Func exportedValueGetter) - { - _exportedValueGetter = exportedValueGetter; - } - - public override ExportDefinition Definition - { - get { return _definition; } - } - - protected override object GetExportedValueCore() - { - return _exportedValueGetter(); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportableAttributeTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportableAttributeTests.cs deleted file mode 100644 index 51b23d42a5f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ExportableAttributeTests.cs +++ /dev/null @@ -1,224 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.Linq; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Reflection; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class MetadataAttributeTests - { - [TestMethod] - [TestProperty("Type", "Integration")] - public void UntypedStructureTest() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(AttributedModelServices.CreatePart(new BasicTestComponent())); - container.Compose(batch); - var export = container.GetExport>(); - - - Assert.IsNotNull(export.Metadata, "It should have metadata"); - Assert.AreEqual("One", export.Metadata["String1"], "Property attribute should copy straight across"); - Assert.AreEqual("Two", export.Metadata["String2"], "Property attribute should copy straight across"); - var e = export.Metadata["Numbers"] as IList; - Assert.IsNotNull(e, "Should get a collection of numbers"); - Assert.IsTrue(e.Contains(1), "Should have 1 in the list"); - Assert.IsTrue(e.Contains(2), "Should have 2 in the list"); - Assert.IsTrue(e.Contains(3), "Should have 3 in the list"); - Assert.AreEqual(3, e.Count, "Should be three numbers total"); - } - -#if !SILVERLIGHT - // Silverlight doesn't support strongly typed metadata - [TestMethod] - [TestProperty("Type", "Integration")] - public void StronglyTypedStructureTest() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(AttributedModelServices.CreatePart(new BasicTestComponent())); - container.Compose(batch); - - var export = container.GetExport(); - - Assert.IsNotNull(export.Metadata, "It should have metadata"); - Assert.AreEqual("One", export.Metadata.String1, "Property should copy straight across"); - Assert.AreEqual("Two", export.Metadata.String2, "Property should copy straight across"); - Assert.IsTrue(export.Metadata.Numbers.Contains(1), "Should have 1 in the list"); - Assert.IsTrue(export.Metadata.Numbers.Contains(2), "Should have 2 in the list"); - Assert.IsTrue(export.Metadata.Numbers.Contains(3), "Should have 3 in the list"); - Assert.AreEqual(3, export.Metadata.Numbers.Length, "Should be three numbers total"); - } -#endif //!SILVERLIGHT - - [Export] - // Should cause a conflict with the multiple nature of Name.Bar because - // it isn't marked with IsMultiple=true - [ExportMetadata("Bar", "Blah")] - [Name("MEF")] - [Name("MEF2")] - [PartNotDiscoverable] - public class BasicTestComponentWithInvalidMetadata - { - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void InvalidMetadataAttributeTest() - { - ComposablePart part = AttributedModelServices.CreatePart(new BasicTestComponentWithInvalidMetadata()); - ExportDefinition export = part.ExportDefinitions.First(); - - var ex = ExceptionAssert.Throws(RetryMode.DoNotRetry, () => - { - var metadata = export.Metadata; - }); - - Assert.IsTrue(ex.Message.Contains("Bar")); - } - - [AttributeUsage(AttributeTargets.All)] - [MetadataAttribute] - public class MetadataWithInvalidCustomAttributeType : Attribute - { - public PersonClass Person { get { return new PersonClass(); } } - - public class PersonClass - { - public string First { get { return "George"; } } - public string Last { get { return "Washington"; } } - } - } - - [Export] - [MetadataWithInvalidCustomAttributeType] - [PartNotDiscoverable] - public class ClassWithInvalidCustomAttributeType - { - - } - - [TestMethod] - public void InvalidAttributType_CustomType_ShouldThrow() - { - ComposablePart part = AttributedModelServices.CreatePart(new ClassWithInvalidCustomAttributeType()); - ExportDefinition export = part.ExportDefinitions.First(); - - // Should throw InvalidOperationException during discovery because - // the person class is an invalid metadata type - ExceptionAssert.Throws(RetryMode.DoNotRetry, () => - { - var metadata = export.Metadata; - }); - } - - [AttributeUsage(AttributeTargets.All)] - [MetadataAttribute] - public class MetadataWithInvalidVersionPropertyAttributeType : Attribute - { - public MetadataWithInvalidVersionPropertyAttributeType() - { - this.Version = new Version(1, 1); - } - public Version Version { get; set; } - } - - [Export] - [MetadataWithInvalidVersionPropertyAttributeType] - [PartNotDiscoverable] - public class ClassWithInvalidVersionPropertyAttributeType - { - - } - - [TestMethod] - public void InvalidAttributType_VersionPropertyType_ShouldThrow() - { - ComposablePart part = AttributedModelServices.CreatePart(new ClassWithInvalidVersionPropertyAttributeType()); - ExportDefinition export = part.ExportDefinitions.First(); - - // Should throw InvalidOperationException during discovery because - // the person class is an invalid metadata type - ExceptionAssert.Throws(RetryMode.DoNotRetry, () => - { - var metadata = export.Metadata; - }); - } - - [MetadataAttribute] - public class BaseMetadataAttribute : Attribute - { - public string BaseKey { get { return "BaseValue"; } } - } - - public class DerivedMetadataAttribute : BaseMetadataAttribute - { - public string DerivedKey { get { return "DerivedValue"; } } - } - - [Export] - [DerivedMetadata] - public class ExportWithDerivedMetadataAttribute { } - - [TestMethod] - public void DerivedMetadataAttributeAttribute_ShouldSupplyMetadata() - { - ComposablePart part = AttributedModelServices.CreatePart(new ExportWithDerivedMetadataAttribute()); - ExportDefinition export = part.ExportDefinitions.Single(); - - Assert.AreEqual("BaseValue", export.Metadata["BaseKey"]); - Assert.AreEqual("DerivedValue", export.Metadata["DerivedKey"]); - } - } - - [AttributeUsage(AttributeTargets.All)] - [MetadataAttribute] - public class BasicMetadataAttribute : Attribute - { - public string String1 { get { return "One"; } } - - public string String2 { get { return "Two"; } } - - public int[] Numbers { get { return new int[] { 1, 2, 3 }; } } - - public CreationPolicy Policy { get { return CreationPolicy.NonShared; } } - - public Type Type { get { return typeof(BasicMetadataAttribute); } } - } - - public interface IStronglyTypedStructure - { - string String1 { get; } - string String2 { get; } - int[] Numbers { get; } - CreationPolicy Policy { get; } - Type Type { get; } - } - - [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] - [MetadataAttribute] - public class Name : Attribute - { - public Name(string name) { Bar = name; } - - public string Bar { set; get; } - } - - [PartNotDiscoverable] - [Export] - [BasicMetadata] - public class BasicTestComponent - { - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Extensibility/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Extensibility/.gitattributes deleted file mode 100644 index 68b098c1438..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Extensibility/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/CustomImportAttribute.cs -crlf -/CustomImportManyAttribute.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Extensibility/CustomImportAttribute.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Extensibility/CustomImportAttribute.cs deleted file mode 100644 index 0894a2061a9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Extensibility/CustomImportAttribute.cs +++ /dev/null @@ -1,20 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition.Extensibility -{ - [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)] - public class CustomImportAttribute : ImportAttribute - { - public CustomImportAttribute() - { - } - - public CustomImportAttribute(Type type) - : base(type) - { - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Extensibility/CustomImportManyAttribute.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Extensibility/CustomImportManyAttribute.cs deleted file mode 100644 index b119e79b05e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Extensibility/CustomImportManyAttribute.cs +++ /dev/null @@ -1,20 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition.Extensibility -{ - [AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)] - public class CustomImportManyAttribute : ImportManyAttribute - { - public CustomImportManyAttribute() - { - } - - public CustomImportManyAttribute(Type type) - : base(type) - { - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/.gitattributes deleted file mode 100644 index 6f6eeedaedf..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/.gitattributes +++ /dev/null @@ -1,31 +0,0 @@ -/CatalogFactory.DerivedComposablePartCatalog.cs -crlf -/CatalogFactory.DisposableComposablePartCatalog.cs -crlf -/CatalogFactory.FilteredComposablePartCatalog.cs -crlf -/CatalogFactory.MutableComposablePartCatalog.cs -crlf -/CatalogFactory.NoOverridesComposablePartCatalog.cs -crlf -/CatalogFactory.NonFilteringTypeCatalog.cs -crlf -/CatalogFactory.cs -crlf -/ConstraintFactory.cs -crlf -/ContainerFactory.DisposableCompositionContainer.cs -crlf -/ContainerFactory.NoOverridesCompositionContainer.cs -crlf -/ContainerFactory.cs -crlf -/ElementFactory.CompositionElement.cs -crlf -/ElementFactory.cs -crlf -/ErrorFactory.cs -crlf -/ExportDefinitionFactory.DerivedExportDefinition.cs -crlf -/ExportDefinitionFactory.cs -crlf -/ExportFactory.cs -crlf -/ExportProviderFactory.NoOverridesExportProvider.cs -crlf -/ExportProviderFactory.RecomposableExportProvider.cs -crlf -/ExportProviderFactory.cs -crlf -/ImportDefinitionFactory.DerivedContractBasedImportDefinition.cs -crlf -/ImportDefinitionFactory.DerivedImportDefinition.cs -crlf -/ImportDefinitionFactory.cs -crlf -/PartDefinitionFactory.DerivedComposablePartDefinition.cs -crlf -/PartDefinitionFactory.NoOverridesComposablePartDefinition.cs -crlf -/PartDefinitionFactory.cs -crlf -/PartFactory.DisposableComposablePart.cs -crlf -/PartFactory.NoOverridesComposablePart.cs -crlf -/PartFactory.cs -crlf -/ReflectionFactory.MockParameterInfo.cs -crlf -/ReflectionFactory.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.DerivedComposablePartCatalog.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.DerivedComposablePartCatalog.cs deleted file mode 100644 index e5a46572fcc..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.DerivedComposablePartCatalog.cs +++ /dev/null @@ -1,28 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.Collections.Generic; - -namespace System.ComponentModel.Composition.Factories -{ - partial class CatalogFactory - { - private class DerivedComposablePartCatalog : ComposablePartCatalog - { - private readonly IEnumerable _definitions; - - public DerivedComposablePartCatalog(IEnumerable definitions) - { - _definitions = definitions; - } - - public override IQueryable Parts - { - get { return _definitions.AsQueryable(); } - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.DisposableComposablePartCatalog.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.DisposableComposablePartCatalog.cs deleted file mode 100644 index 9adf55c7236..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.DisposableComposablePartCatalog.cs +++ /dev/null @@ -1,45 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.Factories -{ - partial class CatalogFactory - { - // NOTE: Do not add any more behavior to this class, as ComposablePartCatalogTests.cs - // uses this to verify default behavior of the base class. - private class DisposableComposablePartCatalog : ComposablePartCatalog - { - private readonly Action _disposeCallback; - - public DisposableComposablePartCatalog(Action disposeCallback) - { - Assert.IsNotNull(disposeCallback); - - _disposeCallback = disposeCallback; - } - - ~DisposableComposablePartCatalog() - { - Dispose(false); - } - - public override IQueryable Parts - { - get { throw new NotImplementedException(); } - } - - protected override void Dispose(bool disposing) - { - _disposeCallback(disposing); - - base.Dispose(disposing); - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.FilteredComposablePartCatalog.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.FilteredComposablePartCatalog.cs deleted file mode 100644 index c891c964180..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.FilteredComposablePartCatalog.cs +++ /dev/null @@ -1,65 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.Hosting; -using System.Linq; -using System.Linq.Expressions; - -namespace System.ComponentModel.Composition.Factories -{ - partial class CatalogFactory - { - public class FilteredCatalog : ComposablePartCatalog, INotifyComposablePartCatalogChanged - { - private readonly ComposablePartCatalog _inner; - private readonly INotifyComposablePartCatalogChanged _innerNotifyChange; - private readonly IQueryable _partsQuery; - - public FilteredCatalog(ComposablePartCatalog inner, - Func filter) - { - _inner = inner; - _innerNotifyChange = inner as INotifyComposablePartCatalogChanged; - _partsQuery = inner.Parts.Where(filter).AsQueryable(); - } - - public override IQueryable Parts - { - get - { - return _partsQuery; - } - } - - public event EventHandler Changed - { - add - { - if (_innerNotifyChange != null) - _innerNotifyChange.Changed += value; - } - remove - { - if (_innerNotifyChange != null) - _innerNotifyChange.Changed -= value; - } - } - - public event EventHandler Changing - { - add - { - if (_innerNotifyChange != null) - _innerNotifyChange.Changing += value; - } - remove - { - if (_innerNotifyChange != null) - _innerNotifyChange.Changing -= value; - } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.MutableComposablePartCatalog.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.MutableComposablePartCatalog.cs deleted file mode 100644 index 0cc4862d485..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.MutableComposablePartCatalog.cs +++ /dev/null @@ -1,67 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition.Hosting; - -namespace System.ComponentModel.Composition.Factories -{ - partial class CatalogFactory - { - public class MutableComposablePartCatalog : ComposablePartCatalog, INotifyComposablePartCatalogChanged - { - private readonly HashSet _definitions; - - public MutableComposablePartCatalog(IEnumerable definitions) - { - _definitions = new HashSet(definitions); - } - - public void AddDefinition(ComposablePartDefinition definition) - { - OnDefinitionsChanged(definition, true); - } - - public void RemoveDefinition(ComposablePartDefinition definition) - { - OnDefinitionsChanged(definition, false); - } - - public override IQueryable Parts - { - get { return _definitions.AsQueryable(); } - } - - private void OnDefinitionsChanged(ComposablePartDefinition definition, bool added) - { - ComposablePartDefinition[] addedDefinitions = added ? new ComposablePartDefinition[] { definition } : new ComposablePartDefinition[0]; - ComposablePartDefinition[] removeDefinitions = added ? new ComposablePartDefinition[0] : new ComposablePartDefinition[] { definition }; - - var e = new ComposablePartCatalogChangeEventArgs(addedDefinitions, removeDefinitions, null); - Changing(this, e); - - if (added) - { - _definitions.Add(definition); - } - else - { - _definitions.Remove(definition); - } - - if (Changed != null) - { - Changed(this, e); - } - } - - public event EventHandler Changed; - - public event EventHandler Changing; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.NoOverridesComposablePartCatalog.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.NoOverridesComposablePartCatalog.cs deleted file mode 100644 index d0b615eeaa9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.NoOverridesComposablePartCatalog.cs +++ /dev/null @@ -1,26 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; -using System.Linq; - -namespace System.ComponentModel.Composition.Factories -{ - partial class CatalogFactory - { - // NOTE: Do not add any more behavior to this class, as ComposablePartCatalogTests.cs - // uses this to verify default behavior of the base class. - private class NoOverridesComposablePartCatalog : ComposablePartCatalog - { - public NoOverridesComposablePartCatalog() - { - } - - public override IQueryable Parts - { - get { return Enumerable.Empty().AsQueryable(); } - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.NonFilteringTypeCatalog.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.NonFilteringTypeCatalog.cs deleted file mode 100644 index 784c54d695a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.NonFilteringTypeCatalog.cs +++ /dev/null @@ -1,32 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.Collections.Generic; - -namespace System.ComponentModel.Composition.Factories -{ - partial class CatalogFactory - { - private class NonFilteringTypeCatalog : ComposablePartCatalog - { - private readonly List _definitions; - - public NonFilteringTypeCatalog(params Type[] types) - { - this._definitions = new List(); - foreach (Type type in types) - { - this._definitions.Add(AttributedModelServices.CreatePartDefinition(type, null)); - } - } - - public override IQueryable Parts - { - get { return this._definitions.AsQueryable(); } - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.cs deleted file mode 100644 index cb957a2d303..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/CatalogFactory.cs +++ /dev/null @@ -1,77 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; - -namespace System.ComponentModel.Composition.Factories -{ - public static partial class CatalogFactory - { - public static AggregateCatalog CreateAggregateCatalog() - { - return new AggregateCatalog(); - } - - public static AggregateCatalog CreateAggregateCatalog(params ComposablePartCatalog[] catalogs) - { - return new AggregateCatalog(catalogs); - } - - public static ComposablePartCatalog Create() - { - return new NoOverridesComposablePartCatalog(); - } - - public static ComposablePartCatalog Create(params ComposablePart[] parts) - { - var definitions = parts.Select(part => PartDefinitionFactory.Create(part)); - - return Create(definitions.ToArray()); - } - - public static ComposablePartCatalog Create(params ComposablePartDefinition[] definitions) - { - return new DerivedComposablePartCatalog(definitions); - } - - public static ComposablePartCatalog CreateDefaultAttributed() - { - return CreateAttributed(typeof(CatalogFactory).Assembly); - } - - public static ComposablePartCatalog CreateDisposable(Action disposeCallback) - { - return new DisposableComposablePartCatalog(disposeCallback); - } - - public static ComposablePartCatalog CreateAttributed(Assembly assembly) - { - return new AssemblyCatalog(assembly); - } - - public static ComposablePartCatalog CreateAttributed(params Type[] types) - { - return new TypeCatalog(types); - } - - public static ComposablePartCatalog CreateNonFilteredAttributed(params Type[] types) - { - return new NonFilteringTypeCatalog(types); - } - - public static MutableComposablePartCatalog CreateMutable(params ComposablePartDefinition[] definitions) - { - return new MutableComposablePartCatalog(definitions); - } - - public static ComposablePartCatalog CreateFiltered(ComposablePartCatalog catalog, Func filter) - { - return new FilteredCatalog(catalog, filter); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ConstraintFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ConstraintFactory.cs deleted file mode 100644 index da087350756..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ConstraintFactory.cs +++ /dev/null @@ -1,18 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.Linq.Expressions; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - internal static class ConstraintFactory - { - public static Expression> Create(string contractName) - { - return definition => definition.ContractName.Equals(contractName); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ContainerFactory.DisposableCompositionContainer.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ContainerFactory.DisposableCompositionContainer.cs deleted file mode 100644 index 57710ec61e4..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ContainerFactory.DisposableCompositionContainer.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.Factories -{ - partial class ContainerFactory - { - // NOTE: Do not add any more behavior to this class, as CompositionContainerTests.cs - // uses this to verify default behavior of the base class. - private class DisposableCompositionContainer : CompositionContainer - { - private readonly Action _disposeCallback; - - public DisposableCompositionContainer(Action disposeCallback) - { - Assert.IsNotNull(disposeCallback); - - _disposeCallback = disposeCallback; - } - - ~DisposableCompositionContainer() - { - Dispose(false); - } - - protected override void Dispose(bool disposing) - { - _disposeCallback(disposing); - - base.Dispose(disposing); - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ContainerFactory.NoOverridesCompositionContainer.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ContainerFactory.NoOverridesCompositionContainer.cs deleted file mode 100644 index ddfd16f4c7c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ContainerFactory.NoOverridesCompositionContainer.cs +++ /dev/null @@ -1,23 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.Factories -{ - partial class ContainerFactory - { - // NOTE: Do not add any more behavior to this class, as CompositionContainerTests.cs - // uses this to verify default behavior of the base class. - private class NoOverridesCompositionContainer : CompositionContainer - { - public NoOverridesCompositionContainer() - { - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ContainerFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ContainerFactory.cs deleted file mode 100644 index 059e665de79..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ContainerFactory.cs +++ /dev/null @@ -1,106 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; - - -namespace System.ComponentModel.Composition.Factories -{ - internal static partial class ContainerFactory - { - public static CompositionContainer Create() - { - return Create((ComposablePart[])null); - } - - public static CompositionContainer Create(ComposablePartCatalog catalog) - { - return new CompositionContainer(catalog); - } - - public static CompositionContainer Create(CompositionContainer parent) - { - return new CompositionContainer(parent); - } - - public static CompositionContainer Create(params ComposablePart[] parts) - { - return Create((CompositionContainer)null, parts); - } - - public static CompositionContainer CreateWithDefaultAttributedCatalog() - { - var catalog = CatalogFactory.CreateDefaultAttributed(); - - return Create(catalog); - } - - public static CompositionContainer CreateWithAttributedCatalog(params Type[] types) - { - var catalog = CatalogFactory.CreateAttributed(types); - - return Create(catalog); - } - - public static CompositionContainer CreateAttributed(params object[] parts) - { - var container = new CompositionContainer(); - var partsArray = new ComposablePart[parts.Length]; - - for (int i = 0; i < parts.Length; i++) - { - Assert.IsNotInstanceOfType(parts[i], typeof(Type), "You should be using CreateWithAttributedCatalog not CreateAttributed"); - partsArray[i] = PartFactory.CreateAttributed(parts[i]); - } - - return Create(partsArray); - } - - public static CompositionContainer Create(CompositionContainer parent, params ComposablePart[] parts) - { - CompositionContainer container; - if (parent == null) - { - container = new CompositionContainer(); - } - else - { - container = new CompositionContainer(parent); - } - - if (parts != null) - { - CompositionBatch batch = new CompositionBatch(parts, Enumerable.Empty()); - container.Compose(batch); - } - - return container; - } - - public static CompositionContainer Create(params MicroExport[] exports) - { - var part = PartFactory.CreateExporter(exports); - - return Create(part); - } - - public static CompositionContainer Create(CompositionContainer parent, params MicroExport[] exports) - { - var part = PartFactory.CreateExporter(exports); - - return Create(parent, part); - } - - - public static CompositionContainer CreateDisposable(Action disposeCallback) - { - return new DisposableCompositionContainer(disposeCallback); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ElementFactory.CompositionElement.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ElementFactory.CompositionElement.cs deleted file mode 100644 index 71f89073361..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ElementFactory.CompositionElement.cs +++ /dev/null @@ -1,35 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - partial class ElementFactory - { - private class CompositionElement : ICompositionElement - { - private readonly string _displayName; - private readonly ICompositionElement _origin; - - public CompositionElement(string displayName, ICompositionElement origin) - { - _displayName = displayName; - _origin = origin; - } - - public string DisplayName - { - get { return _displayName; } - } - - public ICompositionElement Origin - { - get { return _origin; } - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ElementFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ElementFactory.cs deleted file mode 100644 index 34d15343d3a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ElementFactory.cs +++ /dev/null @@ -1,45 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - internal static partial class ElementFactory - { - public static ICompositionElement Create() - { - return Create((string)null, (ICompositionElement)null); - } - - public static ICompositionElement Create(string displayName) - { - return Create(displayName, (ICompositionElement)null); - } - - public static ICompositionElement Create(ICompositionElement origin) - { - return Create((string)null, origin); - } - - public static ICompositionElement Create(string displayName, ICompositionElement origin) - { - return new CompositionElement(displayName, origin); - } - - public static ICompositionElement CreateChain(int count) - { - ICompositionElement previousElement = null; - - for (int i = 0; i < count; i++) - { - previousElement = Create((count - i).ToString(), previousElement); - } - - return previousElement; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ErrorFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ErrorFactory.cs deleted file mode 100644 index 2424739283f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ErrorFactory.cs +++ /dev/null @@ -1,182 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.IO; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.Factories -{ - internal static partial class ErrorFactory - { - public static CompositionError Create(ICompositionElement element) - { - return Create(CompositionErrorId.Unknown, (string)null, element, (Exception)null); - } - - public static CompositionError Create(Exception exception) - { - return Create(CompositionErrorId.Unknown, (string)null, (ICompositionElement)null, exception); - } - - public static CompositionError Create(string message) - { - return Create(CompositionErrorId.Unknown, message, (ICompositionElement)null, (Exception)null); - } - - public static CompositionError Create(string message, Exception exception) - { - return Create(CompositionErrorId.Unknown, message, (ICompositionElement)null, exception); - } - - public static CompositionError Create(CompositionErrorId errorId) - { - return Create(errorId, errorId.ToString(), (ICompositionElement)null, (Exception)null); - } - - public static CompositionError Create(CompositionErrorId errorId, string message, Exception exception) - { - return new CompositionError(errorId, message, (ICompositionElement)null, exception); - } - - public static CompositionError Create(CompositionErrorId errorId, string message, ICompositionElement element, Exception exception) - { - return new CompositionError(errorId, message, element, exception); - } - - public static IEnumerable CreateFromDsl(string format) - { - CompositionException exception = (CompositionException)CreateFromDslCore(format); - - return exception.Errors; - } - - private static Exception CreateFromDslCore(string format) - { - List> identifiers = new List>(); - - StringBuilder token = new StringBuilder(); - StringReader reader = new StringReader(format); - - while (reader.Peek() != -1) - { - char c = (char)reader.Read(); - if (c == '|') - { - AddIdentifier(identifiers, token); - continue; - } - - if (c == '(') - { - string dsl = ReadToNextMatchingParenthesis(reader); - - AddIdentifier(identifiers, token, dsl); - continue; - } - - token.Append(c); - } - - AddIdentifier(identifiers, token); - - return CreateFromList(identifiers); - } - - private static Exception CreateFromList(List> identifiers) - { - List errors = new List(); - Exception exception = null; - foreach (var identifier in identifiers) - { - Exception innerException = null; - if (identifier.Item2 != null) - { - innerException = CreateFromDslCore(identifier.Item2); - } - - if (identifier.Item1 == "Exception") - { - Assert.IsNull(exception); - exception = new Exception(identifier.Item1, innerException); - } - else - { - Assert.AreEqual("Error", identifier.Item1); - - errors.Add(Create(identifier.Item1, innerException)); - } - } - - if (errors.Count == 0) - { - return exception; - } - - return new CompositionException("", exception, errors); - } - - private static void AddIdentifier(List> identifiers, StringBuilder identifier) - { - AddIdentifier(identifiers, identifier, (string)null); - } - - private static void AddIdentifier(List> identifiers, StringBuilder identifier, string dsl) - { - if (identifier.Length == 0) - return; - - identifiers.Add(new Tuple(identifier.ToString(), dsl)); - - identifier.Length = 0; - } - - private static IEnumerable CreateFromList(List errors) - { - foreach (string value in errors) - { - yield return Create(value); - } - } - - private static string ReadToNextMatchingParenthesis(StringReader reader) - { - Stack parenthesis = new Stack(); - parenthesis.Push('('); - - StringBuilder builder = new StringBuilder(); - while (reader.Peek() != -1) - { - char c = (char)reader.Read(); - if (c == '(') - { - parenthesis.Push(c); - - if (parenthesis.Count == 1) - { - continue; - } - } - - if (c == ')') - { - char pop = parenthesis.Pop(); - Assert.AreEqual('(', pop); - - if (parenthesis.Count == 0) - { - break; - } - } - - builder.Append(c); - } - - return builder.ToString(); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportDefinitionFactory.DerivedExportDefinition.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportDefinitionFactory.DerivedExportDefinition.cs deleted file mode 100644 index 41916d32d84..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportDefinitionFactory.DerivedExportDefinition.cs +++ /dev/null @@ -1,46 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - partial class ExportDefinitionFactory - { - private class DerivedExportDefinition : ExportDefinition, ICompositionElement - { - private readonly string _contractName; - private readonly IDictionary _metadata; - - public DerivedExportDefinition(string contractName, IDictionary metadata) - { - _contractName = contractName; - _metadata = metadata ?? new Dictionary(); - } - - public override string ContractName - { - get { return _contractName; } - } - - public override IDictionary Metadata - { - get { return _metadata; } - } - - public string DisplayName - { - get { return base.ToString(); } - } - - public ICompositionElement Origin - { - get { return null; } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportDefinitionFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportDefinitionFactory.cs deleted file mode 100644 index d8b84fd5599..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportDefinitionFactory.cs +++ /dev/null @@ -1,30 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - // This class deliberately does not create instances of ExportDefinition, - // so as to test other derived classes from ImportDefinition. - internal static partial class ExportDefinitionFactory - { - public static ExportDefinition Create() - { - return Create((string)null, (IDictionary)null); - } - - public static ExportDefinition Create(string contractName) - { - return Create(contractName, (IDictionary)null); - } - - public static ExportDefinition Create(string contractName, IDictionary metadata) - { - return new DerivedExportDefinition(contractName, metadata); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportFactory.cs deleted file mode 100644 index 7813fee2b6f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportFactory.cs +++ /dev/null @@ -1,67 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - // This class deliberately does not create instances of Lazy, - // so as to test other derived classes from Lazy. - internal static partial class ExportFactory - { - public static IEnumerable Create(string contractName, int count) - { - Export[] exports = new Export[count]; - - for (int i = 0; i < count; i++) - { - exports[i] = Create(contractName, (object)null); - } - - return exports; - } - - public static Lazy Create(T value) - { - return new Lazy(() => value, false); - } - - public static Lazy> Create(T value, IDictionary metadata) - { - return Create>(() => value, metadata); - } - - public static Export Create(string contractName, Func exportedValueGetter) - { - return Create(contractName,(IDictionary)null, exportedValueGetter); - } - - public static Export Create(string contractName) - { - return Create(contractName, null, (IDictionary)null); - } - - public static Export Create(string contractName, object value) - { - return Create(contractName, value, (IDictionary)null); - } - - public static Export Create(string contractName, object value, IDictionary metadata) - { - return Create(contractName, metadata, () => value); - } - - public static Export Create(string contractName, IDictionary metadata, Func exportedValueGetter) - { - return new Export(ExportDefinitionFactory.Create(contractName, metadata), exportedValueGetter); - } - - private static Lazy Create(Func exportedValueGetter, IDictionary metadata) - { - return new Lazy(exportedValueGetter, AttributedModelServices.GetMetadataView(metadata), false); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportProviderFactory.NoOverridesExportProvider.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportProviderFactory.NoOverridesExportProvider.cs deleted file mode 100644 index 708ebc269ee..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportProviderFactory.NoOverridesExportProvider.cs +++ /dev/null @@ -1,30 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - partial class ExportProviderFactory - { - // NOTE: Do not add any more behavior to this class, as ExportProviderTests.cs - // uses this to verify default behavior of the base class. - private class NoOverridesExportProvider : ExportProvider - { - public NoOverridesExportProvider() - { - } - - protected override IEnumerable GetExportsCore(ImportDefinition definition, AtomicComposition context) - { - throw new NotImplementedException(); - } - } - } - -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportProviderFactory.RecomposableExportProvider.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportProviderFactory.RecomposableExportProvider.cs deleted file mode 100644 index c3137c14da4..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportProviderFactory.RecomposableExportProvider.cs +++ /dev/null @@ -1,114 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Linq; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Collections.Generic; -using System.Linq.Expressions; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.Factories -{ - partial class ExportProviderFactory - { - public class RecomposableExportProvider : ExportProvider - { - public static Dictionary EmptyMetadataDictionary = new Dictionary(); - public List _exports = new List(); - - public void AddExport(string contractName, object value) - { - Export export = CreateExport(contractName, value); - var exports = this._exports.ToList(); - - exports.Add(export); - ChangeExports(exports); - } - - public void RemoveExport(string contractName) - { - int index = FindExport(contractName); - Assert.IsTrue(index >= 0); - - var exports = this._exports.ToList(); - - exports.RemoveAt(index); - - ChangeExports(exports); - } - - public void ReplaceExportValue(string contractName, object newValue) - { - int index = FindExport(contractName); - Assert.IsTrue(index >= 0); - - var exports = this._exports.ToList(); - - exports.RemoveAt(index); - exports.Add(CreateExport(contractName, newValue)); - - ChangeExports(exports); - } - - private void ChangeExports(List newExports) - { - using (var atomicComposition = new AtomicComposition()) - { - atomicComposition.AddCompleteAction(() => this._exports = newExports); - atomicComposition.SetValue(this, newExports); - - var addedExports = newExports.Except(this._exports).Select(export => export.Definition); - var removedExports = this._exports.Except(newExports).Select(export => export.Definition); - - this.OnExportsChanging(new ExportsChangeEventArgs(addedExports, removedExports, atomicComposition)); - - atomicComposition.AddCompleteAction(() => this.OnExportsChanged( - new ExportsChangeEventArgs(addedExports, removedExports, null))); - - atomicComposition.Complete(); - } - } - - private int FindExport(string contractName) - { - for (int i = 0; i < _exports.Count; i++) - { - if (_exports[i].Definition.ContractName == contractName) - { - return i; - } - } - return -1; - } - - private Export CreateExport(string contractName, object value) - { - return new Export(new ExportDefinition(contractName, EmptyMetadataDictionary), () => value); - } - - protected override IEnumerable GetExportsCore(ImportDefinition importDefinition, AtomicComposition context) - { - IEnumerable contextExports; - - if (context == null || !context.TryGetValue(this, out contextExports)) - { - contextExports = this._exports; - } - - List exports = new List(); - var func = importDefinition.Constraint.Compile(); - foreach (Export export in contextExports) - { - if (func(export.Definition)) - { - exports.Add(export); - } - } - return exports; - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportProviderFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportProviderFactory.cs deleted file mode 100644 index bce30e9ef76..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ExportProviderFactory.cs +++ /dev/null @@ -1,25 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.AttributedModel; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Hosting; - -namespace System.ComponentModel.Composition.Factories -{ - internal partial class ExportProviderFactory - { - public static ExportProvider Create() - { - return new NoOverridesExportProvider(); - } - - public static RecomposableExportProvider CreateRecomposable() - { - return new RecomposableExportProvider(); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ImportDefinitionFactory.DerivedContractBasedImportDefinition.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ImportDefinitionFactory.DerivedContractBasedImportDefinition.cs deleted file mode 100644 index 422c40d8af0..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ImportDefinitionFactory.DerivedContractBasedImportDefinition.cs +++ /dev/null @@ -1,57 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - partial class ImportDefinitionFactory - { - private class DerivedContractBasedImportDefinition : ContractBasedImportDefinition - { - private readonly string _contractName; - private readonly ImportCardinality _cardinality; - private readonly bool _isRecomposable; - private readonly bool _isPrerequisite; - private readonly IEnumerable> _requiredMetadata; - - public DerivedContractBasedImportDefinition(string contractName, IEnumerable> requiredMetadata, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite) - { - _contractName = contractName; - _cardinality = cardinality; - _isRecomposable = isRecomposable; - _isPrerequisite = isPrerequisite; - _requiredMetadata = requiredMetadata; - } - - public override IEnumerable> RequiredMetadata - { - get { return _requiredMetadata ?? base.RequiredMetadata; } - } - - public override ImportCardinality Cardinality - { - get { return _cardinality; } - } - - public override bool IsPrerequisite - { - get { return _isPrerequisite; } - } - - public override bool IsRecomposable - { - get { return _isRecomposable; } - } - - public override string ContractName - { - get { return _contractName; } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ImportDefinitionFactory.DerivedImportDefinition.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ImportDefinitionFactory.DerivedImportDefinition.cs deleted file mode 100644 index dbe2fb2a619..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ImportDefinitionFactory.DerivedImportDefinition.cs +++ /dev/null @@ -1,50 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - partial class ImportDefinitionFactory - { - private class DerivedImportDefinition : ImportDefinition - { - private readonly Expression> _constraint; - private readonly ImportCardinality _cardinality; - private readonly bool _isRecomposable; - private readonly bool _isPrerequisite; - - public DerivedImportDefinition(Expression> constraint, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite) - { - _constraint = constraint ?? (export => false); - _cardinality = cardinality; - _isRecomposable = isRecomposable; - _isPrerequisite = isPrerequisite; - } - - public override ImportCardinality Cardinality - { - get { return _cardinality; } - } - - public override bool IsPrerequisite - { - get { return _isPrerequisite; } - } - - public override bool IsRecomposable - { - get { return _isRecomposable; } - } - - public override Expression> Constraint - { - get { return _constraint; } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ImportDefinitionFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ImportDefinitionFactory.cs deleted file mode 100644 index 9709a852d1a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ImportDefinitionFactory.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.ComponentModel.Composition; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - // This class deliberately does not create instances of ImportDefinition, - // so as to test other derived classes from ImportDefinition. - internal static partial class ImportDefinitionFactory - { - public static ImportDefinition Create(string contractName) - { - return Create(contractName, (IEnumerable>)null, ImportCardinality.ExactlyOne, true, false); - } - - public static ImportDefinition Create(string contractName, IEnumerable> requiredMetadata) - { - return Create(contractName, requiredMetadata, ImportCardinality.ExactlyOne, true, false); - } - - public static ImportDefinition Create(string contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite) - { - return Create(contractName, (IEnumerable>)null, cardinality, isRecomposable, isPrerequisite); - } - - public static ImportDefinition Create(string contractName, ImportCardinality cardinality) - { - return Create(contractName, (IEnumerable>)null, cardinality, false, false); - } - - public static ImportDefinition Create(string contractName, bool isRecomposable) - { - return Create(contractName, (IEnumerable>)null, ImportCardinality.ExactlyOne, isRecomposable, false); - } - - public static ImportDefinition Create(string contractName, bool isRecomposable, bool isPrerequisite) - { - return Create(contractName, (IEnumerable>)null, ImportCardinality.ExactlyOne, isRecomposable, isPrerequisite); - } - - public static ImportDefinition Create(string contractName, IEnumerable> requiredMetadata, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite) - { - return new DerivedContractBasedImportDefinition(contractName, requiredMetadata, cardinality, isRecomposable, isPrerequisite); - } - - public static ImportDefinition Create() - { - return Create((Expression>)null); - } - - public static ImportDefinition Create(Expression> constraint) - { - return Create(constraint, ImportCardinality.ExactlyOne, true, false); - } - - public static ImportDefinition Create(Expression> constraint, ImportCardinality cardinality) - { - return Create(constraint, cardinality, true, false); - } - - public static ImportDefinition Create(Expression> constraint, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite) - { - return new DerivedImportDefinition(constraint, cardinality, isRecomposable, isPrerequisite); - } - - public static ImportDefinition CreateDefault(string contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite) - { - return new ContractBasedImportDefinition(contractName, (string)null, (IEnumerable>)null, cardinality, isRecomposable, isPrerequisite, CreationPolicy.Any); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartDefinitionFactory.DerivedComposablePartDefinition.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartDefinitionFactory.DerivedComposablePartDefinition.cs deleted file mode 100644 index 09fdd205ba6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartDefinitionFactory.DerivedComposablePartDefinition.cs +++ /dev/null @@ -1,71 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - partial class PartDefinitionFactory - { - private class DerivedComposablePartDefinition : ComposablePartDefinition - { - private readonly Func _partCreator; - private readonly IDictionary _metadata; - private IEnumerable _importDefinitions; - private IEnumerable _exportDefinitions; - private readonly Func> _importsCreator; - private readonly Func> _exportsCreator; - - - public DerivedComposablePartDefinition( - IDictionary metadata, - Func partCreator, - Func> importsCreator, - Func> exportsCreator) - { - this._metadata = metadata.AsReadOnly(); - this._partCreator = partCreator; - this._importsCreator = importsCreator; - this._exportsCreator = exportsCreator; - } - - public override IDictionary Metadata - { - get { return this._metadata; } - } - - public override IEnumerable ExportDefinitions - { - get - { - if (this._exportDefinitions == null) - { - this._exportDefinitions = this._exportsCreator.Invoke() ?? Enumerable.Empty(); - } - return this._exportDefinitions; - } - } - - public override IEnumerable ImportDefinitions - { - get - { - if (this._importDefinitions == null) - { - this._importDefinitions = this._importsCreator.Invoke() ?? Enumerable.Empty(); - } - return this._importDefinitions; - } - } - - public override ComposablePart CreatePart() - { - return this._partCreator(); - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartDefinitionFactory.NoOverridesComposablePartDefinition.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartDefinitionFactory.NoOverridesComposablePartDefinition.cs deleted file mode 100644 index 94dbb61dea4..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartDefinitionFactory.NoOverridesComposablePartDefinition.cs +++ /dev/null @@ -1,35 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - partial class PartDefinitionFactory - { - // NOTE: Do not add any more behavior to this class, as ComposablePartDefinitionTests.cs - // uses this to verify default behavior of the base class. - private class NoOverridesComposablePartDefinition : ComposablePartDefinition - { - public override IEnumerable ExportDefinitions - { - get { return Enumerable.Empty(); } - } - - public override IEnumerable ImportDefinitions - { - get { return Enumerable.Empty(); } - } - - public override ComposablePart CreatePart() - { - Assert.Fail(); - return null; - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartDefinitionFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartDefinitionFactory.cs deleted file mode 100644 index bbff18c4467..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartDefinitionFactory.cs +++ /dev/null @@ -1,51 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.ReflectionModel; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - internal static partial class PartDefinitionFactory - { - public static ReflectionComposablePartDefinition CreateAttributed() - { - return CreateAttributed(typeof(ComposablePart)); - } - - public static ReflectionComposablePartDefinition CreateAttributed(Type type) - { - return AttributedModelDiscovery.CreatePartDefinition(type, null, false, (ICompositionElement)null); - } - - public static ComposablePartDefinition Create() - { - return new NoOverridesComposablePartDefinition(); - } - - public static ComposablePartDefinition Create(ComposablePart part) - { - return Create(part.Metadata, () => part, part.ImportDefinitions, part.ExportDefinitions); - } - - public static ComposablePartDefinition Create(IDictionary metadata, - Func partCreator, - IEnumerable imports, - IEnumerable exports) - { - return Create(metadata, partCreator, () => imports, () => exports); - } - - public static ComposablePartDefinition Create(IDictionary metadata, - Func partCreator, - Func> importsCreator, - Func> exportsCreator) - { - return new DerivedComposablePartDefinition(metadata, partCreator, importsCreator, exportsCreator); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartFactory.DisposableComposablePart.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartFactory.DisposableComposablePart.cs deleted file mode 100644 index 638a46972ba..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartFactory.DisposableComposablePart.cs +++ /dev/null @@ -1,69 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - partial class PartFactory - { - // NOTE: Do not add any more behavior to this class, as ComposablePartTests.cs - // uses this to verify default behavior of the base class. - private class DisposableComposablePart : ComposablePart, IDisposable - { - private readonly Action _disposeCallback; - - public DisposableComposablePart(Action disposeCallback) - { - Assert.IsNotNull(disposeCallback); - - _disposeCallback = disposeCallback; - } - - public void Dispose() - { - this.Dispose(true); - } - - ~DisposableComposablePart() - { - Dispose(false); - } - - protected virtual void Dispose(bool disposing) - { - _disposeCallback(disposing); - } - - public override IEnumerable ImportDefinitions - { - get { return Enumerable.Empty(); } - } - - public override IEnumerable ExportDefinitions - { - get { return Enumerable.Empty(); } - } - - public override object GetExportedValue(ExportDefinition definition) - { - Assert.Fail(); - return null; - } - - public override void SetImport(ImportDefinition definition, IEnumerable exports) - { - Assert.Fail(); - } - - public override IDictionary Metadata - { - get { return new Dictionary(); } - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartFactory.NoOverridesComposablePart.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartFactory.NoOverridesComposablePart.cs deleted file mode 100644 index 27f9a3da2e1..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartFactory.NoOverridesComposablePart.cs +++ /dev/null @@ -1,44 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - partial class PartFactory - { - // NOTE: Do not add any more behavior to this class, as ComposablePartTests.cs - // uses this to verify default behavior of the base class. - private class NoOverridesComposablePart : ComposablePart - { - public NoOverridesComposablePart() - { - } - - public override IEnumerable ExportDefinitions - { - get { return Enumerable.Empty(); } - } - - public override IEnumerable ImportDefinitions - { - get { return Enumerable.Empty(); } - } - - public override object GetExportedValue(ExportDefinition definition) - { - Assert.Fail(); - return null; - } - - public override void SetImport(ImportDefinition definition, IEnumerable exports) - { - Assert.Fail(); - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartFactory.cs deleted file mode 100644 index 44650c0ce0b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/PartFactory.cs +++ /dev/null @@ -1,112 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Factories -{ - internal static partial class PartFactory - { - public static Type GetAttributedExporterType() - { - return typeof(ExportValueTypeFactory); - } - - public static ComposablePart CreateAttributed(Type type) - { - var definition = PartDefinitionFactory.CreateAttributed(type); - - return definition.CreatePart(); - } - - public static ComposablePart CreateAttributed(object instance) - { - return AttributedModelServices.CreatePart(instance); - } - - public static ComposablePart Create() - { - return new NoOverridesComposablePart(); - } - - public static ComposablePart CreateExporter(string contractName, object value) - { - return CreateExporter(new MicroExport(contractName, value)); - } - - public static ComposablePart CreateExporter(params MicroExport[] exports) - { - ConcreteComposablePart part = new ConcreteComposablePart(); - - if (exports != null) - { - foreach (var export in exports) - { - foreach (object exportedValue in export.ExportedValues) - { - part.AddExport(ExportFactory.Create(export.ContractName, exportedValue, export.Metadata)); - } - } - } - - return part; - } - - public static ImportingComposablePart CreateImporter() - { - string contractName = AttributedModelServices.GetContractName(typeof(T)); - - return CreateImporter(contractName); - } - - public static ImportingComposablePart CreateImporterExporter(string exportContractName, string importContractName) - { - return new ImportingComposablePart(exportContractName, ImportCardinality.ExactlyOne, false, importContractName); - } - - public static ImportingComposablePart CreateImporter(params string[] contractNames) - { - return new ImportingComposablePart(ImportCardinality.ZeroOrMore, false, contractNames); - } - - public static ImportingComposablePart CreateImporter(bool isRecomposable, params string[] contractNames) - { - return new ImportingComposablePart(ImportCardinality.ZeroOrMore, isRecomposable, contractNames); - } - - public static ImportingComposablePart CreateImporter(string contractName) - { - return CreateImporter(contractName, ImportCardinality.ZeroOrMore); - } - - public static ImportingComposablePart CreateImporter(string contractName, bool isRecomposable) - { - return CreateImporter(contractName, ImportCardinality.ZeroOrMore, isRecomposable); - } - - public static ImportingComposablePart CreateImporter(string contractName, ImportCardinality cardinality) - { - return CreateImporter(contractName, cardinality, false); - } - - public static ImportingComposablePart CreateImporter(string contractName, ImportCardinality cardinality, bool isRecomposable) - { - return new ImportingComposablePart(cardinality, isRecomposable, contractName); - } - - public static ImportingComposablePart CreateImporter(params ImportDefinition[] importDefinitions) - { - return new ImportingComposablePart(importDefinitions); - } - - public static ComposablePart CreateDisposable(Action disposeCallback) - { - return new DisposableComposablePart(disposeCallback); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ReflectionFactory.MockParameterInfo.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ReflectionFactory.MockParameterInfo.cs deleted file mode 100644 index 76e80525442..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ReflectionFactory.MockParameterInfo.cs +++ /dev/null @@ -1,51 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.AttributedModel; -using System.Reflection; -using System.Linq; - -namespace System.ComponentModel.Composition.Factories -{ - partial class ReflectionFactory - { - private class MockParameterInfo : ParameterInfo - { - private readonly string _name; - private readonly Type _parameterType = typeof(string); - - public MockParameterInfo(Type parameterType) - { - _parameterType = parameterType; - } - - public MockParameterInfo(string name) - { - _name = name; - } - - public override string Name - { - get { return _name; } - } - - public override Type ParameterType - { - get { return _parameterType; } - } - - public override MemberInfo Member - { - get { return typeof(object).GetConstructors().First(); } - } - - public override object[] GetCustomAttributes(Type attributeType, bool inherit) - { - return (object[])Array.CreateInstance(attributeType, 0); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ReflectionFactory.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ReflectionFactory.cs deleted file mode 100644 index 76d13ee019d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Factories/ReflectionFactory.cs +++ /dev/null @@ -1,29 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.AttributedModel; -using System.Reflection; - -namespace System.ComponentModel.Composition.Factories -{ - internal static partial class ReflectionFactory - { - public static ParameterInfo CreateParameter() - { - return CreateParameter((string)null); - } - - public static ParameterInfo CreateParameter(Type parameterType) - { - return new MockParameterInfo(parameterType); - } - - public static ParameterInfo CreateParameter(string name) - { - return new MockParameterInfo(name); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/GenerationServicesTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/GenerationServicesTests.cs deleted file mode 100644 index b1bfe9251e3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/GenerationServicesTests.cs +++ /dev/null @@ -1,175 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Reflection.Emit; -using System.Reflection; -using System.ComponentModel.Composition; -using System.UnitTesting; -using Microsoft.Internal; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.UnitTesting; - -namespace Microsoft.Internal -{ - [TestClass] - public class GenerationServicesTests - { - // Has to be public, otherwise the dynamic method doesn't see it - public enum TestEnum - { - First = 1, - Second = 2 - } - - public static class DelegateTestClass - { - public static int Method(int i) - { - return i; - } - } - - private Func CreateValueGenerator(T value) - { - DynamicMethod methodBuilder = new DynamicMethod(TestServices.GenerateRandomString(), typeof(T), Type.EmptyTypes); - // Generate the method body that simply returns the dictionary - ILGenerator ilGenerator = methodBuilder.GetILGenerator(); - GenerationServices.LoadValue(ilGenerator, value); - ilGenerator.Emit(OpCodes.Ret); - return (Func)methodBuilder.CreateDelegate(typeof(Func)); - } - - private void TestSuccessfulValueGeneration(T value) - { - Func result = this.CreateValueGenerator(value); - T generatedValue = result.Invoke(); - Assert.AreEqual(value, generatedValue); - } - - private void TestSuccessfulDictionaryGeneration(IDictionary dictionary) - { - Func> result = this.CreateValueGenerator>(dictionary); - IDictionary generatedDictionary = result.Invoke(); - EnumerableAssert.AreEqual(dictionary, generatedDictionary); - } - - private void TestSuccessfulEnumerableGeneration(IEnumerable enumerable) - { - Func result = this.CreateValueGenerator(enumerable); - IEnumerable generatedEnumerable = result.Invoke(); - Assert.IsTrue(generatedEnumerable.Cast().SequenceEqual(enumerable.Cast())); - } - - [TestMethod] - public void PrimitiveTypes() - { - this.TestSuccessfulValueGeneration(Char.MinValue); - this.TestSuccessfulValueGeneration(Char.MaxValue); - this.TestSuccessfulValueGeneration((Char)42); - - this.TestSuccessfulValueGeneration(true); - this.TestSuccessfulValueGeneration(false); - - this.TestSuccessfulValueGeneration(Byte.MinValue); - this.TestSuccessfulValueGeneration(Byte.MaxValue); - this.TestSuccessfulValueGeneration((Byte)42); - - this.TestSuccessfulValueGeneration(SByte.MinValue); - this.TestSuccessfulValueGeneration(SByte.MaxValue); - this.TestSuccessfulValueGeneration((SByte)42); - - this.TestSuccessfulValueGeneration(Int16.MinValue); - this.TestSuccessfulValueGeneration(Int16.MaxValue); - this.TestSuccessfulValueGeneration((Int16)42); - - this.TestSuccessfulValueGeneration(UInt16.MinValue); - this.TestSuccessfulValueGeneration(UInt16.MaxValue); - this.TestSuccessfulValueGeneration((UInt16)42); - - this.TestSuccessfulValueGeneration(Int32.MinValue); - this.TestSuccessfulValueGeneration(Int32.MaxValue); - this.TestSuccessfulValueGeneration((Int32)42); - - this.TestSuccessfulValueGeneration(UInt32.MinValue); - this.TestSuccessfulValueGeneration(UInt32.MaxValue); - this.TestSuccessfulValueGeneration((UInt32)42); - - this.TestSuccessfulValueGeneration(Int64.MinValue); - this.TestSuccessfulValueGeneration(Int64.MaxValue); - this.TestSuccessfulValueGeneration((Int64)42); - - this.TestSuccessfulValueGeneration(UInt64.MinValue); - this.TestSuccessfulValueGeneration(UInt64.MaxValue); - this.TestSuccessfulValueGeneration((UInt64)42); - - this.TestSuccessfulValueGeneration(Single.MinValue); - this.TestSuccessfulValueGeneration(Single.MaxValue); - this.TestSuccessfulValueGeneration((Single)42.42); - - this.TestSuccessfulValueGeneration(Double.MinValue); - this.TestSuccessfulValueGeneration(Double.MaxValue); - this.TestSuccessfulValueGeneration((Double)42.42); - } - - [TestMethod] - public void StringType() - { - this.TestSuccessfulValueGeneration("42"); - } - - [TestMethod] - public void EnumType() - { - this.TestSuccessfulValueGeneration(TestEnum.Second); - } - - - [TestMethod] - public void TypeType() - { - this.TestSuccessfulValueGeneration(typeof(TestEnum)); - } - - [TestMethod] - public void PrimitiveTypeEnumerable() - { - int[] enumerable = new int[] { 1, 2, 3, 4, 5 }; - this.TestSuccessfulEnumerableGeneration(enumerable); - } - - [TestMethod] - public void StringTypeEnumerable() - { - string[] enumerable = new string[] { "1", "2", "3", "4", "5" }; - this.TestSuccessfulEnumerableGeneration(enumerable); - } - - [TestMethod] - [Ignore] - [WorkItem(507696)] - public void EnumTypeEnumerable() - { - TestEnum[] enumerable = new TestEnum[] { TestEnum.First, TestEnum.Second }; - this.TestSuccessfulEnumerableGeneration(enumerable); - } - - - [TestMethod] - public void MixedEnumerable() - { - List list = new List(); - list.Add(42); - list.Add("42"); - list.Add(typeof(TestEnum)); - list.Add(TestEnum.Second); - list.Add(null); - - this.TestSuccessfulEnumerableGeneration(list); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/.gitattributes deleted file mode 100644 index 03c19e8d87a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/.gitattributes +++ /dev/null @@ -1,10 +0,0 @@ -/AggregateCatalogTest.cs -crlf -/AssemblyCatalogDebuggerProxyTests.cs -crlf -/AssemblyCatalogTests.cs -crlf -/CatalogExportProviderTests.cs -crlf -/CompositionBatchTests.cs -crlf -/CompositionTransactionTests.cs -crlf -/DirectoryCatalogDebuggerProxyTests.cs -crlf -/DirectoryCatalogTests.cs -crlf -/ImportEngineTests.cs -crlf -/TypeCatalogTests.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/AggregateCatalogTest.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/AggregateCatalogTest.cs deleted file mode 100644 index 4e2d5cacaa3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/AggregateCatalogTest.cs +++ /dev/null @@ -1,980 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.Threading; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.Hosting -{ - [TestClass] - public class AggregateCatalogTest - { - [TestMethod] - public void Constructor1_ShouldNotThrow() - { - new AggregateCatalog(); - } - - - [TestMethod] - public void Constructor1_ShouldSetCatalogsPropertyToEmpty() - { - var catalog = new AggregateCatalog(); - - EnumerableAssert.IsEmpty(catalog.Catalogs); - } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void Constructor1_ShouldSetPartsPropertyToEmpty() - { - var catalog = new AggregateCatalog(); - - EnumerableAssert.IsEmpty(catalog.Parts); - } - - [TestMethod] - public void Constructor3_NullAsCatalogsArgument_ShouldSetCatalogsPropertyToEmpty() - { - var catalog = new AggregateCatalog((IEnumerable)null); - - EnumerableAssert.IsEmpty(catalog.Catalogs); - } - - [TestMethod] - public void Constructor3_EmptyIEnumerableAsCatalogsArgument_ShouldSetCatalogsPropertyToEmpty() - { - var catalog = new AggregateCatalog(Enumerable.Empty()); - - EnumerableAssert.IsEmpty(catalog.Catalogs); - } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void Constructor3_NullAsCatalogsArgument_ShouldSetPartsPropertyToEmpty() - { - var catalog = new AggregateCatalog((IEnumerable)null); - - EnumerableAssert.IsEmpty(catalog.Parts); - } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void Constructor3_EmptyIEnumerableAsCatalogsArgument_ShouldSetPartsPropertyToEmpty() - { - var catalog = new AggregateCatalog(Enumerable.Empty()); - - EnumerableAssert.IsEmpty(catalog.Parts); - } - - [TestMethod] - public void Constructor3_ArrayWithNullAsCatalogsArgument_ShouldThrowArgument() - { - var catalogs = new ComposablePartCatalog[] { null }; - - ExceptionAssert.ThrowsArgument("catalogs", () => - { - new AggregateCatalog(catalogs); - }); - } - - [TestMethod] - public void Catalogs_WhenCatalogDisposed_ShouldThrowObjectDisposed() - { - var catalog = CreateAggregateCatalog(); - catalog.Dispose(); - - ExceptionAssert.ThrowsDisposed(catalog, () => - { - var catalogs = catalog.Catalogs; - }); - } - - [TestMethod] - public void Parts_WhenCatalogDisposed_ShouldThrowObjectDisposed() - { - var catalog = CreateAggregateCatalog(); - catalog.Dispose(); - - ExceptionAssert.ThrowsDisposed(catalog, () => - { - var parts = catalog.Parts; - }); - } - - [TestMethod] - public void GetExports_WhenCatalogDisposed_ShouldThrowObjectDisposed() - { - var catalog = CreateAggregateCatalog(); - catalog.Dispose(); - var definition = ImportDefinitionFactory.Create(); - - ExceptionAssert.ThrowsDisposed(catalog, () => - { - catalog.GetExports(definition); - }); - } - - [TestMethod] - public void GetExports_NullAsConstraintArgument_ShouldThrowArgumentNull() - { - var catalog = CreateAggregateCatalog(); - - ExceptionAssert.ThrowsArgument("definition", () => - { - catalog.GetExports((ImportDefinition)null); - }); - } - - [TestMethod] - public void Dispose_ShouldNotThrow() - { - using (var catalog = CreateAggregateCatalog()) - { - } - } - - [TestMethod] - public void Dispose_CanBeCalledMultipleTimes() - { - var catalog = CreateAggregateCatalog(); - catalog.Dispose(); - catalog.Dispose(); - catalog.Dispose(); - } - - - [TestMethod] - public void MutableCatalogNotifications() - { - int step = 0; - int changedStep = 0; - var catalog = new AggregateCatalog(); - - var typePartCatalog = new TypeCatalog(typeof(SharedPartStuff)); - var typePartCatalog1 = new TypeCatalog(typeof(SharedPartStuff)); - var typePartCatalog2 = new TypeCatalog(typeof(SharedPartStuff)); - var typePartCatalog3 = new TypeCatalog(typeof(SharedPartStuff)); - var typePartCatalog4 = new TypeCatalog(typeof(SharedPartStuff)); - var typePartCatalog5 = new TypeCatalog(typeof(SharedPartStuff)); - - // Smoke test on inner collection - catalog.Catalogs.Add(typePartCatalog); - catalog.Catalogs.Remove(typePartCatalog); - catalog.Catalogs.Clear(); - Assert.IsTrue(catalog.Catalogs.Count == 0, "Add/Remove/Clear -- PartsAsCollection.Count is now 0"); - - // Add notifications - catalog.Changed += delegate(object source, ComposablePartCatalogChangeEventArgs args) - { - // Local code - ++step; ++step; - changedStep = step; - }; - - //Add something then verify counters - catalog.Catalogs.Add(typePartCatalog); - Assert.IsTrue(catalog.Catalogs.Count == 1, "Add -- Catalogs.Count is now 1"); - Assert.IsTrue(changedStep == 2, "Add -- Changed must be fired after"); - - // Reset counters - step = changedStep = 0; - - // Remove something then verify counters - catalog.Catalogs.Remove(typePartCatalog); - Assert.IsTrue(catalog.Catalogs.Count == 0, "Add -- Catalogs.Count is now 0"); - Assert.IsTrue(changedStep == 2, "Remove -- Changed must be fired after"); - - - //Now Add it back - catalog.Catalogs.Add(typePartCatalog); - Assert.IsTrue(catalog.Catalogs.Count == 1, "Add -- Catalogs.Count is now 1"); - - step = changedStep = 0; - // Now clear the collection and verify counters - catalog.Catalogs.Clear(); - Assert.IsTrue(catalog.Catalogs.Count == 0, "Add -- Catalogs.Count is now 0"); - Assert.IsTrue(changedStep == 2, "Remove -- Changed must be fired after"); - - // Now remove a non existent item and verify counters - step = changedStep = 0; - bool removed = catalog.Catalogs.Remove(typePartCatalog); - Assert.IsTrue(removed == false, "Remove -- correctly returned false"); - Assert.IsTrue(changedStep == 0, "Remove -- Changed should not fire if nothing changed"); - - // Add a bunch - step = changedStep = 0; - catalog.Catalogs.Add(typePartCatalog); - Assert.IsTrue(catalog.Catalogs.Count == 1, "Add -- Catalogs.Count is now 1"); - Assert.IsTrue(changedStep == 2, "Add -- Changed must be fired after"); - - catalog.Catalogs.Add(typePartCatalog1); - Assert.IsTrue(catalog.Catalogs.Count == 2, "Add -- Catalogs.Count is now 1"); - Assert.IsTrue(changedStep == 4, "Add -- Changing must be fired after"); - - catalog.Catalogs.Add(typePartCatalog2); - catalog.Catalogs.Add(typePartCatalog3); - catalog.Catalogs.Add(typePartCatalog4); - catalog.Catalogs.Add(typePartCatalog5); - Assert.IsTrue(catalog.Catalogs.Count == 6, "Add -- Catalogs.Count is now 1"); - Assert.IsTrue(changedStep == 12, "Add -- Changing must be fired after"); - - removed = catalog.Catalogs.Remove(typePartCatalog3); - Assert.IsTrue(catalog.Catalogs.Count == 5, "Add -- Catalogs.Count is now 5"); - Assert.IsTrue(removed == true, "Remove should have succeeded"); - Assert.IsTrue(changedStep == 14, "Remove -- Changed must be fired after"); - removed = catalog.Catalogs.Remove(typePartCatalog2); - removed = catalog.Catalogs.Remove(typePartCatalog1); - removed = catalog.Catalogs.Remove(typePartCatalog4); - removed = catalog.Catalogs.Remove(typePartCatalog); - removed = catalog.Catalogs.Remove(typePartCatalog5); - Assert.IsTrue(catalog.Catalogs.Count == 0, "Add -- Catalogs.Count is now 0"); - Assert.IsTrue(removed == true, "Remove should have succeeded"); - Assert.IsTrue(changedStep == 24, "Remove -- Changing must be fired after"); - - // Add and then clear a lot - step = changedStep = 0; - catalog.Catalogs.Add(typePartCatalog); - catalog.Catalogs.Add(typePartCatalog1); - catalog.Catalogs.Add(typePartCatalog2); - catalog.Catalogs.Add(typePartCatalog3); - catalog.Catalogs.Add(typePartCatalog4); - catalog.Catalogs.Add(typePartCatalog5); - Assert.IsTrue(catalog.Catalogs.Count == 6, "Add -- Catalogs.Count should be 6"); - Assert.IsTrue(changedStep == 12, "Add -- Changing must be fired after"); - - catalog.Catalogs.Clear(); - Assert.IsTrue(catalog.Catalogs.Count == 0, "Add -- Catalogs.Count should be 0"); - - step = changedStep = 0; - int step2 = 100; - int changedStep2 = 0; - - catalog.Changed += delegate(object source, ComposablePartCatalogChangeEventArgs args) - { - // Local code - --step2; --step2; - changedStep2 = step2; - }; - - catalog.Catalogs.Add(typePartCatalog); - Assert.IsTrue(catalog.Catalogs.Count == 1, "Add -- Catalogs.Count is now 1"); - Assert.IsTrue(changedStep == 2, "Add handler 1 -- Changed must be fired after"); - Assert.IsTrue(changedStep2 == 98, "Add handler 2 -- Changed must be fired after"); - - catalog.Catalogs.Add(typePartCatalog1); - Assert.IsTrue(catalog.Catalogs.Count == 2, "Add -- Catalogs.Count is now 1"); - Assert.IsTrue(changedStep == 4, "Add handler 1 -- Changed must be fired after"); - Assert.IsTrue(changedStep2 == 96, "Add handler 2 -- Changed must be firedafter"); - - catalog.Catalogs.Remove(typePartCatalog); - Assert.IsTrue(catalog.Catalogs.Count == 1, "Add -- PartsAsCollection.Count is now 1"); - Assert.IsTrue(changedStep == 6, "Add handler 1 -- Changed must be fired and fired after"); - Assert.IsTrue(changedStep2 == 94, "Add handler 2 -- Changed must be fired and fired after"); - - catalog.Catalogs.Clear(); - Assert.IsTrue(catalog.Catalogs.Count == 0, "Add -- PartsAsCollection.Count is now 0"); - Assert.IsTrue(changedStep == 8, "Add handler 1 -- Changed must be fired after"); - Assert.IsTrue(changedStep2 == 92, "Add handler 2 -- Changed must be fired after"); - - } - - [TestMethod] - public void DisposeAggregatingCatalog() - { - int changedNotification = 0; - - var typePartCatalog1 = new TypeCatalog(typeof(SharedPartStuff)); - var typePartCatalog2 = new TypeCatalog(typeof(SharedPartStuff)); - var typePartCatalog3 = new TypeCatalog(typeof(SharedPartStuff)); - - var assemblyPartCatalog1 = new AssemblyCatalog(typeof(SharedPartStuff).Assembly); - var assemblyPartCatalog2 = new AssemblyCatalog(typeof(SharedPartStuff).Assembly); - var assemblyPartCatalog3 = new AssemblyCatalog(typeof(SharedPartStuff).Assembly); - -#if !SILVERLIGHT - var dirPartCatalog1 = new DirectoryCatalog(FileIO.GetRootTemporaryDirectory()); - var dirPartCatalog2 = new DirectoryCatalog(FileIO.GetRootTemporaryDirectory()); - var dirPartCatalog3 = new DirectoryCatalog(FileIO.GetRootTemporaryDirectory()); -#endif - using (var catalog = new AggregateCatalog()) - { - catalog.Catalogs.Add(typePartCatalog1); - catalog.Catalogs.Add(typePartCatalog2); - catalog.Catalogs.Add(typePartCatalog3); - - catalog.Catalogs.Add(assemblyPartCatalog1); - catalog.Catalogs.Add(assemblyPartCatalog2); - catalog.Catalogs.Add(assemblyPartCatalog3); - -#if !SILVERLIGHT - catalog.Catalogs.Add(dirPartCatalog1); - catalog.Catalogs.Add(dirPartCatalog2); - catalog.Catalogs.Add(dirPartCatalog3); -#endif - - // Add notifications - catalog.Changed += delegate(object source, ComposablePartCatalogChangeEventArgs args) - { - // Local code - ++changedNotification; - }; - - } - - Assert.IsTrue(changedNotification == 0, "No changed notifications"); - - //Ensure that the other catalogs are - ExceptionAssert.ThrowsDisposed(typePartCatalog1, () => - { - var iEnum = typePartCatalog1.Parts.GetEnumerator(); - }); - - ExceptionAssert.ThrowsDisposed(typePartCatalog2, () => - { - var iEnum = typePartCatalog2.Parts.GetEnumerator(); - }); - - ExceptionAssert.ThrowsDisposed(typePartCatalog3, () => - { - var iEnum = typePartCatalog3.Parts.GetEnumerator(); - }); - - //Ensure that the other catalogs are - ExceptionAssert.ThrowsDisposed(assemblyPartCatalog1, () => - { - var iEnum = assemblyPartCatalog1.Parts.GetEnumerator(); - }); - - ExceptionAssert.ThrowsDisposed(assemblyPartCatalog2, () => - { - var iEnum = assemblyPartCatalog2.Parts.GetEnumerator(); - }); - - ExceptionAssert.ThrowsDisposed(assemblyPartCatalog3, () => - { - var iEnum = assemblyPartCatalog3.Parts.GetEnumerator(); - }); - -#if !SILVERLIGHT - //Ensure that the other catalogs are - ExceptionAssert.ThrowsDisposed(dirPartCatalog1, () => - { - var iEnum = dirPartCatalog1.Parts.GetEnumerator(); - }); - - ExceptionAssert.ThrowsDisposed(dirPartCatalog2, () => - { - var iEnum = dirPartCatalog2.Parts.GetEnumerator(); - }); - - ExceptionAssert.ThrowsDisposed(dirPartCatalog3, () => - { - var iEnum = dirPartCatalog3.Parts.GetEnumerator(); - }); -#endif - } - - [TestMethod] - [Ignore] - [WorkItem(514749)] - public void MutableMultithreadedEnumerations() - { - var catalog = new AggregateCatalog(); - - ThreadStart func = delegate() - { - var typePart = new TypeCatalog(typeof(SharedPartStuff)); - var typePart1 = new TypeCatalog(typeof(SharedPartStuff)); - var typePart2 = new TypeCatalog(typeof(SharedPartStuff)); - var typePart3 = new TypeCatalog(typeof(SharedPartStuff)); - var typePart4 = new TypeCatalog(typeof(SharedPartStuff)); - var typePart5 = new TypeCatalog(typeof(SharedPartStuff)); - - for (int i = 0; i < 100; i++) - { - catalog.Catalogs.Add(typePart); - catalog.Catalogs.Add(typePart1); - catalog.Catalogs.Add(typePart2); - catalog.Catalogs.Add(typePart3); - catalog.Catalogs.Add(typePart4); - catalog.Catalogs.Add(typePart5); - - Assert.IsTrue(catalog.Catalogs.Count >= 6, "Catalogs Collection must be at least 6 big"); - - for (int k = 0; k < 5; k++) - { - int j; - // Ensure that iterating the returned queryable is okay even though there are many threads mutationg it - // We are really just looking to ensure that ollection changed exceptions are not thrown - j = 0; - var iq = catalog.Parts.GetEnumerator(); - while (iq.MoveNext()) - { - ++j; - } - - Assert.IsTrue(j >= 6, "Catalogs Collection must be at least 6 big"); - - // Ensure that iterating the returned enumerator is okay even though there are many threads mutationg it - // We are really just looking to ensure that collection changed exceptions are not thrown - j = 0; - var ie = catalog.Catalogs.GetEnumerator(); - while (ie.MoveNext()) - { - ++j; - } - Assert.IsTrue(j >= 6, "Catalogs Collection must be at least 6 big"); - } - - - catalog.Catalogs.Remove(typePart); - catalog.Catalogs.Remove(typePart1); - catalog.Catalogs.Remove(typePart2); - catalog.Catalogs.Remove(typePart3); - catalog.Catalogs.Remove(typePart4); - catalog.Catalogs.Remove(typePart5); - } - }; - - Thread[] threads = new Thread[100]; - for (int i = 0; i < threads.Length; i++) - { - threads[i] = new Thread(func); - } - - for (int i = 0; i < threads.Length; i++) - { - threads[i].Start(); - } - for (int i = 0; i < threads.Length; i++) - { - threads[i].Join(); - } - - Assert.IsTrue(catalog.Catalogs.Count == 0, "Collection must be empty"); - } - - - public void CreateMainAndOtherChildren( - out AggregateCatalog[] mainChildren, - out AggregateCatalog[] otherChildren, - out TypeCatalog[] componentCatalogs) - { - componentCatalogs = new TypeCatalog[] - { - new TypeCatalog(typeof(SharedPartStuff)), - new TypeCatalog(typeof(SharedPartStuff)), - new TypeCatalog(typeof(SharedPartStuff)) - }; - - // Create our child catalogs - mainChildren = new AggregateCatalog[5]; - for (int i = 0; i < mainChildren.Length; i++) - { - mainChildren[i] = new AggregateCatalog(componentCatalogs); - } - - otherChildren = new AggregateCatalog[5]; - for (int i = 0; i < otherChildren.Length; i++) - { - otherChildren[i] = new AggregateCatalog(componentCatalogs); - } - } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void AggregatingCatalogAddAndRemoveChildren() - { - int changedCount = 0; - int typesChanged = 0; - EventHandler onChanged = delegate(object sender, ComposablePartCatalogChangeEventArgs e) - { - ++changedCount; - typesChanged += e.AddedDefinitions.Concat(e.RemovedDefinitions).Count(); - }; - - // Create our child catalogs - AggregateCatalog[] mainChildren; - AggregateCatalog[] otherChildren; - TypeCatalog[] componentCatalogs; - - CreateMainAndOtherChildren(out mainChildren, out otherChildren, out componentCatalogs); - - var parent = new AggregateCatalog(mainChildren); - parent.Changed += onChanged; - - for (int i = 0; i < otherChildren.Length; i++) - { - parent.Catalogs.Add(otherChildren[i]); - } - - Assert.AreEqual(otherChildren.Length, changedCount); - Assert.AreEqual(otherChildren.Length * 3, typesChanged); - - changedCount = 0; - typesChanged = 0; - - parent.Catalogs.Remove(otherChildren[0]); - parent.Catalogs.Remove(otherChildren[1]); - - Assert.AreEqual(2, changedCount); - Assert.AreEqual(2 * 3, typesChanged); - - changedCount = 0; - typesChanged = 0; - - parent.Catalogs.Add(otherChildren[0]); - parent.Catalogs.Add(otherChildren[1]); - - Assert.AreEqual(2, changedCount); - Assert.AreEqual(2 * 3, typesChanged); - - changedCount = 0; - typesChanged = 0; - - parent.Catalogs.Clear(); - Assert.AreEqual(1, changedCount); - Assert.AreEqual((mainChildren.Length + otherChildren.Length) * 3, typesChanged); - - changedCount = 0; - typesChanged = 0; - - // These have already been removed and so I should be able remove components from them without recieving notifications - otherChildren[0].Catalogs.Remove(componentCatalogs[0]); - otherChildren[1].Catalogs.Remove(componentCatalogs[1]); - Assert.AreEqual(0, changedCount); - Assert.AreEqual(0, typesChanged); - - // These have already been Cleared and so I should be able remove components from them without recieving notifications - otherChildren[3].Catalogs.Remove(componentCatalogs[0]); - otherChildren[4].Catalogs.Remove(componentCatalogs[1]); - Assert.AreEqual(0, changedCount); - } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void AggregatingCatalogAddAndRemoveNestedChildren() - { - int changedCount = 0; - int typesChanged = 0; - - EventHandler onChanged = delegate(object sender, ComposablePartCatalogChangeEventArgs e) - { - ++changedCount; - typesChanged += e.AddedDefinitions.Concat(e.RemovedDefinitions).Count(); - }; - - // Create our child catalogs - AggregateCatalog[] mainChildren; - AggregateCatalog[] otherChildren; - TypeCatalog[] componentCatalogs; - CreateMainAndOtherChildren(out mainChildren, out otherChildren, out componentCatalogs); - - - var parent = new AggregateCatalog(mainChildren); - parent.Changed += onChanged; - - for (int i = 0; i < otherChildren.Length; i++) - { - parent.Catalogs.Add(otherChildren[i]); - } - - Assert.AreEqual(otherChildren.Length, changedCount); - Assert.AreEqual(otherChildren.Length * 3, typesChanged); - - changedCount = 0; - typesChanged = 0; - - otherChildren[0].Catalogs.Remove(componentCatalogs[0]); - otherChildren[1].Catalogs.Remove(componentCatalogs[1]); - - Assert.AreEqual(2, changedCount); - Assert.AreEqual(2, typesChanged); - - changedCount = 0; - typesChanged = 0; - - otherChildren[0].Catalogs.Add(componentCatalogs[0]); - otherChildren[1].Catalogs.Add(componentCatalogs[1]); - - Assert.AreEqual(2, changedCount); - Assert.AreEqual(2, typesChanged); - - changedCount = 0; - typesChanged = 0; - otherChildren[1].Catalogs.Clear(); - Assert.AreEqual(1, changedCount); - Assert.AreEqual(componentCatalogs.Length, typesChanged); - } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void AggregatingDisposedAndNotifications() - { - int changedCount = 0; - int typesChanged = 0; - - EventHandler onChanged = delegate(object sender, ComposablePartCatalogChangeEventArgs e) - { - ++changedCount; - typesChanged += e.AddedDefinitions.Concat(e.RemovedDefinitions).Count(); - }; - - // Create our child catalogs - AggregateCatalog[] mainChildren; - AggregateCatalog[] otherChildren; - TypeCatalog[] componentCatalogs; - CreateMainAndOtherChildren(out mainChildren, out otherChildren, out componentCatalogs); - - - var parent = new AggregateCatalog(mainChildren); - parent.Changed += onChanged; - - for (int i = 0; i < otherChildren.Length; i++) - { - parent.Catalogs.Add(otherChildren[i]); - } - - Assert.AreEqual(otherChildren.Length, changedCount); - Assert.AreEqual(otherChildren.Length * 3, typesChanged); - - changedCount = 0; - typesChanged = 0; - - parent.Dispose(); - - Assert.AreEqual(0, changedCount); - Assert.AreEqual(0, typesChanged); - - //Ensure that the children are also disposed - ExceptionAssert.ThrowsDisposed(otherChildren[0], () => - { - otherChildren[0].Catalogs.Remove(componentCatalogs[0]); - }); - - //Ensure that the children are also disposed - ExceptionAssert.ThrowsDisposed(otherChildren[4], () => - { - otherChildren[4].Catalogs.Remove(componentCatalogs[0]); - }); - - Assert.AreEqual(0, changedCount); - Assert.AreEqual(0, typesChanged); - } - - [TestMethod] - public void AggregatingCatalogParmsConstructorAggregateAggregateCatalogs() - { - var aggCatalog1 = new AggregateCatalog(); - var aggCatalog2 = new AggregateCatalog(); - var aggCatalog3 = new AggregateCatalog(); - - // Construct with one catalog parameter - var catalog = new AggregateCatalog(aggCatalog1); - Assert.IsTrue(catalog.Catalogs.Count == 1); - - // Construct with two catalog parameters - catalog = new AggregateCatalog(aggCatalog1, aggCatalog2); - Assert.IsTrue(catalog.Catalogs.Count == 2); - - // Construct with three catalog parameters - catalog = new AggregateCatalog(aggCatalog1, aggCatalog2, aggCatalog3); - Assert.IsTrue(catalog.Catalogs.Count == 3); - } - - - [TestMethod] - public void AggregatingCatalogParmsConstructorAggregateAssemblyCatalogs() - { - var assemblyCatalog1 = new AssemblyCatalog(typeof(SharedPartStuff).Assembly); - var assemblyCatalog2 = new AssemblyCatalog(typeof(SharedPartStuff).Assembly); - var assemblyCatalog3 = new AssemblyCatalog(typeof(SharedPartStuff).Assembly); - - // Construct with one catalog parameter - var catalog = new AggregateCatalog(assemblyCatalog1); - Assert.IsTrue(catalog.Catalogs.Count == 1); - - // Construct with two catalog parameters - catalog = new AggregateCatalog(assemblyCatalog1, assemblyCatalog2); - Assert.IsTrue(catalog.Catalogs.Count == 2); - - // Construct with three catalog parameters - catalog = new AggregateCatalog(assemblyCatalog1, assemblyCatalog2, assemblyCatalog3); - Assert.IsTrue(catalog.Catalogs.Count == 3); - } - - [TestMethod] - public void AggregatingCatalogParmsConstructorMixedCatalogs() - { - var typePartCatalog1 = new TypeCatalog(typeof(SharedPartStuff)); - var assemblyCatalog2 = new AssemblyCatalog(typeof(SharedPartStuff).Assembly); - var typePartCatalog3 = new TypeCatalog(typeof(SharedPartStuff)); - - // Construct with three catalog parameters - var catalog = new AggregateCatalog(typePartCatalog1, assemblyCatalog2, typePartCatalog3); - Assert.IsTrue(catalog.Catalogs.Count == 3); - } - - [TestMethod] - public void AggregatingCatalogRaisesChangesForCatalogsPassedToConstructor() - { - var subCatalog = CreateAggregateCatalog(); - var testCatalog = new AggregateCatalog(subCatalog); - - bool changedCalled = false; - testCatalog.Changed += delegate - { - changedCalled = true; - }; - - subCatalog.Catalogs.Add(new TypeCatalog(typeof(SharedPartStuff))); - - Assert.IsTrue(changedCalled); - } - - private AggregateCatalog CreateAggregateCatalog() - { - return new AggregateCatalog(); - } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void CatalogEvents_AggregateAddRemove() - { - var catalog = new AggregateCatalog(); - AggregateTests(catalog, catalog); - } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void CatalogEvents_DeepAggregateAddRemove() - { - var deepCatalog = new AggregateCatalog(); - var midCatalog = new AggregateCatalog(new ComposablePartCatalog[] { deepCatalog }); - var topCatalog = new AggregateCatalog(new ComposablePartCatalog[] { midCatalog }); - AggregateTests(topCatalog, deepCatalog); - } - - private void AggregateTests(AggregateCatalog watchedCatalog, AggregateCatalog modifiedCatalog) - { - var fooCatalog = new TypeCatalog(new Type[] { typeof(FooExporter) }); - var barCatalog = new TypeCatalog(new Type[] { typeof(BarExporter) }); - var bothCatalog = new TypeCatalog(new Type[] { typeof(FooExporter), typeof(BarExporter) }); - - var catalogListener = new CatalogListener(watchedCatalog, modifiedCatalog); - - catalogListener.VerifyAdd(fooCatalog, typeof(FooExporter)); - catalogListener.VerifyAdd(barCatalog, typeof(BarExporter)); - catalogListener.VerifyRemove(fooCatalog, typeof(FooExporter)); - catalogListener.VerifyRemove(barCatalog, typeof(BarExporter)); - - catalogListener.VerifyAdd(bothCatalog, typeof(FooExporter), typeof(BarExporter)); - catalogListener.VerifyClear(typeof(FooExporter), typeof(BarExporter)); - - catalogListener.VerifyAdd(bothCatalog, typeof(FooExporter), typeof(BarExporter)); - catalogListener.VerifyRemove(bothCatalog, typeof(FooExporter), typeof(BarExporter)); - } - - - public interface IFoo { } - public interface IBar { } - - [Export(typeof(IFoo))] - public class FooExporter : IFoo - { - } - - [Export(typeof(IBar))] - public class BarExporter : IBar - { - } - - public class CatalogListener - { - private AggregateCatalog _watchedCatalog; - private AggregateCatalog _modifiedCatalog; - private string[] _expectedAdds; - private string[] _expectedRemoves; - private int _changedEventCount; - private int _changingEventCount; - - public CatalogListener(AggregateCatalog watchCatalog, AggregateCatalog modifiedCatalog) - { - watchCatalog.Changing += OnChanging; - watchCatalog.Changed += OnChanged; - this._watchedCatalog = watchCatalog; - this._modifiedCatalog = modifiedCatalog; - } - - public void VerifyAdd(ComposablePartCatalog catalogToAdd, params Type[] expectedTypesAdded) - { - this._expectedAdds = GetDisplayNames(expectedTypesAdded); - - this._modifiedCatalog.Catalogs.Add(catalogToAdd); - - Assert.IsTrue(this._changingEventCount == 1, "Changing event should have been called"); - Assert.IsTrue(this._changedEventCount == 1, "Changed event should have been called"); - - ResetState(); - } - - public void VerifyRemove(ComposablePartCatalog catalogToRemove, params Type[] expectedTypesRemoved) - { - this._expectedAdds = null; - this._expectedRemoves = GetDisplayNames(expectedTypesRemoved); - - this._modifiedCatalog.Catalogs.Remove(catalogToRemove); - - Assert.IsTrue(this._changingEventCount == 1, "Changing event should have been called"); - Assert.IsTrue(this._changedEventCount == 1, "Changed event should have been called"); - - ResetState(); - } - - public void VerifyClear(params Type[] expectedTypesRemoved) - { - this._expectedAdds = null; - this._expectedRemoves = GetDisplayNames(expectedTypesRemoved); - - this._modifiedCatalog.Catalogs.Clear(); - - Assert.IsTrue(this._changingEventCount == 1, "Changing event should have been called"); - Assert.IsTrue(this._changedEventCount == 1, "Changed event should have been called"); - - ResetState(); - } - - public void OnChanging(object sender, ComposablePartCatalogChangeEventArgs args) - { - Assert.IsTrue(this._expectedAdds != null || this._expectedRemoves != null); - - if (this._expectedAdds == null) - { - EnumerableAssert.IsEmpty(args.AddedDefinitions); - } - else - { - EnumerableAssert.AreSequenceEqual(this._expectedAdds, GetDisplayNames(args.AddedDefinitions)); - } - - if (this._expectedRemoves == null) - { - EnumerableAssert.IsEmpty(args.RemovedDefinitions); - } - else - { - EnumerableAssert.AreSequenceEqual(this._expectedRemoves, GetDisplayNames(args.RemovedDefinitions)); - } - - Assert.IsFalse(ContainsChanges(), "The catalog should NOT contain the changes yet"); - - this._changingEventCount++; - } - - public void OnChanged(object sender, ComposablePartCatalogChangeEventArgs args) - { - Assert.IsTrue(this._expectedAdds != null || this._expectedRemoves != null); - - if (this._expectedAdds == null) - { - EnumerableAssert.IsEmpty(args.AddedDefinitions); - } - else - { - EnumerableAssert.AreSequenceEqual(this._expectedAdds, GetDisplayNames(args.AddedDefinitions)); - } - - if (this._expectedRemoves == null) - { - EnumerableAssert.IsEmpty(args.RemovedDefinitions); - } - else - { - EnumerableAssert.AreSequenceEqual(this._expectedRemoves, GetDisplayNames(args.RemovedDefinitions)); - } - - Assert.IsNull(args.AtomicComposition); - Assert.IsTrue(ContainsChanges(), "The catalog should contain the changes"); - - this._changedEventCount++; - } - - private bool ContainsChanges() - { - var allParts = GetDisplayNames(this._watchedCatalog.Parts); - - if (this._expectedAdds != null) - { - foreach (var add in this._expectedAdds) - { - if (!allParts.Contains(add)) - { - return false; - } - } - } - - if (this._expectedRemoves != null) - { - foreach (var remove in this._expectedRemoves) - { - if (allParts.Contains(remove)) - { - return false; - } - } - } - - return true; - } - - private void ResetState() - { - this._expectedAdds = null; - this._expectedRemoves = null; - this._changedEventCount = 0; - this._changingEventCount = 0; - } - - private static string[] GetDisplayNames(IEnumerable definitions) - { - return definitions.OfType().Select(p => p.DisplayName).ToArray(); - } - - private static string[] GetDisplayNames(IEnumerable types) - { - return GetDisplayNames(types.Select(t => AttributedModelServices.CreatePartDefinition(t, null))); - } - } - - [Export] - [PartCreationPolicy(CreationPolicy.Shared)] - public class SharedPartStuff - { - Guid id = Guid.NewGuid(); - - public override string ToString() - { - return id.ToString(); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxyTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxyTests.cs deleted file mode 100644 index 96f1e1ca626..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxyTests.cs +++ /dev/null @@ -1,66 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.Reflection; - -namespace System.ComponentModel.Composition.Hosting -{ - [TestClass] - public class AssemblyCatalogDebuggerProxyTests - { - [TestMethod] - public void Constructor_NullAsCatalogArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("catalog", () => - { - new AssemblyCatalogDebuggerProxy((AssemblyCatalog)null); - }); - } - - [TestMethod] - public void Constructor_ValueAsCatalogArgument_ShouldSetPartsProperty() - { - var expectations = Expectations.GetAssemblies(); - - foreach (var e in expectations) - { - var catalog = CreateAssemblyCatalog(e); - - var proxy = new AssemblyCatalogDebuggerProxy(catalog); - - EnumerableAssert.AreSequenceEqual(catalog.Parts, proxy.Parts); - } - } - - [TestMethod] - public void Constructor_ValueAsCatalogArgument_ShouldSetAssemblyProperty() - { - var expectations = Expectations.GetAssemblies(); - - foreach (var e in expectations) - { - var catalog = CreateAssemblyCatalog(e); - - var proxy = new AssemblyCatalogDebuggerProxy(catalog); - - Assert.AreSame(catalog.Assembly, proxy.Assembly); - } - } - - private AssemblyCatalogDebuggerProxy CreateAssemblyDebuggerProxy(AssemblyCatalog catalog) - { - return new AssemblyCatalogDebuggerProxy(catalog); - } - - private AssemblyCatalog CreateAssemblyCatalog(Assembly assembly) - { - return new AssemblyCatalog(assembly); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/AssemblyCatalogTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/AssemblyCatalogTests.cs deleted file mode 100644 index 961da8baf85..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/AssemblyCatalogTests.cs +++ /dev/null @@ -1,510 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.UnitTesting; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Security; -using System.Security.Permissions; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class AssemblyCatalogTests - { -#if !SILVERLIGHT - [TestMethod] - public void Constructor1_ValueAsAssemblyArgument_ShouldSetAssemblyProperty() - { - var expectations = Expectations.GetAssemblies(); - - foreach (var e in expectations) - { - var catalog = new AssemblyCatalog(e.CodeBase); - - Assert.AreSame(e, catalog.Assembly); - } - } -#endif - - [TestMethod] - public void Constructor2_ValueAsAssemblyArgument_ShouldSetAssemblyProperty() - { - var expectations = Expectations.GetAssemblies(); - - foreach (var e in expectations) - { - var catalog = new AssemblyCatalog(e); - - Assert.AreSame(e, catalog.Assembly); - } - } - -#if !SILVERLIGHT - - [TestMethod] - public void Constructor1_LockedFileAsCodeBaseArgument_ShouldThrowFileLoad() - { - using (TemporaryFile file = new TemporaryFile()) - { - using (FileStream stream = new FileStream(file.FileName, FileMode.Open, FileAccess.Read, FileShare.None)) - { - ExceptionAssert.Throws(() => - { - new AssemblyCatalog(file.FileName); - }); - } - } - } - - [TestMethod] - public void Constructor1_NullFileNameAsCodeBaseArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("codeBase", () => - { - new AssemblyCatalog((string)null); - }); - } - - [TestMethod] - public void Constructor1_EmptyFileNameAsCodeBaseArgument_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("codeBase", () => - { - new AssemblyCatalog(""); - }); - } - - [TestMethod] - public void Constructor1_InvalidFileNameAsCodeBaseArgument_ShouldThrowArgument() - { - ExceptionAssert.Throws(() => - { - new AssemblyCatalog("??||>"); - }); - } - - [TestMethod] - public void Constructor1_DirectoryAsCodeBaseArgument_ShouldThrowFileLoad() - { - string directory = Environment.GetFolderPath(Environment.SpecialFolder.System); - Assert.IsTrue(Directory.Exists(directory)); - - ExceptionAssert.Throws(() => - { - new AssemblyCatalog(directory); - }); - } - - [TestMethod] - public void Constructor1_TooLongFileNameAsCodeBaseArgument_ShouldThrowPathTooLong() - { - ExceptionAssert.Throws(() => - { - new AssemblyCatalog(@"c:\This is a very long path\And Just to make sure\We will continue to make it very long\This is a very long path\And Just to make sure\We will continue to make it very long\This is a very long path\And Just to make sure\We will continue to make it very long\myassembly.dll"); - }); - } - - [TestMethod] - public void Constructor1_NonAssemblyFileNameAsCodeBaseArgument_ShouldThrowBadImageFormat() - { - using (TemporaryFile temporaryFile = new TemporaryFile()) - { - ExceptionAssert.Throws(() => - { - new AssemblyCatalog(temporaryFile.FileName); - }); - } - } - - [TestMethod] - public void Constructor1_NonExistentFileNameAsCodeBaseArgument_ShouldThrowFileNotFound() - { - ExceptionAssert.Throws(() => - { - new AssemblyCatalog(@"FileThat should not ever exist"); - }); - } -#endif - -#if !SILVERLIGHT - - [TestMethod] - public void Constructor1_ShouldSetOriginToNull() - { - var catalog = (ICompositionElement)new AssemblyCatalog(GetAttributedAssemblyCodeBase()); - - Assert.IsNull(catalog.Origin); - } - -#endif - - [TestMethod] - public void Constructor2_ShouldSetOriginToNull() - { - var catalog = (ICompositionElement)new AssemblyCatalog(GetAttributedAssembly()); - - Assert.IsNull(catalog.Origin); - } - - [TestMethod] - public void Assembly_WhenCatalogDisposed_ShouldNotThrow() - { - var catalog = CreateAssemblyCatalog(); - catalog.Dispose(); - - Assert.IsNotNull(catalog.Assembly); - } - - [TestMethod] - public void ICompositionElementDisplayName_WhenCatalogDisposed_ShouldNotThrow() - { - var catalog = CreateAssemblyCatalog(); - catalog.Dispose(); - - var displayName = ((ICompositionElement)catalog).DisplayName; - } - - [TestMethod] - public void ICompositionElementOrigin_WhenCatalogDisposed_ShouldNotThrow() - { - var catalog = CreateAssemblyCatalog(); - catalog.Dispose(); - - var origin = ((ICompositionElement)catalog).Origin; - } - - [TestMethod] - public void ToString_WhenCatalogDisposed_ShouldNotThrow() - { - var catalog = CreateAssemblyCatalog(); - catalog.Dispose(); - - catalog.ToString(); - } - - [TestMethod] - public void Parts_WhenCatalogDisposed_ShouldThrowObjectDisposed() - { - var catalog = CreateAssemblyCatalog(); - catalog.Dispose(); - - ExceptionAssert.ThrowsDisposed(catalog, () => - { - var parts = catalog.Parts; - }); - } - - [TestMethod] - public void GetExports_WhenCatalogDisposed_ShouldThrowObjectDisposed() - { - var catalog = CreateAssemblyCatalog(); - catalog.Dispose(); - var definition = ImportDefinitionFactory.Create(); - - ExceptionAssert.ThrowsDisposed(catalog, () => - { - catalog.GetExports(definition); - }); - } - - [TestMethod] - public void GetExports_NullAsConstraintArgument_ShouldThrowArgumentNull() - { - var catalog = CreateAssemblyCatalog(); - - ExceptionAssert.ThrowsArgument("definition", () => - { - catalog.GetExports((ImportDefinition)null); - }); - } - - - [TestMethod] - public void Dispose_ShouldNotThrow() - { - using (var catalog = CreateAssemblyCatalog()) - { - } - } - - [TestMethod] - public void Dispose_CanBeCalledMultipleTimes() - { - var catalog = CreateAssemblyCatalog(); - catalog.Dispose(); - catalog.Dispose(); - catalog.Dispose(); - } - - [TestMethod] - public void Parts() - { - var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); - Assert.IsNotNull(catalog.Parts); - Assert.IsTrue(catalog.Parts.Count()>0); - } - - - [TestMethod] - public void Parts_ShouldSetDefinitionOriginToCatalogItself() - { - var catalog = CreateAssemblyCatalog(); - Assert.IsTrue(catalog.Parts.Count() > 0); - - foreach (ICompositionElement definition in catalog.Parts) - { - Assert.AreSame(catalog, definition.Origin); - } - } - - [TestMethod] - public void GetExports() - { - var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); - Expression> constraint = (ExportDefinition exportDefinition) => exportDefinition.ContractName == AttributedModelServices.GetContractName(typeof(MyExport)); - IEnumerable> matchingExports = catalog.GetExports(constraint); - Assert.IsNotNull(matchingExports); - Assert.IsTrue(matchingExports.Count() >= 0); - - IEnumerable> expectedMatchingExports = catalog.Parts - .SelectMany(part => part.ExportDefinitions, (part, export) => new Tuple(part, export)) - .Where(partAndExport => partAndExport.Item2.ContractName == AttributedModelServices.GetContractName(typeof(MyExport))); - Assert.IsTrue(matchingExports.SequenceEqual(expectedMatchingExports)); - } - - - -#if !SILVERLIGHT - // Silverlight does not support loading assemblies via file path - [TestMethod] - public void AddAssemblyUsingFile() - { - var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly.Location); - var container = new CompositionContainer(catalog); - - Assert.IsNotNull(container.GetExportedValue()); - } -#endif - - [TestMethod] - public void TwoTypesWithSameSimpleName() - { - var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); - var container = new CompositionContainer(catalog); - - NotSoUniqueName unique1 = container.GetExportedValue(); - Assert.IsNotNull(unique1); - - Assert.AreEqual(23, unique1.MyIntProperty); - - NotSoUniqueName2.NotSoUniqueName nestedUnique = container.GetExportedValue(); - - Assert.IsNotNull(nestedUnique); - Assert.AreEqual("MyStringProperty", nestedUnique.MyStringProperty); - } - - [TestMethod] - public void GettingFunctionExports() - { - var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); - var container = new CompositionContainer(catalog); - - ImportDefaultFunctions import = container.GetExportedValue("ImportDefaultFunctions"); - import.VerifyIsBound(); - } - - [TestMethod] - public void AnExportOfAnInstanceThatFailsToCompose() - { - var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); - var container = new CompositionContainer(catalog); - - // Rejection causes the part in the catalog whose imports cannot be - // satisfied to be ignored, resulting in a cardinality mismatch instead of a - // composition exception - ExceptionAssert.Throws(() => - { - container.GetExportedValue("ExportMyString"); - }); - } - - [TestMethod] - public void SharedPartCreation() - { - var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); - var container = new CompositionContainer(catalog); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new Int32Exporter(41)); - container.Compose(batch); - - var sharedPart1 = container.GetExportedValue(); - Assert.AreEqual(41, sharedPart1.Value); - var sharedPart2 = container.GetExportedValue(); - Assert.AreEqual(41, sharedPart2.Value); - - Assert.AreEqual(sharedPart1, sharedPart2, "These should be the same instances"); - } - - [TestMethod] - public void NonSharedPartCreation() - { - var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); - var container = new CompositionContainer(catalog); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new Int32Exporter(41)); - container.Compose(batch); - - var nonSharedPart1 = container.GetExportedValue(); - Assert.AreEqual(41, nonSharedPart1.Value); - var nonSharedPart2 = container.GetExportedValue(); - Assert.AreEqual(41, nonSharedPart2.Value); - - Assert.AreNotSame(nonSharedPart1, nonSharedPart2, "These should be different instances"); - } - - [TestMethod] - public void RecursiveNonSharedPartCreation() - { - var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); - var container = new CompositionContainer(catalog); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - { - container.GetExportedValue(); - }); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - { - container.GetExportedValue(); - }); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - { - container.GetExportedValue(); - }); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - { - container.GetExportedValue(); - }); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - { - container.GetExportedValue(); - }); - - Assert.IsNotNull(container.GetExportedValue()); - Assert.IsNotNull(container.GetExportedValue()); - Assert.IsNotNull(container.GetExportedValue()); - Assert.IsNotNull(container.GetExportedValue()); - } - - [TestMethod] - public void TryToDiscoverExportWithGenericParameter() - { - var catalog = new AssemblyCatalog(typeof(AssemblyCatalogTests).Assembly); - var container = new CompositionContainer(catalog); - - // Open generic should fail because we should discover that type - Assert.IsNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(ExportWithGenericParameter<>)))); - - // This specific generic was not exported any where so it should fail - Assert.IsNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(ExportWithGenericParameter)))); - - // This specific generic was exported so it should succeed - Assert.IsNotNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(ExportWithGenericParameter)))); - - // Shouldn't discovoer static type with open generic - Assert.IsNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(StaticExportWithGenericParameter<>)))); - - // Should find a type that inherits from an export - Assert.IsNotNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(ExportWhichInheritsFromGeneric)))); - - // This should be exported because it is inherited by ExportWhichInheritsFromGeneric - Assert.IsNotNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(ExportWithGenericParameter)))); - } - - [TestMethod] - public void ICompositionElementDisplayName_ShouldIncludeCatalogTypeNameAndAssemblyFullName() - { - var expectations = Expectations.GetAssemblies(); - - foreach (var e in expectations) - { - var catalog = (ICompositionElement)CreateAssemblyCatalog(e); - - string expected = string.Format("AssemblyCatalog (Assembly=\"{0}\")", e.FullName); - - Assert.AreEqual(expected, catalog.DisplayName); - } - } - - [TestMethod] - public void ICompositionElementDisplayName_ShouldIncludeDerivedCatalogTypeNameAndAssemblyFullName() - { - var expectations = Expectations.GetAssemblies(); - - foreach (var e in expectations) - { - var catalog = (ICompositionElement)new DerivedAssemblyCatalog(e); - - string expected = string.Format("DerivedAssemblyCatalog (Assembly=\"{0}\")", e.FullName); - - Assert.AreEqual(expected, catalog.DisplayName); - } - } - - [TestMethod] - public void ToString_ShouldReturnICompositionElementDisplayName() - { - var expectations = Expectations.GetAssemblies(); - - foreach (var e in expectations) - { - var catalog = (ICompositionElement)CreateAssemblyCatalog(e); - - Assert.AreEqual(catalog.DisplayName, catalog.ToString()); - } - } - - - - private string GetAttributedAssemblyCodeBase() - { - return Assembly.GetExecutingAssembly().CodeBase; - } - - private Assembly GetAttributedAssembly() - { - return Assembly.GetExecutingAssembly(); - } - - private AssemblyCatalog CreateAssemblyCatalog() - { - return CreateAssemblyCatalog(GetAttributedAssembly()); - } - - private AssemblyCatalog CreateAssemblyCatalog(Assembly assembly) - { - return new AssemblyCatalog(assembly); - } - - private class DerivedAssemblyCatalog : AssemblyCatalog - { - public DerivedAssemblyCatalog(Assembly assembly) - : base(assembly) - { - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/CatalogExportProviderTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/CatalogExportProviderTests.cs deleted file mode 100644 index 3e0eb928b81..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/CatalogExportProviderTests.cs +++ /dev/null @@ -1,599 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.ComponentModel.Composition.Diagnostics; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ComposablePartCatalogExportProviderTests - { - [TestMethod] - public void Constructor_NullAsCatalogArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("catalog", () => - { - new CatalogExportProvider((ComposablePartCatalog)null); - }); - } - - [TestMethod] - public void Constructor_ValueAsCatalogArgument_ShouldSetCatalogPropertyToEmpty() - { - var expectations = Expectations.GetCatalogs(); - - foreach (var e in expectations) - { - var provider = new CatalogExportProvider(e); - - Assert.AreSame(e, provider.Catalog); - } - } - - [TestMethod] - public void Catalog_WhenDisposed_ShouldThrowObjectDisposed() - { - var provider = CreateCatalogExportProvider(); - provider.Dispose(); - - ExceptionAssert.ThrowsDisposed(provider, () => - { - var catalog = provider.Catalog; - }); - } - - [TestMethod] - public void SourceProvider_NullAsValueArgument_ShouldThrowArgumentNull() - { - var provider = CreateCatalogExportProvider(); - - ExceptionAssert.ThrowsArgument("value", () => - { - provider.SourceProvider = null; - }); - } - - [TestMethod] - public void GetExports_WhenRejectedDefinitionRequiredImportIsAdded_ShouldBeResurrected() - { - var part = PartFactory.CreateImporterExporter("Export", "Import"); - - var provider = CreateCatalogExportProvider(part); - var sourceProvider = ExportProviderFactory.CreateRecomposable(); - provider.SourceProvider = sourceProvider; - - var exports = provider.GetExports("Export"); - - EnumerableAssert.IsEmpty(exports, "definition should have been rejected."); - - // Resurrect the definition - sourceProvider.AddExport("Import", new object()); - - exports = provider.GetExports("Export"); - - Assert.AreEqual(1, exports.Count(), "definition should have been resurrected."); - } - - [TestMethod] - public void GetExports_WhenMultipleRejectedDefinitionsRequiredImportsAreAdded_ShouldBeResurrected() - { - var part1 = PartFactory.CreateImporterExporter("Export", "Import"); - var part2 = PartFactory.CreateImporterExporter("Export", "Import"); - - var provider = CreateCatalogExportProvider(part1, part2); - var sourceProvider = ExportProviderFactory.CreateRecomposable(); - provider.SourceProvider = sourceProvider; - - var exports = provider.GetExports("Export"); - - EnumerableAssert.IsEmpty(exports, "definition1 and definition2 should have been rejected."); - - // Resurrect both definitions - sourceProvider.AddExport("Import", new object()); - - exports = provider.GetExports("Export"); - - Assert.AreEqual(2, exports.Count(), "definition1 and definition2 should have been resurrected."); - } - - [TestMethod] - [WorkItem(743740)] - public void GetExports_AfterResurrectedDefinitionHasBeenRemovedAndReaddedToCatalog_ShouldNotBeTreatedAsRejected() - { - var definition1 = PartDefinitionFactory.Create(PartFactory.CreateImporterExporter("Export", "Import")); - var definition2 = PartDefinitionFactory.Create(PartFactory.CreateImporterExporter("Export", "Import")); - var catalog = CatalogFactory.CreateMutable(definition1, definition2); - - var provider = CreateCatalogExportProvider(catalog); - var sourceProvider = ExportProviderFactory.CreateRecomposable(); - provider.SourceProvider = sourceProvider; - - var exports = provider.GetExports("Export"); - - EnumerableAssert.IsEmpty(exports, "definition1 and definition2 should have been rejected."); - - // Resurrect both definitions - sourceProvider.AddExport("Import", new object()); - - exports = provider.GetExports("Export"); - - Assert.AreEqual(2, exports.Count(), "definition1 and definition2 should have been resurrected."); - - catalog.RemoveDefinition(definition1); - - exports = provider.GetExports("Export"); - Assert.AreEqual(1, exports.Count(), "definition1 should have been removed."); - - catalog.AddDefinition(definition1); - - exports = provider.GetExports("Export"); - - Assert.AreEqual(2, exports.Count(), "definition1 and definition2 should be both present."); - } - -#if !SILVERLIGHT - - [TestMethod] - public void GetExports_WhenDefinitionIsRejected_ShouldTraceWarning() - { - using (TraceContext context = new TraceContext(SourceLevels.Warning)) - { - var part = PartFactory.CreateImporterExporter("Export", "Import"); - var provider = CreateCatalogExportProvider(part); - provider.SourceProvider = ExportProviderFactory.CreateRecomposable(); - - ExceptionAssert.Throws(() => - { - provider.GetExport("Export"); - - }); - - Assert.IsNotNull(context.LastTraceEvent); - Assert.AreEqual(context.LastTraceEvent.EventType, TraceEventType.Warning); - Assert.AreEqual(context.LastTraceEvent.Id, TraceId.Rejection_DefinitionRejected); - } - } - - [TestMethod] - public void GetExports_WhenDefinitionIsResurrected_ShouldTraceInformation() - { - using (TraceContext context = new TraceContext(SourceLevels.Information)) - { - var part = PartFactory.CreateImporterExporter("Export", "Import"); - var sourceProvider = ExportProviderFactory.CreateRecomposable(); - var provider = CreateCatalogExportProvider(part); - provider.SourceProvider = sourceProvider; - - ExceptionAssert.Throws(() => - { - provider.GetExport("Export"); - }); - - // Add the required export to the source provider 'resurrect' the part - sourceProvider.AddExport("Import", "Value"); - - provider.GetExport("Export"); - - Assert.IsNotNull(context.LastTraceEvent); - Assert.AreEqual(context.LastTraceEvent.EventType, TraceEventType.Information); - Assert.AreEqual(context.LastTraceEvent.Id, TraceId.Rejection_DefinitionResurrected); - } - } - - [TestMethod] - public void GetExports_WhenDefinitionsAreResurrected_ShouldTraceInformation() - { - using (TraceContext context = new TraceContext(SourceLevels.Information)) - { - var part1 = PartFactory.CreateImporterExporter("Export", "Import"); - var part2 = PartFactory.CreateImporterExporter("Export", "Import"); - - var sourceProvider = ExportProviderFactory.CreateRecomposable(); - var provider = CreateCatalogExportProvider(part1, part2); - provider.SourceProvider = sourceProvider; - - EnumerableAssert.IsEmpty(provider.GetExports("Export")); - - // Add the required export to the source provider 'resurrect' the part - sourceProvider.AddExport("Import", "Value"); - - provider.GetExports("Export"); - - Assert.AreEqual(4, context.TraceEvents.Count); // 2 for rejection, 2 for resurrection - Assert.AreEqual(context.TraceEvents[2].EventType, TraceEventType.Information); - Assert.AreEqual(context.TraceEvents[3].EventType, TraceEventType.Information); - Assert.AreEqual(context.TraceEvents[2].Id, TraceId.Rejection_DefinitionResurrected); - Assert.AreEqual(context.TraceEvents[3].Id, TraceId.Rejection_DefinitionResurrected); - } - } -#endif - - [TestMethod] - [TestProperty("Type", "Integration")] - public void BasicTest() - { - var catalog = CatalogFactory.CreateDefaultAttributed(); - var catalogExportProvider = new CatalogExportProvider(catalog); - catalogExportProvider.SourceProvider = catalogExportProvider; - var testName = AttributedModelServices.GetContractName(typeof(CatalogComponentTest)); - var testNameNonComponent = AttributedModelServices.GetContractName(typeof(CatalogComponentTestNonComponentPart)); - var testInterfaceName = AttributedModelServices.GetContractName(typeof(ICatalogComponentTest)); - - Assert.AreEqual(1, catalogExportProvider.GetExports(ImportFromContract(testName)).Count()); - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContract(testNameNonComponent)).Count()); - - var exports = catalogExportProvider.GetExports(ImportFromContract(testInterfaceName)); - Assert.AreEqual(2, exports.Count(), "There should be 2 of them"); - - foreach (var i in exports) - Assert.IsNotNull(i.Value, "Should get a value"); - - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void BasicTestWithRequiredMetadata_NoTypeConstraint() - { - var catalog = CatalogFactory.CreateDefaultAttributed(); - var catalogExportProvider = new CatalogExportProvider(catalog); - catalogExportProvider.SourceProvider = catalogExportProvider; - - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithNoFoo", new string[] { "Foo" }, new Type[] {typeof(object)})).Count()); - - Assert.AreEqual(1, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithFoo", new string[] { "Foo" }, new Type[] { typeof(object) })).Count()); - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithFoo", new string[] { "Foo", "Bar" }, new Type[] { typeof(object), typeof(object) })).Count()); - - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithNoFoo", new string[] { "Foo" }, new Type[] { typeof(object) })).Count()); - Assert.AreEqual(1, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithFoo", new string[] { "Foo" }, new Type[] { typeof(object) })).Count()); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void BasicTestWithRequiredMetadata_TypeConstraint() - { - var catalog = CatalogFactory.CreateDefaultAttributed(); - var catalogExportProvider = new CatalogExportProvider(catalog); - catalogExportProvider.SourceProvider = catalogExportProvider; - - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithNoFoo", new string[] { "Foo" }, new Type[] { typeof(string) })).Count()); - - Assert.AreEqual(1, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithFoo", new string[] { "Foo" }, new Type[] { typeof(string) })).Count()); - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithFoo", new string[] { "Foo", "Bar" }, new Type[] { typeof(string), typeof(string) })).Count()); - - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithNoFoo", new string[] { "Foo" }, new Type[] { typeof(string) })).Count()); - Assert.AreEqual(1, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithFoo", new string[] { "Foo" }, new Type[] { typeof(string) })).Count()); - } - - - [TestMethod] - [TestProperty("Type", "Integration")] - public void BasicTestWithRequiredMetadata_WrongTypeConstraint() - { - var catalog = CatalogFactory.CreateDefaultAttributed(); - var catalogExportProvider = new CatalogExportProvider(catalog); - catalogExportProvider.SourceProvider = catalogExportProvider; - - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithNoFoo", new string[] { "Foo" }, new Type[] { typeof(int) })).Count()); - - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithFoo", new string[] { "Foo" }, new Type[] { typeof(int) })).Count()); - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithFoo", new string[] { "Foo", "Bar" }, new Type[] { typeof(int), typeof(int) })).Count()); - - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithNoFoo", new string[] { "Foo" }, new Type[] { typeof(int) })).Count()); - Assert.AreEqual(0, catalogExportProvider.GetExports(ImportFromContractAndMetadata("MyExporterWithFoo", new string[] { "Foo" }, new Type[] { typeof(int) })).Count()); - } - - - [TestMethod] - [TestProperty("Type", "Integration")] - public void ComponentCatalogResolverGetStaticExport() - { - var catalog = CatalogFactory.CreateDefaultAttributed(); - var catalogExportProvider = new CatalogExportProvider(catalog); - catalogExportProvider.SourceProvider = catalogExportProvider; - - var exports = catalogExportProvider.GetExports(ImportFromContract("StaticString")); - Assert.AreEqual(1, exports.Count()); - Assert.AreEqual("StaticString", exports.First().Value); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void ComponentCatalogResolverComponentCatalogExportReference() - { - var catalog = CatalogFactory.CreateDefaultAttributed(); - var catalogExportProvider = new CatalogExportProvider(catalog); - catalogExportProvider.SourceProvider = catalogExportProvider; - - var exports = catalogExportProvider.GetExports(ImportFromContract(AttributedModelServices.GetContractName(typeof(MyExporterWithValidMetadata)))); - - Assert.AreEqual(1, exports.Count()); - - var export = exports.First(); - Assert.AreEqual("world", export.Metadata["hello"]); - - Assert.IsInstanceOfType(export.Value, typeof(MyExporterWithValidMetadata)); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - public void ValueTypeFromCatalog() - { - var catalog = CatalogFactory.CreateDefaultAttributed(); - var container = new CompositionContainer(catalog); - int singletonResult = container.GetExportedValue("{AssemblyCatalogResolver}SingletonValueType"); - Assert.AreEqual(17, singletonResult, "expecting value type resolved from catalog"); - int factoryResult = container.GetExportedValue("{AssemblyCatalogResolver}FactoryValueType"); - Assert.AreEqual(18, factoryResult, "expecting value type resolved from catalog"); - } - - [Export] - [PartCreationPolicy(CreationPolicy.Any)] - public class CreationPolicyAny - { - - } - - [TestMethod] - public void CreationPolicyAny_MultipleCallsReturnSameInstance() - { - var catalog = CatalogFactory.CreateAttributed(typeof (CreationPolicyAny)); - var provider = new CatalogExportProvider(catalog); - provider.SourceProvider = ContainerFactory.Create(); - - var export = provider.GetExportedValue(); - - for (int i = 0; i < 5; i++) // 5 is arbitrarily chosen - { - var export1 = provider.GetExportedValue(); - - Assert.AreEqual(export, export1); - } - } - - [Export] - [PartCreationPolicy(CreationPolicy.Shared)] - public class CreationPolicyShared - { - - } - - [TestMethod] - public void CreationPolicyShared_MultipleCallsReturnSameInstance() - { - var catalog = CatalogFactory.CreateAttributed(typeof(CreationPolicyShared)); - var provider = new CatalogExportProvider(catalog); - provider.SourceProvider = ContainerFactory.Create(); - - var export = provider.GetExportedValue(); - - for (int i = 0; i < 5; i++) // 5 is arbitrarily chosen - { - var export1 = provider.GetExportedValue(); - - Assert.AreEqual(export, export1); - } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class CreationPolicyNonShared - { - - } - - [TestMethod] - public void CreationPolicyNonShared_MultipleCallsReturnsDifferentInstances() - { - var catalog = CatalogFactory.CreateAttributed(typeof(CreationPolicyNonShared)); - var provider = new CatalogExportProvider(catalog); - provider.SourceProvider = ContainerFactory.Create(); - - List list = new List(); - var export = provider.GetExportedValue(); - list.Add(export); - - for (int i = 0; i < 5; i++) // 5 is arbitrarily chosen - { - export = provider.GetExportedValue(); - - CollectionAssert.DoesNotContain(list, export); - list.Add(export); - } - } - - [TestMethod] - [WorkItem(684514)] - public void GetExports_NoSourceProvider_ShouldThrowInvalidOperation() - { - var catalog = CatalogFactory.CreateAttributed(); - var provider = new CatalogExportProvider(catalog); - - ExceptionAssert.Throws(() => - provider.GetExports(ImportFromContract("Foo"))); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - [Ignore] - [WorkItem(561310)] - public void Recomposition_PartDefWithRecomposableImportIsRemoved_ExportsMatchingImportChanged_ShouldNotBeRecomposed() - { - string dependencyContractName = "dependency"; - var exportValue = new object(); - - var exporterPart = PartFactory.CreateExporter(dependencyContractName, exportValue); - var importerPart = PartFactory.CreateImporter(dependencyContractName, true); - - var exporterCatalog = CatalogFactory.Create(exporterPart); - var importerCatalog = CatalogFactory.Create(importerPart); - - var aggregateCatalog = CatalogFactory.CreateAggregateCatalog(importerCatalog, exporterCatalog); - - var provider = new CatalogExportProvider(aggregateCatalog); - provider.SourceProvider = provider; - - var exports = provider.GetExports(importerPart.ImportDefinitions.Single()); - Assert.AreEqual(exportValue, importerPart.Value, "Importer was not composed"); - - aggregateCatalog.Catalogs.Remove(importerCatalog); - aggregateCatalog.Catalogs.Remove(exporterCatalog); - - Assert.AreEqual(exportValue, importerPart.Value, "Importer was unexpectedly recomposed"); - } - - [TestMethod] - [TestProperty("Type", "Integration")] - [Ignore] - [WorkItem(561310)] - public void Recomposition_PartDefWithNonRecomposableImportIsRemoved_ExportsMatchingImportChanged_ShouldNotBeRejected() - { - string dependencyContractName = "dependency"; - var exportValue = new object(); - - var exporterPart = PartFactory.CreateExporter(dependencyContractName, exportValue); - var importerPart = PartFactory.CreateImporter(dependencyContractName, false); - - var exporterCatalog = CatalogFactory.Create(exporterPart); - var importerCatalog = CatalogFactory.Create(importerPart); - - var aggregateCatalog = CatalogFactory.CreateAggregateCatalog(importerCatalog, exporterCatalog); - - var provider = new CatalogExportProvider(aggregateCatalog); - provider.SourceProvider = provider; - - var exports = provider.GetExports(importerPart.ImportDefinitions.Single()); - Assert.AreEqual(exportValue, importerPart.Value, "Importer was not composed"); - - aggregateCatalog.Catalogs.Remove(importerCatalog); - aggregateCatalog.Catalogs.Remove(exporterCatalog); - - Assert.AreEqual(exportValue, importerPart.Value, "Importer was unexpectedly recomposed"); - } - - [TestMethod] - public void CanBeCollectedAfterDispose() - { - AggregateExportProvider sourceExportProvider = new AggregateExportProvider(); - var catalog = new AggregateCatalog(CatalogFactory.CreateDefaultAttributed()); - var catalogExportProvider = new CatalogExportProvider(catalog); - catalogExportProvider.SourceProvider = sourceExportProvider; - - WeakReference weakCatalogExportProvider = new WeakReference(catalogExportProvider); - catalogExportProvider.Dispose(); - catalogExportProvider = null; - - GC.Collect(); - GC.WaitForPendingFinalizers(); - - Assert.IsFalse(weakCatalogExportProvider.IsAlive); - - GC.KeepAlive(sourceExportProvider); - GC.KeepAlive(catalog); - } - - [TestMethod] - public void RemovingAndReAddingMultipleDefinitionsFromCatalog() - { - var fixedParts = new TypeCatalog(typeof(RootMultipleImporter), typeof(ExportedService)); - var changingParts = new TypeCatalog(typeof(Exporter1), typeof(Exporter2)); - var catalog = new AggregateCatalog(); - catalog.Catalogs.Add(fixedParts); - catalog.Catalogs.Add(changingParts); - var catalogExportProvider = new CatalogExportProvider(catalog); - catalogExportProvider.SourceProvider = catalogExportProvider; - - var root = catalogExportProvider.GetExport().Value; - Assert.AreEqual(2, root.Imports.Length); - - catalog.Catalogs.Remove(changingParts); - Assert.AreEqual(0, root.Imports.Length); - - catalog.Catalogs.Add(changingParts); - Assert.AreEqual(2, root.Imports.Length); - } - - [Export] - public class RootMultipleImporter - { - [ImportMany(AllowRecomposition = true)] - public IExportedInterface[] Imports { get; set; } - } - public interface IExportedInterface - { - } - [Export(typeof(IExportedInterface))] - public class Exporter1 : IExportedInterface - { - [Import] - public ExportedService Service { get; set; } - } - [Export(typeof(IExportedInterface))] - public class Exporter2 : IExportedInterface - { - [Import] - public ExportedService Service { get; set; } - } - [Export] - public class ExportedService - { - } - - - - private static ImportDefinition ImportFromContract(string contractName) - { - return ImportDefinitionFactory.CreateDefault(contractName, - - ImportCardinality.ZeroOrMore, - false, - false); - } - - private static ImportDefinition ImportFromContractAndMetadata(string contractName, string[] metadataKeys, Type[] metadataValues) - { - Assert.AreEqual(metadataKeys.Length, metadataValues.Length); - Dictionary requiredMetadata = new Dictionary(); - for (int i = 0; i < metadataKeys.Length; i++) - { - requiredMetadata.Add(metadataKeys[i], metadataValues[i]); - } - - return new ContractBasedImportDefinition(contractName, - (string)null, - requiredMetadata, - ImportCardinality.ZeroOrMore, - false, - false, - CreationPolicy.Any); - } - - private static CatalogExportProvider CreateCatalogExportProvider() - { - return CreateCatalogExportProvider(CatalogFactory.Create()); - } - - private static CatalogExportProvider CreateCatalogExportProvider(params ComposablePartDefinition[] definitions) - { - return CreateCatalogExportProvider(CatalogFactory.Create(definitions)); - } - - private static CatalogExportProvider CreateCatalogExportProvider(params ComposablePart[] parts) - { - return CreateCatalogExportProvider(CatalogFactory.Create(parts)); - } - - private static CatalogExportProvider CreateCatalogExportProvider(ComposablePartCatalog catalog) - { - return new CatalogExportProvider(catalog); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/CompositionBatchTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/CompositionBatchTests.cs deleted file mode 100644 index f43f56ed1e5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/CompositionBatchTests.cs +++ /dev/null @@ -1,872 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Factories; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; -using System.Collections.ObjectModel; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CompositionBatchTests - { - [TestMethod] - public void Constructor1_PropertiesShouldBeSetAndEmpty() - { - CompositionBatch batch = new CompositionBatch(); - - Assert.IsNotNull(batch.PartsToAdd); - EnumerableAssert.IsEmpty(batch.PartsToAdd); - - Assert.IsNotNull(batch.PartsToRemove); - EnumerableAssert.IsEmpty(batch.PartsToRemove); - } - - [TestMethod] - public void Constructor2_PropertiesShouldBeSetAndMatchArguments() - { - ComposablePart[] partsToAdd = new ComposablePart[] { PartFactory.Create(), PartFactory.Create(), PartFactory.Create() }; - ComposablePart[] partsToRemove = new ComposablePart[] { PartFactory.Create(), PartFactory.Create(), PartFactory.Create() }; - - - CompositionBatch batch = new CompositionBatch(partsToAdd, partsToRemove); - - Assert.IsNotNull(batch.PartsToAdd); - Assert.IsNotNull(batch.PartsToRemove); - - EnumerableAssert.AreSequenceEqual(batch.PartsToAdd, partsToAdd); - EnumerableAssert.AreSequenceEqual(batch.PartsToRemove, partsToRemove); - } - - - [TestMethod] - public void Constructor2_PartsToAddAsNull_PartsToAddShouldBeEmpty() - { - ComposablePart[] partsToRemove = new ComposablePart[] { PartFactory.Create(), PartFactory.Create(), PartFactory.Create() }; - - var batch = new CompositionBatch(null, partsToRemove); - - Assert.AreEqual(0, batch.PartsToAdd.Count); - Assert.AreEqual(partsToRemove.Length, batch.PartsToRemove.Count); - } - - [TestMethod] - public void Constructor2_PartsToRemoveAsNull_PartsToRemoveShouldBeEmpty() - { - ComposablePart[] partsToAdd = new ComposablePart[] { PartFactory.Create(), PartFactory.Create(), PartFactory.Create() }; - - var batch = new CompositionBatch(partsToAdd, null); - - Assert.AreEqual(partsToAdd.Length, batch.PartsToAdd.Count); - Assert.AreEqual(0, batch.PartsToRemove.Count); - } - - [TestMethod] - public void Constructor2_PartsToAddHasNull_ShouldThrowArgumentNullException() - { - ComposablePart[] partsToAdd = new ComposablePart[] { PartFactory.Create(), null, PartFactory.Create() }; - ComposablePart[] partsToRemove = new ComposablePart[] { PartFactory.Create(), PartFactory.Create(), PartFactory.Create() }; - - ExceptionAssert.ThrowsArgument("partsToAdd", () => - { - new CompositionBatch(partsToAdd, partsToRemove); - }); - } - - [TestMethod] - public void Constructor2_PartsToRemoveHasNull_ShouldThrowArgumentNullException() - { - ComposablePart[] partsToAdd = new ComposablePart[] { PartFactory.Create(), PartFactory.Create(), PartFactory.Create() }; - ComposablePart[] partsToRemove = new ComposablePart[] { PartFactory.Create(), null, PartFactory.Create() }; - - ExceptionAssert.ThrowsArgument("partsToRemove", () => - { - new CompositionBatch(partsToAdd, partsToRemove); - }); - } - - [TestMethod] - public void AddPart_PartIsInPartsToAdd() - { - CompositionBatch batch = new CompositionBatch(); - ComposablePart part = PartFactory.Create(); - - batch.AddPart(part); - - Assert.AreEqual(1, batch.PartsToAdd.Count); - Assert.AreSame(part, batch.PartsToAdd[0]); - - EnumerableAssert.IsEmpty(batch.PartsToRemove); - } - - [TestMethod] - public void AddPart_PartAsNull_ShouldThrowArgumentNullException() - { - CompositionBatch batch = new CompositionBatch(); - - ExceptionAssert.ThrowsArgument("part", () => - { - batch.AddPart(null); - }); - } - - [TestMethod] - public void RemovePart_PartIsInPartsToRemove() - { - CompositionBatch batch = new CompositionBatch(); - ComposablePart part = PartFactory.Create(); - - batch.RemovePart(part); - - Assert.AreEqual(1, batch.PartsToRemove.Count); - Assert.AreSame(part, batch.PartsToRemove[0]); - - EnumerableAssert.IsEmpty(batch.PartsToAdd); - } - - [TestMethod] - public void RemovePart_PartAsNull_ShouldThrowArgumentNullException() - { - CompositionBatch batch = new CompositionBatch(); - - ExceptionAssert.ThrowsArgument("part", () => - { - batch.RemovePart(null); - }); - } - - [TestMethod] - public void PartsToAdd_ShouldGetCopiedAfterAdd() - { - CompositionBatch batch = new CompositionBatch(); - ComposablePart part1 = PartFactory.Create(); - ComposablePart part2 = PartFactory.Create(); - - batch.AddPart(part1); - Assert.IsTrue(batch.PartsToAdd.Contains(part1)); - - ReadOnlyCollection partsToAddBeforeCopy = batch.PartsToAdd; - Assert.AreSame(partsToAddBeforeCopy, batch.PartsToAdd); - - Assert.AreEqual(1, partsToAddBeforeCopy.Count); - Assert.IsTrue(partsToAddBeforeCopy.Contains(part1)); - - batch.AddPart(part2); - - ReadOnlyCollection partsToAddAfterCopy = batch.PartsToAdd; - Assert.AreSame(partsToAddAfterCopy, batch.PartsToAdd); - - Assert.AreEqual(2, partsToAddAfterCopy.Count); - Assert.IsTrue(partsToAddAfterCopy.Contains(part1)); - Assert.IsTrue(partsToAddAfterCopy.Contains(part2)); - Assert.AreNotSame(partsToAddBeforeCopy, partsToAddAfterCopy); - } - - [TestMethod] - public void PartsToRemove_ShouldGetCopiedAfterRemove() - { - CompositionBatch batch = new CompositionBatch(); - ComposablePart part1 = PartFactory.Create(); - ComposablePart part2 = PartFactory.Create(); - - batch.RemovePart(part1); - Assert.IsTrue(batch.PartsToRemove.Contains(part1)); - - ReadOnlyCollection partsToRemoveBeforeCopy = batch.PartsToRemove; - Assert.AreSame(partsToRemoveBeforeCopy, batch.PartsToRemove); - - Assert.AreEqual(1, partsToRemoveBeforeCopy.Count); - Assert.IsTrue(partsToRemoveBeforeCopy.Contains(part1)); - - batch.RemovePart(part2); - - ReadOnlyCollection partsToRemoveAfterCopy = batch.PartsToRemove; - Assert.AreSame(partsToRemoveAfterCopy, batch.PartsToRemove); - - Assert.AreEqual(2, partsToRemoveAfterCopy.Count); - Assert.IsTrue(partsToRemoveAfterCopy.Contains(part1)); - Assert.IsTrue(partsToRemoveAfterCopy.Contains(part2)); - Assert.AreNotSame(partsToRemoveBeforeCopy, partsToRemoveAfterCopy); - } - - - [TestMethod] - public void AddExportedValue_NullAsContractNameArgument_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - - ExceptionAssert.ThrowsArgument("contractName", () => - { - batch.AddExportedValue((string)null, "Value"); - }); - } - - [TestMethod] - public void AddExportedValue_EmptyStringAsContractNameArgument_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - - ExceptionAssert.ThrowsArgument("contractName", () => - { - batch.AddExportedValue("", "Value"); - }); - } - - [TestMethod] - public void AddExport_NullAsExportArgument_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - - ExceptionAssert.ThrowsArgument("export", () => - { - batch.AddExport((Export)null); - }); - } - - - [TestMethod] - public void AddExport_ExportWithNullExportedValueAsExportArgument_CanBeExported() - { - CompositionBatch batch = new CompositionBatch(); - var export = ExportFactory.Create("Contract", (object)null); - - batch.AddExport(export); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - var result = this.GetSingleExport(batch.PartsToAdd[0], "Contract"); - - Assert.IsNotNull(result); - Assert.IsNull(result.Value); - } - - - - [TestMethod] - public void AddExportedValueOfT_NullAsExportedValueArgument_CanBeExported() - { - CompositionBatch batch = new CompositionBatch(); - - batch.AddExportedValue((string)null); - - Assert.AreEqual(1, batch.PartsToAdd.Count); - var result = this.GetSingleLazy(batch.PartsToAdd[0]); - - Assert.IsNotNull(result); - Assert.IsNull(result.Value); - } - - [TestMethod] - public void AddExportedValue_NullAsExportedValueArgument_CanBeExported() - { - CompositionBatch batch = new CompositionBatch(); - - batch.AddExportedValue("Contract", (string)null); - - Assert.AreEqual(1, batch.PartsToAdd.Count); - var result = this.GetSingleExport(batch.PartsToAdd[0], "Contract"); - - Assert.IsNotNull(result); - Assert.IsNull(result.Value); - } - - [TestMethod] - public void AddExport_ExportWithEmptyMetadata_IsExportedWithEmptyMetadata() - { - CompositionBatch batch = new CompositionBatch(); - var export = ExportFactory.Create("Contract", "Value", new Dictionary()); - - Assert.AreEqual(0, export.Metadata.Count); - - batch.AddExport(export); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - var result = this.GetSingleExport(batch.PartsToAdd[0], "Contract"); - - Assert.AreEqual(0, result.Metadata.Count); - } - - [TestMethod] - public void AddExportedValueOfT_IsExportedWithEmptyMetadata() - { - CompositionBatch batch = new CompositionBatch(); - - batch.AddExportedValue("Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - var result = this.GetSingleLazy(batch.PartsToAdd[0]); - - Assert.AreEqual(1, result.Metadata.Count); // contains type identity - } - - [TestMethod] - public void AddExportedValue_IsExportedWithEmptyMetadata() - { - CompositionBatch batch = new CompositionBatch(); - - batch.AddExportedValue("Contract", "Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - var result = this.GetSingleExport(batch.PartsToAdd[0], "Contract"); - - Assert.AreEqual(1, result.Metadata.Count); // contains type identity - } - - [TestMethod] - public void AddExport_ReturnedComposablePart_IsInAddedPartsCollection() - { - CompositionBatch batch = new CompositionBatch(); - - var export = ExportFactory.Create("Contract", "Value"); - var part = batch.AddExport(export); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - Assert.AreEqual("Value", this.GetSingleExport(batch.PartsToAdd[0], "Contract").Value); - Assert.IsTrue(batch.PartsToAdd.Contains(part)); - } - - [TestMethod] - public void AddExportedValueOfT_ReturnedComposablePart_IsInAddedPartsCollection() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - Assert.AreEqual("Value", this.GetSingleLazy(batch.PartsToAdd[0]).Value); - Assert.IsTrue(batch.PartsToAdd.Contains(part)); - } - - [TestMethod] - public void AddExportedValue_ReturnedComposablePart_IsInAddedPartsCollection() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Contract", "Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - Assert.AreEqual("Value", this.GetSingleExport(batch.PartsToAdd[0], "Contract").Value); - Assert.IsTrue(batch.PartsToAdd.Contains(part)); - } - - [TestMethod] - public void AddExportedValueOfT_ExportAsExportedValueArgument_ShouldBeWrappedInExport() - { - CompositionBatch batch = new CompositionBatch(); - var export = ExportFactory.Create("Contract", "Value"); - - batch.AddExportedValue(export); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - Assert.AreSame(export, this.GetSingleLazy(batch.PartsToAdd[0]).Value); - } - - [TestMethod] - public void AddExportedValue_ExportAsExportedValueArgument_ShouldBeWrappedInExport() - { - CompositionBatch batch = new CompositionBatch(); - var export = ExportFactory.Create("Contract", "Value"); - - batch.AddExportedValue(export); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - Assert.AreSame(export, this.GetSingleLazy(batch.PartsToAdd[0]).Value); - } - - [TestMethod] - public void AddExport_ReturnedComposablePart_NullAsDefinitionArgumentToGetExportedValue_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - var export = ExportFactory.Create("Contract", "Value"); - - var part = batch.AddExport(export); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.GetExportedValue((ExportDefinition)null); - }); - } - - [TestMethod] - public void AddExport_ReturnedComposablePart_WrongDefinitionAsDefinitionArgumentToGetExportedValue_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - var export = ExportFactory.Create("Contract", "Value"); - - var part = batch.AddExport(export); - var definition = ExportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.GetExportedValue(definition); - }); - } - - [TestMethod] - public void AddExport_ReturnedComposablePart_NullAsDefinitionArgumentToSetImports_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - var export = ExportFactory.Create("Contract", "Value"); - - var part = batch.AddExport(export); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.SetImport((ImportDefinition)null, Enumerable.Empty()); - }); - } - - [TestMethod] - public void AddExport_ReturnedComposablePart_NullAsExportsArgumentToSetImports_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - var export = ExportFactory.Create("Contract", "Value"); - - var part = batch.AddExport(export); - var definition = ImportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, (IEnumerable)null); - }); - } - - [TestMethod] - public void AddExport_ReturnedComposablePart_ExportsArrayWithNullElementAsExportsArgumentToSetImports_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - var export = ExportFactory.Create("Contract", "Value"); - - var part = batch.AddExport(export); - var definition = ImportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, new Export[] { null }); - }); - } - - [TestMethod] - public void AddExport_ReturnedComposablePart_SetImports_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - var export = ExportFactory.Create("Contract", "Value"); - - var part = batch.AddExport(export); - var definition = ImportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.SetImport(definition, Enumerable.Empty()); - }); - } - - [TestMethod] - public void AddExport_ReturnedComposablePart_ContainsExportDefinitionRepresentingExport() - { - var metadata = new Dictionary(); - metadata["Name"] = "Value"; - - CompositionBatch batch = new CompositionBatch(); - var export = ExportFactory.Create("Contract", "Value", metadata); - - var part = batch.AddExport(export); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - var definition = part.ExportDefinitions.Single(); - - Assert.AreEqual("Contract", definition.ContractName); - Assert.AreEqual("Value", part.GetExportedValue(definition)); - EnumerableAssert.AreEqual(metadata, definition.Metadata); - } - - [TestMethod] - public void AddExportedValueOfT_ReturnedComposablePart_ImportDefinitionsPropertyIsEmpty() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - Assert.AreEqual(0, part.ImportDefinitions.Count()); - } - - [TestMethod] - public void AddExportedValueOfT_ReturnedComposablePart_MetadataPropertyIsEmpty() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - Assert.AreEqual(0, part.Metadata.Count); - } - - [TestMethod] - public void AddExportedValueOfT_ReturnedComposablePart_NullAsDefinitionArgumentToGetExportedValue_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.GetExportedValue((ExportDefinition)null); - }); - } - - [TestMethod] - public void AddExportedValueOfT_ReturnedComposablePart_WrongDefinitionAsDefinitionArgumentToGetExportedValue_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Value"); - var definition = ExportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.GetExportedValue(definition); - }); - } - - [TestMethod] - public void AddExportedValueOfT_ReturnedComposablePart_NullAsDefinitionArgumentToSetImports_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.SetImport((ImportDefinition)null, Enumerable.Empty()); - }); - } - - [TestMethod] - public void AddExportedValueOfT_ReturnedComposablePart_NullAsExportsArgumentToSetImports_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Value"); - var definition = ImportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, (IEnumerable)null); - }); - } - - [TestMethod] - public void AddExportedValueOfT_ReturnedComposablePart_ExportsArrayWithNullElementAsExportsArgumentToSetImports_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Value"); - var definition = ImportDefinitionFactory.Create(); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, new Export[] { null }); - }); - } - - [TestMethod] - public void AddExportedValueOfT_ReturnedComposablePart_SetImports_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Value"); - var definition = ImportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.SetImport(definition, Enumerable.Empty()); - }); - } - - [TestMethod] - public void AddExportedValueOfT_ReturnedComposablePart_ContainsExportDefinitionRepresentingExport() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - var definition = part.ExportDefinitions.Single(); - - Assert.AreEqual(NameForType(), definition.ContractName); - Assert.AreEqual("Value", part.GetExportedValue(definition)); - Assert.AreEqual(1, definition.Metadata.Count); // contains type identity - } - - [TestMethod] - public void AddExportedValue_ReturnedComposablePart_ImportDefinitionsPropertyIsEmpty() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Contract", "Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - Assert.AreEqual(0, part.ImportDefinitions.Count()); - } - - [TestMethod] - public void AddExportedValue_ReturnedComposablePart_MetadataPropertyIsEmpty() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Contract", "Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - Assert.AreEqual(0, part.Metadata.Count); - } - - [TestMethod] - public void AddExportedValue_ReturnedComposablePart_NullAsDefinitionArgumentToGetExportedValue_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Contract", "Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.GetExportedValue((ExportDefinition)null); - }); - } - - [TestMethod] - public void AddExportedValue_ReturnedComposablePart_WrongDefinitionAsDefinitionArgumentToGetExportedValue_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Contract", "Value"); - var definition = ExportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.GetExportedValue(definition); - }); - } - - [TestMethod] - public void AddExportedValue_ReturnedComposablePart_NullAsDefinitionArgumentToSetImports_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Contract", "Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.SetImport((ImportDefinition)null, Enumerable.Empty()); - }); - } - - [TestMethod] - public void AddExportedValue_ReturnedComposablePart_NullAsExportsArgumentToSetImports_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Contract", "Value"); - var definition = ImportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, (IEnumerable)null); - }); - } - - [TestMethod] - public void AddExportedValue_ReturnedComposablePart_ExportsArrayWithNullElementAsExportsArgumentToSetImports_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Contract", "Value"); - var definition = ImportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, new Export[] { null }); - }); - } - - [TestMethod] - public void AddExportedValue_ReturnedComposablePart_WrongDefinitionAsDefinitionArgumentToSetImports_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Contract", "Value"); - var definition = ImportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.SetImport(definition, Enumerable.Empty()); - }); - } - - - [TestMethod] - public void AddExportedValue_ReturnedComposablePart_ContainsExportDefinitionRepresentingExport() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddExportedValue("Contract", "Value"); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - var definition = part.ExportDefinitions.Single(); - - Assert.AreEqual("Contract", definition.ContractName); - Assert.AreEqual("Value", part.GetExportedValue(definition)); - Assert.AreEqual(1, definition.Metadata.Count); // containts type identity - } - - - [TestMethod] - public void AddPart_Int32ValueTypeAsAttributedPartArgument_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - - ExceptionAssert.ThrowsArgument("attributedPart", () => - { - batch.AddPart((object)10); - }); - } - - [TestMethod] - public void AddPart_ReturnedComposablePart_NullAsDefinitionArgumentToGetExportedValue_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddPart(new Int32Importer()); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.GetExportedValue((ExportDefinition)null); - }); - } - - [TestMethod] - public void AddPart_ReturnedComposablePart_WrongDefinitionAsDefinitionArgumentToGetExportedValue_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddPart(new Int32Importer()); - var definition = ExportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.GetExportedValue(definition); - }); - } - - [TestMethod] - public void AddPart_ReturnedComposablePart_NullAsDefinitionArgumentToSetImports_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddPart(new Int32Importer()); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.SetImport((ImportDefinition)null, Enumerable.Empty()); - }); - } - - [TestMethod] - public void AddPart_ReturnedComposablePart_NullAsExportsArgumentToSetImports_ShouldThrowArgumentNull() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddPart(new Int32Importer()); - var definition = ImportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, (IEnumerable)null); - }); - } - - [TestMethod] - public void AddPart_ReturnedComposablePart_ExportsArrayWithNullElementAsExportsArgumentToSetImports_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddPart(new Int32Importer()); - var definition = part.ImportDefinitions.First(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, new Export[] { null }); - }); - } - - [TestMethod] - public void AddPart_ReturnedComposablePart_WrongDefinitionAsDefinitionArgumentToSetImports_ShouldThrowArgument() - { - CompositionBatch batch = new CompositionBatch(); - - var part = batch.AddPart(new Int32Importer()); - var definition = ImportDefinitionFactory.Create(); - Assert.AreEqual(1, batch.PartsToAdd.Count); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.SetImport(definition, Enumerable.Empty()); - }); - } - - private Export GetSingleLazy(ComposablePart part) - { - return this.GetSingleExport(part, AttributedModelServices.GetContractName(typeof(T))); - } - - private Export GetSingleExport(ComposablePart part, string contractName) - { - Assert.IsNotNull(part); - Assert.AreEqual(0, part.Metadata.Count); - Assert.AreEqual(1, part.ExportDefinitions.Count()); - Assert.AreEqual(0, part.ImportDefinitions.Count()); - ExportDefinition exportDefinition = part.ExportDefinitions.First(); - Assert.AreEqual(contractName, exportDefinition.ContractName); - - part.Activate(); - - return new Export(exportDefinition, () => part.GetExportedValue(exportDefinition)); - } - - - private static string NameForType() - { - return AttributedModelServices.GetContractName(typeof(T)); - } - } - -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/CompositionTransactionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/CompositionTransactionTests.cs deleted file mode 100644 index cf1dd30e887..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/CompositionTransactionTests.cs +++ /dev/null @@ -1,516 +0,0 @@ -using System; -using System.Text; -using System.Reflection; -using System.Collections.Generic; - -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Hosting; -using System.UnitTesting; - -namespace System.ComponentModel.Composition.Hosting -{ - [TestClass] - public class AtomicCompositionTests - { - [TestMethod] - public void Constructor1() - { - var ct = new AtomicComposition(); - } - - [TestMethod] - public void Constructor2() - { - // Null should be allowed - var ct = new AtomicComposition(null); - - // Another AtomicComposition should be allowed - var ct2 = new AtomicComposition(ct); - } - - [TestMethod] - public void Constructor2_MultipleTimes() - { - var outer = new AtomicComposition(); - - var ct1 = new AtomicComposition(outer); - - ExceptionAssert.Throws(() => new AtomicComposition(outer)); - } - - [TestMethod] - public void Dispose_AllMethodsShouldThrow() - { - var ct = new AtomicComposition(); - - ct.Dispose(); - - ExceptionAssert.ThrowsDisposed(ct, () => ct.AddCompleteAction(() => ct = null)); - ExceptionAssert.ThrowsDisposed(ct, () => ct.Complete()); - ExceptionAssert.ThrowsDisposed(ct, () => ct.SetValue(ct, 10)); - object value; - ExceptionAssert.ThrowsDisposed(ct, () => ct.TryGetValue(ct, out value)); - } - - [TestMethod] - public void AfterComplete_AllMethodsShouldThrow() - { - var ct = new AtomicComposition(); - - ct.Complete(); - - ExceptionAssert.Throws(() => ct.AddCompleteAction(() => ct = null)); - ExceptionAssert.Throws(() => ct.Complete()); - ExceptionAssert.Throws(() => ct.SetValue(ct, 10)); - object value; - ExceptionAssert.Throws(() => ct.TryGetValue(ct, out value)); - } - - [TestMethod] - public void SetValue_ToNull_ShouldBeAllowed() - { - var ct = new AtomicComposition(); - - ct.SetValue(ct, null); - - object value = new object(); - - Assert.IsTrue(ct.TryGetValue(ct, out value)); - Assert.IsNull(value); - } - - [TestMethod] - public void SetValue_ValueType_ShouldBeAllowed() - { - var ct = new AtomicComposition(); - - ct.SetValue(ct, 45); - - int value; - - Assert.IsTrue(ct.TryGetValue(ct, out value)); - Assert.AreEqual(45, value); - } - - [TestMethod] - public void SetValue_Reference_ShouldBeAllowed() - { - var ct = new AtomicComposition(); - - var sb = new StringBuilder(); - ct.SetValue(ct, sb); - - StringBuilder value; - - Assert.IsTrue(ct.TryGetValue(ct, out value)); - Assert.AreEqual(sb, value); - } - - [TestMethod] - public void SetValue_CauseResize_ShouldWorkFine() - { - var ct = new AtomicComposition(); - - var keys = new List(); - var values = new List(); - - - for (int i = 0; i < 20; i++) - { - var key = new object(); - keys.Add(key); - values.Add(i); - ct.SetValue(key, i); - } - - for (int i = 0; i < keys.Count; i++) - { - object value; - Assert.IsTrue(ct.TryGetValue(keys[i], out value)); - Assert.AreEqual(i, value); - } - } - - [TestMethod] - public void SetValue_ChangeOuterValuesWhileHaveInner_ShouldThrow() - { - var ct = new AtomicComposition(); - - var ct2 = new AtomicComposition(ct); - - var key = new object(); - ExceptionAssert.Throws(() => ct.SetValue(key, 1)); - - object value; - Assert.IsFalse(ct2.TryGetValue(key, out value)); - Assert.IsFalse(ct.TryGetValue(key, out value)); - - // remove the inner atomicComposition so the outer one becomes unlocked. - ct2.Dispose(); - - ct.SetValue(key, 2); - Assert.IsTrue(ct.TryGetValue(key, out value)); - Assert.AreEqual(2, value); - } - - [TestMethod] - public void Complete_ShouldExecuteActions() - { - bool executedAction = false; - - var ct = new AtomicComposition(); - - ct.AddCompleteAction(() => executedAction = true); - - ct.Complete(); - - Assert.IsTrue(executedAction); - } - - [TestMethod] - public void Complete_ShouldCopyActionsToInner() - { - bool executedAction = false; - - var innerAtomicComposition = new AtomicComposition(); - - using (var ct = new AtomicComposition(innerAtomicComposition)) - { - ct.AddCompleteAction(() => executedAction = true); - - ct.Complete(); - Assert.IsFalse(executedAction, "Action should not have been exectued yet"); - } - - innerAtomicComposition.Complete(); - Assert.IsTrue(executedAction); - } - - [TestMethod] - public void Complete_ShouldCopyValuesToInner() - { - var innerAtomicComposition = new AtomicComposition(); - - object value; - using (var ct = new AtomicComposition(innerAtomicComposition)) - { - ct.SetValue(this, 21); - - Assert.IsFalse(innerAtomicComposition.TryGetValue(this, out value)); - - ct.Complete(); - - Assert.IsTrue(innerAtomicComposition.TryGetValue(this, out value)); - Assert.AreEqual(21, value); - } - - // reverify after dispose - Assert.IsTrue(innerAtomicComposition.TryGetValue(this, out value)); - Assert.AreEqual(21, value); - } - - [TestMethod] - public void NoComplete_ShouldNotCopyActionsToInner() - { - bool executedAction = false; - - var innerAtomicComposition = new AtomicComposition(); - - using (var ct = new AtomicComposition(innerAtomicComposition)) - { - ct.AddCompleteAction(() => executedAction = true); - - Assert.IsFalse(executedAction, "Action should not have been exectued yet"); - - // Do not complete - } - - innerAtomicComposition.Complete(); - Assert.IsFalse(executedAction); - } - - [TestMethod] - public void NoComplete_ShouldNotCopyValuesToInner() - { - var innerAtomicComposition = new AtomicComposition(); - - object value; - using (var ct = new AtomicComposition(innerAtomicComposition)) - { - ct.SetValue(this, 21); - - Assert.IsFalse(innerAtomicComposition.TryGetValue(this, out value)); - - // Do not call complete - } - - // reverify after dispose - Assert.IsFalse(innerAtomicComposition.TryGetValue(this, out value)); - } - - - [TestMethod] - public void AtomicComposition_CompleteActions() - { - var setMe = false; - var setMeToo = false; - var dontSetMe = false; - using (var contextA = new AtomicComposition()) - { - contextA.AddCompleteAction(() => setMe = true); - using (var contextB = new AtomicComposition(contextA)) - { - contextB.AddCompleteAction(() => setMeToo = true); - contextB.Complete(); - } - - using (var contextC = new AtomicComposition(contextA)) - { - contextC.AddCompleteAction(() => dontSetMe = true); - // Don't complete - } - Assert.IsFalse(setMe); - Assert.IsFalse(setMeToo); - Assert.IsFalse(dontSetMe); - - contextA.Complete(); - - Assert.IsTrue(setMe); - Assert.IsTrue(setMeToo); - Assert.IsFalse(dontSetMe); - } - } - - private void TestNoValue(AtomicComposition context, object key) - { - string value; - Assert.IsFalse(context.TryGetValue(key, out value)); - } - - private void TestValue(AtomicComposition context, object key, string expectedValue) - { - string value; - Assert.IsTrue(context.TryGetValue(key, out value)); - Assert.AreEqual(expectedValue, value); - } - - [TestMethod] - public void AtomicComposition_CompleteValues() - { - object key1 = new Object(); - object key2 = new Object(); - - using (var contextA = new AtomicComposition()) - { - TestNoValue(contextA, key1); - TestNoValue(contextA, key2); - contextA.SetValue(key1, "Hello"); - TestValue(contextA, key1, "Hello"); - TestNoValue(contextA, key2); - - // Try overwriting - using (var contextB = new AtomicComposition(contextA)) - { - TestValue(contextB, key1, "Hello"); - TestNoValue(contextB, key2); - contextB.SetValue(key1, "Greetings"); - TestValue(contextB, key1, "Greetings"); - TestNoValue(contextB, key2); - - contextB.Complete(); - } - TestValue(contextA, key1, "Greetings"); - TestNoValue(contextA, key2); - - // Try overwrite with revert - using (var contextC = new AtomicComposition(contextA)) - { - TestValue(contextC, key1, "Greetings"); - TestNoValue(contextC, key2); - contextC.SetValue(key1, "Goodbye"); - contextC.SetValue(key2, "Goodbye, Again"); - TestValue(contextC, key1, "Goodbye"); - TestValue(contextC, key2, "Goodbye, Again"); - - // Don't complete - } - TestValue(contextA, key1, "Greetings"); - TestNoValue(contextA, key2); - - contextA.Complete(); - } - } - - private void TestQuery(AtomicComposition context, object key, int parameter, bool expectation) - { - Func query; - if (context.TryGetValue(key, out query)) - Assert.AreEqual(expectation, query(parameter)); - } - - private void SetQuery(AtomicComposition context, object key, Func, bool> query) - { - Func parentQuery; - context.TryGetValue(key, out parentQuery); - Func queryFunction = parameter => { return query(parameter, parentQuery); }; - context.SetValue(key, queryFunction); - } - - [TestMethod] - public void AtomicComposition_NestedQueries() - { - // This is a rather convoluted test that exercises the way AtomicComposition used to work to - // ensure consistency of the newer design - var key = new Object(); - - using (var contextA = new AtomicComposition()) - { - SetQuery(contextA, key, (int parameter, Func parentQuery) => - { - if (parameter == 22) - return true; - if (parentQuery != null) - return parentQuery(parameter); - return false; - }); - TestQuery(contextA, key, 22, true); - - using (var contextB = new AtomicComposition(contextA)) - { - TestQuery(contextB, key, 22, true); - SetQuery(contextB, key, (int parameter, Func parentQuery) => - { - if (parentQuery != null) - return !parentQuery(parameter); - Assert.Fail(); // Should never have no parent - return false; - }); - TestQuery(contextB, key, 21, true); - TestQuery(contextB, key, 22, false); - - using (var contextC = new AtomicComposition(contextB)) - { - SetQuery(contextC, key, (int parameter, Func parentQuery) => - { - if (parameter == 23) - return true; - if (parentQuery != null) - return !parentQuery(parameter); - Assert.Fail(); // Should never have no parent - return false; - }); - TestQuery(contextC, key, 21, false); - TestQuery(contextC, key, 22, true); - TestQuery(contextC, key, 23, true); - contextC.Complete(); - } - - using (var contextD = new AtomicComposition(contextB)) - { - SetQuery(contextD, key, (int parameter, Func parentQuery) => - { - if (parentQuery != null) - return parentQuery(parameter + 1); - Assert.Fail(); // Should never have no parent - return false; - }); - TestQuery(contextD, key, 21, true); - TestQuery(contextD, key, 22, true); - TestQuery(contextD, key, 23, false); - // No complete - } - - contextB.Complete(); - } - TestQuery(contextA, key, 21, false); - TestQuery(contextA, key, 22, true); - TestQuery(contextA, key, 23, true); - contextA.Complete(); - } - } - - [TestMethod] - public void AddRevertAction_ShouldExecuteWhenDisposedAndNotCompleteted() - { - var ct = new AtomicComposition(); - bool executed = false; - - ct.AddRevertAction(() => executed = true); - - ct.Dispose(); - - Assert.IsTrue(executed); - } - - [TestMethod] - public void AddRevertAction_ShouldNotExecuteWhenCompleteted() - { - var ct = new AtomicComposition(); - bool executed = false; - - ct.AddRevertAction(() => executed = true); - - ct.Complete(); - - Assert.IsFalse(executed); - - ct.Dispose(); - - Assert.IsFalse(executed); - } - - [TestMethod] - public void AddRevertAction_ShouldExecuteInReverseOrder() - { - var ct = new AtomicComposition(); - Stack stack = new Stack(); - stack.Push(1); - stack.Push(2); - stack.Push(3); - - ct.AddRevertAction(() => Assert.AreEqual(1, stack.Pop())); - ct.AddRevertAction(() => Assert.AreEqual(2, stack.Pop())); - ct.AddRevertAction(() => Assert.AreEqual(3, stack.Pop())); - - ct.Dispose(); - - Assert.IsTrue(stack.Count == 0); - } - - [TestMethod] - public void AddRevertAction_ShouldBeCopiedWhenCompleteed() - { - Stack stack = new Stack(); - stack.Push(1); - stack.Push(2); - stack.Push(11); - stack.Push(12); - stack.Push(3); - - using (var ct = new AtomicComposition()) - { - ct.AddRevertAction(() => Assert.AreEqual(1, stack.Pop())); - ct.AddRevertAction(() => Assert.AreEqual(2, stack.Pop())); - - using (var ct2 = new AtomicComposition(ct)) - { - ct2.AddRevertAction(() => Assert.AreEqual(11, stack.Pop())); - ct2.AddRevertAction(() => Assert.AreEqual(12, stack.Pop())); - - // completeting should move those revert actions to ct - ct2.Complete(); - - Assert.AreEqual(5, stack.Count); - } - - ct.AddRevertAction(() => Assert.AreEqual(3, stack.Pop())); - - // Do not complete let ct dispose and revert - } - - Assert.IsTrue(stack.Count == 0); - } - - - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/DirectoryCatalogDebuggerProxyTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/DirectoryCatalogDebuggerProxyTests.cs deleted file mode 100644 index 9dfd4155727..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/DirectoryCatalogDebuggerProxyTests.cs +++ /dev/null @@ -1,171 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; -using System.ComponentModel.Composition.Hosting; -using System.IO; -using System.Linq; -using System.UnitTesting; -using System.Reflection; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.Primitives -{ - [TestClass] - public class DirectoryCatalogDebuggerProxyTests - { - [TestMethod] - public void Constructor_NullAsCatalogArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("catalog", () => - { - new DirectoryCatalog.DirectoryCatalogDebuggerProxy((DirectoryCatalog)null); - }); - } - - [TestMethod] - public void Constructor_ValueAsCatalogArgument_ShouldSetPartsProperty() - { - var expectations = Expectations.GetAssemblies(); - - foreach (var e in expectations) - { - using (TemporaryFileCopier copier = new TemporaryFileCopier(e.Location)) - { - var catalog = CreateDirectoryCatalog(copier.DirectoryPath); - - var proxy = new DirectoryCatalog.DirectoryCatalogDebuggerProxy(catalog); - - EnumerableAssert.AreSequenceEqual(catalog.Parts, proxy.Parts); - } - } - } - - [TestMethod] - public void Constructor_ValueAsCatalogArgument_ShouldSetAssemblyProperty() - { - var expectations = Expectations.GetAssemblies(); - - using (TemporaryFileCopier copier = new TemporaryFileCopier(expectations.Select(assembly => assembly.Location).ToArray())) - { - var catalog = CreateDirectoryCatalog(copier.DirectoryPath); - var proxy = new DirectoryCatalog.DirectoryCatalogDebuggerProxy(catalog); - - EnumerableAssert.AreEqual(expectations, proxy.Assemblies); - } - } - - [TestMethod] - public void Constuctor_ValueAsCatalogArgument_ShouldSetPathProperty() - { - string path = FileIO.GetNewTemporaryDirectory(); - - var catalog = CreateDirectoryCatalog(path); - var proxy = new DirectoryCatalog.DirectoryCatalogDebuggerProxy(catalog); - - Assert.AreEqual(path, proxy.Path); - } - - [TestMethod] - public void Constuctor_ValueAsCatalogArgument_ShouldSetSearchPatternProperty() - { - using (TemporaryDirectory directory = new TemporaryDirectory()) - { - var expectations = new ExpectationCollection(); - - expectations.Add("*.*", "*.*"); - expectations.Add("*.doc", "*.doc"); - expectations.Add("*.exe", "*.exe"); - expectations.Add("*.dll", "*.dll"); - - foreach (var e in expectations) - { - var catalog = CreateDirectoryCatalog(directory.DirectoryPath, e.Input); - var proxy = new DirectoryCatalog.DirectoryCatalogDebuggerProxy(catalog); - - Assert.AreEqual(e.Output, proxy.SearchPattern); - } - } - } - - [TestMethod] - public void FullPath_ValidPath_ShouldBeFine() - { - using (TemporaryDirectory directory = new TemporaryDirectory()) - { - var expectations = new ExpectationCollection(); - - // Ensure the path is always normalized properly. - string rootTempPath = Path.GetFullPath(FileIO.GetRootTemporaryDirectory()).ToUpperInvariant(); - - // Note: These relative paths work properly because the unit test temporary directories are always - // created as a subfolder off the AppDomain.CurrentDomain.BaseDirectory. - expectations.Add(".", Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ".")).ToUpperInvariant()); - expectations.Add(FileIO.RootTemporaryDirectoryName, rootTempPath); - expectations.Add(FileIO.GetRootTemporaryDirectory(), rootTempPath); - expectations.Add(directory.DirectoryPath, Path.GetFullPath(directory.DirectoryPath).ToUpperInvariant()); - - foreach (var e in expectations) - { - var cat = CreateDirectoryCatalog(e.Input, DirectoryCatalogTests.NonExistentSearchPattern); - var proxy = new DirectoryCatalog.DirectoryCatalogDebuggerProxy(cat); - - Assert.AreEqual(e.Output, proxy.FullPath); - } - } - } - - [TestMethod] - public void LoadedFiles_EmptyDirectory_ShouldBeFine() - { - using (var directory = new TemporaryDirectory()) - { - var cat = CreateDirectoryCatalog(directory.DirectoryPath); - var proxy = new DirectoryCatalog.DirectoryCatalogDebuggerProxy(cat); - - Assert.AreEqual(0, proxy.LoadedFiles.Count); - } - } - - [TestMethod] - public void LoadedFiles_ContainsMultipleDllsAndSomeNonDll_ShouldOnlyContainDlls() - { - using (var directory = new TemporaryDirectory()) - { - // Add one text file - using (File.CreateText(Path.Combine(directory.DirectoryPath, "Test.txt"))) { } - - // Add two dll's - string dll1 = Path.Combine(directory.DirectoryPath, "Test1.dll"); - string dll2 = Path.Combine(directory.DirectoryPath, "Test2.dll"); - File.Copy(Assembly.GetExecutingAssembly().Location, dll1); - File.Copy(Assembly.GetExecutingAssembly().Location, dll2); - - var cat = CreateDirectoryCatalog(directory.DirectoryPath); - var proxy = new DirectoryCatalog.DirectoryCatalogDebuggerProxy(cat); - - CollectionAssert.AreEquivalent(new string[] { dll1.ToUpperInvariant(), dll2.ToUpperInvariant() }, - proxy.LoadedFiles); - } - } - - private DirectoryCatalog.DirectoryCatalogDebuggerProxy CreateAssemblyDebuggerProxy(DirectoryCatalog catalog) - { - return new DirectoryCatalog.DirectoryCatalogDebuggerProxy(catalog); - } - - private DirectoryCatalog CreateDirectoryCatalog(string path) - { - return new DirectoryCatalog(path); - } - - private DirectoryCatalog CreateDirectoryCatalog(string path, string filter) - { - return new DirectoryCatalog(path, filter); - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs deleted file mode 100644 index 3639a80cfe2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/DirectoryCatalogTests.cs +++ /dev/null @@ -1,543 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Factories; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; -using System.Reflection; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class DirectoryCatalogTests - { - internal const string NonExistentSearchPattern = "*.NonExistentSearchPattern"; - - [TestMethod] - public void ICompositionElementDisplayName_ShouldIncludeCatalogTypeNameAndDirectoryPath() - { - var paths = GetPathExpectations(); - - foreach (var path in paths) - { - var catalog = (ICompositionElement)CreateDirectoryCatalog(path, NonExistentSearchPattern); - - string expected = string.Format("DirectoryCatalog (Path=\"{0}\")", path); - - Assert.AreEqual(expected, catalog.DisplayName); - } - } - - [TestMethod] - public void ICompositionElementDisplayName_ShouldIncludeDerivedCatalogTypeNameAndAssemblyFullName() - { - var paths = GetPathExpectations(); - - foreach (var path in paths) - { - var catalog = (ICompositionElement)new DerivedDirectoryCatalog(path, NonExistentSearchPattern); - - string expected = string.Format("DerivedDirectoryCatalog (Path=\"{0}\")", path); - - Assert.AreEqual(expected, catalog.DisplayName); - } - } - - [TestMethod] - public void ToString_ShouldReturnICompositionElementDisplayName() - { - var paths = GetPathExpectations(); - - foreach (var path in paths) - { - var catalog = (ICompositionElement)CreateDirectoryCatalog(path, NonExistentSearchPattern); - - Assert.AreEqual(catalog.DisplayName, catalog.ToString()); - } - } - - [TestMethod] - public void ICompositionElementDisplayName_WhenCatalogDisposed_ShouldNotThrow() - { - var catalog = CreateDirectoryCatalog(); - catalog.Dispose(); - - var displayName = ((ICompositionElement)catalog).DisplayName; - } - - [TestMethod] - public void ICompositionElementOrigin_WhenCatalogDisposed_ShouldNotThrow() - { - var catalog = CreateDirectoryCatalog(); - catalog.Dispose(); - - var origin = ((ICompositionElement)catalog).Origin; - } - - [TestMethod] - public void Parts_WhenCatalogDisposed_ShouldThrowObjectDisposed() - { - var catalog = CreateDirectoryCatalog(); - catalog.Dispose(); - - ExceptionAssert.ThrowsDisposed(catalog, () => - { - var parts = catalog.Parts; - }); - } - - [TestMethod] - public void GetExports_WhenCatalogDisposed_ShouldThrowObjectDisposed() - { - var catalog = CreateDirectoryCatalog(); - catalog.Dispose(); - var definition = ImportDefinitionFactory.Create(); - - ExceptionAssert.ThrowsDisposed(catalog, () => - { - catalog.GetExports(definition); - }); - } - - [TestMethod] - public void Refresh_WhenCatalogDisposed_ShouldThrowObjectDisposed() - { - var catalog = CreateDirectoryCatalog(); - catalog.Dispose(); - - ExceptionAssert.ThrowsDisposed(catalog, () => - { - catalog.Refresh(); - }); - } - - [TestMethod] - public void ToString_WhenCatalogDisposed_ShouldNotThrow() - { - var catalog = CreateDirectoryCatalog(); - catalog.Dispose(); - - catalog.ToString(); - } - - [TestMethod] - public void GetExports_NullAsConstraintArgument_ShouldThrowArgumentNull() - { - var catalog = CreateDirectoryCatalog(); - - ExceptionAssert.ThrowsArgument("definition", () => - { - catalog.GetExports((ImportDefinition)null); - }); - } - - - [TestMethod] - public void Dispose_ShouldNotThrow() - { - using (var catalog = CreateDirectoryCatalog()) - { - } - } - - [TestMethod] - public void Dispose_CanBeCalledMultipleTimes() - { - var catalog = CreateDirectoryCatalog(); - catalog.Dispose(); - catalog.Dispose(); - catalog.Dispose(); - } - - - [TestMethod] - public void AddAssembly1_NonExistentUriAsAssemblyFileNameArgument_ShouldNotSupportedException() - { - ExceptionAssert.Throws(() => - { - var catalog = new DirectoryCatalog("http://microsoft.com/myassembly.dll"); - }); - } - - [TestMethod] - public void AddAssembly1_NullPathArgument_ShouldThrowArugmentNull() - { - ExceptionAssert.Throws(() => - new DirectoryCatalog((string)null)); - } - - [TestMethod] - public void AddAssembly1_EmptyPathArgument_ShouldThrowArugment() - { - ExceptionAssert.Throws(() => - new DirectoryCatalog("")); - } - - [TestMethod] - public void AddAssembly1_InvalidPathName_ShouldThrowDirectoryNotFound() - { - ExceptionAssert.Throws(() => - { - var c1 = new DirectoryCatalog("*"); - }); - } - - [TestMethod] - public void AddAssembly1_TooLongPathNameArgument_ShouldThrowPathTooLongException() - { - ExceptionAssert.Throws(() => - { - var c1 = new DirectoryCatalog(@"c:\This is a very long path\And Just to make sure\We will continue to make it very long\This is a very long path\And Just to make sure\We will continue to make it very long\This is a very long path\And Just to make sure\We will continue to make it very long\myassembly.dll"); - }); - } - - - [TestMethod] - public void Parts() - { - using (var directory = CreateTemporaryDirectory()) - { - var catalog = new DirectoryCatalog(directory.DirectoryPath); - Assert.IsNotNull(catalog.Parts); - Assert.IsTrue(catalog.Parts.Count() > 0); - } - } - - [TestMethod] - public void Parts_ShouldSetDefinitionOriginToCatalogItself() - { - using (var directory = CreateTemporaryDirectory()) - { - var catalog = new DirectoryCatalog(directory.DirectoryPath); - Assert.IsTrue(catalog.Parts.Count() > 0); - - foreach (ICompositionElement definition in catalog.Parts) - { - Assert.AreSame(catalog, definition.Origin); - } - } - } - - [TestMethod] - public void Path_ValidPath_ShouldBeFine() - { - using (var directory = CreateTemporaryDirectory()) - { - var expectations = new ExpectationCollection(); - - expectations.Add(".", "."); - expectations.Add(FileIO.RootTemporaryDirectoryName, FileIO.RootTemporaryDirectoryName); - expectations.Add(FileIO.GetRootTemporaryDirectory(), FileIO.GetRootTemporaryDirectory()); - expectations.Add(directory.DirectoryPath, directory.DirectoryPath); - - foreach (var e in expectations) - { - var cat = CreateDirectoryCatalog(e.Input, NonExistentSearchPattern); - - Assert.AreEqual(e.Output, cat.Path); - } - } - } - - [TestMethod] - public void FullPath_ValidPath_ShouldBeFine() - { - using (var directory = CreateTemporaryDirectory()) - { - var expectations = new ExpectationCollection(); - - // Ensure the path is always normalized properly. - string rootTempPath = Path.GetFullPath(FileIO.GetRootTemporaryDirectory()).ToUpperInvariant(); - - // Note: These relative paths work properly because the unit test temporary directories are always - // created as a subfolder off the AppDomain.CurrentDomain.BaseDirectory. - expectations.Add(".", Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ".")).ToUpperInvariant()); - expectations.Add(FileIO.RootTemporaryDirectoryName, rootTempPath); - expectations.Add(FileIO.GetRootTemporaryDirectory(), rootTempPath); - expectations.Add(directory.DirectoryPath, Path.GetFullPath(directory.DirectoryPath).ToUpperInvariant()); - - foreach (var e in expectations) - { - var cat = CreateDirectoryCatalog(e.Input, NonExistentSearchPattern); - - Assert.AreEqual(e.Output, cat.FullPath); - } - } - } - - [TestMethod] - public void LoadedFiles_EmptyDirectory_ShouldBeFine() - { - using (var directory = new TemporaryDirectory()) - { - var cat = new DirectoryCatalog(directory.DirectoryPath); - - Assert.AreEqual(0, cat.LoadedFiles.Count); - } - } - - [TestMethod] - public void LoadedFiles_ContainsMultipleDllsAndSomeNonDll_ShouldOnlyContainDlls() - { - using (var directory = new TemporaryDirectory()) - { - // Add one text file - using (File.CreateText(Path.Combine(directory.DirectoryPath, "Test.txt"))) { } - - // Add two dll's - string dll1 = Path.Combine(directory.DirectoryPath, "Test1.dll"); - string dll2 = Path.Combine(directory.DirectoryPath, "Test2.dll"); - File.Copy(Assembly.GetExecutingAssembly().Location, dll1); - File.Copy(Assembly.GetExecutingAssembly().Location, dll2); - - var cat = new DirectoryCatalog(directory.DirectoryPath); - - CollectionAssert.AreEquivalent(new string[] { dll1.ToUpperInvariant(), dll2.ToUpperInvariant() }, - cat.LoadedFiles); - } - } - - [TestMethod] - public void Constructor_InvalidAssembly_ShouldBeFine() - { - using (var directory = CreateTemporaryDirectory()) - { - using (File.CreateText(Path.Combine(directory.DirectoryPath, "Test.dll"))) { } - var cat = new DirectoryCatalog(directory.DirectoryPath); - } - } - - [TestMethod] - public void Constructor_NonExistentDirectory_ShouldThrow() - { - using (var directory = CreateTemporaryDirectory()) - { - ExceptionAssert.Throws( () => - new DirectoryCatalog(directory.DirectoryPath + @"\NonexistentDirectoryWithoutEndingSlash")); - - ExceptionAssert.Throws( () => - new DirectoryCatalog(directory.DirectoryPath + @"\NonexistentDirectoryWithEndingSlash\")); - - } - } - - [TestMethod] - public void Constructor_PassExistingFileName_ShouldThrow() - { - using (var directory = CreateTemporaryDirectory()) - { - using (File.CreateText(Path.Combine(directory.DirectoryPath, "Test.txt"))) { } - ExceptionAssert.Throws(() => - new DirectoryCatalog(Path.Combine(directory.DirectoryPath, "Test.txt"))); - } - } - - [TestMethod] - public void Constructor_PassNonExistingFileName_ShouldThrow() - { - using (var directory = CreateTemporaryDirectory()) - { - ExceptionAssert.Throws(() => - new DirectoryCatalog(Path.Combine(directory.DirectoryPath, "NonExistingFile.txt"))); - } - } - - [TestMethod] - public void Refresh_AssemblyAdded_ShouldFireOnChanged() - { - using (var directory = new TemporaryDirectory()) - { - bool changedFired = false; - bool changingFired = false; - var cat = new DirectoryCatalog(directory.DirectoryPath); - - Assert.AreEqual(0, cat.Parts.Count(), "Catalog should initially be empty"); - - cat.Changing += new EventHandler((o, e) => - { - Assert.AreEqual(0, cat.Parts.Count(), "Catalog changes should NOT have been completeed yet"); - changingFired = true; - }); - - cat.Changed += new EventHandler((o, e) => - { - Assert.AreNotEqual(0, cat.Parts.Count(), "Catalog changes should have been completeed"); - changedFired = true; - }); - - - File.Copy(Assembly.GetExecutingAssembly().Location, Path.Combine(directory.DirectoryPath, "Test.dll")); - - cat.Refresh(); - - Assert.IsTrue(changingFired); - Assert.IsTrue(changedFired); - } - } - - [TestMethod] - public void Refresh_AssemblyRemoved_ShouldFireOnChanged() - { - using (var directory = CreateTemporaryDirectory()) - { - string file = Path.Combine(directory.DirectoryPath, "Test.dll"); - File.Copy(Assembly.GetExecutingAssembly().Location, file); - bool changedFired = false; - var cat = new DirectoryCatalog(directory.DirectoryPath); - - cat.Changed += new EventHandler((o, e) => - changedFired = true); - - // This assembly can be deleted because it was already loaded by the CLR in another context - // in another location so it isn't locked on disk. - File.Delete(file); - - cat.Refresh(); - - Assert.IsTrue(changedFired); - } - } - - [TestMethod] - public void Refresh_NoChanges_ShouldNotFireOnChanged() - { - using (var directory = CreateTemporaryDirectory()) - { - var cat = new DirectoryCatalog(directory.DirectoryPath); - - cat.Changed += new EventHandler((o, e) => - Assert.Fail("Should not recieve any change notifications")); - - cat.Refresh(); - } - } - - [TestMethod] - public void Refresh_DirectoryRemoved_ShouldThrowDirectoryNotFound() - { - DirectoryCatalog cat; - using (var directory = CreateTemporaryDirectory()) - { - cat = new DirectoryCatalog(directory.DirectoryPath); - } - - ExceptionAssert.Throws(RetryMode.DoNotRetry, () => - cat.Refresh()); - } - - [TestMethod] - public void GetExports() - { - using (var directory = CreateTemporaryDirectory()) - { - var catalog = new AggregateCatalog(); - Expression> constraint = (ExportDefinition exportDefinition) => exportDefinition.ContractName == AttributedModelServices.GetContractName(typeof(MyExport)); - IEnumerable> matchingExports = null; - - matchingExports = catalog.GetExports(constraint); - Assert.IsNotNull(matchingExports); - Assert.IsTrue(matchingExports.Count() == 0); - - var testsDirectoryCatalog = new DirectoryCatalog(directory.DirectoryPath); - catalog.Catalogs.Add(testsDirectoryCatalog); - matchingExports = catalog.GetExports(constraint); - - Assert.IsNotNull(matchingExports); - Assert.IsTrue(matchingExports.Count() >= 0); - - IEnumerable> expectedMatchingExports = catalog.Parts - .SelectMany(part => part.ExportDefinitions, (part, export) => new Tuple(part, export)) - .Where(partAndExport => partAndExport.Item2.ContractName == AttributedModelServices.GetContractName(typeof(MyExport))); - - Assert.IsTrue(matchingExports.SequenceEqual(expectedMatchingExports)); - - catalog.Catalogs.Remove(testsDirectoryCatalog); - matchingExports = catalog.GetExports(constraint); - Assert.IsNotNull(matchingExports); - Assert.IsTrue(matchingExports.Count() == 0); - } - } - - [TestMethod] - public void AddAndRemoveDirectory() - { - using (var directory = CreateTemporaryDirectory()) - { - var cat = new AggregateCatalog(); - var container = new CompositionContainer(cat); - - Assert.IsFalse(container.IsPresent()); - - var dir1 = new DirectoryCatalog(directory.DirectoryPath); - cat.Catalogs.Add(dir1); - Assert.IsTrue(container.IsPresent()); - - cat.Catalogs.Remove(dir1); - - Assert.IsFalse(container.IsPresent()); - } - } - - [TestMethod] - public void AddDirectoryNotFoundException() - { - ExceptionAssert.Throws(() => - { - var cat = new DirectoryCatalog("Directory That Should Never Exist tadfasdfasdfsdf"); - }); - } - - [TestMethod] - public void ExecuteOnCreationThread() - { - // Add a proper test for event notification on caller thread - } - - - private DirectoryCatalog CreateDirectoryCatalog() - { - return CreateDirectoryCatalog(FileIO.GetNewTemporaryDirectory()); - } - - private DirectoryCatalog CreateDirectoryCatalog(string path) - { - return new DirectoryCatalog(path); - } - - private DirectoryCatalog CreateDirectoryCatalog(string path, string searchPattern) - { - return new DirectoryCatalog(path, searchPattern); - } - - private TemporaryDirectory CreateTemporaryDirectory() - { - return new TemporaryFileCopier(typeof(DirectoryCatalogTests).Assembly.Location); - } - - public IEnumerable GetPathExpectations() - { - yield return AppDomain.CurrentDomain.BaseDirectory; - yield return AppDomain.CurrentDomain.BaseDirectory + @"\"; - yield return "."; - } - - private class DerivedDirectoryCatalog : DirectoryCatalog - { - public DerivedDirectoryCatalog(string path, string searchPattern) - : base(path, searchPattern) - { - } - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/ImportEngineTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/ImportEngineTests.cs deleted file mode 100644 index 5119689ab2e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/ImportEngineTests.cs +++ /dev/null @@ -1,567 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.UnitTesting; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ImportEngineTests - { - [TestMethod] - public void PreviewImports_Successful_NoAtomicComposition_ShouldBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value"); - var importer = PartFactory.CreateImporter(import); - - exportProvider.AddExport("Value", 21); - - engine.PreviewImports(importer, null); - - ExceptionAssert.Throws(() => - exportProvider.AddExport("Value", 22)); - - ExceptionAssert.Throws(() => - exportProvider.RemoveExport("Value")); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void PreviewImports_Unsuccessful_NoAtomicComposition_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value"); - var importer = PartFactory.CreateImporter(import); - - ExceptionAssert.Throws(() => - engine.PreviewImports(importer, null)); - - exportProvider.AddExport("Value", 22); - exportProvider.AddExport("Value", 23); - exportProvider.RemoveExport("Value"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void PreviewImports_Successful_AtomicComposition_Completeted_ShouldBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value"); - var importer = PartFactory.CreateImporter(import); - - exportProvider.AddExport("Value", 21); - - using (var atomicComposition = new AtomicComposition()) - { - engine.PreviewImports(importer, atomicComposition); - atomicComposition.Complete(); - } - - ExceptionAssert.Throws(() => - exportProvider.AddExport("Value", 22)); - - ExceptionAssert.Throws(() => - exportProvider.RemoveExport("Value")); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void PreviewImports_Successful_AtomicComposition_RolledBack_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value"); - var importer = PartFactory.CreateImporter(import); - - exportProvider.AddExport("Value", 21); - - using (var atomicComposition = new AtomicComposition()) - { - engine.PreviewImports(importer, atomicComposition); - - // Let atomicComposition get disposed thus rolledback - } - - exportProvider.AddExport("Value", 22); - exportProvider.RemoveExport("Value"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void PreviewImports_Unsuccessful_AtomicComposition_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value"); - var importer = PartFactory.CreateImporter(import); - - using (var atomicComposition = new AtomicComposition()) - { - ExceptionAssert.Throws(() => - engine.PreviewImports(importer, atomicComposition)); - } - - exportProvider.AddExport("Value", 22); - exportProvider.AddExport("Value", 23); - exportProvider.RemoveExport("Value"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void PreviewImports_ReleaseImports_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value"); - var importer = PartFactory.CreateImporter(import); - - exportProvider.AddExport("Value", 21); - - engine.PreviewImports(importer, null); - - ExceptionAssert.Throws(() => - exportProvider.AddExport("Value", 22)); - - ExceptionAssert.Throws(() => - exportProvider.RemoveExport("Value")); - - engine.ReleaseImports(importer, null); - - exportProvider.AddExport("Value", 22); - exportProvider.RemoveExport("Value"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void PreviewImports_MissingOptionalImport_ShouldSucceed() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value", ImportCardinality.ZeroOrOne); - var importer = PartFactory.CreateImporter(import); - - engine.PreviewImports(importer, null); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void PreviewImports_ZeroCollectionImport_ShouldSucceed() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value", ImportCardinality.ZeroOrMore); - var importer = PartFactory.CreateImporter(import); - - engine.PreviewImports(importer, null); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void PreviewImports_MissingOptionalImport_NonRecomposable_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value", ImportCardinality.ZeroOrOne, false, false); - var importer = PartFactory.CreateImporter(import); - - engine.PreviewImports(importer, null); - - exportProvider.AddExport("Value", 21); - exportProvider.AddExport("Value", 22); - exportProvider.RemoveExport("Value"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void PreviewImports_ZeroCollectionImport_NonRecomposable_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value", ImportCardinality.ZeroOrMore, false, false); - var importer = PartFactory.CreateImporter(import); - - engine.PreviewImports(importer, null); - - exportProvider.AddExport("Value", 21); - exportProvider.AddExport("Value", 22); - exportProvider.RemoveExport("Value"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImports_NonRecomposable_ValueShouldNotChange() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - exportProvider.AddExport("Value", 21); - - var import = ImportDefinitionFactory.Create("Value", false); - var importer = PartFactory.CreateImporter(import); - - engine.SatisfyImports(importer); - - Assert.AreEqual(21, importer.GetImport(import)); - - // After rejection batch failures throw ChangeRejectedException to indicate that - // the failure did not affect the container - ExceptionAssert.Throws(() => - exportProvider.ReplaceExportValue("Value", 42)); - - Assert.AreEqual(21, importer.GetImport(import), "Value should not change!"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImports_Recomposable_ValueShouldChange() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - exportProvider.AddExport("Value", 21); - - var import = ImportDefinitionFactory.Create("Value", true); - var importer = PartFactory.CreateImporter(import); - - engine.SatisfyImports(importer); - - Assert.AreEqual(21, importer.GetImport(import)); - - exportProvider.ReplaceExportValue("Value", 42); - - Assert.AreEqual(42, importer.GetImport(import), "Value should change!"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImports_NonRecomposable_Prerequisite_ValueShouldNotChange() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value", false, true); - var importer = PartFactory.CreateImporter(import); - - exportProvider.AddExport("Value", 21); - - engine.SatisfyImports(importer); - - Assert.AreEqual(21, importer.GetImport(import)); - - ExceptionAssert.Throws(() => - exportProvider.ReplaceExportValue("Value", 42)); - - Assert.AreEqual(21, importer.GetImport(import), "Value should NOT change!"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImports_Recomposable_Prerequisite_ValueShouldChange() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value", true, true); - var importer = PartFactory.CreateImporter(import); - - exportProvider.AddExport("Value", 21); - - engine.SatisfyImports(importer); - - Assert.AreEqual(21, importer.GetImport(import)); - - exportProvider.ReplaceExportValue("Value", 42); - - Assert.AreEqual(42, importer.GetImport(import), "Value should change!"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImports_OneRecomposable_OneNotRecomposable() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import1 = ImportDefinitionFactory.Create("Value", true); - var import2 = ImportDefinitionFactory.Create("Value", false); - var importer = PartFactory.CreateImporter(import1, import2); - - exportProvider.AddExport("Value", 21); - - engine.SatisfyImports(importer); - - // Initial compose values should be 21 - Assert.AreEqual(21, importer.GetImport(import1)); - Assert.AreEqual(21, importer.GetImport(import2)); - - // Reset value to ensure it doesn't get set to same value again - importer.ResetImport(import1); - importer.ResetImport(import2); - - ExceptionAssert.Throws(() => - exportProvider.ReplaceExportValue("Value", 42)); - - Assert.AreEqual(null, importer.GetImport(import1), "Value should NOT have been set!"); - Assert.AreEqual(null, importer.GetImport(import2), "Value should NOT have been set!"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImports_TwoRecomposables_SingleExportValueChanged() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import1 = ImportDefinitionFactory.Create("Value1", true); - var import2 = ImportDefinitionFactory.Create("Value2", true); - var importer = PartFactory.CreateImporter(import1, import2); - - exportProvider.AddExport("Value1", 21); - exportProvider.AddExport("Value2", 23); - - engine.SatisfyImports(importer); - - Assert.AreEqual(21, importer.GetImport(import1)); - Assert.AreEqual(23, importer.GetImport(import2)); - - importer.ResetImport(import1); - importer.ResetImport(import2); - - // Only change Value1 - exportProvider.ReplaceExportValue("Value1", 42); - - Assert.AreEqual(42, importer.GetImport(import1), "Value should have been set!"); - - Assert.AreEqual(null, importer.GetImport(import2), "Value should NOT have changed to the value in the container."); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImports_Recomposable_Unregister_ValueShouldChangeOnce() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - exportProvider.AddExport("Value", 21); - - var import = ImportDefinitionFactory.Create("Value", true); - var importer = PartFactory.CreateImporter(import); - - engine.SatisfyImports(importer); - - Assert.AreEqual(21, importer.GetImport(import)); - - exportProvider.ReplaceExportValue("Value", 42); - - Assert.AreEqual(42, importer.GetImport(import), "Value should change!"); - - engine.ReleaseImports(importer, null); - - exportProvider.ReplaceExportValue("Value", 666); - - Assert.AreEqual(42, importer.GetImport(import), "Value should not change!"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImports_MissingOptionalImport_NonRecomposable_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value", ImportCardinality.ZeroOrOne, false, false); - var importer = PartFactory.CreateImporter(import); - - exportProvider.AddExport("Value", 20); - - engine.SatisfyImports(importer); - - ExceptionAssert.Throws(() => - exportProvider.AddExport("Value", 21)); - - ExceptionAssert.Throws(() => - exportProvider.RemoveExport("Value")); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImports_ZeroCollectionImport_NonRecomposable_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value", ImportCardinality.ZeroOrMore, false, false); - var importer = PartFactory.CreateImporter(import); - - exportProvider.AddExport("Value", 20); - - engine.SatisfyImports(importer); - - ExceptionAssert.Throws(() => - exportProvider.AddExport("Value", 21)); - - ExceptionAssert.Throws(() => - exportProvider.RemoveExport("Value")); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImports_MissingOptionalImport_Recomposable_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value", ImportCardinality.ZeroOrOne, true, false); - var importer = PartFactory.CreateImporter(import); - - exportProvider.AddExport("Value", 20); - - engine.SatisfyImports(importer); - - exportProvider.AddExport("Value", 21); - exportProvider.RemoveExport("Value"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImports_ZeroCollectionImport_Recomposable_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value", ImportCardinality.ZeroOrMore, true, false); - var importer = PartFactory.CreateImporter(import); - - exportProvider.AddExport("Value", 20); - - engine.SatisfyImports(importer); - - exportProvider.AddExport("Value", 21); - exportProvider.RemoveExport("Value"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImportsOnce_Recomposable_ValueShouldNotChange_NoRecompositionRequested() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - exportProvider.AddExport("Value", 21); - - var import = ImportDefinitionFactory.Create("Value", true); - var importer = PartFactory.CreateImporter(import); - - engine.SatisfyImportsOnce(importer); - - Assert.AreEqual(21, importer.GetImport(import)); - - exportProvider.ReplaceExportValue("Value", 42); - - Assert.AreEqual(21, importer.GetImport(import), "Value should not change!"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisifyImportsOnce_Recomposable_ValueShouldNotChange_NoRecompositionRequested_ViaNonArgumentSignature() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - exportProvider.AddExport("Value", 21); - - var import = ImportDefinitionFactory.Create("Value", true); - var importer = PartFactory.CreateImporter(import); - - engine.SatisfyImportsOnce(importer); - - Assert.AreEqual(21, importer.GetImport(import)); - - exportProvider.ReplaceExportValue("Value", 42); - - Assert.AreEqual(21, importer.GetImport(import), "Value should not change!"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImportsOnce_Successful_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value"); - var importer = PartFactory.CreateImporter(import); - - exportProvider.AddExport("Value", 21); - - engine.SatisfyImportsOnce(importer); - - exportProvider.AddExport("Value", 22); - exportProvider.RemoveExport("Value"); - - GC.KeepAlive(importer); - } - - [TestMethod] - public void SatisfyImportsOnce_Unsuccessful_ShouldNotBlockChanges() - { - var exportProvider = ExportProviderFactory.CreateRecomposable(); - var engine = new ImportEngine(exportProvider); - - var import = ImportDefinitionFactory.Create("Value"); - var importer = PartFactory.CreateImporter(import); - - ExceptionAssert.Throws(() => - engine.SatisfyImportsOnce(importer)); - - exportProvider.AddExport("Value", 22); - exportProvider.AddExport("Value", 23); - exportProvider.RemoveExport("Value"); - - GC.KeepAlive(importer); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/TypeCatalogTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/TypeCatalogTests.cs deleted file mode 100644 index 2d1499101f8..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Hosting/TypeCatalogTests.cs +++ /dev/null @@ -1,506 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.UnitTesting; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.UnitTesting; -using Microsoft.Internal; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Globalization; -using System.Text; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class TypeCatalogTests - { - [TestMethod] - public void Constructor2_NullAsTypesArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("types", () => - { - new TypeCatalog((Type[])null); - }); - } - - [TestMethod] - public void Constructor3_NullAsTypesArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("types", () => - { - new TypeCatalog((IEnumerable)null); - }); - } - - [TestMethod] - public void Constructor2_ArrayWithNullAsTypesArgument_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("types", () => - { - new TypeCatalog(new Type[] { null }); - }); - } - - [TestMethod] - public void Constructor3_ArrayWithNullAsTypesArgument_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("types", () => - { - new TypeCatalog((IEnumerable)new Type[] { null }); - }); - } - - [TestMethod] - public void Constructor2_EmptyEnumerableAsTypesArgument_ShouldSetPartsPropertyToEmptyEnumerable() - { - var catalog = new TypeCatalog(Enumerable.Empty()); - - EnumerableAssert.IsEmpty(catalog.Parts); - } - - [TestMethod] - public void Constructor3_EmptyArrayAsTypesArgument_ShouldSetPartsPropertyToEmpty() - { - var catalog = new TypeCatalog(new Type[0]); - - EnumerableAssert.IsEmpty(catalog.Parts); - } - - [TestMethod] - public void Constructor2_ArrayAsTypesArgument_ShouldNotAllowModificationAfterConstruction() - { - var types = new Type[] { PartFactory.GetAttributedExporterType() }; - var catalog = new TypeCatalog(types); - - types[0] = null; - - Assert.IsNotNull(catalog.Parts.First()); - } - - [TestMethod] - public void Constructor3_ArrayAsTypesArgument_ShouldNotAllowModificationAfterConstruction() - { - var types = new Type[] { PartFactory.GetAttributedExporterType() }; - var catalog = new TypeCatalog((IEnumerable)types); - - types[0] = null; - - Assert.IsNotNull(catalog.Parts.First()); - } - - [TestMethod] - public void Constructor2_ShouldSetOriginToNull() - { - var catalog = (ICompositionElement)new TypeCatalog(PartFactory.GetAttributedExporterType()); - - Assert.IsNull(catalog.Origin); - } - - [TestMethod] - public void Constructor3_ShouldSetOriginToNull() - { - var catalog = (ICompositionElement)new TypeCatalog((IEnumerable)new Type[] { PartFactory.GetAttributedExporterType() }); - - Assert.IsNull(catalog.Origin); - } - - [TestMethod] - public void DisplayName_WhenCatalogDisposed_ShouldNotThrow() - { - var catalog = CreateTypeCatalog(); - catalog.Dispose(); - - var displayName = ((ICompositionElement)catalog).DisplayName; - } - - [TestMethod] - public void Origin_WhenCatalogDisposed_ShouldNotThrow() - { - var catalog = CreateTypeCatalog(); - catalog.Dispose(); - - var origin = ((ICompositionElement)catalog).Origin; - } - - [TestMethod] - public void Parts_WhenCatalogDisposed_ShouldThrowObjectDisposed() - { - var catalog = CreateTypeCatalog(); - catalog.Dispose(); - - ExceptionAssert.ThrowsDisposed(catalog, () => - { - var parts = catalog.Parts; - }); - } - - [TestMethod] - public void ToString_WhenCatalogDisposed_ShouldNotThrow() - { - var catalog = CreateTypeCatalog(); - catalog.Dispose(); - - catalog.ToString(); - } - - - [TestMethod] - public void GetExports_WhenCatalogDisposed_ShouldThrowObjectDisposed() - { - var catalog = CreateTypeCatalog(); - catalog.Dispose(); - var definition = ImportDefinitionFactory.Create(); - - ExceptionAssert.ThrowsDisposed(catalog, () => - { - catalog.GetExports(definition); - }); - } - - [TestMethod] - public void GetExports_NullAsConstraintArgument_ShouldThrowArgumentNull() - { - var catalog = CreateTypeCatalog(); - - ExceptionAssert.ThrowsArgument("definition", () => - { - catalog.GetExports((ImportDefinition)null); - }); - } - - [TestMethod] - public void Dispose_ShouldNotThrow() - { - using (var catalog = CreateTypeCatalog()) - { - } - } - - [TestMethod] - public void Dispose_CanBeCalledMultipleTimes() - { - var catalog = CreateTypeCatalog(); - catalog.Dispose(); - catalog.Dispose(); - catalog.Dispose(); - } - - - [TestMethod] - public void Parts() - { - var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); - Assert.IsNotNull(catalog.Parts); - Assert.IsTrue(catalog.Parts.Count()>0); - } - - [TestMethod] - public void Parts_ShouldSetDefinitionOriginToCatalogItself() - { - var catalog = CreateTypeCatalog(); - Assert.IsTrue(catalog.Parts.Count() > 0); - - foreach (ICompositionElement definition in catalog.Parts) - { - Assert.AreSame(catalog, definition.Origin); - } - } - - - [TestMethod] - public void ICompositionElementDisplayName_SingleTypeAsTypesArgument_ShouldIncludeCatalogTypeNameAndTypeFullName() - { - var expectations = Expectations.GetAttributedTypes(); - - foreach (var e in expectations) - { - var catalog = (ICompositionElement)CreateTypeCatalog(e); - - string expected = string.Format(Strings.TypeCatalog_DisplayNameFormat, typeof(TypeCatalog).Name, e.FullName); - - Assert.AreEqual(expected, catalog.DisplayName); - } - } - - [TestMethod] - public void ICompositionElementDisplayName_ValueAsTypesArgument_ShouldIncludeCatalogTypeNameAndTypeFullNames() - { - var expectations = new ExpectationCollection(); - expectations.Add(new Type[] { typeof(Type) }, - GetDisplayName(false, typeof(TypeCatalog))); - - expectations.Add(new Type[] { typeof(ExportValueTypeSingleton) }, - GetDisplayName(false, typeof(TypeCatalog), typeof(ExportValueTypeSingleton))); - - expectations.Add(new Type[] { typeof(ExportValueTypeSingleton), typeof(ExportValueTypeSingleton) }, - GetDisplayName(false, typeof(TypeCatalog), typeof(ExportValueTypeSingleton), typeof(ExportValueTypeSingleton))); - - expectations.Add(new Type[] { typeof(ExportValueTypeSingleton), typeof(string), typeof(ExportValueTypeSingleton) }, - GetDisplayName(false, typeof(TypeCatalog), typeof(ExportValueTypeSingleton), typeof(ExportValueTypeSingleton))); - - expectations.Add(new Type[] { typeof(ExportValueTypeSingleton), typeof(ExportValueTypeFactory) }, - GetDisplayName(false, typeof(TypeCatalog), typeof(ExportValueTypeSingleton), typeof(ExportValueTypeFactory))); - - expectations.Add(new Type[] { typeof(ExportValueTypeSingleton), typeof(ExportValueTypeFactory), typeof(CallbackExecuteCodeDuringCompose) }, - GetDisplayName(true, typeof(TypeCatalog), typeof(ExportValueTypeSingleton), typeof(ExportValueTypeFactory))); - - foreach (var e in expectations) - { - var catalog = (ICompositionElement)CreateTypeCatalog(e.Input); - - Assert.AreEqual(e.Output, catalog.DisplayName); - } - } - - [TestMethod] - public void ICompositionElementDisplayName_ShouldIncludeDerivedCatalogTypeNameAndTypeFullNames() - { - var expectations = Expectations.GetAttributedTypes(); - - foreach (var e in expectations) - { - var catalog = (ICompositionElement)new DerivedTypeCatalog(e); - - string expected = string.Format(Strings.TypeCatalog_DisplayNameFormat, typeof(DerivedTypeCatalog).Name, e.FullName); - - Assert.AreEqual(expected, catalog.DisplayName); - } - } - - [TestMethod] - public void ToString_ShouldReturnICompositionElementDisplayName() - { - var expectations = Expectations.GetAttributedTypes(); - - foreach (var e in expectations) - { - var catalog = (ICompositionElement)CreateTypeCatalog(e); - - Assert.AreEqual(catalog.DisplayName, catalog.ToString()); - } - } - - - [TestMethod] - public void GetExports() - { - var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); - Expression> constraint = (ExportDefinition exportDefinition) => exportDefinition.ContractName == AttributedModelServices.GetContractName(typeof(MyExport)); - IEnumerable> matchingExports = catalog.GetExports(constraint); - Assert.IsNotNull(matchingExports); - Assert.IsTrue(matchingExports.Count() >= 0); - - IEnumerable> expectedMatchingExports = catalog.Parts - .SelectMany(part => part.ExportDefinitions, (part, export) => new Tuple(part, export)) - .Where(partAndExport => partAndExport.Item2.ContractName == AttributedModelServices.GetContractName(typeof(MyExport))); - Assert.IsTrue(matchingExports.SequenceEqual(expectedMatchingExports)); - } - - [TestMethod] - public void TwoTypesWithSameSimpleName() - { - var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); - var container = new CompositionContainer(catalog); - - NotSoUniqueName unique1 = container.GetExportedValue(); - - Assert.IsNotNull(unique1); - - Assert.AreEqual(23, unique1.MyIntProperty); - - NotSoUniqueName2.NotSoUniqueName nestedUnique = container.GetExportedValue(); - - Assert.IsNotNull(nestedUnique); - - Assert.AreEqual("MyStringProperty", nestedUnique.MyStringProperty); - } - - [TestMethod] - public void GettingFunctionExports() - { - var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); - var container = new CompositionContainer(catalog); - - ImportDefaultFunctions import = container.GetExportedValue("ImportDefaultFunctions"); - import.VerifyIsBound(); - } - - [TestMethod] - public void AnExportOfAnInstanceThatFailsToCompose() - { - var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); - var container = new CompositionContainer(catalog); - - // Rejection causes the part in the catalog whose imports cannot be - // satisfied to be ignored, resulting in a cardinality mismatch instead of a - // composition exception - ExceptionAssert.Throws(() => - { - container.GetExportedValue("ExportMyString"); - }); - } - - [TestMethod] - public void SharedPartCreation() - { - var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); - var container = new CompositionContainer(catalog); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new Int32Exporter(41)); - container.Compose(batch); - - var sharedPart1 = container.GetExportedValue(); - Assert.AreEqual(41, sharedPart1.Value); - var sharedPart2 = container.GetExportedValue(); - Assert.AreEqual(41, sharedPart2.Value); - - Assert.AreEqual(sharedPart1, sharedPart2, "These should be the same instances"); - } - - [TestMethod] - public void NonSharedPartCreation() - { - var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); - var container = new CompositionContainer(catalog); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new Int32Exporter(41)); - container.Compose(batch); - - var nonSharedPart1 = container.GetExportedValue(); - Assert.AreEqual(41, nonSharedPart1.Value); - var nonSharedPart2 = container.GetExportedValue(); - Assert.AreEqual(41, nonSharedPart2.Value); - - Assert.AreNotEqual(nonSharedPart1, nonSharedPart2, "These should be different instances"); - } - - [TestMethod] - public void RecursiveNonSharedPartCreation() - { - var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); - var container = new CompositionContainer(catalog); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - { - container.GetExportedValue(); - }); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - { - container.GetExportedValue(); - }); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - { - container.GetExportedValue(); - }); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - { - container.GetExportedValue(); - }); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - { - container.GetExportedValue(); - }); - - Assert.IsNotNull(container.GetExportedValue()); - Assert.IsNotNull(container.GetExportedValue()); - Assert.IsNotNull(container.GetExportedValue()); - Assert.IsNotNull(container.GetExportedValue()); - } - - [TestMethod] - public void TryToDiscoverExportWithGenericParameter() - { - var catalog = new TypeCatalog(Assembly.GetExecutingAssembly().GetTypes()); - var container = new CompositionContainer(catalog); - - // Open generic should fail because we should discover that type - Assert.IsNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(ExportWithGenericParameter<>)))); - - // This specific generic was not exported any where so it should fail - Assert.IsNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(ExportWithGenericParameter)))); - - // This specific generic was exported so it should succeed - Assert.IsNotNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(ExportWithGenericParameter)))); - - // Shouldn't discovoer static type with open generic - Assert.IsNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(StaticExportWithGenericParameter<>)))); - - // Should find a type that inherits from an export - Assert.IsNotNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(ExportWhichInheritsFromGeneric)))); - - // This should be exported because it is inherited by ExportWhichInheritsFromGeneric - Assert.IsNotNull(container.GetExportedValueOrDefault(AttributedModelServices.GetContractName(typeof(ExportWithGenericParameter)))); - } - - private string GetDisplayName(bool useEllipses, Type catalogType, params Type[] types) - { - return String.Format(CultureInfo.CurrentCulture, - Strings.TypeCatalog_DisplayNameFormat, - catalogType.Name, - this.GetTypesDisplay(useEllipses, types)); - } - - private string GetTypesDisplay(bool useEllipses, Type[] types) - { - int count = types.Length; - if (count == 0) - { - return Strings.TypeCatalog_Empty; - } - - StringBuilder builder = new StringBuilder(); - foreach (Type type in types) - { - if (builder.Length > 0) - { - builder.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator); - builder.Append(" "); - } - - builder.Append(type.FullName); - } - - if (useEllipses) - { // Add an elipse to indicate that there - // are more types than actually listed - builder.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator); - builder.Append(" ..."); - } - - return builder.ToString(); - } - - - private TypeCatalog CreateTypeCatalog() - { - var type = PartFactory.GetAttributedExporterType(); - - return CreateTypeCatalog(type); - } - - private TypeCatalog CreateTypeCatalog(params Type[] types) - { - return new TypeCatalog(types); - } - - private class DerivedTypeCatalog : TypeCatalog - { - public DerivedTypeCatalog(params Type[] types) - : base(types) - { - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportAttributeTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportAttributeTests.cs deleted file mode 100644 index 2a4f46772f3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportAttributeTests.cs +++ /dev/null @@ -1,139 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ImportAttributeTests - { - [TestMethod] - public void Constructor1_ShouldSetContractNamePropertyToEmptyString() - { - var attribute = new ImportAttribute(); - - Assert.IsNull(attribute.ContractName); - Assert.IsNull(attribute.ContractType); - } - - [TestMethod] - public void Constructor2_NullAsContractNameArgument_ShouldSetContractNamePropertyToEmptyString() - { - var attribute = new ImportAttribute((string)null); - - Assert.IsNull(attribute.ContractName); - Assert.IsNull(attribute.ContractType); - } - - [TestMethod] - public void Constructor3_NullAsContractTypeArgument_ShouldSetContractNamePropertyToEmptyString() - { - var attribute = new ImportAttribute((Type)null); - - Assert.IsNull(attribute.ContractName); - Assert.IsNull(attribute.ContractType); - } - - [TestMethod] - public void Constructor4_NullAsContractTypeArgument_ShouldSetContractNamePropertyToEmptyString() - { - var attribute = new ImportAttribute((string)null, (Type)null); - - Assert.IsNull(attribute.ContractName); - Assert.IsNull(attribute.ContractType); - } - - [TestMethod] - public void Constructor2_ValueAsContractNameArgument_ShouldSetContractNameProperty() - { - var expectations = Expectations.GetContractNamesWithEmpty(); - - foreach (var e in expectations) - { - var attribute = new ImportAttribute(e); - - Assert.AreEqual(e, attribute.ContractName); - } - } - - [TestMethod] - public void Constructor1_ShouldSetAllowDefaultPropertyToFalse() - { - var attribute = new ImportAttribute(); - - Assert.IsFalse(attribute.AllowDefault); - } - - [TestMethod] - public void Constructor2_ShouldSetAllowDefaultPropertyToFalse() - { - var attribute = new ImportAttribute("ContractName"); - - Assert.IsFalse(attribute.AllowDefault); - } - - [TestMethod] - public void Constructor3_ShouldSetAllowDefaultPropertyToFalse() - { - var attribute = new ImportAttribute(typeof(String)); - - Assert.IsFalse(attribute.AllowDefault); - } - - [TestMethod] - public void Constructor1_ShouldSetAllowRecompositionPropertyToFalse() - { - var attribute = new ImportAttribute(); - - Assert.IsFalse(attribute.AllowRecomposition); - } - - [TestMethod] - public void Constructor2_ShouldSetAllowRecompositionPropertyToFalse() - { - var attribute = new ImportAttribute("ContractName"); - - Assert.IsFalse(attribute.AllowRecomposition); - } - - [TestMethod] - public void Constructor3_ShouldSetAllowRecompositionPropertyToFalse() - { - var attribute = new ImportAttribute(typeof(String)); - - Assert.IsFalse(attribute.AllowRecomposition); - } - - [TestMethod] - public void AllowDefault_ValueAsValueArgument_ShouldSetProperty() - { - var expectations = Expectations.GetBooleans(); - - var attribute = new ImportAttribute(); - - foreach (var e in expectations) - { - attribute.AllowDefault = e; - Assert.AreEqual(e, attribute.AllowDefault); - } - } - - [TestMethod] - public void AllowRecomposition_ValueAsValueArgument_ShouldSetProperty() - { - var expectations = Expectations.GetBooleans(); - - var attribute = new ImportAttribute(); - - foreach (var e in expectations) - { - attribute.AllowRecomposition = e; - Assert.AreEqual(e, attribute.AllowRecomposition); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportDefinitionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportDefinitionTests.cs deleted file mode 100644 index a3092cd2ed5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportDefinitionTests.cs +++ /dev/null @@ -1,246 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ -using System; -using System.ComponentModel.Composition; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Linq.Expressions; -using System.Text.RegularExpressions; -using System.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ImportDefinitionTests - { - [TestMethod] - public void Constructor1_ShouldSetCardinalityPropertyToExactlyOne() - { - var definition = new NoOverridesImportDefinition(); - - Assert.AreEqual(ImportCardinality.ExactlyOne, definition.Cardinality); - } - - [TestMethod] - public void Constructor1_ShouldSetIsPrerequisitePropertyToTrue() - { - var definition = new NoOverridesImportDefinition(); - - Assert.IsTrue(definition.IsPrerequisite); - } - - [TestMethod] - public void Constructor1_ShouldSetIsRecomposablePropertyToFalse() - { - var definition = new NoOverridesImportDefinition(); - - Assert.IsFalse(definition.IsRecomposable); - } - - [TestMethod] - public void Constructor2_NullAsConstraintArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("constraint", () => - { - new ImportDefinition((Expression>)null, "", ImportCardinality.ExactlyOne, false, false); - }); - } - - [TestMethod] - public void Constructor2_OutOfRangeValueAsCardinalityArgument_ShouldThrowArgument() - { - var expectations = Expectations.GetInvalidEnumValues(); - - foreach (var e in expectations) - { - ExceptionAssert.ThrowsArgument("cardinality", () => - { - new ImportDefinition(d => true, "", e, false, false); - }); - } - } - - [TestMethod] - public void Constructor2_ValueAsCardinalityArgument_ShouldSetCardinalityProperty() - { - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var definition = new ImportDefinition(d => true, "", e, false, false); - - Assert.AreEqual(e, definition.Cardinality); - } - } - - [TestMethod] - public void Constructor2_ValueAsConstraintArgument_ShouldSetConstraintProperty() - { - var expectations = new List>>(); - expectations.Add(d => d.ContractName == "ContractName"); - expectations.Add(d => d.ContractName.Equals("ContractName")); - expectations.Add(d => (string)d.Metadata["Name"] == "Value"); - expectations.Add(d => true); - - foreach (var e in expectations) - { - var definition = new ImportDefinition(e, "", ImportCardinality.ExactlyOne, false, false); - - Assert.AreEqual(e, definition.Constraint); - } - } - - [TestMethod] - public void Constructor2_ValueAsIsRecomposableArgument_ShouldSetIsRecomposableProperty() - { - var expectations = Expectations.GetBooleans(); - - foreach (var e in expectations) - { - var definition = new ImportDefinition(d => true, "", ImportCardinality.ExactlyOne, e, false); - - Assert.AreEqual(e, definition.IsRecomposable); - } - } - - [TestMethod] - public void Constructor2_ValueAsIsPrerequisiteArgument_ShouldSetIsPrerequisiteProperty() - { - var expectations = Expectations.GetBooleans(); - - foreach (var e in expectations) - { - var definition = new ImportDefinition(d => true, "", ImportCardinality.ExactlyOne, false, e); - - Assert.AreEqual(e, definition.IsPrerequisite); - } - } - - [TestMethod] - public void Constructor2_ContractName_ShouldSetAppropriately() - { - var expectations = new ExpectationCollection(); - - expectations.Add(null, string.Empty); - expectations.Add(string.Empty, string.Empty); - expectations.Add("Contract", "Contract"); - - string cn = AttributedModelServices.GetContractName(typeof(ImportDefinitionTests)); - expectations.Add(cn, cn); - - foreach (var e in expectations) - { - var definition = new ImportDefinition(d => true, e.Input, ImportCardinality.ExactlyOne, false, false); - - Assert.AreEqual(e.Output, definition.ContractName); - } - } - - - [TestMethod] - public void Constraint_WhenNotOverridden_ShouldThrowNotImplemented() - { - var definition = new NoOverridesImportDefinition(); - - ExceptionAssert.Throws(() => - { - var constraint = definition.Constraint; - }); - } - - [TestMethod] - public void ToString_WhenConstraintPropertyNotOverridden_ShouldThrowNotImplemented() - { - var definition = new NoOverridesImportDefinition(); - - ExceptionAssert.Throws(() => - { - definition.ToString(); - }); - } - - [TestMethod] - public void ToString_ValueAsConstraintArgument_ShouldReturnConstraintProperty() - { - var expectations = new ExpectationCollection>, string>(); - expectations.Add(d => d.ContractName == "ContractName", @"d.ContractName ==? ""ContractName"""); - expectations.Add(d => d.ContractName.Equals("ContractName"), @"d.ContractName.Equals\(""ContractName""\)"); - expectations.Add(d => (string)d.Metadata["Name"] == "Value", @"Convert\(d.Metadata.get_Item\(""Name""\)\) ==? ""Value"""); - expectations.Add(d => true, "True"); - - foreach (var e in expectations) - { - var item = new ImportDefinition(e.Input, "", ImportCardinality.ExactlyOne, false, false); - - Assert.IsTrue(Regex.IsMatch(item.ToString(), e.Output)); - } - } - - [TestMethod] - public void ToString_DerivedImportDefinition_ShouldReturnOverriddenConstraintProperty() - { - var expectations = new ExpectationCollection>, string>(); - expectations.Add(d => d.ContractName == "ContractName", @"d.ContractName ==? ""ContractName"""); - expectations.Add(d => d.ContractName.Equals("ContractName"), @"d.ContractName.Equals\(""ContractName""\)"); - expectations.Add(d => (string)d.Metadata["Name"] == "Value", @"Convert\(d.Metadata.get_Item\(""Name""\)\) ==? ""Value"""); - expectations.Add(d => true, "True"); - - foreach (var e in expectations) - { - var item = new DerivedImportDefinition(e.Input); - - Assert.IsTrue(Regex.IsMatch(item.ToString(), e.Output)); - } - } - - [TestMethod] - [WorkItem(738535)] - [Ignore] - public void ContractName_ShouldBeIncludedInConstraintAutomatically() - { - string testContractName = "TestContractName"; - var contractImportDefinition = new ImportDefinition(ed => true, testContractName, ImportCardinality.ZeroOrMore, false, false); - - var shouldMatch = new ExportDefinition(testContractName, null); - var shouldNotMatch = new ExportDefinition(testContractName + testContractName, null); - - Assert.IsTrue(contractImportDefinition.IsConstraintSatisfiedBy(shouldMatch)); - Assert.IsFalse(contractImportDefinition.IsConstraintSatisfiedBy(shouldNotMatch)); - } - - [TestMethod] - public void EmptyContractName_ShouldMatchAllContractNames() - { - var importDefinition = new ImportDefinition(ed => true, string.Empty, ImportCardinality.ZeroOrMore, false, false); - - var shouldMatch1 = new ExportDefinition("contract1", null); - var shouldMatch2 = new ExportDefinition("contract2", null); - - Assert.IsTrue(importDefinition.IsConstraintSatisfiedBy(shouldMatch1)); - Assert.IsTrue(importDefinition.IsConstraintSatisfiedBy(shouldMatch2)); - } - - private class NoOverridesImportDefinition : ImportDefinition - { - } - - private class DerivedImportDefinition : ImportDefinition - { - private readonly Expression> _constraint; - - public DerivedImportDefinition(Expression> constraint) - { - _constraint = constraint; - } - - public override Expression> Constraint - { - get { return _constraint ?? base.Constraint; } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportingComposablePart.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportingComposablePart.cs deleted file mode 100644 index e89f71ed33f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportingComposablePart.cs +++ /dev/null @@ -1,144 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Factories; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - internal class ImportingComposablePart : ComposablePart - { - private readonly List _importDefinitions = new List(); - private readonly List _exportDefinitions = new List(); - private Dictionary _importValues = new Dictionary(); - - public ImportingComposablePart(ImportCardinality cardinality, bool isRecomposable, params string[] contractNames) - : this((string)null, cardinality, isRecomposable, contractNames) - { - } - - public ImportingComposablePart(string exportContractName, ImportCardinality cardinality, bool isRecomposable, params string[] contractNames) - { - if (exportContractName != null) - { - var definition = ExportDefinitionFactory.Create(exportContractName); - - _exportDefinitions.Add(definition); - } - - foreach (string contractName in contractNames) - { - var definition = ImportDefinitionFactory.Create(contractName, - cardinality, - isRecomposable, - false); - - _importDefinitions.Add(definition); - } - } - - public ImportingComposablePart(params ImportDefinition[] importDefintions) - { - _importDefinitions.AddRange(importDefintions); - } - - public override IEnumerable ExportDefinitions - { - get { return this._exportDefinitions; } - } - - public override IEnumerable ImportDefinitions - { - get { return this._importDefinitions; } - } - - public override IDictionary Metadata - { - get { return new Dictionary(); } - } - - public int ImportSatisfiedCount - { - get; - private set; - } - - public void ResetImportSatisfiedCount() - { - ImportSatisfiedCount = 0; - } - - public object Value - { - get - { - Assert.AreEqual(1, _importValues.Count); - - return _importValues.Values.First(); - } - } - - public object GetImport(string contractName) - { - foreach (var pair in _importValues) - { - var definition = (ContractBasedImportDefinition)pair.Key; - if (definition.ContractName == contractName) - { - return pair.Value; - } - } - - return null; - } - - public object GetImport(ImportDefinition definition) - { - Assert.IsTrue(_importValues.ContainsKey(definition)); - return _importValues[definition]; - } - - public override object GetExportedValue(ExportDefinition definition) - { - Assert.Fail(); - return null; - } - - public override void SetImport(ImportDefinition definition, IEnumerable exports) - { - Assert.IsTrue(_importDefinitions.Contains(definition)); - - ImportSatisfiedCount++; - - _importValues[definition] = GetExportValue(exports); - } - - public void ResetImport(ImportDefinition definition) - { - Assert.IsTrue(_importDefinitions.Contains(definition)); - _importValues[definition] = null; - } - - private object GetExportValue(IEnumerable exports) - { - var exportedValues = exports.Select(export => export.Value); - - int count = exportedValues.Count(); - if (count == 0) - { - return null; - } - else if (count == 1) - { - return exportedValues.First(); - } - - return exportedValues.ToArray(); - } - } - -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportingConstructorAttributeTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportingConstructorAttributeTests.cs deleted file mode 100644 index f222b065394..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ImportingConstructorAttributeTests.cs +++ /dev/null @@ -1,20 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ImportingConstructorAttributeTests - { - [TestMethod] - public void Constructor_ShouldNotThrow() - { - var attribute = new ImportingConstructorAttribute(); - - Assert.IsNotNull(attribute); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/InitializationScopeTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/InitializationScopeTests.cs deleted file mode 100644 index 303563e6e9e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/InitializationScopeTests.cs +++ /dev/null @@ -1,150 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class InitializationScopeTests - { - [TestMethod] - public void SingleContainerSimpleCompose() - { - var container = ContainerFactory.Create(); - ImportingComposablePart importPart; - CompositionBatch batch = new CompositionBatch(); - - batch.AddExportedValue("value1", "Hello"); - batch.AddExportedValue("value2", "World"); - batch.AddPart(importPart = PartFactory.CreateImporter("value1", "value2")); - container.Compose(batch); - - Assert.AreEqual(2, importPart.ImportSatisfiedCount); - Assert.AreEqual("Hello", importPart.GetImport("value1")); - Assert.AreEqual("World", importPart.GetImport("value2")); - } - - [TestMethod] - public void ParentedContainerSimpleCompose() - { - var container = ContainerFactory.Create(); - var importPart = PartFactory.CreateImporter("value1", "value2"); - - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("value1", "Parent"); - - var childContainer = new CompositionContainer(container); - CompositionBatch childBatch = new CompositionBatch(); - childBatch.AddExportedValue("value2", "Child"); - childBatch.AddPart(importPart); - - Assert.AreEqual(0, importPart.ImportSatisfiedCount, "Import should not happen until outer scope is disposed"); - - container.Compose(batch); - childContainer.Compose(childBatch); - - Assert.AreEqual(2, importPart.ImportSatisfiedCount); - Assert.AreEqual("Parent", importPart.GetImport("value1")); - Assert.AreEqual("Child", importPart.GetImport("value2")); - } - - [TestMethod] - public void SingleContainerPartReplacement() - { - var container = ContainerFactory.Create(); - var importPart = PartFactory.CreateImporter(true, "value1", "value2"); - - CompositionBatch batch = new CompositionBatch(); - var export1Key = batch.AddExportedValue("value1", "Hello"); - batch.AddExportedValue("value2", "World"); - batch.AddPart(importPart); - container.Compose(batch); - - Assert.AreEqual(2, importPart.ImportSatisfiedCount); - Assert.AreEqual("Hello", importPart.GetImport("value1")); - Assert.AreEqual("World", importPart.GetImport("value2")); - - importPart.ResetImportSatisfiedCount(); - - batch = new CompositionBatch(); - batch.RemovePart(export1Key); - batch.AddExportedValue("value1", "Goodbye"); - container.Compose(batch); - - Assert.AreEqual(1, importPart.ImportSatisfiedCount); - Assert.AreEqual("Goodbye", importPart.GetImport("value1")); - Assert.AreEqual("World", importPart.GetImport("value2")); - } - - [TestMethod] - public void ParentedContainerPartReplacement() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - var importPart = PartFactory.CreateImporter(true, "value1", "value2"); - var exportKey = batch.AddExportedValue("value1", "Parent"); - - var childContainer = new CompositionContainer(container); - CompositionBatch childBatch = new CompositionBatch(); - childBatch.AddExportedValue("value2", "Child"); - childBatch.AddPart(importPart); - - Assert.AreEqual(0, importPart.ImportSatisfiedCount, "Should not import until outer scope is disposed"); - container.Compose(batch); - childContainer.Compose(childBatch); - - Assert.AreEqual(2, importPart.ImportSatisfiedCount); - Assert.AreEqual("Parent", importPart.GetImport("value1")); - Assert.AreEqual("Child", importPart.GetImport("value2")); - - importPart.ResetImportSatisfiedCount(); - batch = new CompositionBatch(); - batch.RemovePart(exportKey); - batch.AddExportedValue("value1", "New Parent"); - container.Compose(batch); - - Assert.AreEqual(1, importPart.ImportSatisfiedCount); - Assert.AreEqual("New Parent", importPart.GetImport("value1")); - Assert.AreEqual("Child", importPart.GetImport("value2")); - } - - [TestMethod] - public void SelectiveRecompose() - { - var container = ContainerFactory.Create(); - var stableImporter = PartFactory.CreateImporter("stable"); - var dynamicImporter = PartFactory.CreateImporter("dynamic", true); - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(stableImporter); - batch.AddPart(dynamicImporter); - var exportKey = batch.AddExportedValue("dynamic", 1); - batch.AddExportedValue("stable", 42); - container.Compose(batch); - - Assert.AreEqual(1, stableImporter.ImportSatisfiedCount); - Assert.AreEqual(stableImporter.GetImport("stable"), 42); - Assert.AreEqual(1, dynamicImporter.ImportSatisfiedCount); - Assert.AreEqual(dynamicImporter.GetImport("dynamic"), 1); - - batch = new CompositionBatch(); - stableImporter.ResetImportSatisfiedCount(); - dynamicImporter.ResetImportSatisfiedCount(); - batch.RemovePart(exportKey); - batch.AddExportedValue("dynamic", 2); - container.Compose(batch); - - Assert.AreEqual(0, stableImporter.ImportSatisfiedCount, "Should not have imported the stable import part"); - Assert.AreEqual(stableImporter.GetImport("stable"), 42); - Assert.AreEqual(1, dynamicImporter.ImportSatisfiedCount); - Assert.AreEqual(dynamicImporter.GetImport("dynamic"), 2); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MetadataAttributeAttributeTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MetadataAttributeAttributeTests.cs deleted file mode 100644 index 0cde9ac78bb..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MetadataAttributeAttributeTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class MetadataAttributeAttributeTests - { - [TestMethod] - public void Constructor_ShouldNotThrow() - { - var attribute = new MetadataAttributeAttribute(); - - Assert.IsNotNull(attribute); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MetadataTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MetadataTests.cs deleted file mode 100644 index 73d8c873c5d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MetadataTests.cs +++ /dev/null @@ -1,1255 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.UnitTesting; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; -using System.Reflection; -using System.Collections.ObjectModel; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class MetadataTests - { - #region Tests for metadata on exports - - public enum SimpleEnum - { - First - } - - [PartNotDiscoverable] - [Export] - [ExportMetadata("String", "42")] - [ExportMetadata("Int", 42)] - [ExportMetadata("Float", 42.0f)] - [ExportMetadata("Enum", SimpleEnum.First)] - [ExportMetadata("Type", typeof(string))] - [ExportMetadata("Object", 42)] - public class SimpleMetadataExporter - { - } - - [PartNotDiscoverable] - [Export] - [ExportMetadata("String", null)] // null - [ExportMetadata("Int", 42)] - [ExportMetadata("Float", 42.0f)] - [ExportMetadata("Enum", SimpleEnum.First)] - [ExportMetadata("Type", typeof(string))] - [ExportMetadata("Object", 42)] - public class SimpleMetadataExporterWithNullReferenceValue - { - } - - [PartNotDiscoverable] - [Export] - [ExportMetadata("String", "42")] - [ExportMetadata("Int", null)] //null - [ExportMetadata("Float", 42.0f)] - [ExportMetadata("Enum", SimpleEnum.First)] - [ExportMetadata("Type", typeof(string))] - [ExportMetadata("Object", 42)] - public class SimpleMetadataExporterWithNullNonReferenceValue - { - } - - [PartNotDiscoverable] - [Export] - [ExportMetadata("String", "42")] - [ExportMetadata("Int", "42")] // wrong type - [ExportMetadata("Float", 42.0f)] - [ExportMetadata("Enum", SimpleEnum.First)] - [ExportMetadata("Type", typeof(string))] - [ExportMetadata("Object", 42)] - public class SimpleMetadataExporterWithTypeMismatch - { - } - - public interface ISimpleMetadataView - { - string String { get; } - int Int { get; } - float Float { get; } - SimpleEnum Enum { get; } - Type Type { get; } - object Object { get; } - } - - [TestMethod] - public void SimpleMetadataTest() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new SimpleMetadataExporter()); - - var export = container.GetExport(); - - Assert.AreEqual("42", export.Metadata.String); - Assert.AreEqual(42, export.Metadata.Int); - Assert.AreEqual(42.0f, export.Metadata.Float); - Assert.AreEqual(SimpleEnum.First, export.Metadata.Enum); - Assert.AreEqual(typeof(string), export.Metadata.Type); - Assert.AreEqual(42, export.Metadata.Object); - } - - [TestMethod] - public void SimpleMetadataTestWithNullReferenceValue() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new SimpleMetadataExporterWithNullReferenceValue()); - - var export = container.GetExport(); - - Assert.AreEqual(null, export.Metadata.String); - Assert.AreEqual(42, export.Metadata.Int); - Assert.AreEqual(42.0f, export.Metadata.Float); - Assert.AreEqual(SimpleEnum.First, export.Metadata.Enum); - Assert.AreEqual(typeof(string), export.Metadata.Type); - Assert.AreEqual(42, export.Metadata.Object); - } - - [TestMethod] - public void SimpleMetadataTestWithNullNonReferenceValue() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new SimpleMetadataExporterWithNullNonReferenceValue()); - - var exports = container.GetExports(); - Assert.IsFalse(exports.Any()); - } - - [TestMethod] - public void SimpleMetadataTestWithTypeMismatch() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new SimpleMetadataExporterWithTypeMismatch()); - - var exports = container.GetExports(); - Assert.IsFalse(exports.Any()); - } - - [TestMethod] - public void ValidMetadataTest() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new MyExporterWithValidMetadata()); - container.Compose(batch); - - var typeVi = container.GetExport>(); - var metadataFoo = typeVi.Metadata["foo"] as IList; - Assert.AreEqual(2, metadataFoo.Count(), "There are should be two items in the metadata foo's collection"); - Assert.IsTrue(metadataFoo.Contains("bar1"), "The metadata collection should include value 'bar1'"); - Assert.IsTrue(metadataFoo.Contains("bar2"), "The metadata collection should include value 'bar2'"); - Assert.AreEqual("world", typeVi.Metadata["hello"], "The single item metadata should be present"); - Assert.AreEqual("GoodOneValue2", typeVi.Metadata["GoodOne2"], "The metadata supplied by strong attribute should also be present"); - - var metadataAcme = typeVi.Metadata["acme"] as IList; - Assert.AreEqual(2, metadataAcme.Count(), "There are should be two items in the metadata acme's collection"); - Assert.IsTrue(metadataAcme.Contains("acmebar"), "The metadata collection should include value 'bar'"); - Assert.IsTrue(metadataAcme.Contains(2.0), "The metadata collection should include value 2"); - - var memberVi = container.GetExport, IDictionary>("ContractForValidMetadata"); - var metadataBar = memberVi.Metadata["bar"] as IList; - Assert.AreEqual(2, metadataBar.Count(), "There are should be two items in the metadata bar's collection"); - Assert.IsTrue(metadataBar.Contains("foo1"), "The metadata collection should include value 'foo1'"); - Assert.IsTrue(metadataBar.Contains("foo2"), "The metadata collection should include value 'foo2'"); - Assert.AreEqual("hello", memberVi.Metadata["world"], "The single item metadata should be present"); - Assert.AreEqual("GoodOneValue2", memberVi.Metadata["GoodOne2"], "The metadata supplied by strong attribute should also be present"); - - var metadataStuff = memberVi.Metadata["stuff"] as IList; - Assert.AreEqual(2, metadataAcme.Count(), "There are should be two items in the metadata acme's collection"); - Assert.IsTrue(metadataStuff.Contains("acmebar"), "The metadata collection should include value 'acmebar'"); - Assert.IsTrue(metadataStuff.Contains(2.0), "The metadata collection should include value 2"); - - } - - [TestMethod] - public void ValidMetadataDiscoveredByComponentCatalogTest() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - ValidMetadataDiscoveredByCatalog(container); - } - - private void ValidMetadataDiscoveredByCatalog(CompositionContainer container) - { - var export1 = container.GetExport>(); - - var metadataFoo = export1.Metadata["foo"] as IList; - Assert.AreEqual(2, metadataFoo.Count(), "There are should be two items in the metadata foo's collection"); - Assert.IsTrue(metadataFoo.Contains("bar1"), "The metadata collection should include value 'bar1'"); - Assert.IsTrue(metadataFoo.Contains("bar2"), "The metadata collection should include value 'bar2'"); - Assert.AreEqual("world", export1.Metadata["hello"], "The single item metadata should also be present"); - Assert.AreEqual("GoodOneValue2", export1.Metadata["GoodOne2"], "The metadata supplied by strong attribute should also be present"); - - var metadataAcme = export1.Metadata["acme"] as IList; - Assert.AreEqual(2, metadataAcme.Count(), "There are should be two items in the metadata acme's collection"); - Assert.IsTrue(metadataAcme.Contains("acmebar"), "The metadata collection should include value 'bar'"); - Assert.IsTrue(metadataAcme.Contains(2.0), "The metadata collection should include value 2"); - - var export2 = container.GetExport, IDictionary>("ContractForValidMetadata"); - var metadataBar = export2.Metadata["bar"] as IList; - Assert.AreEqual(2, metadataBar.Count(), "There are should be two items in the metadata foo's collection"); - Assert.IsTrue(metadataBar.Contains("foo1"), "The metadata collection should include value 'foo1'"); - Assert.IsTrue(metadataBar.Contains("foo2"), "The metadata collection should include value 'foo2'"); - Assert.AreEqual("hello", export2.Metadata["world"], "The single item metadata should also be present"); - Assert.AreEqual("GoodOneValue2", export2.Metadata["GoodOne2"], "The metadata supplied by strong attribute should also be present"); - - var metadataStuff = export2.Metadata["stuff"] as IList; - Assert.AreEqual(2, metadataAcme.Count(), "There are should be two items in the metadata acme's collection"); - Assert.IsTrue(metadataStuff.Contains("acmebar"), "The metadata collection should include value 'acmebar'"); - Assert.IsTrue(metadataStuff.Contains(2.0), "The metadata collection should include value 2"); - } - - - [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] - [MetadataAttribute] - public class BadStrongMetadata : Attribute - { - public string SelfConflicted { get { return "SelfConflictedValue"; } } - } - - [Export] - [BadStrongMetadata] - [ExportMetadata("InvalidCollection", "InvalidCollectionValue1")] - [ExportMetadata("InvalidCollection", "InvalidCollectionValue2", IsMultiple = true)] - [BadStrongMetadata] - [ExportMetadata("RepeatedMetadata", "RepeatedMetadataValue1")] - [ExportMetadata("RepeatedMetadata", "RepeatedMetadataValue2")] - [ExportMetadata("GoodOne1", "GoodOneValue1")] - [ExportMetadata("ConflictedOne1", "ConfilictedOneValue1")] - [GoodStrongMetadata] - [ExportMetadata("ConflictedOne2", "ConflictedOne2Value2")] - [PartNotDiscoverable] - public class MyExporterWithInvalidMetadata - { - [Export("ContractForInvalidMetadata")] - [ExportMetadata("ConflictedOne1", "ConfilictedOneValue1")] - [GoodStrongMetadata] - [ExportMetadata("ConflictedOne2", "ConflictedOne2Value2")] - [ExportMetadata("RepeatedMetadata", "RepeatedMetadataValue1")] - [ExportMetadata("RepeatedMetadata", "RepeatedMetadataValue2")] - [BadStrongMetadata] - [ExportMetadata("InvalidCollection", "InvalidCollectionValue1")] - [ExportMetadata("InvalidCollection", "InvalidCollectionValue2", IsMultiple = true)] - [BadStrongMetadata] - [ExportMetadata("GoodOne1", "GoodOneValue1")] - public double DoSomething() { return 0.618; } - } - - [Export] - [ExportMetadata("DuplicateMetadataName", "My Name")] - [ExportMetadata("DuplicateMetadataName", "Your Name")] - [PartNotDiscoverable] - public class ClassWithInvalidDuplicateMetadataOnType - { - - } - - [TestMethod] - public void InvalidDuplicateMetadataOnType_ShouldThrow() - { - var part = AttributedModelServices.CreatePart(new ClassWithInvalidDuplicateMetadataOnType()); - var export = part.ExportDefinitions.First(); - var ex = ExceptionAssert.Throws(RetryMode.DoNotRetry, () => - { - var metadata = export.Metadata; - }); - - Assert.IsTrue(ex.Message.Contains("DuplicateMetadataName")); - } - - [PartNotDiscoverable] - public class ClassWithInvalidDuplicateMetadataOnMember - { - [Export] - [ExportMetadata("DuplicateMetadataName", "My Name")] - [ExportMetadata("DuplicateMetadataName", "Your Name")] - public ClassWithDuplicateMetadataOnMember Member { get; set; } - } - - [TestMethod] - public void InvalidDuplicateMetadataOnMember_ShouldThrow() - { - var part = AttributedModelServices.CreatePart(new ClassWithInvalidDuplicateMetadataOnMember()); - var export = part.ExportDefinitions.First(); - - var ex = ExceptionAssert.Throws(RetryMode.DoNotRetry, () => - { - var metadata = export.Metadata; - }); - - Assert.IsTrue(ex.Message.Contains("DuplicateMetadataName")); - } - - [Export] - [ExportMetadata("DuplicateMetadataName", "My Name", IsMultiple=true)] - [ExportMetadata("DuplicateMetadataName", "Your Name", IsMultiple=true)] - public class ClassWithValidDuplicateMetadataOnType - { - - } - - [TestMethod] - public void ValidDuplicateMetadataOnType_ShouldDiscoverAllMetadata() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new ClassWithValidDuplicateMetadataOnType()); - - container.Compose(batch); - - var export = container.GetExport>(); - - var names = export.Metadata["DuplicateMetadataName"] as string[]; - - Assert.AreEqual(2, names.Length); - } - - public class ClassWithDuplicateMetadataOnMember - { - [Export] - [ExportMetadata("DuplicateMetadataName", "My Name", IsMultiple=true)] - [ExportMetadata("DuplicateMetadataName", "Your Name", IsMultiple=true)] - public ClassWithDuplicateMetadataOnMember Member { get; set; } - } - - [TestMethod] - public void ValidDuplicateMetadataOnMember_ShouldDiscoverAllMetadata() - { - var container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new ClassWithDuplicateMetadataOnMember()); - - container.Compose(batch); - - var export = container.GetExport>(); - - var names = export.Metadata["DuplicateMetadataName"] as string[]; - - Assert.AreEqual(2, names.Length); - } - - [Export] - [ExportMetadata(CompositionConstants.PartCreationPolicyMetadataName, "My Policy")] - [PartNotDiscoverable] - public class ClassWithReservedMetadataValue - { - - } - - [TestMethod] - public void InvalidMetadata_UseOfReservedName_ShouldThrow() - { - var part = AttributedModelServices.CreatePart(new ClassWithReservedMetadataValue()); - var export = part.ExportDefinitions.First(); - - var ex = ExceptionAssert.Throws(RetryMode.DoNotRetry, () => - { - var metadata = export.Metadata; - }); - - Assert.IsTrue(ex.Message.Contains(CompositionConstants.PartCreationPolicyMetadataName)); - } - - #endregion - - #region Tests for weakly supported metadata as part of contract - - [TestMethod] - [WorkItem(468388)] - [Ignore] - public void FailureImportForNoRequiredMetadatForExportCollection() - { - CompositionContainer container = ContainerFactory.Create(); - - MyImporterWithExportCollection importer; - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new MyExporterWithNoMetadata()); - batch.AddPart(importer = new MyImporterWithExportCollection()); - - Assert.Fail(); - - //var result = container.TryCompose(); - - //Assert.IsTrue(result.Succeeded, "Composition should be successful because collection import is not required"); - //Assert.AreEqual(1, result.Issues.Count, "There should be one issue reported"); - //Assert.IsTrue(result.Issues[0].Description.Contains("Foo"), "The missing required metadata is 'Foo'"); - } - - [TestMethod] - [WorkItem(472538)] - [Ignore] - public void FailureImportForNoRequiredMetadataThroughComponentCatalogTest() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - FailureImportForNoRequiredMetadataThroughCatalog(container); - } - - private void FailureImportForNoRequiredMetadataThroughCatalog(CompositionContainer container) - { - Assert.Fail("This needs to be fixed, see: 472538"); - - //var export1 = container.GetExport(); - - //export1.TryGetExportedValue().VerifyFailure(CompositionIssueId.RequiredMetadataNotFound, CompositionIssueId.CardinalityMismatch); - - //var export2 = container.GetExport(); - //export2.TryGetExportedValue().VerifySuccess(CompositionIssueId.RequiredMetadataNotFound); - - //container.TryGetExportedValue().VerifyFailure(CompositionIssueId.RequiredMetadataNotFound, CompositionIssueId.CardinalityMismatch); - } - - [TestMethod] - [WorkItem(468388)] - [Ignore] - public void SelectiveImportBasedOnMetadataForExport() - { - CompositionContainer container = ContainerFactory.Create(); - - MyImporterWithExportForSelectiveImport importer; - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new MyExporterWithNoMetadata()); - batch.AddPart(new MyExporterWithMetadata()); - batch.AddPart(importer = new MyImporterWithExportForSelectiveImport()); - - Assert.Fail(); - //var result = container.TryCompose(); - - //Assert.IsTrue(result.Succeeded, "Composition should be successfull because one of two exports meets both the contract name and metadata requirement"); - //Assert.AreEqual(1, result.Issues.Count, "There should be one issue reported about the export who has no required metadata"); - //Assert.IsTrue(result.Issues[0].Description.Contains("Foo"), "The missing required metadata is 'Foo'"); - //Assert.IsNotNull(importer.ValueInfo, "The import should really get bound"); - } - - [TestMethod] - [WorkItem(468388)] - [Ignore] - public void SelectiveImportBasedOnMetadataForExportCollection() - { - CompositionContainer container = ContainerFactory.Create(); - - MyImporterWithExportCollectionForSelectiveImport importer; - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new MyExporterWithNoMetadata()); - batch.AddPart(new MyExporterWithMetadata()); - batch.AddPart(importer = new MyImporterWithExportCollectionForSelectiveImport()); - - Assert.Fail(); - - //var result = container.TryCompose(); - - //Assert.IsTrue(result.Succeeded, "Composition should be successfull in anyway for collection import"); - //Assert.AreEqual(1, result.Issues.Count, "There should be one issue reported however, about the export who has no required metadata"); - //Assert.IsTrue(result.Issues[0].Description.Contains("Foo"), "The missing required metadata is 'Foo'"); - //Assert.AreEqual(1, importer.ValueInfoCol.Count, "The export with required metadata should get bound"); - //Assert.IsNotNull(importer.ValueInfoCol[0], "The import should really get bound"); - } - - - [TestMethod] - [WorkItem(472538)] - [Ignore] - public void SelectiveImportBasedOnMetadataThruoughComponentCatalogTest() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - SelectiveImportBasedOnMetadataThruoughCatalog(container); - } - - private void SelectiveImportBasedOnMetadataThruoughCatalog(CompositionContainer container) - { - Assert.Fail("This needs to be fixed, see: 472538"); - - //var export1 = container.GetExport(); - //export1.TryGetExportedValue().VerifySuccess(CompositionIssueId.RequiredMetadataNotFound); - - //var export2 = container.GetExport(); - //export2.TryGetExportedValue().VerifySuccess(CompositionIssueId.RequiredMetadataNotFound); - } - - [TestMethod] - public void ChildParentContainerTest1() - { - CompositionContainer parent = ContainerFactory.Create(); - CompositionContainer child = new CompositionContainer(parent); - - CompositionBatch childBatch = new CompositionBatch(); - CompositionBatch parentBatch = new CompositionBatch(); - parentBatch.AddPart(new MyExporterWithNoMetadata()); - childBatch.AddPart(new MyExporterWithMetadata()); - parent.Compose(parentBatch); - child.Compose(childBatch); - - var exports = child.GetExports(CreateImportDefinition(typeof(IMyExporter), "Foo")); - - Assert.AreEqual(1, exports.Count()); - } - - [TestMethod] - public void ChildParentContainerTest2() - { - CompositionContainer parent = ContainerFactory.Create(); - CompositionContainer child = new CompositionContainer(parent); - - CompositionBatch childBatch = new CompositionBatch(); - CompositionBatch parentBatch = new CompositionBatch(); - parentBatch.AddPart(new MyExporterWithMetadata()); - childBatch.AddPart(new MyExporterWithNoMetadata()); - parent.Compose(parentBatch); - - var exports = child.GetExports(CreateImportDefinition(typeof(IMyExporter), "Foo")); - - Assert.AreEqual(1, exports.Count()); - } - - [TestMethod] - public void ChildParentContainerTest3() - { - CompositionContainer parent = ContainerFactory.Create(); - CompositionContainer child = new CompositionContainer(parent); - - CompositionBatch childBatch = new CompositionBatch(); - CompositionBatch parentBatch = new CompositionBatch(); - - parentBatch.AddPart(new MyExporterWithMetadata()); - childBatch.AddPart(new MyExporterWithMetadata()); - parent.Compose(parentBatch); - child.Compose(childBatch); - - var exports = child.GetExports(CreateImportDefinition(typeof(IMyExporter), "Foo")); - - Assert.AreEqual(2, exports.Count(), "There should be two from child and parent container each"); - } - - private static ImportDefinition CreateImportDefinition(Type type, string metadataKey) - { - return new ContractBasedImportDefinition(AttributedModelServices.GetContractName(typeof(IMyExporter)), null, new KeyValuePair[] { new KeyValuePair(metadataKey, typeof(object))}, ImportCardinality.ZeroOrMore, true, true, CreationPolicy.Any); - } - - #endregion - - #region Tests for strongly typed metadata as part of contract - - [TestMethod] - [WorkItem(468388)] - [Ignore] - public void SelectiveImportBySTM_Export() - { - CompositionContainer container = ContainerFactory.Create(); - CompositionBatch batch = new CompositionBatch(); - - MyImporterWithExportStronglyTypedMetadata importer; - batch.AddPart(new MyExporterWithNoMetadata()); - batch.AddPart(new MyExporterWithMetadata()); - batch.AddPart(importer = new MyImporterWithExportStronglyTypedMetadata()); - - Assert.Fail(); - - //var result = container.TryCompose(); - - //Assert.IsTrue(result.Succeeded, "Composition should be successful becasue one of two exports does not have required metadata"); - //Assert.AreEqual(1, result.Issues.Count, "There should be an issue reported about the export who has no required metadata"); - //Assert.IsNotNull(importer.ValueInfo, "The valid export should really get bound"); - //Assert.AreEqual("Bar", importer.ValueInfo.Metadata.Foo, "The value of metadata 'Foo' should be 'Bar'"); - } - - [TestMethod] - [WorkItem(468388)] - [Ignore] - public void SelectiveImportBySTM_ExportCollection() - { - CompositionContainer container = ContainerFactory.Create(); - - MyImporterWithExportCollectionStronglyTypedMetadata importer; - CompositionBatch batch = new CompositionBatch(); - - batch.AddPart(new MyExporterWithNoMetadata()); - batch.AddPart(new MyExporterWithMetadata()); - batch.AddPart(importer = new MyImporterWithExportCollectionStronglyTypedMetadata()); - - Assert.Fail(); - - //var result = container.TryCompose(); - - //Assert.IsTrue(result.Succeeded, "Collection import should be successful in anyway"); - //Assert.AreEqual(1, result.Issues.Count, "There should be an issue reported about the export with no required metadata"); - //Assert.AreEqual(1, importer.ValueInfoCol.Count, "There should be only one export got bound"); - //Assert.AreEqual("Bar", importer.ValueInfoCol.First().Metadata.Foo, "The value of metadata 'Foo' should be 'Bar'"); - } - - [TestMethod] - public void SelectiveImportBySTMThroughComponentCatalog1() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - SelectiveImportBySTMThroughCatalog1(container); - } - - public void SelectiveImportBySTMThroughCatalog1(CompositionContainer container) - { - Assert.IsNotNull(container.GetExport()); - - var result2 = container.GetExports(); - } - - [TestMethod] - [WorkItem(468388)] - [Ignore] - public void SelectiveImportBySTMThroughComponentCatalog2() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - SelectiveImportBySTMThroughCatalog2(container); - } - - public void SelectiveImportBySTMThroughCatalog2(CompositionContainer container) - { - Assert.Fail("This needs to be fixed, see: 472538"); - - //var export1 = container.GetExport(); - //var result1 = export1.TryGetExportedValue().VerifySuccess(CompositionIssueId.RequiredMetadataNotFound); - //Assert.IsNotNull(result1.Value.ValueInfo, "The valid export should really get bound"); - //Assert.AreEqual("Bar", result1.Value.ValueInfo.Metadata.Foo, "The value of metadata 'Foo' should be 'Bar'"); - - //var export2 = container.GetExport(); - //var result2 = export2.TryGetExportedValue().VerifySuccess(CompositionIssueId.RequiredMetadataNotFound); - //Assert.AreEqual(1, result2.Value.ValueInfoCol.Count, "There should be only one export got bound"); - //Assert.AreEqual("Bar", result2.Value.ValueInfoCol.First().Metadata.Foo, "The value of metadata 'Foo' should be 'Bar'"); - } - - [TestMethod] - public void TestMultipleStronglyTypedAttributes() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - - var export = container.GetExport(); - EnumerableAssert.AreEqual(export.Metadata.OptionNames.OrderBy(s => s), "name1", "name2", "name3"); - EnumerableAssert.AreEqual(export.Metadata.OptionValues.OrderBy(o => o.ToString()), "value1", "value2", "value3"); - } - - [TestMethod] - public void TestMultipleStronglyTypedAttributesAsIEnumerable() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - - var export = container.GetExport(); - EnumerableAssert.AreEqual(export.Metadata.OptionNames.OrderBy(s => s), "name1", "name2", "name3"); - EnumerableAssert.AreEqual(export.Metadata.OptionValues.OrderBy(o => o.ToString()), "value1", "value2", "value3"); - } - - [TestMethod] - public void TestMultipleStronglyTypedAttributesAsArray() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - - var export = container.GetExport(); - EnumerableAssert.AreEqual(export.Metadata.OptionNames.OrderBy(s => s), "name1", "name2", "name3"); - EnumerableAssert.AreEqual(export.Metadata.OptionValues.OrderBy(o => o.ToString()), "value1", "value2", "value3"); - } - - [TestMethod] - public void TestMultipleStronglyTypedAttributesWithInvalidType() - { - var container = ContainerFactory.CreateWithDefaultAttributedCatalog(); - - // IMyOption2 actually contains all the correct properties but just the wrong types. This should cause us to not match the exports by metadata - var exports = container.GetExports(); - Assert.AreEqual(0, exports.Count()); - } - - [TestMethod] - public void TestOptionalMetadataValueTypeMismatch() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(OptionalFooIsInt)); - var exports = container.GetExports(); - Assert.AreEqual(1, exports.Count()); - var export = exports.Single(); - Assert.AreEqual(null, export.Metadata.OptionalFoo); - } - - #endregion - - - [ExportMetadata("Name", "FromBaseType")] - public abstract class BaseClassWithMetadataButNoExport - { - } - - [Export(typeof(BaseClassWithMetadataButNoExport))] - public class DerivedClassWithExportButNoMetadata : BaseClassWithMetadataButNoExport - { - } - - [TestMethod] - public void Metadata_BaseClassWithMetadataButNoExport() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(BaseClassWithMetadataButNoExport), - typeof(DerivedClassWithExportButNoMetadata)); - - var export = container.GetExport>(); - - Assert.IsFalse(export.Metadata.ContainsKey("Name"), "Export should only contain metadata from the derived!"); - } - - [InheritedExport(typeof(BaseClassWithExportButNoMetadata))] - public abstract class BaseClassWithExportButNoMetadata - { - } - - - [ExportMetadata("Name", "FromDerivedType")] - public class DerivedClassMetadataButNoExport : BaseClassWithExportButNoMetadata - { - } - - [TestMethod] - public void Metadata_BaseClassWithExportButNoMetadata() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(BaseClassWithExportButNoMetadata), - typeof(DerivedClassMetadataButNoExport)); - - var export = container.GetExport>(); - - Assert.IsFalse(export.Metadata.ContainsKey("Name"), "Export should only contain metadata from the base!"); - } - - [Export(typeof(BaseClassWithExportAndMetadata))] - [ExportMetadata("Name", "FromBaseType")] - public class BaseClassWithExportAndMetadata - { - } - - [Export(typeof(DerivedClassWithExportAndMetadata))] - [ExportMetadata("Name", "FromDerivedType")] - public class DerivedClassWithExportAndMetadata : BaseClassWithExportAndMetadata - { - } - - [TestMethod] - public void Metadata_BaseAndDerivedWithExportAndMetadata() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(BaseClassWithExportAndMetadata), - typeof(DerivedClassWithExportAndMetadata)); - - var exportBase = container.GetExport>(); - - Assert.AreEqual("FromBaseType", exportBase.Metadata["Name"]); - - var exportDerived = container.GetExport>(); - Assert.AreEqual("FromDerivedType", exportDerived.Metadata["Name"]); - } - - [Export] - [ExportMetadata("Data", null, IsMultiple=true)] - [ExportMetadata("Data", false, IsMultiple=true)] - [ExportMetadata("Data", Int16.MaxValue, IsMultiple = true)] - [ExportMetadata("Data", Int32.MaxValue, IsMultiple = true)] - [ExportMetadata("Data", Int64.MaxValue, IsMultiple = true)] - [ExportMetadata("Data", UInt16.MaxValue, IsMultiple = true)] - [ExportMetadata("Data", UInt32.MaxValue, IsMultiple = true)] - [ExportMetadata("Data", UInt64.MaxValue, IsMultiple = true)] - [ExportMetadata("Data", "String", IsMultiple = true)] - [ExportMetadata("Data", typeof(ClassWithLotsOfDifferentMetadataTypes), IsMultiple = true)] - [ExportMetadata("Data", CreationPolicy.NonShared, IsMultiple=true)] - [ExportMetadata("Data", new object[] { 1, 2, null }, IsMultiple=true)] - [CLSCompliant(false)] - public class ClassWithLotsOfDifferentMetadataTypes - { - } - - [TestMethod] - public void ExportWithValidCollectionOfMetadata_ShouldDiscoverAllMetadata() - { - var catalog = CatalogFactory.CreateAttributed(typeof(ClassWithLotsOfDifferentMetadataTypes)); - - var export = catalog.Parts.First().ExportDefinitions.First(); - - var data = (object[])export.Metadata["Data"]; - - Assert.AreEqual(12, data.Length); - } - - [Export] - [ExportMetadata("Data", null, IsMultiple = true)] - [ExportMetadata("Data", 1, IsMultiple = true)] - [ExportMetadata("Data", 2, IsMultiple = true)] - [ExportMetadata("Data", 3, IsMultiple = true)] - public class ClassWithIntCollectionWithNullValue - { - } - - [TestMethod] - public void ExportWithIntCollectionPlusNullValueOfMetadata_ShouldDiscoverAllMetadata() - { - var catalog = CatalogFactory.CreateAttributed(typeof(ClassWithIntCollectionWithNullValue)); - - var export = catalog.Parts.First().ExportDefinitions.First(); - - var data = (object[])export.Metadata["Data"]; - - Assert.IsNotInstanceOfType(data, typeof(int[])); - - Assert.AreEqual(4, data.Length); - } - - [AttributeUsage(AttributeTargets.Class, AllowMultiple=true)] - [MetadataAttribute] - public class DataAttribute : Attribute - { - public object Object { get; set; } - } - - [Export] - [Data(Object="42")] - [Data(Object = "10")] - public class ExportWithMultipleMetadata_ExportStringsAsObjects - { - } - - [Export] - [Data(Object = "42")] - [Data(Object = "10")] - [Data(Object = null)] - public class ExportWithMultipleMetadata_ExportStringsAsObjects_WithNull - { - } - - [Export] - [Data(Object = 42)] - [Data(Object = 10)] - public class ExportWithMultipleMetadata_ExportIntsAsObjects - { - } - - [Export] - [Data(Object = null)] - [Data(Object = 42)] - [Data(Object = 10)] - public class ExportWithMultipleMetadata_ExportIntsAsObjects_WithNull - { - } - - public interface IObjectView_AsStrings - { - string[] Object { get; } - } - - public interface IObjectView_AsInts - { - int[] Object { get; } - } - - public interface IObjectView - { - object[] Object { get; } - } - - - [TestMethod] - public void ExportWithMultipleMetadata_ExportStringsAsObjects_ShouldDiscoverMetadataAsStrings() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new ExportWithMultipleMetadata_ExportStringsAsObjects()); - - var export = container.GetExport(); - Assert.IsNotNull(export); - - Assert.IsNotNull(export.Metadata); - Assert.IsNotNull(export.Metadata.Object); - Assert.AreEqual(2, export.Metadata.Object.Length); - } - - [TestMethod] - public void ExportWithMultipleMetadata_ExportStringsAsObjects_With_Null_ShouldDiscoverMetadataAsStrings() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new ExportWithMultipleMetadata_ExportStringsAsObjects_WithNull()); - - var export = container.GetExport(); - Assert.IsNotNull(export); - - Assert.IsNotNull(export.Metadata); - Assert.IsNotNull(export.Metadata.Object); - Assert.AreEqual(3, export.Metadata.Object.Length); - } - - [TestMethod] - public void ExportWithMultipleMetadata_ExportIntsAsObjects_ShouldDiscoverMetadataAsInts() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new ExportWithMultipleMetadata_ExportIntsAsObjects()); - - var export = container.GetExport(); - Assert.IsNotNull(export); - - Assert.IsNotNull(export.Metadata); - Assert.IsNotNull(export.Metadata.Object); - Assert.AreEqual(2, export.Metadata.Object.Length); - } - - [TestMethod] - public void ExportWithMultipleMetadata_ExportIntsAsObjects_With_Null_ShouldDiscoverMetadataAsObjects() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new ExportWithMultipleMetadata_ExportIntsAsObjects_WithNull()); - - var exports = container.GetExports(); - Assert.IsFalse(exports.Any()); - - var export = container.GetExport(); - - Assert.IsNotNull(export.Metadata); - Assert.IsNotNull(export.Metadata.Object); - Assert.AreEqual(3, export.Metadata.Object.Length); - } - - [MetadataAttribute] - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] - public class OrderAttribute : Attribute - { - public string Before { get; set; } - public string After { get; set; } - } - - public interface IOrderMetadataView - { - string[] Before { get; } - string[] After { get; } - } - - [Export] - [Order(Before = "Step3")] - [Order(Before = "Step2")] - public class OrderedItemBeforesOnly - { - } - - [TestMethod] - public void ExportWithMultipleMetadata_ExportStringsAndNulls_ThroughMetadataAttributes() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new OrderedItemBeforesOnly()); - - var export = container.GetExport(); - Assert.IsNotNull(export); - - Assert.IsNotNull(export.Metadata); - - Assert.IsNotNull(export.Metadata.Before); - Assert.IsNotNull(export.Metadata.After); - - Assert.AreEqual(2, export.Metadata.Before.Length); - Assert.AreEqual(2, export.Metadata.After.Length); - - Assert.IsNotNull(export.Metadata.Before[0]); - Assert.IsNotNull(export.Metadata.Before[1]); - - Assert.IsNull(export.Metadata.After[0]); - Assert.IsNull(export.Metadata.After[1]); - } - - [MetadataAttribute] - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] - public class DataTypeAttribute : Attribute - { - public Type Type { get; set; } - } - - public interface ITypesMetadataView - { - Type[] Type { get; } - } - - [Export] - [DataType(Type = typeof(int))] - [DataType(Type = typeof(string))] - public class ItemWithTypeExports - { - } - - [Export] - [DataType(Type = typeof(int))] - [DataType(Type = typeof(string))] - [DataType(Type = null)] - public class ItemWithTypeExports_WithNulls - { - } - - [Export] - [DataType(Type = null)] - [DataType(Type = null)] - [DataType(Type = null)] - public class ItemWithTypeExports_WithAllNulls - { - } - - [TestMethod] - public void ExportWithMultipleMetadata_ExportTypes() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new ItemWithTypeExports()); - - var export = container.GetExport(); - - Assert.IsNotNull(export.Metadata); - Assert.IsNotNull(export.Metadata.Type); - Assert.AreEqual(2, export.Metadata.Type.Length); - } - - [TestMethod] - public void ExportWithMultipleMetadata_ExportTypes_WithNulls() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new ItemWithTypeExports_WithNulls()); - - var export = container.GetExport(); - - Assert.IsNotNull(export.Metadata); - Assert.IsNotNull(export.Metadata.Type); - Assert.AreEqual(3, export.Metadata.Type.Length); - } - - [TestMethod] - public void ExportWithMultipleMetadata_ExportTypes_WithAllNulls() - { - var container = ContainerFactory.Create(); - container.ComposeParts(new ItemWithTypeExports_WithAllNulls()); - - var export = container.GetExport(); - - Assert.IsNotNull(export.Metadata); - Assert.IsNotNull(export.Metadata.Type); - Assert.AreEqual(3, export.Metadata.Type.Length); - - Assert.IsNull(export.Metadata.Type[0]); - Assert.IsNull(export.Metadata.Type[1]); - Assert.IsNull(export.Metadata.Type[2]); - } - [Export] - [ExportMetadata(null, "ValueOfNullKey")] - public class ClassWithNullMetadataKey - { - } - - [TestMethod] - public void ExportMetadataWithNullKey_ShouldUseEmptyString() - { - var nullMetadataCatalog = CatalogFactory.CreateAttributed(typeof(ClassWithNullMetadataKey)); - var nullMetadataExport = nullMetadataCatalog.Parts.Single().ExportDefinitions.Single(); - - Assert.IsTrue(nullMetadataExport.Metadata.ContainsKey(string.Empty)); - Assert.AreEqual("ValueOfNullKey", nullMetadataExport.Metadata[string.Empty]); - } - - } - - - - - - // Tests for metadata issues on export - - [Export] - [ExportMetadata("foo", "bar1", IsMultiple = true)] - [ExportMetadata("foo", "bar2", IsMultiple = true)] - [ExportMetadata("acme", "acmebar", IsMultiple = true)] - [ExportMetadata("acme", 2.0, IsMultiple = true)] - [ExportMetadata("hello", "world")] - [GoodStrongMetadata] - public class MyExporterWithValidMetadata - { - [Export("ContractForValidMetadata")] - [ExportMetadata("bar", "foo1", IsMultiple = true)] - [ExportMetadata("bar", "foo2", IsMultiple = true)] - [ExportMetadata("stuff", "acmebar", IsMultiple = true)] - [ExportMetadata("stuff", 2.0, IsMultiple = true)] - [ExportMetadata("world", "hello")] // the order of the attribute should not affect the result - [GoodStrongMetadata] - public double DoSomething() { return 0.618; } - } - - [AttributeUsage(AttributeTargets.All, AllowMultiple = false)] - [MetadataAttribute] - public class GoodStrongMetadata : Attribute - { - public string GoodOne2 { get { return "GoodOneValue2"; } } - public string ConflictedOne1 { get { return "ConflictedOneValue1"; } } - public string ConflictedOne2 { get { return "ConflictedOneValue2"; } } - } - - // Tests for metadata as part of contract - - public interface IMyExporter { } - - [Export] - [Export(typeof(IMyExporter))] - public class MyExporterWithNoMetadata : IMyExporter - { - } - - [Export] - [Export(typeof(IMyExporter))] - [ExportMetadata("Foo", "Bar")] - public class MyExporterWithMetadata : IMyExporter - { - } - - - public interface IMetadataFoo - { - string Foo { get; } - } - - public interface IMetadataBar - { - string Bar { get; } - } - - [Export] - public class MyImporterWithExport - { - [Import(typeof(MyExporterWithNoMetadata))] - public Lazy ValueInfo { get; set; } - } - - [Export] - public class SingleImportWithAllowDefault - { - [Import("Import", AllowDefault = true)] - public Lazy Import { get; set; } - } - - [Export] - public class SingleImport - { - [Import("Import")] - public Lazy Import { get; set; } - } - - public interface IFooMetadataView - { - string Foo { get; } - } - - [Export] - public class MyImporterWithExportCollection - { - [ImportMany(typeof(MyExporterWithNoMetadata))] - public IEnumerable> ValueInfoCol { get; set; } - } - - [Export] - public class MyImporterWithExportForSelectiveImport - { - [Import] - public Lazy ValueInfo { get; set; } - } - - [Export] - public class MyImporterWithExportCollectionForSelectiveImport - { - [ImportMany] - public Collection> ValueInfoCol { get; set; } - } - - public interface IMetadataView - { - string Foo { get; } - - [System.ComponentModel.DefaultValue(null)] - string OptionalFoo { get; } - } - - [Export] - [ExportMetadata("Foo", "fooValue3")] - [ExportMetadata("OptionalFoo", 42)] - public class OptionalFooIsInt { } - - [Export] - public class MyImporterWithExportStronglyTypedMetadata - { - [Import] - public Lazy ValueInfo { get; set; } - } - - [Export] - public class MyImporterWithExportCollectionStronglyTypedMetadata - { - [ImportMany] - public Collection> ValueInfoCol { get; set; } - } - - public class MyExporterWithFullMetadata - { - [Export("MyStringContract")] - public string String1 { get { return "String1"; } } - - [Export("MyStringContract")] - [ExportMetadata("Foo", "fooValue")] - public string String2 { get { return "String2"; } } - - [Export("MyStringContract")] - [ExportMetadata("Bar", "barValue")] - public string String3 { get { return "String3"; } } - - [Export("MyStringContract")] - [ExportMetadata("Foo", "fooValue")] - [ExportMetadata("Bar", "barValue")] - public string String4 { get { return "String4"; } } - } - - [MetadataAttribute] - [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] - public class MyOption : Attribute - { - public MyOption(string name, object value) - { - OptionNames = name; - OptionValues = value; - } - public string OptionNames { get; set; } - public object OptionValues { get; set; } - } - - public interface IMyOptions - { - IList OptionNames { get; } - ICollection OptionValues { get; } - } - - public interface IMyOptionsAsIEnumerable - { - IEnumerable OptionNames { get; } - IEnumerable OptionValues { get; } - } - - public interface IMyOptionsAsArray - { - string[] OptionNames { get; } - string[] OptionValues { get; } - } - - [Export] - [MyOption("name1", "value1")] - [MyOption("name2", "value2")] - [ExportMetadata("OptionNames", "name3", IsMultiple = true)] - [ExportMetadata("OptionValues", "value3", IsMultiple = true)] - public class ExportMultiple - { - } - - public interface IMyOption2 - { - string OptionNames { get; } - string OptionValues { get; } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MetadataViewProviderTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MetadataViewProviderTests.cs deleted file mode 100644 index 862402cd1b2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MetadataViewProviderTests.cs +++ /dev/null @@ -1,401 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Reflection; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class MetadataViewProviderTests - { - - [TestMethod] - public void GetMetadataView_InterfaceWithPropertySetter_ShouldThrowNotSupported() - { - var metadata = new Dictionary(); - metadata["Value"] = "value"; - - ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(metadata); - }); - } - - [TestMethod] - public void GetMetadataView_InterfaceWithMethod_ShouldThrowNotSupportedException() - { - var metadata = new Dictionary(); - metadata["Value"] = "value"; - - ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(metadata); - }); - } - - [TestMethod] - public void GetMetadataView_InterfaceWithEvent_ShouldThrowNotSupportedException() - { - var metadata = new Dictionary(); - metadata["Value"] = "value"; - - ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(metadata); - }); - } - - [TestMethod] - public void GetMetadataView_InterfaceWithIndexer_ShouldThrowNotSupportedException() - { - var metadata = new Dictionary(); - metadata["Value"] = "value"; - - ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(metadata); - }); - } - - [TestMethod] - public void GetMetadataView_AbstractClass_ShouldThrowMissingMethodException() - { - var metadata = new Dictionary(); - metadata["Value"] = "value"; - - ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(metadata); - }); - } - - [TestMethod] - public void GetMetadataView_AbstractClassWithConstructor_ShouldThrowMemberAccessException() - { - var metadata = new Dictionary(); - metadata["Value"] = "value"; - - ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(metadata); - }); - } - - [TestMethod] - public void GetMetadataView_IDictionaryAsTMetadataViewTypeArgument_ShouldReturnMetadata() - { - var metadata = new Dictionary(); - - var result = MetadataViewProvider.GetMetadataView>(metadata); - - Assert.AreSame(metadata, result); - } - - [TestMethod] - public void GetMetadataView_IEnumerableAsTMetadataViewTypeArgument_ShouldReturnMetadata() - { - var metadata = new Dictionary(); - - var result = MetadataViewProvider.GetMetadataView>>(metadata); - - Assert.AreSame(metadata, result); - } - - - [TestMethod] - public void GetMetadataView_DictionaryAsTMetadataViewTypeArgument_ShouldNotThrow() - { - var metadata = new Dictionary(); - MetadataViewProvider.GetMetadataView>(metadata); - } - - [TestMethod] - public void GetMetadataView_PrivateInterfaceAsTMetadataViewTypeArgument_ShouldhrowNotSupportedException() - { - var metadata = new Dictionary(); - metadata["CanActivate"] = true; - - ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(metadata); - }); - } - - [TestMethod] - public void GetMetadataView_DictionaryWithUncastableValueAsMetadataArgument_ShouldThrowCompositionContractMismatchException() - { - var metadata = new Dictionary(); - metadata["Value"] = true; - - ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(metadata); - }); - } - - [TestMethod] - public void GetMetadataView_InterfaceWithTwoPropertiesWithSameNameDifferentTypeAsTMetadataViewArgument_ShouldThrowContractMismatch() - { - var metadata = new Dictionary(); - metadata["Value"] = 10; - - ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(metadata); - }); - } - - [TestMethod] - public void GetMetadataView_RawMetadata() - { - var metadata = new Dictionary(); - metadata["Value"] = 10; - - var view = MetadataViewProvider.GetMetadataView(new Dictionary(metadata)); - - Assert.IsTrue(view.Count == metadata.Count); - Assert.IsTrue(view["Value"] == metadata["Value"]); - } - - [TestMethod] - public void GetMetadataView_InterfaceInheritance() - { - var metadata = new Dictionary(); - metadata["Value"] = "value"; - metadata["Value2"] = "value2"; - - var view = MetadataViewProvider.GetMetadataView(metadata); - Assert.AreEqual("value", view.Value); - Assert.AreEqual("value2", view.Value2); - } - - - [TestMethod] - public void GetMetadataView_CachesViewType() - { - var metadata1 = new Dictionary(); - metadata1["Value"] = "value1"; - var view1 = MetadataViewProvider.GetMetadataView(metadata1); - Assert.AreEqual("value1", view1.Value); - - var metadata2 = new Dictionary(); - metadata2["Value"] = "value2"; - var view2 = MetadataViewProvider.GetMetadataView(metadata2); - Assert.AreEqual("value2", view2.Value); - - Assert.AreEqual(view1.GetType(), view2.GetType()); - } - - private interface IActivator - { - bool CanActivate - { - get; - } - } - public class RawMetadata : Dictionary - { - public RawMetadata(IDictionary dictionary) : base(dictionary) { } - } - - public interface IMetadataView - { - string Value - { - get; - } - } - - public interface IMetadataView2 : IMetadataView - { - new int Value - { - get; - } - } - - public interface IMetadataView3 : IMetadataView - { - string Value2 - { - get; - } - } - - public interface IMetadataViewWithPropertySetter - { - string Value - { - get; - set; - } - } - - public interface IMetadataViewWithMethod - { - string Value - { - get; - } - void Method(); - } - - public interface IMetadataViewWithEvent - { - string Value - { - get; - } - event EventHandler TestEvent; - } - - public interface IMetadataViewWithIndexer - { - string Value - { - get; - } - string this[object o] { get; } - } - - public abstract class AbstractClassMetadataView - { - public abstract object Value { get; } - } - - public abstract class AbstractClassWithConstructorMetadataView - { - public AbstractClassWithConstructorMetadataView(IDictionary metadata) {} - public abstract object Value { get; } - } - - public interface IMetadataViewWithDefaultedInt - { - [DefaultValue(120)] - int MyInt { get; } - } - - [TestMethod] - public void GetMetadataView_IMetadataViewWithDefaultedInt() - { - var view = MetadataViewProvider.GetMetadataView(new Dictionary()); - Assert.AreEqual(120, view.MyInt); - } - - - [TestMethod] - public void GetMetadataView_IMetadataViewWithDefaultedIntAndInvalidMetadata() - { - Dictionary metadata = new Dictionary(); - metadata = new Dictionary(); - metadata.Add("MyInt", 1.2); - var view1 = MetadataViewProvider.GetMetadataView(metadata); - Assert.AreEqual(120, view1.MyInt); - - metadata = new Dictionary(); - metadata.Add("MyInt", "Hello, World"); - var view2 = MetadataViewProvider.GetMetadataView(metadata); - Assert.AreEqual(120, view2.MyInt); - } - - - public interface IMetadataViewWithDefaultedBool - { - [DefaultValue(false)] - bool MyBool { get; } - } - - [TestMethod] - public void GetMetadataView_IMetadataViewWithDefaultedBool() - { - var view = MetadataViewProvider.GetMetadataView(new Dictionary()); - Assert.AreEqual(false, view.MyBool); - } - - public interface IMetadataViewWithDefaultedInt64 - { - [DefaultValue(Int64.MaxValue)] - Int64 MyInt64 { get; } - } - - [TestMethod] - public void GetMetadataView_IMetadataViewWithDefaultedInt64() - { - var view = MetadataViewProvider.GetMetadataView(new Dictionary()); - Assert.AreEqual(Int64.MaxValue, view.MyInt64); - } - - public interface IMetadataViewWithDefaultedString - { - [DefaultValue("MyString")] - string MyString { get; } - } - - [TestMethod] - public void GetMetadataView_IMetadataViewWithDefaultedString() - { - var view = MetadataViewProvider.GetMetadataView(new Dictionary()); - Assert.AreEqual("MyString", view.MyString); - } - - public interface IMetadataViewWithTypeMismatchDefaultValue - { - [DefaultValue("Strings can't cast to numbers")] - int MyInt { get; } - } - - [TestMethod] - public void GetMetadataView_IMetadataViewWithTypeMismatchDefaultValue() - { - var exception = ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(new Dictionary()); - }); - - Assert.IsInstanceOfType(exception.InnerException, typeof(TargetInvocationException)); - } - - - public interface IMetadataViewUnboxAsInt - { - int Value { get; } - } - - - [TestMethod] - public void GetMetadataView_IMetadataViewWithTypeMismatchOnUnbox() - { - var metadata = new Dictionary(); - metadata["Value"] = (short)9999; - - var exception = ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(new Dictionary()); - }); - - Assert.IsInstanceOfType(exception.InnerException, typeof(TargetInvocationException)); - } - - public interface IHasInt32 - { - Int32 Value { get; } - } - - [TestMethod] - public void TestMetadataIntConversion() - { - var metadata = new Dictionary(); - metadata["Value"] = (Int64)45; - - var exception = ExceptionAssert.Throws(() => - { - MetadataViewProvider.GetMetadataView(metadata); - }); - } - - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MicroExport.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MicroExport.cs deleted file mode 100644 index 3303f4d2ca7..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/MicroExport.cs +++ /dev/null @@ -1,79 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Hosting; - -namespace System.ComponentModel.Composition -{ - internal class MicroExport - { - public MicroExport(Type contractType, params object[] exportedValues) - : this(AttributedModelServices.GetContractName(contractType), contractType, (IDictionary)null, exportedValues) - { - } - - public MicroExport(string contractName, params object[] exportedValues) - : this(contractName, exportedValues[0].GetType(), (IDictionary)null, exportedValues) - { - } - - public MicroExport(Type contractType, IDictionary metadata, params object[] exportedValues) - : this(AttributedModelServices.GetContractName(contractType), exportedValues[0].GetType(), metadata, exportedValues) - { - } - - public MicroExport(string contractName, Type contractType, params object[] exportedValues) - : this(contractName, contractType, (IDictionary)null, exportedValues) - { - } - - public MicroExport(string contractName, IDictionary metadata, params object[] exportedValues) - : this(contractName, exportedValues[0].GetType(), metadata, exportedValues) - { - } - - public MicroExport(string contractName, Type contractType, IDictionary metadata, params object[] exportedValues) - { - this.ContractName = contractName; - this.ExportedValues = exportedValues; - - if (contractType != null) - { - string typeIdentity = AttributedModelServices.GetTypeIdentity(contractType); - - if (metadata == null) - { - metadata = new Dictionary(); - } - - object val; - if (!metadata.TryGetValue(CompositionConstants.ExportTypeIdentityMetadataName, out val)) - { - metadata.Add(CompositionConstants.ExportTypeIdentityMetadataName, AttributedModelServices.GetTypeIdentity(contractType)); - } - } - this.Metadata = metadata; - } - - public string ContractName - { - get; - private set; - } - - public object[] ExportedValues - { - get; - private set; - } - - public IDictionary Metadata - { - get; - private set; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/PartCreationPolicyAttributeTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/PartCreationPolicyAttributeTests.cs deleted file mode 100644 index cbcac9cafc5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/PartCreationPolicyAttributeTests.cs +++ /dev/null @@ -1,41 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class PartCreationPolicyAttributeTests - { - [TestMethod] - public void Constructor_ShouldSetCreationPolicyToGivenValue() - { - var expectations = Expectations.GetEnumValues(); - - foreach (var e in expectations) - { - var attribute = new PartCreationPolicyAttribute(e); - - Assert.AreEqual(e, attribute.CreationPolicy); - } - } - - [TestMethod] - public void Constructor_OutOfRangeValueAsCreationPolicyArgument_ShouldSetCreationPolicy() - { // Attributes should not throw exceptions - - var expectations = Expectations.GetInvalidEnumValues(); - - foreach (var e in expectations) - { - var attribute = new PartCreationPolicyAttribute(e); - - Assert.AreEqual(e, attribute.CreationPolicy); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/PartMetadataAttributeTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/PartMetadataAttributeTests.cs deleted file mode 100644 index 54722a3c9a3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/PartMetadataAttributeTests.cs +++ /dev/null @@ -1,48 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class PartMetadataAttributeTests - { - [TestMethod] - public void Constructor_NullAsNameArgument_ShouldSetNamePropertyToEmptyString() - { - var attribute = new PartMetadataAttribute((string)null, "Value"); - - Assert.AreEqual(string.Empty, attribute.Name); - } - - [TestMethod] - public void Constructor_ValueAsNameArgument_ShouldSetNameProperty() - { - var expectations = Expectations.GetMetadataNames(); - - foreach (var e in expectations) - { - var attribute = new PartMetadataAttribute(e, "Value"); - - Assert.AreEqual(e, attribute.Name); - } - } - - [TestMethod] - public void Constructor_ValueAsValueArgument_ShouldSetValueProperty() - { - var expectations = Expectations.GetMetadataValues(); - - foreach (var e in expectations) - { - var attribute = new PartMetadataAttribute("Name", e); - - Assert.AreEqual(e, attribute.Value); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/.gitattributes deleted file mode 100644 index 2c06c29c5de..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/.gitattributes +++ /dev/null @@ -1,5 +0,0 @@ -/ComposablePartCatalogDebuggerProxyTests.cs -crlf -/ComposablePartCatalogTests.cs -crlf -/CompositionElementDebuggerProxyTests.cs -crlf -/CompositionElementTests.cs -crlf -/SerializableCompositionElementTests.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxyTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxyTests.cs deleted file mode 100644 index 4bf0be6b52a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxyTests.cs +++ /dev/null @@ -1,63 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; - -namespace System.ComponentModel.Composition.Primitives -{ - [TestClass] - public class ComposablePartCatalogDebuggerProxyTests - { - [TestMethod] - public void Constructor_NullAsCatalogArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("catalog", () => - { - new ComposablePartCatalogDebuggerProxy((ComposablePartCatalog)null); - }); - } - - [TestMethod] - public void Constructor_ValueAsCatalogArgument_ShouldSetPartsProperty() - { - var expectations = Expectations.GetCatalogs(); - foreach (var e in expectations) - { - var proxy = new ComposablePartCatalogDebuggerProxy(e); - - EnumerableAssert.AreSequenceEqual(e.Parts, proxy.Parts); - } - } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void Parts_ShouldNotCacheUnderlyingParts() - { - var catalog = CatalogFactory.CreateAggregateCatalog(); - var proxy = CreateComposablePartCatalogDebuggerProxy(catalog); - - EnumerableAssert.IsEmpty(proxy.Parts); - - var expectations = Expectations.GetCatalogs(); - foreach (var e in expectations) - { - catalog.Catalogs.Add(e); - - EnumerableAssert.AreSequenceEqual(catalog.Parts, proxy.Parts); - - catalog.Catalogs.Remove(e); - } - } - - private ComposablePartCatalogDebuggerProxy CreateComposablePartCatalogDebuggerProxy(ComposablePartCatalog catalog) - { - return new ComposablePartCatalogDebuggerProxy(catalog); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/ComposablePartCatalogTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/ComposablePartCatalogTests.cs deleted file mode 100644 index 73a809fb1d1..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/ComposablePartCatalogTests.cs +++ /dev/null @@ -1,114 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Factories; -using System.Linq; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Linq.Expressions; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ComposablePartCatalogTests - { - [TestMethod] - public void GetExports_WhenDisposed_ShouldThrowObjectDisposed() - { - var catalog = CatalogFactory.Create(); - catalog.Dispose(); - var definition = ImportDefinitionFactory.Create(); - - ExceptionAssert.ThrowsDisposed(catalog, () => - { - catalog.GetExports(definition); - }); - } - - [TestMethod] - public void GetExports_NullAsConstraintArgument_ShouldThrowArgumentNull() - { - var catalog = CatalogFactory.Create(); - - ExceptionAssert.ThrowsArgument("definition", () => - { - catalog.GetExports((ImportDefinition)null); - }); - } - - [TestMethod] - public void Dispose_ShouldNotThrow() - { - var catalog = CatalogFactory.Create(); - catalog.Dispose(); - } - - [TestMethod] - public void Dispose_CanBeCalledMultipleTimes() - { - var catalog = CatalogFactory.Create(); - catalog.Dispose(); - catalog.Dispose(); - catalog.Dispose(); - } - - [TestMethod] - public void Dispose_CallsGCSuppressFinalize() - { - bool finalizerCalled = false; - - var catalog = CatalogFactory.CreateDisposable(disposing => - { - if (!disposing) - { - finalizerCalled = true; - } - - }); - - catalog.Dispose(); - - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); - - Assert.IsFalse(finalizerCalled); - } - - [TestMethod] - public void Dispose_CallsDisposeBoolWithTrue() - { - var catalog = CatalogFactory.CreateDisposable(disposing => - { - Assert.IsTrue(disposing); - }); - - catalog.Dispose(); - } - - [TestMethod] - public void Dispose_CallsDisposeBoolOnce() - { - int disposeCount = 0; - var catalog = CatalogFactory.CreateDisposable(disposing => - { - disposeCount++; - }); - - catalog.Dispose(); - - Assert.AreEqual(1, disposeCount); - } - - private IQueryable GetPartDefinitions(ExportDefinition definition) - { - var partDefinition = PartDefinitionFactory.Create(null, () => null, Enumerable.Empty(), new ExportDefinition[] { definition }); - - return new ComposablePartDefinition[] { partDefinition }.AsQueryable(); - } - } -} - diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/CompositionElementDebuggerProxyTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/CompositionElementDebuggerProxyTests.cs deleted file mode 100644 index f4d69dcbb13..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/CompositionElementDebuggerProxyTests.cs +++ /dev/null @@ -1,76 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Primitives; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.Hosting -{ - [TestClass] - public class CompositionElementDebuggerProxyTests - { - [TestMethod] - public void Constructor_NullAsElementArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("element", () => - { - new CompositionElementDebuggerProxy((CompositionElement)null); - }); - } - - [TestMethod] - public void Constructor_ValueAsElementArgument_ShouldSetDisplayNameProperty() - { - var expectations = Expectations.GetObjectsReferenceTypes(); - - foreach (var e in expectations) - { - var element = CreateCompositionElement(e); - - var proxy = new CompositionElementDebuggerProxy(element); - - Assert.AreSame(element.DisplayName, proxy.DisplayName); - } - } - - [TestMethod] - public void Constructor_ValueAsElementArgument_ShouldSetOriginProperty() - { - var expectations = Expectations.GetObjectsReferenceTypes(); - - foreach (var e in expectations) - { - var element = CreateCompositionElement(e); - - var proxy = new CompositionElementDebuggerProxy(element); - - Assert.AreSame(element.Origin, proxy.Origin); - } - } - - [TestMethod] - public void Constructor_ValueAsElementArgument_ShouldSetUnderlyingObjectProperty() - { - var expectations = Expectations.GetObjectsReferenceTypes(); - - foreach (var e in expectations) - { - var element = CreateCompositionElement(e); - - var proxy = new CompositionElementDebuggerProxy(element); - - Assert.AreSame(element.UnderlyingObject, proxy.UnderlyingObject); - } - } - - private static CompositionElement CreateCompositionElement(object underlyingObject) - { - return new CompositionElement(underlyingObject); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/CompositionElementTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/CompositionElementTests.cs deleted file mode 100644 index e7fdc1346f8..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/CompositionElementTests.cs +++ /dev/null @@ -1,75 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Primitives; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.Hosting -{ - [TestClass] - public class CompositionElementTests - { - [TestMethod] - public void Constructor_ValueAsUnderlyingObjectArgument_ShouldSetUnderlyingObjectProperty() - { - var expectations = Expectations.GetObjectsReferenceTypes(); - - foreach (var e in expectations) - { - var element = new CompositionElement(e); - - Assert.AreSame(e, element.UnderlyingObject); - } - } - - [TestMethod] - public void Constructor_ValueAsUnderlyingObjectArgument_ShouldSetDisplayNamePropertyToUnderlyingObjectToString() - { - var expectations = Expectations.GetObjectsReferenceTypes(); - - foreach (var e in expectations) - { - var element = new CompositionElement(e); - - Assert.AreEqual(e.ToString(), element.DisplayName); - } - } - - [TestMethod] - public void Constructor_ValueAsUnderlyingObjectArgument_ShouldSetOriginToUnknown() - { - var expectations = Expectations.GetObjectsReferenceTypes(); - - foreach (var e in expectations) - { - var element = new CompositionElement(e); - - Assert.IsNotNull(element.Origin); - Assert.IsNull(element.Origin.Origin); - } - } - - [TestMethod] - public void ToString_ShouldReturnDisplayNameProperty() - { - var expectations = Expectations.GetObjectsReferenceTypes(); - - foreach (var e in expectations) - { - var element = CreateCompositionElement(e); - - Assert.AreEqual(element.DisplayName, element.ToString()); - } - } - - private static CompositionElement CreateCompositionElement(object underlyingObject) - { - return new CompositionElement(underlyingObject); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/SerializableCompositionElementTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/SerializableCompositionElementTests.cs deleted file mode 100644 index 4f038de4987..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/Primitives/SerializableCompositionElementTests.cs +++ /dev/null @@ -1,137 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.UnitTesting; -using System.Runtime.Serialization; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.Hosting -{ - [TestClass] - public class SerializableCompositionElementTests - { - [TestMethod] - public void FromICompositionElement_NullAsElementArgument_ShouldReturnNull() - { - var result = SerializableCompositionElement.FromICompositionElement((ICompositionElement)null); - - Assert.IsNull(result); - } - - [TestMethod] - public void FromICompositionElement_ValueWithNullDisplayNameAsElementArgument_ShouldSetDisplayNamePropertyToEmptyString() - { - var element = ElementFactory.Create((string)null); - Assert.IsNull(element.DisplayName); - - var result = SerializableCompositionElement.FromICompositionElement(element); - - Assert.AreEqual(string.Empty, result.DisplayName); - } - - [TestMethod] - public void FromICompositionElement_ValueAsElementArgument_ShouldSetDisplayNameProperty() - { - var expectations = Expectations.GetDisplayNames(); - - foreach (var e in expectations) - { - var element = ElementFactory.Create(e); - - var result = SerializableCompositionElement.FromICompositionElement(element); - - Assert.AreEqual(e, result.DisplayName); - } - } - - [TestMethod] - public void FormICompositionElement_ValueWithNullOriginAsElementArgument_ShouldSetOriginPropertyToNull() - { - var element = ElementFactory.Create((ICompositionElement)null); - Assert.IsNull(element.Origin); - - var result = SerializableCompositionElement.FromICompositionElement(element); - - Assert.IsNull(element.Origin); - } - - [TestMethod] - public void FromICompositionElement_ValueAsElementArgument_ShouldSetOriginProperty() - { - var expectations = Expectations.GetCompositionElements(); - - foreach (var e in expectations) - { - var element = ElementFactory.Create(e); - - var result = SerializableCompositionElement.FromICompositionElement(element); - - ElementAssert.AreEqual(e, result.Origin); - } - } - - [TestMethod] - public void ToString_ShouldReturnDisplayNameProperty() - { - var expectations = Expectations.GetDisplayNames(); - - foreach (var e in expectations) - { - var element = ElementFactory.Create(e); - - var result = SerializableCompositionElement.FromICompositionElement(element); - - Assert.AreEqual(e, result.ToString()); - } - } - -#if !SILVERLIGHT - - [TestMethod] - public void Origin_CanBeSerialized() - { - var expectations = Expectations.GetCompositionElements(); - - foreach (var e in expectations) - { - var element = CreateSerializableCompositionElement(e); - - var result = SerializationTestServices.RoundTrip(element); - - ElementAssert.AreEqual(e, result); - } - } - - [TestMethod] - public void DisplayName_CanBeSerialized() - { - var expectations = Expectations.GetDisplayNames(); - - foreach (var e in expectations) - { - var element = CreateSerializableCompositionElement(e); - - var result = SerializationTestServices.RoundTrip(element); - - Assert.AreEqual(e, result.DisplayName); - } - } - -#endif - - private static SerializableCompositionElement CreateSerializableCompositionElement(string displayName) - { - var element = ElementFactory.Create(displayName); - - return CreateSerializableCompositionElement(element); - } - - private static SerializableCompositionElement CreateSerializableCompositionElement(ICompositionElement element) - { - return (SerializableCompositionElement)SerializableCompositionElement.FromICompositionElement(element); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/.gitattributes deleted file mode 100644 index 394a811bd56..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/.gitattributes +++ /dev/null @@ -1,7 +0,0 @@ -/LazyMemberInfoTests.cs -crlf -/ReflectionComposablePartDefinitionTests.cs -crlf -/ReflectionComposablePartTests.cs -crlf -/ReflectionMemberExportDefinitionTests.cs -crlf -/ReflectionMemberImportDefinitionTests.cs -crlf -/ReflectionModelServicesTests.cs -crlf -/ReflectionParameterImportDefinitionTests.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfoTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfoTests.cs deleted file mode 100644 index edc08f368a5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfoTests.cs +++ /dev/null @@ -1,248 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.Linq; -using System.UnitTesting; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - [TestClass] - public class LazyMemberInfoTests - { - [TestMethod] - public void Constructor_PassMember() - { - foreach (var memberAndAccessorsInfo in GetMembersAndAccessors(typeof(LazyMemberTestClass))) - { - MemberInfo member = memberAndAccessorsInfo.Item1; - MemberTypes memberType = memberAndAccessorsInfo.Item2.Item1; - MemberInfo[] accessors = memberAndAccessorsInfo.Item2.Item2; - - LazyMemberInfo lazy = new LazyMemberInfo(member); - Assert.AreEqual(memberType, lazy.MemberType); - Assert.AreEqual(accessors.Length, lazy.GetAccessors().Length); - Assert.IsTrue(accessors.SequenceEqual(lazy.GetAccessors())); - } - } - - [TestMethod] - public void Constructor_PassNullMember() - { - ExceptionAssert.ThrowsArgument("member", () => - { - LazyMemberInfo lazy = new LazyMemberInfo((MemberInfo)null); - }); - } - - [TestMethod] - public void Constructor_PassAccessors() - { - foreach (var memberAndAccessorsInfo in GetMembersAndAccessors(typeof(LazyMemberTestClass))) - { - MemberInfo member = memberAndAccessorsInfo.Item1; - MemberTypes memberType = memberAndAccessorsInfo.Item2.Item1; - MemberInfo[] accessors = memberAndAccessorsInfo.Item2.Item2; - - LazyMemberInfo lazy = new LazyMemberInfo(memberType, accessors); - Assert.AreEqual(memberType, lazy.MemberType); - Assert.AreEqual(accessors.Length, lazy.GetAccessors().Length); - Assert.IsTrue(accessors.SequenceEqual(lazy.GetAccessors())); - } - } - - [TestMethod] - public void Constructor_PassInvalidAccessors() - { - foreach (var memberAndAccessorsInfo in GetMembersAndAccessors(typeof(LazyMemberTestClass))) - { - MemberInfo member = memberAndAccessorsInfo.Item1; - MemberTypes memberType = memberAndAccessorsInfo.Item2.Item1; - MemberInfo[] accessors = memberAndAccessorsInfo.Item2.Item2; - - foreach (MemberTypes wrongMemberType in GetValidMemberTypes()) - { - if (wrongMemberType == memberType) - { - continue; - } - ExceptionAssert.ThrowsArgument("accessors", () => - { - LazyMemberInfo lazy = new LazyMemberInfo(wrongMemberType, accessors); - }); - } - } - } - - [TestMethod] - public void Constructor_PassAccessorsInvalidMemberType() - { - MemberTypes[] validMemberTypes = GetValidMemberTypes().ToArray(); - foreach (MemberTypes memberType in GetMemberTypeValues()) - { - if (!validMemberTypes.Contains(memberType)) - { - ExceptionAssert.ThrowsArgument("memberType", () => - { - LazyMemberInfo lazy = new LazyMemberInfo(memberType, typeof(LazyMemberTestClass)); - }); - } - } - } - - [TestMethod] - public void Constructor_PassNullAccessors() - { - ExceptionAssert.ThrowsArgument("accessors", () => - { - LazyMemberInfo lazy = new LazyMemberInfo(MemberTypes.Field, (MemberInfo[])null); - }); - } - - [TestMethod] - public void Constructor_PassAccessorsWithNulls() - { - ExceptionAssert.ThrowsArgument("accessors", () => - { - LazyMemberInfo lazy = new LazyMemberInfo(MemberTypes.Field, new MemberInfo[] { null, null }); - }); - } - - [TestMethod] - public void Constructor_PassAccessorCreators() - { - foreach (var memberAndAccessorsInfo in GetMembersAndAccessors(typeof(LazyMemberTestClass))) - { - MemberInfo member = memberAndAccessorsInfo.Item1; - MemberTypes memberType = memberAndAccessorsInfo.Item2.Item1; - MemberInfo[] accessors = memberAndAccessorsInfo.Item2.Item2; - - LazyMemberInfo lazy = new LazyMemberInfo(memberType, () => accessors); - Assert.AreEqual(memberType, lazy.MemberType); - Assert.AreEqual(accessors.Length, lazy.GetAccessors().Length); - Assert.IsTrue(accessors.SequenceEqual(lazy.GetAccessors())); - } - } - - [TestMethod] - public void Constructor_PassInvalidAccessorCreators() - { - foreach (var memberAndAccessorsInfo in GetMembersAndAccessors(typeof(LazyMemberTestClass))) - { - MemberInfo member = memberAndAccessorsInfo.Item1; - MemberTypes memberType = memberAndAccessorsInfo.Item2.Item1; - MemberInfo[] accessors = memberAndAccessorsInfo.Item2.Item2; - - foreach (MemberTypes wrongMemberType in GetValidMemberTypes()) - { - if (wrongMemberType == memberType) - { - continue; - } - LazyMemberInfo lazy = new LazyMemberInfo(wrongMemberType, () => accessors); - ExceptionAssert.Throws(() => - { - lazy.GetAccessors(); - }); - } - } - } - - [TestMethod] - public void Constructor_PassAccessorCreatorsWithInvalidMemberType() - { - MemberTypes[] validMemberTypes = GetValidMemberTypes().ToArray(); - foreach (MemberTypes memberType in GetMemberTypeValues()) - { - if (!validMemberTypes.Contains(memberType)) - { - ExceptionAssert.ThrowsArgument("memberType", () => - { - LazyMemberInfo lazy = new LazyMemberInfo(memberType, () => new MemberInfo[] { typeof(LazyMemberTestClass) }); - }); - } - } - } - - [TestMethod] - public void Constructor_PassNullAccessorCreators() - { - ExceptionAssert.ThrowsArgument("accessorsCreator", () => - { - LazyMemberInfo lazy = new LazyMemberInfo(MemberTypes.Field, (Func)null); - }); - } - - - private static IEnumerable>> GetMembersAndAccessors(Type type) - { - yield return new Tuple>( - type, new Tuple(type.MemberType, new MemberInfo[] { type })); - - foreach (MemberInfo member in type.GetMembers()) - { - MemberInfo[] accessors = null; - if (member.MemberType == MemberTypes.Property) - { - PropertyInfo property = (PropertyInfo)member; - accessors = new MemberInfo[] { property.GetGetMethod(true), property.GetSetMethod(true) }; - } - else if (member.MemberType == MemberTypes.Event) - { - EventInfo event_ = (EventInfo)member; - accessors = new MemberInfo[] { event_.GetRaiseMethod(true), event_.GetAddMethod(true), event_.GetRemoveMethod(true) }; - } - else - { - accessors = new MemberInfo[] { member }; - } - - yield return new Tuple>( - member, new Tuple(member.MemberType, accessors)); - } - } - - private static IEnumerable GetMemberTypeValues() - { - yield return MemberTypes.All; - yield return MemberTypes.Constructor; - yield return MemberTypes.Custom; - yield return MemberTypes.Event; - yield return MemberTypes.Field; - yield return MemberTypes.Method; - yield return MemberTypes.NestedType; - yield return MemberTypes.Property; - yield return MemberTypes.TypeInfo; - } - - private static IEnumerable GetValidMemberTypes() - { - yield return MemberTypes.TypeInfo; - yield return MemberTypes.NestedType; - yield return MemberTypes.Constructor; - yield return MemberTypes.Field; - yield return MemberTypes.Method; - yield return MemberTypes.Property; - yield return MemberTypes.Event; - } - - public class LazyMemberTestClass - { - public LazyMemberTestClass() { } - public string Property { get; set; } - public string SetProperty { set { } } - public string GetProperty { get { return null; } } - public string Field; - public void Method() { this.Event(this, new EventArgs()); } - public event EventHandler Event; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinitionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinitionTests.cs deleted file mode 100644 index 778ded44a1f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinitionTests.cs +++ /dev/null @@ -1,353 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.Linq; -using System.UnitTesting; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - [TestClass] - public class ReflectionComposablePartDefinitionTests - { - private ReflectionComposablePartDefinition CreateReflectionPartDefinition( - Lazy partType, - bool requiresDisposal, - Func> imports, - Func>exports, - IDictionary metadata, - ICompositionElement origin) - { - return (ReflectionComposablePartDefinition)ReflectionModelServices.CreatePartDefinition(partType, requiresDisposal, - new Lazy>(imports, false), - new Lazy>(exports, false), - metadata.AsLazy(), origin); - } - - [TestMethod] - public void Constructor() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ReflectionComposablePartDefinition definition = CreateReflectionPartDefinition( - expectedLazyType, - false, - () => expectedImports, - () => expectedExports, - expectedMetadata, - expectedOrigin); - - Assert.AreSame(expectedType, definition.GetPartType()); - Assert.IsTrue(definition.Metadata.Keys.SequenceEqual(expectedMetadata.Keys)); - Assert.IsTrue(definition.Metadata.Values.SequenceEqual(expectedMetadata.Values)); - Assert.IsTrue(definition.ExportDefinitions.SequenceEqual(expectedExports.Cast())); - Assert.IsTrue(definition.ImportDefinitions.SequenceEqual(expectedImports.Cast())); - Assert.AreSame(expectedOrigin, ((ICompositionElement)definition).Origin); - Assert.IsNotNull(((ICompositionElement)definition).DisplayName); - Assert.IsFalse(definition.IsDisposalRequired); - } - - [TestMethod] - public void Constructor_DisposablePart() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ReflectionComposablePartDefinition definition = CreateReflectionPartDefinition( - expectedLazyType, - true, - () => expectedImports, - () => expectedExports, - expectedMetadata, - expectedOrigin); - - Assert.AreSame(expectedType, definition.GetPartType()); - Assert.IsTrue(definition.Metadata.Keys.SequenceEqual(expectedMetadata.Keys)); - Assert.IsTrue(definition.Metadata.Values.SequenceEqual(expectedMetadata.Values)); - Assert.IsTrue(definition.ExportDefinitions.SequenceEqual(expectedExports.Cast())); - Assert.IsTrue(definition.ImportDefinitions.SequenceEqual(expectedImports.Cast())); - Assert.AreSame(expectedOrigin, ((ICompositionElement)definition).Origin); - Assert.IsNotNull(((ICompositionElement)definition).DisplayName); - Assert.IsTrue(definition.IsDisposalRequired); - } - - [TestMethod] - public void CreatePart() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ReflectionComposablePartDefinition definition = CreateReflectionPartDefinition( - expectedLazyType, - false, - () => expectedImports, - () => expectedExports, - expectedMetadata, - expectedOrigin); - - var part = definition.CreatePart(); - Assert.IsNotNull(part); - Assert.IsFalse(part is IDisposable); - } - - [TestMethod] - public void CreatePart_Disposable() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ReflectionComposablePartDefinition definition = CreateReflectionPartDefinition( - expectedLazyType, - true, - () => expectedImports, - () => expectedExports, - expectedMetadata, - expectedOrigin); - - var part = definition.CreatePart(); - Assert.IsNotNull(part); - Assert.IsTrue(part is IDisposable); - } - - [TestMethod] - public void CreatePart_DoesntLoadType() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = new Lazy(() => { Assert.Fail("Part should not be loaded"); return null; }); - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ReflectionComposablePartDefinition definition = CreateReflectionPartDefinition( - expectedLazyType, - true, - () => expectedImports, - () => expectedExports, - expectedMetadata, - expectedOrigin); - - var part = definition.CreatePart(); - Assert.IsNotNull(part); - Assert.IsTrue(part is IDisposable); - } - - [TestMethod] - public void Constructor_NullMetadata_ShouldSetMetadataPropertyToEmpty() - { - ReflectionComposablePartDefinition definition = CreateEmptyDefinition(typeof(object), typeof(object).GetConstructors().First(), null, new MockOrigin()); - Assert.IsNotNull(definition.Metadata); - Assert.AreEqual(0, definition.Metadata.Count); - } - - [TestMethod] - public void Constructor_NullOrigin_ShouldSetOriginPropertyToNull() - { - ReflectionComposablePartDefinition definition = CreateEmptyDefinition(typeof(object), typeof(object).GetConstructors().First(), MetadataServices.EmptyMetadata, null); - Assert.IsNotNull(((ICompositionElement)definition).DisplayName); - Assert.IsNull(((ICompositionElement)definition).Origin); - } - - [TestMethod] - public void ImportaAndExports_CreatorsShouldBeCalledLazilyAndOnce() - { - Type expectedType = typeof(TestPart); - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - bool importsCreatorCalled = false; - Func> importsCreator = () => - { - Assert.IsFalse(importsCreatorCalled); - importsCreatorCalled = true; - return expectedImports.Cast(); - }; - - bool exportsCreatorCalled = false; - Func> exportsCreator = () => - { - Assert.IsFalse(exportsCreatorCalled); - exportsCreatorCalled = true; - return expectedExports.Cast(); - }; - - ReflectionComposablePartDefinition definition = CreateReflectionPartDefinition( - expectedType.AsLazy(), - false, - importsCreator, - exportsCreator, - null, - null); - - IEnumerable exports; - Assert.IsFalse(exportsCreatorCalled); - exports = definition.ExportDefinitions; - Assert.IsTrue(exportsCreatorCalled); - exports = definition.ExportDefinitions; - - - IEnumerable imports; - Assert.IsFalse(importsCreatorCalled); - imports = definition.ImportDefinitions; - Assert.IsTrue(importsCreatorCalled); - imports = definition.ImportDefinitions; - } - - [TestMethod] - public void ICompositionElementDisplayName_ShouldReturnTypeDisplayName() - { - var expectations = Expectations.GetAttributedTypes(); - foreach (var e in expectations) - { - var definition = (ICompositionElement)CreateEmptyDefinition(e, null, null, null); - - Assert.AreEqual(e.GetDisplayName(), definition.DisplayName); - } - } - - [TestMethod] - public void ToString_ShouldReturnICompositionElementDisplayName() - { - var expectations = Expectations.GetAttributedTypes(); - foreach (var e in expectations) - { - var definition = (ICompositionElement)CreateEmptyDefinition(e, null, null, null); - - Assert.AreEqual(definition.DisplayName, definition.ToString()); - } - } - - private ReflectionComposablePartDefinition CreateEmptyDefinition(Type type, ConstructorInfo constructor, IDictionary metadata, ICompositionElement origin) - { - return (ReflectionComposablePartDefinition)ReflectionModelServices.CreatePartDefinition( - (type != null) ? type.AsLazy() : null, - false, - Enumerable.Empty().AsLazy(), - Enumerable.Empty().AsLazy(), - metadata.AsLazy(), - origin); - } - - private static List CreateImports(Type type) - { - List imports = new List(); - foreach (PropertyInfo property in type.GetProperties()) - { - imports.Add(new ReflectionMemberImportDefinition(new LazyMemberInfo(property), "Contract", (string)null, new KeyValuePair[] { new KeyValuePair("Key1", typeof(object)) }, ImportCardinality.ZeroOrOne, true, CreationPolicy.Any, new TypeOrigin(type))); - } - - return imports; - } - - private static List CreateExports(Type type) - { - List exports = new List(); - foreach (PropertyInfo property in type.GetProperties()) - { - exports.Add(ReflectionModelServices.CreateExportDefinition(new LazyMemberInfo(property), "Contract", new Lazy>(() => null, false), new TypeOrigin(type))); - } - - return exports; - } - - public class TestPart - { - public int field1; - public string field2; - public int Property1 { get; set; } - public string Property2 { get; set; } - } - - private class TypeOrigin : ICompositionElement - { - private readonly Type _type; - private readonly ICompositionElement _orgin; - - public TypeOrigin(Type type) - : this(type, null) - { - } - - public TypeOrigin(Type type, ICompositionElement origin) - { - this._type = type; - this._orgin = origin; - } - - public string DisplayName - { - get - { - return this._type.GetDisplayName(); - } - } - - public ICompositionElement Origin - { - get - { - return this._orgin; - } - } - } - - private class MockOrigin : ICompositionElement - { - public string DisplayName - { - get { throw new NotImplementedException(); } - } - - public ICompositionElement Origin - { - get { throw new NotImplementedException(); } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartTests.cs deleted file mode 100644 index 9a7c6ed6109..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartTests.cs +++ /dev/null @@ -1,932 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; -using System.ComponentModel.Composition.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.Collections.Generic; -using Microsoft.Internal; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.Diagnostics; -using System.Diagnostics; -using System.ComponentModel.Composition.Extensibility; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - [TestClass] - public class ReflectionComposablePartTests - { - [TestMethod] - public void Constructor1_DefinitionAsDefinitionArgument_ShouldSetOriginProperty() - { - var expectations = Expectations.GetAttributedDefinitions(); - - foreach (var e in expectations) - { - var definition = (ICompositionElement)new ReflectionComposablePart(e); - - Assert.AreSame(e, definition.Origin); - } - } - - [TestMethod] - public void Constructor1_NullAsDefinitionArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("definition", () => - { - new ReflectionComposablePart((ReflectionComposablePartDefinition)null); - }); - } - - [TestMethod] - public void Constructor2_NullAsAttributedPartArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("attributedPart", () => - { - new ReflectionComposablePart(PartDefinitionFactory.CreateAttributed(), (object)null); - }); - } - - [TestMethod] - public void Constructor2_ValueTypeAsAttributedPartArgument_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("attributedPart", () => - { - new ReflectionComposablePart(PartDefinitionFactory.CreateAttributed(), 42); - }); - } - - - [TestMethod] - public void Constructor1_AttributedComposablePartDefintion_ShouldProduceValidObject() - { - var definition = PartDefinitionFactory.CreateAttributed(typeof(MyExport)); - var part = new ReflectionComposablePart(definition); - - Assert.AreEqual(definition, part.Definition); - Assert.IsNotNull(part.Metadata); - - Assert.IsFalse(part is IDisposable); - } - - [TestMethod] - public void Constructor1_AttributedComposablePartDefintion_Disposable_ShouldProduceValidObject() - { - var definition = PartDefinitionFactory.CreateAttributed(typeof(DisposablePart)); - var part = new DisposableReflectionComposablePart(definition); - - Assert.AreEqual(definition, part.Definition); - Assert.IsNotNull(part.Metadata); - - Assert.IsTrue(part is IDisposable); - } - - [TestMethod] - public void Constructor1_Type_ShouldProduceValidObject() - { - var part = new ReflectionComposablePart(PartDefinitionFactory.CreateAttributed(typeof(MyExport))); - } - - [TestMethod] - public void Constructor1_Object_ShouldProduceValidObject() - { - var part = new ReflectionComposablePart(PartDefinitionFactory.CreateAttributed(typeof(MyExport)), new MyExport()); - } - - [TestMethod] - public void Metadata_WhenDisposed_ShouldThrowObjectDisposed() - { - var part = CreateDefaultDisposablePart(); - ((IDisposable)part).Dispose(); - - ExceptionAssert.ThrowsDisposed(part, () => - { - var metadata = part.Metadata; - }); - } - - [TestMethod] - public void ImportDefinitions_WhenDisposed_ShouldThrowObjectDisposed() - { - var part = CreateDefaultDisposablePart(); - ((IDisposable)part).Dispose(); - - ExceptionAssert.ThrowsDisposed(part, () => - { - var definitions = part.ImportDefinitions; - }); - } - - [TestMethod] - public void ExportDefinitions_WhenDisposed_ShouldThrowObjectDisposed() - { - var part = CreateDefaultDisposablePart(); - ((IDisposable)part).Dispose(); - - ExceptionAssert.ThrowsDisposed(part, () => - { - var definitions = part.ExportDefinitions; - }); - } - [TestMethod] - public void OnComposed_WhenDisposed_ShouldThrowObjectDisposed() - { - var part = CreateDefaultDisposablePart(); - ((IDisposable)part).Dispose(); - - ExceptionAssert.ThrowsDisposed(part, () => - { - part.Activate(); - }); - } - - [TestMethod] - public void OnComposed_MissingPostImportsOnInstance_ShouldThrowComposition() - { - var part = CreatePart(new MySharedPartExport()); - - // Dev10:484204 - This used to cause a failure but after we made - // ReflectionComposablePart internal we needed to back remove this - // validation for post imports to make declarative composition work. - //part.Activate().VerifyFailure(CompositionIssueId.ImportNotSetOnPart); - part.Activate(); - } - - [TestMethod] - public void OnComposed_ProperlyComposed_ShouldSucceed() - { - var import = new TrivialImporter(); - var export = new TrivialExporter(); - - var part = CreatePart(import); - - var importDef = part.ImportDefinitions.First(); - part.SetImport(importDef, CreateSimpleExports(export)); - part.Activate(); - Assert.IsTrue(export.done, "OnImportsSatisfied should have been called"); - } - - [TestMethod] - public void OnComposed_UnhandledExceptionThrowInOnImportsSatisfied_ShouldThrowComposablePart() - { - var part = CreatePart(typeof(ExceptionDuringINotifyImport)); - var definition = part.ImportDefinitions.First(); - part.SetImport(definition, CreateSimpleExports(21)); - - CompositionAssert.ThrowsPart(ErrorId.ReflectionModel_PartOnImportsSatisfiedThrewException, RetryMode.DoNotRetry, () => - { - part.Activate(); - }); - } - - [TestMethod] - public void SetImport_WhenDisposed_ShouldThrowObjectDisposed() - { - var part = CreateDefaultDisposablePart(); - var definition = part.ImportDefinitions.First(); - - ((IDisposable)part).Dispose(); - - ExceptionAssert.ThrowsDisposed(part, () => - { - part.SetImport(definition, Enumerable.Empty()); - }); - } - - [TestMethod] - public void SetImport_NullAsImportDefinitionArgument_ShouldThrowArgumentNull() - { - var part = CreateDefaultPart(); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.SetImport((ImportDefinition)null, Enumerable.Empty()); - }); - } - - [TestMethod] - public void SetImport_NullAsExportsArgument_ShouldThrowArgumentNull() - { - var part = CreatePart(typeof(MySharedPartExport)); - var import = part.ImportDefinitions.First(); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(import, (IEnumerable)null); - }); - } - - [TestMethod] - public void SetImport_ExportsArrayWithNullElementAsExportsArgument_ShouldThrowArgument() - { - var part = CreatePart(typeof(MySharedPartExport)); - var definition = part.ImportDefinitions.First(); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, new Export[] { null }); - }); - } - - [TestMethod] - public void SetImport_WrongDefinitionAsDefinitionArgument_ShouldThrowArgument() - { - var part = CreateDefaultPart(); - - var definition = ImportDefinitionFactory.Create(); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.SetImport(definition, Enumerable.Empty()); - }); - } - - [TestMethod] - public void SetImport_SetNonRecomposableDefinitionAsDefinitionArgumentAfterOnComposed_ShouldThrowInvalidOperation() - { - var part = CreatePartWithNonRecomposableImport(); - var definition = part.ImportDefinitions.First(); - - part.SetImport(definition, Enumerable.Empty()); - part.Activate(); - - ExceptionAssert.Throws(() => - { - part.SetImport(definition, Enumerable.Empty()); - }); - } - - [TestMethod] - public void SetImport_ZeroOrOneDefinitionAsDefinitionArgumentAndTwoExportsAsExportsArgument_ShouldThrowArgument() - { - var part = CreatePartWithZeroOrOneImport(); - var definition = part.ImportDefinitions.First(); - - var exports = ExportFactory.Create("Import", 2); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, exports); - }); - } - - [TestMethod] - public void SetImport_ExactlyOneDefinitionAsDefinitionArgumentAndTwoExportsAsExportsArgument_ShouldThrowArgument() - { - var part = CreatePartWithExactlyOneImport(); - var definition = part.ImportDefinitions.First(); - - var exports = ExportFactory.Create("Import", 2); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, exports); - }); - } - - [TestMethod] - public void SetImport_ExactlyOneDefinitionAsDefinitionArgumentAndEmptyExportsAsExportsArgument_ShouldThrowArgument() - { - var part = CreatePartWithExactlyOneImport(); - var definition = part.ImportDefinitions.First(); - - var exports = Enumerable.Empty(); - - ExceptionAssert.ThrowsArgument("exports", () => - { - part.SetImport(definition, exports); - }); - } - - [TestMethod] - public void SetImport_WrongTypeExportGiven_ShouldThrowComposablePart() - { - var part = CreatePart(new MySharedPartExport()); - var import = part.ImportDefinitions.First(); - - CompositionAssert.ThrowsPart(ErrorId.ReflectionModel_ImportNotAssignableFromExport, () => - { - part.SetImport(import, CreateSimpleExports("21")); - }); - } - - [TestMethod] - public void SetImport_SetPostValueAndSetAgainOnInstance_ShouldSetProperty() - { - var import = new MySharedPartExport(); - var part = CreatePart(import); - var importDef = part.ImportDefinitions.First(); - - part.SetImport(importDef, CreateSimpleExports(21)); - - Assert.AreNotEqual(import.Value, 21, "Value should NOT be set on live object until OnComposed"); - part.Activate(); - - Assert.AreEqual(import.Value, 21, "Value should be set on live object now"); - - part.SetImport(importDef, CreateSimpleExports(42)); - - Assert.AreNotEqual(import.Value, 42, "Value should NOT be rebound on live object"); - - part.Activate(); - - Assert.AreEqual(import.Value, 42, "Value should be set on live object now"); - } - - [TestMethod] - public void GetExportedValue_WhenDisposed_ShouldThrowObjectDisposed() - { - var part = CreateDefaultDisposablePart(); - var definition = part.ExportDefinitions.First(); - - ((IDisposable)part).Dispose(); - - ExceptionAssert.ThrowsDisposed(part, () => - { - part.GetExportedValue(definition); - }); - } - - [TestMethod] - public void GetExportedValue_NullAsDefinitionArgument_ShouldThrowArgumentNull() - { - var part = CreateDefaultPart(); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.GetExportedValue((ExportDefinition)null); - }); - } - - [TestMethod] - public void GetExportedValue_WrongDefinitionAsDefinitionArgument_ShouldThrowArgument() - { - var part = CreateDefaultPart(); - var definition = ExportDefinitionFactory.Create(); - - ExceptionAssert.ThrowsArgument("definition", () => - { - part.GetExportedValue(definition); - }); - } - - [TestMethod] - public void GetExportedValue_MissingPrerequisiteImport_ShouldThrowInvalidOperation() - { - var part = CreatePart(typeof(SimpleConstructorInjectedObject)); - var definition = part.ExportDefinitions.First(); - - ExceptionAssert.Throws(() => - { - part.GetExportedValue(definition); - }); - } - - [Ignore] - [TestMethod] - [WorkItem(484204)] - public void GetExportedValue_MissingPostImports_ShouldThrowComposition() - { - var part = CreatePart(typeof(MySharedPartExport)); - - // Signal that the composition should be finished - part.Activate(); - - var definition = part.ExportDefinitions.First(); - - // Dev10:484204 - This used to cause a failure but after we made - // ReflectionComposablePart internal we needed to back remove this - // validation for post imports to make declarative composition work. - CompositionAssert.ThrowsError(ErrorId.ImportNotSetOnPart, () => - { - part.GetExportedValue(definition); - }); - } - - [TestMethod] - public void GetExportedValue_NoConstructorOnDefinition_ShouldThrowComposablePart() - { - var part = CreatePart(typeof(ClassWithNoMarkedOrDefaultConstructor)); - - var definition = part.ExportDefinitions.First(); - - CompositionAssert.ThrowsPart(ErrorId.ReflectionModel_PartConstructorMissing, () => - { - part.GetExportedValue(definition); - }); - } - - [TestMethod] - public void GetExportedValue_UnhandledExceptionThrowInConstructor_ShouldThrowComposablePart() - { - var part = CreatePart(typeof(ExportWithExceptionDuringConstruction)); - - var definition = part.ExportDefinitions.First(); - - CompositionAssert.ThrowsPart(ErrorId.ReflectionModel_PartConstructorThrewException, () => - { - part.GetExportedValue(definition); - }); - } - - [TestMethod] - public void GetExportedValue_GetObjectAfterSetPreImport_ShouldGetValue() - { - var part = CreatePart(typeof(SimpleConstructorInjectedObject)); - - var import = part.ImportDefinitions.First(); - part.SetImport(import, CreateSimpleExports(21)); - - part.Activate(); - - var definition = part.ExportDefinitions.First(); - var exportObject = (SimpleConstructorInjectedObject)part.GetExportedValue(definition); - - Assert.AreEqual(21, exportObject.CISimpleValue); - } - - [TestMethod] - public void GetExportedValue_GetObjectAfterSetPostImport_ShouldGetValue() - { - var part = CreatePart(typeof(MySharedPartExport)); - - var import = part.ImportDefinitions.First(); - part.SetImport(import, CreateSimpleExports(21)); - - part.Activate(); - - var definition = part.ExportDefinitions.First(); - var exportObject = (MySharedPartExport)part.GetExportedValue(definition); - - Assert.IsNotNull(exportObject); - Assert.AreEqual(21, exportObject.Value); - } - - [TestMethod] - public void GetExportedValue_CallMultipleTimes_ShouldReturnSame() - { - var part = CreatePart(typeof(MySharedPartExport)); - - var import = part.ImportDefinitions.First(); - part.SetImport(import, CreateSimpleExports(21)); - - part.Activate(); - - var definition = part.ExportDefinitions.First(); - var exportedValue1 = part.GetExportedValue(definition); - var exportedValue2 = part.GetExportedValue(definition); - - Assert.AreSame(exportedValue1, exportedValue2); - } - - [TestMethod] - public void GetExportedValue_FromStaticClass_ShouldReturnExport() - { - var part = CreatePart(typeof(StaticExportClass)); - - var definition = part.ExportDefinitions.First(); - - var exportObject = (string)part.GetExportedValue(definition); - - Assert.AreEqual("StaticString", exportObject); - } - - [TestMethod] - public void GetExportedValue_OptionalPostNotGiven_ShouldReturnValidObject() - { - var part = CreatePart(typeof(ClassWithOptionalPostImport)); - part.Activate(); - - var definition = part.ExportDefinitions.First(); - var exportObject = (ClassWithOptionalPostImport)part.GetExportedValue(definition); - - Assert.IsNull(exportObject.Formatter); - } - - [TestMethod] - public void GetExportedValue_OptionalPreNotGiven_ShouldReturnValidObject() - { - var part = CreatePart(typeof(ClassWithOptionalPreImport)); - part.Activate(); - - var definition = part.ExportDefinitions.First(); - - var exportedValue = (ClassWithOptionalPreImport)part.GetExportedValue(definition); - Assert.IsNull(exportedValue.Formatter); - } - - [TestMethod] - public void ICompositionElementDisplayName_ShouldReturnTypeDisplayName() - { - var expectations = Expectations.GetAttributedTypes(); - foreach (var e in expectations) - { - var part = (ICompositionElement)CreatePart(e); - - Assert.AreEqual(e.GetDisplayName(), part.DisplayName); - } - } - - [TestMethod] - public void ToString_ShouldReturnICompositionElementDisplayName() - { - var expectations = Expectations.GetAttributedTypes(); - foreach (var e in expectations) - { - var part = (ICompositionElement)CreatePart(e); - - Assert.AreEqual(part.DisplayName, part.ToString()); - } - } - - [PartNotDiscoverable] - public class PropertyExporter - { - [Export] - public object Property { get { return new object(); } } - } - - [PartNotDiscoverable] - public class FieldExporter - { - [Export] - public object Field = null; - } - - [PartNotDiscoverable] - public class MethodExporter - { - [Export("Method")] - public void Method() { } - } - - [PartNotDiscoverable] - [Export] - public class TypeExporter - { - } - - [TestMethod] - public void GetExportedObjectAlwaysReturnsSameReference_ForProperty() - { - var cp = CreatePart(new PropertyExporter()); - var ed = cp.ExportDefinitions.Single(); - var eo1 = cp.GetExportedValue(ed); - var eo2 = cp.GetExportedValue(ed); - Assert.AreSame(eo1, eo2); - } - - [TestMethod] - public void GetExportedObjectAlwaysReturnsSameReference_ForField() - { - var exporter = new FieldExporter(); - var cp = CreatePart(new FieldExporter()); - var ed = cp.ExportDefinitions.Single(); - - exporter.Field = new object(); - var eo1 = cp.GetExportedValue(ed); - exporter.Field = new object(); - var eo2 = cp.GetExportedValue(ed); - Assert.AreSame(eo1, eo2); - } - - [TestMethod] - public void GetExportedObjectAlwaysReturnsSameReference_ForMethod() - { - var cp = CreatePart(new MethodExporter()); - var ed = cp.ExportDefinitions.Single(); - var eo1 = cp.GetExportedValue(ed); - var eo2 = cp.GetExportedValue(ed); - Assert.AreSame(eo1, eo2); - } - - [TestMethod] - public void GetExportedObjectAlwaysReturnsSameReference_ForType() - { - var cp = CreatePart(new TypeExporter()); - var ed = cp.ExportDefinitions.Single(); - var eo1 = cp.GetExportedValue(ed); - var eo2 = cp.GetExportedValue(ed); - Assert.AreSame(eo1, eo2); - } - - - [PartNotDiscoverable] - public class MethodWithoutContractName - { - [Export] - public void MethodWithoutContractNameNotAllowed() - { - } - } - - public interface IContract - { - } - - - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] - public class CustomImportAttributeInvalidTarget : ImportAttribute - { - public CustomImportAttributeInvalidTarget() - : base(typeof(IContract)) - { - } - } - - [PartNotDiscoverable] - public class ImportWithCustomImport - { - [CustomImport] - IContract ImportWithCustomAttributeImport { get; set; } - } - - [PartNotDiscoverable] - public class ImportWithCustomImportInvalidTarget - { - [CustomImportAttributeInvalidTarget] - void InvalidImport() { } - } - - [TestMethod] - public void ImportDefinitions_ImportWithCustomAttributeImports() - { - var part = CreatePart(typeof(ImportWithCustomImport)); - Assert.AreEqual(part.ImportDefinitions.Count(), 1); - ContractBasedImportDefinition import = part.ImportDefinitions.First() as ContractBasedImportDefinition; - Assert.IsNotNull(import); - - Assert.AreEqual(AttributedModelServices.GetContractName(typeof(IContract)), import.ContractName); - Assert.AreEqual(AttributedModelServices.GetTypeIdentity(typeof(IContract)), import.RequiredTypeIdentity); - } - - [TestMethod] - public void ImportDefinitions_ImportWithCustomImportInvalidTarget_ShouldbeIgnored() - { - var part = CreatePart(typeof(ImportWithCustomImportInvalidTarget)); - Assert.AreEqual(part.ImportDefinitions.Count(), 0); - } - - [PartNotDiscoverable] - public class ImportManyWithCustomImportMany - { - [CustomImportMany] - IContract ImportManyWithCustomAttributeImportMany { get; set; } - } - - [PartNotDiscoverable] - public class ImportManyWithCustomImportManyInvalidTarget - { - [CustomImportMany] - void InvalidImportMany() { } - } - - [TestMethod] - public void ImportDefinitions_ImportManyWithCustomAttributeImportManys() - { - var part = CreatePart(typeof(ImportManyWithCustomImportMany)); - Assert.AreEqual(part.ImportDefinitions.Count(), 1); - ContractBasedImportDefinition import = part.ImportDefinitions.First() as ContractBasedImportDefinition; - Assert.IsNotNull(import); - - Assert.AreEqual(AttributedModelServices.GetContractName(typeof(IContract)), import.ContractName); - Assert.AreEqual(AttributedModelServices.GetTypeIdentity(typeof(IContract)), import.RequiredTypeIdentity); - } - - [TestMethod] - public void ImportDefinitions_ImportManyWithCustomImportManyInvalidTarget_ShouldbeIgnored() - { - var part = CreatePart(typeof(ImportManyWithCustomImportManyInvalidTarget)); - Assert.AreEqual(part.ImportDefinitions.Count(), 0); - } - - [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] - public class CustomImportingConstructorAttribute : ImportingConstructorAttribute - { - public CustomImportingConstructorAttribute() - : base() - { - } - } - - [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = true, Inherited = false)] - public class CustomImportingConstructorAllowMultipleAttribute : ImportingConstructorAttribute - { - public CustomImportingConstructorAllowMultipleAttribute() - : base() - { - } - } - - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] - public class CustomImportingConstructorInvalidTargetAttribute : ImportingConstructorAttribute - { - public CustomImportingConstructorInvalidTargetAttribute() - : base() - { - } - } - - [PartNotDiscoverable] - public class ImportingConstructorWithCustomImportingConstructor - { - [CustomImportingConstructor] - ImportingConstructorWithCustomImportingConstructor([Import] IContract argument) {} - } - - [PartNotDiscoverable] - public class ImportingConstructorWithCustomImportingConstructorAllowMultiple - { - [CustomImportingConstructorAllowMultiple] - [CustomImportingConstructorAllowMultiple] - ImportingConstructorWithCustomImportingConstructorAllowMultiple([Import] IContract argument) { } - } - - [PartNotDiscoverable] - public class ImportingConstructorWithCustomImportingConstructorInvalidTarget - { - [CustomImportingConstructorInvalidTarget] - void InvalidImportingConstructor() { } - } - - [TestMethod] - public void ImportDefinitions_ImportingConstructorWithCustomAttributeImportingConstructors() - { - var part = CreatePart(typeof(ImportingConstructorWithCustomImportingConstructor)); - Assert.AreEqual(part.ImportDefinitions.Count(), 1); - ContractBasedImportDefinition import = part.ImportDefinitions.First() as ContractBasedImportDefinition; - Assert.IsNotNull(import); - - Assert.AreEqual(AttributedModelServices.GetContractName(typeof(IContract)), import.ContractName); - Assert.AreEqual(AttributedModelServices.GetTypeIdentity(typeof(IContract)), import.RequiredTypeIdentity); - } - - [TestMethod] - public void ImportDefinitions_ImportingConstructorWithCustomAttributeImportingConstructorsWithAllowMultiple_ShouldNotThrowInvalidOperation() - { - var part = CreatePart(typeof(ImportingConstructorWithCustomImportingConstructorAllowMultiple)); - - Assert.AreEqual(part.ImportDefinitions.Count(), 1); - ContractBasedImportDefinition import = part.ImportDefinitions.First() as ContractBasedImportDefinition; - Assert.IsNotNull(import); - - Assert.AreEqual(AttributedModelServices.GetContractName(typeof(IContract)), import.ContractName); - Assert.AreEqual(AttributedModelServices.GetTypeIdentity(typeof(IContract)), import.RequiredTypeIdentity); - } - - [TestMethod] - public void ImportDefinitions_ImportingConstructorWithCustomImportingConstructorInvalidTarget_ShouldbeIgnored() - { - var part = CreatePart(typeof(ImportingConstructorWithCustomImportingConstructorInvalidTarget)); - Assert.AreEqual(part.ImportDefinitions.Count(), 0); - } -#if !SILVERLIGHT - - [Export] - public class ClassWithMultipleParameterImports - { - [ImportingConstructor] - public ClassWithMultipleParameterImports([Import][ImportMany]string parameter) - { - } - } - - [Export] - public class ClassWithMultipleFieldImports - { - [Import] - [ImportMany] - public string Field; - } - - [Export] - public class ClassWithMultiplePropertyImports - { - [Import] - [ImportMany] - public string Property - { - get; - set; - } - } - - [Export] - public class ClassWithMultipleCustomPropertyImports - { - [CustomImport] - [CustomImport] - string Property { get; set; } - } - - [Export] - public class ClassWithMultipleCustomPropertyImportManys - { - [CustomImportMany] - [CustomImportMany] - string Property { get; set; } - } - - [Export] - public class ClassWithMultipleCustomPropertyImportAndImportManys - { - [CustomImport] - [CustomImportMany] - string Property { get; set; } - } - - [TestMethod] - public void ImportDefinitions_TypeWithMemberMarkedWithMultipleImports_ShouldTraceError() - { - var types = new Type[] { typeof(ClassWithMultipleParameterImports), - typeof(ClassWithMultipleFieldImports), - typeof(ClassWithMultiplePropertyImports), - typeof(ClassWithMultipleCustomPropertyImports), - typeof(ClassWithMultipleCustomPropertyImportManys), - typeof(ClassWithMultipleCustomPropertyImportAndImportManys)}; - - foreach (Type type in types) - { - using (TraceContext context = new TraceContext(SourceLevels.Error)) - { - var definition = AttributedModelServices.CreatePartDefinition(type, null, true); - definition.ImportDefinitions.Count(); - - Assert.IsNotNull(context.LastTraceEvent); - Assert.AreEqual(context.LastTraceEvent.EventType, TraceEventType.Error); - Assert.AreEqual(context.LastTraceEvent.Id, TraceId.Discovery_MemberMarkedWithMultipleImportAndImportMany); - } - } - } -#endif - - private Export[] CreateSimpleExports(object value) - { - var export = ExportFactory.Create("NoContract", () => value); - - return new Export[] { export }; - } - - private ReflectionComposablePart CreatePartWithExport() - { - return CreatePart(typeof(StaticExportClass)); - } - - private ReflectionComposablePart CreatePartWithNonRecomposableImport() - { - return CreatePart(typeof(SingleImportWithAllowDefault)); - } - - private ReflectionComposablePart CreatePartWithZeroOrOneImport() - { - return CreatePart(typeof(SingleImportWithAllowDefault)); - } - - private ReflectionComposablePart CreatePartWithExactlyOneImport() - { - return CreatePart(typeof(SingleImport)); - } - - private ReflectionComposablePart CreateDefaultPart() - { - return CreatePart(new object()); - } - - [PartNotDiscoverable] - [Export] - public class DisposablePart : IDisposable - { - [Import(AllowDefault = true)] - public int Foo { get; set; } - - public void Dispose() { } - } - - private ReflectionComposablePart CreateDefaultDisposablePart() - { - return CreatePart(typeof(DisposablePart)); - } - - private ReflectionComposablePart CreatePart(object instance) - { - if (instance is Type) - { - var definition = PartDefinitionFactory.CreateAttributed((Type)instance); - - return (ReflectionComposablePart)definition.CreatePart(); - } - else - { - var definition = PartDefinitionFactory.CreateAttributed(instance.GetType()); - - return new ReflectionComposablePart(definition, instance); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberExportDefinitionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberExportDefinitionTests.cs deleted file mode 100644 index cad1f40d5cc..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberExportDefinitionTests.cs +++ /dev/null @@ -1,172 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.Linq; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - [TestClass] - public class ReflectionMemberExportDefinitionTests - { - private static ReflectionMemberExportDefinition CreateReflectionExportDefinition(LazyMemberInfo exportMember, string contractname, IDictionary metadata) - { - return CreateReflectionExportDefinition(exportMember, contractname, metadata, null); - } - - private static ReflectionMemberExportDefinition CreateReflectionExportDefinition(LazyMemberInfo exportMember, string contractname, IDictionary metadata, ICompositionElement origin) - { - return (ReflectionMemberExportDefinition)ReflectionModelServices.CreateExportDefinition( - exportMember, contractname, CreateLazyMetadata(metadata), origin); - } - - private static Lazy> CreateLazyMetadata(IDictionary metadata) - { - return new Lazy>(() => metadata, false); - } - - [TestMethod] - public void Constructor() - { - MemberInfo expectedMember = this.GetType(); - LazyMemberInfo expectedExportingMemberInfo = new LazyMemberInfo(expectedMember); - - string expectedContractName = "Contract"; - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - ReflectionMemberExportDefinition definition = CreateReflectionExportDefinition(expectedExportingMemberInfo, expectedContractName, expectedMetadata); - - Assert.AreEqual(expectedExportingMemberInfo, definition.ExportingLazyMember); - Assert.AreSame(expectedMember, definition.ExportingLazyMember.GetAccessors()[0]); - Assert.AreEqual(MemberTypes.TypeInfo, definition.ExportingLazyMember.MemberType); - - Assert.AreSame(expectedContractName, definition.ContractName); - - Assert.IsNotNull(definition.Metadata); - Assert.IsTrue(definition.Metadata.Keys.SequenceEqual(expectedMetadata.Keys)); - Assert.IsTrue(definition.Metadata.Values.SequenceEqual(expectedMetadata.Values)); - - Assert.IsNull(((ICompositionElement)definition).Origin); - } - - [TestMethod] - public void Constructor_NullMetadata() - { - MemberInfo expectedMember = this.GetType(); - LazyMemberInfo expectedExportingMemberInfo = new LazyMemberInfo(expectedMember); - - string expectedContractName = "Contract"; - - ReflectionMemberExportDefinition definition = CreateReflectionExportDefinition(expectedExportingMemberInfo, expectedContractName, null); - - Assert.AreEqual(expectedExportingMemberInfo, definition.ExportingLazyMember); - Assert.AreSame(expectedMember, definition.ExportingLazyMember.GetAccessors()[0]); - Assert.AreEqual(MemberTypes.TypeInfo, definition.ExportingLazyMember.MemberType); - - Assert.AreSame(expectedContractName, definition.ContractName); - - Assert.IsNotNull(definition.Metadata); - Assert.AreEqual(0, definition.Metadata.Count); - - Assert.IsNull(((ICompositionElement)definition).Origin); - } - - [TestMethod] - public void SetDefinition_OriginIsSet() - { - var expectedPartDefinition = PartDefinitionFactory.CreateAttributed(typeof(object)); - var exportDefinition = CreateReflectionExportDefinition(new LazyMemberInfo(this.GetType()), "ContractName", null, expectedPartDefinition); - - Assert.AreSame(expectedPartDefinition, ((ICompositionElement)exportDefinition).Origin); - } - - [TestMethod] - public void SetDefinition_PartDefinitionDoesNotContainCreationPolicy_CreationPolicyShouldNotBeInMetadata() - { - var expectedPartDefinition = PartDefinitionFactory.CreateAttributed(typeof(object)); - var exportDefinition = CreateReflectionExportDefinition(new LazyMemberInfo(this.GetType()), "ContractName", null); - - Assert.IsFalse(exportDefinition.Metadata.ContainsKey(CompositionConstants.PartCreationPolicyMetadataName)); - } - - [TestMethod] - public void ICompositionElementDisplayName_ValueAsContractName_ShouldIncludeContractName() - { - var contractNames = Expectations.GetContractNamesWithEmpty(); - - foreach (var contractName in contractNames) - { - if (string.IsNullOrEmpty(contractName)) continue; - var definition = (ICompositionElement)CreateReflectionExportDefinition(new LazyMemberInfo(typeof(string)), contractName, null); - - var e = CreateDisplayNameExpectation(contractName); - - Assert.AreEqual(e, definition.DisplayName); - } - } - - [TestMethod] - public void ICompositionElementDisplayName_TypeAsMember_ShouldIncludeMemberDisplayName() - { - var types = Expectations.GetTypes(); - - foreach (var type in types) - { - var definition = (ICompositionElement)CreateReflectionExportDefinition(new LazyMemberInfo(type), "Contract", null); - - var e = CreateDisplayNameExpectation(type); - - Assert.AreEqual(e, definition.DisplayName); - } - } - - [TestMethod] - public void ICompositionElementDisplayName_ValueAsMember_ShouldIncludeMemberDisplayName() - { - var members = Expectations.GetMembers(); - - foreach (var member in members) - { - var definition = (ICompositionElement)CreateReflectionExportDefinition(new LazyMemberInfo(member), "Contract", null); - - var e = CreateDisplayNameExpectation(member); - - Assert.AreEqual(e, definition.DisplayName); - } - } - - [TestMethod] - public void ToString_ShouldReturnDisplayName() - { - var members = Expectations.GetMembers(); - - foreach (var member in members) - { - var definition = (ICompositionElement)CreateReflectionExportDefinition(new LazyMemberInfo(member), "Contract", null); - - Assert.AreEqual(definition.DisplayName, definition.ToString()); - } - } - - private static string CreateDisplayNameExpectation(string contractName) - { - return String.Format("System.String (ContractName=\"{0}\")", contractName); - } - - private static string CreateDisplayNameExpectation(MemberInfo member) - { - return String.Format("{0} (ContractName=\"Contract\")", member.GetDisplayName()); - } - - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberImportDefinitionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberImportDefinitionTests.cs deleted file mode 100644 index 5705310c7d9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberImportDefinitionTests.cs +++ /dev/null @@ -1,85 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.Linq; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - [TestClass] - public class ReflectionMemberImportDefinitionTests - { - [TestMethod] - public void Constructor() - { - PropertyInfo expectedMember = typeof(PublicImportsExpectingPublicExports).GetProperty("PublicImportPublicProperty"); - LazyMemberInfo expectedImportingMemberInfo = new LazyMemberInfo(expectedMember); - IEnumerable> requiredMetadata = new KeyValuePair[] { new KeyValuePair("Foo", typeof(object)) }; - - ReflectionMemberImportDefinition definition = new ReflectionMemberImportDefinition( - expectedImportingMemberInfo, "Contract", (string)null, requiredMetadata, ImportCardinality.ZeroOrMore, true, CreationPolicy.NonShared, null); - - Assert.AreEqual(expectedImportingMemberInfo, definition.ImportingLazyMember); - - Assert.AreEqual("Contract", definition.ContractName); - Assert.AreSame(requiredMetadata, definition.RequiredMetadata); - Assert.AreEqual(CreationPolicy.NonShared, definition.RequiredCreationPolicy); - Assert.AreEqual(true, definition.IsRecomposable); - Assert.AreEqual(false, definition.IsPrerequisite); - Assert.IsNull(((ICompositionElement)definition).Origin); - Assert.IsNotNull(((ICompositionElement)definition).DisplayName); - Assert.IsTrue(((ICompositionElement)definition).DisplayName.Contains(expectedMember.GetDisplayName())); - } - - [TestMethod] - public void Constructor_WithNullRequiredMetadata() - { - LazyMemberInfo member = CreateLazyMemberInfo(); - - ReflectionMemberImportDefinition definition = new ReflectionMemberImportDefinition( - member, "Contract", (string)null, null, ImportCardinality.ZeroOrMore, true, CreationPolicy.NonShared, null); - - Assert.IsNotNull(definition.RequiredMetadata); - Assert.AreEqual(0, definition.RequiredMetadata.Count()); - } - - [TestMethod] - public void SetDefinition_OriginIsSet() - { - LazyMemberInfo member = CreateLazyMemberInfo(); - var expectedPartDefinition = PartDefinitionFactory.CreateAttributed(typeof(object)); - ReflectionMemberImportDefinition definition = new ReflectionMemberImportDefinition( - member, "Contract", (string)null, null, ImportCardinality.ZeroOrMore, true, CreationPolicy.NonShared, expectedPartDefinition); - - Assert.AreSame(expectedPartDefinition, ((ICompositionElement)definition).Origin); - } - - [TestMethod] - public void ToString_ShouldReturnDisplayName() - { - var members = Expectations.GetMembers(); - - foreach (var member in members) - { - var definition = (ICompositionElement)new ReflectionMemberImportDefinition( - new LazyMemberInfo(member), "Contract", (string)null, null, ImportCardinality.ZeroOrMore, true, CreationPolicy.NonShared, null); - - Assert.AreEqual(definition.DisplayName, definition.ToString()); - } - } - - private static LazyMemberInfo CreateLazyMemberInfo() - { - PropertyInfo expectedMember = typeof(PublicImportsExpectingPublicExports).GetProperty("PublicImportPublicProperty"); - return new LazyMemberInfo(expectedMember); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServicesTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServicesTests.cs deleted file mode 100644 index 4cf4d95b94e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServicesTests.cs +++ /dev/null @@ -1,1098 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.Linq; -using System.UnitTesting; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - [TestClass] - public class ReflectionModelServicesTests - { - [TestMethod] - public void CreatePartDefinition() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, false, - new Lazy>(() => expectedImports), - new Lazy>(() => expectedExports), - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - ReflectionComposablePartDefinition definition = partDefinition as ReflectionComposablePartDefinition; - Assert.IsNotNull(definition); - - Assert.AreSame(expectedType, definition.GetPartType()); - Assert.IsTrue(definition.Metadata.Keys.SequenceEqual(expectedMetadata.Keys)); - Assert.IsTrue(definition.Metadata.Values.SequenceEqual(expectedMetadata.Values)); - Assert.IsTrue(definition.ExportDefinitions.SequenceEqual(expectedExports.Cast())); - Assert.IsTrue(definition.ImportDefinitions.SequenceEqual(expectedImports.Cast())); - Assert.AreSame(expectedOrigin, ((ICompositionElement)definition).Origin); - Assert.IsNotNull(((ICompositionElement)definition).DisplayName); - Assert.IsFalse(definition.IsDisposalRequired); - } - - [TestMethod] - public void CreatePartDefinition_Disposable() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, true, - new Lazy>(() => expectedImports), - new Lazy>(() => expectedExports), - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - ReflectionComposablePartDefinition definition = partDefinition as ReflectionComposablePartDefinition; - Assert.IsNotNull(definition); - - Assert.AreSame(expectedType, definition.GetPartType()); - Assert.IsTrue(definition.Metadata.Keys.SequenceEqual(expectedMetadata.Keys)); - Assert.IsTrue(definition.Metadata.Values.SequenceEqual(expectedMetadata.Values)); - Assert.IsTrue(definition.ExportDefinitions.SequenceEqual(expectedExports.Cast())); - Assert.IsTrue(definition.ImportDefinitions.SequenceEqual(expectedImports.Cast())); - Assert.AreSame(expectedOrigin, ((ICompositionElement)definition).Origin); - Assert.IsNotNull(((ICompositionElement)definition).DisplayName); - Assert.IsTrue(definition.IsDisposalRequired); - } - - [TestMethod] - public void CreatePartDefinition_NullMetadataAllowed() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, false, - new Lazy>(() => expectedImports), - new Lazy>(() => expectedExports), - null, expectedOrigin); - Assert.IsNotNull(partDefinition); - - ReflectionComposablePartDefinition definition = partDefinition as ReflectionComposablePartDefinition; - Assert.IsNotNull(definition); - Assert.IsNotNull(definition.Metadata); - Assert.AreEqual(0, definition.Metadata.Count); - } - - [TestMethod] - public void CreatePartDefinition_EvaluatedNullMetadataAllowed() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - IDictionary expectedMetadata = null; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, false, - new Lazy>(() => expectedImports), - new Lazy>(() => expectedExports), - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - ReflectionComposablePartDefinition definition = partDefinition as ReflectionComposablePartDefinition; - Assert.IsNotNull(definition); - Assert.IsNotNull(definition.Metadata); - Assert.AreEqual(0, definition.Metadata.Count); - } - - - [TestMethod] - public void CreatePartDefinition_NullExportsAllowed() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - IDictionary expectedMetadata = new Dictionary(); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, false, - new Lazy>(() => expectedImports), - null, - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - ReflectionComposablePartDefinition definition = partDefinition as ReflectionComposablePartDefinition; - Assert.IsNotNull(definition); - Assert.IsNotNull(definition.ExportDefinitions); - Assert.AreEqual(0, definition.ExportDefinitions.Count()); - } - - [TestMethod] - public void CreatePartDefinition_EvaluatedNullExportsAllowed() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - IDictionary expectedMetadata = new Dictionary(); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, false, - new Lazy>(() => expectedImports), - new Lazy>(() => null), - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - ReflectionComposablePartDefinition definition = partDefinition as ReflectionComposablePartDefinition; - Assert.IsNotNull(definition); - Assert.IsNotNull(definition.ExportDefinitions); - Assert.AreEqual(0, definition.ExportDefinitions.Count()); - } - - [TestMethod] - public void CreatePartDefinition_ExportsMustBeOfRightType() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - IDictionary expectedMetadata = new Dictionary(); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, false, - new Lazy>(() => expectedImports), - new Lazy>(() => CreateInvalidExports()), - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - ReflectionComposablePartDefinition definition = partDefinition as ReflectionComposablePartDefinition; - Assert.IsNotNull(definition); - - ExceptionAssert.Throws(() => - { - definition.ExportDefinitions.Count(); - }); - } - - [TestMethod] - public void CreatePartDefinition_NullImportsAllowed() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - IDictionary expectedMetadata = new Dictionary(); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, false, - null, - new Lazy>(() => expectedExports), - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - ReflectionComposablePartDefinition definition = partDefinition as ReflectionComposablePartDefinition; - Assert.IsNotNull(definition); - Assert.IsNotNull(definition.ImportDefinitions); - Assert.AreEqual(0, definition.ImportDefinitions.Count()); - } - - [TestMethod] - public void CreatePartDefinition_EvaluatedNullImportsAllowed() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - IDictionary expectedMetadata = new Dictionary(); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, false, - new Lazy>(() => null), - new Lazy>(() => expectedExports), - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - ReflectionComposablePartDefinition definition = partDefinition as ReflectionComposablePartDefinition; - Assert.IsNotNull(definition); - Assert.IsNotNull(definition.ImportDefinitions); - Assert.AreEqual(0, definition.ImportDefinitions.Count()); - } - - [TestMethod] - public void CreatePartDefinition_ImportsMustBeOfRightType() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - IDictionary expectedMetadata = new Dictionary(); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, false, - new Lazy>(() => CreateInvalidImports()), - new Lazy>(() => expectedExports), - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - ReflectionComposablePartDefinition definition = partDefinition as ReflectionComposablePartDefinition; - Assert.IsNotNull(definition); - ExceptionAssert.Throws(() => - { - definition.ImportDefinitions.Count(); - }); - - } - - [TestMethod] - public void CreatePartDefinition_NullTypeNotAllowed() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ExceptionAssert.ThrowsArgument("partType", () => - { - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(null, false, - new Lazy>(() => expectedImports), - new Lazy>(() => expectedExports), - expectedMetadata.AsLazy(), expectedOrigin); - }); - } - - - [TestMethod] - public void CreatePartDefinition_NullEvaluatedTypeNotAllowed() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(new Lazy(() => null), false, - new Lazy>(() => expectedImports), - new Lazy>(() => expectedExports), - expectedMetadata.AsLazy(), expectedOrigin); - - ReflectionComposablePartDefinition definition = partDefinition as ReflectionComposablePartDefinition; - Assert.IsNotNull(definition); - - ExceptionAssert.Throws(() => - { - definition.GetPartType(); - }); - } - - [TestMethod] - public void GetPartType() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, false, - new Lazy>(() => expectedImports), - new Lazy>(() => expectedExports), - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - Lazy lazyPartType = ReflectionModelServices.GetPartType(partDefinition); - Assert.AreEqual(expectedLazyType, lazyPartType); - } - - [TestMethod] - public void GetPartType_NullAsPart_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("partDefinition", () => - { - ReflectionModelServices.GetPartType(null); - }); - } - - [TestMethod] - public void GetPartType_InvalidPart_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("partDefinition", () => - { - ReflectionModelServices.GetPartType(new InvalidPartDefinition()); - }); - } - - - [TestMethod] - public void IsDisposalRequired_ForNonDisposable() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, false, - new Lazy>(() => expectedImports), - new Lazy>(() => expectedExports), - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - bool isDisposalRequired = ReflectionModelServices.IsDisposalRequired(partDefinition); - Assert.IsFalse(isDisposalRequired); - } - - [TestMethod] - public void IsDisposalRequired_ForDisposable() - { - Type expectedType = typeof(TestPart); - Lazy expectedLazyType = expectedType.AsLazy(); - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - IEnumerable expectedImports = CreateImports(expectedType); - IEnumerable expectedExports = CreateExports(expectedType); - - ICompositionElement expectedOrigin = new MockOrigin(); - - ComposablePartDefinition partDefinition = ReflectionModelServices.CreatePartDefinition(expectedLazyType, true, - new Lazy>(() => expectedImports), - new Lazy>(() => expectedExports), - expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(partDefinition); - - bool isDisposalRequired = ReflectionModelServices.IsDisposalRequired(partDefinition); - Assert.IsTrue(isDisposalRequired); - } - - - [TestMethod] - public void IsDisposalRequired_NullAsPart_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("partDefinition", () => - { - ReflectionModelServices.IsDisposalRequired(null); - }); - } - - [TestMethod] - public void IsDisposalRequired_InvalidPart_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("partDefinition", () => - { - ReflectionModelServices.IsDisposalRequired(new InvalidPartDefinition()); - }); - } - - [TestMethod] - public void CreateExportDefinition() - { - PropertyInfo property = typeof(TestPart).GetProperties().First(); - LazyMemberInfo expectedLazyMember = new LazyMemberInfo(property); - - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - string expectedContractName = "Foo"; - - ICompositionElement expectedOrigin = new MockOrigin(); - - ExportDefinition exportDefinition = ReflectionModelServices.CreateExportDefinition(expectedLazyMember, expectedContractName, expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(exportDefinition); - ReflectionMemberExportDefinition definition = exportDefinition as ReflectionMemberExportDefinition; - Assert.IsNotNull(definition); - - Assert.AreEqual(expectedContractName, definition.ContractName); - Assert.IsTrue(definition.Metadata.Keys.SequenceEqual(expectedMetadata.Keys)); - Assert.IsTrue(definition.Metadata.Values.SequenceEqual(expectedMetadata.Values)); - Assert.AreEqual(expectedOrigin, ((ICompositionElement)definition).Origin); - Assert.AreEqual(expectedLazyMember, definition.ExportingLazyMember); - } - - [TestMethod] - public void CreateExportDefinition_NullAsContractName_ThrowsNullArgument() - { - PropertyInfo property = typeof(TestPart).GetProperties().First(); - LazyMemberInfo expectedLazyMember = new LazyMemberInfo(property); - - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - - ICompositionElement expectedOrigin = new MockOrigin(); - - ExceptionAssert.ThrowsArgument("contractName", () => - { - ReflectionModelServices.CreateExportDefinition(expectedLazyMember, null, expectedMetadata.AsLazy(), expectedOrigin); - }); - } - - public void CreateExportDefinition_NullAsMetadata_Allowed() - { - PropertyInfo property = typeof(TestPart).GetProperties().First(); - LazyMemberInfo expectedLazyMember = new LazyMemberInfo(property); - - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - string expectedContractName = "Foo"; - ICompositionElement expectedOrigin = new MockOrigin(); - - ExportDefinition definition = ReflectionModelServices.CreateExportDefinition(expectedLazyMember, expectedContractName, expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(definition.Metadata); - Assert.AreEqual(0, definition.Metadata.Count); - } - - [TestMethod] - public void CreateExportDefinition_InvalidLazymemberInfo_ShouldThrowArtument() - { - EventInfo _event = typeof(TestPart).GetEvents().First(); - LazyMemberInfo expectedLazyMember = new LazyMemberInfo(_event); - - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - string expectedContractName = "Foo"; - - ICompositionElement expectedOrigin = new MockOrigin(); - - ExceptionAssert.ThrowsArgument("exportingMember", () => - { - ReflectionModelServices.CreateExportDefinition(expectedLazyMember, expectedContractName, expectedMetadata.AsLazy(), expectedOrigin); - }); - } - - [TestMethod] - public void GetExportingMember() - { - PropertyInfo property = typeof(TestPart).GetProperties().First(); - LazyMemberInfo expectedLazyMember = new LazyMemberInfo(property); - - IDictionary expectedMetadata = new Dictionary(); - expectedMetadata["Key1"] = 1; - expectedMetadata["Key2"] = "Value2"; - - string expectedContractName = "Foo"; - - ICompositionElement expectedOrigin = new MockOrigin(); - - ExportDefinition exportDefinition = ReflectionModelServices.CreateExportDefinition(expectedLazyMember, expectedContractName, expectedMetadata.AsLazy(), expectedOrigin); - Assert.IsNotNull(exportDefinition); - - LazyMemberInfo lazyMember = ReflectionModelServices.GetExportingMember(exportDefinition); - Assert.AreEqual(expectedLazyMember, lazyMember); - } - - [TestMethod] - public void GetExportingMember_NullAsExportDefinition_ShouldThrowArhumentNull() - { - ExceptionAssert.ThrowsArgument("exportDefinition", () => - { - ReflectionModelServices.GetExportingMember(null); - }); - } - - [TestMethod] - public void GetExportingMember_InvalidExportDefinition_ShouldThrowArhumentNull() - { - ExceptionAssert.ThrowsArgument("exportDefinition", () => - { - ReflectionModelServices.GetExportingMember(new ExportDefinition("Foo", null)); - }); - } - - [TestMethod] - public void CreateImportDefinition_Member() - { - PropertyInfo property = typeof(TestPart).GetProperties().First(); - LazyMemberInfo expectedLazyMember = new LazyMemberInfo(property); - - string expectedContractName = "Foo"; - string expectedRequiredTypeIdentity = "Bar"; - KeyValuePair[] expectedRequiredMetadata = new KeyValuePair[] { new KeyValuePair("Key1", typeof(string)), new KeyValuePair("Key2", typeof(int)) }; - ImportCardinality expectedCardinality = ImportCardinality.ExactlyOne; - CreationPolicy expectedCreationPolicy = CreationPolicy.NonShared; - bool expectedRecomposable = true; - - ICompositionElement expectedOrigin = new MockOrigin(); - - ImportDefinition importDefinition = ReflectionModelServices.CreateImportDefinition( - expectedLazyMember, - expectedContractName, - expectedRequiredTypeIdentity, - expectedRequiredMetadata, - expectedCardinality, - expectedRecomposable, - expectedCreationPolicy, - expectedOrigin); - Assert.IsNotNull(importDefinition); - - ReflectionMemberImportDefinition definition = importDefinition as ReflectionMemberImportDefinition; - Assert.IsNotNull(definition); - - Assert.AreEqual(expectedLazyMember, definition.ImportingLazyMember); - Assert.AreEqual(definition.ContractName, expectedContractName); - Assert.AreEqual(definition.RequiredTypeIdentity, expectedRequiredTypeIdentity); - Assert.IsTrue(definition.RequiredMetadata.SequenceEqual(expectedRequiredMetadata)); - Assert.AreEqual(definition.Cardinality, expectedCardinality); - Assert.AreEqual(definition.RequiredCreationPolicy, expectedCreationPolicy); - Assert.AreEqual(definition.IsRecomposable, expectedRecomposable); - Assert.AreSame(expectedOrigin, ((ICompositionElement)definition).Origin); - Assert.IsFalse(definition.IsPrerequisite); - } - - [TestMethod] - public void CreateImportDefinition_Member_InvalidMember_ShouldThrowArgument() - { - MethodInfo method = typeof(TestPart).GetMethods().First(); - LazyMemberInfo expectedLazyMember = new LazyMemberInfo(method); - - string expectedContractName = "Foo"; - string expectedRequiredTypeIdentity = "Bar"; - KeyValuePair[] expectedRequiredMetadata = new KeyValuePair[] { new KeyValuePair("Key1", typeof(string)), new KeyValuePair("Key2", typeof(int)) }; - ImportCardinality expectedCardinality = ImportCardinality.ExactlyOne; - CreationPolicy expectedCreationPolicy = CreationPolicy.NonShared; - bool expectedRecomposable = true; - - ICompositionElement expectedOrigin = new MockOrigin(); - - ExceptionAssert.ThrowsArgument("importingMember", () => - { - ReflectionModelServices.CreateImportDefinition( - expectedLazyMember, - expectedContractName, - expectedRequiredTypeIdentity, - expectedRequiredMetadata, - expectedCardinality, - expectedRecomposable, - expectedCreationPolicy, - expectedOrigin); - }); - } - - [TestMethod] - public void GetImporingMember() - { - PropertyInfo property = typeof(TestPart).GetProperties().First(); - LazyMemberInfo expectedLazyMember = new LazyMemberInfo(property); - - string expectedContractName = "Foo"; - string expectedRequiredTypeIdentity = "Bar"; - KeyValuePair[] expectedRequiredMetadata = new KeyValuePair[] { new KeyValuePair("Key1", typeof(string)), new KeyValuePair("Key2", typeof(int)) }; - ImportCardinality expectedCardinality = ImportCardinality.ExactlyOne; - CreationPolicy expectedCreationPolicy = CreationPolicy.NonShared; - bool expectedRecomposable = true; - - ICompositionElement expectedOrigin = new MockOrigin(); - - ImportDefinition importDefinition = ReflectionModelServices.CreateImportDefinition( - expectedLazyMember, - expectedContractName, - expectedRequiredTypeIdentity, - expectedRequiredMetadata, - expectedCardinality, - expectedRecomposable, - expectedCreationPolicy, - expectedOrigin); - Assert.IsNotNull(importDefinition); - - LazyMemberInfo lazyMember = ReflectionModelServices.GetImportingMember(importDefinition); - Assert.AreEqual(expectedLazyMember, lazyMember); - } - - [TestMethod] - public void GetImporingMember_NullAsImport_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("importDefinition", () => - { - ReflectionModelServices.GetImportingMember(null); - }); - } - - [TestMethod] - public void GetImporingMember_InvalidImport_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("importDefinition", () => - { - ReflectionModelServices.GetImportingMember(new ContractBasedImportDefinition("Foo", "Foo", null, ImportCardinality.ZeroOrMore, false, false, CreationPolicy.Any)); - }); - } - - - - [TestMethod] - public void CreateImportDefinition_Parameter() - { - - ParameterInfo parameter = typeof(TestPart).GetConstructor(new Type[] { typeof(int) }).GetParameters()[0]; - Lazy expectedLazyParameter = parameter.AsLazy(); - - string expectedContractName = "Foo"; - string expectedRequiredTypeIdentity = "Bar"; - KeyValuePair[] expectedRequiredMetadata = new KeyValuePair[] { new KeyValuePair("Key1", typeof(string)), new KeyValuePair("Key2", typeof(int)) }; - ImportCardinality expectedCardinality = ImportCardinality.ExactlyOne; - CreationPolicy expectedCreationPolicy = CreationPolicy.NonShared; - - ICompositionElement expectedOrigin = new MockOrigin(); - - ImportDefinition importDefinition = ReflectionModelServices.CreateImportDefinition( - expectedLazyParameter, - expectedContractName, - expectedRequiredTypeIdentity, - expectedRequiredMetadata, - expectedCardinality, - expectedCreationPolicy, - expectedOrigin); - Assert.IsNotNull(importDefinition); - - ReflectionParameterImportDefinition definition = importDefinition as ReflectionParameterImportDefinition; - Assert.IsNotNull(definition); - - Assert.AreEqual(expectedLazyParameter, definition.ImportingLazyParameter); - Assert.AreEqual(definition.ContractName, expectedContractName); - Assert.AreEqual(definition.RequiredTypeIdentity, expectedRequiredTypeIdentity); - Assert.IsTrue(definition.RequiredMetadata.SequenceEqual(expectedRequiredMetadata)); - Assert.AreEqual(definition.Cardinality, expectedCardinality); - Assert.AreEqual(definition.RequiredCreationPolicy, expectedCreationPolicy); - Assert.IsFalse(definition.IsRecomposable); - Assert.AreSame(expectedOrigin, ((ICompositionElement)definition).Origin); - Assert.IsTrue(definition.IsPrerequisite); - } - - [TestMethod] - public void CreateImportDefinition_Parameter_NullAsParamater_ShouldThrowArgumentNull() - { - ParameterInfo parameter = typeof(TestPart).GetConstructor(new Type[] { typeof(int) }).GetParameters()[0]; - Lazy expectedLazyParameter = parameter.AsLazy(); - - string expectedContractName = "Foo"; - string expectedRequiredTypeIdentity = "Bar"; - KeyValuePair[] expectedRequiredMetadata = new KeyValuePair[] { new KeyValuePair("Key1", typeof(string)), new KeyValuePair("Key2", typeof(int)) }; - ImportCardinality expectedCardinality = ImportCardinality.ExactlyOne; - CreationPolicy expectedCreationPolicy = CreationPolicy.NonShared; - - ICompositionElement expectedOrigin = new MockOrigin(); - - ExceptionAssert.ThrowsArgument("parameter", () => - { - ReflectionModelServices.CreateImportDefinition( - null, - expectedContractName, - expectedRequiredTypeIdentity, - expectedRequiredMetadata, - expectedCardinality, - expectedCreationPolicy, - expectedOrigin); - }); - } - - [TestMethod] - public void GetImportingParameter() - { - ParameterInfo parameter = typeof(TestPart).GetConstructor(new Type[] { typeof(int) }).GetParameters()[0]; - Lazy expectedLazyParameter = parameter.AsLazy(); - - string expectedContractName = "Foo"; - string expectedRequiredTypeIdentity = "Bar"; - KeyValuePair[] expectedRequiredMetadata = new KeyValuePair[] { new KeyValuePair("Key1", typeof(string)), new KeyValuePair("Key2", typeof(int)) }; - ImportCardinality expectedCardinality = ImportCardinality.ExactlyOne; - CreationPolicy expectedCreationPolicy = CreationPolicy.NonShared; - - ICompositionElement expectedOrigin = new MockOrigin(); - ImportDefinition importDefinition = ReflectionModelServices.CreateImportDefinition( - expectedLazyParameter, - expectedContractName, - expectedRequiredTypeIdentity, - expectedRequiredMetadata, - expectedCardinality, - expectedCreationPolicy, - expectedOrigin); - Assert.IsNotNull(importDefinition); - - Lazy lazyParameter = ReflectionModelServices.GetImportingParameter(importDefinition); - Assert.AreEqual(expectedLazyParameter, lazyParameter); - } - - [TestMethod] - public void GetImportingParameter_NullAsImport_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("importDefinition", () => - { - ReflectionModelServices.GetImportingParameter(null); - }); - } - - [TestMethod] - public void GetImportingParameter_InvalidImport_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("importDefinition", () => - { - ReflectionModelServices.GetImportingParameter(new ContractBasedImportDefinition("Foo", "Foo", null, ImportCardinality.ZeroOrMore, false, false, CreationPolicy.Any)); - }); - } - - [TestMethod] - public void IsImportingParameter_OnParameterImport() - { - ParameterInfo parameter = typeof(TestPart).GetConstructor(new Type[] { typeof(int) }).GetParameters()[0]; - Lazy expectedLazyParameter = parameter.AsLazy(); - - string expectedContractName = "Foo"; - string expectedRequiredTypeIdentity = "Bar"; - KeyValuePair[] expectedRequiredMetadata = new KeyValuePair[] { new KeyValuePair("Key1", typeof(string)), new KeyValuePair("Key2", typeof(int)) }; - ImportCardinality expectedCardinality = ImportCardinality.ExactlyOne; - CreationPolicy expectedCreationPolicy = CreationPolicy.NonShared; - - ICompositionElement expectedOrigin = new MockOrigin(); - ImportDefinition importDefinition = ReflectionModelServices.CreateImportDefinition( - expectedLazyParameter, - expectedContractName, - expectedRequiredTypeIdentity, - expectedRequiredMetadata, - expectedCardinality, - expectedCreationPolicy, - expectedOrigin); - Assert.IsNotNull(importDefinition); - - Assert.IsTrue(ReflectionModelServices.IsImportingParameter(importDefinition)); - } - - [TestMethod] - public void IsImportingParameter_OnMemberImport() - { - PropertyInfo property = typeof(TestPart).GetProperties().First(); - LazyMemberInfo expectedLazyMember = new LazyMemberInfo(property); - - string expectedContractName = "Foo"; - string expectedRequiredTypeIdentity = "Bar"; - KeyValuePair[] expectedRequiredMetadata = new KeyValuePair[] { new KeyValuePair("Key1", typeof(string)), new KeyValuePair("Key2", typeof(int)) }; - ImportCardinality expectedCardinality = ImportCardinality.ExactlyOne; - CreationPolicy expectedCreationPolicy = CreationPolicy.NonShared; - bool expectedRecomposable = true; - - ICompositionElement expectedOrigin = new MockOrigin(); - - ImportDefinition importDefinition = ReflectionModelServices.CreateImportDefinition( - expectedLazyMember, - expectedContractName, - expectedRequiredTypeIdentity, - expectedRequiredMetadata, - expectedCardinality, - expectedRecomposable, - expectedCreationPolicy, - expectedOrigin); - Assert.IsNotNull(importDefinition); - - Assert.IsFalse(ReflectionModelServices.IsImportingParameter(importDefinition)); - } - - [TestMethod] - public void IsImportingParameter_NullAsImport_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("importDefinition", () => - { - ReflectionModelServices.IsImportingParameter(null); - }); - } - - [TestMethod] - public void IsImportingParameter_InvalidImport_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("importDefinition", () => - { - ReflectionModelServices.IsImportingParameter(new ContractBasedImportDefinition("Foo", "Foo", null, ImportCardinality.ZeroOrMore, false, false, CreationPolicy.Any)); - }); - } - - [TestMethod] - public void IsExportFactoryImportDefinition_NullImport_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgumentNull("importDefinition", () => - ReflectionModelServices.IsExportFactoryImportDefinition(null)); - } - - [TestMethod] - public void IsExportFactoryImportDefinition_InvalidImport_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("importDefinition", () => - ReflectionModelServices.IsExportFactoryImportDefinition(CreateInvalidImport())); - } - - [TestMethod] - public void IsExportFactoryImportDefinition_NonPartCreatorImport_ShouldReturnFalse() - { - var import = ReflectionModelServices.CreateImportDefinition( - new LazyMemberInfo(MemberTypes.Field, () => new MemberInfo[] { typeof(ReflectionModelServicesTests) }), // bogus member - "Foo", - "Foo", - Enumerable.Empty>(), - ImportCardinality.ZeroOrMore, - false, - CreationPolicy.Any, - null); - - Assert.IsFalse(ReflectionModelServices.IsExportFactoryImportDefinition(import)); - } - - [TestMethod] - public void IsExportFactoryImportDefinition_PartCreatorImport_ShouldReturnTrue() - { - var import = ReflectionModelServices.CreateImportDefinition( - new LazyMemberInfo(MemberTypes.Field, () => new MemberInfo[] { typeof(ReflectionModelServicesTests) }), // bogus member - "Foo", - "Foo", - Enumerable.Empty>(), - ImportCardinality.ZeroOrMore, - false, - CreationPolicy.Any, - true, //isPartCreator - null); - - Assert.IsTrue(ReflectionModelServices.IsExportFactoryImportDefinition(import)); - } - - [TestMethod] - public void GetPartCreatorProductImportDefinition_NullImport_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgumentNull("importDefinition", () => - ReflectionModelServices.GetPartCreatorProductImportDefinition(null)); - } - - [TestMethod] - public void GetPartCreatorProductImportDefinition_InvalidImport_ShouldThrowArgument() - { - ExceptionAssert.ThrowsArgument("importDefinition", () => - ReflectionModelServices.GetPartCreatorProductImportDefinition(CreateInvalidImport())); - } - - [TestMethod] - public void GetPartCreatorProductImportDefinition_() - { - - } - - [TestMethod] - public void GetPartCreatorProductImportDefinition_PartCreatorImport_() - { - LazyMemberInfo bogusMember = new LazyMemberInfo(MemberTypes.Field, () => new MemberInfo[] { typeof(ReflectionModelServicesTests) }); - var import = ReflectionModelServices.CreateImportDefinition( - bogusMember, - "Foo", - "Foo", - Enumerable.Empty>(), - ImportCardinality.ZeroOrMore, - false, - CreationPolicy.Any, - true, //isPartCreator - null); - - var productImport = ReflectionModelServices.GetPartCreatorProductImportDefinition(import); - - var import2 = ReflectionModelServices.CreateImportDefinition( - bogusMember, - productImport.ContractName, - productImport.RequiredTypeIdentity, - productImport.RequiredMetadata, - productImport.Cardinality, - productImport.IsRecomposable, - productImport.RequiredCreationPolicy, - true, //isPartCreator - null); - - Assert.AreEqual(import.ContractName, import2.ContractName); - Assert.AreEqual(import.Cardinality, import2.Cardinality); - Assert.AreEqual(import.IsRecomposable, import2.IsRecomposable); - Assert.AreEqual(import.RequiredCreationPolicy, import2.RequiredCreationPolicy); - Assert.AreEqual(import.RequiredTypeIdentity, import2.RequiredTypeIdentity); - EnumerableAssert.AreEqual(import.RequiredMetadata, import2.RequiredMetadata); - } - - private static IEnumerable CreateInvalidImports() - { - yield return new ContractBasedImportDefinition("Foo", "Foo", null, ImportCardinality.ZeroOrMore, false, false, CreationPolicy.Any); - } - - private static ImportDefinition CreateInvalidImport() - { - return new ContractBasedImportDefinition("Foo", "Foo", null, ImportCardinality.ZeroOrMore, false, false, CreationPolicy.Any); - } - - private static IEnumerable CreateInvalidExports() - { - yield return new ExportDefinition("Foo", null); - } - - - class InvalidPartDefinition : ComposablePartDefinition - { - public override ComposablePart CreatePart() - { - throw new NotImplementedException(); - } - - public override IEnumerable ExportDefinitions - { - get { throw new NotImplementedException(); } - } - - public override IEnumerable ImportDefinitions - { - get { throw new NotImplementedException(); } - } - } - - private static List CreateImports(Type type) - { - List imports = new List(); - foreach (PropertyInfo property in type.GetProperties()) - { - imports.Add(new ReflectionMemberImportDefinition(new LazyMemberInfo(property), "Contract", (string)null, new KeyValuePair[] { new KeyValuePair("Key1", typeof(string)), new KeyValuePair("Key2", typeof(int)) }, ImportCardinality.ZeroOrOne, true, CreationPolicy.Any, new TypeOrigin(type))); - } - - return imports; - } - - private static List CreateExports(Type type) - { - List exports = new List(); - foreach (PropertyInfo property in type.GetProperties()) - { - exports.Add(ReflectionModelServices.CreateExportDefinition(new LazyMemberInfo(property), "Contract", new Lazy>(() => null), new TypeOrigin(type))); - } - - return exports; - } - - public class TestPart - { - public TestPart(int arg1) - { - } - - public int field1; - public string field2; - public int Property1 { get; set; } - public string Property2 - { - get { return null; } - set - { - this.Event.Invoke(this, null); - } - } - public event EventHandler Event; - } - - private class TypeOrigin : ICompositionElement - { - private readonly Type _type; - private readonly ICompositionElement _orgin; - - public TypeOrigin(Type type) - : this(type, null) - { - } - - public TypeOrigin(Type type, ICompositionElement origin) - { - this._type = type; - this._orgin = origin; - } - - public string DisplayName - { - get - { - return this._type.GetDisplayName(); - } - } - - public ICompositionElement Origin - { - get - { - return this._orgin; - } - } - } - - private class MockOrigin : ICompositionElement - { - public string DisplayName - { - get { throw new NotImplementedException(); } - } - - public ICompositionElement Origin - { - get { throw new NotImplementedException(); } - } - } - - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionParameterImportDefinitionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionParameterImportDefinitionTests.cs deleted file mode 100644 index 5016f9aea34..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/ReflectionModel/ReflectionParameterImportDefinitionTests.cs +++ /dev/null @@ -1,147 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.AttributedModel; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.Linq; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - [TestClass] - public class ReflectionParameterImportDefinitionTests - { - [TestMethod] - public void Constructor() - { - Lazy parameter = CreateLazyParameter(); - IEnumerable> requiredMetadata = new KeyValuePair[] { new KeyValuePair("Foo", typeof(object)) }; - - ReflectionParameterImportDefinition definition = new ReflectionParameterImportDefinition( - parameter, "Contract", (string)null, requiredMetadata, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, null); - - Assert.AreSame(parameter, definition.ImportingLazyParameter); - Assert.AreEqual("Contract", definition.ContractName); - Assert.AreSame(requiredMetadata, definition.RequiredMetadata); - Assert.AreEqual(CreationPolicy.NonShared, definition.RequiredCreationPolicy); - Assert.AreEqual(false, definition.IsRecomposable); - Assert.AreEqual(true, definition.IsPrerequisite); - Assert.IsNull(((ICompositionElement)definition).Origin); - Assert.IsNotNull(((ICompositionElement)definition).DisplayName); - } - - [TestMethod] - public void Constructor_WithNullRequiredMetadata() - { - Lazy parameter = CreateLazyParameter(); - - ReflectionParameterImportDefinition definition = new ReflectionParameterImportDefinition( - parameter, "Contract", (string)null, null, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, null); - - - Assert.IsNotNull(definition.RequiredMetadata); - Assert.AreEqual(0, definition.RequiredMetadata.Count()); - } - - [TestMethod] - public void SetDefinition_OriginIsSet() - { - Lazy parameter = CreateLazyParameter(); - var expectedPartDefinition = PartDefinitionFactory.CreateAttributed(typeof(object)); - - ReflectionParameterImportDefinition definition = new ReflectionParameterImportDefinition( - parameter, "Contract", (string)null, null, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, expectedPartDefinition); - - Assert.AreSame(expectedPartDefinition, ((ICompositionElement)definition).Origin); - } - - - [TestMethod] - public void ICompositionElementDisplayName_ValueAsParameter_ShouldIncludeParameterName() - { - var names = Expectations.GetContractNamesWithEmpty(); - - foreach (var name in names) - { - var definition = CreateReflectionParameterImportDefinition(name); - - var e = CreateDisplayNameExpectationFromParameterName(definition, name); - - Assert.AreEqual(e, ((ICompositionElement)definition).DisplayName); - } - } - - [TestMethod] - public void ICompositionElementDisplayName_ValueAsParameter_ShouldIncludeContractName() - { - var types = Expectations.GetTypes(); - - foreach (var type in types) - { - var definition = CreateReflectionParameterImportDefinition(type); - - var e = CreateDisplayNameExpectationFromContractName(definition, type); - - Assert.AreEqual(e, ((ICompositionElement)definition).DisplayName); - } - } - - [TestMethod] - public void ToString_ShouldReturnICompositionElementDisplayName() - { - var types = Expectations.GetTypes(); - - foreach (var type in types) - { - var definition = CreateReflectionParameterImportDefinition(type); - - Assert.AreEqual(((ICompositionElement)definition).DisplayName, definition.ToString()); - } - } - - - private Lazy CreateLazyParameter() - { - return typeof(SimpleConstructorInjectedObject).GetConstructors().First().GetParameters().First().AsLazy(); - } - - private static string CreateDisplayNameExpectationFromContractName(ReflectionParameterImportDefinition definition, Type type) - { - string contractName = AttributedModelServices.GetContractName(type); - - return String.Format("{0} (Parameter=\"\", ContractName=\"{1}\")", definition.ImportingLazyParameter.Value.Member.GetDisplayName(), contractName); - } - - private static string CreateDisplayNameExpectationFromParameterName(ReflectionParameterImportDefinition definition, string name) - { - return String.Format("{0} (Parameter=\"{1}\", ContractName=\"System.String\")", definition.ImportingLazyParameter.Value.Member.GetDisplayName(), name); - } - - private static ReflectionParameterImportDefinition CreateReflectionParameterImportDefinition(Type parameterType) - { - var parameter = ReflectionFactory.CreateParameter(parameterType); - - return CreateReflectionParameterImportDefinition(parameter); - } - - private static ReflectionParameterImportDefinition CreateReflectionParameterImportDefinition(string name) - { - var parameter = ReflectionFactory.CreateParameter(name); - - return CreateReflectionParameterImportDefinition(parameter); - } - - private static ReflectionParameterImportDefinition CreateReflectionParameterImportDefinition(ParameterInfo parameter) - { - return new ReflectionParameterImportDefinition( - parameter.AsLazy(), AttributedModelServices.GetContractName(parameter.ParameterType), (string)null, null, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, null); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/SampleComponents.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/SampleComponents.cs deleted file mode 100644 index f82d9eabf36..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/SampleComponents.cs +++ /dev/null @@ -1,1023 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - public interface IGetString - { - string GetString(); - } - public class PublicComponentWithPublicExports - { - public const string PublicFieldExpectedValue = "PublicField"; - [Export("PublicField")] - public string PublicField = PublicFieldExpectedValue; - public const string PublicPropertyExpectedValue = "PublicProperty"; - [Export("PublicProperty")] - public string PublicProperty { get { return PublicPropertyExpectedValue; } } - public const string PublicMethodExpectedValue = "PublicMethod"; - [Export("PublicDelegate")] - public string PublicMethod() { return PublicMethodExpectedValue; } - public const string PublicNestedClassExpectedValue = "PublicNestedClass"; - [Export("PublicIGetString", typeof(IGetString))] - public class PublicNestedClass : IGetString - { - public string GetString() { return PublicNestedClassExpectedValue; } - } - } - [Export] - public class PublicImportsExpectingPublicExports - { - [Import("PublicField")] - public string PublicImportPublicField { get; set; } - [Import("PublicProperty")] - public string PublicImportPublicProperty { get; set; } - [Import("PublicDelegate")] - public Func PublicImportPublicMethod { get; set; } - [Import("PublicIGetString")] - public IGetString PublicImportPublicNestedClass { get; set; } - - public void VerifyIsBound() - { - Assert.AreEqual(PublicComponentWithPublicExports.PublicFieldExpectedValue, PublicImportPublicField, "PublicImportPublicField should be bound."); - Assert.AreEqual(PublicComponentWithPublicExports.PublicPropertyExpectedValue, PublicImportPublicProperty, "PublicImportPublicProperty should be bound."); - Assert.AreEqual(PublicComponentWithPublicExports.PublicMethodExpectedValue, PublicImportPublicMethod(), "PublicImportPublicMethod should be bound."); - Assert.AreEqual(PublicComponentWithPublicExports.PublicNestedClassExpectedValue, PublicImportPublicNestedClass.GetString(), "PublicImportPublicNestedClass should be bound and have a method GetString."); - } - } - [Export] - internal class InternalImportsExpectingPublicExports - { - [Import("PublicField")] - internal string InternalImportPublicField { get; set; } - [Import("PublicProperty")] - internal string InternalImportPublicProperty { get; set; } - [Import("PublicDelegate")] - internal Func InternalImportPublicMethod { get; set; } - [Import("PublicIGetString")] - internal IGetString InternalImportPublicNestedClass { get; set; } - - public void VerifyIsBound() - { - Assert.AreEqual(PublicComponentWithPublicExports.PublicFieldExpectedValue, InternalImportPublicField, "InternalImportPublicField should be bound."); - Assert.AreEqual(PublicComponentWithPublicExports.PublicPropertyExpectedValue, InternalImportPublicProperty, "InternalImportPublicProperty should be bound."); - Assert.AreEqual(PublicComponentWithPublicExports.PublicMethodExpectedValue, InternalImportPublicMethod(), "InternalImportPublicMethod should be bound."); - Assert.AreEqual(PublicComponentWithPublicExports.PublicNestedClassExpectedValue, InternalImportPublicNestedClass.GetString(), "InternalImportPublicNestedClass should be bound and have a method GetString."); - } - } - public class PublicComponentWithInternalExports - { - public const string InternalFieldExpectedValue = "InternalField"; - [Export("InternalField")] - internal string InternalField = InternalFieldExpectedValue; - public const string InternalPropertyExpectedValue = "InternalProperty"; - [Export("InternalProperty")] - internal string InternalProperty { get { return InternalPropertyExpectedValue; } } - public const string InternalMethodExpectedValue = "InternalMethod"; - [Export("InternalDelegate")] - internal string InternalMethod() { return InternalMethodExpectedValue; } - public const string InternalNestedClassExpectedValue = "InternalNestedClass"; - [Export("InternalIGetString", typeof(IGetString))] - internal class InternalNestedClass : IGetString - { - public string GetString() { return InternalNestedClassExpectedValue; } - } - } - [Export] - public class PublicImportsExpectingInternalExports - { - [Import("InternalField")] - public string PublicImportInternalField { get; set; } - [Import("InternalProperty")] - public string PublicImportInternalProperty { get; set; } - [Import("InternalDelegate")] - public Func PublicImportInternalMethod { get; set; } - [Import("InternalIGetString", typeof(IGetString))] - public IGetString PublicImportInternalNestedClass { get; set; } - - public void VerifyIsBound() - { - Assert.AreEqual(PublicComponentWithInternalExports.InternalFieldExpectedValue, PublicImportInternalField, "PublicImportInternalField should be bound."); - Assert.AreEqual(PublicComponentWithInternalExports.InternalPropertyExpectedValue, PublicImportInternalProperty, "PublicImportInternalProperty should be bound."); - Assert.AreEqual(PublicComponentWithInternalExports.InternalMethodExpectedValue, PublicImportInternalMethod(), "PublicImportInternalMethod should be bound."); - Assert.AreEqual(PublicComponentWithInternalExports.InternalNestedClassExpectedValue, PublicImportInternalNestedClass.GetString(), "PublicImportInternalNestedClass should be bound and have a method GetString."); - } - } - [Export] - internal class InternalImportsExpectingInternalExports - { - [Import("InternalField")] - internal string InternalImportInternalField { get; set; } - [Import("InternalProperty")] - internal string InternalImportInternalProperty { get; set; } - [Import("InternalDelegate")] - internal Func InternalImportInternalMethod { get; set; } - [Import("InternalIGetString")] - internal IGetString InternalImportInternalNestedClass { get; set; } - - public void VerifyIsBound() - { - Assert.AreEqual(PublicComponentWithInternalExports.InternalFieldExpectedValue, InternalImportInternalField, "InternalImportInternalField should be bound."); - Assert.AreEqual(PublicComponentWithInternalExports.InternalPropertyExpectedValue, InternalImportInternalProperty, "InternalImportInternalProperty should be bound."); - Assert.AreEqual(PublicComponentWithInternalExports.InternalMethodExpectedValue, InternalImportInternalMethod(), "InternalImportInternalMethod should be bound."); - Assert.AreEqual(PublicComponentWithInternalExports.InternalNestedClassExpectedValue, InternalImportInternalNestedClass.GetString(), "InternalImportInternalNestedClass should be bound and have a method GetString."); - } - } - public class PublicComponentWithProtectedExports - { - public const string ProtectedFieldExpectedValue = "ProtectedField"; - [Export("ProtectedField")] - protected string ProtectedField = ProtectedFieldExpectedValue; - public const string ProtectedPropertyExpectedValue = "ProtectedProperty"; - [Export("ProtectedProperty")] - protected string ProtectedProperty { get { return ProtectedPropertyExpectedValue; } } - public const string ProtectedMethodExpectedValue = "ProtectedMethod"; - [Export("ProtectedDelegate")] - protected string ProtectedMethod() { return ProtectedMethodExpectedValue; } - public const string ProtectedNestedClassExpectedValue = "ProtectedNestedClass"; - [Export("ProtectedIGetString", typeof(IGetString))] - protected class ProtectedNestedClass : IGetString - { - public string GetString() { return ProtectedNestedClassExpectedValue; } - } - } - [Export] - public class PublicImportsExpectingProtectedExports - { - [Import("ProtectedField")] - public string PublicImportProtectedField { get; set; } - [Import("ProtectedProperty")] - public string PublicImportProtectedProperty { get; set; } - [Import("ProtectedDelegate")] - public Func PublicImportProtectedMethod { get; set; } - [Import("ProtectedIGetString")] - public IGetString PublicImportProtectedNestedClass { get; set; } - - public void VerifyIsBound() - { - Assert.AreEqual(PublicComponentWithProtectedExports.ProtectedFieldExpectedValue, PublicImportProtectedField, "PublicImportProtectedField should be bound."); - Assert.AreEqual(PublicComponentWithProtectedExports.ProtectedPropertyExpectedValue, PublicImportProtectedProperty, "PublicImportProtectedProperty should be bound."); - Assert.AreEqual(PublicComponentWithProtectedExports.ProtectedMethodExpectedValue, PublicImportProtectedMethod(), "PublicImportProtectedMethod should be bound."); - Assert.AreEqual(PublicComponentWithProtectedExports.ProtectedNestedClassExpectedValue, PublicImportProtectedNestedClass.GetString(), "PublicImportProtectedNestedClass should be bound and have a method GetString."); - } - } - [Export] - internal class InternalImportsExpectingProtectedExports - { - [Import("ProtectedField")] - internal string InternalImportProtectedField { get; set; } - [Import("ProtectedProperty")] - internal string InternalImportProtectedProperty { get; set; } - [Import("ProtectedDelegate")] - internal Func InternalImportProtectedMethod { get; set; } - [Import("ProtectedIGetString")] - internal IGetString InternalImportProtectedNestedClass { get; set; } - - public void VerifyIsBound() - { - Assert.AreEqual(PublicComponentWithProtectedExports.ProtectedFieldExpectedValue, InternalImportProtectedField, "InternalImportProtectedField should be bound."); - Assert.AreEqual(PublicComponentWithProtectedExports.ProtectedPropertyExpectedValue, InternalImportProtectedProperty, "InternalImportProtectedProperty should be bound."); - Assert.AreEqual(PublicComponentWithProtectedExports.ProtectedMethodExpectedValue, InternalImportProtectedMethod(), "InternalImportProtectedMethod should be bound."); - Assert.AreEqual(PublicComponentWithProtectedExports.ProtectedNestedClassExpectedValue, InternalImportProtectedNestedClass.GetString(), "InternalImportProtectedNestedClass should be bound and have a method GetString."); - } - } - public class PublicComponentWithProtectedInternalExports - { - public const string ProtectedInternalFieldExpectedValue = "ProtectedInternalField"; - [Export("ProtectedInternalField")] - protected internal string ProtectedInternalField = ProtectedInternalFieldExpectedValue; - public const string ProtectedInternalPropertyExpectedValue = "ProtectedInternalProperty"; - [Export("ProtectedInternalProperty")] - protected internal string ProtectedInternalProperty { get { return ProtectedInternalPropertyExpectedValue; } } - public const string ProtectedInternalMethodExpectedValue = "ProtectedInternalMethod"; - [Export("ProtectedInternalDelegate")] - protected internal string ProtectedInternalMethod() { return ProtectedInternalMethodExpectedValue; } - public const string ProtectedInternalNestedClassExpectedValue = "ProtectedInternalNestedClass"; - [Export("ProtectedInternalIGetString", typeof(IGetString))] - protected internal class ProtectedInternalNestedClass : IGetString - { - public string GetString() { return ProtectedInternalNestedClassExpectedValue; } - } - } - [Export] - public class PublicImportsExpectingProtectedInternalExports - { - [Import("ProtectedInternalField")] - public string PublicImportProtectedInternalField { get; set; } - [Import("ProtectedInternalProperty")] - public string PublicImportProtectedInternalProperty { get; set; } - [Import("ProtectedInternalDelegate")] - public Func PublicImportProtectedInternalMethod { get; set; } - [Import("ProtectedInternalIGetString")] - public IGetString PublicImportProtectedInternalNestedClass { get; set; } - - public void VerifyIsBound() - { - Assert.AreEqual(PublicComponentWithProtectedInternalExports.ProtectedInternalFieldExpectedValue, PublicImportProtectedInternalField, "PublicImportProtectedInternalField should be bound."); - Assert.AreEqual(PublicComponentWithProtectedInternalExports.ProtectedInternalPropertyExpectedValue, PublicImportProtectedInternalProperty, "PublicImportProtectedInternalProperty should be bound."); - Assert.AreEqual(PublicComponentWithProtectedInternalExports.ProtectedInternalMethodExpectedValue, PublicImportProtectedInternalMethod(), "PublicImportProtectedInternalMethod should be bound."); - Assert.AreEqual(PublicComponentWithProtectedInternalExports.ProtectedInternalNestedClassExpectedValue, PublicImportProtectedInternalNestedClass.GetString(), "PublicImportProtectedInternalNestedClass should be bound and have a method GetString."); - } - } - [Export] - internal class InternalImportsExpectingProtectedInternalExports - { - [Import("ProtectedInternalField")] - internal string InternalImportProtectedInternalField { get; set; } - [Import("ProtectedInternalProperty")] - internal string InternalImportProtectedInternalProperty { get; set; } - [Import("ProtectedInternalDelegate")] - internal Func InternalImportProtectedInternalMethod { get; set; } - [Import("ProtectedInternalIGetString")] - internal IGetString InternalImportProtectedInternalNestedClass { get; set; } - - public void VerifyIsBound() - { - Assert.AreEqual(PublicComponentWithProtectedInternalExports.ProtectedInternalFieldExpectedValue, InternalImportProtectedInternalField, "InternalImportProtectedInternalField should be bound."); - Assert.AreEqual(PublicComponentWithProtectedInternalExports.ProtectedInternalPropertyExpectedValue, InternalImportProtectedInternalProperty, "InternalImportProtectedInternalProperty should be bound."); - Assert.AreEqual(PublicComponentWithProtectedInternalExports.ProtectedInternalMethodExpectedValue, InternalImportProtectedInternalMethod(), "InternalImportProtectedInternalMethod should be bound."); - Assert.AreEqual(PublicComponentWithProtectedInternalExports.ProtectedInternalNestedClassExpectedValue, InternalImportProtectedInternalNestedClass.GetString(), "InternalImportProtectedInternalNestedClass should be bound and have a method GetString."); - } - } - public class PublicComponentWithPrivateExports - { - public const string PrivateFieldExpectedValue = "PrivateField"; - [Export("PrivateField")] - private string PrivateField = PrivateFieldExpectedValue; - public const string PrivatePropertyExpectedValue = "PrivateProperty"; - [Export("PrivateProperty")] - private string PrivateProperty { get { return PrivatePropertyExpectedValue; } } - public const string PrivateMethodExpectedValue = "PrivateMethod"; - [Export("PrivateDelegate")] - private string PrivateMethod() { return PrivateMethodExpectedValue; } - public const string PrivateNestedClassExpectedValue = "PrivateNestedClass"; - [Export("PrivateIGetString", typeof(IGetString))] - private class PrivateNestedClass : IGetString - { - public string GetString() { return PrivateNestedClassExpectedValue; } - } - } - [Export] - public class PublicImportsExpectingPrivateExports - { - [Import("PrivateField")] - public string PublicImportPrivateField { get; set; } - [Import("PrivateProperty")] - public string PublicImportPrivateProperty { get; set; } - [Import("PrivateDelegate")] - public Func PublicImportPrivateMethod { get; set; } - [Import("PrivateIGetString")] - public IGetString PublicImportPrivateNestedClass { get; set; } - - public void VerifyIsBound() - { - Assert.AreEqual(PublicComponentWithPrivateExports.PrivateFieldExpectedValue, PublicImportPrivateField, "PublicImportPrivateField should be bound."); - Assert.AreEqual(PublicComponentWithPrivateExports.PrivatePropertyExpectedValue, PublicImportPrivateProperty, "PublicImportPrivateProperty should be bound."); - Assert.AreEqual(PublicComponentWithPrivateExports.PrivateMethodExpectedValue, PublicImportPrivateMethod(), "PublicImportPrivateMethod should be bound."); - Assert.AreEqual(PublicComponentWithPrivateExports.PrivateNestedClassExpectedValue, PublicImportPrivateNestedClass.GetString(), "PublicImportPrivateNestedClass should be bound and have a method GetString."); - } - } - [Export] - internal class InternalImportsExpectingPrivateExports - { - [Import("PrivateField")] - internal string InternalImportPrivateField { get; set; } - [Import("PrivateProperty")] - internal string InternalImportPrivateProperty { get; set; } - [Import("PrivateDelegate")] - internal Func InternalImportPrivateMethod { get; set; } - [Import("PrivateIGetString")] - internal IGetString InternalImportPrivateNestedClass { get; set; } - - public void VerifyIsBound() - { - Assert.AreEqual(PublicComponentWithPrivateExports.PrivateFieldExpectedValue, InternalImportPrivateField, "InternalImportPrivateField should be bound."); - Assert.AreEqual(PublicComponentWithPrivateExports.PrivatePropertyExpectedValue, InternalImportPrivateProperty, "InternalImportPrivateProperty should be bound."); - Assert.AreEqual(PublicComponentWithPrivateExports.PrivateMethodExpectedValue, InternalImportPrivateMethod(), "InternalImportPrivateMethod should be bound."); - Assert.AreEqual(PublicComponentWithPrivateExports.PrivateNestedClassExpectedValue, InternalImportPrivateNestedClass.GetString(), "InternalImportPrivateNestedClass should be bound and have a method GetString."); - } - } - - [Export("ImportDefaultFunctions")] - public class ImportDefaultFunctions - { - [Import("FunctionWith0Args")] - public Func MyFunction0; - - [Import("FunctionWith1Arg")] - public Func MyFunction1; - - [Import("FunctionWith2Args")] - public Func MyFunction2; - - [Import("FunctionWith3Args")] - public Func MyFunction3; - - [Import("FunctionWith4Args")] - public Func MyFunction4; - - [Import("ActionWith0Args")] - public Action MyAction0; - - [Import("ActionWith1Arg")] - public Action MyAction1; - - [Import("ActionWith2Args")] - public Action MyAction2; - - [Import("ActionWith3Args")] - public Action MyAction3; - - [Import("ActionWith4Args")] - public Action MyAction4; - - public void VerifyIsBound() - { - Assert.AreEqual(0, MyFunction0.Invoke()); - Assert.AreEqual(1, MyFunction1.Invoke(1)); - Assert.AreEqual(3, MyFunction2.Invoke(1, 2)); - Assert.AreEqual(6, MyFunction3.Invoke(1, 2, 3)); - Assert.AreEqual(10, MyFunction4.Invoke(1, 2, 3, 4)); - - MyAction0.Invoke(); - MyAction1.Invoke(1); - MyAction2.Invoke(1, 2); - MyAction3.Invoke(1, 2, 3); - MyAction4.Invoke(1, 2, 3, 4); - } - } - - public class ExportDefaultFunctions - { - [Export("FunctionWith0Args")] - public int MyFunction0() - { - return 0; - } - - [Export("FunctionWith1Arg")] - public int MyFunction1(int i1) - { - return i1; - } - - [Export("FunctionWith2Args")] - public int MyFunction2(int i1, int i2) - { - return i1 + i2; - } - - [Export("FunctionWith3Args")] - public int MyFunction3(int i1, int i2, int i3) - { - return i1 + i2 + i3; - } - - [Export("FunctionWith4Args")] - public int MyFunction4(int i1, int i2, int i3, int i4) - { - return i1 + i2 + i3 + i4; - } - - - - [Export("ActionWith0Args")] - public void MyAction0() - { - } - - [Export("ActionWith1Arg")] - public void MyAction1(int i1) - { - Assert.AreEqual(i1, 1); - } - - [Export("ActionWith2Args")] - public void MyAction2(int i1, int i2) - { - Assert.AreEqual(i1, 1); - Assert.AreEqual(i2, 2); - } - - [Export("ActionWith3Args")] - public void MyAction3(int i1, int i2, int i3) - { - Assert.AreEqual(i1, 1); - Assert.AreEqual(i2, 2); - Assert.AreEqual(i3, 3); - } - - [Export("ActionWith4Args")] - public void MyAction4(int i1, int i2, int i3, int i4) - { - Assert.AreEqual(i1, 1); - Assert.AreEqual(i2, 2); - Assert.AreEqual(i3, 3); - Assert.AreEqual(i4, 4); - } - } - - [Export] - public class CatalogComponentTest - { - } - - [Export] - [PartNotDiscoverable] - public class CatalogComponentTestNonComponentPart - { - } - - public interface ICatalogComponentTest - { - } - - [Export(typeof(ICatalogComponentTest))] - public class CatalogComponentInterfaceTest1 : ICatalogComponentTest - { - } - - public class CatalogComponentInterfaceTest2 - { - [Export] - public ICatalogComponentTest ExportedInterface - { - get { return new CatalogComponentInterfaceTest1(); } - } - } - - public static class StaticExportClass - { - [Export("StaticString")] - public static string StaticString { get { return "StaticString"; } } - } - - [Export] - public class DisposableExportClass : IDisposable - { - public bool IsDisposed { get; set; } - public void Dispose() - { - Assert.IsFalse(IsDisposed); - IsDisposed = true; - } - } - - public interface IServiceView - { - int GetSomeInt(); - } - - [Export("service1")] - public class Service - { - public int GetSomeInt() - { - return 5; - } - } - - public class Client - { - private IServiceView mySerivce; - - [Import("service1")] - public IServiceView MyService - { - get { return mySerivce; } - set { mySerivce = value; } - } - public int GetSomeValue() - { - return MyService.GetSomeInt() * 2; - } - } - - [Export] - public class TrivialExporter - { - public bool done = false; - } - - [Export] - public class TrivialImporter : IPartImportsSatisfiedNotification - { - [Import] - public TrivialExporter checker; - - public void OnImportsSatisfied() - { - checker.done = true; - } - } - - [Export] - public class UnnamedImportAndExport - { - [Import] - public IUnnamedExport ImportedValue; - } - - [Export] - public class StaticExport - { - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class NonStaticExport - { - } - - public interface IUnnamedExport - { - } - - [Export(typeof(IUnnamedExport))] - public class UnnamedExport : IUnnamedExport - { - } - - public interface IExportableTest - { - string Var1 { get; } - } - - [AttributeUsage(AttributeTargets.All)] - [MetadataAttribute] - public class ExportableTestAttribute : Attribute - { - private string var1; - - public string Var1 - { - get { return var1; } - set { var1 = value; } - } - } - - [AttributeUsage(AttributeTargets.All)] - [MetadataAttribute] - [CLSCompliant(false)] - public class MetadataWithCollectionPropertyAttribute : Attribute - { - private string[] values; - - public string[] Values - { - get { return values; } - } - - public MetadataWithCollectionPropertyAttribute(params string[] values) - { - this.values = values; - } - } - - [Export] - [MetadataWithCollectionProperty("One", "two", "3")] - [CLSCompliant(false)] - public class ComponentWithCollectionProperty - { - } - - public interface ICollectionOfStrings - { - IEnumerable Values { get; } - } - - public class SubtractProvider - { - [Export("One")] - public int One = 1; - - [Export("Two")] - public int Two { get { return 2; } } - - [Export("Add")] - [ExportableTest(Var1 = "sub")] - public Func Subtract = (x, y) => x - y; - } - public class RealAddProvider - { - [Export("One")] - public int One = 1; - - [Export("Two")] - public int Two { get { return 2; } } - - [Export("Add")] - [ExportMetadata("Var1", "add")] - public int Add(int x, int y) - { - return x + y; - } - } - public class Consumer - { - [Import("One")] - public int a; - [Import("Two")] - public int b; - [Import("Add")] - public Func op; - [Import("Add", AllowDefault = true)] - public Lazy> opInfo; - } - - public class ConsumerOfMultiple - { - [ImportMany("Add")] - public IEnumerable, IDictionary>> opInfo; - } - - public interface IStrongValueMetadata - { - int value { get; set; } - } - - public class UntypedExportImporter - { - [Import("untyped")] - public Lazy Export; - } - - public class UntypedExportsImporter - { - [ImportMany("untyped")] - public IEnumerable> Exports; - } - - public class DerivedExport : Export - { - } - - public class DerivedExportImporter - { - [Import("derived")] - public DerivedExport Export; - - } - - public class DerivedExportsImporter - { - [ImportMany("derived")] - public IEnumerable Exports; - } - - [Export] - public class NotSoUniqueName - { - public int MyIntProperty { get { return 23; } } - } - - public class NotSoUniqueName2 - { - [Export] - public class NotSoUniqueName - { - public virtual string MyStringProperty { get { return "MyStringProperty"; } } - } - } - - [Export] - public class MyExport - { - } - - [Export] - public class MySharedPartExport - { - [Import("Value", AllowRecomposition = true)] - public int Value { get; set; } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class MyNonSharedPartExport - { - [Import("Value")] - public int Value { get; set; } - } - - public class ExportThatCantBeActivated - { - [Export("ExportMyString")] - public string MyString { get { return "MyString"; } } - - [Import("ContractThatShouldNotexist")] - public string MissingImport { get; set; } - } - - public class GenericContract1 - { - public class GenericContract2 - { - public class GenericContract3 - { - } - } - } - - public class GenericContract4 - { - public class GenericContract5 - { - public class GenericContract6 - { - } - } - } - - public class OuterClassWithGenericNested - { - public class GenericNested - { - } - } - - public class GenericContract7 : - GenericContract4.GenericContract5.GenericContract6 { } - - public class GenericContract8 : GenericContract1.GenericContract2.GenericContract3 { } - - public class NestedParent - { - public class NestedChild { } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class DirectCycleNonSharedPart - { - [Import] - public DirectCycleNonSharedPart NonSharedPart { get; set; } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class CycleNonSharedPart1 - { - [Import] - public CycleNonSharedPart2 NonSharedPart2 { get; set; } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class CycleNonSharedPart2 - { - [Import] - public CycleNonSharedPart1 NonSharedPart1 { get; set; } - } - - [Export] - public class CycleNonSharedPart - { - [Import] - public CycleNonSharedPart1 NonSharedPart1 { get; set; } - } - - [Export] - public class CycleSharedPart1 - { - [Import] - public CycleSharedPart2 SharedPart2 { get; set; } - } - - [Export] - public class CycleSharedPart2 - { - [Import] - public CycleSharedPart1 SharedPart2 { get; set; } - } - - [Export] - public class CycleSharedPart - { - [Import] - public CycleSharedPart1 SharedPart1 { get; set; } - - [Import] - public CycleSharedPart2 SharedPart2 { get; set; } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class NoCycleNonSharedPart - { - [Import] - public SharedPartWithNoCycleNonSharedPart SharedPart { get; set; } - } - - [Export] - public class SharedPartWithNoCycleNonSharedPart - { - [Import] - public NoCycleNonSharedPart NonSharedPart { get; set; } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class CycleWithSharedPartAndNonSharedPart - { - [Import] - public SharedPartWithNoCycleNonSharedPart BeforeNonSharedPart { get; set; } - - [Import] - public CycleWithNonSharedPartOnly NonSharedPart { get; set; } - - [Import] - public SharedPartWithNoCycleNonSharedPart SharedPart { get; set; } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class CycleWithNonSharedPartOnly - { - [Import] - public CycleWithSharedPartAndNonSharedPart NonSharedPart { get; set; } - - } - - [InheritedExport] - public class ExportWithGenericParameter - { - } - - public class ExportWithGenericParameterOfInt - { - [Export] - public ExportWithGenericParameter GenericExport { get { return new ExportWithGenericParameter(); } } - } - - [Export] - public static class StaticExportWithGenericParameter - { - } - - [Export] - public class ExportWhichInheritsFromGeneric : ExportWithGenericParameter - { - - } - - [Export] - public class ExportWithExceptionDuringConstruction - { - public ExportWithExceptionDuringConstruction() - { - throw new NotImplementedException(); - } - } - - [Export] - public class SimpleConstructorInjectedObject - { - [ImportingConstructor] - public SimpleConstructorInjectedObject([Import("CISimpleValue")]int value) - { - CISimpleValue = value; - } - - public int CISimpleValue { get; private set; } - } - - [Export] - public class ClassWithNoMarkedOrDefaultConstructor - { - public ClassWithNoMarkedOrDefaultConstructor(int blah) { } - } - - public class ClassWhichOnlyHasImportingConstructorWithOneArgument - { - [ImportingConstructor] - public ClassWhichOnlyHasImportingConstructorWithOneArgument(int blah) { } - } - - public class ClassWhichOnlyHasImportingConstructor - { - [ImportingConstructor] - public ClassWhichOnlyHasImportingConstructor() { } - } - - public class ClassWhichOnlyHasDefaultConstructor - { - public ClassWhichOnlyHasDefaultConstructor() { } - } - - [Export] - public class BaseExportForImportingConstructors - { - - } - - [Export] - public class ClassWithOnlyHasImportingConstructorButInherits : BaseExportForImportingConstructors - { - [ImportingConstructor] - public ClassWithOnlyHasImportingConstructorButInherits(int blah) { } - } - - [Export] - public class ClassWithOnlyHasMultipleImportingConstructorButInherits : BaseExportForImportingConstructors - { - [ImportingConstructor] - public ClassWithOnlyHasMultipleImportingConstructorButInherits(int blah) { } - - [ImportingConstructor] - public ClassWithOnlyHasMultipleImportingConstructorButInherits(string blah) { } - } - - - [Export] - public class ClassWithMultipleMarkedConstructors - { - [ImportingConstructor] - public ClassWithMultipleMarkedConstructors(int i) { } - - [ImportingConstructor] - public ClassWithMultipleMarkedConstructors(string s) { } - - public ClassWithMultipleMarkedConstructors() { } - } - - [Export] - public class ClassWithOneMarkedAndOneDefaultConstructor - { - [ImportingConstructor] - public ClassWithOneMarkedAndOneDefaultConstructor(int i) { } - - public ClassWithOneMarkedAndOneDefaultConstructor() { } - } - - [Export] - public class ClassWithTwoZeroParameterConstructors - { - public ClassWithTwoZeroParameterConstructors() { } - - static ClassWithTwoZeroParameterConstructors() { } - } - - [Export] - public class ExceptionDuringINotifyImport : IPartImportsSatisfiedNotification - { - [ImportMany("Value")] - public IEnumerable ValuesJustUsedToGetImportCompletedCalled { get; set; } - - public void OnImportsSatisfied() - { - throw new NotImplementedException(); - } - } - - [Export] - public class ClassWithOptionalPostImport - { - [Import(AllowDefault = true)] - public IFormattable Formatter { get; set; } - } - - [Export] - public class ClassWithOptionalPreImport - { - [ImportingConstructor] - public ClassWithOptionalPreImport([Import(AllowDefault = true)] IFormattable formatter) - { - this.Formatter = formatter; - } - - public IFormattable Formatter { get; private set; } - } - - [MetadataAttribute] - public class ThisIsMyMetadataMetadataAttribute : Attribute - { - public string Argument1 { get; set; } - public int Argument2 { get; set; } - public double Argument3 { get; set; } - public string Argument4 { get; set; } - - public ThisIsMyMetadataMetadataAttribute() - { - } - - public ThisIsMyMetadataMetadataAttribute(string Argument1, int Argument2) - { - this.Argument1 = Argument1; - this.Argument2 = Argument2; - } - } - - [Export] - [ThisIsMyMetadataMetadataAttribute("One", 2, Argument3 = 3.0)] - public class ExportedTypeWithConcreteMetadata - { - } - -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/UnitTesting/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/UnitTesting/.gitattributes deleted file mode 100644 index bc32a4e52dd..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/UnitTesting/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/ConstraintAssert.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/UnitTesting/ConstraintAssert.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/UnitTesting/ConstraintAssert.cs deleted file mode 100644 index 1266032df50..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/ComponentModel/Composition/UnitTesting/ConstraintAssert.cs +++ /dev/null @@ -1,37 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.UnitTesting -{ - internal static class ConstraintAssert - { - public static void Contains(Expression> constraint, string contractName) - { - Contains(constraint, contractName, Enumerable.Empty>()); - } - - public static void Contains(Expression> constraint, string contractName, IEnumerable> requiredMetadata) - { - string actualContractName; - IEnumerable> actualRequiredMetadata; - bool success = TryParseConstraint(constraint, out actualContractName, out actualRequiredMetadata); - - Assert.IsTrue(success); - Assert.AreEqual(contractName, actualContractName); - EnumerableAssert.AreEqual(requiredMetadata, actualRequiredMetadata); - } - - private static bool TryParseConstraint(Expression> constraint, out string contractName, out IEnumerable> requiredMetadata) - { - return ContraintParser.TryParseConstraint(constraint, out contractName, out requiredMetadata); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/.gitattributes deleted file mode 100644 index 2b2b014d535..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/.gitattributes +++ /dev/null @@ -1,13 +0,0 @@ -/AdaptingCollectionTests.cs -crlf -/CatalogFilteringTests.cs -crlf -/CompositionContainerAttributedModelCycleTests.cs -crlf -/ConstructorInjectionTests.cs -crlf -/DelayLoadingTests.cs -crlf -/DelegateCompositionTests.cs -crlf -/DiscoveryTests.cs -crlf -/ExportProviderEventTests.cs -crlf -/LifetimeTests.cs -crlf -/PartCreatorTests.cs -crlf -/RecompositionTests.cs -crlf -/RejectionTests.cs -crlf -/RequiredCreationPolicyTests.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/AdaptingCollectionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/AdaptingCollectionTests.cs deleted file mode 100644 index 442cfd59688..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/AdaptingCollectionTests.cs +++ /dev/null @@ -1,405 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; - -namespace System.ComponentModel.Composition -{ - public class FilteringCollection : AdaptingCollection - { - public FilteringCollection(Func, bool> filter) - : base(e => e.Where(filter)) - { - } - } - - public class OrderingCollection : AdaptingCollection - { - public OrderingCollection(Func, object> keySelector) - : this(keySelector, false) - { - } - - public OrderingCollection(Func, object> keySelector, bool descending) - : base(e => descending ? e.OrderByDescending(keySelector) : e.OrderBy(keySelector)) - { - } - } - - public class AdaptingCollection : AdaptingCollection> - { - public AdaptingCollection(Func>>, - IEnumerable>>> adaptor) - : base(adaptor) - { - } - } - - public class AdaptingCollection : ICollection>, INotifyCollectionChanged - { - private readonly List> _allItems = new List>(); - private readonly Func>, IEnumerable>> _adaptor = null; - private List> _adaptedItems = null; - - public AdaptingCollection() : this(null) - { - } - - public AdaptingCollection(Func>, IEnumerable>> adaptor) - { - this._adaptor = adaptor; - } - - public event NotifyCollectionChangedEventHandler CollectionChanged; - - public void ReapplyAdaptor() - { - if (this._adaptedItems != null) - { - this._adaptedItems = null; - this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); - } - } - - protected virtual IEnumerable> Adapt(IEnumerable> collection) - { - if (this._adaptor != null) - { - return this._adaptor.Invoke(collection); - } - - return collection; - } - - protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e) - { - NotifyCollectionChangedEventHandler collectionChanged = this.CollectionChanged; - - if (collectionChanged != null) - { - collectionChanged.Invoke(this, e); - } - } - - private List> AdaptedItems - { - get - { - if (this._adaptedItems == null) - { - this._adaptedItems = Adapt(this._allItems).ToList(); - } - - return this._adaptedItems; - } - } - - #region ICollection Implementation - // Accessors work directly against adapted collection - public bool Contains(Lazy item) - { - return this.AdaptedItems.Contains(item); - } - - public void CopyTo(Lazy[] array, int arrayIndex) - { - this.AdaptedItems.CopyTo(array, arrayIndex); - } - - public int Count - { - get { return this.AdaptedItems.Count; } - } - - public bool IsReadOnly - { - get { return false; } - } - - public IEnumerator> GetEnumerator() - { - return this.AdaptedItems.GetEnumerator(); - } - - Collections.IEnumerator Collections.IEnumerable.GetEnumerator() - { - return this.GetEnumerator(); - } - - // Mutation methods work against complete collection - // and then force a reset of the adapted collection - public void Add(Lazy item) - { - this._allItems.Add(item); - ReapplyAdaptor(); - } - - public void Clear() - { - this._allItems.Clear(); - ReapplyAdaptor(); - } - - public bool Remove(Lazy item) - { - bool removed = this._allItems.Remove(item); - ReapplyAdaptor(); - return removed; - } - #endregion - } - - [TestClass] - public class AdaptingCollectionTests - { - public interface IContract { } - public interface INetworkAwareMetadata - { - [DefaultValue(false)] - bool RequiresOnline { get; } - } - - [Export(typeof(IContract))] - [ExportMetadata("RequiresOnline", true)] - public class NetworkExport : IContract { } - - [Export(typeof(IContract))] - public class NonNetworkExport : IContract { } - - public class FilterExports - { - public FilterExports() - { - this.OnlineOnly = new AdaptingCollection(e => - e.Where(p => p.Metadata.RequiresOnline)); - - this.OnlineOnly2 = new FilteringCollection(p => p.Metadata.RequiresOnline); - } - - [ImportMany] - public AdaptingCollection OnlineOnly { get; set; } - - [ImportMany] - public FilteringCollection OnlineOnly2 { get; set; } - } - - [TestMethod] - public void TestFilteringImports() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(NetworkExport), typeof(NonNetworkExport)); - - var filterExports = new FilterExports(); - container.ComposeParts(filterExports); - - Assert.AreEqual(1, filterExports.OnlineOnly.Count); - Assert.AreEqual(1, filterExports.OnlineOnly2.Count); - } - - public interface IOrderMetadata - { - [DefaultValue(Int32.MaxValue)] - int Order { get; } - } - - [Export(typeof(IContract))] - [ExportMetadata("Order", 2)] - public class BExport : IContract { } - - [Export(typeof(IContract))] - [ExportMetadata("Order", 1)] - public class AExport : IContract { } - - [Export(typeof(IContract))] - public class CExport : IContract { } - - public class OrderExportsByMetadata - { - public OrderExportsByMetadata() - { - this.OrderedItems = new AdaptingCollection(e => - e.OrderBy(p => p.Metadata.Order)); - - this.OrderedItems2 = new OrderingCollection(p => p.Metadata.Order); - } - - [ImportMany] - public AdaptingCollection OrderedItems { get; set; } - - [ImportMany] - public OrderingCollection OrderedItems2 { get; set; } - } - - [TestMethod] - public void TestOrderingImportsByMetadata() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(BExport), typeof(AExport), typeof(CExport)); - var orderExports = new OrderExportsByMetadata(); - - container.ComposeParts(orderExports); - - Assert.IsInstanceOfType(orderExports.OrderedItems.ElementAt(0).Value, typeof(AExport)); - Assert.IsInstanceOfType(orderExports.OrderedItems.ElementAt(1).Value, typeof(BExport)); - Assert.IsInstanceOfType(orderExports.OrderedItems.ElementAt(2).Value, typeof(CExport)); - - Assert.IsInstanceOfType(orderExports.OrderedItems2.ElementAt(0).Value, typeof(AExport)); - Assert.IsInstanceOfType(orderExports.OrderedItems2.ElementAt(1).Value, typeof(BExport)); - Assert.IsInstanceOfType(orderExports.OrderedItems2.ElementAt(2).Value, typeof(CExport)); - } - - public class OrderExportsByName - { - public OrderExportsByName(bool descending) - { - if (descending) - { - this.OrderedItems = new AdaptingCollection(e => - e.OrderByDescending(p => p.Value.GetType().FullName)); - } - else - { - this.OrderedItems = new AdaptingCollection(e => - e.OrderBy(p => p.Value.GetType().FullName)); - } - } - - [ImportMany] - public AdaptingCollection OrderedItems { get; set; } - } - - - [TestMethod] - public void TestOrderingImportsByTypeName() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(BExport), typeof(AExport), typeof(CExport)); - var orderExports = new OrderExportsByName(false); - - container.ComposeParts(orderExports); - - Assert.IsInstanceOfType(orderExports.OrderedItems.ElementAt(0).Value, typeof(AExport)); - Assert.IsInstanceOfType(orderExports.OrderedItems.ElementAt(1).Value, typeof(BExport)); - Assert.IsInstanceOfType(orderExports.OrderedItems.ElementAt(2).Value, typeof(CExport)); - - orderExports = new OrderExportsByName(true); - - container.ComposeParts(orderExports); - - Assert.IsInstanceOfType(orderExports.OrderedItems.ElementAt(0).Value, typeof(CExport)); - Assert.IsInstanceOfType(orderExports.OrderedItems.ElementAt(1).Value, typeof(BExport)); - Assert.IsInstanceOfType(orderExports.OrderedItems.ElementAt(2).Value, typeof(AExport)); - } - - public interface IDynamicFilteredMetadata - { - bool Dynamic { get; } - } - - [Export(typeof(IContract))] - [ExportMetadata("Dynamic", true)] - public class Dynamic1 : IContract { } - - [Export(typeof(IContract))] - [ExportMetadata("Dynamic", true)] - public class Dynamic2 : IContract { } - - [Export(typeof(IContract))] - [ExportMetadata("Dynamic", false)] - public class NonDynamic1 : IContract { } - - public class DynamicFilteredCollection : AdaptingCollection where M : IDynamicFilteredMetadata - { - public DynamicFilteredCollection() - { - } - - private bool _includeDynamic = false; - public bool IncludeDynamic - { - get { return this._includeDynamic; } - set - { - if (this._includeDynamic != value) - { - this.ReapplyAdaptor(); - } - - this._includeDynamic = value; - } - } - - protected override IEnumerable> Adapt(IEnumerable> collection) - { - return collection.Where(p => !p.Metadata.Dynamic || IncludeDynamic); - } - } - - public class DynamicExports - { - [ImportMany] - public DynamicFilteredCollection DynamicCollection { get; set; } - } - - [TestMethod] - public void TestDyamicallyFilteringImports() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Dynamic1), typeof(Dynamic2), typeof(NonDynamic1)); - var dynamicExports = new DynamicExports(); - - container.ComposeParts(dynamicExports); - - Assert.AreEqual(1, dynamicExports.DynamicCollection.Count); - - dynamicExports.DynamicCollection.IncludeDynamic = true; - - Assert.AreEqual(3, dynamicExports.DynamicCollection.Count); - } - - public class DynamicExportsNoSubType - { - public DynamicExportsNoSubType() - { - this.DynamicCollection = new AdaptingCollection(e => - e.Where(p => !p.Metadata.Dynamic || this.IncludeDynamic)); - } - - private bool _includeDynamic = false; - public bool IncludeDynamic - { - get { return this._includeDynamic; } - set - { - if (this._includeDynamic != value) - { - this.DynamicCollection.ReapplyAdaptor(); - } - - this._includeDynamic = value; - } - } - - [ImportMany] - public AdaptingCollection DynamicCollection { get; set; } - } - - [TestMethod] - public void TestDyamicallyFilteringNoSubTypeImports() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Dynamic1), typeof(Dynamic2), typeof(NonDynamic1)); - var dynamicExports = new DynamicExportsNoSubType(); - - container.ComposeParts(dynamicExports); - - Assert.AreEqual(1, dynamicExports.DynamicCollection.Count); - - dynamicExports.IncludeDynamic = true; - - Assert.AreEqual(3, dynamicExports.DynamicCollection.Count); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/CatalogFilteringTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/CatalogFilteringTests.cs deleted file mode 100644 index 0b11315804f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/CatalogFilteringTests.cs +++ /dev/null @@ -1,129 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class CatalogFilteringTests - { - [TestMethod] - public void FilteredCatalog_ScopeA() - { - var cat = GetCatalog(); - var contA = new CompositionContainer(ScopeCatalog(cat, "A")); - - Assert.IsTrue(contA.IsPresent()); - Assert.IsTrue(contA.IsPresent()); - Assert.IsFalse(contA.IsPresent()); - Assert.IsFalse(contA.IsPresent()); - } - - [TestMethod] - public void FilteredCatalog_ScopeB() - { - var cat = GetCatalog(); - var contA = new CompositionContainer(ScopeCatalog(cat, "A")); - var contB = new CompositionContainer(ScopeCatalog(cat, "B"), contA); - - Assert.IsTrue(contB.IsPresent()); - Assert.IsTrue(contB.IsPresent()); - Assert.IsTrue(contB.IsPresent()); - Assert.IsFalse(contB.IsPresent()); - } - - [TestMethod] - public void FilteredCatalog_ScopeC() - { - var cat = GetCatalog(); - var contA = new CompositionContainer(ScopeCatalog(cat, "A")); - var contB = new CompositionContainer(ScopeCatalog(cat, "B"), contA); - var contC = new CompositionContainer(ScopeCatalog(cat, "C"), contB); - - Assert.IsTrue(contC.IsPresent()); - Assert.IsTrue(contC.IsPresent()); - Assert.IsTrue(contC.IsPresent()); - Assert.IsTrue(contC.IsPresent()); - } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void FilteredCatalog_EventsFired() - { - var aggCatalog = CatalogFactory.CreateAggregateCatalog(); - var cat1 = CatalogFactory.CreateAttributed(typeof(ScopeAComponent1), typeof(ScopeBComponent)); - - var filteredCatalog = CatalogFactory.CreateFiltered(aggCatalog, - partDef => partDef.Metadata.ContainsKey("Scope") && - partDef.Metadata["Scope"].ToString() == "A"); - - var container = ContainerFactory.Create(filteredCatalog); - - Assert.IsFalse(container.IsPresent(), "sa before add"); - Assert.IsFalse(container.IsPresent(), "sb before add"); - - aggCatalog.Catalogs.Add(cat1); - - Assert.IsTrue(container.IsPresent(), "sa after add"); - Assert.IsFalse(container.IsPresent(), "sb after add"); - - aggCatalog.Catalogs.Remove(cat1); - - Assert.IsFalse(container.IsPresent(), "sa after remove"); - Assert.IsFalse(container.IsPresent(), "sb after remove"); - } - - private ComposablePartCatalog GetCatalog() - { - return CatalogFactory.CreateAttributed( - typeof(ScopeAComponent1), - typeof(ScopeAComponent2), - typeof(ScopeBComponent), - typeof(ScopeCComponent)); - } - - private ComposablePartCatalog ScopeCatalog(ComposablePartCatalog catalog, string scope) - { - return CatalogFactory.CreateFiltered(catalog, - partDef => partDef.Metadata.ContainsKey("Scope") && - partDef.Metadata["Scope"].ToString() == scope); - } - - [Export] - [PartMetadata("Scope", "A")] - public class ScopeAComponent1 - { - } - - [Export] - [PartMetadata("Scope", "A")] - public class ScopeAComponent2 - { - [Import] - public ScopeAComponent1 ScopeA { get; set; } - } - - [Export] - [PartMetadata("Scope", "B")] - public class ScopeBComponent - { - [Import] - public ScopeAComponent1 ScopeA { get; set; } - } - - [Export] - [PartMetadata("Scope", "C")] - public class ScopeCComponent - { - [Import] - public ScopeBComponent ScopeB { get; set; } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/CompositionContainerAttributedModelCycleTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/CompositionContainerAttributedModelCycleTests.cs deleted file mode 100644 index 952ef533ff2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/CompositionContainerAttributedModelCycleTests.cs +++ /dev/null @@ -1,274 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Linq; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Primitives; - -namespace Tests.Integration -{ - [TestClass] - public class CompositionContainerAttributedModelCycleTests - { - // There are nine possible scenarios that cause a part to have a dependency on another part, some of which - // are legal and some not. For example, below, is not legal for a part, A, to have a prerequisite dependency - // on a part, B, which has also has a prerequisite dependency on A. In contrast, however, it is legal for - // part A and B to have a non-prerequisite (Post) dependency on each other. - // - // ------------------------------ - // | | B | - // | | Pre | Post | None | - // |--------|-----|------|------| - // | Pre | X | X | √ | - // | A Post | X | √ | √ | - // | None | √ | √ | √ | - // ------------------------------ - // - - [TestMethod] - public void APrerequisiteDependsOnBPrerequisite_ShouldThrowComposition() - { - AssertCycle(typeof(APrerequisiteDependsOnBPrerequisite), - typeof(BPrerequisiteDependsOnAPrerequisite)); - } - - [TestMethod] - public void APrerequisiteDependsOnBPost_ShouldThrowComposition() - { - AssertCycle(typeof(APrerequisiteDependsOnBPost), - typeof(BPostDependsOnAPrerequisite)); - } - - [TestMethod] - public void APrerequisiteDependsOnBNone_ShouldNotThrow() - { - AssertNotCycle(typeof(APrerequisiteDependsOnBNone), - typeof(BNone)); - } - - [TestMethod] - public void APostDependsOnBPrerequisite_ShouldThrowComposition() - { - AssertCycle(typeof(APostDependsOnBPrerequisite), - typeof(BPrerequisiteDependsOnAPost)); - } - - [TestMethod] - public void APostDependsOnBPost_ShouldNotThrow() - { - AssertNotCycle(typeof(APostDependsOnBPost), - typeof(BPostDependsOnAPost)); - } - - [TestMethod] - public void APostDependsOnBNone_ShouldNotThrow() - { - AssertNotCycle(typeof(APostDependsOnBNone), - typeof(BNone)); - } - - [TestMethod] - public void BPrerequisiteDependsOnANone_ShouldNotThrow() - { - AssertNotCycle(typeof(ANone), - typeof(BPrerequisiteDependsOnANone)); - } - - [TestMethod] - public void BPostDependsOnANone_ShouldNotThrow() - { - AssertNotCycle(typeof(ANone), - typeof(BPostDependsOnANone)); - } - - [TestMethod] - public void ANoneWithBNone_ShouldNotThrow() - { - AssertNotCycle(typeof(ANone), - typeof(BNone)); - } - - [TestMethod] - public void PartWithHasPrerequisteImportThatIsInAPostCycle_ShouldNotThrow() - { - AssertNotCycle(typeof(PartWithHasPrerequisteImportThatIsInAPostCycle) - , typeof(APostDependsOnBPost), typeof(BPostDependsOnAPost)); - } - - private static void AssertCycle(params Type[] types) - { - foreach (Type type in types) - { - var export = GetExport(type, types); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, () => - { - var value = export.Value; - }); - } - } - - private static void AssertNotCycle(params Type[] types) - { - foreach (Type type in types) - { - var export = GetExport(type, types); - - Assert.IsInstanceOfType(export.Value, type); - } - } - - private static Lazy GetExport(Type type, Type[] partTypes) - { - var container = ContainerFactory.CreateWithAttributedCatalog(partTypes); - - return container.GetExports(type, null, null).Single(); - } - - [Export] - public class APrerequisiteDependsOnBPrerequisite - { - [ImportingConstructor] - public APrerequisiteDependsOnBPrerequisite(BPrerequisiteDependsOnAPrerequisite b) - { - } - } - - [Export] - public class BPrerequisiteDependsOnAPrerequisite - { - [ImportingConstructor] - public BPrerequisiteDependsOnAPrerequisite(APrerequisiteDependsOnBPrerequisite a) - { - } - } - - - [Export] - public class APrerequisiteDependsOnBPost - { - [ImportingConstructor] - public APrerequisiteDependsOnBPost(BPostDependsOnAPrerequisite b) - { - } - } - - [Export] - public class BPostDependsOnAPrerequisite - { - [Import] - public APrerequisiteDependsOnBPost A - { - get; - set; - } - } - - [Export] - public class APrerequisiteDependsOnBNone - { - [ImportingConstructor] - public APrerequisiteDependsOnBNone(BNone b) - { - } - } - - [Export] - public class BNone - { - } - - - [Export] - public class ANone - { - } - - [Export] - public class APostDependsOnBPrerequisite - { - [Import] - public BPrerequisiteDependsOnAPost B - { - get; - set; - } - } - - [Export] - public class BPrerequisiteDependsOnAPost - { - [ImportingConstructor] - public BPrerequisiteDependsOnAPost(APostDependsOnBPrerequisite a) - { - } - } - - - [Export] - public class APostDependsOnBPost - { - [Import] - public BPostDependsOnAPost B - { - get; - set; - } - } - - [Export] - public class BPostDependsOnAPost - { - [Import] - public APostDependsOnBPost A - { - get; - set; - } - } - - [Export] - public class APostDependsOnBNone - { - [Import] - public BNone B - { - get; - set; - } - } - - [Export] - public class BPrerequisiteDependsOnANone - { - [ImportingConstructor] - public BPrerequisiteDependsOnANone(ANone a) - { - } - } - - [Export] - public class BPostDependsOnANone - { - [Import] - public ANone A - { - get; - set; - } - } - - [Export] - public class PartWithHasPrerequisteImportThatIsInAPostCycle - { - [ImportingConstructor] - public PartWithHasPrerequisteImportThatIsInAPostCycle(APostDependsOnBPost a) - { - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/ConstructorInjectionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/ConstructorInjectionTests.cs deleted file mode 100644 index 099347e0fee..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/ConstructorInjectionTests.cs +++ /dev/null @@ -1,191 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.UnitTesting; -using System.UnitTesting; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.Hosting; - -namespace Tests.Integration -{ - [TestClass] - public class ConstructorInjectionTests - { - [TestMethod] - public void SimpleConstructorInjection() - { - var container = ContainerFactory.Create(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(PartFactory.CreateAttributed(typeof(SimpleConstructorInjectedObject))); - batch.AddExportedValue("CISimpleValue", 42); - container.Compose(batch); - - SimpleConstructorInjectedObject simple = container.GetExportedValue(); - - Assert.AreEqual(42, simple.CISimpleValue); - } - - public interface IOptionalRef { } - - [Export] - public class OptionalExportProvided { } - - [Export] - public class AWithOptionalParameter - { - [ImportingConstructor] - public AWithOptionalParameter([Import(AllowDefault = true)]IOptionalRef import, - [Import("ContractThatShouldNotBeFound", AllowDefault = true)]int value, - [Import(AllowDefault=true)]OptionalExportProvided provided) - { - Assert.IsNull(import); - Assert.AreEqual(0, value); - Assert.IsNotNull(provided); - } - } - - [TestMethod] - public void OptionalConstructorArgument() - { - var container = GetContainerWithCatalog(); - var a = container.GetExportedValue(); - - // A should verify that it receieved optional arugments properly - Assert.IsNotNull(a); - } - - [Export] - public class AWithCollectionArgument - { - private IEnumerable _values; - - [ImportingConstructor] - public AWithCollectionArgument([ImportMany("MyConstructorCollectionItem")]IEnumerable values) - { - this._values = values; - } - - public IEnumerable Values { get { return this._values; } } - } - - [TestMethod] - public void RebindingShouldNotHappenForConstructorArguments() - { - var container = GetContainerWithCatalog(); - CompositionBatch batch = new CompositionBatch(); - - var p1 = batch.AddExportedValue("MyConstructorCollectionItem", 1); - batch.AddExportedValue("MyConstructorCollectionItem", 2); - batch.AddExportedValue("MyConstructorCollectionItem", 3); - container.Compose(batch); - - var a = container.GetExportedValue(); - - EnumerableAssert.AreEqual(a.Values, 1, 2, 3); - - batch = new CompositionBatch(); - batch.AddExportedValue("MyConstructorCollectionItem", 4); - batch.AddExportedValue("MyConstructorCollectionItem", 5); - batch.AddExportedValue("MyConstructorCollectionItem", 6); - // After rejection changes that are incompatible with existing assumptions are no - // longer silently ignored. The batch attempting to make this change is rejected - // with a ChangeRejectedException - CompositionAssert.ThrowsChangeRejectedError(ErrorId.ImportEngine_PreventedByExistingImport,() => - { - container.Compose(batch); - }); - - // The collection which is a constructor import should not be rebound - EnumerableAssert.AreEqual(a.Values, 1, 2, 3); - - batch.RemovePart(p1); - // After rejection changes that are incompatible with existing assumptions are no - // longer silently ignored. The batch attempting to make this change is rejected - // with a ChangeRejectedException - CompositionAssert.ThrowsChangeRejectedError(ErrorId.ImportEngine_PreventedByExistingImport, () => - { - container.Compose(batch); - }); - - // The collection which is a constructor import should not be rebound - EnumerableAssert.AreEqual(a.Values, 1, 2, 3); - } - - [TestMethod] - public void MissingConstructorArgsWithAlreadyCreatedInstance() - { - var container = GetContainerWithCatalog(); - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(new ClassWithNotFoundConstructorArgs(21)); - container.Compose(batch); - } - - [TestMethod] - public void MissingConstructorArgsWithTypeFromCatalogMissingArg() - { - var container = GetContainerWithCatalog(); - - // After rejection part definitions in catalogs whose dependencies cannot be - // satisfied are now silently ignored, turning this into a cardinality - // exception for the GetExportedValue call - ExceptionAssert.Throws(() => - { - container.GetExportedValue(); - }); - } - - [TestMethod] - public void MissingConstructorArgsWithWithTypeFromCatalogWithArg() - { - var container = GetContainerWithCatalog(); - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("ContractThatDoesntExist", 21); - container.Compose(batch); - - Assert.IsTrue(container.IsPresent()); - } - - [Export] - public class ClassWithNotFoundConstructorArgs - { - [ImportingConstructor] - public ClassWithNotFoundConstructorArgs([Import("ContractThatDoesntExist")]int i) - { - } - } - - private CompositionContainer GetContainerWithCatalog() - { - var catalog = new AssemblyCatalog(typeof(ConstructorInjectionTests).Assembly); - - return new CompositionContainer(catalog); - } - - [Export] - public class InvalidImportManyCI - { - [ImportingConstructor] - public InvalidImportManyCI( - [ImportMany]List exports) - { - } - } - - [TestMethod] - public void ImportMany_ConstructorParameter_OnNonAssiganbleType_ShouldThrowCompositionException() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(InvalidImportManyCI)); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, - ErrorId.ImportEngine_PartCannotActivate, - ErrorId.ReflectionModel_ImportManyOnParameterCanOnlyBeAssigned, - () => container.GetExportedValue()); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/DelayLoadingTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/DelayLoadingTests.cs deleted file mode 100644 index 24afb6731be..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/DelayLoadingTests.cs +++ /dev/null @@ -1,309 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.UnitTesting; -using System.UnitTesting; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.ComponentModel.Composition.ReflectionModel; -using Microsoft.Internal; - -namespace Tests.Integration -{ - [TestClass] - public class DelayLoadingTests - { - [TestMethod] - public void PartTypeLoadedLazily() - { - var catalog = new TypeLoadNotifyingCatalog(typeof(ExportingPart)); - var container = new CompositionContainer(catalog); - catalog.AssertNotLoaded(typeof(ExportingPart)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - Lazy lazyContract = container.GetExport(); - Assert.IsNotNull(lazyContract); - catalog.AssertNotLoaded(typeof(ExportingPart)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - IExporter value = lazyContract.Value; - - catalog.AssertLoaded(typeof(ExportingPart)); - Assert.AreEqual(1, catalog.LoadedTypes.Count()); - } - - [TestMethod] - public void PartTypeLoadedLazilyEagerDependeciesLoadEagerly() - { - var catalog = new TypeLoadNotifyingCatalog(typeof(ExportingPart), typeof(PartImportingEagerly)); - var container = new CompositionContainer(catalog); - catalog.AssertNotLoaded(typeof(ExportingPart)); - catalog.AssertNotLoaded(typeof(PartImportingEagerly)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - Lazy lazyContract = container.GetExport(); - Assert.IsNotNull(lazyContract); - catalog.AssertNotLoaded(typeof(PartImportingEagerly)); - catalog.AssertNotLoaded(typeof(ExportingPart)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - IImporter value = lazyContract.Value; - catalog.AssertLoaded(typeof(PartImportingEagerly)); - catalog.AssertLoaded(typeof(ExportingPart)); - Assert.AreEqual(2, catalog.LoadedTypes.Count()); - } - - [TestMethod] - public void PartTypeLoadedLazilyLazyDependeciesLoadLazily() - { - var catalog = new TypeLoadNotifyingCatalog(typeof(ExportingPart), typeof(PartImportingLazily)); - var container = new CompositionContainer(catalog); - catalog.AssertNotLoaded(typeof(ExportingPart)); - catalog.AssertNotLoaded(typeof(PartImportingLazily)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - Lazy lazyContract = container.GetExport(); - Assert.IsNotNull(lazyContract); - catalog.AssertNotLoaded(typeof(PartImportingLazily)); - catalog.AssertNotLoaded(typeof(ExportingPart)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - IImporter value = lazyContract.Value; - catalog.AssertLoaded(typeof(PartImportingLazily)); - catalog.AssertNotLoaded(typeof(ExportingPart)); - Assert.AreEqual(1, catalog.LoadedTypes.Count()); - } - - [TestMethod] - public void PartTypeLoadedLazilyEagerCollectionDependeciesLoadEagerly() - { - var catalog = new TypeLoadNotifyingCatalog(typeof(ExportingPart), typeof(PartImportingCollectionEagerly)); - var container = new CompositionContainer(catalog); - catalog.AssertNotLoaded(typeof(ExportingPart)); - catalog.AssertNotLoaded(typeof(PartImportingCollectionEagerly)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - Lazy lazyContract = container.GetExport(); - Assert.IsNotNull(lazyContract); - catalog.AssertNotLoaded(typeof(PartImportingCollectionEagerly)); - catalog.AssertNotLoaded(typeof(ExportingPart)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - IImporter value = lazyContract.Value; - catalog.AssertLoaded(typeof(PartImportingCollectionEagerly)); - catalog.AssertLoaded(typeof(ExportingPart)); - Assert.AreEqual(2, catalog.LoadedTypes.Count()); - } - - [TestMethod] - public void PartTypeLoadedLazilyLazyCollectionDependeciesLoadLazily() - { - var catalog = new TypeLoadNotifyingCatalog(typeof(ExportingPart), typeof(PartImportingCollectionLazily)); - var container = new CompositionContainer(catalog); - catalog.AssertNotLoaded(typeof(ExportingPart)); - catalog.AssertNotLoaded(typeof(PartImportingCollectionLazily)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - Lazy lazyContract = container.GetExport(); - Assert.IsNotNull(lazyContract); - catalog.AssertNotLoaded(typeof(PartImportingCollectionLazily)); - catalog.AssertNotLoaded(typeof(ExportingPart)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - IImporter value = lazyContract.Value; - catalog.AssertLoaded(typeof(PartImportingCollectionLazily)); - catalog.AssertNotLoaded(typeof(ExportingPart)); - Assert.AreEqual(1, catalog.LoadedTypes.Count()); - } - - - [TestMethod] - public void PartTypeLoadedLazilyLazyLoopLoadsLazily() - { - var catalog = new TypeLoadNotifyingCatalog(typeof(LazyLoopImporter), typeof(LazyLoopExporter)); - var container = new CompositionContainer(catalog); - catalog.AssertNotLoaded(typeof(LazyLoopImporter)); - catalog.AssertNotLoaded(typeof(LazyLoopExporter)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - Lazy lazyContract = container.GetExport(); - Assert.IsNotNull(lazyContract); - catalog.AssertNotLoaded(typeof(LazyLoopImporter)); - catalog.AssertNotLoaded(typeof(LazyLoopExporter)); - Assert.AreEqual(0, catalog.LoadedTypes.Count()); - - IImporter value = lazyContract.Value; - catalog.AssertLoaded(typeof(LazyLoopImporter)); - catalog.AssertNotLoaded(typeof(LazyLoopExporter)); - Assert.AreEqual(1, catalog.LoadedTypes.Count()); - } - - public class IExporter - { - } - - public class IImporter - { - } - - [Export(typeof(IExporter))] - public class ExportingPart : IExporter - { - } - - [Export(typeof(IImporter))] - public class PartImportingLazily : IImporter - { - [Import] - public Lazy Exporter { get; set; } - } - - [Export(typeof(IImporter))] - public class PartImportingCollectionLazily : IImporter - { - [ImportMany] - public IEnumerable> Exporters { get; set; } - } - - [Export(typeof(IImporter))] - public class PartImportingEagerly : IImporter - { - [Import] - public IExporter Exporter { get; set; } - } - - [Export(typeof(IImporter))] - public class PartImportingCollectionEagerly : IImporter - { - [ImportMany] - public IEnumerable Exporters { get; set; } - } - - - [Export(typeof(IImporter))] - public class LazyLoopImporter : IImporter - { - [Import] - public Lazy Exporter { get; set; } - } - - [Export(typeof(IExporter))] - public class LazyLoopExporter : IExporter - { - [Import] - public Lazy Importer { get; set; } - } - - - private class TypeLoadNotifyingCatalog : ComposablePartCatalog - { - ComposablePartDefinition[] _definitions; - public HashSet LoadedTypes { get; private set; } - - public TypeLoadNotifyingCatalog(params Type[] types) - { - this._definitions = types.Select(type => this.CreatePartDefinition(type)).ToArray(); - this.LoadedTypes = new HashSet(); - } - - public override IQueryable Parts - { - get { return this._definitions.AsQueryable(); } - } - - private ComposablePartDefinition CreatePartDefinition(Type type) - { - ComposablePartDefinition partDefinition = AttributedModelServices.CreatePartDefinition(type, null); - return this.CreateWrapped(partDefinition, type); - } - - private ComposablePartDefinition CreateWrapped(ComposablePartDefinition partDefinition, Type type) - { - IEnumerable exports = partDefinition.ExportDefinitions.Select(e => this.CreateWrapped(e, type)).ToArray(); - IEnumerable imports = partDefinition.ImportDefinitions.Cast().Select(i => this.CreateWrapped(i, type)).ToArray(); - - return ReflectionModelServices.CreatePartDefinition( - this.CreateWrapped(ReflectionModelServices.GetPartType(partDefinition), type), - ReflectionModelServices.IsDisposalRequired(partDefinition), - imports.AsLazy(), - exports.AsLazy(), - partDefinition.Metadata.AsLazy(), - null); - } - - private Lazy CreateWrapped(Lazy lazy, Type type) - { - return new Lazy( - () => { this.OnTypeLoaded(type); return lazy.Value; }); - } - - private LazyMemberInfo CreateWrapped(LazyMemberInfo lazyMember, Type type) - { - return new LazyMemberInfo( - lazyMember.MemberType, - () => { this.OnTypeLoaded(type); return lazyMember.GetAccessors(); }); - } - - private ExportDefinition CreateWrapped(ExportDefinition export, Type type) - { - return ReflectionModelServices.CreateExportDefinition( - this.CreateWrapped(ReflectionModelServices.GetExportingMember(export), type), - export.ContractName, - export.Metadata.AsLazy(), - null); - } - - private ImportDefinition CreateWrapped(ContractBasedImportDefinition import, Type type) - { - if (ReflectionModelServices.IsImportingParameter(import)) - { - return ReflectionModelServices.CreateImportDefinition( - this.CreateWrapped(ReflectionModelServices.GetImportingParameter(import), type), - import.ContractName, - import.RequiredTypeIdentity, - import.RequiredMetadata, - import.Cardinality, - import.RequiredCreationPolicy, - null); - } - else - { - return ReflectionModelServices.CreateImportDefinition( - this.CreateWrapped(ReflectionModelServices.GetImportingMember(import), type), - import.ContractName, - import.RequiredTypeIdentity, - import.RequiredMetadata, - import.Cardinality, - import.IsRecomposable, - import.RequiredCreationPolicy, - null); - } - } - - - - private void OnTypeLoaded(Type type) - { - this.LoadedTypes.Add(type); - } - - public void AssertLoaded(Type type) - { - Assert.IsTrue(this.LoadedTypes.Contains(type)); - } - - public void AssertNotLoaded(Type type) - { - Assert.IsFalse(this.LoadedTypes.Contains(type)); - } - - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/DelegateCompositionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/DelegateCompositionTests.cs deleted file mode 100644 index d775424f592..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/DelegateCompositionTests.cs +++ /dev/null @@ -1,287 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Tests.Integration -{ - [TestClass] - public class DelegateCompositionTests - { - public delegate int SimpleDelegate(); - public delegate object DoWorkDelegate(int i, ref object o, out string s); - - public class MethodExporter - { - [Export] - public int SimpleMethod() - { - return 1; - } - - [Export(typeof(DoWorkDelegate))] - public object DoWork(int i, ref object o, out string s) - { - s = ""; - return o; - } - - [Export("ActionWith8Arguments")] - [Export("ActionWith8Arguments", typeof(Delegate))] - public void Action(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8) - { - } - - [Export("FunctionWith8Arguments")] - [Export("FunctionWith8Arguments", typeof(Delegate))] - public int Function(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8) - { - return i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8; - } - - [Export("ActionWith9Arguments")] - [Export("ActionWith9Arguments", typeof(Delegate))] - public void Action(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9) - { - } - - [Export("FunctionWith9Arguments")] - [Export("FunctionWith9Arguments", typeof(Delegate))] - public int Function(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9) - { - return i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9; - } - -#if CLR40 && !SILVERLIGHT - [Export("FunctionWithDefaultValue")] - public int FunctionWithDefaultValue(int i, string s = "") - { - return i; - } -#endif - } - - [TestMethod] - public void Export_SimpleCustomDelegate_ShouldWork() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(MethodExporter)); - - var contractName = AttributedModelServices.GetContractName(typeof(SimpleDelegate)); - - var export1 = container.GetExportedValue(); - Assert.AreEqual(1, export1()); - - var export2 = container.GetExportedValue>(); - Assert.AreEqual(1, export1()); - - var export3 = (ExportedDelegate)container.GetExportedValue(contractName); - var export4 = (SimpleDelegate)export3.CreateDelegate(typeof(SimpleDelegate)); - Assert.AreEqual(1, export4()); - } - - [TestMethod] - public void Export_CustomDelegateWithOutRefParams_ShouldWork() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(MethodExporter)); - - var export1 = container.GetExportedValue(); - - int i = 0; - object o = new object(); - string s; - - export1(i, ref o, out s); - } - - [TestMethod] - public void Export_FunctionWith8Arguments_ShouldWorkFine() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(MethodExporter)); - -#if CLR40 && !SILVERLIGHT - Assert.IsNotNull(container.GetExportedValue("FunctionWith8Arguments")); -#else - ExceptionAssert.Throws(() => - container.GetExportedValue("FunctionWith8Arguments")); -#endif - } - - public delegate int FuncWith9Args(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9); - - [TestMethod] - public void Export_FuncWith9Arguments_ShouldThrowContractMismatch() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(MethodExporter)); - - // Cannot Create a standard delegate that takes 9 arguments - // so the generic Delegate type will not work - ExceptionAssert.Throws(() => - container.GetExportedValue("FunctionWith9Arguments")); - - // If a matching custom delegate type is used then it will work - Assert.IsNotNull(container.GetExportedValue("FunctionWith9Arguments")); - } - - [TestMethod] - public void Export_ActionWith8Arguments_ShouldWorkFine() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(MethodExporter)); - -#if CLR40 && !SILVERLIGHT - Assert.IsNotNull(container.GetExportedValue("ActionWith8Arguments")); -#else - ExceptionAssert.Throws(() => - container.GetExportedValue("ActionWith8Arguments")); -#endif - } - - public delegate void ActionWith9Args(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9); - - [TestMethod] - public void Export_ActionWith9Arguments_ShouldThrowContractMismatch() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(MethodExporter)); - - // Cannot Create a standard delegate that takes 9 arguments - // so the generic Delegate type will not work - ExceptionAssert.Throws(() => - container.GetExportedValue("ActionWith9Arguments")); - - // If a matching custom delegate type is used then it will work - Assert.IsNotNull(container.GetExportedValue("ActionWith9Arguments")); - } - -#if CLR40 && !SILVERLIGHT - [TestMethod] - public void Export_FunctionWithDefaultValue_ShouldWorkFine() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(MethodExporter)); - - var export = container.GetExportedValue>("FunctionWithDefaultValue"); - Assert.AreEqual(3, export(3, "a")); - - // Even though the string argument is optional it still cannot be cast to Func. - var export2 = (ExportedDelegate)container.GetExportedValue("FunctionWithDefaultValue"); - var export3 = export2.CreateDelegate(typeof(Func)); - - Assert.IsNull(export3); - } -#endif - - - public delegate int DelegateOneArg(int i); - public delegate int DelegateTwoArgs(int i, int j); - - public class CustomExportedDelegate : ExportedDelegate - { - private Func _func; - - public CustomExportedDelegate(Func func) - { - this._func = func; - } - - public override Delegate CreateDelegate(Type delegateType) - { - if (delegateType == typeof(DelegateOneArg)) - { - return (DelegateOneArg)((i) => this._func(i, 0)); - } - else if (delegateType == typeof(DelegateTwoArgs)) - { - return (DelegateTwoArgs)((i, j) => this._func(i, j)); - } - - return null; - } - } - - public class ExportCustomExportedDelegates - { - [Export("CustomExportedDelegate", typeof(DelegateOneArg))] - [Export("CustomExportedDelegate", typeof(DelegateTwoArgs))] - public ExportedDelegate MyExportedDelegate - { - get - { - return new CustomExportedDelegate(DoWork); - } - } - - public int DoWork(int i, int j) - { - return i + j; - } - } - - [Export] - public class ImportCustomExportedDelegates - { - [Import("CustomExportedDelegate")] - public DelegateOneArg DelegateOneArg { get; set; } - - [Import("CustomExportedDelegate")] - public DelegateTwoArgs DelegateTwoArgs { get; set; } - - } - - [TestMethod] - public void CustomExportedDelegate_ShouldWork() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(ExportCustomExportedDelegates), - typeof(ImportCustomExportedDelegates)); - - var importer = container.GetExportedValue(); - - Assert.AreEqual(1, importer.DelegateOneArg(1)); - Assert.AreEqual(2, importer.DelegateTwoArgs(1, 1)); - } - - public delegate void GetRef(ref int i); - public delegate void GetOut(out int i); - - public class RefOutMethodExporter - { - [Export] - public void MyGetOut(out int i) - { - i = 29; - } - } - - [TestMethod] - public void MethodWithOutParam_ShouldWorkWithRefParam() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(RefOutMethodExporter)); - - int i = 0; - - var export1 = container.GetExportedValue(); - - export1(ref i); - Assert.AreEqual(29, i); - i = 0; - - var export2 = container.GetExportedValue(); - - export2(out i); - Assert.AreEqual(29, i); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/DiscoveryTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/DiscoveryTests.cs deleted file mode 100644 index 32d2d5d197c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/DiscoveryTests.cs +++ /dev/null @@ -1,874 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.UnitTesting; -using System.Linq; -using System.Reflection; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Tests.Integration -{ - [TestClass] - public class DiscoveryTests - { - public abstract class AbstractClassWithExports - { - [Export("StaticExport")] - public static string StaticExport { get { return "ExportedValue"; } } - - [Export("InstanceExport")] - public string InstanceExport { get { return "InstanceExportedValue"; } } - } - - [TestMethod] - public void Export_StaticOnAbstractClass_ShouldExist() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(AbstractClassWithExports)); - - Assert.IsTrue(container.IsPresent("StaticExport")); - Assert.IsFalse(container.IsPresent("InstanceExport")); - } - - public class ClassWithStaticImport - { - [Import("StaticImport")] - public static string MyImport - { - get; set; - } - } - - [TestMethod] - public void Import_StaticImport_ShouldNotBeSet() - { - var container = ContainerFactory.Create(); - container.AddAndComposeExportedValue("StaticImport", "String that shouldn't be imported"); - - var importer = new ClassWithStaticImport(); - - container.SatisfyImportsOnce(importer); - - Assert.IsNull(ClassWithStaticImport.MyImport, "Static import should not have been set!"); - } - -#if !SILVERLIGHT -// private imports don't work on SILVERLIGHT - [Export] - public class BaseWithNonPublicImportAndExport - { - [Import("BasePrivateImport")] - private string _basePrivateImport = null; - - public string BasePrivateImport { get { return this._basePrivateImport; } } - } - - [Export] - public class DerivedBaseWithNonPublicImportAndExport : BaseWithNonPublicImportAndExport - { - - } - - [TestMethod] - public void Import_PrivateOnClass_ShouldSetImport() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(BaseWithNonPublicImportAndExport)); - container.AddAndComposeExportedValue("BasePrivateImport", "Imported String"); - - var importer = container.GetExportedValue(); - Assert.AreEqual("Imported String", importer.BasePrivateImport); - } - - - [TestMethod] - public void Import_PrivateOnBase_ShouldSetImport() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(DerivedBaseWithNonPublicImportAndExport)); - container.AddAndComposeExportedValue("BasePrivateImport", "Imported String"); - - var importer = container.GetExportedValue(); - Assert.AreEqual("Imported String", importer.BasePrivateImport); - } -#endif // !SILVERLIGHT - - public interface InterfaceWithImport - { - [Import("InterfaceImport")] - int MyImport { get; set; } - } - - public interface InterfaceWithExport - { - [Export("InterfaceExport")] - int MyExport { get; set; } - } - - [TestMethod] - public void AttributesOnInterface_ShouldNotBeConsiderAPart() - { - var catalog = CatalogFactory.CreateAttributed( - typeof(InterfaceWithImport), - typeof(InterfaceWithExport)); - - Assert.AreEqual(0, catalog.Parts.Count()); - } - - [Export] - public class ClassWithInterfaceInheritedImport : InterfaceWithImport - { - public int MyImport { get; set; } - } - - [TestMethod] - public void Import_InheritImportFromInterface_ShouldExposeImport() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(ClassWithInterfaceInheritedImport)); - - container.AddAndComposeExportedValue("InterfaceImport", 42); - - var importer = container.GetExportedValue(); - - Assert.IsTrue(importer.MyImport == default(int), "Imports declared on interfaces should not be discovered"); - } - - public class ClassWithInterfaceInheritedExport : InterfaceWithExport - { - public ClassWithInterfaceInheritedExport() - { - MyExport = 42; - } - - public int MyExport { get; set; } - } - - [TestMethod] - public void Import_InheritExportFromInterface_ShouldNotExposeExport() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(ClassWithInterfaceInheritedExport)); - - Assert.IsFalse(container.IsPresent("InterfaceExport"), "Export defined on interface should not be discovered!"); - } - - public interface IFoo { } - - [InheritedExport] - public abstract class BaseWithVirtualExport - { - [Export] - public virtual IFoo MyProp { get; set; } - } - - [InheritedExport(typeof(BaseWithVirtualExport))] - public class DerivedWithOverrideExport : BaseWithVirtualExport - { - [Export] - public override IFoo MyProp { get; set; } - } - - [TestMethod] - public void Export_BaseAndDerivedShouldAmountInTwoExports() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(BaseWithVirtualExport), - typeof(DerivedWithOverrideExport)); - - var exports1 = container.GetExportedValues(); - Assert.AreEqual(1, exports1.Count()); - - var exports2 = container.GetExportedValues(); - Assert.AreEqual(1, exports2.Count()); - } - - public interface IDocument { } - - [Export(typeof(IDocument))] - [ExportMetadata("Name", "TextDocument")] - public class TextDocument : IDocument - { - } - - [Export(typeof(IDocument))] - [ExportMetadata("Name", "XmlDocument")] - public class XmlDocument : TextDocument - { - } - - [TestMethod] - public void Export_ExportingSameContractInDerived_ShouldResultInHidingBaseExport() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(IDocument), - typeof(XmlDocument)); - - var export = container.GetExport>(); - - Assert.AreEqual("XmlDocument", export.Metadata["Name"]); - } - - [TestMethod] - public void Export_ExportingBaseAndDerivedSameContract_ShouldResultInOnlyTwoExports() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(IDocument), - typeof(TextDocument), - typeof(XmlDocument)); - - var exports = container.GetExports>(); - - Assert.AreEqual(2, exports.Count()); - Assert.AreEqual("TextDocument", exports.ElementAt(0).Metadata["Name"]); - Assert.IsInstanceOfType(exports.ElementAt(0).Value, typeof(TextDocument)); - - Assert.AreEqual("XmlDocument", exports.ElementAt(1).Metadata["Name"]); - Assert.IsInstanceOfType(exports.ElementAt(1).Value, typeof(XmlDocument)); - } - - public interface IObjectSerializer { } - - [Export(typeof(IDocument))] - [Export(typeof(IObjectSerializer))] - [ExportMetadata("Name", "XamlDocument")] - public class XamlDocument : XmlDocument, IObjectSerializer - { - } - - [TestMethod] - public void Export_ExportingSameContractInDerivedAndNewContract_ShouldResultInHidingBaseAndExportingNewContract() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(XamlDocument)); - - var export = container.GetExport>(); - - Assert.AreEqual("XamlDocument", export.Metadata["Name"]); - - var export2 = container.GetExport>(); - - Assert.AreEqual("XamlDocument", export2.Metadata["Name"]); - } - - - [Export(typeof(IDocument))] - [ExportMetadata("Name", "WPFDocument")] - public class WPFDocument : XamlDocument - { - } - - [TestMethod] - public void Export_ExportingSameContractInDerivedAndAnotherContractInBase_ShouldResultInHidingOneBaseAndInheritingNewContract() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(WPFDocument)); - - var export = container.GetExport>(); - - Assert.AreEqual("WPFDocument", export.Metadata["Name"]); - - var export2 = container.GetExportedValueOrDefault(); - - Assert.IsNull(export2, "IObjectSerializer export should not have been inherited"); - } - - [InheritedExport] - public abstract class Plugin - { - public virtual string GetLocation() - { - return "NoWhere"; - } - - public virtual int Version - { - get - { - return 0; - } - } - } - - private void VerifyValidPlugin(CompositionContainer container, int version, string location) - { - var plugins = container.GetExports(); - Assert.AreEqual(1, plugins.Count()); - - var plugin = plugins.Single().Value; - - Assert.AreEqual(location, plugin.GetLocation()); - Assert.AreEqual(version, plugin.Version); - } - - public class Plugin1 : Plugin - { - } - - [TestMethod] - public void Export_Plugin1() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(Plugin1)); - - VerifyValidPlugin(container, 0, "NoWhere"); - } - - public class Plugin2 : Plugin - { - public override string GetLocation() - { - return "SomeWhere"; - } - public override int Version - { - get - { - return 1; - } - } - } - - [TestMethod] - public void Export_Plugin2() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(Plugin2)); - - VerifyValidPlugin(container, 1, "SomeWhere"); - } - - public class Plugin3 : Plugin - { - [Export("PluginLocation")] - public override string GetLocation() - { - return "SomeWhere3"; - } - - [Export("PluginVersion")] - public override int Version - { - get - { - return 3; - } - } - } - - [TestMethod] - public void Export_Plugin3() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(Plugin3)); - - VerifyValidPlugin(container, 3, "SomeWhere3"); - - var plVer = container.GetExportedValue("PluginVersion"); - Assert.AreEqual(3, plVer); - - var plLoc = container.GetExportedValue>("PluginLocation"); - Assert.AreEqual("SomeWhere3", plLoc()); - } - - [InheritedExport(typeof(Plugin))] - public class Plugin4 : Plugin - { - public override string GetLocation() - { - return "SomeWhere4"; - } - - public override int Version - { - get - { - return 4; - } - } - } - - [TestMethod] - public void Export_Plugin4() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(Plugin4)); - - VerifyValidPlugin(container, 4, "SomeWhere4"); - } - - - public interface IPlugin - { - int Id { get; } - } - - public class MyPlugin : IPlugin - { - [Export("PluginId")] - public int Id { get { return 0; } } - } - - [TestMethod] - public void Export_MyPlugin() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(MyPlugin)); - - var export = container.GetExportedValue("PluginId"); - } - - [InheritedExport] - public interface IApplicationPlugin - { - string Name { get; } - - object Application { get; set; } - } - - [InheritedExport] - public interface IToolbarPlugin : IApplicationPlugin - { - object ToolBar { get; set; } - } - - public class MyToolbarPlugin : IToolbarPlugin - { - [Export("ApplicationPluginNames")] - public string Name { get { return "MyToolbarPlugin"; } } - - [Import("Application")] - public object Application { get; set; } - - [Import("ToolBar")] - public object ToolBar { get; set; } - } - - [TestMethod] - public void TestInterfaces() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(MyToolbarPlugin)); - - var app = new object(); - container.AddAndComposeExportedValue("Application", app); - - var toolbar = new object(); - container.AddAndComposeExportedValue("ToolBar", toolbar); - - var export = container.GetExportedValue(); - - Assert.AreEqual(app, export.Application); - Assert.AreEqual(toolbar, export.ToolBar); - Assert.AreEqual("MyToolbarPlugin", export.Name); - - var pluginNames = container.GetExportedValues("ApplicationPluginNames"); - Assert.AreEqual(1, pluginNames.Count()); - } - - public class ImportOnVirtualProperty - { - public int ImportSetCount = 0; - private int _value; - - [Import("VirtualImport")] - public virtual int VirtualImport - { - get - { - return this._value; - } - set - { - this._value = value; - ImportSetCount++; - } - } - } - - public class ImportOnOverridenPropertyWithSameContract : ImportOnVirtualProperty - { - [Import("VirtualImport")] - public override int VirtualImport - { - get - { - return base.VirtualImport; - } - set - { - base.VirtualImport = value; - } - } - } - - [TestMethod] - public void Import_VirtualPropertyOverrideWithSameContract_ShouldSucceed() - { - var container = ContainerFactory.Create(); - container.AddAndComposeExportedValue("VirtualImport", 21); - - var import = new ImportOnOverridenPropertyWithSameContract(); - - container.SatisfyImportsOnce(import); - - // Import will get set twice because there are 2 imports on the same property. - // We would really like to either elminate it getting set twice or error in this case - // but we figure it is a rare enough corner case that it doesn't warrented the run time cost - // and can be covered by an FxCop rule. - - Assert.AreEqual(2, import.ImportSetCount); - Assert.AreEqual(21, import.VirtualImport); - } - - public class ImportOnOverridenPropertyWithDifferentContract : ImportOnVirtualProperty - { - [Import("OverriddenImport")] - public override int VirtualImport - { - set - { - base.VirtualImport = value; - } - } - } - - [TestMethod] - public void Import_VirtualPropertyOverrideWithDifferentContract_ShouldSucceed() - { - var container = ContainerFactory.Create(); - container.AddAndComposeExportedValue("VirtualImport", 21); - container.AddAndComposeExportedValue("OverriddenImport", 42); - - var import = new ImportOnOverridenPropertyWithSameContract(); - - container.SatisfyImportsOnce(import); - - // Import will get set twice because there are 2 imports on the same property. - // We would really like to either elminate it getting set twice or error in this case - // but we figure it is a rare enough corner case that it doesn't warrented the run time cost - // and can be covered by an FxCop rule. - - Assert.AreEqual(2, import.ImportSetCount); - - // The derived most import should be discovered first and so it will get set first - // and thus the value should be the base import which is 21. - Assert.AreEqual(21, import.VirtualImport); - } - - [InheritedExport] - public interface IOrderScreen { } - - public class NorthwindOrderScreen : IOrderScreen - { - } - - public class SouthsandOrderScreen : IOrderScreen - { - } - - [TestMethod] - public void Export_ExportOnlyOnBaseInterfacewithInheritedMarked_ShouldFindAllImplementers() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(NorthwindOrderScreen), - typeof(SouthsandOrderScreen)); - - var exports = container.GetExportedValues(); - - Assert.AreEqual(2, exports.Count()); - Assert.IsInstanceOfType(exports.ElementAt(0), typeof(NorthwindOrderScreen)); - Assert.IsInstanceOfType(exports.ElementAt(1), typeof(SouthsandOrderScreen)); - } - - [Export] - public class PartWithStaticConstructor - { - static PartWithStaticConstructor() - { - throw new Exception(); - } - } - - [TestMethod] - public void StaticConstructor() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(PartWithStaticConstructor)); - - CompositionAssert.ThrowsError(ErrorId.ImportEngine_PartCannotGetExportedValue, - ErrorId.ImportEngine_PartCannotActivate, - ErrorId.ReflectionModel_PartConstructorThrewException, - () => container.GetExportedValue()); - } - - public interface IAddin - { - void LoadAddin(object application); - void Shutdown(); - } - - public interface IAddinMetadata - { - string Name { get; } - string Version { get; } - string Id { get; } - } - - [MetadataAttribute] - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class AddinAttribute : ExportAttribute, IAddinMetadata - { - private string _name; - private string _version; - private string _id; - - public AddinAttribute(string name, string version, string id) - : base(typeof(IAddin)) - { - this._name = name; - this._version = version; - this._id = id; - } - - public string Name { get { return this._name; } } - public string Version { get { return this._version; } } - public string Id { get { return this._id; } } - } - - - [Addin("Addin1", "1.0", "{63D1B00F-AD2F-4F14-8A36-FFA59E4A101C}")] - public class Addin1 : IAddin - { - public void LoadAddin(object application) - { - } - public void Shutdown() - { - } - } - - [Addin("Addin2", "1.0", "{63D1B00F-AD2F-4F14-8A36-FFA59E4A101D}")] - public class Addin2 : IAddin - { - public void LoadAddin(object application) - { - } - public void Shutdown() - { - } - } - - [Addin("Addin3", "1.0", "{63D1B00F-AD2F-4F14-8A36-FFA59E4A101E}")] - public class Addin3 : IAddin - { - public void LoadAddin(object application) - { - } - public void Shutdown() - { - } - } - - [TestMethod] - public void DiscoverAddinsWithCombinedCustomExportAndMetadataAttribute() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Addin1), typeof(Addin2), typeof(Addin3)); - - var addins = container.GetExports().ToArray(); - - Assert.AreEqual(3, addins.Length, "Incorrect number of addins"); - - var values = new AddinAttribute[] - { - new AddinAttribute("Addin1", "1.0", "{63D1B00F-AD2F-4F14-8A36-FFA59E4A101C}"), - new AddinAttribute("Addin2", "1.0", "{63D1B00F-AD2F-4F14-8A36-FFA59E4A101D}"), - new AddinAttribute("Addin3", "1.0", "{63D1B00F-AD2F-4F14-8A36-FFA59E4A101E}"), - }; - - for (int i = 0; i < values.Length; i++) - { - var addinMetadata = addins[i].Metadata; - - Assert.AreEqual(values[i].Name, addinMetadata.Name); - Assert.AreEqual(values[i].Version, addinMetadata.Version); - Assert.AreEqual(values[i].Id, addinMetadata.Id); - } - } - - [TestMethod] - public void CombinedCustomExportMetadataAttribute_ShouldNotContainMetadataFromExportAttribute() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Addin1)); - var addin = container.GetExport>(); - - Assert.AreEqual(4, addin.Metadata.Count); // 3 metadata values and type identity - - Assert.AreEqual(AttributedModelServices.GetTypeIdentity(typeof(IAddin)), addin.Metadata[CompositionConstants.ExportTypeIdentityMetadataName]); - Assert.AreEqual("Addin1", addin.Metadata["Name"]); - Assert.AreEqual("1.0", addin.Metadata["Version"]); - Assert.AreEqual("{63D1B00F-AD2F-4F14-8A36-FFA59E4A101C}", addin.Metadata["Id"]); - } - - public class CustomInheritedExportAttribute : InheritedExportAttribute - { - } - - [CustomInheritedExport] - public interface IUsesCustomInheritedExport - { - int Property { get; } - } - - public class UsesCustomInheritedExportOnInterface : IUsesCustomInheritedExport - { - public int Property - { - get { return 42; } - } - } - - [TestMethod] - public void Test_CustomInheritedExportAttribute_OnInterface() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(UsesCustomInheritedExportOnInterface)); - var exporter = container.GetExportedValue(); - Assert.AreEqual(42, exporter.Property); - } - - [CustomInheritedExport] - public class BaseClassWithCustomInheritedExport - { - public int Property { get; set; } - } - - public class DerivedFromBaseWithCustomInheritedExport : BaseClassWithCustomInheritedExport - { - public DerivedFromBaseWithCustomInheritedExport() - { - Property = 43; - } - } - - [TestMethod] - public void Test_CustomInheritedExportAttribute_OnBaseClass() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(DerivedFromBaseWithCustomInheritedExport)); - var exporter = container.GetExportedValue(); - Assert.AreEqual(43, exporter.Property); - } - - - [InheritedExport("Foo")] - [ExportMetadata("Name", "IFoo1")] - public interface IFoo1 { } - - [InheritedExport("Foo")] - [ExportMetadata("Name", "IFoo2")] - public interface IFoo2 { } - - [InheritedExport("Foo")] - [ExportMetadata("Name", "FooWithOneFoo")] - public class FooWithOneFoo : IFoo1 - { - } - - [TestMethod] - public void InheritedExport_OnTypeAndInterface() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(FooWithOneFoo)); - - var foos = container.GetExports>("Foo").ToArray(); - - Assert.AreEqual(1, foos.Length); - Assert.AreEqual("FooWithOneFoo", foos[0].Metadata["Name"]); - } - - public class FooWithTwoFoos : IFoo1, IFoo2 { } - - [TestMethod] - public void InheritedExport_TwoInterfaces() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(FooWithTwoFoos)); - - var foos = container.GetExports>("Foo").ToArray(); - - Assert.AreEqual(2, foos.Length); - - EnumerableAssert.AreEqual(foos.Select(e => (string)e.Metadata["Name"]), "IFoo1", "IFoo2"); - } - - public class FooWithIfaceByOneFoo : FooWithOneFoo, IFoo1 { } - - [TestMethod] - public void InheritedExport_BaseAndInterface() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(FooWithIfaceByOneFoo)); - - var foos = container.GetExports>("Foo").ToArray(); - - Assert.AreEqual(1, foos.Length); - - Assert.AreEqual("FooWithOneFoo", foos[0].Metadata["Name"]); - } - - [InheritedExport("Foo")] - [ExportMetadata("Name", "FooWithInheritedOnSelf")] - public class FooWithInheritedOnSelf : FooWithOneFoo, IFoo1 { } - - [TestMethod] - public void InheritedExport_BaseInterfaceAndSelf() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(FooWithInheritedOnSelf)); - - var foos = container.GetExports>("Foo").ToArray(); - - Assert.AreEqual(1, foos.Length); - - Assert.AreEqual("FooWithInheritedOnSelf", foos[0].Metadata["Name"]); - } - - [InheritedExport("Foo")] - [ExportMetadata("Name", "IFoo3")] - public interface IFoo3 : IFoo1 { } - - public class FooWithInterfaceWithMultipleFoos : IFoo3 { } - - [TestMethod] - public void InheritedExport_InterfaceHiearchy() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(FooWithInterfaceWithMultipleFoos)); - - var foos = container.GetExports>("Foo").ToArray(); - Assert.AreEqual(2, foos.Length); - - EnumerableAssert.AreEqual(foos.Select(e => (string)e.Metadata["Name"]), "IFoo1", "IFoo3"); - } - - [InheritedExport("Foo2")] - [ExportMetadata("Name", "FooWithMultipleInheritedExports")] - public class FooWithMultipleInheritedExports : IFoo1 { } - - [TestMethod] - public void InheritedExport_MultipleDifferentContracts() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(FooWithMultipleInheritedExports)); - - var foos = container.GetExports>("Foo").ToArray(); - - Assert.AreEqual(1, foos.Length); - - Assert.AreEqual("IFoo1", foos[0].Metadata["Name"]); - - var foo2s = container.GetExports>("Foo2").ToArray(); - - Assert.AreEqual(1, foo2s.Length); - - Assert.AreEqual("FooWithMultipleInheritedExports", foo2s[0].Metadata["Name"]); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/ExportProviderEventTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/ExportProviderEventTests.cs deleted file mode 100644 index 3744048f8ae..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/ExportProviderEventTests.cs +++ /dev/null @@ -1,284 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; - -namespace System.ComponentModel.Composition -{ - [TestClass] - public class ExportProviderEventTests - { - [TestMethod] - public void BatchAdd_ShouldFireEvents() - { - var container = ContainerFactory.Create(); - var eventListener = new ExportProviderListener(container, container); - - var batch = new CompositionBatch(); - batch.AddExportedValue("MyExport", new object()); - eventListener.VerifyCompose(batch); - } - - [TestMethod] - public void BatchRemove_ShouldFireEvents() - { - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - var exportPart = batch.AddExportedValue("MyExport", new object()); - container.Compose(batch); - - var eventListener = new ExportProviderListener(container, container); - - batch = new CompositionBatch(); - batch.RemovePart(exportPart); - eventListener.VerifyCompose(batch); - } - - [TestMethod] - public void BatchAddRemove_ShouldFireEvents() - { - var container = ContainerFactory.Create(); - var batch = new CompositionBatch(); - var exportPart = batch.AddExportedValue("MyExport", new object()); - container.Compose(batch); - - var eventListener = new ExportProviderListener(container, container); - - batch = new CompositionBatch(); - batch.RemovePart(exportPart); - batch.AddExportedValue("MyExport2", new object()); - eventListener.VerifyCompose(batch); - } - - [TestMethod] - public void BatchMultipleAdds_ShouldFireEvents() - { - var container = ContainerFactory.Create(); - var eventListener = new ExportProviderListener(container, container); - - var batch = new CompositionBatch(); - batch.AddExportedValue("MyExport", new object()); - batch.AddExportedValue("MyExport2", new object()); - batch.AddExportedValue("MyExport3", new object()); - eventListener.VerifyCompose(batch); - } - - [TestMethod] - public void BatchNestedContainerAdds_ShouldFireEvents() - { - var parentContainer = ContainerFactory.Create(); - var container = ContainerFactory.Create(parentContainer); - var eventListener = new ExportProviderListener(parentContainer, container); - - var batch = new CompositionBatch(); - batch.AddExportedValue("MyExport", new object()); - eventListener.VerifyCompose(batch); - } - - [Export] - public class SampleCatalogExport { } - - [TestMethod] - public void CatalogAdd_ShouldFireEvents() - { - var catalog = new TypeCatalog(typeof(SampleCatalogExport)); - var aggCat = new AggregateCatalog(); - var container = ContainerFactory.Create(aggCat); - var eventListener = new ExportProviderListener(container, container); - - eventListener.VerifyCatalogAdd(() => aggCat.Catalogs.Add(catalog), typeof(SampleCatalogExport)); - } - - [TestMethod] - public void CatalogRemove_ShouldFireEvents() - { - var catalog = new TypeCatalog(typeof(SampleCatalogExport)); - var aggCat = new AggregateCatalog(); - var container = ContainerFactory.Create(aggCat); - - aggCat.Catalogs.Add(catalog); - var eventListener = new ExportProviderListener(container, container); - - eventListener.VerifyCatalogRemove(() => aggCat.Catalogs.Remove(catalog), typeof(SampleCatalogExport)); - } - - [Export] - public class SampleCatalogExport2 { } - - [TestMethod] - [Ignore] - [WorkItem(812029)] - public void CatalogMultipleAdds_ShouldFireEvents() - { - var catalog = new TypeCatalog(typeof(SampleCatalogExport)); - var aggCat = new AggregateCatalog(); - var container = ContainerFactory.Create(aggCat); - var eventListener = new ExportProviderListener(container, container); - - var otherAggCat = new AggregateCatalog(new TypeCatalog(typeof(SampleCatalogExport)), new TypeCatalog(typeof(SampleCatalogExport2))); - - eventListener.VerifyCatalogAdd(() => aggCat.Catalogs.Add(otherAggCat), typeof(SampleCatalogExport), typeof(SampleCatalogExport2)); - } - - [TestMethod] - public void CatalogNestedContainerAdds_ShouldFireEvents() - { - var catalog = new TypeCatalog(typeof(SampleCatalogExport)); - var aggCat = new AggregateCatalog(); - var parentContainer = ContainerFactory.Create(aggCat); - var container = ContainerFactory.Create(parentContainer); - var eventListener = new ExportProviderListener(parentContainer, container); - - eventListener.VerifyCatalogAdd(() => aggCat.Catalogs.Add(catalog), typeof(SampleCatalogExport)); - } - - public class ExportProviderListener - { - private CompositionContainer _container; - private ExportProvider _watchedProvider; - private string[] _expectedAdds; - private string[] _expectedRemoves; - private int _changedEventCount; - private int _changingEventCount; - - public ExportProviderListener(CompositionContainer container, ExportProvider watchExportProvider) - { - watchExportProvider.ExportsChanged += OnExportsChanged; - watchExportProvider.ExportsChanging += OnExportsChanging; - this._watchedProvider = watchExportProvider; - this._container = container; - } - - public void VerifyCompose(CompositionBatch batch) - { - this._expectedAdds = GetContractNames(batch.PartsToAdd); - this._expectedRemoves = GetContractNames(batch.PartsToRemove); - - this._container.Compose(batch); - - Assert.IsTrue(this._changingEventCount == 1, "Changing event should have been called"); - Assert.IsTrue(this._changedEventCount == 1, "Changed event should have been called"); - - ResetState(); - } - - public void VerifyCatalogAdd(Action doAdd, params Type[] expectedTypesAdded) - { - this._expectedAdds = GetContractNames(expectedTypesAdded); - - doAdd(); - - Assert.IsTrue(this._changingEventCount == 1, "Changing event should have been called"); - Assert.IsTrue(this._changedEventCount == 1, "Changed event should have been called"); - - ResetState(); - } - - public void VerifyCatalogRemove(Action doRemove, params Type[] expectedTypesRemoved) - { - this._expectedRemoves = GetContractNames(expectedTypesRemoved); - - doRemove(); - - Assert.IsTrue(this._changingEventCount == 1, "Changing event should have been called"); - Assert.IsTrue(this._changedEventCount == 1, "Changed event should have been called"); - - ResetState(); - } - - public void OnExportsChanging(object sender, ExportsChangeEventArgs args) - { - Assert.IsTrue(this._expectedAdds != null || this._expectedRemoves != null); - - if (this._expectedAdds == null) - { - EnumerableAssert.IsEmpty(args.AddedExports); - } - else - { - foreach (var add in this._expectedAdds) - { - Assert.IsFalse(this._container.IsPresent(add), "Added exports should ot be added yet during changing"); - } - } - - if (this._expectedRemoves == null) - { - EnumerableAssert.IsEmpty(args.RemovedExports); - } - else - { - foreach (var remove in this._expectedRemoves) - { - Assert.IsTrue(this._container.IsPresent(remove), "Removed exports should not be removed yet during changing"); - } - } - - this._changingEventCount++; - } - - public void OnExportsChanged(object sender, ExportsChangeEventArgs args) - { - Assert.IsTrue(this._expectedAdds != null || this._expectedRemoves != null); - - if (this._expectedAdds == null) - { - EnumerableAssert.IsEmpty(args.AddedExports); - } - else - { - foreach (var add in this._expectedAdds) - { - Assert.IsTrue(this._container.IsPresent(add), "Added exports should be added during changed"); - } - } - - if (this._expectedRemoves == null) - { - EnumerableAssert.IsEmpty(args.RemovedExports); - } - else - { - foreach (var remove in this._expectedRemoves) - { - Assert.IsFalse(this._container.IsPresent(remove), "Removed exports should be removed during changed"); - } - } - - Assert.IsNull(args.AtomicComposition); - - this._changedEventCount++; - } - - private void ResetState() - { - this._expectedAdds = null; - this._expectedRemoves = null; - this._changedEventCount = 0; - this._changingEventCount = 0; - } - - private static string[] GetContractNames(IEnumerable definitions) - { - return definitions.Select(e => e.ContractName).ToArray(); - } - - private static string[] GetContractNames(IEnumerable parts) - { - return GetContractNames(parts.SelectMany(p => p.ExportDefinitions)); - } - - private static string[] GetContractNames(IEnumerable types) - { - return GetContractNames(types.Select(t => AttributedModelServices.CreatePartDefinition(t, null)).SelectMany(p => p.ExportDefinitions)); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/LifetimeTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/LifetimeTests.cs deleted file mode 100644 index 5a5cd5d50fb..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/LifetimeTests.cs +++ /dev/null @@ -1,1273 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.UnitTesting; -using System.Linq; -using System.Reflection; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Tests.Integration -{ - [TestClass] - public class LifetimeTests - { - [Export] - public class AnyPartSimple - { - - } - - [Export] - public class AnyPartDisposable : IDisposable - { - public bool IsDisposed { get; set; } - public void Dispose() - { - Assert.IsFalse(IsDisposed); - IsDisposed = true; - } - } - - [Export] - public class AnyPartRecomposable - { - [Import("Value", AllowRecomposition = true)] - public int Value { get; set; } - } - - [Export] - public class AnyPartDisposableRecomposable : IDisposable - { - [Import("Value", AllowRecomposition = true)] - public int Value { get; set; } - - public bool IsDisposed { get; set; } - public void Dispose() - { - Assert.IsFalse(IsDisposed); - IsDisposed = true; - } - } - - [TestMethod] - public void PartAddedViaAddExportedValue_ShouldNotBeDisposedWithContainer() - { - var container = new CompositionContainer(); - var disposablePart = new AnyPartDisposable(); - var batch = new CompositionBatch(); - batch.AddPart(batch); - container.Compose(batch); - - container.Dispose(); - Assert.IsFalse(disposablePart.IsDisposed); - } - - [TestMethod] - public void PartAddedTwice_AppearsTwice() - { - // You probably shouldn't be adding a part to the container twice, but it's not something we're going to check for and throw an exception on - var container = new CompositionContainer(); - var disposable = new AnyPartDisposable(); - var part = AttributedModelServices.CreatePart(disposable); - var batch = new CompositionBatch(); - batch.AddPart(part); - container.Compose(batch); - - batch = new CompositionBatch(); - batch.AddPart(part); - container.Compose(batch); - - var exports = container.GetExports(); - Assert.AreEqual(2, exports.Count()); - - container.Dispose(); - } - - [TestMethod] - public void AnyPart_Simple_ShouldNotBeCollected() - { - var catalog = new TypeCatalog(typeof(AnyPartSimple)); - var container = new CompositionContainer(catalog); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesNotExpectedToBeCollected( - container.GetExportedValue()); - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void AnyPart_Disposable_ShouldNotBeCollected() - { - var catalog = new TypeCatalog(typeof(AnyPartDisposable)); - var container = new CompositionContainer(catalog); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesNotExpectedToBeCollected( - container.GetExportedValue()); - - GC.KeepAlive(container); - } - - [TestMethod] - public void AnyPart_Disposable_ShouldBeDisposedWithContainer() - { - var catalog = new TypeCatalog(typeof(AnyPartDisposable)); - var container = new CompositionContainer(catalog); - - var exportedValue = container.GetExportedValue(); - - Assert.IsFalse(exportedValue.IsDisposed); - - container.Dispose(); - - Assert.IsTrue(exportedValue.IsDisposed, "AnyPart should be disposed with the container!"); - } - - [TestMethod] - public void AnyPart_RecomposabeImport_ShouldNotBeCollected() - { - var catalog = new TypeCatalog(typeof(AnyPartRecomposable)); - var container = new CompositionContainer(catalog); - - // Setup dependency - CompositionBatch batch = new CompositionBatch(); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - batch = null; - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesNotExpectedToBeCollected( - container.GetExportedValue()); - refTracker.CollectAndAssert(); - - // Lets make sure recomposition doesn't blow anything up here. - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - container.Compose(batch); - batch = null; - - var exportedValue = (AnyPartRecomposable)refTracker.ReferencesNotExpectedToBeCollected[0].Target; - Assert.AreEqual(42, exportedValue.Value); - - GC.KeepAlive(container); - } - - [TestMethod] - public void AnyPart_DisposableRecomposabeImport_ShouldNotBeCollected() - { - var catalog = new TypeCatalog(typeof(AnyPartDisposableRecomposable)); - var container = new CompositionContainer(catalog); - - // Setup dependency - CompositionBatch batch = new CompositionBatch(); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - batch = null; - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesNotExpectedToBeCollected( - container.GetExportedValue()); - - refTracker.CollectAndAssert(); - - // Lets make sure recomposition doesn't blow anything up here. - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - container.Compose(batch); - batch = null; - - var exportedValue = (AnyPartDisposableRecomposable)refTracker.ReferencesNotExpectedToBeCollected[0].Target; - Assert.AreEqual(42, exportedValue.Value); - - GC.KeepAlive(container); - - container.Dispose(); - - Assert.IsTrue(exportedValue.IsDisposed, "Any parts should be disposed with the container!"); - } - - [Export] - [PartCreationPolicy(CreationPolicy.Shared)] - public class SharedPartSimple - { - - } - - [Export] - [PartCreationPolicy(CreationPolicy.Shared)] - public class SharedPartDisposable : IDisposable - { - public bool IsDisposed { get; set; } - public void Dispose() - { - Assert.IsFalse(IsDisposed); - IsDisposed = true; - } - } - - [Export] - [PartCreationPolicy(CreationPolicy.Shared)] - public class SharedPartRecomposable - { - [Import("Value", AllowRecomposition = true)] - public int Value { get; set; } - } - - [Export] - [PartCreationPolicy(CreationPolicy.Shared)] - public class SharedPartDisposableRecomposable : IDisposable - { - [Import("Value", AllowRecomposition = true)] - public int Value { get; set; } - - public bool IsDisposed { get; set; } - public void Dispose() - { - Assert.IsFalse(IsDisposed); - IsDisposed = true; - } - } - - [TestMethod] - public void SharedPart_Simple_ShouldNotBeCollected() - { - var catalog = new TypeCatalog(typeof(SharedPartSimple)); - var container = new CompositionContainer(catalog); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesNotExpectedToBeCollected( - container.GetExportedValue()); - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void SharedPart_Disposable_ShouldNotBeCollected() - { - var catalog = new TypeCatalog(typeof(SharedPartDisposable)); - var container = new CompositionContainer(catalog); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesNotExpectedToBeCollected( - container.GetExportedValue()); - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void SharedPart_Disposable_ShouldBeDisposedWithContainer() - { - var catalog = new TypeCatalog(typeof(SharedPartDisposable)); - var container = new CompositionContainer(catalog); - - var export = container.GetExportedValue(); - - Assert.IsFalse(export.IsDisposed); - - container.Dispose(); - - Assert.IsTrue(export.IsDisposed, "SharedPart should be disposed with the container!"); - } - - [TestMethod] - public void SharedPart_RecomposabeImport_ShouldNotBeCollected() - { - var catalog = new TypeCatalog(typeof(SharedPartRecomposable)); - var container = new CompositionContainer(catalog); - - // Setup dependency - CompositionBatch batch = new CompositionBatch(); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - batch = null; - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesNotExpectedToBeCollected( - container.GetExportedValue()); - - refTracker.CollectAndAssert(); - - // Lets make sure recomposition doesn't blow anything up here. - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - container.Compose(batch); - batch = null; - - var exportedValue = (SharedPartRecomposable)refTracker.ReferencesNotExpectedToBeCollected[0].Target; - Assert.AreEqual(42, exportedValue.Value); - - GC.KeepAlive(container); - } - - [TestMethod] - public void SharedPart_DisposableRecomposabeImport_ShouldNotBeCollected() - { - var catalog = new TypeCatalog(typeof(SharedPartDisposableRecomposable)); - var container = new CompositionContainer(catalog); - - // Setup dependency - CompositionBatch batch = new CompositionBatch(); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - batch = null; - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesNotExpectedToBeCollected( - container.GetExportedValue()); - - refTracker.CollectAndAssert(); - - // Lets make sure recomposition doesn't blow anything up here. - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - container.Compose(batch); - batch = null; - - var exportedValue = (SharedPartDisposableRecomposable)refTracker.ReferencesNotExpectedToBeCollected[0].Target; - Assert.AreEqual(42, exportedValue.Value); - - container.Dispose(); - - Assert.IsTrue(exportedValue.IsDisposed, "Any parts should be disposed with the container!"); - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class NonSharedPartSimple - { - - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class NonSharedPartRecomposable - { - [Import("Value", AllowRecomposition = true)] - public int Value { get; set; } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class NonSharedPartDisposable : IDisposable - { - public bool IsDisposed { get; set; } - public void Dispose() - { - Assert.IsFalse(IsDisposed); - IsDisposed = true; - } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class NonSharedPartDisposableRecomposable : IDisposable - { - private int _value; - - [Import("Value", AllowRecomposition = true)] - public int Value - { - get - { - if (this.IsDisposed) throw new ObjectDisposedException(this.GetType().Name); - return this._value; - } - set - { - if (this.IsDisposed) throw new ObjectDisposedException(this.GetType().Name); - this._value = value; - } - } - - public bool IsDisposed { get; set; } - public void Dispose() - { - Assert.IsFalse(IsDisposed); - IsDisposed = true; - } - } - - [TestMethod] - public void NonSharedPart_Disposable_ShouldNotBeCollected() - { - var catalog = new TypeCatalog(typeof(NonSharedPartDisposable)); - var container = new CompositionContainer(catalog); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesNotExpectedToBeCollected( - container.GetExportedValue()); - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void NonSharedPart_Disposable_ShouldBeDisposedWithContainer() - { - var catalog = new TypeCatalog(typeof(NonSharedPartDisposable)); - var container = new CompositionContainer(catalog); - - var export = container.GetExportedValue(); - - Assert.IsFalse(export.IsDisposed); - - container.Dispose(); - - Assert.IsTrue(export.IsDisposed, "NonSharedParts should be disposed with the container!"); - } - - [TestMethod] - public void NonSharedPart_RecomposableImport_WithReference_ShouldNotBeCollected() - { - var catalog = new TypeCatalog(typeof(NonSharedPartRecomposable)); - var container = new CompositionContainer(catalog); - - // Setup dependency - CompositionBatch batch = new CompositionBatch(); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - batch = null; - - var exportedValue = container.GetExportedValue(); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesNotExpectedToBeCollected(exportedValue); - - refTracker.CollectAndAssert(); - - // Recompose should work because we are still holding a reference to the exported value. - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - container.Compose(batch); - batch = null; - - Assert.AreEqual(42, exportedValue.Value, "Value should have been recomposed"); - - GC.KeepAlive(container); - } - - [TestMethod] - public void NonSharedPart_DisposableRecomposabeImport_NoReference_ShouldNotBeCollected() - { - var catalog = new TypeCatalog(typeof(NonSharedPartDisposableRecomposable)); - var container = new CompositionContainer(catalog); - - // Setup dependency - CompositionBatch batch = new CompositionBatch(); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - batch = null; - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesNotExpectedToBeCollected( - container.GetExportedValue()); - - refTracker.CollectAndAssert(); - - // Recompose just to ensure we don't blow up, even though we don't expect anything to happen. - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - container.Compose(batch); - batch = null; - - var exportedValue = (NonSharedPartDisposableRecomposable)refTracker.ReferencesNotExpectedToBeCollected[0].Target; - Assert.AreEqual(42, exportedValue.Value, "Value shoudl ahve been recomposed."); - - GC.KeepAlive(container); - } - - [Export] - public class SharedState - { - public static int instanceNumber = 0; - public SharedState() - { - MyInstanceNumber = instanceNumber++; - } - - public int MyInstanceNumber { get; private set; } - } - - [PartCreationPolicy(CreationPolicy.NonShared)] - public class NonSharedState - { - [Import(AllowRecomposition = true)] - public SharedState State { set { ExportState = value; } } - - [Export("SharedFromNonShared")] - public SharedState ExportState { get; private set; } - } - - [TestMethod] - public void NonSharedPart_TwoRecomposablePartsSameExportedValue() - { - // This test is primarily used to ensure that we allow for multiple parts to be associated - // with the same exported value. - var catalog = new TypeCatalog(typeof(SharedState), typeof(NonSharedState)); - var container = new CompositionContainer(catalog); - - var export1 = container.GetExportedValue("SharedFromNonShared"); - var export2 = container.GetExportedValue("SharedFromNonShared"); - - // Same exported value that comes from two different recomposable part instances. - Assert.AreEqual(export1.MyInstanceNumber, export2.MyInstanceNumber, "Should be the same shared object!"); - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class SharedImporter - { - [Import(RequiredCreationPolicy = CreationPolicy.Shared)] - public AnyPartSimple AnyPartSimple { get; set; } - - [Import(RequiredCreationPolicy = CreationPolicy.Shared)] - public AnyPartDisposable AnyPartDisposable { get; set; } - - [Import(RequiredCreationPolicy = CreationPolicy.Shared)] - public AnyPartRecomposable AnyPartRecomposable { get; set; } - - [Import(RequiredCreationPolicy = CreationPolicy.Shared)] - public AnyPartDisposableRecomposable AnyPartDisposableRecomposable { get; set; } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class NonSharedImporter - { - [Import(RequiredCreationPolicy = CreationPolicy.NonShared)] - public AnyPartSimple AnyPartSimple { get; set; } - - [Import(RequiredCreationPolicy = CreationPolicy.NonShared)] - public AnyPartDisposable AnyPartDisposable { get; set; } - - [Import(RequiredCreationPolicy = CreationPolicy.NonShared)] - public AnyPartRecomposable AnyPartRecomposable { get; set; } - - [Import(RequiredCreationPolicy = CreationPolicy.NonShared)] - public AnyPartDisposableRecomposable AnyPartDisposableRecomposable { get; set; } - } - - private static CompositionContainer GetContainer() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(LifetimeTests).GetNestedTypes(BindingFlags.Public)); - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("Value", 21); - container.Compose(batch); - return container; - } - - [TestMethod] - public void GetReleaseExport_SharedRoot_ShouldNotDisposeChain() - { - var container = GetContainer(); - - var export = container.GetExport>(); - var exportedValue = export.Value; - - container.ReleaseExport(export); - - Assert.IsFalse(exportedValue.AnyPartDisposable.IsDisposed); - Assert.IsFalse(exportedValue.AnyPartDisposableRecomposable.IsDisposed); - } - - [TestMethod] - public void AddRemovePart_SharedRoot_ShouldNotDisposeChain() - { - var container = GetContainer(); - - var exportedValue = new SharedImporter(); - - CompositionBatch batch = new CompositionBatch(); - var part = batch.AddPart(exportedValue); - container.Compose(batch); - - batch = new CompositionBatch(); - batch.RemovePart(part); - container.Compose(batch); - - Assert.IsFalse(exportedValue.AnyPartDisposable.IsDisposed); - Assert.IsFalse(exportedValue.AnyPartDisposableRecomposable.IsDisposed); - } - - [TestMethod] - public void ContainerDispose_SharedRoot_ShouldDisposeChain() - { - var container = GetContainer(); - - var export = container.GetExport(); - var exportedValue = export.Value; - - container.Dispose(); - - Assert.IsTrue(exportedValue.AnyPartDisposable.IsDisposed); - Assert.IsTrue(exportedValue.AnyPartDisposableRecomposable.IsDisposed); - } - - [TestMethod] - public void GetReleaseExport_NonSharedRoot_ShouldDisposeChain() - { - var container = GetContainer(); - - var exports = new List>(); - var exportedValues = new List(); - - // Executing this 100 times to help uncover any GC bugs - for (int i = 0; i < 100; i++) - { - var export = container.GetExport(); - var exportedValue = export.Value; - - exports.Add(export); - exportedValues.Add(exportedValue); - } - - for (int i = 0; i < 100; i++) - { - var export = exports[i]; - var exportedValue = exportedValues[i]; - - container.ReleaseExport(export); - - Assert.IsTrue(exportedValue.AnyPartDisposable.IsDisposed); - Assert.IsTrue(exportedValue.AnyPartDisposableRecomposable.IsDisposed); - } - } - - public void GetReleaseExport_NonSharedRoot_ShouldDisposeChain_WithMetadata() - { - var container = GetContainer(); - - var exports = new List>>(); - var exportedValues = new List(); - - // Executing this 100 times to help uncover any GC bugs - for (int i = 0; i < 100; i++) - { - var export = container.GetExport>(); - var exportedValue = export.Value; - - exports.Add(export); - exportedValues.Add(exportedValue); - } - - for (int i = 0; i < 100; i++) - { - var export = exports[i]; - var exportedValue = exportedValues[i]; - - container.ReleaseExport(export); - - Assert.IsTrue(exportedValue.AnyPartDisposable.IsDisposed); - Assert.IsTrue(exportedValue.AnyPartDisposableRecomposable.IsDisposed); - } - } - - [TestMethod] - public void ReleaseExports_ShouldDispose_NonSharedParts() - { - var container = GetContainer(); - - var export1 = container.GetExport(); - var exportedValue1 = export1.Value; - - var export2 = container.GetExport(); - var exportedValue2 = export2.Value; - - container.ReleaseExports(new[] { export1, export2 }); - - Assert.IsTrue(exportedValue1.AnyPartDisposable.IsDisposed); - Assert.IsTrue(exportedValue1.AnyPartDisposableRecomposable.IsDisposed); - - Assert.IsTrue(exportedValue2.AnyPartDisposable.IsDisposed); - Assert.IsTrue(exportedValue2.AnyPartDisposableRecomposable.IsDisposed); - } - - - [TestMethod] - public void AddRemovePart_NonSharedRoot_ShouldDisposeChain() - { - var container = GetContainer(); - - var exportedValue = new NonSharedImporter(); - - CompositionBatch batch = new CompositionBatch(); - var part = batch.AddPart(exportedValue); - container.Compose(batch); - - batch = new CompositionBatch(); - batch.RemovePart(part); - container.Compose(batch); - - Assert.IsTrue(exportedValue.AnyPartDisposable.IsDisposed); - Assert.IsTrue(exportedValue.AnyPartDisposableRecomposable.IsDisposed); - } - - [TestMethod] - public void ContainerDispose_NonSharedRoot_ShouldNotDisposeChain() - { - var container = GetContainer(); - - var export = container.GetExport(); - var exportedValue = export.Value; - - container.Dispose(); - - Assert.IsTrue(exportedValue.AnyPartDisposable.IsDisposed); - Assert.IsTrue(exportedValue.AnyPartDisposableRecomposable.IsDisposed); - } - - [TestMethod] - public void GetReleaseExport_NonSharedPart_ShouldNotRecomposeAfterRelease() - { - var catalog = new TypeCatalog(typeof(NonSharedPartRecomposable)); - var container = new CompositionContainer(catalog); - - // Setup dependency - CompositionBatch batch = new CompositionBatch(); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - - var export = container.GetExport(); - var exportedValue = export.Value; - - Assert.AreEqual(21, exportedValue.Value); - - container.ReleaseExport(export); - - // Recompose just to ensure we don't blow up, even though we don't expect anything to happen. - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - container.Compose(batch); - - Assert.AreEqual(21, exportedValue.Value, "Value should not be recomposed after ReleaseExport is called on it."); - } - - [TestMethod] - public void GetExportManualDisposeThenRecompose_NonSharedDisposableRecomposablePart_ShouldThrowComposition() - { - var catalog = new TypeCatalog(typeof(NonSharedPartDisposableRecomposable)); - var container = new CompositionContainer(catalog); - - // Setup dependency - CompositionBatch batch = new CompositionBatch(); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - - var export = container.GetExport(); - var exportedValue = export.Value; - - Assert.AreEqual(21, exportedValue.Value); - - exportedValue.Dispose(); - - // Recompose should cause a ObjectDisposedException. - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - - CompositionAssert.ThrowsError( - ErrorId.ImportEngine_PartCannotActivate, // Cannot activate part because - ErrorId.ReflectionModel_ImportThrewException, // Import threw an exception - RetryMode.DoNotRetry, - () => - { - container.Compose(batch); - }); - } - - [Export] - public class MyImporter - { - [Import(AllowDefault = true, AllowRecomposition = true, RequiredCreationPolicy = CreationPolicy.NonShared)] - public AnyPartDisposable AnyPartDisposable { get; set; } - } - - [TestMethod] - public void RecomposeCausesOldImportedValuesToBeDisposed() - { - var cat = new AggregateCatalog(); - var cat1 = new TypeCatalog(typeof(AnyPartDisposable)); - - cat.Catalogs.Add(new TypeCatalog(typeof (MyImporter))); - cat.Catalogs.Add(cat1); - - var container = new CompositionContainer(cat); - - var importer = container.GetExportedValue(); - - var anyPart = importer.AnyPartDisposable; - - Assert.IsFalse(anyPart.IsDisposed); - Assert.IsInstanceOfType(anyPart, typeof(AnyPartDisposable)); - - // Remove the instance of MyClass1 - cat.Catalogs.Remove(cat1); - - Assert.IsNull(importer.AnyPartDisposable); - Assert.IsTrue(anyPart.IsDisposed); - } - - private static CompositionContainer CreateParentChildContainerWithNonSharedImporter() - { - var parentCat = CatalogFactory.CreateAttributed(typeof(AnyPartDisposable), - typeof(AnyPartDisposableRecomposable), - typeof(AnyPartRecomposable), - typeof(AnyPartSimple)); - var parent = new CompositionContainer(parentCat); - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue("Value", 21); - parent.Compose(batch); - - var childCat = CatalogFactory.CreateAttributed(typeof(NonSharedImporter)); - var child = new CompositionContainer(childCat, parent); - - return child; - } - - [TestMethod] - public void ChildContainerGetReleaseExport_NonSharedRoot_ShouldDisposeChain() - { - var child = CreateParentChildContainerWithNonSharedImporter(); - - var export = child.GetExport(); - var exportedValue = export.Value; - - child.ReleaseExport(export); - - Assert.IsTrue(exportedValue.AnyPartDisposable.IsDisposed); - Assert.IsTrue(exportedValue.AnyPartDisposableRecomposable.IsDisposed); - } - - [TestMethod] - public void ChildContainerAddRemovePart_NonSharedRoot_ShouldDisposeChain() - { - var child = CreateParentChildContainerWithNonSharedImporter(); - - var exportedValue = new NonSharedImporter(); - - CompositionBatch batch = new CompositionBatch(); - var part = batch.AddPart(exportedValue); - child.Compose(batch); - - batch = new CompositionBatch(); - batch.RemovePart(part); - child.Compose(batch); - - Assert.IsTrue(exportedValue.AnyPartDisposable.IsDisposed); - Assert.IsTrue(exportedValue.AnyPartDisposableRecomposable.IsDisposed); - } - - [TestMethod] - public void ChildContainerAddRemovePart_NonSharedRoot_ShouldNotDisposeChain() - { - var child = CreateParentChildContainerWithNonSharedImporter(); - - var exportedValue = child.GetExportedValue(); - - child.Dispose(); - - Assert.IsFalse(exportedValue.AnyPartDisposable.IsDisposed); - Assert.IsFalse(exportedValue.AnyPartDisposableRecomposable.IsDisposed); - } - -#if CLR40 - - [TestMethod] - public void NonSharedPart_Simple_ShouldBeCollected() - { - var catalog = new TypeCatalog(typeof(NonSharedPartSimple)); - var container = new CompositionContainer(catalog); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesExpectedToBeCollected( - container.GetExportedValue()); - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void ContainerDispose_SharedPart_ShouldCollectWholeObjectChain() - { - // Test only works properly with while using the real ConditionalWeakTable - var container = GetContainer(); - - var export = container.GetExport(); - var exportedValue = export.Value; - - container.Dispose(); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesExpectedToBeCollected( - exportedValue, - exportedValue.AnyPartDisposable, - exportedValue.AnyPartDisposableRecomposable, - exportedValue.AnyPartRecomposable, - exportedValue.AnyPartSimple); - - export = null; - exportedValue = null; - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void AddRemovePart_SharedPart_ShouldCollectOnlyRoot() - { - var container = GetContainer(); - - var exportedValue = new SharedImporter(); - - CompositionBatch batch = new CompositionBatch(); - var part = batch.AddPart(exportedValue); - container.Compose(batch); - batch = null; - - batch = new CompositionBatch(); - batch.RemovePart(part); - container.Compose(batch); - batch = null; - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesExpectedToBeCollected( - exportedValue); - - refTracker.AddReferencesNotExpectedToBeCollected( - exportedValue.AnyPartDisposable, - exportedValue.AnyPartDisposableRecomposable, - exportedValue.AnyPartRecomposable, - exportedValue.AnyPartSimple); - - part = null; - exportedValue = null; - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void AddRemovePart_NonSharedPart_ShouldCollectWholeObjectChain() - { - var container = GetContainer(); - - var exportedValue = new NonSharedImporter(); - - CompositionBatch batch = new CompositionBatch(); - var part = batch.AddPart(exportedValue); - container.Compose(batch); - batch = null; - - batch = new CompositionBatch(); - batch.RemovePart(part); - container.Compose(batch); - batch = null; - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesExpectedToBeCollected( - exportedValue, - exportedValue.AnyPartDisposable, - exportedValue.AnyPartDisposableRecomposable, - exportedValue.AnyPartRecomposable, - exportedValue.AnyPartSimple); - - part = null; - exportedValue = null; - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void ContainerDispose_NonSharedPart_ShouldCollectWholeObjectChain() - { - // Test only works properly with while using the real ConditionalWeakTable - var container = GetContainer(); - - var export = container.GetExport(); - var exportedValue = export.Value; - - container.Dispose(); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesExpectedToBeCollected( - exportedValue, - exportedValue.AnyPartDisposable, - exportedValue.AnyPartDisposableRecomposable, - exportedValue.AnyPartRecomposable, - exportedValue.AnyPartSimple); - - export = null; - exportedValue = null; - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void NonSharedImporter_ReleaseReference_ShouldCollectWholeChain() - { - var container = GetContainer(); - - var export = container.GetExport(); - var exportedValue = export.Value; - - var refTracker = new ReferenceTracker(); - - // Non-Disposable references in the chain should be GC'ed - refTracker.AddReferencesExpectedToBeCollected( - exportedValue, - exportedValue.AnyPartRecomposable, - exportedValue.AnyPartSimple); - - // Disposable references in the chain should NOT be GC'ed - refTracker.AddReferencesNotExpectedToBeCollected( - exportedValue.AnyPartDisposable, - exportedValue.AnyPartDisposableRecomposable); - - export = null; - exportedValue = null; - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void ChildContainerDispose_NonSharedPart_ShouldOnlyCleanupChildAndSimpleNonShared() - { - var child = CreateParentChildContainerWithNonSharedImporter(); - - var exportedValue = child.GetExportedValue(); - - child.Dispose(); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesExpectedToBeCollected( - exportedValue, // object in child - exportedValue.AnyPartSimple, // No reference parent so collected. - exportedValue.AnyPartRecomposable); - - // These are in the parent and will not be cleaned out - refTracker.AddReferencesNotExpectedToBeCollected( - exportedValue.AnyPartDisposable, - exportedValue.AnyPartDisposableRecomposable); - - exportedValue = null; - - refTracker.CollectAndAssert(); - - GC.KeepAlive(child); - } - - [TestMethod] - public void ChildContainerGetReleaseExport_NonSharedPart_ShouldCollectWholeObjectChain() - { - var child = CreateParentChildContainerWithNonSharedImporter(); - - var export = child.GetExport(); - var exportedValue = export.Value; - - child.ReleaseExport(export); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesExpectedToBeCollected( - exportedValue, - exportedValue.AnyPartDisposable, - exportedValue.AnyPartDisposableRecomposable, - exportedValue.AnyPartRecomposable, - exportedValue.AnyPartSimple); - - export = null; - exportedValue = null; - - refTracker.CollectAndAssert(); - - GC.KeepAlive(child); - } - - [TestMethod] - public void NonSharedPart_RecomposableImport_NoReference_ShouldBeCollected() - { - var catalog = new TypeCatalog(typeof(NonSharedPartRecomposable)); - var container = new CompositionContainer(catalog); - - // Setup dependency - CompositionBatch batch = new CompositionBatch(); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - batch = null; - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesExpectedToBeCollected( - container.GetExportedValue()); - - refTracker.CollectAndAssert(); - - // Recompose just to ensure we don't blow up, even though we don't expect anything to happen. - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - container.Compose(batch); - batch = null; - - GC.KeepAlive(container); - } - - [TestMethod] - public void ChildContainerAddRemovePart_NonSharedPart_ShouldCollectWholeObjectChain() - { - var child = CreateParentChildContainerWithNonSharedImporter(); - - var exportedValue = new NonSharedImporter(); - - CompositionBatch batch = new CompositionBatch(); - var part = batch.AddPart(exportedValue); - child.Compose(batch); - batch = null; - - batch = new CompositionBatch(); - batch.RemovePart(part); - child.Compose(batch); - batch = null; - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesExpectedToBeCollected( - exportedValue, - exportedValue.AnyPartDisposable, - exportedValue.AnyPartDisposableRecomposable, - exportedValue.AnyPartRecomposable, - exportedValue.AnyPartSimple); - - part = null; - exportedValue = null; - - refTracker.CollectAndAssert(); - - GC.KeepAlive(child); - } - - [TestMethod] - public void GetReleaseExport_SharedPart_ShouldCollectOnlyRoot() - { - var container = GetContainer(); - - var export = container.GetExport(); - var exportedValue = export.Value; - - container.ReleaseExport(export); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesExpectedToBeCollected( - exportedValue); - - refTracker.AddReferencesNotExpectedToBeCollected( - exportedValue.AnyPartDisposable, - exportedValue.AnyPartDisposableRecomposable, - exportedValue.AnyPartRecomposable, - exportedValue.AnyPartSimple); - - export = null; - exportedValue = null; - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void GetReleaseExport_NonSharedPart_ShouldCollectWholeObjectChain() - { - var container = GetContainer(); - - var export = container.GetExport(); - var exportedValue = export.Value; - - container.ReleaseExport(export); - - var refTracker = new ReferenceTracker(); - - refTracker.AddReferencesExpectedToBeCollected( - exportedValue, - exportedValue.AnyPartDisposable, - exportedValue.AnyPartDisposableRecomposable, - exportedValue.AnyPartRecomposable, - exportedValue.AnyPartSimple); - - export = null; - exportedValue = null; - - refTracker.CollectAndAssert(); - - GC.KeepAlive(container); - } - - [TestMethod] - public void ReleaseExports_ShouldWorkWithExportCollection() - { - var container = GetContainer(); - var exports = container.GetExports(); - - Assert.IsTrue(exports.Count() > 0); - - var exportedValues = exports.Select(export => export.Value).ToList(); - - container.ReleaseExports(exports); - - foreach (var obj in exportedValues) - { - Assert.IsTrue(obj.AnyPartDisposable.IsDisposed); - Assert.IsTrue(obj.AnyPartDisposableRecomposable.IsDisposed); - } - } -#endif - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/PartCreatorTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/PartCreatorTests.cs deleted file mode 100644 index 1ce835664bb..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/PartCreatorTests.cs +++ /dev/null @@ -1,368 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.UnitTesting; -using System.Linq; -using System.Reflection; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Diagnostics; -using System.ComponentModel.Composition.ReflectionModel; - -#if SILVERLIGHT - -namespace Tests.Integration -{ - [TestClass] - public class PartCreatorTests - { - public interface IId - { - int Id { get; } - } - - public interface IIdTypeMetadata - { - string IdType { get; } - string ExportTypeIdentity { get; } - } - - - [Export(typeof(IId))] - [ExportMetadata("IdType", "PostiveIncrement")] - public class UniqueExport : IId, IDisposable - { - private static int lastId = 0; - - public UniqueExport() - { - Id = lastId++; - } - - public int Id { get; private set; } - - public void Dispose() - { - Id = -1; - } - } - - [Export] - [CLSCompliant(false)] - public class PartCreatorImporter - { - [ImportingConstructor] - public PartCreatorImporter( - PartCreator idCreatorTCtor, - PartCreator idCreatorTMCtor) - { - this._idCreatorTCtor = idCreatorTCtor; - this._idCreatorTMCtor = idCreatorTMCtor; - } - - private PartCreator _idCreatorTCtor; - private PartCreator _idCreatorTMCtor; - - [Import(typeof(IId))] - public PartCreator _idCreatorTField = null; // public so these can work on SL - - [Import] - public PartCreator _idCreatorTMField = null; // public so these can work on SL - - [Import] - public PartCreator IdCreatorTProperty { get; set; } - - [Import(typeof(IId))] - public PartCreator IdCreatorTMProperty { get; set; } - - [ImportMany] - public PartCreator[] IdCreatorsTProperty { get; set; } - - [ImportMany] - public PartCreator[] IdCreatorsTMProperty { get; set; } - - public void AssertValid() - { - var ids = new int[] - { - VerifyPartCreator(this._idCreatorTCtor), - VerifyPartCreator(this._idCreatorTMCtor), - VerifyPartCreator(this._idCreatorTField), - VerifyPartCreator(this._idCreatorTMField), - VerifyPartCreator(this.IdCreatorTProperty), - VerifyPartCreator(this.IdCreatorTMProperty), - VerifyPartCreator(this.IdCreatorsTProperty[0]), - VerifyPartCreator(this.IdCreatorsTMProperty[0]) - }; - - Assert.AreEqual(1, this.IdCreatorsTProperty.Length, "Should only be one PartCreator"); - Assert.AreEqual(1, this.IdCreatorsTMProperty.Length, "Should only be one PartCreator"); - - CollectionAssert.AllItemsAreUnique(ids, "There should be no duplicate ids"); - } - - private int VerifyPartCreator(PartCreator creator) - { - var val1 = creator.CreatePart(); - var val2 = creator.CreatePart(); - - Assert.AreNotEqual(val1.ExportedValue, val2.ExportedValue, "Values should not be the same"); - Assert.AreNotEqual(val1.ExportedValue.Id, val2.ExportedValue.Id, "Value Ids should not be the same"); - - Assert.IsTrue(val1.ExportedValue.Id >= 0, "Id should be positive"); - - val1.Dispose(); - - Assert.IsTrue(val1.ExportedValue.Id < 0, "Disposal of the value should set the id to negative"); - - return creator.CreatePart().ExportedValue.Id; - } - - private int VerifyPartCreator(PartCreator creator) - { - var val = VerifyPartCreator((PartCreator)creator); - - Assert.AreEqual("PostiveIncrement", creator.Metadata.IdType, "IdType should be PositiveIncrement"); - Assert.AreEqual(AttributedModelServices.GetTypeIdentity(typeof(ComposablePartDefinition)), creator.Metadata.ExportTypeIdentity); - - return val; - } - } - - [TestMethod] - public void PartCreatorStandardImports_ShouldWorkProperly() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(UniqueExport), typeof(PartCreatorImporter)); - var partCreatorImporter = container.GetExportedValue(); - - partCreatorImporter.AssertValid(); - } - - [Export] - public class Foo : IDisposable - { - public bool IsDisposed { get; private set; } - - public void Dispose() - { - this.IsDisposed = true; - } - } - - [Export] - public class SimplePartCreatorImporter - { - [Import] - public PartCreator FooFactory { get; set; } - } - - [TestMethod] - public void PartCreatorOfT_RecompositionSingle_ShouldBlockChanges() - { - var aggCat = new AggregateCatalog(); - var typeCat = new TypeCatalog(typeof(Foo)); - aggCat.Catalogs.Add(new TypeCatalog(typeof(SimplePartCreatorImporter))); - aggCat.Catalogs.Add(typeCat); - - var container = new CompositionContainer(aggCat); - - var fooFactory = container.GetExportedValue(); - - ExceptionAssert.Throws(() => - aggCat.Catalogs.Remove(typeCat)); - - ExceptionAssert.Throws(() => - aggCat.Catalogs.Add(new TypeCatalog(typeof(Foo)))); - } - - [Export] - public class ManyPartCreatorImporter - { - [ImportMany(AllowRecomposition = true)] - public PartCreator[] FooFactories { get; set; } - } - - [TestMethod] - public void FactoryOfT_RecompositionImportMany_ShouldSucceed() - { - var aggCat = new AggregateCatalog(); - var typeCat = new TypeCatalog(typeof(Foo)); - aggCat.Catalogs.Add(new TypeCatalog(typeof(ManyPartCreatorImporter))); - aggCat.Catalogs.Add(typeCat); - - var container = new CompositionContainer(aggCat); - - var fooFactories = container.GetExportedValue(); - - Assert.AreEqual(1, fooFactories.FooFactories.Length); - - aggCat.Catalogs.Add(new TypeCatalog(typeof(Foo))); - - Assert.AreEqual(2, fooFactories.FooFactories.Length); - } - - public class PartCreatorExplicitCP - { - [Import(RequiredCreationPolicy = CreationPolicy.Any)] - public PartCreator FooCreatorAny { get; set; } - - [Import(RequiredCreationPolicy = CreationPolicy.NonShared)] - public PartCreator FooCreatorNonShared { get; set; } - - [Import(RequiredCreationPolicy = CreationPolicy.Shared)] - public PartCreator FooCreatorShared { get; set; } - - [ImportMany(RequiredCreationPolicy = CreationPolicy.Any)] - public PartCreator[] FooCreatorManyAny { get; set; } - - [ImportMany(RequiredCreationPolicy = CreationPolicy.NonShared)] - public PartCreator[] FooCreatorManyNonShared { get; set; } - - [ImportMany(RequiredCreationPolicy = CreationPolicy.Shared)] - public PartCreator[] FooCreatorManyShared { get; set; } - } - - [TestMethod] - public void PartCreator_ExplicitCreationPolicy_CPShouldBeIgnored() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Foo)); - - var part = new PartCreatorExplicitCP(); - - container.SatisfyImportsOnce(part); - - // specifying the required creation policy explicit on the import - // of a PartCreator will be ignored because the PartCreator requires - // the part it wraps to be either Any or NonShared to work properly. - Assert.IsNotNull(part.FooCreatorAny); - Assert.IsNotNull(part.FooCreatorNonShared); - Assert.IsNotNull(part.FooCreatorShared); - - Assert.AreEqual(1, part.FooCreatorManyAny.Length); - Assert.AreEqual(1, part.FooCreatorManyNonShared.Length); - Assert.AreEqual(1, part.FooCreatorManyShared.Length); - } - - public class PartCreatorImportRequiredMetadata - { - [ImportMany] - public PartCreator[] FooCreator { get; set; } - - [ImportMany] - public PartCreator[] FooCreatorWithMetadata { get; set; } - } - - [TestMethod] - public void PartCreator_ImportRequiredMetadata_MissingMetadataShouldCauseImportToBeExcluded() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Foo)); - - var part = new PartCreatorImportRequiredMetadata(); - - container.SatisfyImportsOnce(part); - - Assert.AreEqual(1, part.FooCreator.Length, "Should contain the one Foo"); - Assert.AreEqual(0, part.FooCreatorWithMetadata.Length, "Should NOT contain Foo because it is missing the required Id metadata property"); - } - - [Export(typeof(Foo))] - [PartCreationPolicy(CreationPolicy.Shared)] - public class SharedFoo : Foo - { - } - - [TestMethod] - public void PartCreator_ImportShouldNotImportSharedPart() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(SharedFoo)); - - var foo = container.GetExportedValue(); - Assert.IsNotNull(foo, "Ensure that a Foo actually exists in the container"); - - var part = new PartCreatorImportRequiredMetadata(); - - container.SatisfyImportsOnce(part); - - Assert.AreEqual(0, part.FooCreator.Length, "Should not contain the SharedFoo because the PartCreator should only wrap Any/NonShared parts"); - } - - - [TestMethod] - public void PartCreator_QueryContainerDirectly_ShouldWork() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Foo)); - - var importDef = ReflectionModelServices.CreateImportDefinition( - new LazyMemberInfo(MemberTypes.Field, () => new MemberInfo[] { typeof(PartCreatorTests) }), // Give it a bogus member - AttributedModelServices.GetContractName(typeof(Foo)), - AttributedModelServices.GetTypeIdentity(typeof(Foo)), - Enumerable.Empty>(), - ImportCardinality.ZeroOrMore, - true, - CreationPolicy.Any, - true, // isPartCreator - null); - - var exports = container.GetExports(importDef); - - var partCreator = exports.Single(); - - // Manually walk the steps of using a raw part creator which is modeled as a PartDefinition with - // a single ExportDefinition. - var partDef = (ComposablePartDefinition)partCreator.Value; - var part = partDef.CreatePart(); - var foo = (Foo)part.GetExportedValue(partDef.ExportDefinitions.Single()); - - Assert.IsNotNull(foo); - - var foo1 = (Foo)part.GetExportedValue(partDef.ExportDefinitions.Single()); - Assert.AreEqual(foo, foo1, "Retrieving the exported value from the same part should return the same value"); - - // creating a new part should result in getting a new exported value - var part2 = partDef.CreatePart(); - var foo2 = (Foo)part2.GetExportedValue(partDef.ExportDefinitions.Single()); - - Assert.AreNotEqual(foo, foo2, "New part should equate to a new exported value"); - - // Disposing of part should cause foo to be disposed - ((IDisposable)part).Dispose(); - Assert.IsTrue(foo.IsDisposed); - } - - [Export] - public class PartImporter - { - [Import] - public PartCreator Creator { get; set; } - } - - [Export] - public class SimpleExport - { - } - - [TestMethod] - public void PartCreator_SimpleRejectionRecurrection_ShouldWork() - { - var importTypeCat = new TypeCatalog(typeof(PartImporter)); - var aggCatalog = new AggregateCatalog(importTypeCat); - var container = ContainerFactory.Create(aggCatalog); - var exports = container.GetExports>(); - Assert.AreEqual(0, exports.Count()); - - aggCatalog.Catalogs.Add(new TypeCatalog(typeof(SimpleExport))); - - exports = container.GetExports>(); - Assert.AreEqual(1, exports.Count()); - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/RecompositionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/RecompositionTests.cs deleted file mode 100644 index 1ec36109f93..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/RecompositionTests.cs +++ /dev/null @@ -1,565 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Factories; -using System.UnitTesting; -using System.Linq; -using System.ComponentModel.Composition.Primitives; - -namespace Tests.Integration -{ - [TestClass] - public class RecompositionTests - { - public class Class_OptIn_AllowRecompositionImports - { - [Import("Value", AllowRecomposition = true)] - public int Value { get; set; } - } - - [TestMethod] - public void Import_OptIn_AllowRecomposition() - { - var container = new CompositionContainer(); - var importer = new Class_OptIn_AllowRecompositionImports(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - - // Initial compose Value should be 21 - Assert.AreEqual(21, importer.Value); - - // Recompose Value to be 42 - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - container.Compose(batch); - - Assert.AreEqual(42, importer.Value, "Value should have changed!"); - } - - public class Class_OptOut_AllowRecompositionImports - { - [Import("Value", AllowRecomposition = false)] - public int Value { get; set; } - } - - [TestMethod] - public void Import_OptOut_AllowRecomposition() - { - var container = new CompositionContainer(); - var importer = new Class_OptOut_AllowRecompositionImports(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - - // Initial compose Value should be 21 - Assert.AreEqual(21, importer.Value); - - // Reset value to ensure it doesn't get set to same value again - importer.Value = -21; - - // Recompose Value to be 42 - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - // After rejection batch failures throw ChangeRejectedException to indicate that - // the failure did not affect the container - CompositionAssert.ThrowsChangeRejectedError(ErrorId.ImportEngine_PreventedByExistingImport, () => - { - container.Compose(batch); - }); - - Assert.AreEqual(-21, importer.Value, "Value should NOT have changed!"); - } - - public class Class_Default_AllowRecompositionImports - { - [Import("Value")] - public int Value { get; set; } - } - - [TestMethod] - public void Import_Default_AllowRecomposition() - { - var container = new CompositionContainer(); - var importer = new Class_Default_AllowRecompositionImports(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - - // Initial compose Value should be 21 - Assert.AreEqual(21, importer.Value); - - // Reset value to ensure it doesn't get set to same value again - importer.Value = -21; - - // Recompose Value to be 42 - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - // After rejection batch failures throw ChangeRejectedException to indicate that - // the failure did not affect the container - CompositionAssert.ThrowsChangeRejectedError(ErrorId.ImportEngine_PreventedByExistingImport, () => - { - container.Compose(batch); - }); - - Assert.AreEqual(-21, importer.Value, "Value should NOT have changed!"); - } - - public class Class_BothOptInAndOptOutRecompositionImports - { - [Import("Value", AllowRecomposition = true)] - public int RecomposableValue { get; set; } - - [Import("Value", AllowRecomposition = false)] - public int NonRecomposableValue { get; set; } - } - - [TestMethod] - public void Import_BothOptInAndOptOutRecomposition() - { - var container = new CompositionContainer(); - var importer = new Class_BothOptInAndOptOutRecompositionImports(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - var valueKey = batch.AddExportedValue("Value", 21); - container.Compose(batch); - - // Initial compose values should be 21 - Assert.AreEqual(21, importer.RecomposableValue); - Assert.AreEqual(21, importer.NonRecomposableValue); - - // Reset value to ensure it doesn't get set to same value again - importer.NonRecomposableValue = -21; - importer.RecomposableValue = -21; - - // Recompose Value to be 42 - batch = new CompositionBatch(); - batch.RemovePart(valueKey); - batch.AddExportedValue("Value", 42); - // After rejection batch failures throw ChangeRejectedException to indicate that - // the failure did not affect the container - CompositionAssert.ThrowsChangeRejectedError(ErrorId.ImportEngine_PreventedByExistingImport, () => - { - container.Compose(batch); - }); - - Assert.AreEqual(-21, importer.NonRecomposableValue, "Value should NOT have changed!"); - // The batch rejection means that the recomposable value shouldn't change either - Assert.AreEqual(-21, importer.RecomposableValue, "Value should NOT have changed!"); - } - - public class Class_MultipleOptInRecompositionImportsWithDifferentContracts - { - [Import("Value1", AllowRecomposition = true)] - public int Value1 { get; set; } - - [Import("Value2", AllowRecomposition = true)] - public int Value2 { get; set; } - } - - [TestMethod] - public void Import_OptInRecomposition_Multlple() - { - var container = new CompositionContainer(); - var importer = new Class_MultipleOptInRecompositionImportsWithDifferentContracts(); - - CompositionBatch batch = new CompositionBatch(); - batch.AddPart(importer); - var value1Key = batch.AddExportedValue("Value1", 21); - var value2Key = batch.AddExportedValue("Value2", 23); - container.Compose(batch); - - Assert.AreEqual(21, importer.Value1); - Assert.AreEqual(23, importer.Value2); - - // Reset value to ensure it doesn't get set to same value again - importer.Value1 = -21; - importer.Value2 = -23; - - // Recompose Value to be 42 - batch = new CompositionBatch(); - batch.RemovePart(value1Key); - batch.AddExportedValue("Value1", 42); - container.Compose(batch); - - Assert.AreEqual(42, importer.Value1, "Value should have changed!"); - Assert.AreEqual(-23, importer.Value2, "Value should NOT have changed because Value2 contract should not be updated."); - } - - [PartNotDiscoverable] - public class MyName - { - public MyName(string name) - { - this.Name = name; - } - - [Export("Name")] - public string Name { get; private set; } - } - - [PartNotDiscoverable] - public class Spouse - { - public Spouse(string name) - { - this.Name = name; - } - - [Export("Friend")] - [ExportMetadata("Relationship", "Wife")] - public string Name { get; private set; } - } - - [PartNotDiscoverable] - public class Child - { - public Child(string name) - { - this.Name = name; - } - - [Export("Child")] - public string Name { get; private set; } - } - - [PartNotDiscoverable] - public class Job - { - public Job(string name) - { - this.Name = name; - } - - [Export("Job")] - public string Name { get; private set; } - } - - [PartNotDiscoverable] - public class Friend - { - public Friend(string name) - { - this.Name = name; - } - - [Export("Friend")] - public string Name { get; private set; } - } - - public interface IRelationshipView - { - string Relationship { get; } - } - - [PartNotDiscoverable] - public class Me - { - [Import("Name", AllowRecomposition = true)] - public string Name { get; set; } - - [Import("Job", AllowDefault = true, AllowRecomposition = true)] - public string Job { get; set; } - - [ImportMany("Child")] - public string[] Children { get; set; } - - [ImportMany("Friend")] - public Lazy[] Relatives { get; set; } - - [ImportMany("Friend", AllowRecomposition = true)] - public string[] Friends { get; set; } - } - - [TestMethod] - public void Recomposition_IntegrationTest() - { - var container = new CompositionContainer(); - var batch = new CompositionBatch(); - - var me = new Me(); - batch.AddPart(me); - var namePart = batch.AddPart(new MyName("Blake")); - batch.AddPart(new Spouse("Barbara")); - batch.AddPart(new Friend("Steve")); - batch.AddPart(new Friend("Joyce")); - container.Compose(batch); - Assert.AreEqual(me.Name, "Blake", "Name in initial composition incorrect"); - Assert.AreEqual(me.Job, null, "Job should have the default value"); - Assert.AreEqual(me.Friends.Length, 3, "Number of friends in initial composition incorrect"); - Assert.AreEqual(me.Relatives.Length, 1, "Number of relatives in initial composition incorrect"); - Assert.AreEqual(me.Children.Length, 0, "Number of children in initial composition incorrect"); - - // Can only have one name - ExceptionAssert.Throws(() => - container.ComposeParts(new MyName("Blayke"))); - - batch = new CompositionBatch(); - batch.AddPart(new MyName("Blayke")); - batch.RemovePart(namePart); - container.Compose(batch); - Assert.AreEqual(me.Name, "Blayke", "Name after recomposition incorrect"); - - batch = new CompositionBatch(); - var jobPart = batch.AddPart(new Job("Architect")); - container.Compose(batch); - Assert.AreEqual(me.Job, "Architect", "Job after recomposition incorrect"); - - batch = new CompositionBatch(); - batch.AddPart(new Job("Chimney Sweep")); - container.Compose(batch); - Assert.IsTrue(me.Job == null, "More than one of an optional import should result in the default value"); - - batch = new CompositionBatch(); - batch.RemovePart(jobPart); - container.Compose(batch); - Assert.AreEqual(me.Job, "Chimney Sweep", "Job after re-recomposition incorrect"); - - batch = new CompositionBatch(); - - // Can only have one spouse because they aren't recomposable - ExceptionAssert.Throws(() => - container.ComposeParts(new Spouse("Cameron"))); - - Assert.AreEqual(me.Relatives.Length, 1, "Number of relatives shouldn't be affected by rolled back composition"); - - batch = new CompositionBatch(); - batch.AddPart(new Friend("Graham")); - container.Compose(batch); - Assert.AreEqual(me.Friends.Length, 4, "Number of friends after recomposition incorrect"); - Assert.AreEqual(me.Relatives.Length, 1, "Number of relatives shouldn't be affected by rolled back composition"); - } - - public class FooWithOptionalImport - { - private FooWithSimpleImport _optionalImport; - - [Import(AllowDefault=true, AllowRecomposition=true)] - public FooWithSimpleImport OptionalImport - { - get - { - return this._optionalImport; - } - set - { - if (value != null) - { - this._optionalImport = value; - - Assert.IsTrue(!string.IsNullOrEmpty(this._optionalImport.SimpleValue), "Value should have it's imports satisfied"); - } - } - } - } - - [Export] - public class FooWithSimpleImport - { - [Import("FooSimpleImport")] - public string SimpleValue { get; set; } - } - - [TestMethod] - public void PartsShouldHaveImportsSatisfiedBeforeBeingUsedToSatisfyRecomposableImports() - { - var container = new CompositionContainer(); - var fooOptional = new FooWithOptionalImport(); - - container.ComposeParts(fooOptional); - container.ComposeExportedValue("FooSimpleImport", "NotNullOrEmpty"); - container.ComposeParts(new FooWithSimpleImport()); - - Assert.IsTrue(!string.IsNullOrEmpty(fooOptional.OptionalImport.SimpleValue)); - } - - - [Export] - public class RootImportRecomposable - { - [Import(AllowDefault = true, AllowRecomposition = true)] - public NonSharedImporter Importer { get; set; } - } - - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class NonSharedImporter - { - [Import] - public SimpleImport Import { get; set; } - } - - [Export] - public class RootImporter - { - [Import] - public SimpleImport Import { get; set; } - } - - [Export] - public class SimpleImport - { - public int Property { get { return 42; } } - } - - [TestMethod] - [Ignore] - [WorkItem(733533)] - public void RemoveCatalogWithNonSharedPartWithRequiredImport() - { - var typeCatalog = new TypeCatalog(typeof(NonSharedImporter), typeof(SimpleImport)); - var aggCatalog = new AggregateCatalog(); - var container = new CompositionContainer(aggCatalog); - - aggCatalog.Catalogs.Add(typeCatalog); - aggCatalog.Catalogs.Add(new TypeCatalog(typeof(RootImportRecomposable))); - - var rootExport = container.GetExport(); - var root = rootExport.Value; - - Assert.AreEqual(42, root.Importer.Import.Property); - - aggCatalog.Catalogs.Remove(typeCatalog); - - Assert.IsNull(root.Importer); - } - - [TestMethod] - [Ignore] - [WorkItem(734123)] - public void GetExportResultShouldBePromise() - { - var typeCatalog = new TypeCatalog(typeof(RootImporter), typeof(SimpleImport)); - var aggCatalog = new AggregateCatalog(); - var container = new CompositionContainer(aggCatalog); - - aggCatalog.Catalogs.Add(typeCatalog); - - var root = container.GetExport(); - - ExceptionAssert.Throws(() => - aggCatalog.Catalogs.Remove(typeCatalog) - ); - - var value = root.Value; - Assert.AreEqual(42, value.Import.Property); - } - - [TestMethod] - [WorkItem(789269)] - public void TestRemovingAndReAddingMultipleDefinitionsFromCatalog() - { - var fixedParts = new TypeCatalog(typeof(RootMultipleImporter), typeof(ExportedService)); - var changingParts = new TypeCatalog(typeof(Exporter1), typeof(Exporter2)); - var catalog = new AggregateCatalog(); - catalog.Catalogs.Add(fixedParts); - catalog.Catalogs.Add(changingParts); - - var container = new CompositionContainer(catalog); - - var root = container.GetExport().Value; - - Assert.AreEqual(2, root.Imports.Length); - - catalog.Catalogs.Remove(changingParts); - - Assert.AreEqual(0, root.Imports.Length); - - catalog.Catalogs.Add(changingParts); - - Assert.AreEqual(2, root.Imports.Length); - } - - [Export] - public class RootMultipleImporter - { - [ImportMany(AllowRecomposition=true)] - public IExportedInterface[] Imports { get; set; } - } - - public interface IExportedInterface - { - - } - - [Export(typeof(IExportedInterface))] - public class Exporter1 : IExportedInterface - { - [Import] - public ExportedService Service { get; set; } - } - - [Export(typeof(IExportedInterface))] - public class Exporter2 : IExportedInterface - { - [Import] - public ExportedService Service { get; set; } - } - - [Export] - public class ExportedService - { - - } - - [TestMethod] - [WorkItem(762215)] - [Ignore] - public void TestPartCreatorResurrection() - { - var container = new CompositionContainer(new TypeCatalog(typeof(NonDisposableImportsDisposable), typeof(PartImporter))); - var exports = container.GetExports>(); - Assert.AreEqual(0, exports.Count()); - container.ComposeParts(new DisposablePart()); - exports = container.GetExports>(); - Assert.AreEqual(1, exports.Count()); - } - - [Export] - public class PartImporter - { - [Import] - public PartType Creator { get; set; } - } - - [Export] - public class NonDisposableImportsDisposable - { - [Import] - public DisposablePart Part { get; set; } - } - - [Export] - public class Part - { - - } - [Export] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class DisposablePart : Part, IDisposable - { - public bool Disposed { get; private set; } - public void Dispose() - { - Disposed = true; - } - } - - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/RejectionTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/RejectionTests.cs deleted file mode 100644 index 9efdc6cc569..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/RejectionTests.cs +++ /dev/null @@ -1,505 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.UnitTesting; - -namespace Tests.Integration -{ - [TestClass] - public class RejectionTests - { - public interface IExtension - { - int Id { get; set; } - } - - [Export] - public class MyImporter - { - [ImportMany(AllowRecomposition = true)] - public IExtension[] Extensions { get; set; } - } - - [Export(typeof(IExtension))] - public class Extension1 : IExtension - { - [Import("IExtension.IdValue")] - public int Id { get; set; } - } - - [Export(typeof(IExtension))] - public class Extension2 : IExtension - { - [Import("IExtension.IdValue2")] - public int Id { get; set; } - } - - [TestMethod] - public void Rejection_ExtensionLightUp_AddedViaBatch() - { - var container = ContainerFactory.CreateWithAttributedCatalog( - typeof(MyImporter), - typeof(Extension1), - typeof(Extension2)); - - var importer = container.GetExportedValue(); - - Assert.AreEqual(0, importer.Extensions.Length, "Should have 0 extensions"); - - container.ComposeExportedValue("IExtension.IdValue", 10); - - Assert.AreEqual(1, importer.Extensions.Length, "Should have 1 extension"); - Assert.AreEqual(10, importer.Extensions[0].Id); - - container.ComposeExportedValue("IExtension.IdValue2", 20); - - Assert.AreEqual(2, importer.Extensions.Length, "Should have 2 extension"); - Assert.AreEqual(10, importer.Extensions[0].Id); - Assert.AreEqual(20, importer.Extensions[1].Id); - } - - public class ExtensionValues - { - [Export("IExtension.IdValue")] - public int Value = 10; - - [Export("IExtension.IdValue2")] - public int Value2 = 20; - } - - [TestMethod] - public void Rejection_ExtensionLightUp_AddedViaCatalog() - { - var ext1Cat = CatalogFactory.CreateAttributed(typeof(Extension1)); - var ext2Cat = CatalogFactory.CreateAttributed(typeof(Extension2)); - var hostCat = CatalogFactory.CreateAttributed(typeof(MyImporter)); - var valueCat = CatalogFactory.CreateAttributed(typeof(ExtensionValues)); - - var catalog = new AggregateCatalog(); - catalog.Catalogs.Add(hostCat); - - var container = ContainerFactory.Create(catalog); - - var importer = container.GetExportedValue(); - - Assert.AreEqual(0, importer.Extensions.Length, "Should have 0 extensions"); - - catalog.Catalogs.Add(ext1Cat); - - Assert.AreEqual(0, importer.Extensions.Length, "Should have 0 extensions after ext1 added without dependency"); - - catalog.Catalogs.Add(ext2Cat); - - Assert.AreEqual(0, importer.Extensions.Length, "Should have 0 extensions after ext2 added without dependency"); - - catalog.Catalogs.Add(valueCat); - - Assert.AreEqual(2, importer.Extensions.Length, "Should have 2 extension"); - Assert.AreEqual(10, importer.Extensions[0].Id); - Assert.AreEqual(20, importer.Extensions[1].Id); - } - - public interface IMissing { } - public interface ISingle { } - public interface IMultiple { } - public interface IConditional { } - public class SingleImpl : ISingle { } - public class MultipleImpl : IMultiple { } - - public class NoImportPart - { - public NoImportPart() - { - SingleExport = new SingleImpl(); - MultipleExport1 = new MultipleImpl(); - MultipleExport2 = new MultipleImpl(); - } - - [Export] - public ISingle SingleExport { private set; get; } - - [Export] - public IMultiple MultipleExport1 { private set; get; } - - [Export] - public IMultiple MultipleExport2 { private set; get; } - } - - [Export] - public class Needy - { - public Needy() { } - - [Import] - public ISingle SingleImport { get; set; } - } - - [TestMethod] - public void Rejection_Resurrection() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Needy)); - - var exports1 = container.GetExportedValues(); - - Assert.AreEqual(0, exports1.Count(), "Catalog entry should be rejected"); - - container.ComposeParts(new NoImportPart()); - - var exports2 = container.GetExportedValues(); - Assert.AreEqual(1, exports2.Count(), "Catalog entry should be ressurrected"); - } - - [TestMethod] - public void Rejection_BatchSatisfiesBatch() - { - var container = ContainerFactory.Create(); - var needy = new Needy(); - container.ComposeParts(needy, new NoImportPart()); - Assert.IsInstanceOfType(needy.SingleImport, typeof(SingleImpl), "Import not satisifed as expected"); - } - - [TestMethod] - public void Rejection_BatchSatisfiesBatchReversed() - { - var container = ContainerFactory.Create(); - var needy = new Needy(); - container.ComposeParts(new NoImportPart(), needy); - Assert.IsInstanceOfType(needy.SingleImport, typeof(SingleImpl), "Import not satisifed as expected"); - } - - [TestMethod] - public void Rejection_CatalogSatisfiesBatch() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(NoImportPart)); - var needy = new Needy(); - container.ComposeParts(needy); - Assert.IsInstanceOfType(needy.SingleImport, typeof(SingleImpl), "Import not satisifed as expected"); - } - - [TestMethod] - public void Rejection_TransitiveDependenciesSatisfied() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Needy), typeof(NoImportPart)); - var needy = container.GetExportedValue(); - Assert.IsNotNull(needy); - Assert.IsInstanceOfType(needy.SingleImport, typeof(SingleImpl), "Import not satisifed as expected"); - } - - [TestMethod] - public void Rejection_TransitiveDependenciesUnsatisfied_ShouldThrowCardinalityMismatch() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Needy), typeof(MissingImportPart)); - - ExceptionAssert.Throws(() => - container.GetExportedValue()); - } - - public class MissingImportPart : NoImportPart - { - [Import] - public IMissing MissingImport { set; get; } - } - - [TestMethod] - public void Rejection_BatchRevert() - { - var container = ContainerFactory.Create(); - - ExceptionAssert.Throws(() => - container.ComposeParts(new MissingImportPart())); - } - - [TestMethod] - public void Rejection_DefendPromisesOnceMade() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Needy)); - - var addBatch = new CompositionBatch(); - var removeBatch = new CompositionBatch(); - var addedPart = addBatch.AddPart(new NoImportPart()); - removeBatch.RemovePart(addedPart); - - // Add then remove should be fine as long as exports aren't used yet. - container.Compose(addBatch); - container.Compose(removeBatch); - - // Add the dependencies - container.Compose(addBatch); - - // Retrieve needy which uses an export from addedPart - var export = container.GetExportedValue(); - - // Should not be able to remove the addedPart because someone depends on it. - ExceptionAssert.Throws(() => - container.Compose(removeBatch)); - } - - [TestMethod] - public void Rejection_DefendPromisesLazily() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Needy)); - - // Add the missing dependency for Needy - container.ComposeParts(new NoImportPart()); - - // This change should succeed since the component "Needy" hasn't been fully composed - // and one way of satisfying its needs is as good ask another - var export = container.GetExport(); - - // Cannot add another import because it would break existing promised compositions - ExceptionAssert.Throws(() => - container.ComposeParts(new NoImportPart())); - - // Instansitate the object - var needy = export.Value; - - // Cannot add another import because it would break existing compositions - ExceptionAssert.Throws(() => - container.ComposeParts(new NoImportPart())); - } - - - [TestMethod] - public void Rejection_SwitchPromiseFromManualToCatalog() - { - // This test shows how the priority list in the AggregateCatalog can actually play with - // the rejection work. Until the actual object is actually pulled on and satisfied the - // promise can be moved around even for not-recomposable imports but once the object is - // pulled on it is fixed from that point on. - - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(Needy), typeof(NoImportPart)); - - // Add the missing dependency for Needy - container.ComposeParts(new NoImportPart()); - - // This change should succeed since the component "Needy" hasn't been fully composed - // and one way of satisfying its needs is as good as another - var export = container.GetExport(); - - // Adding more exports doesn't fail because we push the promise to use the NoImportPart from the catalog - // using the priorities from the AggregateExportProvider - container.ComposeParts(new NoImportPart()); - - // Instansitate the object - var needy = export.Value; - - // Cannot add another import because it would break existing compositions - ExceptionAssert.Throws(() => - container.ComposeParts(new NoImportPart())); - } - - public interface ILoopA { } - public interface ILoopB { } - - [Export(typeof(ILoopA))] - public class LoopA1 : ILoopA - { - [Import] - public ILoopB LoopB { set; get; } - } - - [Export(typeof(ILoopA))] - public class LoopA2 : ILoopA - { - [Import] - public ILoopB LoopB { set; get; } - } - - [Export(typeof(ILoopB))] - public class LoopB1 : ILoopB - { - [Import] - public ILoopA LoopA { set; get; } - } - - [Export(typeof(ILoopB))] - public class LoopB2 : ILoopB - { - [Import] - public ILoopA LoopA { set; get; } - } - - // This is an interesting situation. There are several possible self-consistent outcomes: - // - All parts involved in the loop are rejected - // - A consistent subset are not rejected (exactly one of LoopA1/LoopA2 and one of LoopB1/LoopB2 - // - // Both have desireable and undesirable characteristics. The first case is non-discriminatory but - // rejects more parts than are necessary, the second minimizes rejection but must choose a subset - // on somewhat arbitary grounds. - [TestMethod] - public void Rejection_TheClemensLoop() - { - var catalog = new TypeCatalog(new Type[] { typeof(LoopA1), typeof(LoopA2), typeof(LoopB1), typeof(LoopB2) }); - var container = new CompositionContainer(catalog); - var exportsA = container.GetExportedValues(); - var exportsB = container.GetExportedValues(); - - // These assertions would prove solution one - Assert.AreEqual(0, exportsA.Count(), "Catalog ILoopA entries should be rejected"); - Assert.AreEqual(0, exportsB.Count(), "Catalog ILoopB entries should be rejected"); - - // These assertions would prove solution two - //Assert.AreEqual(1, exportsA.Count, "Only noe ILoopA entry should not be rejected"); - //Assert.AreEqual(1, exportsB.Count, "Only noe ILoopB entry should not be rejected"); - } - - public interface IWorkItem - { - string Id { get; set; } - } - - [Export] - public class AllWorkItems - { - [ImportMany(AllowRecomposition = true)] - public Lazy[] WorkItems { get; set; } - } - - [Export(typeof(IWorkItem))] - public class WorkItem : IWorkItem - { - [Import("WorkItem.Id", AllowRecomposition = true)] - public string Id { get; set; } - } - - public class Ids - { - [Export("WorkItem.Id")] - public string Id = "MyId"; - - } - - [TestMethod] - public void AppliedStateNotCompleteedYet() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(AllWorkItems)); - - container.ComposeExportedValue("WorkItem.Id", "A"); - - var workItems = container.GetExportedValue(); - - Assert.AreEqual(0, workItems.WorkItems.Length); - - container.ComposeParts(new WorkItem()); - - Assert.AreEqual(1, workItems.WorkItems.Length); - Assert.AreEqual("A", workItems.WorkItems[0].Value.Id); - } - - [Export] - public class ClassWithMissingImport - { - [Import] - private string _importNotFound = null; - } - - [TestMethod] - public void AppliedStateStored_ShouldRevertStateOnFailure() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(AllWorkItems), typeof(WorkItem), typeof(Ids)); - - var workItems = container.GetExportedValue(); - - Assert.AreEqual(1, workItems.WorkItems.Length); - - var batch = new CompositionBatch(); - - batch.AddExportedValue("WorkItem.Id", "B"); - batch.AddPart(new ClassWithMissingImport()); - - ExceptionAssert.Throws(() => - container.Compose(batch)); - - Assert.AreEqual("MyId", workItems.WorkItems[0].Value.Id); - } - - [Export] - public class OptionalImporter - { - [Import(AllowDefault = true)] - public ClassWithMissingImport Import { get; set; } - } - - [TestMethod] - public void OptionalImportWithMissingDependency_ShouldRejectAndComposeFine() - { - var container = ContainerFactory.CreateWithAttributedCatalog(typeof(OptionalImporter), typeof(ClassWithMissingImport)); - - var importer = container.GetExportedValue(); - - Assert.IsNull(importer.Import); - } - - [Export] - public class PartA - { - [Import(AllowDefault = true, AllowRecomposition = true)] - public PartB ImportB { get; set; } - } - - [Export] - public class PartB - { - [Import] - public PartC ImportC { get; set; } - } - - [Export] - public class PartC - { - [Import] - public PartB ImportB { get; set; } - } - - [TestMethod] - [WorkItem(684510)] - public void PartAOptionalDependsOnPartB_PartBGetAddedLater() - { - var container = new CompositionContainer(new TypeCatalog(typeof(PartC), typeof(PartA))); - var partA = container.GetExportedValue(); - - Assert.IsNull(partA.ImportB); - - var partB = new PartB(); - container.ComposeParts(partB); - - Assert.AreEqual(partA.ImportB, partB); - Assert.IsNotNull(partB.ImportC); - } - - [Export] - public class PartA2 - { - [Import(AllowDefault = true, AllowRecomposition = true)] - public PartB ImportB { get; set; } - - [Import(AllowDefault = true, AllowRecomposition = true)] - public PartC ImportC { get; set; } - } - - [TestMethod] - [WorkItem(684510)] - public void PartAOptionalDependsOnPartBAndPartC_PartCGetRecurrected() - { - var container = new CompositionContainer(new TypeCatalog(typeof(PartA2), typeof(PartB))); - var partA = container.GetExportedValue(); - - Assert.IsNull(partA.ImportB); - Assert.IsNull(partA.ImportC); - - var partC = new PartC(); - container.ComposeParts(partC); - - Assert.AreEqual(partA.ImportB, partC.ImportB); - Assert.AreEqual(partA.ImportC, partC); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/RequiredCreationPolicyTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/RequiredCreationPolicyTests.cs deleted file mode 100644 index 742b4c83ce0..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/Integration/RequiredCreationPolicyTests.cs +++ /dev/null @@ -1,159 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.Linq; -using System.Linq.Expressions; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Tests.Integration -{ - [TestClass] - public class RequiredCreationPolicyTests - { - // Matrix that details which policy to use for a given part to satisfy a given import. - // Part.Any Part.Shared Part.NonShared - // Import.Any Shared Shared NonShared - // Import.Shared Shared Shared N/A - // Import.NonShared NonShared N/A NonShared - - public interface ICreationPolicyExport - { - - } - - [Export(typeof(ICreationPolicyExport))] - public class CreationPolicyAnyExportImplicit : ICreationPolicyExport - { - - } - - [Export(typeof(ICreationPolicyExport))] - [PartCreationPolicy(CreationPolicy.Any)] - public class CreationPolicyAnyExportExplicit : ICreationPolicyExport - { - - } - - [Export(typeof(ICreationPolicyExport))] - [PartCreationPolicy(CreationPolicy.Shared)] - public class CreationPolicySharedExport : ICreationPolicyExport - { - - } - - [Export(typeof(ICreationPolicyExport))] - [PartCreationPolicy(CreationPolicy.NonShared)] - public class CreationPolicyNonSharedExport : ICreationPolicyExport - { - - } - - [Export] - public class RequiredAnyImporterImplicit - { - [ImportMany] - public IEnumerable Exports { get; set; } - } - - [Export] - public class RequiredAnyImporterExplicit - { - [ImportMany(RequiredCreationPolicy = CreationPolicy.Any)] - public IEnumerable Exports { get; set; } - } - - [Export] - public class RequiredSharedImporter - { - [ImportMany(RequiredCreationPolicy = CreationPolicy.Shared)] - public IEnumerable Exports { get; set; } - } - - [Export] - public class RequiredNonSharedImporter - { - [ImportMany(RequiredCreationPolicy = CreationPolicy.NonShared)] - public IEnumerable Exports { get; set; } - } - - private static CompositionContainer CreateDefaultContainer() - { - return ContainerFactory.CreateWithAttributedCatalog( - typeof(ICreationPolicyExport), - - typeof(CreationPolicyAnyExportImplicit), - typeof(CreationPolicyAnyExportExplicit), - typeof(CreationPolicySharedExport), - typeof(CreationPolicyNonSharedExport), - - typeof(RequiredAnyImporterImplicit), - typeof(RequiredAnyImporterExplicit), - typeof(RequiredSharedImporter), - typeof(RequiredNonSharedImporter)); - } - - [TestMethod] - public void RequiredAnyImporterImplicit_ShouldIncludeAll() - { - var container = CreateDefaultContainer(); - - var importer = container.GetExportedValue(); - - EnumerableAssert.AreEqual( - importer.Exports.Select(obj => obj.GetType()), - typeof(CreationPolicyAnyExportImplicit), - typeof(CreationPolicyAnyExportExplicit), - typeof(CreationPolicySharedExport), - typeof(CreationPolicyNonSharedExport)); - } - - [TestMethod] - public void RequiredAnyImporterExplicit_ShouldIncludeAll() - { - var container = CreateDefaultContainer(); - - var importer = container.GetExportedValue(); - - EnumerableAssert.AreEqual( - importer.Exports.Select(obj => obj.GetType()), - typeof(CreationPolicyAnyExportImplicit), - typeof(CreationPolicyAnyExportExplicit), - typeof(CreationPolicySharedExport), - typeof(CreationPolicyNonSharedExport)); - } - - [TestMethod] - public void RequiredSharedImporter_ShouldFilterNonShared() - { - var container = CreateDefaultContainer(); - - var importer = container.GetExportedValue(); - - EnumerableAssert.AreEqual( - importer.Exports.Select(obj => obj.GetType()), - typeof(CreationPolicyAnyExportImplicit), - typeof(CreationPolicyAnyExportExplicit), - typeof(CreationPolicySharedExport)); - } - - [TestMethod] - public void RequiredNonSharedImporter_ShouldFilterShared() - { - var container = CreateDefaultContainer(); - - var importer = container.GetExportedValue(); - - EnumerableAssert.AreEqual( - importer.Exports.Select(obj => obj.GetType()), - typeof(CreationPolicyAnyExportImplicit), - typeof(CreationPolicyAnyExportExplicit), - typeof(CreationPolicyNonSharedExport)); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/LazyOfTTMetadataTests.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/LazyOfTTMetadataTests.cs deleted file mode 100644 index 8e22488c134..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/LazyOfTTMetadataTests.cs +++ /dev/null @@ -1,111 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Factories; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System -{ - [TestClass] - public class LazyOfTMetadataTests - { - public class MetadataView - { - } - - [TestMethod] - public void Constructor1_MetadataViewSet() - { - MetadataView metadataView = new MetadataView(); - var export = new Lazy(() => "Value", metadataView, false); - Assert.AreEqual(metadataView, export.Metadata); - } - - [TestMethod] - public void Constructor1_MetadataViewSetToNull() - { - MetadataView metadataView = new MetadataView(); - var export = new Lazy(() => "Value", null, false); - Assert.IsNull(export.Metadata); - } - - - [TestMethod] - public void Constructor1_NullAsExportedValueGetterArgument_ShouldThrowArgumentNull() - { - ExceptionAssert.ThrowsArgument("valueFactory", () => - { - new Lazy((Func)null, new MetadataView(), false); - }); - } - - [TestMethod] - public void Constructor1_FuncReturningAStringAsExportedValueGetter_ShouldBeReturnedByGetExportedValue() - { - var export = new Lazy(() => "Value", new MetadataView(), false); - - Assert.AreEqual("Value", export.Value); - } - - [TestMethod] - public void Constructor1_FuncReturningNullAsExportedValueGetter_ShouldBeReturnedByGetExportedValue() - { - var export = new Lazy(() => null, new MetadataView(), false); - - Assert.IsNull(export.Value); - } - - [TestMethod] - public void Value_ShouldCacheExportedValueGetter() - { - int count = 0; - - var export = new Lazy(() => - { - count++; - return count; - }, new MetadataView(), false); - - Assert.AreEqual(1, export.Value); - Assert.AreEqual(1, export.Value); - Assert.AreEqual(1, export.Value); - } - [TestMethod] - public void Constructor2_MetadataSet() - { - MetadataView metadataView = new MetadataView(); - var export = new Lazy(metadataView, false); - - Assert.AreSame(metadataView, export.Metadata); - Assert.IsNotNull(export.Value); - } - -#if CLR40 - [TestMethod] - public void Constructor3_MetadataSet() - { - MetadataView metadataView = new MetadataView(); - var export = new Lazy(metadataView, true); - - Assert.AreSame(metadataView, export.Metadata); - Assert.IsNotNull(export.Value); - } - - [TestMethod] - public void Constructor4_MetadataSet() - { - MetadataView metadataView = new MetadataView(); - var export = new Lazy(() => "Value", - metadataView, true); - - Assert.AreSame(metadataView, export.Metadata); - Assert.IsNotNull(export.Value); - } -#endif - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/UnitTesting/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/UnitTesting/.gitattributes deleted file mode 100644 index 5c302f05cff..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/UnitTesting/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/ReflectionItemAssert.cs -crlf -/TestUtilities.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/UnitTesting/ReflectionItemAssert.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/UnitTesting/ReflectionItemAssert.cs deleted file mode 100644 index 2fac3f659b3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/UnitTesting/ReflectionItemAssert.cs +++ /dev/null @@ -1,47 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.ReflectionModel; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.UnitTesting -{ - internal static class ReflectionItemAssert - { - public static void AreSame(ReflectionItem expected, ReflectionItem actual) - { - switch (expected.ItemType) - { - case ReflectionItemType.Property: - { - ReflectionProperty expectedProperty = (ReflectionProperty)expected; - ReflectionProperty actualProperty = (ReflectionProperty)actual; - - ReflectionAssert.AreSame(expectedProperty.UnderlyingGetMethod, actualProperty.UnderlyingGetMethod); - ReflectionAssert.AreSame(expectedProperty.UnderlyingSetMethod, actualProperty.UnderlyingSetMethod); - return; - } - - case ReflectionItemType.Parameter: - { - ReflectionParameter expectedParameter = (ReflectionParameter)expected; - ReflectionParameter actualParameter = (ReflectionParameter)actual; - - ReflectionAssert.AreSame(expectedParameter.UnderlyingParameter, actualParameter.UnderlyingParameter); - return; - } - - default: - { - ReflectionMember expectedMember = (ReflectionMember)expected; - ReflectionMember actualMember = (ReflectionMember)actual; - - ReflectionAssert.AreSame(expectedMember.UnderlyingMember, actualMember.UnderlyingMember); - return; - } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/UnitTesting/TestUtilities.cs b/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/UnitTesting/TestUtilities.cs deleted file mode 100644 index 9da9f86c7a9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/ComponentModelUnitTest/System/UnitTesting/TestUtilities.cs +++ /dev/null @@ -1,97 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition; -using System.IO; -using System.Linq; -using System.Reflection; - -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.UnitTesting -{ - public static class TestUtilities - { - - public static void CheckICollectionOfTConformance(ICollection list, T a, T b, T c, T d) - { - list.Clear(); - EnumerableAssert.AreEqual(list); - - Assert.IsFalse(list.IsReadOnly, "The list should not report being read-only for these tests to work"); - Assert.IsFalse(list.Contains(a), "Contains should fail for anything when the collection is empty"); - Assert.IsFalse(list.Remove(a), "Remove should fail on anything when the collection is empty"); - - list.Add(a); - EnumerableAssert.AreEqual(list, a); - - list.Add(b); - EnumerableAssert.AreEqual(list, a, b); - - list.Add(c); - EnumerableAssert.AreEqual(list, a, b, c); - - list.Remove(b); - EnumerableAssert.AreEqual(list, a, c); - - list.Remove(c); - EnumerableAssert.AreEqual(list, a); - - list.Remove(a); - EnumerableAssert.AreEqual(list); - - list.Add(a); list.Add(b); list.Add(c); - - list.Clear(); - EnumerableAssert.AreEqual(list); - - list.Clear(); - EnumerableAssert.AreEqual(list); - - list.Add(d); list.Add(c); list.Add(b); list.Add(a); - - T[] destination = new T[5]; - list.CopyTo(destination, 0); - EnumerableAssert.AreEqual(destination, d, c, b, a, default(T)); - } - - public static void CheckIListOfTConformance(IList list, T a, T b, T c, T d) - { - CheckICollectionOfTConformance(list, a, b, c, d); - - list.Clear(); - list.Insert(0, d); - list.Insert(0, a); - list.Insert(1, c); - list.Insert(1, b); - CompareListContents(list, a, b, c, d); - - list[1] = a; - CompareListContents(list, a, a, c, d); - - list.RemoveAt(2); - CompareListContents(list, a, a, d); - - Assert.AreEqual(2, list.IndexOf(d), "Expected indexof to return the correct location of {0}", d); - Assert.AreEqual(-1, list.IndexOf(b), "{0} should not be found in the collection", b); - Assert.AreEqual(-1, list.IndexOf(c), "{0} should not be found in the collection", c); - } - - - - public static void CompareListContents(IList list, params object[] values) - { - EnumerableAssert.AreEqual(list, values); - - for (var index = 0; index < values.Length; index++) - { - Assert.AreEqual(values[index], list[index], - "List should return true for Contains on every element, index {0}, length {1}", index, values[index]); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/.gitattributes deleted file mode 100644 index f7d8287f511..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/AssemblyInfo.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/AssemblyInfo.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/AssemblyInfo.cs deleted file mode 100644 index d043eef0a20..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/AssemblyInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ -[assembly: System.CLSCompliant(true)] -[assembly: System.Reflection.AssemblyTitle("System.ComponentModel.Composition.UnitTestFramework")] -[assembly: System.Reflection.AssemblyCopyright("(c) Microsoft Corporation. All rights reserved.")] -[assembly: System.Reflection.AssemblyVersion("2010.02.11")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("System.ComponentModel.Composition.UnitTests")] diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/.gitattributes deleted file mode 100644 index ed47a6216df..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -/DisposableObject.cs -crlf -/EnumExtensions.cs -crlf -/ReferenceTracker.cs -crlf -/TypeExtensions.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/.gitattributes deleted file mode 100644 index e27dae9bcb6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/EnumerableExtensions.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/EnumerableExtensions.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/EnumerableExtensions.cs deleted file mode 100644 index efb9c82994f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/EnumerableExtensions.cs +++ /dev/null @@ -1,72 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Microsoft.Internal.Collections -{ - public static class EnumerableExtensions - { - public static int Count(this IEnumerable source) - { - int count = 0; - - foreach (object o in source) - { - count++; - } - - return count; - } - - public static IEnumerable ToEnumerable(this IEnumerable source) - { - foreach (object value in source) - { - yield return (T)value; - } - } - - public static List ToList(this IEnumerable source) - { - var enumerable = source.ToEnumerable(); - - return System.Linq.Enumerable.ToList(enumerable); - } - - public static T AssertSingle(this IEnumerable source) - { - return AssertSingle(source, t => true); - } - - public static T AssertSingle(this IEnumerable source, string message) - { - return AssertSingle(source, t => true, message); - } - - public static T AssertSingle(this IEnumerable source, Func predicate) - { - return AssertSingle(source, predicate, "Expecting a single item matching the predicate in the collection."); - } - - public static T AssertSingle(this IEnumerable source, Func predicate, string message) - { - int count = 0; - T ret = default(T); - foreach (T t in source) - { - if (predicate(t)) - { - count++; - ret = t; - } - } - - Assert.AreEqual(1, count, message); - return ret; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/Generic/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/Generic/.gitattributes deleted file mode 100644 index f96646a32c5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/Generic/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/DictionaryExtensions.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/Generic/DictionaryExtensions.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/Generic/DictionaryExtensions.cs deleted file mode 100644 index c9942406cde..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Collections/Generic/DictionaryExtensions.cs +++ /dev/null @@ -1,60 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; - -namespace Microsoft.Internal.Collections -{ - public static class DictionaryExtensions - { - public static bool ContainsAllKeys(this IDictionary dictionary, IEnumerable keys) - { - foreach (TKey key in keys) - { - if (!dictionary.ContainsKey(key)) - return false; - } - - return true; - } - - public static bool DictionaryEquals(this IDictionary dictionary1, IDictionary dictionary2) - { - if (dictionary1.Keys.Count != dictionary2.Keys.Count) - { - return false; - } - - foreach (KeyValuePair kvp in dictionary1) - { - TValue value1 = kvp.Value; - TValue value2 = default(TValue); - if (!dictionary2.TryGetValue(kvp.Key, out value2)) - { - return false; - } - - IDictionary nestedDictionary1 = value1 as IDictionary; - IDictionary nestedDictionary2 = value1 as IDictionary; - - if ((nestedDictionary1 != null) && (nestedDictionary2 != null)) - { - if (!nestedDictionary1.DictionaryEquals(nestedDictionary2)) - { - return false; - } - } - else - { - if (!(value1.Equals(value2))) - { - return false; - } - } - } - - return true; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/.gitattributes deleted file mode 100644 index 8946265321a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/ConstraintParser.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/ConstraintParser.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/ConstraintParser.cs deleted file mode 100644 index 2a0a0d3e665..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/ConstraintParser.cs +++ /dev/null @@ -1,225 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - public class ContraintParser - { - private static readonly PropertyInfo _exportDefinitionContractNameProperty = typeof(ExportDefinition).GetProperty("ContractName"); - private static readonly PropertyInfo _exportDefinitionMetadataProperty = typeof(ExportDefinition).GetProperty("Metadata"); - private static readonly MethodInfo _metadataContainsKeyMethod = typeof(IDictionary).GetMethod("ContainsKey"); - private static readonly MethodInfo _metadataItemMethod = typeof(IDictionary).GetMethod("get_Item"); - private static readonly MethodInfo _typeIsInstanceOfTypeMethod = typeof(Type).GetMethod("IsInstanceOfType"); - - public static bool TryParseConstraint(Expression> constraint, out string contractName, out IEnumerable> requiredMetadata) - { - contractName = null; - requiredMetadata = null; - - List> requiredMetadataList = new List>(); - foreach (Expression expression in SplitConstraintBody(constraint.Body)) - { - // First try to parse as a contract, if we don't have one already - if (contractName == null && TryParseExpressionAsContractConstraintBody(expression, constraint.Parameters[0], out contractName)) - { - continue; - } - - // Then try to parse as a required metadata item name - string requiredMetadataItemName = null; - Type requiredMetadataItemType = null; - if (TryParseExpressionAsMetadataConstraintBody(expression, constraint.Parameters[0], out requiredMetadataItemName, out requiredMetadataItemType)) - { - requiredMetadataList.Add(new KeyValuePair(requiredMetadataItemName, requiredMetadataItemType)); - } - - // Just skip the expressions we don't understand - } - - // ContractName should have been set already, just need to set metadata - requiredMetadata = requiredMetadataList; - return true; - } - - - private static IEnumerable SplitConstraintBody(Expression expression) - { - Assert.IsNotNull(expression); - - // The expression we know about should be a set of nested AndAlso's, we - // need to flatten them into one list. we do this iteratively, as - // recursion will create too much of a memory churn. - Stack expressions = new Stack(); - expressions.Push(expression); - - while (expressions.Count > 0) - { - Expression current = expressions.Pop(); - if (current.NodeType == ExpressionType.AndAlso) - { - BinaryExpression andAlso = (BinaryExpression)current; - // Push right first - this preserves the ordering of the expression, which will force - // the contract constraint to come up first as the callers are optimized for this form - expressions.Push(andAlso.Right); - expressions.Push(andAlso.Left); - continue; - } - - yield return current; - } - } - - private static bool TryParseExpressionAsContractConstraintBody(Expression expression, Expression parameter, out string contractName) - { - contractName = null; - - // The expression should be an '==' expression - if (expression.NodeType != ExpressionType.Equal) - { - return false; - } - - BinaryExpression contractConstraintExpression = (BinaryExpression)expression; - - // First try item.ContractName == "Value" - if (TryParseContractNameFromEqualsExpression(contractConstraintExpression.Left, contractConstraintExpression.Right, parameter, out contractName)) - { - return true; - } - - // Then try "Value == item.ContractName - if (TryParseContractNameFromEqualsExpression(contractConstraintExpression.Right, contractConstraintExpression.Left, parameter, out contractName)) - { - return true; - } - - return false; - } - - private static bool TryParseContractNameFromEqualsExpression(Expression left, Expression right, Expression parameter, out string contractName) - { - contractName = null; - - // The left should be access to property "Contract" applied to the parameter - MemberExpression targetMember = left as MemberExpression; - if (targetMember == null) - { - return false; - } - - if ((targetMember.Member != _exportDefinitionContractNameProperty) || (targetMember.Expression != parameter)) - { - return false; - } - - // Right should a constant expression containing the contract name - ConstantExpression contractNameConstant = right as ConstantExpression; - if (contractNameConstant == null) - { - return false; - } - - if (!TryParseConstant(contractNameConstant, out contractName)) - { - return false; - } - - return true; - } - - private static bool TryParseExpressionAsMetadataConstraintBody(Expression expression, Expression parameter, out string requiredMetadataKey, out Type requiredMetadataType) - { - Assumes.NotNull(expression, parameter); - - requiredMetadataKey = null; - requiredMetadataType = null; - - // Should be a call to Type.IsInstanceofType on definition.Metadata[key] - MethodCallExpression outerMethodCall = expression as MethodCallExpression; - if (outerMethodCall == null) - { - return false; - } - - // Make sure that the right method ie being called - if (outerMethodCall.Method != _typeIsInstanceOfTypeMethod) - { - return false; - } - Assumes.IsTrue(outerMethodCall.Arguments.Count == 1); - - - // 'this' should be a constant expression pointing at a Type object - ConstantExpression targetType = outerMethodCall.Object as ConstantExpression; - if(!TryParseConstant(targetType, out requiredMetadataType)) - { - return false; - } - - // SHould be a call to get_Item - MethodCallExpression methodCall = outerMethodCall.Arguments[0] as MethodCallExpression; - if (methodCall == null) - { - return false; - } - - if (methodCall.Method != _metadataItemMethod) - { - return false; - } - - // Make sure the method is being called on the right object - MemberExpression targetMember = methodCall.Object as MemberExpression; - if (targetMember == null) - { - return false; - } - - if ((targetMember.Expression != parameter) || (targetMember.Member != _exportDefinitionMetadataProperty)) - { - return false; - } - - // There should only ever be one argument; otherwise, - // we've got the wrong IDictionary.get_Item method. - Assumes.IsTrue(methodCall.Arguments.Count == 1); - - // Argument should a constant expression containing the metadata key - ConstantExpression requiredMetadataKeyConstant = methodCall.Arguments[0] as ConstantExpression; - if (requiredMetadataKeyConstant == null) - { - return false; - } - - if (!TryParseConstant(requiredMetadataKeyConstant, out requiredMetadataKey)) - { - return false; - } - - return true; - } - - private static bool TryParseConstant(ConstantExpression constant, out T result) - where T : class - { - Assumes.NotNull(constant); - - if (constant.Type == typeof(T) && constant.Value != null) - { - result = (T)constant.Value; - return true; - } - - result = default(T); - return false; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/.gitattributes deleted file mode 100644 index 2d87a8bf956..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -/TraceContext.TraceContextTraceListener.cs -crlf -/TraceContext.cs -crlf -/TraceEventDetails.cs -crlf -/TraceId.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceContext.TraceContextTraceListener.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceContext.TraceContextTraceListener.cs deleted file mode 100644 index aa47b32ed10..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceContext.TraceContextTraceListener.cs +++ /dev/null @@ -1,42 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; -using System.Diagnostics; -using System.Collections.Generic; -using System.Collections.ObjectModel; - -namespace System.ComponentModel.Composition.Diagnostics -{ - partial class TraceContext : IDisposable - { - private class TraceContextTraceListener : TraceListener - { - private readonly Collection _traceEvents = new Collection(); - - public IList TraceEvents - { - get { return _traceEvents; } - } - - public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args) - { - _traceEvents.Add(new TraceEventDetails(eventCache, source, eventType, (TraceId)id, format, args)); - } - - public override void Write(string message) - { - throw new NotImplementedException(); - } - - public override void WriteLine(string message) - { - throw new NotImplementedException(); - } - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceContext.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceContext.cs deleted file mode 100644 index 57486c71b29..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceContext.cs +++ /dev/null @@ -1,44 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; -using System.Linq; -using System.Diagnostics; -using System.Collections.Generic; - -namespace System.ComponentModel.Composition.Diagnostics -{ - public partial class TraceContext : IDisposable - { - private readonly SourceLevels _previousLevel = TraceSourceTraceWriter.Source.Switch.Level; - private readonly TraceContextTraceListener _listener = new TraceContextTraceListener(); - - public TraceContext(SourceLevels level) - { - TraceSourceTraceWriter.Source.Switch.Level = level; - TraceSourceTraceWriter.Source.Listeners.Add(_listener); - } - - [CLSCompliant(false)] - public TraceEventDetails LastTraceEvent - { - get { return _listener.TraceEvents.LastOrDefault(); } - } - - [CLSCompliant(false)] - public IList TraceEvents - { - get { return _listener.TraceEvents; } - } - - public void Dispose() - { - TraceSourceTraceWriter.Source.Listeners.Remove(_listener); - TraceSourceTraceWriter.Source.Switch.Level = _previousLevel; - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceEventDetails.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceEventDetails.cs deleted file mode 100644 index 8883b0f526a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceEventDetails.cs +++ /dev/null @@ -1,62 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; -using System.Diagnostics; - -namespace System.ComponentModel.Composition.Diagnostics -{ - [CLSCompliant(false)] - public class TraceEventDetails - { - public TraceEventDetails(TraceEventCache eventCache, string source, TraceEventType eventType, TraceId id, string format, params object[] args) - { - EventCache = eventCache; - Source = source; - EventType = eventType; - Id = id; - Format = format; - Args = args; - } - - public TraceEventCache EventCache - { - get; - private set; - } - - public string Source - { - get; - private set; - } - - public TraceEventType EventType - { - get; - private set; - } - - public TraceId Id - { - get; - private set; - } - - public string Format - { - get; - private set; - } - - public object[] Args - { - get; - private set; - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceId.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceId.cs deleted file mode 100644 index 7d07532394f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Diagnostics/TraceId.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition.Diagnostics -{ - // We need a public version of CompositionTraceId, so that the QA tests can access and verify the trace. - [CLSCompliant(false)] - public enum TraceId : ushort - { - Rejection_DefinitionRejected = CompositionTraceId.Rejection_DefinitionRejected, - Rejection_DefinitionResurrected = CompositionTraceId.Rejection_DefinitionResurrected, - - Discovery_AssemblyLoadFailed = CompositionTraceId.Discovery_AssemblyLoadFailed, - Discovery_DefinitionMarkedWithPartNotDiscoverableAttribute = CompositionTraceId.Discovery_DefinitionMarkedWithPartNotDiscoverableAttribute, - Discovery_DefinitionContainsGenericParameters = CompositionTraceId.Discovery_DefinitionContainsGenericParameters, - Discovery_DefinitionContainsNoExports = CompositionTraceId.Discovery_DefinitionContainsNoExports, - Discovery_MemberMarkedWithMultipleImportAndImportMany = CompositionTraceId.Discovery_MemberMarkedWithMultipleImportAndImportMany, - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Hosting/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Hosting/.gitattributes deleted file mode 100644 index 4a9c9034149..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Hosting/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/CompositionHostTestService.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Hosting/CompositionHostTestService.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Hosting/CompositionHostTestService.cs deleted file mode 100644 index fc9606310f4..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/Hosting/CompositionHostTestService.cs +++ /dev/null @@ -1,46 +0,0 @@ -#if SILVERLIGHT -using System; -using System.Net; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Hosting -{ - public static class CompositionHostTestService - { - public static void SetupTestGlobalContainer(CompositionContainer container) - { - CompositionHost._container = null; - CompositionHost.Initialize(container); - } - - public static void SetupTestGlobalContainer(ComposablePartCatalog catalog) - { - CompositionHost._container = null; - CompositionHost.Initialize(catalog); - } - - public static void ClearGlobalContainer() - { - CompositionHost._container = null; - } - - public static void ResetGlobalContainer() - { - ClearGlobalContainer(); -#if !BUILDING_IN_VS - // We can only use the default SL Deployment option while building in VS otherwise we - // will not have a proper Application/Deployment object setup. - SetupTestGlobalContainer(new AssemblyCatalog(typeof(CompositionHostTestService).Assembly)); -#endif - } - - public static CompositionContainer GlobalContainer - { - get { return CompositionHost._container; } - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/ReflectionModel/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/ReflectionModel/.gitattributes deleted file mode 100644 index 8e8fec9cec1..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/ReflectionModel/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/ReflectionModelServicesEx.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServicesEx.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServicesEx.cs deleted file mode 100644 index 75b483e163b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServicesEx.cs +++ /dev/null @@ -1,155 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.Linq; -using System.Linq.Expressions; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Reflection; -using System.ComponentModel.Composition.Hosting; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; - -// NOTE : this is a helper class for exosig the EditorFactory functionality to tests until ExportFactory can be moved where it belongs -namespace System.ComponentModel.Composition.ReflectionModel -{ - public static class ReflectionModelServicesEx - { - public static ContractBasedImportDefinition CreateImportDefinition( - Lazy parameter, - string contractName, - string requiredTypeIdentity, - IEnumerable> requiredMetadata, - ImportCardinality cardinality, - CreationPolicy requiredCreationPolicy, - bool isExportFactory, - ICompositionElement origin) - { - return ReflectionModelServices.CreateImportDefinition(parameter, contractName, requiredTypeIdentity, requiredMetadata, cardinality, requiredCreationPolicy, isExportFactory, origin); - } - - public static ContractBasedImportDefinition CreateImportDefinition( - LazyMemberInfo importingMember, - string contractName, - string requiredTypeIdentity, - IEnumerable> requiredMetadata, - ImportCardinality cardinality, - bool isRecomposable, - CreationPolicy requiredCreationPolicy, - bool isExportFactory, - ICompositionElement origin) - { - return ReflectionModelServices.CreateImportDefinition(importingMember, contractName, requiredTypeIdentity, requiredMetadata, cardinality, isRecomposable, requiredCreationPolicy, isExportFactory, origin); - } - - public static bool IsExportFactoryImportDefinition(ImportDefinition importDefinition) - { - return ReflectionModelServices.IsExportFactoryImportDefinition(importDefinition); - } - - public static ContractBasedImportDefinition CreateExportFactoryImportDefinition(ContractBasedImportDefinition productImportDefinition) - { - return new ExportFactoryImportDefinition(productImportDefinition); - } - - private class ExportFactoryImportDefinition : ContractBasedImportDefinition, IPartCreatorImportDefinition - { - private readonly ContractBasedImportDefinition _productImportDefinition; - - public ExportFactoryImportDefinition(ContractBasedImportDefinition productImportDefinition) - : base(CompositionConstants.PartCreatorContractName, CompositionConstants.PartCreatorTypeIdentity, productImportDefinition.RequiredMetadata, - productImportDefinition.Cardinality, productImportDefinition.IsRecomposable, false, CreationPolicy.Any) - { - _productImportDefinition = productImportDefinition; - } - - public ContractBasedImportDefinition ProductImportDefinition - { - get - { - return _productImportDefinition; - } - } - - public override Expression> Constraint - { - get - { - return CreateExportFactoryConstraint(base.Constraint, this._productImportDefinition); - } - } - - public override bool IsConstraintSatisfiedBy(ExportDefinition exportDefinition) - { - if (!base.IsConstraintSatisfiedBy(exportDefinition)) - { - return false; - } - - return IsProductConstraintSatisfiedBy(this._productImportDefinition, exportDefinition); - } - - private static bool IsProductConstraintSatisfiedBy(ImportDefinition productImportDefinition, ExportDefinition exportDefinition) - { - object productValue = null; - if (exportDefinition.Metadata.TryGetValue(CompositionConstants.ProductDefinitionMetadataName, out productValue)) - { - ExportDefinition productDefinition = productValue as ExportDefinition; - - if (productDefinition != null) - { - return productImportDefinition.IsConstraintSatisfiedBy(productDefinition); - } - } - - return false; - } - - private static readonly PropertyInfo _exportDefinitionMetadataProperty = typeof(ExportDefinition).GetProperty("Metadata"); - private static readonly MethodInfo _metadataContainsKeyMethod = typeof(IDictionary).GetMethod("ContainsKey"); - private static readonly MethodInfo _metadataItemMethod = typeof(IDictionary).GetMethod("get_Item"); - - private static Expression> CreateExportFactoryConstraint(Expression> baseConstraint, ImportDefinition productImportDefinition) - { - ParameterExpression exportDefinitionParameter = baseConstraint.Parameters[0]; - - // exportDefinition.Metadata - Expression metadataExpression = Expression.Property(exportDefinitionParameter, _exportDefinitionMetadataProperty); - - // exportDefinition.Metadata.ContainsKey("ProductDefinition") - Expression containsProductExpression = Expression.Call( - metadataExpression, - _metadataContainsKeyMethod, - Expression.Constant(CompositionConstants.ProductDefinitionMetadataName)); - - // exportDefinition.Metadata["ProductDefinition"] - Expression productExportDefinitionExpression = Expression.Call( - metadataExpression, - _metadataItemMethod, - Expression.Constant(CompositionConstants.ProductDefinitionMetadataName)); - - // ProductImportDefinition.Contraint((ExportDefinition)exportDefinition.Metadata["ProductDefinition"]) - Expression productMatchExpression = - Expression.Invoke(productImportDefinition.Constraint, - Expression.Convert(productExportDefinitionExpression, typeof(ExportDefinition))); - - // baseContraint(exportDefinition) && - // exportDefinition.Metadata.ContainsKey("ProductDefinition") && - // ProductImportDefinition.Contraint((ExportDefinition)exportDefinition.Metadata["ProductDefinition"]) - Expression> constraint = - Expression.Lambda>( - Expression.AndAlso( - baseConstraint.Body, - Expression.AndAlso( - containsProductExpression, - productMatchExpression)), - exportDefinitionParameter); - - return constraint; - } - } - - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/.gitattributes deleted file mode 100644 index 54538e6d2f4..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -/CompositionAssert.cs -crlf -/ElementAssert.cs -crlf -/ErrorId.cs -crlf -/ExportsAssert.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/CompositionAssert.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/CompositionAssert.cs deleted file mode 100644 index 8039a825934..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/CompositionAssert.cs +++ /dev/null @@ -1,439 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using System.Linq; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Reflection; -using System.ComponentModel.Composition.Hosting; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.UnitTesting -{ - public static class CompositionAssert - { - internal static void AreEqual(CompositionResult expected, CompositionResult actual) - { - Assert.AreEqual(expected.Succeeded, actual.Succeeded); - - EnumerableAssert.AreSequenceEqual(expected.Errors, actual.Errors, (index, expectedError, actualError) => - { - AreEqual(expectedError, actualError); - }); - } - - internal static void AreEqual(CompositionError expected, CompositionError actual) - { - Assert.AreEqual(((ICompositionError)expected).Id, ((ICompositionError)actual).Id); - Assert.AreEqual(expected.Description, actual.Description); - ExtendedAssert.IsInstanceOfSameType(expected.Exception, actual.Exception); - } - - public static void ThrowsPart(ErrorId id, Action action) - { - ThrowsPart(id, RetryMode.Retry, action); - } - - public static void ThrowsPart(ErrorId id, RetryMode retry, Action action) - { - ThrowsPart(new CompositionErrorExpectation { Id = id }, retry, action); - } - - public static void ThrowsPart(ErrorId id, ICompositionElement element, Action action) - { - ThrowsPart(id, element, RetryMode.Retry, action); - } - - public static void ThrowsPart(ErrorId id, ICompositionElement element, RetryMode retry, Action action) - { - ThrowsPart(new CompositionErrorExpectation { Id = id, Element = element }, retry, action); - } - - public static void ThrowsPart(ErrorId id, Action action) - where TInner : Exception - { - ThrowsPart(id, RetryMode.Retry, action); - } - - public static void ThrowsPart(ErrorId id, RetryMode retry, Action action) - where TInner : Exception - { - ThrowsPart(new CompositionErrorExpectation { Id = id, InnerExceptionType = typeof(TInner) }, retry, action); - } - - private static void ThrowsPart(CompositionErrorExpectation expectation, RetryMode retry, Action action) - { - ExceptionAssert.Throws(retry, action, (thrownException, retryCount) => - { - AssertCore(retryCount, "ComposablePartException", thrownException, expectation); - }); - } - - public static void ThrowsRootError(ErrorId rootId, RetryMode retry, Action action) - { - var exception = ExceptionAssert.Throws(retry, action, (thrownException, retryCount) => - { - ErrorId actualId = GetRootErrorId(thrownException); - - Assert.AreEqual(rootId, actualId, "Retry Count {0}: Expected '{1}' to be the root ErrorId, however, '{2}' is.", retryCount, rootId, actualId); - }); - } - - public static void ThrowsError(ErrorId id, RetryMode retry, Action action) - { - ThrowsError(new CompositionErrorExpectation { Id = id, InnerExceptionType = typeof(TInner) }, RetryMode.Retry, action); - } - - public static void ThrowsError(ErrorId id, Action action) - { - ThrowsError(new CompositionErrorExpectation { Id = id}, RetryMode.Retry, action); - } - - public static void ThrowsError(ErrorId id, ErrorId innerId, Action action) - { - ThrowsError(id, innerId, RetryMode.Retry, action); - } - - public static void ThrowsError(ErrorId id, ErrorId innerId, RetryMode retry, Action action) - { - ThrowsError(GetExpectation(id, innerId), retry, action); - } - - public static void ThrowsError(ErrorId id, ErrorId innerId, ErrorId innerInnerId, Action action) - { - ThrowsError(id, innerId, innerInnerId, RetryMode.Retry, action); - } - - public static void ThrowsError(ErrorId id, ErrorId innerId, ErrorId innerInnerId, RetryMode retry, Action action) - { - ThrowsError(GetExpectation(id, innerId, innerInnerId), retry, action); - } - - public static void ThrowsError(ErrorId id, RetryMode retry, Action action) - { - ThrowsError(new CompositionErrorExpectation { Id = id, }, retry, action); - } - - public static void ThrowsError(ErrorId id, ICompositionElement element, Action action) - { - ThrowsError(new CompositionErrorExpectation { Id = id, Element = element}, RetryMode.Retry, action); - } - - public static void ThrowsError(ErrorId id, ICompositionElement element, RetryMode retry, Action action) - { - ThrowsError(new CompositionErrorExpectation { Id = id, Element = element }, retry, action); - } - - public static void ThrowsError(ErrorId id, Exception exception, Action action) - { - ThrowsError(new CompositionErrorExpectation { Id = id, InnerException = exception }, RetryMode.Retry, action); - } - - public static void ThrowsError(ErrorId id, Exception exception, RetryMode retry, Action action) - { - ThrowsError(new CompositionErrorExpectation { Id = id, InnerException = exception }, retry, action); - } - - public static void ThrowsError(ErrorId id, ICompositionElement element, Exception exception, Action action) - { - ThrowsError(new CompositionErrorExpectation { Id = id, Element = element, InnerException = exception }, RetryMode.Retry, action); - } - - public static void ThrowsError(ErrorId id, ICompositionElement element, Exception exception, RetryMode retry, Action action) - { - ThrowsError(new CompositionErrorExpectation { Id = id, Element = element, InnerException = exception }, retry, action); - } - - private static void ThrowsError(CompositionErrorExpectation expectation, RetryMode retry, Action action) - { - ThrowsErrors(new CompositionErrorExpectation[] { expectation }, retry, action); - } - - public static void ThrowsErrors(ErrorId id1, ErrorId id2, Action action) - { - ThrowsErrors(id1, id2, RetryMode.Retry, action); - } - - public static void ThrowsErrors(ErrorId id1, ErrorId id2, RetryMode retry, Action action) - { - ThrowsErrors(new ErrorId[] { id1, id2 }, retry, action); - } - - public static void ThrowsErrors(ErrorId[] ids, RetryMode retry, Action action) - { - CompositionErrorExpectation[] expectations = new CompositionErrorExpectation[ids.Length]; - for (int i = 0; i < expectations.Length; i++) - { - expectations[i] = new CompositionErrorExpectation { Id = ids[i] }; - } - - ThrowsErrors(expectations, retry, action); - } - - private static void ThrowsErrors(CompositionErrorExpectation[] expectations, RetryMode retry, Action action) - { - ExceptionAssert.Throws(retry, action, (thrownException, retryCount) => - { - AssertCore(retryCount, "CompositionException", thrownException, expectations); - }); - } - - public static void ThrowsChangeRejectedRootError(ErrorId rootId, RetryMode retry, Action action) - { - var exception = ExceptionAssert.Throws(retry, action, (thrownException, retryCount) => - { - ErrorId actualId = GetRootErrorId(thrownException); - - Assert.AreEqual(rootId, actualId, "Retry Count {0}: Expected '{1}' to be the root ErrorId, however, '{2}' is.", retryCount, rootId, actualId); - }); - } - - public static void ThrowsChangeRejectedError(ErrorId id, Action action) - { - ThrowsChangeRejectedError(new CompositionErrorExpectation { Id = id }, RetryMode.Retry, action); - } - - public static void ThrowsChangeRejectedError(ErrorId id, RetryMode retry, Action action) - { - ThrowsChangeRejectedError(new CompositionErrorExpectation { Id = id, }, retry, action); - } - - public static void ThrowsChangeRejectedError(ErrorId id, ICompositionElement element, Action action) - { - ThrowsChangeRejectedError(new CompositionErrorExpectation { Id = id, Element = element }, RetryMode.Retry, action); - } - - public static void ThrowsChangeRejectedError(ErrorId id, ErrorId innerId, RetryMode retry, Action action) - { - ThrowsChangeRejectedError(GetExpectation(id, innerId), retry, action); - } - - public static void ThrowsChangeRejectedError(ErrorId id, ErrorId innerId, ErrorId innerInnerId, Action action) - { - ThrowsChangeRejectedError(id, innerId, innerInnerId, RetryMode.Retry, action); - } - - public static void ThrowsChangeRejectedError(ErrorId id, ErrorId innerId, ErrorId innerInnerId, RetryMode retry, Action action) - { - ThrowsChangeRejectedError(GetExpectation(id, innerId, innerInnerId), retry, action); - } - - private static void ThrowsChangeRejectedError(CompositionErrorExpectation expectation, RetryMode retry, Action action) - { - ThrowsChangeRejectedErrors(new CompositionErrorExpectation[] { expectation }, retry, action); - } - - public static void ThrowsChangeRejectedError(ErrorId id, ICompositionElement element, Exception exception, Action action) - { - ThrowsChangeRejectedError(new CompositionErrorExpectation { Id = id, Element = element, InnerException = exception }, RetryMode.Retry, action); - } - - public static void ThrowsChangeRejectedErrors(ErrorId id1, ErrorId id2, RetryMode retry, Action action) - { - ThrowsChangeRejectedErrors(new ErrorId[] { id1, id2 }, retry, action); - } - - public static void ThrowsChangeRejectedErrors(ErrorId[] ids, RetryMode retry, Action action) - { - CompositionErrorExpectation[] expectations = new CompositionErrorExpectation[ids.Length]; - for (int i = 0; i < expectations.Length; i++) - { - expectations[i] = new CompositionErrorExpectation { Id = ids[i] }; - } - - ThrowsChangeRejectedErrors(expectations, retry, action); - } - - private static void ThrowsChangeRejectedErrors(CompositionErrorExpectation[] expectations, RetryMode retry, Action action) - { - ExceptionAssert.Throws(retry, action, (thrownException, retryCount) => - { - AssertCore(retryCount, "CompositionException", thrownException, expectations); - }); - } - - private static void AssertCore(int retryCount, string prefix, CompositionException exception, CompositionErrorExpectation[] expectations) - { - Assert.AreEqual(exception.Errors.Count, expectations.Length); - - for (int i = 0; i < exception.Errors.Count; i++) - { - AssertCore(retryCount, prefix + ".Errors[" + i + "]", exception.Errors[i], expectations[i]); - } - } - - private static void AssertCore(int retryCount, string prefix, ICompositionError error, CompositionErrorExpectation expectation) - { - if (expectation.IdSpecified) - { - AssertCore(retryCount, prefix, "Id", expectation.Id, (ErrorId)error.Id); - } - - if (expectation.ElementSpecified) - { - AssertCore(retryCount, prefix, "Element", expectation.Element, error.Element); - } - - if (expectation.InnerExceptionSpecified) - { - AssertCore(retryCount, prefix, "InnerException", expectation.InnerException, error.InnerException); - } - - if (expectation.InnerExceptionTypeSpecified) - { - AssertCore(retryCount, prefix, "InnerException.GetType()", expectation.InnerExceptionType, error.InnerException == null ? null : error.InnerException.GetType()); - } - - if (expectation.InnerExpectationsSpecified) - { - ICompositionError innerError = error.InnerException as ICompositionError; - if (innerError != null) - { - Assert.AreEqual(1, expectation.InnerExpectations.Length); - AssertCore(retryCount, prefix + ".InnerException", innerError, expectation.InnerExpectations[0]); - } - else - { - AssertCore(retryCount, prefix + ".InnerException", (CompositionException)error.InnerException, expectation.InnerExpectations); - } - } - } - - private static void AssertCore(int retryCount, string prefix, string propertyName, T expected, T actual) - { - Assert.AreEqual(expected, actual, "Retry Count {0}: Expected '{1}' to be {3}.{4}, however, '{2}' is.", retryCount, expected, actual, prefix, propertyName); - } - - private static CompositionErrorExpectation GetExpectation(params ErrorId[] ids) - { - var parent = new CompositionErrorExpectation() { Id = ids[0] }; - var expectation = parent; - - for (int i = 1; i < ids.Length; i++) - { - expectation.InnerExpectations = new CompositionErrorExpectation[] { new CompositionErrorExpectation() { Id = ids[i] } }; - expectation = expectation.InnerExpectations[0]; - } - - return parent; - } - - private static ErrorId GetRootErrorId(CompositionException exception) - { - Assert.IsTrue(exception.Errors.Count == 1); - - return GetRootErrorId(exception.Errors[0]); - } - - private static ErrorId GetRootErrorId(ICompositionError error) - { - Exception exception = error.InnerException; - - var childError = exception as ICompositionError; - if (childError != null) - { - return GetRootErrorId(childError); - } - - CompositionException composition = exception as CompositionException; - if (composition != null) - { - return GetRootErrorId(composition); - } - - return (ErrorId)error.Id; - } - - private class CompositionErrorExpectation - { - private ErrorId _id; - private Exception _innerException; - private Type _innerExceptionType; - private ICompositionElement _element; - private CompositionErrorExpectation[] _innerExpectations; - - public ErrorId Id - { - get { return _id; } - set - { - _id = value; - IdSpecified = true; - } - } - - public Exception InnerException - { - get { return _innerException; } - set - { - _innerException = value; - InnerExceptionSpecified = true; - } - } - - public Type InnerExceptionType - { - get { return _innerExceptionType; } - set - { - _innerExceptionType = value; - InnerExceptionTypeSpecified = true; - } - } - - public ICompositionElement Element - { - get { return _element; } - set - { - _element = value; - ElementSpecified = true; - } - } - - public CompositionErrorExpectation[] InnerExpectations - { - get { return _innerExpectations; } - set - { - _innerExpectations = value; - InnerExpectationsSpecified = true; - } - } - - public bool IdSpecified - { - get; - private set; - } - - public bool InnerExceptionSpecified - { - get; - private set; - } - - public bool InnerExceptionTypeSpecified - { - get; - private set; - } - - public bool ElementSpecified - { - get; - private set; - } - - public bool InnerExpectationsSpecified - { - get; - private set; - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/ElementAssert.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/ElementAssert.cs deleted file mode 100644 index 8a9a4194475..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/ElementAssert.cs +++ /dev/null @@ -1,42 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.Linq.Expressions; -using System.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.ComponentModel.Composition.UnitTesting -{ - internal static class ElementAssert - { - public static void AreEqual(ICompositionElement expected, ICompositionElement actual) - { - if (expected == null || actual == null) - { - Assert.AreEqual(expected, actual); - return; - } - - Assert.AreEqual(expected.DisplayName, actual.DisplayName); - ElementAssert.AreEqual(expected.Origin, actual.Origin); - } - - public static void AreEqual(IEnumerable expected, IEnumerable actual) - { - Assert.AreEqual(expected.Count(), actual.Count()); - - int index = 0; - foreach (var element in expected) - { - AreEqual(element, actual.ElementAt(index)); - - index++; - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/ErrorId.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/ErrorId.cs deleted file mode 100644 index 4ed1d2cbecc..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/ErrorId.cs +++ /dev/null @@ -1,42 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition -{ - // We need a public version of CompositionErrorId, so that the QA tests can access and verify the errors. - public enum ErrorId : int - { - Unknown = CompositionErrorId.Unknown, - InvalidExportMetadata = CompositionErrorId.InvalidExportMetadata, - RequiredMetadataNotFound = CompositionErrorId.RequiredMetadataNotFound, - UnsupportedExportType = CompositionErrorId.UnsupportedExportType, - ImportNotSetOnPart = CompositionErrorId.ImportNotSetOnPart, - ImportEngine_ComposeTookTooManyIterations = CompositionErrorId.ImportEngine_ComposeTookTooManyIterations, - ImportEngine_ImportCardinalityMismatch = CompositionErrorId.ImportEngine_ImportCardinalityMismatch, - ImportEngine_PartCycle = CompositionErrorId.ImportEngine_PartCycle, - ImportEngine_PartCannotSetImport = CompositionErrorId.ImportEngine_PartCannotSetImport, - ImportEngine_PartCannotGetExportedValue = CompositionErrorId.ImportEngine_PartCannotGetExportedValue, - ImportEngine_PartCannotActivate = CompositionErrorId.ImportEngine_PartCannotActivate, - ImportEngine_PreventedByExistingImport = CompositionErrorId.ImportEngine_PreventedByExistingImport, - ImportEngine_InvalidStateForRecomposition = CompositionErrorId.ImportEngine_InvalidStateForRecomposition, - ReflectionModel_PartConstructorMissing = CompositionErrorId.ReflectionModel_PartConstructorMissing, - ReflectionModel_PartConstructorThrewException = CompositionErrorId.ReflectionModel_PartConstructorThrewException, - ReflectionModel_PartOnImportsSatisfiedThrewException = CompositionErrorId.ReflectionModel_PartOnImportsSatisfiedThrewException, - ReflectionModel_ExportNotReadable = CompositionErrorId.ReflectionModel_ExportNotReadable, - ReflectionModel_ExportThrewException = CompositionErrorId.ReflectionModel_ExportThrewException, - ReflectionModel_ExportMethodTooManyParameters = CompositionErrorId.ReflectionModel_ExportMethodTooManyParameters, - ReflectionModel_ImportNotWritable = CompositionErrorId.ReflectionModel_ImportNotWritable, - ReflectionModel_ImportThrewException = CompositionErrorId.ReflectionModel_ImportThrewException, - ReflectionModel_ImportNotAssignableFromExport = CompositionErrorId.ReflectionModel_ImportNotAssignableFromExport, - ReflectionModel_ImportCollectionNull = CompositionErrorId.ReflectionModel_ImportCollectionNull, - ReflectionModel_ImportCollectionNotWritable = CompositionErrorId.ReflectionModel_ImportCollectionNotWritable, - ReflectionModel_ImportCollectionConstructionThrewException = CompositionErrorId.ReflectionModel_ImportCollectionConstructionThrewException, - ReflectionModel_ImportCollectionGetThrewException = CompositionErrorId.ReflectionModel_ImportCollectionGetThrewException, - ReflectionModel_ImportCollectionIsReadOnlyThrewException = CompositionErrorId.ReflectionModel_ImportCollectionIsReadOnlyThrewException, - ReflectionModel_ImportCollectionClearThrewException = CompositionErrorId.ReflectionModel_ImportCollectionClearThrewException, - ReflectionModel_ImportCollectionAddThrewException = CompositionErrorId.ReflectionModel_ImportCollectionAddThrewException, - ReflectionModel_ImportManyOnParameterCanOnlyBeAssigned = CompositionErrorId.ReflectionModel_ImportManyOnParameterCanOnlyBeAssigned, - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/ExportsAssert.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/ExportsAssert.cs deleted file mode 100644 index d68a4ba1505..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ComponentModel/Composition/UnitTesting/ExportsAssert.cs +++ /dev/null @@ -1,30 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.UnitTesting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.UnitTesting -{ - public static class ExportsAssert - { - public static void AreEqual(IEnumerable actual, params T[] expected) - { - EnumerableAssert.AreEqual((IEnumerable)expected, (IEnumerable)actual.Select(export => export.Value)); - } - - public static void AreEqual(IEnumerable> actual, params T[] expected) - { - EnumerableAssert.AreEqual((IEnumerable)expected, (IEnumerable)actual.Select(export => export.Value)); - } - - public static void AreEqual(IEnumerable> actual, params T[] expected) - { - EnumerableAssert.AreEqual((IEnumerable)expected, (IEnumerable)actual.Select(export => export.Value)); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/DisposableObject.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/DisposableObject.cs deleted file mode 100644 index 5b7ba3cd135..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/DisposableObject.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System -{ - public class DisposableObject : IDisposable - { - public int DisposeCount - { - get; - private set; - } - - public void Dispose() - { - DisposeCount++; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/EnumExtensions.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/EnumExtensions.cs deleted file mode 100644 index f6314786173..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/EnumExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !CLR40 -using System; - -namespace System -{ - public static class EnumExtensions - { - public static bool HasFlag(this Enum enumRef, Enum flag) - { - long value = Convert.ToInt64(enumRef); - long flagVal = Convert.ToInt64(flag); - - return (value & flagVal) == flagVal; - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Globalization/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Globalization/.gitattributes deleted file mode 100644 index f5c09b62787..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Globalization/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/CurrentCultureContext.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Globalization/CurrentCultureContext.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Globalization/CurrentCultureContext.cs deleted file mode 100644 index 6210c7f9aa6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Globalization/CurrentCultureContext.cs +++ /dev/null @@ -1,29 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Globalization; -using System.Threading; - -namespace System.Globalization -{ - public class CurrentCultureContext : IDisposable - { - private CultureInfo _previousCulture; - - public CurrentCultureContext(CultureInfo culture) - { - _previousCulture = Thread.CurrentThread.CurrentCulture; - - Thread.CurrentThread.CurrentCulture = culture; - } - - public void Dispose() - { - if (_previousCulture != null) - { - Thread.CurrentThread.CurrentCulture = _previousCulture; - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/.gitattributes deleted file mode 100644 index bca099de401..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -/FileIO.cs -crlf -/TemporaryDirectory.cs -crlf -/TemporaryFile.cs -crlf -/TemporaryFileCopier.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/FileIO.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/FileIO.cs deleted file mode 100644 index d004fd7c7de..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/FileIO.cs +++ /dev/null @@ -1,50 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Reflection; -using System.UnitTesting; - -namespace System.IO -{ - public static class FileIO - { - public const string RootTemporaryDirectoryName = "RootTempDirectory"; - - private static string _temporaryDirectory; - public static string GetRootTemporaryDirectory() - { - if (_temporaryDirectory == null) - { -#if SILVERLIGHT - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), RootTemporaryDirectoryName); -#else - string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, RootTemporaryDirectoryName); -#endif - - if (!Directory.Exists(path)) - { - Directory.CreateDirectory(path); - } - - _temporaryDirectory = path; - } - - return _temporaryDirectory; - } - - public static string GetNewTemporaryDirectory() - { - string path = Path.Combine(GetRootTemporaryDirectory(), TestServices.GenerateRandomString()); - - Directory.CreateDirectory(path); - - return path; - } - - public static string GetTemporaryFileName(string extension) - { - return Path.Combine(GetRootTemporaryDirectory(), TestServices.GenerateRandomString() + "." + extension); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/TemporaryDirectory.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/TemporaryDirectory.cs deleted file mode 100644 index 7f373a292f5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/TemporaryDirectory.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- - -#if !SILVERLIGHT - -using System; - -namespace System.IO -{ - public class TemporaryDirectory : IDisposable - { - private string _directoryPath; - - public TemporaryDirectory() - { - _directoryPath = FileIO.GetNewTemporaryDirectory(); - } - - public string DirectoryPath - { - get { return _directoryPath; } - } - - public void Dispose() - { - if (_directoryPath != null) - { - try - { - Directory.Delete(_directoryPath, true); - } - catch (IOException) - { - } - - _directoryPath = null; - } - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/TemporaryFile.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/TemporaryFile.cs deleted file mode 100644 index 69fda640ef6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/TemporaryFile.cs +++ /dev/null @@ -1,35 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; - -namespace System.IO -{ - public class TemporaryFile : IDisposable - { - private string _fileName; - - public TemporaryFile() - { - _fileName = Path.GetTempFileName(); - } - - public string FileName - { - get { return _fileName; } - } - - public void Dispose() - { - if (_fileName != null) - { - File.Delete(_fileName); - _fileName = null; - } - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/TemporaryFileCopier.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/TemporaryFileCopier.cs deleted file mode 100644 index d1ae9070ba5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/IO/TemporaryFileCopier.cs +++ /dev/null @@ -1,22 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; - -namespace System.IO -{ - public class TemporaryFileCopier : TemporaryDirectory - { - public TemporaryFileCopier(params string[] fileNames) - { - foreach (string fileName in fileNames) - { - File.Copy(fileName, Path.Combine(DirectoryPath, Path.GetFileName(fileName))); - } - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ReferenceTracker.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ReferenceTracker.cs deleted file mode 100644 index b803e62f604..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/ReferenceTracker.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.UnitTesting; - -namespace System -{ - public class ReferenceTracker - { - public readonly List ReferencesExpectedToBeCollected = new List(); - public readonly List ReferencesNotExpectedToBeCollected = new List(); - - public void AddReferencesExpectedToBeCollected(params object[] objects) - { - for (int i = 0; i < objects.Length; i++) - { - ReferencesExpectedToBeCollected.Add(new WeakReference(objects[i])); - objects[i] = null; - } - } - - public void AddReferencesNotExpectedToBeCollected(params object[] objects) - { - for (int i = 0; i < objects.Length; i++) - { - ReferencesNotExpectedToBeCollected.Add(new WeakReference(objects[i])); - objects[i] = null; - } - } - - public void CollectAndAssert() - { - GC.Collect(); - GC.WaitForPendingFinalizers(); - - EnumerableAssert.IsTrueForAll(ReferencesExpectedToBeCollected, wr => wr.Target == null, "Object should have been collected."); - EnumerableAssert.IsTrueForAll(ReferencesNotExpectedToBeCollected, wr => wr.Target != null, "Object should be have NOT been collected."); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Runtime/Serialization/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Runtime/Serialization/.gitattributes deleted file mode 100644 index 3ed0af6a232..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Runtime/Serialization/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/SerializationTestServices.cs -crlf -/StrictFormatterConverter.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Runtime/Serialization/SerializationTestServices.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Runtime/Serialization/SerializationTestServices.cs deleted file mode 100644 index 338b520cf94..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Runtime/Serialization/SerializationTestServices.cs +++ /dev/null @@ -1,155 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; -using System.IO; -using System.Runtime.Serialization.Formatters.Binary; -using System.Reflection; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.Runtime.Serialization -{ - public static class SerializationTestServices - { - /// - /// Serializes and then deserializes the specified value. - /// - public static T RoundTrip(T value) - { - Assert.IsNotNull(value); - - using (MemoryStream stream = new MemoryStream()) - { - BinaryFormatter formatter = new BinaryFormatter(); - formatter.Serialize(stream, value); - - stream.Seek(0, SeekOrigin.Begin); - return (T)formatter.Deserialize(stream); - } - } - - /// - /// Creates an instance of a type using the serialization constructor. - /// - public static T Create(SerializationInfo info, StreamingContext context) - { - ConstructorInfo constructor = typeof(T).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, - new Type[] { typeof(SerializationInfo), typeof(StreamingContext) }, - (ParameterModifier[])null); - - Assert.IsNotNull(constructor, "Type does not have a private or protected serialization constructor."); - - try - { - return (T)constructor.Invoke(new object[] { info, context }); - } - catch (TargetInvocationException ex) - { - throw ex.InnerException; - } - } - - /// - /// Returns a new instance of replacing the specified member name with the specified value. - /// - public static SerializationInfo CreateSerializationInfoReplacingMember(string memberName, object value) - where T : ISerializable, new() - { - return CreateSerializationInfoReplacingMember(memberName, value, () => new T()); - } - - /// - /// Returns a new instance of replacing the specified member name with the specified value. - /// - public static SerializationInfo CreateSerializationInfoReplacingMember(string memberName, object value, Func creator) - where T : ISerializable - { - T serializableObject = creator(); - - var info = GetObjectDataFrom(serializableObject); - - return CloneReplacingMember(info, memberName, value); - } - - /// - /// Returns a new instance of removing the specified member name. - /// - public static SerializationInfo CreateSerializationInfoRemovingMember(string memberName) - where T : ISerializable, new() - { - return CreateSerializationInfoRemovingMember(memberName, () => new T()); - } - - /// - /// Returns a new instance of removing the specified member name. - /// - public static SerializationInfo CreateSerializationInfoRemovingMember(string memberName, Func creator) - where T : ISerializable - { - T serializableObject = creator(); - - var info = GetObjectDataFrom(serializableObject); - - return CloneRemovingMember(info, memberName); - } - - private static SerializationInfo CloneReplacingMember(SerializationInfo info, string memberName, object value) - { - return Clone(info, (entry, clone) => - { - if (entry.Name != memberName) - { - return true; - } - - // Replace the entry - clone.AddValue(entry.Name, value, value == null ? entry.ObjectType : value.GetType()); - return false; - }); - } - - private static SerializationInfo CloneRemovingMember(SerializationInfo info, string memberName) - { - return Clone(info, (entry, clone) => - { - // Add everything except the member we want to remove - return entry.Name != memberName; - }); - } - - private static SerializationInfo Clone(SerializationInfo info, Func predicate) - { - var clone = GetEmptySerializationInfo(); - - foreach (var entry in info) - { - if (predicate(entry, clone)) - { - clone.AddValue(entry.Name, entry.Value, entry.ObjectType); - } - } - - return clone; - } - - private static SerializationInfo GetObjectDataFrom(T serializableObject) where T : ISerializable - { - var info = GetEmptySerializationInfo(); - - serializableObject.GetObjectData(info, new StreamingContext()); - - return info; - } - - private static SerializationInfo GetEmptySerializationInfo() - { - StrictFormatterConverter converter = new StrictFormatterConverter(); - - return new SerializationInfo(typeof(T), converter); - } - } -} - -#endif // !SILVERLIGHT \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Runtime/Serialization/StrictFormatterConverter.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Runtime/Serialization/StrictFormatterConverter.cs deleted file mode 100644 index 29e68d753b3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/Runtime/Serialization/StrictFormatterConverter.cs +++ /dev/null @@ -1,106 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; - -namespace System.Runtime.Serialization -{ - /// - /// Represents an where no conversion is actually performed. - /// - public class StrictFormatterConverter : IFormatterConverter - { - public object Convert(object value, TypeCode typeCode) - { - return value; - } - - public object Convert(object value, Type type) - { - return value; - } - - public bool ToBoolean(object value) - { - return (bool)value; - } - - public byte ToByte(object value) - { - return (byte)value; - } - - public char ToChar(object value) - { - return (char)value; - } - - public DateTime ToDateTime(object value) - { - return (DateTime)value; - } - - public decimal ToDecimal(object value) - { - return (decimal)value; - } - - public double ToDouble(object value) - { - return (double)value; - } - - public short ToInt16(object value) - { - return (short)value; - } - - public int ToInt32(object value) - { - return (int)value; - } - - public long ToInt64(object value) - { - return (long)value; - } - - [CLSCompliant(false)] - public sbyte ToSByte(object value) - { - return (sbyte)value; - } - - public float ToSingle(object value) - { - return (float)value; - } - - public string ToString(object value) - { - return (string)value; - } - - [CLSCompliant(false)] - public ushort ToUInt16(object value) - { - return (ushort)value; - } - - [CLSCompliant(false)] - public uint ToUInt32(object value) - { - return (uint)value; - } - - [CLSCompliant(false)] - public ulong ToUInt64(object value) - { - return (ulong)value; - } - } -} - -#endif // !SILVERLIGHT \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/TypeExtensions.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/TypeExtensions.cs deleted file mode 100644 index 55d0fb1b22b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/TypeExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Linq; -using System.Reflection; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System -{ - public static class TypeExtensions - { - public static MemberInfo GetSingleMember(this Type type, string name) - { - Assert.IsNotNull(type); - Assert.IsNotNull(name); - - return type.GetMember(name).Single(); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/.gitattributes b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/.gitattributes deleted file mode 100644 index 7c48b21042d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/.gitattributes +++ /dev/null @@ -1,10 +0,0 @@ -/EnumerableAssert.cs -crlf -/ExceptionAssert.cs -crlf -/ExpectationCollectionOfI.cs -crlf -/ExpectationCollectionOfIO.cs -crlf -/ExpectationOfI.cs -crlf -/ExpectationOfIO.cs -crlf -/ExtendedAssert.cs -crlf -/ReflectionAssert.cs -crlf -/RetryMode.cs -crlf -/TestServices.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/EnumerableAssert.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/EnumerableAssert.cs deleted file mode 100644 index 35331181341..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/EnumerableAssert.cs +++ /dev/null @@ -1,204 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Collections; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.Internal.Collections; - -namespace System.UnitTesting -{ - public static class EnumerableAssert - { - public static void IsTrueForAll(IEnumerable source, Predicate predicate) - { - IsTrueForAll(source, predicate, "IsTrueForAll Failed"); - } - - public static void IsTrueForAll(IEnumerable source, Predicate predicate, string message) - { - Assert.IsNotNull(source, "Source should not be null!"); - - foreach (T t in source) - { - Assert.IsTrue(predicate(t), message); - } - } - - // Needed to prevent strings from matching to the plain IEnumerable overload - public static void AreEqual(IEnumerable actual, params string[] expected) - { - AreEqual((IEnumerable)expected, (IEnumerable)actual); - } - - public static void AreEqual(IEnumerable actual, params object[] expected) - { - AreEqual((IEnumerable)expected, (IEnumerable)actual); - } - - public static void AreEqual(IEnumerable actual, params T[] expected) - { - AreEqual((IEnumerable)expected, (IEnumerable)actual); - } - - public static void AreEqual(IEnumerable expected, IEnumerable actual) - { - Assert.AreEqual(expected.Count(), actual.Count(), "Enumerable should contain the correct number of items"); - - List actualList = actual.ToList(); - - foreach (object value in expected) - { - bool removed = actualList.Remove(value); - - Assert.IsTrue(removed, "Enumerable does not contain value {0}.", value); - } - - Assert.AreEqual(0, actualList.Count, "Enumerable contains extra values."); - } - - public static void AreEqual(IEnumerable expected, IEnumerable actual) - { - // First, test the IEnumerable implementation - AreEqual((IEnumerable)expected, (IEnumerable)actual); - - // Second, test the IEnumerable implementation - Assert.AreEqual(expected.Count(), actual.Count(), "Enumerable should contain the correct number of items"); - - List actualList = actual.ToList(); - - foreach (T value in expected) - { - bool removed = actualList.Remove(value); - - Assert.IsTrue(removed, "Enumerable does not contain value {0}.", value); - } - - Assert.AreEqual(0, actualList.Count, "Enumerable contains extra values."); - } - - // Needed to prevent strings from matching to the plain IEnumerable overload - public static void AreSequenceEqual(IEnumerable actual, params string[] expected) - { - AreEqual((IEnumerable)expected, (IEnumerable)actual); - } - - public static void AreSequenceEqual(IEnumerable actual, params object[] expected) - { - AreEqual((IEnumerable)expected, (IEnumerable)actual); - } - - public static void AreSequenceEqual(IEnumerable expected, IEnumerable actual) - { - AreSequenceEqual(expected, actual, (Action)null); - } - - public static void AreSequenceEqual(IEnumerable expected, IEnumerable actual, Action comparer) - { - if (comparer == null) - { - comparer = (i, left, right) => Assert.AreEqual(left, right, "Enumerable at index {0} should have same value", i); - } - - int expectedCount = expected.Count(); - - Assert.AreEqual(expectedCount, actual.Count(), "Enumerable should contain the correct number of items"); - - IEnumerator actualEnumerator = actual.GetEnumerator(); - IEnumerator expectedEnumerator = expected.GetEnumerator(); - - int index = 0; - while (index < expectedCount) - { - Assert.IsTrue(actualEnumerator.MoveNext()); - Assert.IsTrue(expectedEnumerator.MoveNext()); - - comparer(index, expectedEnumerator.Current, actualEnumerator.Current); - index++; - } - } - - public static void AreSequenceEqual(IEnumerable actual, params T[] expected) - { - AreSequenceEqual((IEnumerable)expected, (IEnumerable)actual); - } - - public static void AreSequenceEqual(IEnumerable expected, IEnumerable actual) - { - AreSequenceEqual(expected, actual, (Action)null); - } - - public static void AreSequenceEqual(IEnumerable expected, IEnumerable actual, Action comparer) - { - if (comparer == null) - { - comparer = (i, left, right) => Assert.AreEqual(left, right, "Enumerable at index {0} should have same value", i); - } - - // First, test the IEnumerable implementation - AreSequenceEqual((IEnumerable)expected, (IEnumerable)actual, (Action)((currentIndex, left, right) => comparer(currentIndex, (T)left, (T)right))); - - // Second, test the IEnumerable implementation - int expectedCount = expected.Count(); - - IEnumerator actualEnumerator = actual.GetEnumerator(); - IEnumerator expectedEnumerator = expected.GetEnumerator(); - - int index = 0; - while (index < expectedCount) - { - Assert.IsTrue(actualEnumerator.MoveNext()); - Assert.IsTrue(expectedEnumerator.MoveNext()); - - comparer(index, expectedEnumerator.Current, actualEnumerator.Current); - index++; - } - } - - public static void AreSequenceSame(IEnumerable expected, IEnumerable actual) - { - AreSequenceEqual(expected, actual, (index, left, right) => - { - Assert.AreSame(left, right, "Enumerable at index {0} should have same value", index); - }); - } - - public static void AreEqual(IDictionary expected, IDictionary actual) - { - Assert.AreEqual(expected.Count, actual.Count, "Dictionaries are different : first has '{0} elements, whereas second has '{1}", expected.Count, actual.Count); - - foreach (KeyValuePair kvp in expected) - { - TValue firstValue = kvp.Value; - TValue secondValue = default(TValue); - if (!actual.TryGetValue(kvp.Key, out secondValue)) - { - Assert.Fail("Dictionaries are different : There is no item with key '{0}' in the second dictionary", kvp.Key); - } - - if ((firstValue is IDictionary) && (secondValue is IDictionary)) - { - AreEqual((IDictionary)firstValue, (IDictionary)secondValue); - continue; - } - - Assert.AreEqual(kvp.Value, secondValue, "Dictionaries are different : values for key '{0}' are different - '{1}' vs '{2}'", kvp.Key, firstValue, secondValue); - } - } - - /// - /// Verifies that the specified enumerable is empty. - /// - public static void IsEmpty(IEnumerable source) - { - IsEmpty(source, null); - } - - public static void IsEmpty(IEnumerable source, string message) - { - Assert.AreEqual(0, source.Count(), message); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExceptionAssert.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExceptionAssert.cs deleted file mode 100644 index c75dcc759ba..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExceptionAssert.cs +++ /dev/null @@ -1,326 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Runtime.Serialization; - -namespace System.UnitTesting -{ - public static class ExceptionAssert - { - // NOTE: To catch state corrupting exceptions, it by design that - // the ThrowsXXX methods retry by default. To prevent this in a - // test, simply use one of the overloads that takes a RetryMode. - - /// - /// Verifies that the exception has the default message generated by the base Exception class. - /// - public static void HasDefaultMessage(Exception exception) - { - Assert.IsNotNull(exception); - - // Exception of type '[typename]' was thrown - StringAssert.Contains(exception.Message, exception.GetType().FullName); - } - - /// - /// Verifies that the specified action throws a SerializationException. - /// - public static SerializationException ThrowsSerialization(string memberName, Action action) - { - var exception = Throws(RetryMode.Retry, action, (actual, retryCount) => - { - AssertSerializationMemberName(memberName, actual, retryCount); - }); - - return exception; - } - - /// - /// Verifies that the specified action throws an ObjectDisposedException. - /// - public static ObjectDisposedException ThrowsDisposed(object instance, Action action) - { - var exception = Throws(RetryMode.Retry, action, (actual, retryCount) => - { - AssertObjectDisposed(instance, actual, retryCount); - }); - - return exception; - } - - /// - /// Verifies that the specified action throws an ArgumentNullException. - /// - public static ArgumentNullException ThrowsArgumentNull(string parameterName, Action action) - { - return ThrowsArgument(parameterName, action); - } - - /// - /// Verifies that the specified action throws an ArgumentException. - /// - public static ArgumentException ThrowsArgument(string parameterName, Action action) - { - return ThrowsArgument(parameterName, action); - } - - /// - /// Verifies that the specified action throws an ArgumentException of type . - /// - public static T ThrowsArgument(string parameterName, Action action) - where T : ArgumentException - { - var exception = Throws(RetryMode.Retry, action, (actual, retryCount) => - { - AssertSameParameterName(parameterName, actual, retryCount); - }); - - return exception; - } - - /// - /// Verifies that the specified action throws an exception of type , - /// with the specified inner exception of type . - /// - public static T Throws(Action action) - where T : Exception - where TInner : Exception - { - return Throws(RetryMode.Retry, action); - } - - /// - /// Verifies that the specified action throws an exception of type , - /// with the specified inner exception of type , and indicating - /// whether to retry. - /// - public static T Throws(RetryMode retry, Action action) - where T : Exception - where TInner : Exception - { - return Throws(retry, action, (Action)null); - } - - /// - /// Verifies that the specified action throws an exception of type , - /// with the specified inner exception of type , indicating - /// whether to retry and running the specified validator. - /// - public static T Throws(RetryMode retry, Action action, Action validator) - where T : Exception - where TInner : Exception - { - var exception = Throws(retry, action, (actual, retryCount) => - { - AssertIsExactInstanceOfInner(typeof(TInner), actual, retryCount); - - if (validator != null) - { - validator(actual, retryCount); - } - }); - - return exception; - } - - /// - /// Verifies that the specified action throws an exception of type , - /// with the specified inner exception. - /// - public static T Throws(Exception innerException, Action action) - where T : Exception - { - return Throws(innerException, RetryMode.Retry, action, (Action)null); - } - - /// - /// Verifies that the specified action throws an exception of type , - /// with the specified inner exception, and indicating whether to retry. - /// - public static T Throws(Exception innerException, RetryMode retry, Action action) - where T : Exception - { - return Throws(innerException, RetryMode.Retry, action, (Action)null); - } - - /// - /// Verifies that the specified action throws an exception of type , - /// with the specified inner exception, indicating whether to retry and running the - /// specified validator. - /// - public static T Throws(Exception innerException, RetryMode retry, Action action, Action validator) - where T : Exception - { - T exception = Throws(retry, action, (actual, retryCount) => - { - AssertSameInner(innerException, actual, retryCount); - - if (validator != null) - { - validator(actual, retryCount); - } - }); - - return exception; - } - - /// - /// Verifies that the specified action throws an exception of type . - /// - public static T Throws(Action action) - where T : Exception - { - return Throws(RetryMode.Retry, action, (Action)null); - } - - /// - /// Verifies that the specified action throws an exception of type , - /// indicating whether to retry. - /// - public static T Throws(RetryMode retry, Action action) - where T : Exception - { - return Throws(retry, action, (Action)null); - } - - /// - /// Verifies that the specified action throws an exception of type , - /// indicating whether to retry and running the specified validator. - /// - public static T Throws(RetryMode retry, Action action, Action validator) - where T : Exception - { - var exception = (T)Run(retry, action, (actual, retryCount) => - { - AssertIsExactInstanceOf(typeof(T), actual, retryCount); - - if (validator != null) - { - validator((T)actual, retryCount); - } - }); - - return exception; - } - - /// - /// Verifies that the specified action throws the specified exception. - /// - public static void Throws(Exception expected, Action action) - { - Throws(expected, RetryMode.Retry, action); - } - - /// - /// Verifies that the specified action throws the specified exception, - /// indicating whether to retry. - /// - public static void Throws(Exception expected, RetryMode retry, Action action) - { - Throws(expected, retry, action, (Action)null); - } - - /// - /// Verifies that the specified action throws the specified exception, - /// indicating whether to retry and running the specified validator. - /// - public static void Throws(Exception expected, RetryMode retry, Action action, Action validator) - { - Run(retry, action, (actual, retryCount) => - { - AssertSame(expected, actual, retryCount); - - if (validator != null) - { - validator(actual, retryCount); - } - }); - } - - private static Exception Run(RetryMode retry, Action action, Action validator) - { - Exception exception = null; - - for (int i = -1; i < (int)retry; i++) - { - exception = Run(action); - - validator(exception, i + 2); - } - - return exception; - } - - private static Exception Run(Action action) - { - try - { - action(); - return null; - } - catch (Exception ex) - { - return ex; - } - } - - private static void AssertSerializationMemberName(string memberName, SerializationException actual, int retryCount) - { - // Unfortunately, SerializationException does not provide a way to get our hands on the - // the actual member that was missing from the SerializationInfo, so we need to grok the - // message string. - - // Member '[memberName]' was not found. - StringAssert.Contains(actual.Message, "'" + memberName + "'", "Retry Count {0}: Expected SerializationException MemberName to be '{1}'", retryCount, memberName); - } - - private static void AssertObjectDisposed(object instance, ObjectDisposedException actual, int retryCount) - { - string objectName = instance.GetType().FullName; - - Assert.AreEqual(objectName, actual.ObjectName, "Retry Count {0}: Expected {1}.ObjectName to be '{2}', however, '{3}' is.", retryCount, actual.GetType().Name, objectName, actual.ObjectName); - } - - private static void AssertSameParameterName(string parameterName, ArgumentException actual, int retryCount) - { -#if !SILVERLIGHT - Assert.AreEqual(parameterName, actual.ParamName, "Retry Count {0}: Expected {1}.ParamName to be '{2}', however, '{3}' is.", retryCount, actual.GetType().Name, parameterName, actual.ParamName); -#else - // Silverlight doesn't have ArgumentException.ParamName - StringAssert.Contains(actual.Message, parameterName, "Retry Count {0}: Expected {1}.ParamName to be '{2}'", retryCount, actual.GetType().Name, parameterName); -#endif - } - - private static void AssertSame(Exception expected, Exception actual, int retryCount) - { - Assert.AreSame(expected, actual, "Retry Count {0}: Expected '{1}' to be thrown, however, '{2}' was thrown.", retryCount, expected, actual); - } - - private static void AssertSameInner(Exception innerException, Exception actual, int retryCount) - { - Assert.AreSame(innerException, actual.InnerException, "Retry Count {0}: Expected '{1}' to be the inner exception, however, '{2}' is.", retryCount, innerException, actual.InnerException); - } - - private static void AssertIsExactInstanceOf(Type expectedType, Exception actual, int retryCount) - { - if (actual == null) - Assert.Fail("Retry Count {0}: Expected '{1}' to be thrown", retryCount, expectedType); - - Type actualType = actual.GetType(); - - Assert.AreSame(expectedType, actualType, "Retry Count {0}: Expected '{1}' to be thrown, however, '{2}' was thrown.", retryCount, expectedType, actualType); - } - - private static void AssertIsExactInstanceOfInner(Type expectedType, Exception actual, int retryCount) - { - if (actual.InnerException == null) - Assert.Fail("Retry Count {0}: Expected '{1}' be the inner exception, however, it is null.", retryCount, expectedType); - - Type actualType = actual.InnerException.GetType(); - - Assert.AreSame(expectedType, actualType, "Retry Count {0}: Expected '{1}' to be the inner exception, however, '{2}' is.", retryCount, expectedType, actualType); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationCollectionOfI.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationCollectionOfI.cs deleted file mode 100644 index 718c898193d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationCollectionOfI.cs +++ /dev/null @@ -1,30 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.ObjectModel; -using System.Collections.Generic; - -namespace System.UnitTesting -{ - public class ExpectationCollection : Collection> - { - public void Add(TInputAndOutput inputAndOutput) - { - Add(inputAndOutput, inputAndOutput); - } - - public void AddRange(IEnumerable inputAndOutputs) - { - foreach (TInputAndOutput inputAndOutput in inputAndOutputs) - { - Add(inputAndOutput); - } - } - - public void Add(TInputAndOutput input, TInputAndOutput output) - { - Add(new Expectation(input, output)); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationCollectionOfIO.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationCollectionOfIO.cs deleted file mode 100644 index f323eb5242d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationCollectionOfIO.cs +++ /dev/null @@ -1,16 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.ObjectModel; - -namespace System.UnitTesting -{ - public class ExpectationCollection : Collection> - { - public void Add(TInput input, TOutput output) - { - Add(new Expectation(input, output)); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationOfI.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationOfI.cs deleted file mode 100644 index 7670f8cf6f2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationOfI.cs +++ /dev/null @@ -1,16 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.UnitTesting -{ - public class Expectation : Expectation - { - public Expectation(TInputAndOutput input, TInputAndOutput output) - : base(input, output) - { - } - } - -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationOfIO.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationOfIO.cs deleted file mode 100644 index 00e1b7bc999..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExpectationOfIO.cs +++ /dev/null @@ -1,28 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.UnitTesting -{ - public class Expectation - { - public Expectation(TInput input, TOutput output) - { - Input = input; - Output = output; - } - - public TInput Input - { - get; - private set; - } - - public TOutput Output - { - get; - private set; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExtendedAssert.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExtendedAssert.cs deleted file mode 100644 index 97b605c88da..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ExtendedAssert.cs +++ /dev/null @@ -1,70 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.UnitTesting -{ - public static class ExtendedAssert - { - /// - /// Verifies that the two specified objects are an instance of the same type. - /// - public static void IsInstanceOfSameType(object expected, object actual) - { - if (expected == null || actual == null) - { - Assert.AreSame(expected, actual); - return; - } - - Assert.AreSame(expected.GetType(), actual.GetType()); - } - - public static void ContainsLines(string value, params string[] lines) - { - StringReader reader = new StringReader(value); - - int count = 0; - string line; - while ((line = reader.ReadLine()) != null) - { - if (count == lines.Length) - { - Assert.Fail(); - } - - StringAssert.Contains(line, lines[count]); - - count++; - } - - Assert.AreEqual(lines.Length, count, "Expectation: {0}; Result: {1}", String.Join(Environment.NewLine, lines), value); - } - - public static void EnumsContainSameValues() - where TEnum1 : struct - where TEnum2 : struct - { - EnumsContainSameValuesCore(); - EnumsContainSameValuesCore(); - } - - private static void EnumsContainSameValuesCore() - where TEnum1 : struct - where TEnum2 : struct - { - var values = TestServices.GetEnumValues(); - - foreach (TEnum1 value in values) - { - string name1 = Enum.GetName(typeof(TEnum1), value); - string name2 = Enum.GetName(typeof(TEnum2), value); - - Assert.AreEqual(name1, name2, "{0} contains a value that {1} does not have. These enums need to be in sync.", typeof(TEnum1), typeof(TEnum2)); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ReflectionAssert.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ReflectionAssert.cs deleted file mode 100644 index bc0fca3b83e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/ReflectionAssert.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Reflection; - -namespace System.UnitTesting -{ - // Unfortunately, you can't rely on reference equality for MemberInfo and ParameterInfo - // objects because, you may get different instances representing the same members depending - // on the type that the member was retrieived from. - - public static class ReflectionAssert - { - public static void AreSame(MemberInfo expected, MemberInfo actual) - { - if (expected == null && actual == null) - { - return; - } - - Assert.AreEqual(expected.MetadataToken, actual.MetadataToken); - Assert.AreSame(expected.Module, actual.Module); - Assert.AreEqual(expected.MemberType, actual.MemberType); - } - - public static void AreSame(ParameterInfo expected, ParameterInfo actual) - { - if (expected == null && actual == null) - { - return; - } - - ReflectionAssert.AreSame(expected.Member, actual.Member); - Assert.AreEqual(expected.MetadataToken, actual.MetadataToken); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/RetryMode.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/RetryMode.cs deleted file mode 100644 index bdda321a7c9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/RetryMode.cs +++ /dev/null @@ -1,14 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace System.UnitTesting -{ - public enum RetryMode : int - { - DoNotRetry = 0, - Retry = 1, - } -} diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/TestServices.cs b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/TestServices.cs deleted file mode 100644 index 87032d796ad..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/UnitTesting/TestServices.cs +++ /dev/null @@ -1,30 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Reflection; -using System.Collections.Generic; - -namespace System.UnitTesting -{ - public static class TestServices - { - public static string GenerateRandomString() - { - return Guid.NewGuid().ToString().Replace('-', '_'); - } - - public static IEnumerable GetEnumValues() where TEnum : struct - { // Silverlight 2.0 does not have Enum.GetValues() - // so we need to write our own - - foreach (FieldInfo field in typeof(TEnum).GetFields()) - { - if (!field.IsLiteral) - continue; - - yield return (TEnum)field.GetRawConstantValue(); - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/UnitTestFramework.csproj b/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/UnitTestFramework.csproj deleted file mode 100644 index 3bde43f2533..00000000000 --- a/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/UnitTestFramework.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - Migrated rules for UnitTestFramework.ruleset - - - - ..\..\bin - $(DefineConstants);TRACE - 1570;1572;1573;1591;1699 - - - 9.0.30729 - 2.0 - {35FBE8A0-D87E-4991-B3FC-2A77807DEC85} - FULLCLR;SILVERLIGHT - Library - Properties - - - System.ComponentModel.Composition.UnitTestFramework - 512 - ;1699;1570;1572;1573;1591;0414 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - true - - - - - - - - {1BBA5101-D4F0-48B8-A5D6-7B23A099DCE3} - ComponentModel - - - - - - {A497DC28-0A3B-4BAD-B964-B8B436686D98} - Composition.Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/.gitattributes deleted file mode 100644 index 5bebade7c71..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/.gitattributes +++ /dev/null @@ -1,6 +0,0 @@ -/AssemblyInfo.cs -crlf -/SilverlightAdditions.cs -crlf -/Strings.Designer.cs -crlf -/Strings.resx -crlf -/SuppressMessages.cs -crlf -/SuppressMessagesBaselined.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/AssemblyInfo.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/AssemblyInfo.cs deleted file mode 100644 index e77ac0d8553..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/AssemblyInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -[assembly: System.CLSCompliant(true)] -[assembly: System.Reflection.AssemblyTitle("System.ComponentModel.Composition")] -[assembly: System.Reflection.AssemblyCopyright("(c) Microsoft Corporation. All rights reserved.")] -[assembly: System.Reflection.AssemblyVersion(Consts.FxVersion)] -[assembly: System.Reflection.AssemblyKeyFile ("../ecma.pub")] -[assembly: System.Reflection.AssemblyDelaySign (true)] -//[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("System.ComponentModel.Composition.UnitTests")] -//[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("System.ComponentModel.Composition.UnitTestFramework")] diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/ComponentModel - SL.csproj b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/ComponentModel - SL.csproj deleted file mode 100644 index 819645d6347..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/ComponentModel - SL.csproj +++ /dev/null @@ -1,211 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A36AEF66-2411-4225-B68E-F2D29368A31B} - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Microsoft.Internal - System.ComponentModel.Composition - v3.5 - 512 - - - true - full - false - ..\..\bin\SL - DEBUG;TRACE;SILVERLIGHT - true - true - prompt - 4 - 1570;1572;1573;1591;1699 - ..\..\bin\SL\System.ComponentModel.Composition.xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Strings.resx - - - - - ResXFileCodeGenerator - Strings.Designer.cs - Microsoft.Internal - - - - - - - - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/ComponentModel.csproj b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/ComponentModel.csproj deleted file mode 100644 index 75c4836b09d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/ComponentModel.csproj +++ /dev/null @@ -1,237 +0,0 @@ - - - - Migrated rules for ComponentModel.ruleset - - - - ..\..\bin - $(DefineConstants);TRACE - 1570;1572;1573;1591;1699 - - - 10.0.20729 - 2.0 - {1BBA5101-D4F0-48B8-A5D6-7B23A099DCE3} - FULLCLR;SILVERLIGHT - Library - Microsoft.Internal - System.ComponentModel.Composition - $(OutputPath)\System.ComponentModel.Composition.xml - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - true - - - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Strings.resx - Microsoft.Internal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - ResXFileCodeGenerator - Strings.Designer.cs - Microsoft.Internal - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/ComponentModelSL.csproj b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/ComponentModelSL.csproj deleted file mode 100644 index be3fe5e8867..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/ComponentModelSL.csproj +++ /dev/null @@ -1,240 +0,0 @@ - - - - Migrated rules for ComponentModel.ruleset - - - - true - $(DefineConstants);SILVERLIGHT - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - ..\..\bin\SL - v3.5 - 1570;1572;1573;1591;1699 - - - 10.0.20729 - 2.0 - {1BBA5101-D4F0-48B8-A5D6-7B23A099DCE3} - FULLCLR;SILVERLIGHT - Library - Microsoft.Internal - System.ComponentModel.Composition - $(OutputPath)\System.ComponentModel.Composition.xml - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - true - - - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Strings.resx - Microsoft.Internal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - ResXFileCodeGenerator - Strings.Designer.cs - Microsoft.Internal - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/.gitattributes deleted file mode 100644 index 8843daa9c3b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/.gitattributes +++ /dev/null @@ -1,14 +0,0 @@ -/Assumes.InternalErrorException.cs -crlf -/Assumes.cs -crlf -/AttributeServices.cs -crlf -/ContractServices.cs -crlf -/GenerationServices.cs -crlf -/LazyServices.cs -crlf -/Lock.Reader.cs -crlf -/Lock.Writer.cs -crlf -/Lock.cs -crlf -/ReflectionInvoke.cs -crlf -/ReflectionServices.cs -crlf -/Requires.cs -crlf -/SilverlightReflectionInvoke.cs -crlf -/StringComparers.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Assumes.InternalErrorException.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Assumes.InternalErrorException.cs deleted file mode 100644 index 147e85709f8..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Assumes.InternalErrorException.cs +++ /dev/null @@ -1,32 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Runtime.Serialization; - -namespace Microsoft.Internal -{ - partial class Assumes - { - // The exception that is thrown when an internal assumption failed. - [Serializable] - [SuppressMessage("Microsoft.Design", "CA1064:ExceptionsShouldBePublic")] - private class InternalErrorException : Exception - { - public InternalErrorException(string message) - : base(string.Format(CultureInfo.CurrentCulture, Strings.InternalExceptionMessage, message)) - { - } - -#if !SILVERLIGHT - [System.Security.SecuritySafeCritical] - protected InternalErrorException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } -#endif - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Assumes.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Assumes.cs deleted file mode 100644 index 7b1dd6f7975..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Assumes.cs +++ /dev/null @@ -1,102 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Runtime.Serialization; - -namespace Microsoft.Internal -{ - internal static partial class Assumes - { - [DebuggerStepThrough] - internal static void NotNull(T value) - where T : class - { - IsTrue(value != null); - } - - [DebuggerStepThrough] - internal static void NotNull(T1 value1, T2 value2) - where T1 : class - where T2 : class - { - NotNull(value1); - NotNull(value2); - } - - [DebuggerStepThrough] - internal static void NotNull(T1 value1, T2 value2, T3 value3) - where T1 : class - where T2 : class - where T3 : class - { - NotNull(value1); - NotNull(value2); - NotNull(value3); - } - - [DebuggerStepThrough] - internal static void NotNullOrEmpty(T[] values) - { - Assumes.NotNull(values); - Assumes.IsTrue(values.Length > 0); - } - - [DebuggerStepThrough] - internal static void NotNullOrEmpty(string value) - { - NotNull(value); - IsTrue(value.Length > 0); - } - - [DebuggerStepThrough] - internal static void Null(T value) - where T : class - { - IsTrue(value == null); - } - - [DebuggerStepThrough] - internal static void IsFalse(bool condition) - { - if (condition) - { - Fail(null); - } - } - - [DebuggerStepThrough] - internal static void IsTrue(bool condition) - { - if (!condition) - { - Fail(null); - } - } - - [DebuggerStepThrough] - internal static void IsTrue(bool condition, [Localizable(false)]string message) - { - if (!condition) - { - Fail(message); - } - } - - [DebuggerStepThrough] - internal static void Fail([Localizable(false)]string message) - { - throw new InternalErrorException(message); - } - - [DebuggerStepThrough] - internal static T NotReachable() - { - throw new InternalErrorException("Code path should never be reached!"); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/AttributeServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/AttributeServices.cs deleted file mode 100644 index 6364fa99109..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/AttributeServices.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -namespace Microsoft.Internal -{ - internal static class AttributeServices - { - public static T[] GetAttributes(this ICustomAttributeProvider attributeProvider) where T : class - { - return (T[])attributeProvider.GetCustomAttributes(typeof(T), false); - } - - public static T[] GetAttributes(this ICustomAttributeProvider attributeProvider, bool inherit) where T : class - { - return (T[])attributeProvider.GetCustomAttributes(typeof(T), inherit); - } - - public static T GetFirstAttribute(this ICustomAttributeProvider attributeProvider) where T : class - { - return GetAttributes(attributeProvider).FirstOrDefault(); - } - - public static T GetFirstAttribute(this ICustomAttributeProvider attributeProvider, bool inherit) where T : class - { - return GetAttributes(attributeProvider, inherit).FirstOrDefault(); - } - - public static bool IsAttributeDefined(this ICustomAttributeProvider attributeProvider) where T : class - { - return attributeProvider.IsDefined(typeof(T), false); - } - - public static bool IsAttributeDefined(this ICustomAttributeProvider attributeProvider, bool inherit) where T : class - { - return attributeProvider.IsDefined(typeof(T), inherit); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/.gitattributes deleted file mode 100644 index 71f35810375..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/.gitattributes +++ /dev/null @@ -1,7 +0,0 @@ -/CollectionServices.CollectionOfObject.cs -crlf -/CollectionServices.cs -crlf -/ConditionalWeakTable.cs -crlf -/EnumerableCardinality.cs -crlf -/ReadOnlyDictionary.cs -crlf -/ReadOnlyDictionaryDebuggerProxy.cs -crlf -/WeakReferenceCollection.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/CollectionServices.CollectionOfObject.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/CollectionServices.CollectionOfObject.cs deleted file mode 100644 index a915efc0016..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/CollectionServices.CollectionOfObject.cs +++ /dev/null @@ -1,145 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; - -namespace Microsoft.Internal.Collections -{ - internal static partial class CollectionServices - { - public static ICollection GetCollectionWrapper(Type itemType, object collectionObject) - { - Assumes.NotNull(itemType, collectionObject); - - if (itemType == typeof(object)) - { - return (ICollection)collectionObject; - } - - // Most common .Net collections implement IList as well so for those - // cases we can optimize the wrapping instead of using reflection to create - // a generic type. - if (typeof(IList).IsAssignableFrom(collectionObject.GetType())) - { - return new CollectionOfObjectList((IList)collectionObject); - } - - Type collectionType = typeof(CollectionOfObject<>).MakeGenericType(itemType); - - return (ICollection)Activator.CreateInstance(collectionType, collectionObject); - } - - private class CollectionOfObjectList : ICollection - { - private readonly IList _list; - - public CollectionOfObjectList(IList list) - { - this._list = list; - } - - public void Add(object item) - { - this._list.Add(item); - } - - public void Clear() - { - this._list.Clear(); - } - - public bool Contains(object item) - { - return Assumes.NotReachable(); - } - - public void CopyTo(object[] array, int arrayIndex) - { - Assumes.NotReachable(); - } - - public int Count - { - get { return Assumes.NotReachable(); } - } - - public bool IsReadOnly - { - get { return this._list.IsReadOnly; } - } - - public bool Remove(object item) - { - return Assumes.NotReachable(); - } - - public IEnumerator GetEnumerator() - { - return Assumes.NotReachable>(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return Assumes.NotReachable(); - } - } - - private class CollectionOfObject : ICollection - { - private readonly ICollection _collectionOfT; - - public CollectionOfObject(object collectionOfT) - { - this._collectionOfT = (ICollection)collectionOfT; - } - - public void Add(object item) - { - this._collectionOfT.Add((T) item); - } - - public void Clear() - { - this._collectionOfT.Clear(); - } - - public bool Contains(object item) - { - return Assumes.NotReachable(); - } - - public void CopyTo(object[] array, int arrayIndex) - { - Assumes.NotReachable(); - } - - public int Count - { - get { return Assumes.NotReachable(); } - } - - public bool IsReadOnly - { - get { return this._collectionOfT.IsReadOnly; } - } - - public bool Remove(object item) - { - return Assumes.NotReachable(); - } - - public IEnumerator GetEnumerator() - { - return Assumes.NotReachable>(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return Assumes.NotReachable(); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/CollectionServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/CollectionServices.cs deleted file mode 100644 index 33fabda0602..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/CollectionServices.cs +++ /dev/null @@ -1,181 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; - -namespace Microsoft.Internal.Collections -{ - internal static partial class CollectionServices - { - private static readonly Type StringType = typeof(string); - private static readonly Type IEnumerableType = typeof(IEnumerable); - private static readonly Type IEnumerableOfTType = typeof(IEnumerable<>); - private static readonly Type ICollectionOfTType = typeof(ICollection<>); - - public static bool IsEnumerableOfT(Type type) - { - if (type.IsGenericType) - { - Type genericType = type.GetGenericTypeDefinition(); - - if (genericType == IEnumerableOfTType) - { - return true; - } - } - return false; - } - - public static Type GetEnumerableElementType(Type type) - { - if (type == StringType || !IEnumerableType.IsAssignableFrom(type)) - { - return null; - } - - Type closedType; - if (ReflectionServices.TryGetGenericInterfaceType(type, IEnumerableOfTType, out closedType)) - { - return closedType.GetGenericArguments()[0]; - } - - return null; - } - - public static Type GetCollectionElementType(Type type) - { - Type closedType; - if (ReflectionServices.TryGetGenericInterfaceType(type, ICollectionOfTType, out closedType)) - { - return closedType.GetGenericArguments()[0]; - } - - return null; - } - - public static ReadOnlyCollection ToReadOnlyCollection(this IEnumerable source) - { - Assumes.NotNull(source); - - return new ReadOnlyCollection(source.AsArray()); - } - - public static IEnumerable WhereNotNull(this IEnumerable source) where T : class - { - Assumes.NotNull(source); - return source.Where(NotNull); // Use non-generic NotNull for performance reasons - } - - private static bool NotNull(object element) - { - return element != null; - } - - public static IEnumerable ConcatAllowingNull(this IEnumerable source, IEnumerable second) - { - if (second == null || !second.FastAny()) - { - return source; - } - - if (source == null || !source.FastAny()) - { - return second; - } - - return source.Concat(second); - } - - public static void ForEach(this IEnumerable source, Action action) - { - foreach(T t in source) - { - action.Invoke(t); - } - } - - public static EnumerableCardinality GetCardinality(this IEnumerable source) - { - Assumes.NotNull(source); - - // Cast to ICollection instead of ICollection for performance reasons. - ICollection collection = source as ICollection; - if (collection != null) - { - switch (collection.Count) - { - case 0: - return EnumerableCardinality.Zero; - - case 1: - return EnumerableCardinality.One; - - default: - return EnumerableCardinality.TwoOrMore; - } - } - - using (var enumerator = source.GetEnumerator()) - { - if (!enumerator.MoveNext()) - { - return EnumerableCardinality.Zero; - } - - if (!enumerator.MoveNext()) - { - return EnumerableCardinality.One; - } - - return EnumerableCardinality.TwoOrMore; - } - } - - public static bool FastAny(this IEnumerable source) - { - // Enumerable.Any underneath doesn't cast to ICollection, - // like it does with many of the other LINQ methods. - // Below is significantly (4x) when mainly working with ICollection - // sources and a little slower if working with mainly IEnumerable - // sources. - - // Cast to ICollection instead of ICollection for performance reasons. - ICollection collection = source as ICollection; - if (collection != null) - { - return collection.Count > 0; - } - - return source.Any(); - } - - public static Stack Copy(this Stack stack) - { - Assumes.NotNull(stack); - - // Stack.GetEnumerator walks from top to bottom - // of the stack, whereas Stack(IEnumerable) - // pushes to bottom from top, so we need to reverse - // the stack to get them in the right order. - return new Stack(stack.Reverse()); - } - - public static T[] AsArray(this IEnumerable enumerable) - { - T[] array = enumerable as T[]; - - if (array != null) - { - return array; - } - - return enumerable.ToArray(); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/ConditionalWeakTable.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/ConditionalWeakTable.cs deleted file mode 100644 index d25dad3357b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/ConditionalWeakTable.cs +++ /dev/null @@ -1,116 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !CLR40 -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace Microsoft.Internal.Collections -{ - // This is a broken implementation of ConditionalWeakTable that allows us - // to compile and work on versions of .Net eariler then 4.0. This class is - // broken when there are circular dependencies between keys and values, which - // can only be fixed by using some specific CLR 4.0 features. - // For code samples of the broken behavior see ConditionalWeakTableTests.cs. - internal class ConditionalWeakTable - where TKey : class - where TValue : class - { - private readonly Dictionary _table; - private int _capacity = 4; - - public ConditionalWeakTable() - { - this._table = new Dictionary(); - } - - public void Add(TKey key, TValue value) - { - CleanupDeadReferences(); - this._table.Add(CreateWeakKey(key), value); - } - - public bool Remove(TKey key) - { - return this._table.Remove(key); - } - - public bool TryGetValue(TKey key, out TValue value) - { - return this._table.TryGetValue(key, out value); - } - - private void CleanupDeadReferences() - { - if (this._table.Count < _capacity) - { - return; - } - - object[] deadKeys = this._table.Keys - .Where(weakRef => !((EquivalentWeakReference)weakRef).IsAlive).ToArray(); - - foreach (var deadKey in deadKeys) - { - this._table.Remove(deadKey); - } - - if (this._table.Count >= _capacity) - { - _capacity *= 2; - } - } - - private static object CreateWeakKey(TKey key) - { - return new EquivalentWeakReference(key); - } - - private class EquivalentWeakReference - { - private readonly WeakReference _weakReference; - private readonly int _hashCode; - - public EquivalentWeakReference(object obj) - { - this._hashCode = obj.GetHashCode(); - this._weakReference = new WeakReference(obj); - } - - public bool IsAlive - { - get - { - return this._weakReference.IsAlive; - } - } - - public override bool Equals(object obj) - { - EquivalentWeakReference weakRef = obj as EquivalentWeakReference; - - if (weakRef != null) - { - obj = weakRef._weakReference.Target; - } - - if (obj == null) - { - return base.Equals(weakRef); - } - - return object.Equals(this._weakReference.Target, obj); - } - - public override int GetHashCode() - { - return this._hashCode; - } - } - } -} -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/EnumerableCardinality.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/EnumerableCardinality.cs deleted file mode 100644 index 45fc7de01cf..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/EnumerableCardinality.cs +++ /dev/null @@ -1,14 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace Microsoft.Internal.Collections -{ - internal enum EnumerableCardinality : int - { - Zero = 0, - One = 1, - TwoOrMore = 2, - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/ReadOnlyDictionary.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/ReadOnlyDictionary.cs deleted file mode 100644 index 55da71142b5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/ReadOnlyDictionary.cs +++ /dev/null @@ -1,103 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; - -namespace Microsoft.Internal.Collections -{ - [DebuggerDisplay("Count = {Count}")] - [DebuggerTypeProxy(typeof(ReadOnlyDictionaryDebuggerProxy<,>))] - internal sealed partial class ReadOnlyDictionary : IDictionary - { - private readonly IDictionary _innerDictionary; - - public ReadOnlyDictionary(IDictionary dictionary) - { - this._innerDictionary = dictionary ?? new Dictionary(0); - } - - public int Count - { - get { return this._innerDictionary.Count; } - } - - public bool IsReadOnly - { - get { return true; } - } - - public ICollection Keys - { - get { return this._innerDictionary.Keys; } - } - - public TValue this[TKey key] - { - get { return this._innerDictionary[key]; } - set { throw new NotSupportedException(Strings.NotSupportedReadOnlyDictionary); } - } - - public ICollection Values - { - get { return this._innerDictionary.Values; } - } - - public bool Contains(KeyValuePair item) - { - return this._innerDictionary.Contains(item); - } - - public bool ContainsKey(TKey key) - { - return this._innerDictionary.ContainsKey(key); - } - - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - this._innerDictionary.CopyTo(array, arrayIndex); - } - - public IEnumerator> GetEnumerator() - { - return this._innerDictionary.GetEnumerator(); - } - - public bool TryGetValue(TKey key, out TValue value) - { - return this._innerDictionary.TryGetValue(key, out value); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return this._innerDictionary.GetEnumerator(); - } - - void IDictionary.Add(TKey key, TValue value) - { - throw new NotSupportedException(Strings.NotSupportedReadOnlyDictionary); - } - - void ICollection>.Add(KeyValuePair item) - { - throw new NotSupportedException(Strings.NotSupportedReadOnlyDictionary); - } - - void ICollection>.Clear() - { - throw new NotSupportedException(Strings.NotSupportedReadOnlyDictionary); - } - - bool IDictionary.Remove(TKey key) - { - throw new NotSupportedException(Strings.NotSupportedReadOnlyDictionary); - } - - bool ICollection>.Remove(KeyValuePair item) - { - throw new NotSupportedException(Strings.NotSupportedReadOnlyDictionary); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/ReadOnlyDictionaryDebuggerProxy.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/ReadOnlyDictionaryDebuggerProxy.cs deleted file mode 100644 index 8fa7ad5fcf6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/ReadOnlyDictionaryDebuggerProxy.cs +++ /dev/null @@ -1,32 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; - -namespace Microsoft.Internal.Collections -{ - // NOTE: This type cannot be a nested proxy of ReadOnlyDictionary due to a bug - // in the Visual Studio Debugger which causes it to ignore nested generic proxies. - internal class ReadOnlyDictionaryDebuggerProxy - { - private readonly ReadOnlyDictionary _dictionary; - - public ReadOnlyDictionaryDebuggerProxy(ReadOnlyDictionary dictionary) - { - Requires.NotNull(dictionary, "dictionary"); - - _dictionary = dictionary; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public KeyValuePair[] Items - { - // NOTE: This shouldn't be cached, so that on every query of - // the current value of the underlying dictionary is respected. - get { return this._dictionary.ToArray(); } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/WeakReferenceCollection.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/WeakReferenceCollection.cs deleted file mode 100644 index ce8b55a485c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Collections/WeakReferenceCollection.cs +++ /dev/null @@ -1,92 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace Microsoft.Internal.Collections -{ - internal class WeakReferenceCollection where T : class - { - private readonly List _items = new List(); - - public void Add(T item) - { - // Only cleanup right before we need to reallocate space. - if (this._items.Capacity == this._items.Count) - { - this.CleanupDeadReferences(); - } - - this._items.Add(new WeakReference(item)); - } - - public void Remove(T item) - { - int index = IndexOf(item); - - if (index != -1) - { - this._items.RemoveAt(index); - } - } - - public bool Contains(T item) - { - return IndexOf(item) >= 0; - } - - public void Clear() - { - this._items.Clear(); - } - - // Should be executed under at least a read lock. - private int IndexOf(T item) - { - int count = this._items.Count; - for (int i = 0; i < count; i++) - { - if (this._items[i].Target == item) - { - return i; - } - } - return -1; - } - - // Should be executed under a write lock - private void CleanupDeadReferences() - { - int count = this._items.Count; - for (int i = count - 1; i >= 0; i--) - { - if (this._items[i].Target == null) - { - this._items.RemoveAt(i); - } - } - } - - public List AliveItemsToList() - { - List aliveItems = new List(); - - foreach (var weakItem in this._items) - { - T item = weakItem.Target as T; - - if (item != null) - { - aliveItems.Add(item); - } - } - - return aliveItems; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/ContractServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/ContractServices.cs deleted file mode 100644 index 4a125d61407..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/ContractServices.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.Linq; -using System.Text; -using System.Threading; -using System.ComponentModel.Composition.Primitives; - -namespace Microsoft.Internal -{ - internal class ContractServices - { - public static T Cast(object o) - { - return (T)o; - } - - public static bool TryCast(Type contractType, object value, out object result) - { - if (value == null) - { - result = null; - return true; - } - if (contractType.IsInstanceOfType(value)) - { - result = value; - return true; - } - - // We couldn't cast see if a delegate works for us. - if (typeof(Delegate).IsAssignableFrom(contractType)) - { - ExportedDelegate exportedDelegate = value as ExportedDelegate; - if (exportedDelegate != null) - { - result = exportedDelegate.CreateDelegate(contractType); - return (result != null); - } - } - - result = null; - return false; - } - } -} - diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/GenerationServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/GenerationServices.cs deleted file mode 100644 index 9aae10caf0e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/GenerationServices.cs +++ /dev/null @@ -1,333 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- - -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Reflection; -using System.Reflection.Emit; - -namespace Microsoft.Internal -{ - internal static class GenerationServices - { - // Type.GetTypeFromHandle - private static readonly MethodInfo _typeGetTypeFromHandleMethod = typeof(Type).GetMethod("GetTypeFromHandle"); - - - // typeofs are pretty expensive, so we cache them statically - private static readonly Type TypeType = typeof(System.Type); - private static readonly Type StringType = typeof(System.String); - private static readonly Type CharType = typeof(System.Char); - private static readonly Type BooleanType = typeof(System.Boolean); - private static readonly Type ByteType = typeof(System.Byte); - private static readonly Type SByteType = typeof(System.SByte); - private static readonly Type Int16Type = typeof(System.Int16); - private static readonly Type UInt16Type = typeof(System.UInt16); - private static readonly Type Int32Type = typeof(System.Int32); - private static readonly Type UInt32Type = typeof(System.UInt32); - private static readonly Type Int64Type = typeof(System.Int64); - private static readonly Type UInt64Type = typeof(System.UInt64); - private static readonly Type DoubleType = typeof(System.Double); - private static readonly Type SingleType = typeof(System.Single); - private static readonly Type IEnumerableTypeofT = typeof(System.Collections.Generic.IEnumerable<>); - private static readonly Type IEnumerableType = typeof(System.Collections.IEnumerable); - - private static readonly MethodInfo ExceptionGetData = typeof(Exception).GetProperty("Data").GetGetMethod(); - private static readonly MethodInfo DictionaryAdd = typeof(IDictionary).GetMethod("Add"); - private static readonly ConstructorInfo ObjectCtor = typeof(object).GetConstructor(Type.EmptyTypes); - - public static ILGenerator CreateGeneratorForPublicConstructor(this TypeBuilder typeBuilder, Type[] ctrArgumentTypes) - { - ConstructorBuilder ctorBuilder = typeBuilder.DefineConstructor( - MethodAttributes.Public, - CallingConventions.Standard, - ctrArgumentTypes); - - ILGenerator ctorIL = ctorBuilder.GetILGenerator(); - ctorIL.Emit(OpCodes.Ldarg_0); - ctorIL.Emit(OpCodes.Call, ObjectCtor); - - return ctorIL; - } - - /// Generates the code that loads the supplied value on the stack - /// This is not as simple as it seems, as different instructions need to be generated depending - /// on its type. - /// We support: - /// 1. All primitive types - /// 2. Strings - /// 3. Enums - /// 4. typeofs - /// 5. nulls - /// 6. Enumerables - /// 7. Delegates on static functions or any of the above - /// Everything else cannot be represented as literals - /// - /// - /// - /// - /// - public static void LoadValue(this ILGenerator ilGenerator, object value) - { - Assumes.NotNull(ilGenerator); - - // - // Get nulls out of the way - they are basically typeless, so we just load null - // - if (value == null) - { - ilGenerator.LoadNull(); - return; - } - - // - // Prepare for literal loading - decide whether we should box, and handle enums properly - // - Type valueType = value.GetType(); - object rawValue = value; - if (valueType.IsEnum) - { - // enums are special - we need to load the underlying constant on the stack - rawValue = Convert.ChangeType(value, Enum.GetUnderlyingType(valueType), null); - valueType = rawValue.GetType(); - } - - // - // Generate IL depending on the valueType - this is messier than it should ever be, but sadly necessary - // - if (valueType == GenerationServices.StringType) - { - // we need to check for strings before enumerables, because strings are IEnumerable - ilGenerator.LoadString((string)rawValue); - } - else if (GenerationServices.TypeType.IsAssignableFrom(valueType)) - { - ilGenerator.LoadTypeOf((Type)rawValue); - } - else if (GenerationServices.IEnumerableType.IsAssignableFrom(valueType)) - { - // NOTE : strings and dictionaries are also enumerables, but we have already handled those - ilGenerator.LoadEnumerable((IEnumerable) rawValue); - } - else if ( - (valueType == GenerationServices.CharType) || - (valueType == GenerationServices.BooleanType) || - (valueType == GenerationServices.ByteType) || - (valueType == GenerationServices.SByteType) || - (valueType == GenerationServices.Int16Type) || - (valueType == GenerationServices.UInt16Type) || - (valueType == GenerationServices.Int32Type) - ) - { - // NOTE : Everything that is 32 bit or less uses ldc.i4. We need to pass int32, even if the actual types is shorter - this is IL memory model - // direct casting to (int) won't work, because the value is boxed, thus we need to use Convert. - // Sadly, this will not work for all cases - namely large uint32 - because they can't semantically fit into 32 signed bits - // We have a special case for that next - ilGenerator.LoadInt((int)Convert.ChangeType(rawValue, typeof(int), CultureInfo.InvariantCulture)); - } - else if (valueType == GenerationServices.UInt32Type) - { - // NOTE : This one is a bit tricky. Ldc.I4 takes an Int32 as an argument, although it really treats it as a 32bit number - // That said, some UInt32 values are larger that Int32.MaxValue, so the Convert call above will fail, which is why - // we need to treat this case individually and cast to uint, and then - unchecked - to int. - ilGenerator.LoadInt(unchecked((int)((uint)rawValue))); - } - else if (valueType == GenerationServices.Int64Type) - { - ilGenerator.LoadLong((long)rawValue); - } - else if (valueType == GenerationServices.UInt64Type) - { - // NOTE : This one is a bit tricky. Ldc.I8 takes an Int64 as an argument, although it really treats it as a 64bit number - // That said, some UInt64 values are larger that Int64.MaxValue, so the direct case we use above (or Convert, for that matter)will fail, which is why - // we need to treat this case individually and cast to ulong, and then - unchecked - to long. - ilGenerator.LoadLong(unchecked((long)((ulong)rawValue))); - } - else if (valueType == GenerationServices.SingleType) - { - ilGenerator.LoadFloat((float)rawValue); - } - else if (valueType == GenerationServices.DoubleType) - { - ilGenerator.LoadDouble((double)rawValue); - } - else - { - throw new InvalidOperationException( - string.Format(CultureInfo.CurrentCulture, Strings.InvalidMetadataValue, value.GetType().FullName)); - } - } - - /// Generates the code that adds an object to a dictionary stored in a local variable - /// - /// - /// - /// - /// - public static void AddItemToLocalDictionary(this ILGenerator ilGenerator, LocalBuilder dictionary, object key, object value) - { - Assumes.NotNull(ilGenerator); - Assumes.NotNull(dictionary); - Assumes.NotNull(key); - Assumes.NotNull(value); - - ilGenerator.Emit(OpCodes.Ldloc, dictionary); - ilGenerator.LoadValue(key); - ilGenerator.LoadValue(value); - ilGenerator.Emit(OpCodes.Callvirt, DictionaryAdd); - } - - /// Generates the code that adds an object from a local variable to a dictionary also stored in a local - /// - /// - /// - /// - /// - public static void AddLocalToLocalDictionary(this ILGenerator ilGenerator, LocalBuilder dictionary, object key, LocalBuilder value) - { - Assumes.NotNull(ilGenerator); - Assumes.NotNull(dictionary); - Assumes.NotNull(key); - Assumes.NotNull(value); - - ilGenerator.Emit(OpCodes.Ldloc, dictionary); - ilGenerator.LoadValue(key); - ilGenerator.Emit(OpCodes.Ldloc, value); - ilGenerator.Emit(OpCodes.Callvirt, DictionaryAdd); - } - - /// Generates the code to get the type of an object and store it in a local - /// - /// - /// - /// - /// - public static void GetExceptionDataAndStoreInLocal(this ILGenerator ilGenerator, LocalBuilder exception, LocalBuilder dataStore) - { - Assumes.NotNull(ilGenerator); - Assumes.NotNull(exception); - Assumes.NotNull(dataStore); - - ilGenerator.Emit(OpCodes.Ldloc, exception); - ilGenerator.Emit(OpCodes.Callvirt, ExceptionGetData); - ilGenerator.Emit(OpCodes.Stloc, dataStore); - } - - private static void LoadEnumerable(this ILGenerator ilGenerator, IEnumerable enumerable) - { - Assumes.NotNull(ilGenerator); - Assumes.NotNull(enumerable); - - // We load enumerable as an array - this is the most compact and efficient way of representing it - Type elementType = null; - Type closedType = null; - if (ReflectionServices.TryGetGenericInterfaceType(enumerable.GetType(), GenerationServices.IEnumerableTypeofT, out closedType)) - { - elementType = closedType.GetGenericArguments()[0]; - } - else - { - elementType = typeof(object); - } - - // - // elem[] array = new elem[] - // - Type generatedArrayType = elementType.MakeArrayType(); - LocalBuilder generatedArrayLocal = ilGenerator.DeclareLocal(generatedArrayType); - - ilGenerator.LoadInt(enumerable.Cast().Count()); - ilGenerator.Emit(OpCodes.Newarr, elementType); - ilGenerator.Emit(OpCodes.Stloc, generatedArrayLocal); - - int index = 0; - foreach (object value in enumerable) - { - // - //array[] = value; - // - ilGenerator.Emit(OpCodes.Ldloc, generatedArrayLocal); - ilGenerator.LoadInt(index); - ilGenerator.LoadValue(value); - if (GenerationServices.IsBoxingRequiredForValue(value) && !elementType.IsValueType) - { - ilGenerator.Emit(OpCodes.Box, value.GetType()); - } - ilGenerator.Emit(OpCodes.Stelem, elementType); - index++; - } - - ilGenerator.Emit(OpCodes.Ldloc, generatedArrayLocal); - } - - private static bool IsBoxingRequiredForValue(object value) - { - if (value == null) - { - return false; - } - else - { - return value.GetType().IsValueType; - } - } - - - private static void LoadNull(this ILGenerator ilGenerator) - { - ilGenerator.Emit(OpCodes.Ldnull); - } - - private static void LoadString(this ILGenerator ilGenerator, string s) - { - Assumes.NotNull(ilGenerator); - if (s == null) - { - ilGenerator.LoadNull(); - } - else - { - ilGenerator.Emit(OpCodes.Ldstr, s); - } - } - - - private static void LoadInt(this ILGenerator ilGenerator, int value) - { - Assumes.NotNull(ilGenerator); - ilGenerator.Emit(OpCodes.Ldc_I4, value); - } - - private static void LoadLong(this ILGenerator ilGenerator, long value) - { - Assumes.NotNull(ilGenerator); - ilGenerator.Emit(OpCodes.Ldc_I8, value); - } - - private static void LoadFloat(this ILGenerator ilGenerator, float value) - { - Assumes.NotNull(ilGenerator); - ilGenerator.Emit(OpCodes.Ldc_R4, value); - } - - private static void LoadDouble(this ILGenerator ilGenerator, double value) - { - Assumes.NotNull(ilGenerator); - ilGenerator.Emit(OpCodes.Ldc_R8, value); - } - - private static void LoadTypeOf(this ILGenerator ilGenerator, Type type) - { - Assumes.NotNull(ilGenerator); - //typeofs() translate into ldtoken and Type::GetTypeFromHandle call - ilGenerator.Emit(OpCodes.Ldtoken, type); - ilGenerator.EmitCall(OpCodes.Call, GenerationServices._typeGetTypeFromHandleMethod, null); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/LazyServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/LazyServices.cs deleted file mode 100644 index 07783ffcd7b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/LazyServices.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Text; -using System.Globalization; - -namespace Microsoft.Internal -{ - internal static class LazyServices - { - public static Lazy AsLazy(this T t) - where T : class - { - return new Lazy(() => t, false); - } - - public static T GetNotNullValue(this Lazy lazy, string argument) - where T : class - { - Assumes.NotNull(lazy); - T value = lazy.Value; - if (value == null) - { - throw new InvalidOperationException( - string.Format(CultureInfo.CurrentCulture, Strings.LazyServices_LazyResolvesToNull, typeof(T), argument)); - } - - return value; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Lock.Reader.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Lock.Reader.cs deleted file mode 100644 index 3f81a68ade9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Lock.Reader.cs +++ /dev/null @@ -1,32 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; - -namespace Microsoft.Internal -{ - internal struct ReadLock : IDisposable - { - private readonly Lock _lock; - private int _isDisposed; - - public ReadLock(Lock @lock) - { - this._isDisposed = 0; - this._lock = @lock; - this._lock.EnterReadLock(); - } - - public void Dispose() - { - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) - { - this._lock.ExitReadLock(); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Lock.Writer.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Lock.Writer.cs deleted file mode 100644 index e9d7088020f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Lock.Writer.cs +++ /dev/null @@ -1,32 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; - -namespace Microsoft.Internal -{ - internal struct WriteLock : IDisposable - { - private readonly Lock _lock; - private int _isDisposed; - - public WriteLock(Lock @lock) - { - this._isDisposed = 0; - this._lock = @lock; - this._lock.EnterWriteLock(); - } - - public void Dispose() - { - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) - { - this._lock.ExitWriteLock(); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Lock.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Lock.cs deleted file mode 100644 index 7cd7ac2ee5e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Lock.cs +++ /dev/null @@ -1,79 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; - -namespace Microsoft.Internal -{ - internal sealed class Lock : IDisposable - { -#if (!SILVERLIGHT) - private ReaderWriterLockSlim _thisLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion); - private int _isDisposed = 0; - public void EnterReadLock() - { - this._thisLock.EnterReadLock(); - } - - public void EnterWriteLock() - { - this._thisLock.EnterWriteLock(); - } - - public void ExitReadLock() - { - this._thisLock.ExitReadLock(); - } - - public void ExitWriteLock() - { - this._thisLock.ExitWriteLock(); - } - - public void Dispose() - { - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) - { - this._thisLock.Dispose(); - } - } - -#else - // ReaderWriterLockSlim is not yet implemented on SilverLight - // Satisfies our requirements until it is implemented - object _thisLock = new object(); - - public Lock() - { - } - - public void EnterReadLock() - { - Monitor.Enter(this._thisLock); - } - - public void EnterWriteLock() - { - Monitor.Enter(this._thisLock); - } - - public void ExitReadLock() - { - Monitor.Exit(this._thisLock); - } - - public void ExitWriteLock() - { - Monitor.Exit(this._thisLock); - } - - public void Dispose() - { - } -#endif - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/ReflectionInvoke.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/ReflectionInvoke.cs deleted file mode 100644 index b91a0c52a30..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/ReflectionInvoke.cs +++ /dev/null @@ -1,114 +0,0 @@ -#if !SILVERLIGHT && CLR40 - -using System; -using System.Reflection; -using System.Security; -using System.Security.Permissions; - -namespace Microsoft.Internal -{ - internal static class ReflectionInvoke - { - private static readonly ReflectionPermission _memberAccess = new ReflectionPermission(ReflectionPermissionFlag.MemberAccess); - private static readonly ReflectionPermission _restrictedMemberAccess = new ReflectionPermission(ReflectionPermissionFlag.RestrictedMemberAccess); - - public static object SafeCreateInstance(this Type type, params object[] arguments) - { - DemandMemberAccessIfNeeded(type); - - return Activator.CreateInstance(type, arguments); - } - - public static object SafeInvoke(this ConstructorInfo constructor, params object[] arguments) - { - DemandMemberAccessIfNeeded(constructor); - - return constructor.Invoke(arguments); - } - - public static object SafeInvoke(this MethodInfo method, object instance, params object[] arguments) - { - DemandMemberAccessIfNeeded(method); - - return method.Invoke(instance, arguments); - } - - public static object SafeGetValue(this FieldInfo field, object instance) - { - DemandMemberAccessIfNeeded(field); - - return field.GetValue(instance); - } - - public static void SafeSetValue(this FieldInfo field, object instance, object value) - { - DemandMemberAccessIfNeeded(field); - - field.SetValue(instance, value); - } - - public static void DemandMemberAccessIfNeeded(MethodInfo method) - { - if (!method.IsVisible()) - { - DemandMemberAccess(method); - } - } - - private static void DemandMemberAccessIfNeeded(FieldInfo field) - { - if (!field.IsVisible()) - { - DemandMemberAccess(field); - } - } - - public static void DemandMemberAccessIfNeeded(Type type) - { - // Consult UnderlyingSystemType this is the type that Activator.CreateInstance creates - if (!type.UnderlyingSystemType.IsVisible) - { - DemandMemberAccess(type); - } - } - - private static void DemandMemberAccessIfNeeded(ConstructorInfo constructor) - { - if (!constructor.IsVisible()) - { - DemandMemberAccess(constructor); - } - } - - private static void DemandMemberAccess(MemberInfo target) - { - try - { - _memberAccess.Demand(); - } - catch (SecurityException) - { // The caller doesn't have member access, but let's see whether they have access to - // members of assemblies with less or equal permissions (this mimics Reflection's behavior) - - DemandRestrictedMemberAccess(target); - } - } - - private static void DemandRestrictedMemberAccess(MemberInfo target) - { - Assembly targetAssembly = target.Assembly(); - - PermissionSet targetGrantSet = UnsafePermissionSet(targetAssembly); - targetGrantSet.AddPermission(_restrictedMemberAccess); - targetGrantSet.Demand(); - } - - [SecuritySafeCritical] // PermissionSet is [SecurityCritical] - private static PermissionSet UnsafePermissionSet(Assembly assembly) - { - return assembly.PermissionSet; - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/ReflectionServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/ReflectionServices.cs deleted file mode 100644 index 937e5bdefc3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/ReflectionServices.cs +++ /dev/null @@ -1,122 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Reflection; -using System.Runtime.InteropServices; - -namespace Microsoft.Internal -{ - internal static class ReflectionServices - { - public static Assembly Assembly(this MemberInfo member) - { - Type type = member as Type; - if (type != null) - { - return type.Assembly; - } - - return member.DeclaringType.Assembly; - } - - public static bool IsVisible(this ConstructorInfo constructor) - { - return constructor.DeclaringType.IsVisible && constructor.IsPublic; - } - - public static bool IsVisible(this FieldInfo field) - { - return field.DeclaringType.IsVisible && field.IsPublic; - } - - public static bool IsVisible(this MethodInfo method) - { - if (!method.DeclaringType.IsVisible) - return false; - - if (!method.IsPublic) - return false; - - if (method.IsGenericMethod) - { - // Check type arguments, for example if we're passed 'Activator.CreateInstance()' - foreach (Type typeArgument in method.GetGenericArguments()) - { - if (!typeArgument.IsVisible) - return false; - } - } - - return true; - } - - public static string GetDisplayName(Type declaringType, string name) - { - Assumes.NotNull(declaringType); - - return declaringType.GetDisplayName() + "." + name; - } - - public static string GetDisplayName(this MemberInfo member) - { - Assumes.NotNull(member); - - switch (member.MemberType) - { - case MemberTypes.TypeInfo: - case MemberTypes.NestedType: - return ((Type)member).FullName; - } - - return GetDisplayName(member.DeclaringType, member.Name); - } - - internal static bool TryGetGenericInterfaceType(Type instanceType, Type targetOpenInterfaceType, out Type targetClosedInterfaceType) - { - // The interface must be open - Assumes.IsTrue(targetOpenInterfaceType.IsInterface); - Assumes.IsTrue(targetOpenInterfaceType.IsGenericTypeDefinition); - Assumes.IsTrue(!instanceType.IsGenericTypeDefinition); - - // if instanceType is an interface, we must first check it directly - if (instanceType.IsInterface && - instanceType.IsGenericType && - instanceType.GetGenericTypeDefinition() == targetOpenInterfaceType) - { - targetClosedInterfaceType = instanceType; - return true; - } - - try - { - // Purposefully not using FullName here because it results in a significantly - // more expensive implementation of GetInterface, this does mean that we're - // takign the chance that there aren't too many types which implement multiple - // interfaces by the same name... - Type targetInterface = instanceType.GetInterface(targetOpenInterfaceType.Name, false); - if (targetInterface != null && - targetInterface.GetGenericTypeDefinition() == targetOpenInterfaceType) - { - targetClosedInterfaceType = targetInterface; - return true; - } - } - catch (AmbiguousMatchException) - { - // If there are multiple with the same name we should not pick any - } - - targetClosedInterfaceType = null; - return false; - } - - internal static IEnumerable GetAllProperties(this Type type) - { - return type.GetInterfaces().Concat(new Type[] { type }).SelectMany(itf => itf.GetProperties()); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Requires.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Requires.cs deleted file mode 100644 index fa9656c544f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Requires.cs +++ /dev/null @@ -1,102 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Globalization; -using System.Reflection; -using System.ComponentModel.Composition; -using System.Text; - -namespace Microsoft.Internal -{ - internal static class Requires - { - [DebuggerStepThrough] - public static void NotNull(T value, string parameterName) - where T : class - { - if (value == null) - { - throw new ArgumentNullException(parameterName); - } - } - - [DebuggerStepThrough] - public static void NotNullOrEmpty(string value, string parameterName) - { - NotNull(value, parameterName); - - if (value.Length == 0) - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentException_EmptyString, parameterName), parameterName); - } - } - - [DebuggerStepThrough] - public static void NotNullOrNullElements(IEnumerable values, string parameterName) - where T : class - { - NotNull(values, parameterName); - NotNullElements(values, parameterName); - } - - [DebuggerStepThrough] - public static void NullOrNotNullElements(IEnumerable> values, string parameterName) - where TKey : class - where TValue : class - { - if (values != null) - { - NotNullElements(values, parameterName); - } - } - - [DebuggerStepThrough] - public static void NullOrNotNullElements(IEnumerable values, string parameterName) - where T : class - { - if (values != null) - { - NotNullElements(values, parameterName); - } - } - - private static void NotNullElements(IEnumerable values, string parameterName) - where T : class - { - foreach (T value in values) - { - if (value == null) - { - throw ExceptionBuilder.CreateContainsNullElement(parameterName); - } - } - } - - private static void NotNullElements(IEnumerable> values, string parameterName) - where TKey : class - where TValue : class - { - foreach (KeyValuePair value in values) - { - if ((value.Key == null) || (value.Value == null)) - { - throw ExceptionBuilder.CreateContainsNullElement(parameterName); - } - } - } - [DebuggerStepThrough] - public static void IsInMembertypeSet(MemberTypes value, string parameterName, MemberTypes enumFlagSet) - { - if ((value & enumFlagSet) != value || // Ensure the member is in the set - (value & (value - 1)) != 0) // Ensure that there is only one flag in the value (i.e. value is a power of 2). - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentOutOfRange_InvalidEnumInSet, parameterName, value, enumFlagSet.ToString()), parameterName); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Runtime/Serialization/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Runtime/Serialization/.gitattributes deleted file mode 100644 index cc023ba4d69..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Runtime/Serialization/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/SerializationServices.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Runtime/Serialization/SerializationServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Runtime/Serialization/SerializationServices.cs deleted file mode 100644 index 39c6f41beec..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/Runtime/Serialization/SerializationServices.cs +++ /dev/null @@ -1,22 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; -using System.Runtime.Serialization; - -namespace Microsoft.Internal.Runtime.Serialization -{ - internal static class SerializationServices - { - public static T GetValue(this SerializationInfo info, string name) - { - Assumes.NotNull(info, name); - - return (T)info.GetValue(name, typeof(T)); - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/SilverlightReflectionInvoke.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/SilverlightReflectionInvoke.cs deleted file mode 100644 index 0e2e3f63f1e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/SilverlightReflectionInvoke.cs +++ /dev/null @@ -1,43 +0,0 @@ -#if SILVERLIGHT || !CLR40 - -using System; -using System.Reflection; -using System.Security; -using System.Security.Permissions; - -namespace Microsoft.Internal -{ - internal static class ReflectionInvoke - { - public static object SafeCreateInstance(this Type type, params object[] arguments) - { - return Activator.CreateInstance(type, arguments); - } - - public static object SafeInvoke(this ConstructorInfo constructor, params object[] arguments) - { - return constructor.Invoke(arguments); - } - - public static object SafeInvoke(this MethodInfo method, object instance, params object[] arguments) - { - return method.Invoke(instance, arguments); - } - - public static object SafeGetValue(this FieldInfo field, object instance) - { - return field.GetValue(instance); - } - - public static void SafeSetValue(this FieldInfo field, object instance, object value) - { - field.SetValue(instance, value); - } - - public static void DemandMemberAccessIfNeeded(MethodInfo method) - { - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/StringComparers.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/StringComparers.cs deleted file mode 100644 index d66113b4730..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Microsoft/Internal/StringComparers.cs +++ /dev/null @@ -1,20 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace Microsoft.Internal -{ - internal static class StringComparers - { - public static StringComparer ContractName - { - get { return StringComparer.Ordinal; } - } - - public static StringComparer MetadataKeyNames - { - get { return StringComparer.Ordinal; } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/SilverlightAdditions.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/SilverlightAdditions.cs deleted file mode 100644 index 75c1cf65c0c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/SilverlightAdditions.cs +++ /dev/null @@ -1,90 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; - -namespace System -{ - [Conditional("NOT_SILVERLIGHT")] // Trick so that the attribute is never actually applied - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)] - internal sealed class SerializableAttribute : Attribute - { - } -} - -namespace System.ComponentModel -{ - internal sealed class LocalizableAttribute : Attribute - { - [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "isLocalizable")] - public LocalizableAttribute(bool isLocalizable) - { - } - } -} - -#if !CLR40 -namespace System.Collections.Generic -{ - internal class HashSet : IEnumerable - { - private Dictionary _set = new Dictionary(); - - public HashSet() - { - } - - public HashSet(IEnumerable items) - { - foreach (T item in items) - { - Add(item); - } - } - - public bool Add(T item) - { - if (!this._set.ContainsKey(item)) - { - this._set.Add(item, null); - return true; - } - return false; - } - - public void Clear() - { - this._set.Clear(); - } - - public bool Contains(T item) - { - return this._set.ContainsKey(item); - } - - public bool Remove(T item) - { - if (this._set.ContainsKey(item)) - { - this._set.Remove(item); - return true; - } - return false; - } - - public IEnumerator GetEnumerator() - { - return this._set.Keys.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Strings.Designer.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Strings.Designer.cs deleted file mode 100644 index 5650944d037..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Strings.Designer.cs +++ /dev/null @@ -1,927 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.20626.0 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.Internal { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Strings { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Strings() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Internal.Strings", typeof(Strings).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to '{0}' is a reflection-only assembly which is not supported.. - /// - internal static string Argument_AssemblyReflectionOnly { - get { - return ResourceManager.GetString("Argument_AssemblyReflectionOnly", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to '{0}' contains a reflection-only type which is not supported.. - /// - internal static string Argument_ElementReflectionOnlyType { - get { - return ResourceManager.GetString("Argument_ElementReflectionOnlyType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 'exports' cannot be empty when ImportDefinition.ImportCardinality is ImportCardinality.ExactlyOne.. - /// - internal static string Argument_ExportsEmpty { - get { - return ResourceManager.GetString("Argument_ExportsEmpty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 'exports' cannot contain more than one element when ImportDefinition.ImportCardinality is ImportCardinality.ZeroOrOne or ImportCardinality.ExactlyOne.. - /// - internal static string Argument_ExportsTooMany { - get { - return ResourceManager.GetString("Argument_ExportsTooMany", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to '{0}' cannot contain a null (Nothing in Visual Basic) element.. - /// - internal static string Argument_NullElement { - get { - return ResourceManager.GetString("Argument_NullElement", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to '{0}' cannot be an empty string ("").. - /// - internal static string ArgumentException_EmptyString { - get { - return ResourceManager.GetString("ArgumentException_EmptyString", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The value of argument '{0}' ({1}) is invalid for Enum type '{2}'.. - /// - internal static string ArgumentOutOfRange_InvalidEnum { - get { - return ResourceManager.GetString("ArgumentOutOfRange_InvalidEnum", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The value of argument '{0}' ({1}) is not supported. Allowed values are : '{2}'.. - /// - internal static string ArgumentOutOfRange_InvalidEnumInSet { - get { - return ResourceManager.GetString("ArgumentOutOfRange_InvalidEnumInSet", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The argument was a value type which is not supported.. - /// - internal static string ArgumentValueType { - get { - return ResourceManager.GetString("ArgumentValueType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Assembly file {0} is either not found or not a dll or exe file.. - /// - internal static string AssemblyFileNotFoundOrWrongType { - get { - return ResourceManager.GetString("AssemblyFileNotFoundOrWrongType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The atomicComposition can no longer be changed because the atomicComposition has already been completed.. - /// - internal static string AtomicComposition_AlreadyCompleted { - get { - return ResourceManager.GetString("AtomicComposition_AlreadyCompleted", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The atomicComposition is already contains an inner atomicComposition and cannot contain more than one atomicComposition at a time.. - /// - internal static string AtomicComposition_AlreadyNested { - get { - return ResourceManager.GetString("AtomicComposition_AlreadyNested", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The atomicComposition contains another inner atomicComposition and cannot be changed until the that inner atomicComposition has been completed.. - /// - internal static string AtomicComposition_PartOfAnotherAtomicComposition { - get { - return ResourceManager.GetString("AtomicComposition_PartOfAnotherAtomicComposition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No valid exports were found that match the constraint '{0}', invalid exports may have been rejected.. - /// - internal static string CardinalityMismatch_NoExports { - get { - return ResourceManager.GetString("CardinalityMismatch_NoExports", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to More than one export was found that matches the constraint '{0}'.. - /// - internal static string CardinalityMismatch_TooManyExports { - get { - return ResourceManager.GetString("CardinalityMismatch_TooManyExports", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unknown Origin. - /// - internal static string CompositionElement_UnknownOrigin { - get { - return ResourceManager.GetString("CompositionElement_UnknownOrigin", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The composition remains unchanged. The changes were rejected because of the following error(s): {0}. - /// - internal static string CompositionException_ChangesRejected { - get { - return ResourceManager.GetString("CompositionException_ChangesRejected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Element: {0}. - /// - internal static string CompositionException_ElementPrefix { - get { - return ResourceManager.GetString("CompositionException_ElementPrefix", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Resulting in:. - /// - internal static string CompositionException_ErrorPrefix { - get { - return ResourceManager.GetString("CompositionException_ErrorPrefix", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to create an instance of the Metadata view '{0}' because a constructor could not be selected. Ensure that the type implements a constructor which takes an argument of type IDictionary<string, object>.. - /// - internal static string CompositionException_MetadataViewInvalidConstructor { - get { - return ResourceManager.GetString("CompositionException_MetadataViewInvalidConstructor", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The composition produced multiple composition errors, with {0:N0} root causes. The root causes are provided below.. - /// - internal static string CompositionException_MultipleErrorsWithMultiplePaths { - get { - return ResourceManager.GetString("CompositionException_MultipleErrorsWithMultiplePaths", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} {1}. - /// - internal static string CompositionException_OriginFormat { - get { - return ResourceManager.GetString("CompositionException_OriginFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to --> . - /// - internal static string CompositionException_OriginSeparator { - get { - return ResourceManager.GetString("CompositionException_OriginSeparator", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ). - /// - internal static string CompositionException_PathsCountSeparator { - get { - return ResourceManager.GetString("CompositionException_PathsCountSeparator", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Review the CompositionException.Errors property for more detailed information.. - /// - internal static string CompositionException_ReviewErrorProperty { - get { - return ResourceManager.GetString("CompositionException_ReviewErrorProperty", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The composition produced a single composition error, with {0:N0} root causes. The root causes are provided below.. - /// - internal static string CompositionException_SingleErrorWithMultiplePaths { - get { - return ResourceManager.GetString("CompositionException_SingleErrorWithMultiplePaths", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The composition produced a single composition error. The root cause is provided below.. - /// - internal static string CompositionException_SingleErrorWithSinglePath { - get { - return ResourceManager.GetString("CompositionException_SingleErrorWithSinglePath", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The catalog '{0}' could not load assembly '{1}'. {2}. - /// - internal static string CompositionTrace_Discovery_AssemblyLoadFailed { - get { - return ResourceManager.GetString("CompositionTrace_Discovery_AssemblyLoadFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The ComposablePartDefinition '{0}' was ignored because it is an open generic type.. - /// - internal static string CompositionTrace_Discovery_DefinitionContainsGenericParameters { - get { - return ResourceManager.GetString("CompositionTrace_Discovery_DefinitionContainsGenericParameters", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The ComposablePartDefinition '{0}' was ignored because it contains no exports.. - /// - internal static string CompositionTrace_Discovery_DefinitionContainsNoExports { - get { - return ResourceManager.GetString("CompositionTrace_Discovery_DefinitionContainsNoExports", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The ComposablePartDefinition '{0}' was ignored because it was marked with PartNotDiscoverableAttribute.. - /// - internal static string CompositionTrace_Discovery_DefinitionMarkedWithPartNotDiscoverableAttribute { - get { - return ResourceManager.GetString("CompositionTrace_Discovery_DefinitionMarkedWithPartNotDiscoverableAttribute", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The member or parameter '{0}' is marked with multiple Import and ImportMany attributes. Only the first attribute encountered will be respected.. - /// - internal static string CompositionTrace_Discovery_MemberMarkedWithMultipleImportAndImportMany { - get { - return ResourceManager.GetString("CompositionTrace_Discovery_MemberMarkedWithMultipleImportAndImportMany", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The ComposablePartDefinition '{0}' has been rejected. {1}. - /// - internal static string CompositionTrace_Rejection_DefinitionRejected { - get { - return ResourceManager.GetString("CompositionTrace_Rejection_DefinitionRejected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The ComposablePartDefinition '{0}' that was previously rejected has been resurrected.. - /// - internal static string CompositionTrace_Rejection_DefinitionResurrected { - get { - return ResourceManager.GetString("CompositionTrace_Rejection_DefinitionResurrected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot cast the underlying exported value of type '{0}' to type '{1}'.. - /// - internal static string ContractMismatch_ExportedValueCannotBeCastToT { - get { - return ResourceManager.GetString("ContractMismatch_ExportedValueCannotBeCastToT", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to create an Instance of the Metadata view '{0}' because the exporter exported the metadata for the item '{1}' with the value '{2}' as type '{3}' but the view imports it as type '{4}'.. - /// - internal static string ContractMismatch_InvalidCastOnMetadataField { - get { - return ResourceManager.GetString("ContractMismatch_InvalidCastOnMetadataField", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unable to create an Instance of the Metadata view '{0}' because the exporter exported the metadata for the item '{1}' with a null value and null is not a valid value for type '{2}'.. - /// - internal static string ContractMismatch_NullReferenceOnMetadataField { - get { - return ResourceManager.GetString("ContractMismatch_NullReferenceOnMetadataField", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Directory '{0}' could not be found.. - /// - internal static string DirectoryNotFound { - get { - return ResourceManager.GetString("DirectoryNotFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Member or Type '{0}' contains multiple metadata entries with the name '{1}'. The metadata entries could be coming from the ExportMetadataAttribute or from a property of a custom metadata attribute. Either remove the duplicate entries or enable the metadata entry with name '{1}' to allow multiple entries via the IsMultiple property on ExportMetadataAttribute or AttributeUsage.AllowMultiple on custom metadata attributes.. - /// - internal static string Discovery_DuplicateMetadataNameValues { - get { - return ResourceManager.GetString("Discovery_DuplicateMetadataNameValues", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Property '{0}' has type '{1}' which is an invalid metadata type. Metadata can only contain values with a type that is available to be embedded at compile-time into attributes. For more details of what types are valid reference section 17.1.3 in the C# specification.. - /// - internal static string Discovery_MetadataContainsValueWithInvalidType { - get { - return ResourceManager.GetString("Discovery_MetadataContainsValueWithInvalidType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Member or Type '{0}' contains a metadata entry with the name '{1}', which is a reserved metadata key name. Either remove this metadata entry or change the name associated with the entry.. - /// - internal static string Discovery_ReservedMetadataNameUsed { - get { - return ResourceManager.GetString("Discovery_ReservedMetadataNameUsed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} did not originate from the ExportDefinitions property on this ComposablePart or its ComposablePartDefinition.. - /// - internal static string ExportDefinitionNotOnThisComposablePart { - get { - return ResourceManager.GetString("ExportDefinitionNotOnThisComposablePart", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} did not originate from the ImportDefinitions property on this ComposablePart or its ComposablePartDefinition.. - /// - internal static string ImportDefinitionNotOnThisComposablePart { - get { - return ResourceManager.GetString("ImportDefinitionNotOnThisComposablePart", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The composition failed because it did not complete within '{0:N0}' iterations. This is most likely caused by a cycle in the dependency graph of a part which is marked with a non-shared creation policy.. - /// - internal static string ImportEngine_ComposeTookTooManyIterations { - get { - return ResourceManager.GetString("ImportEngine_ComposeTookTooManyIterations", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The ComposablePart of type '{0}' cannot be recomposed because it is in an invalid state. It can only be recomposed if it has already been fully previewed or composed.. - /// - internal static string ImportEngine_InvalidStateForRecomposition { - get { - return ResourceManager.GetString("ImportEngine_InvalidStateForRecomposition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot activate part '{0}'.. - /// - internal static string ImportEngine_PartCannotActivate { - get { - return ResourceManager.GetString("ImportEngine_PartCannotActivate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot get export '{0}' from part '{1}'.. - /// - internal static string ImportEngine_PartCannotGetExportedValue { - get { - return ResourceManager.GetString("ImportEngine_PartCannotGetExportedValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot set import '{0}' on part '{1}'.. - /// - internal static string ImportEngine_PartCannotSetImport { - get { - return ResourceManager.GetString("ImportEngine_PartCannotSetImport", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot compose part '{0}' because a cycle exists in the dependencies between the exports being composed. To break this cycle, consider changing some imports from constructor to property injection.. - /// - internal static string ImportEngine_PartCycle { - get { - return ResourceManager.GetString("ImportEngine_PartCycle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Change in exports prevented by non-recomposable import '{0}' on part '{1}'.. - /// - internal static string ImportEngine_PreventedByExistingImport { - get { - return ResourceManager.GetString("ImportEngine_PreventedByExistingImport", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not finishing composing object of type '{0}'. The import '{1}' was not satisfied.. - /// - internal static string ImportNotSetOnPart { - get { - return ResourceManager.GetString("ImportNotSetOnPart", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Internal error occurred. Additional information: '{0}'.. - /// - internal static string InternalExceptionMessage { - get { - return ResourceManager.GetString("InternalExceptionMessage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Metadata can only contain values with a type that is available to be embedded at compile-time into attributes. For more details of what types are valid reference section 17.1.3 in the C# specification.. - /// - internal static string InvalidMetadataValue { - get { - return ResourceManager.GetString("InvalidMetadataValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The Type '{0}' supplied is not a valid Metadata View.. - /// - internal static string InvalidMetadataView { - get { - return ResourceManager.GetString("InvalidMetadataView", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to 'definition' cannot be set after Activate has been called because ImportDefinition.IsRecomposable is false.. - /// - internal static string InvalidOperation_DefinitionCannotBeRecomposed { - get { - return ResourceManager.GetString("InvalidOperation_DefinitionCannotBeRecomposed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to GetExportedValue cannot be called before prerequisite import '{0}' has been set.. - /// - internal static string InvalidOperation_GetExportedValueBeforePrereqImportSet { - get { - return ResourceManager.GetString("InvalidOperation_GetExportedValueBeforePrereqImportSet", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A call to Compose occurred during a call to Compose on the same CompositionContainer object. Use the IsComposing property on CompositionContainer to ensure a composition is not already in progress before calling Compose.. - /// - internal static string InvalidOperationReentrantCompose { - get { - return ResourceManager.GetString("InvalidOperationReentrantCompose", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The MetadataView '{0}' is invalid because property '{1}' has a property set method.. - /// - internal static string InvalidSetterOnMetadataField { - get { - return ResourceManager.GetString("InvalidSetterOnMetadataField", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Accessors must not be null (Nothing in Visual Basic).. - /// - internal static string LazyMemberInfo_AccessorsNull { - get { - return ResourceManager.GetString("LazyMemberInfo_AccessorsNull", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A member of type '{0}' must have exactly a single accessor of type '{0}'. - /// - internal static string LazyMemberInfo_InvalidAccessorOnSimpleMember { - get { - return ResourceManager.GetString("LazyMemberInfo_InvalidAccessorOnSimpleMember", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All event accessors must be methods.. - /// - internal static string LazyMemberinfo_InvalidEventAccessors_AccessorType { - get { - return ResourceManager.GetString("LazyMemberinfo_InvalidEventAccessors_AccessorType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An event must have exactly three accessors.. - /// - internal static string LazyMemberInfo_InvalidEventAccessors_Cardinality { - get { - return ResourceManager.GetString("LazyMemberInfo_InvalidEventAccessors_Cardinality", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to All property accessors must be methods.. - /// - internal static string LazyMemberinfo_InvalidPropertyAccessors_AccessorType { - get { - return ResourceManager.GetString("LazyMemberinfo_InvalidPropertyAccessors_AccessorType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A property must have exactly two accessors.. - /// - internal static string LazyMemberInfo_InvalidPropertyAccessors_Cardinality { - get { - return ResourceManager.GetString("LazyMemberInfo_InvalidPropertyAccessors_Cardinality", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A member must have at least one accessor.. - /// - internal static string LazyMemberInfo_NoAccessors { - get { - return ResourceManager.GetString("LazyMemberInfo_NoAccessors", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The lazily evaluated value of type '{0}' passed to the ReflectionModelServices API as part of the argument '{1}' must not return null (Nothing in Visual Basic).. - /// - internal static string LazyServices_LazyResolvesToNull { - get { - return ResourceManager.GetString("LazyServices_LazyResolvesToNull", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This export does not support the metadata item '{0}'.. - /// - internal static string MetadataItemNotSupported { - get { - return ResourceManager.GetString("MetadataItemNotSupported", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The {0} member must be overridden by a derived class.. - /// - internal static string NotImplemented_NotOverriddenByDerived { - get { - return ResourceManager.GetString("NotImplemented_NotOverriddenByDerived", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Interface '{0}' is not a valid MetadataView; MetadataViews do not support non-public interfaces, and interfaces that contain members that are not properties.. - /// - internal static string NotSupportedInterfaceMetadataView { - get { - return ResourceManager.GetString("NotSupportedInterfaceMetadataView", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The underlying dictionary is read-only.. - /// - internal static string NotSupportedReadOnlyDictionary { - get { - return ResourceManager.GetString("NotSupportedReadOnlyDictionary", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This property cannot be set after the object's public surface has been accessed.. - /// - internal static string ObjectAlreadyInitialized { - get { - return ResourceManager.GetString("ObjectAlreadyInitialized", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This object has not been initialized - the property '{0}' must be set.. - /// - internal static string ObjectMustBeInitialized { - get { - return ResourceManager.GetString("ObjectMustBeInitialized", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Currently composing another batch in this ComposablePartExportProvider. Only one batch can be composed at a time.. - /// - internal static string ReentrantCompose { - get { - return ResourceManager.GetString("ReentrantCompose", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot get the value of property '{0}', because the member is not readable. The property must have an accessible getter.. - /// - internal static string ReflectionModel_ExportNotReadable { - get { - return ResourceManager.GetString("ReflectionModel_ExportNotReadable", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An exception occurred while trying to get the value of property '{0}'.. - /// - internal static string ReflectionModel_ExportThrewException { - get { - return ResourceManager.GetString("ReflectionModel_ExportThrewException", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot populate the collection '{0}' because an exception occurred while calling the Add method on the type '{1}'.. - /// - internal static string ReflectionModel_ImportCollectionAddThrewException { - get { - return ResourceManager.GetString("ReflectionModel_ImportCollectionAddThrewException", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot populate the collection '{0}' because an exception occurred while calling the Clear method on the type '{1}'.. - /// - internal static string ReflectionModel_ImportCollectionClearThrewException { - get { - return ResourceManager.GetString("ReflectionModel_ImportCollectionClearThrewException", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot populate the collection '{0}' because an exception occurred while calling the default constructor on the type '{1}'.. - /// - internal static string ReflectionModel_ImportCollectionConstructionThrewException { - get { - return ResourceManager.GetString("ReflectionModel_ImportCollectionConstructionThrewException", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot populate the collection '{0}' because an exception occurred while trying to access the collection value. If the collection is not IEnumerable<T> or T[] it must implement ICollection<T> and be either pre-initialized or be writable with a default constructor.. - /// - internal static string ReflectionModel_ImportCollectionGetThrewException { - get { - return ResourceManager.GetString("ReflectionModel_ImportCollectionGetThrewException", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot populate the collection '{0}' because an exception occurred while reading the IsReadOnly property on the type '{1}'.. - /// - internal static string ReflectionModel_ImportCollectionIsReadOnlyThrewException { - get { - return ResourceManager.GetString("ReflectionModel_ImportCollectionIsReadOnlyThrewException", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot populate the collection '{0}' because it does not implement ICollection<T> or is read-only. If the collection is not IEnumerable<T> or T[] it must implement ICollection<T> and be either pre-initialized or be writable with a default constructor.. - /// - internal static string ReflectionModel_ImportCollectionNotWritable { - get { - return ResourceManager.GetString("ReflectionModel_ImportCollectionNotWritable", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot populate the value of enumerable member '{0}' because it is null (Nothing in Visual Basic). If the collection is not IEnumerable<T> or T[] it must implement ICollection<T> and be either pre-initialized or be writable with a default constructor.. - /// - internal static string ReflectionModel_ImportCollectionNull { - get { - return ResourceManager.GetString("ReflectionModel_ImportCollectionNull", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The importing constructor on type '{0}' is using ImportManyAttribute on parameter '{1}' with a non-assignable type. On constructor parameters the ImportManyAttribute only supports importing into types T[] or IEnumerable<T>.. - /// - internal static string ReflectionModel_ImportManyOnParameterCanOnlyBeAssigned { - get { - return ResourceManager.GetString("ReflectionModel_ImportManyOnParameterCanOnlyBeAssigned", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The export '{0}' is not assignable to type '{1}'.. - /// - internal static string ReflectionModel_ImportNotAssignableFromExport { - get { - return ResourceManager.GetString("ReflectionModel_ImportNotAssignableFromExport", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot set the value of '{0}' because the member is not writable. If the member is a property, it must have an accessible setter; otherwise, if it is a field, it must not be read-only.. - /// - internal static string ReflectionModel_ImportNotWritable { - get { - return ResourceManager.GetString("ReflectionModel_ImportNotWritable", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An exception occurred while trying to set the value of property '{0}'.. - /// - internal static string ReflectionModel_ImportThrewException { - get { - return ResourceManager.GetString("ReflectionModel_ImportThrewException", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ExportDefinition of type '{0}' cannot be used in this context. Only export definitions produced by the ReflectionModelServices.CreateExportDefinition are supported.. - /// - internal static string ReflectionModel_InvalidExportDefinition { - get { - return ResourceManager.GetString("ReflectionModel_InvalidExportDefinition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ImportDefinition of type '{0}' cannot be used in this context. Only import definitions produced by the ReflectionModelServices.CreateImportDefinition are supported.. - /// - internal static string ReflectionModel_InvalidImportDefinition { - get { - return ResourceManager.GetString("ReflectionModel_InvalidImportDefinition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ImportDefinition of type '{0}' cannot be used in this context. Only import definitions produced by the ReflectionModelServices.CreateImportDefinition based on members are supported. Use ReflectionModelServices.IsImportingParameter to determine whether a given import definition is based on a member or a parameter.. - /// - internal static string ReflectionModel_InvalidMemberImportDefinition { - get { - return ResourceManager.GetString("ReflectionModel_InvalidMemberImportDefinition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ImportDefinition of type '{0}' cannot be used in this context. Only import definitions produced by the ReflectionModelServices.CreateImportDefinition based on parameters are supported. Use ReflectionModelServices.IsImportingParameter to determine whether a given import definition is based on a member or a parameter.. - /// - internal static string ReflectionModel_InvalidParameterImportDefinition { - get { - return ResourceManager.GetString("ReflectionModel_InvalidParameterImportDefinition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ComposablePartDefinition of type '{0}' cannot be used in this context. Only part definitions produced by the ReflectionModelServices.CreatePartDefinition are supported.. - /// - internal static string ReflectionModel_InvalidPartDefinition { - get { - return ResourceManager.GetString("ReflectionModel_InvalidPartDefinition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot create an instance of type '{0}' because a constructor could not be selected for construction. Ensure that the type either has a default constructor, or a single constructor marked with the 'System.ComponentModel.Composition.ImportingConstructorAttribute'.. - /// - internal static string ReflectionModel_PartConstructorMissing { - get { - return ResourceManager.GetString("ReflectionModel_PartConstructorMissing", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An exception occurred while trying to create an instance of type '{0}'.. - /// - internal static string ReflectionModel_PartConstructorThrewException { - get { - return ResourceManager.GetString("ReflectionModel_PartConstructorThrewException", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An exception occurred while calling the 'OnImportsSatisfied' method on type '{0}'.. - /// - internal static string ReflectionModel_PartOnImportsSatisfiedThrewException { - get { - return ResourceManager.GetString("ReflectionModel_PartOnImportsSatisfiedThrewException", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} (Types='{1}').. - /// - internal static string TypeCatalog_DisplayNameFormat { - get { - return ResourceManager.GetString("TypeCatalog_DisplayNameFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <Empty>. - /// - internal static string TypeCatalog_Empty { - get { - return ResourceManager.GetString("TypeCatalog_Empty", resourceCulture); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Strings.resx b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Strings.resx deleted file mode 100644 index db6341d4ba7..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/Strings.resx +++ /dev/null @@ -1,408 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - '{0}' cannot be an empty string (""). - - - The value of argument '{0}' ({1}) is invalid for Enum type '{2}'. - - - The argument was a value type which is not supported. - - - '{0}' is a reflection-only assembly which is not supported. - - - '{0}' cannot contain a null (Nothing in Visual Basic) element. - - - Assembly file {0} is either not found or not a dll or exe file. - - - No valid exports were found that match the constraint '{0}', invalid exports may have been rejected. - - - More than one export was found that matches the constraint '{0}'. - - - The composition failed because it did not complete within '{0:N0}' iterations. This is most likely caused by a cycle in the dependency graph of a part which is marked with a non-shared creation policy. - - - Cannot cast the underlying exported value of type '{0}' to type '{1}'. - - - Directory '{0}' could not be found. - - - An exception occurred while trying to create an instance of type '{0}'. - - - An exception occurred while trying to get the value of property '{0}'. - - - An exception occurred while calling the 'OnImportsSatisfied' method on type '{0}'. - - - An exception occurred while trying to set the value of property '{0}'. - - - {0} did not originate from the ExportDefinitions property on this ComposablePart or its ComposablePartDefinition. - - - Cannot populate the collection '{0}' because it does not implement ICollection<T> or is read-only. If the collection is not IEnumerable<T> or T[] it must implement ICollection<T> and be either pre-initialized or be writable with a default constructor. - - - Cannot populate the value of enumerable member '{0}' because it is null (Nothing in Visual Basic). If the collection is not IEnumerable<T> or T[] it must implement ICollection<T> and be either pre-initialized or be writable with a default constructor. - - - Cannot compose part '{0}' because a cycle exists in the dependencies between the exports being composed. To break this cycle, consider changing some imports from constructor to property injection. - - - {0} did not originate from the ImportDefinitions property on this ComposablePart or its ComposablePartDefinition. - - - Could not finishing composing object of type '{0}'. The import '{1}' was not satisfied. - - - Cannot set the value of '{0}' because the member is not writable. If the member is a property, it must have an accessible setter; otherwise, if it is a field, it must not be read-only. - - - Internal error occurred. Additional information: '{0}'. - - - The Type '{0}' supplied is not a valid Metadata View. - - - A call to Compose occurred during a call to Compose on the same CompositionContainer object. Use the IsComposing property on CompositionContainer to ensure a composition is not already in progress before calling Compose. - - - This export does not support the metadata item '{0}'. - - - Interface '{0}' is not a valid MetadataView; MetadataViews do not support non-public interfaces, and interfaces that contain members that are not properties. - - - Cannot create an instance of type '{0}' because a constructor could not be selected for construction. Ensure that the type either has a default constructor, or a single constructor marked with the 'System.ComponentModel.Composition.ImportingConstructorAttribute'. - - - The {0} member must be overridden by a derived class. - - - The underlying dictionary is read-only. - - - This property cannot be set after the object's public surface has been accessed. - - - This object has not been initialized - the property '{0}' must be set. - - - The export '{0}' is not assignable to type '{1}'. - - - Cannot get the value of property '{0}', because the member is not readable. The property must have an accessible getter. - - - '{0}' contains a reflection-only type which is not supported. - - - 'definition' cannot be set after Activate has been called because ImportDefinition.IsRecomposable is false. - - - 'exports' cannot be empty when ImportDefinition.ImportCardinality is ImportCardinality.ExactlyOne. - - - 'exports' cannot contain more than one element when ImportDefinition.ImportCardinality is ImportCardinality.ZeroOrOne or ImportCardinality.ExactlyOne. - - - Unknown Origin - - - Cannot activate part '{0}'. - - - Cannot set import '{0}' on part '{1}'. - - - Cannot get export '{0}' from part '{1}'. - - - <Empty> - - - GetExportedValue cannot be called before prerequisite import '{0}' has been set. - - - Resulting in: - - - The composition produced multiple composition errors, with {0:N0} root causes. The root causes are provided below. - - - Review the CompositionException.Errors property for more detailed information. - - - The composition produced a single composition error, with {0:N0} root causes. The root causes are provided below. - - - The composition produced a single composition error. The root cause is provided below. - - - Cannot populate the collection '{0}' because an exception occurred while trying to access the collection value. If the collection is not IEnumerable<T> or T[] it must implement ICollection<T> and be either pre-initialized or be writable with a default constructor. - - - Cannot populate the collection '{0}' because an exception occurred while calling the Add method on the type '{1}'. - - - Cannot populate the collection '{0}' because an exception occurred while calling the Clear method on the type '{1}'. - - - Cannot populate the collection '{0}' because an exception occurred while reading the IsReadOnly property on the type '{1}'. - - - Cannot populate the collection '{0}' because an exception occurred while calling the default constructor on the type '{1}'. - - - The member or parameter '{0}' is marked with multiple Import and ImportMany attributes. Only the first attribute encountered will be respected. - - - Property '{0}' has type '{1}' which is an invalid metadata type. Metadata can only contain values with a type that is available to be embedded at compile-time into attributes. For more details of what types are valid reference section 17.1.3 in the C# specification. - - - Member or Type '{0}' contains multiple metadata entries with the name '{1}'. The metadata entries could be coming from the ExportMetadataAttribute or from a property of a custom metadata attribute. Either remove the duplicate entries or enable the metadata entry with name '{1}' to allow multiple entries via the IsMultiple property on ExportMetadataAttribute or AttributeUsage.AllowMultiple on custom metadata attributes. - - - Member or Type '{0}' contains a metadata entry with the name '{1}', which is a reserved metadata key name. Either remove this metadata entry or change the name associated with the entry. - - - ExportDefinition of type '{0}' cannot be used in this context. Only export definitions produced by the ReflectionModelServices.CreateExportDefinition are supported. - - - Change in exports prevented by non-recomposable import '{0}' on part '{1}'. - - - ImportDefinition of type '{0}' cannot be used in this context. Only import definitions produced by the ReflectionModelServices.CreateImportDefinition are supported. - - - ComposablePartDefinition of type '{0}' cannot be used in this context. Only part definitions produced by the ReflectionModelServices.CreatePartDefinition are supported. - - - The value of argument '{0}' ({1}) is not supported. Allowed values are : '{2}'. - - - ImportDefinition of type '{0}' cannot be used in this context. Only import definitions produced by the ReflectionModelServices.CreateImportDefinition based on members are supported. Use ReflectionModelServices.IsImportingParameter to determine whether a given import definition is based on a member or a parameter. - - - ImportDefinition of type '{0}' cannot be used in this context. Only import definitions produced by the ReflectionModelServices.CreateImportDefinition based on parameters are supported. Use ReflectionModelServices.IsImportingParameter to determine whether a given import definition is based on a member or a parameter. - - - Accessors must not be null (Nothing in Visual Basic). - - - A member of type '{0}' must have exactly a single accessor of type '{0}' - - - All event accessors must be methods. - - - An event must have exactly three accessors. - - - All property accessors must be methods. - - - A property must have exactly two accessors. - - - A member must have at least one accessor. - - - The lazily evaluated value of type '{0}' passed to the ReflectionModelServices API as part of the argument '{1}' must not return null (Nothing in Visual Basic). - - - Metadata can only contain values with a type that is available to be embedded at compile-time into attributes. For more details of what types are valid reference section 17.1.3 in the C# specification. - - - Unable to create an Instance of the Metadata view '{0}' because the exporter exported the metadata for the item '{1}' with the value '{2}' as type '{3}' but the view imports it as type '{4}'. - - - Unable to create an Instance of the Metadata view '{0}' because the exporter exported the metadata for the item '{1}' with a null value and null is not a valid value for type '{2}'. - - - The MetadataView '{0}' is invalid because property '{1}' has a property set method. - - - The composition remains unchanged. The changes were rejected because of the following error(s): {0} - - - The ComposablePart of type '{0}' cannot be recomposed because it is in an invalid state. It can only be recomposed if it has already been fully previewed or composed. - - - The atomicComposition can no longer be changed because the atomicComposition has already been completed. - - - The atomicComposition contains another inner atomicComposition and cannot be changed until the that inner atomicComposition has been completed. - - - The atomicComposition is already contains an inner atomicComposition and cannot contain more than one atomicComposition at a time. - - - Currently composing another batch in this ComposablePartExportProvider. Only one batch can be composed at a time. - - - The importing constructor on type '{0}' is using ImportManyAttribute on parameter '{1}' with a non-assignable type. On constructor parameters the ImportManyAttribute only supports importing into types T[] or IEnumerable<T>. - - - Element: {0} - - - --> - - - The ComposablePartDefinition '{0}' has been rejected. {1} - - - The ComposablePartDefinition '{0}' that was previously rejected has been resurrected. - - - The catalog '{0}' could not load assembly '{1}'. {2} - - - The ComposablePartDefinition '{0}' was ignored because it is an open generic type. - - - The ComposablePartDefinition '{0}' was ignored because it contains no exports. - - - The ComposablePartDefinition '{0}' was ignored because it was marked with PartNotDiscoverableAttribute. - - - Unable to create an instance of the Metadata view '{0}' because a constructor could not be selected. Ensure that the type implements a constructor which takes an argument of type IDictionary<string, object>. - - - ) - - - {0} {1} - - - {0} (Types='{1}'). - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/SuppressMessages.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/SuppressMessages.cs deleted file mode 100644 index dbe413bdbd6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/SuppressMessages.cs +++ /dev/null @@ -1,10 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.ComponentModel.Composition.ReflectionModel")] -[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System")] -[assembly: SuppressMessage("Microsoft.MSInternal", "CA905:SystemNamespacesRequireApproval", Scope = "namespace", Target = "System.ComponentModel.Composition.ReflectionModel", Justification = "Approved by Framework")] - diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/SuppressMessagesBaselined.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/SuppressMessagesBaselined.cs deleted file mode 100644 index b2f62f7b20d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/SuppressMessagesBaselined.cs +++ /dev/null @@ -1,659 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Diagnostics.CodeAnalysis; - -// The following are untriaged violations, do not add to this list unless you hit a bug in Code Analysis. Any explicitly -// suppressed violations should either be applied against the member or type itself, or if raised against a namespace, -// resource or assembly, placed in SuppressMessages.cs. - -// Code Analysis Bug: ValidateArgumentsOfPublicMethods should not fire on protected members -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#GetExportsCore(System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AggregateExportProvider.#GetExportsCore(System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition)")] - -// Code Analysis Bug: ValidateArgumentsOfPublicMethods should not fire on usage of Requires.NotNull -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModelServices.#AddExportedValue`1(System.ComponentModel.Composition.Hosting.CompositionBatch,System.String,!!0)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModelServices.#AddPart(System.ComponentModel.Composition.Hosting.CompositionBatch,System.Object)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModelServices.#ComposeExportedValue`1(System.ComponentModel.Composition.Hosting.CompositionContainer,System.String,!!0)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModelServices.#ComposeExportedValue`1(System.ComponentModel.Composition.Hosting.CompositionContainer,!!0)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModelServices.#ComposeParts(System.ComponentModel.Composition.Hosting.CompositionContainer,System.Object[])")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModelServices.#SatisfyImportsOnce(System.ComponentModel.Composition.ICompositionService,System.Object)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider+CatalogChangeProxy.#GetExports(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#SourceProvider")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ComposablePartCatalog.#GetExports(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ComposablePartException.#GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#Compose(System.ComponentModel.Composition.Hosting.CompositionBatch)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer.#ReleaseExports(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer.#ReleaseExports`2(System.Collections.Generic.IEnumerable`1>)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer.#ReleaseExports`1(System.Collections.Generic.IEnumerable`1>)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.CompositionError.#.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.CompositionError.#GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition.#IsConstraintSatisfiedBy(System.ComponentModel.Composition.Primitives.ExportDefinition)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#GetExports(System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#OnExportsChanged(System.ComponentModel.Composition.Hosting.ExportsChangeEventArgs)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#OnExportsChanging(System.ComponentModel.Composition.Hosting.ExportsChangeEventArgs)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#.ctor(System.ComponentModel.Composition.Hosting.ExportProvider,System.Boolean)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo.#.ctor(System.Reflection.MemberInfo)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#GetExportingMember(System.ComponentModel.Composition.Primitives.ExportDefinition)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#GetImportingMember(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#GetImportingParameter(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#GetPartType(System.ComponentModel.Composition.Primitives.ComposablePartDefinition)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#IsDisposalRequired(System.ComponentModel.Composition.Primitives.ComposablePartDefinition)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#IsImportingParameter(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.TypeCatalog.#GetExports(System.ComponentModel.Composition.Primitives.ImportDefinition)")] - -// DevDiv 10: 583413 AsmMeta: No longer finds APTCA bit on assemblies -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.Lazy`2", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.AttributedModelServices", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.ChangeRejectedException", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.CompositionContractMismatchException", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.CompositionError", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.CompositionException", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.CreationPolicy", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.ExportAttribute", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.ExportMetadataAttribute", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.ImportAttribute", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.ImportCardinalityMismatchException", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.ImportingConstructorAttribute", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.ImportManyAttribute", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.InheritedExportAttribute", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.MetadataAttributeAttribute", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.PartCreationPolicyAttribute", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.PartMetadataAttribute", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.PartNotDiscoverableAttribute", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.AdaptingExportProvider", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.AggregateCatalog", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.AggregateExportProvider", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.AssemblyCatalog", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.CompositionBatch", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.CompositionConstants", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Primitives.ExportedDelegate", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.ExportProvider", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.ExportsChangeEventArgs", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.ImportEngine", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Hosting.TypeCatalog", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Primitives.Export", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Primitives.ExportDefinition", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Primitives.ComposablePart", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Primitives.ComposablePartCatalog", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Primitives.ComposablePartDefinition", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Primitives.ComposablePartException", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Primitives.ImportCardinality", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.Primitives.ImportDefinition", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2117:AptcaTypesShouldOnlyExtendAptcaBaseTypes", Scope = "type", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices", Justification = "Razzle mscorlib is not APTCA")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AggregateCatalog.#.ctor(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AggregateCatalog.#Dispose(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AggregateCatalog.#GetExports(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AggregateExportProvider.#.ctor(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AggregateExportProvider.#.ctor(System.ComponentModel.Composition.Hosting.ExportProvider[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AggregateExportProvider.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AggregateExportProvider.#Dispose(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AggregateExportProvider.#GetExportsCore(System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AssemblyCatalog.#.ctor(System.Reflection.Assembly,System.ComponentModel.Composition.Primitives.ICompositionElement)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AssemblyCatalog.#Dispose(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AssemblyCatalog.#GetDisplayName()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AssemblyCatalog.#InnerCatalog")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AssemblyCatalog.#LoadAssembly(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AssemblyCatalogDebuggerProxy.#.ctor(System.ComponentModel.Composition.Hosting.AssemblyCatalog)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Assumes+InternalErrorException.#.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Assumes+InternalErrorException.#.ctor(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Assumes.#NotNullOrEmpty(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#AddCompleteAction(System.Action)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#AddRevertAction(System.Action)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#.ctor(System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#ContainsInnerAtomicComposition")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#CopyComplete()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#Dispose(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#FinalComplete()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#SetValueInternal(System.Object,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#ThrowIfCompleteed()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#ThrowIfContainsInnerAtomicComposition()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicComposition.#TryGetValueInternal`1(System.Object,System.Boolean,!!0&)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicCompositionExtensions.#AddCompleteActionAllowNull(System.ComponentModel.Composition.Hosting.AtomicComposition,System.Action)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.AtomicCompositionExtensions.#AddRevertActionAllowNull(System.ComponentModel.Composition.Hosting.AtomicComposition,System.Action)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedExportDefinition.#Metadata")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedModelDiscovery.#CreatePart(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedModelDiscovery.#GetImportDefinitionCreationInfo(System.ComponentModel.Composition.ReflectionModel.ReflectionItem,System.Reflection.ICustomAttributeProvider)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModelServices.#AddExportedValue`1(System.ComponentModel.Composition.Hosting.CompositionBatch,System.String,!!0)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModelServices.#AddExportedValue`1(System.ComponentModel.Composition.Hosting.CompositionBatch,!!0)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModelServices.#ComposeParts(System.ComponentModel.Composition.Hosting.CompositionContainer,System.Object[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.#.ctor(System.Type,System.ComponentModel.Composition.PartCreationPolicyAttribute,System.Boolean,System.ComponentModel.Composition.Primitives.ICompositionElement)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.#GetConstructor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.#GetExportDefinitions()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.#GetImportDefinitions()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.#GetLazyPartType()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.#HasExports()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.#IsDisposalRequired")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.#IsPartDiscoverable()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.#SelectPartConstructor(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.AttributeServices.#GetAttributes`1(System.Reflection.ICustomAttributeProvider)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.AttributeServices.#GetAttributes`1(System.Reflection.ICustomAttributeProvider,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.AttributeServices.#GetFirstAttribute`1(System.Reflection.ICustomAttributeProvider)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.AttributeServices.#GetFirstAttribute`1(System.Reflection.ICustomAttributeProvider,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.AttributeServices.#IsAttributeDefined`1(System.Reflection.ICustomAttributeProvider)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.AttributeServices.#IsAttributeDefined`1(System.Reflection.ICustomAttributeProvider,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider+CatalogChangeProxy.#.ctor(System.ComponentModel.Composition.Primitives.ComposablePartCatalog,System.Collections.Generic.IEnumerable`1,System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider+CatalogChangeProxy.#GetExports(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider+CatalogChangeProxy.#Parts")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#.ctor(System.ComponentModel.Composition.Primitives.ComposablePartCatalog,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#DetermineRejection(System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#Dispose(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#EnsureCanRun()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#EnsureCanSet`1(!!0)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#EnsureRunning()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#GetAtomicCompositionQuery(System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#GetComposablePart(System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#GetExportsCore(System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#GetSharedPart(System.ComponentModel.Composition.Primitives.ComposablePartDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#IsRejected(System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#OnCatalogChanging(System.Object,System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#OnExportsChangingInternal(System.Object,System.ComponentModel.Composition.Hosting.ExportsChangeEventArgs)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#ReleasePart(System.Object,System.ComponentModel.Composition.Primitives.ComposablePart,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#SetConditionalReferenceForRecomposablePart(System.Object,System.ComponentModel.Composition.Primitives.ComposablePart)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#SourceProvider")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#UpdateAtomicCompositionQuery(System.ComponentModel.Composition.Hosting.AtomicComposition,System.Func`2,System.ComponentModel.Composition.Hosting.CatalogExportProvider+AtomicCompositionQueryState)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CatalogExportProvider.#UpdateRejections(System.Collections.Generic.IEnumerable`1,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ChangeRejectedException.#Message")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices.#AsArray`1(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices+CollectionOfObject`1.#Add(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices+CollectionOfObject`1.#Clear()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices+CollectionOfObject`1.#.ctor(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices+CollectionOfObject`1.#IsReadOnly")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices+CollectionOfObjectList.#Add(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices+CollectionOfObjectList.#Clear()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices+CollectionOfObjectList.#.ctor(System.Collections.IList)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices+CollectionOfObjectList.#IsReadOnly")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices.#ConcatAllowingNull`1(System.Collections.Generic.IEnumerable`1,System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices.#Copy`1(System.Collections.Generic.Stack`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices.#FastAny`1(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices.#ForEach`1(System.Collections.Generic.IEnumerable`1,System.Action`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices.#GetCardinality`1(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices.#GetCollectionElementType(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices.#GetCollectionWrapper(System.Type,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices.#GetEnumerableElementType(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices.#ToReadOnlyCollection`1(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.CollectionServices.#WhereNotNull`1(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ComposablePart.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ComposablePartCatalog.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ComposablePartCatalog.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ComposablePartCatalog.#GetExports(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs.#.ctor(System.Collections.Generic.IEnumerable`1,System.Collections.Generic.IEnumerable`1,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#Add(System.ComponentModel.Composition.Primitives.ComposablePartCatalog)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#Changed")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#Changing")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#Clear()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#.ctor(System.Collections.Generic.IEnumerable`1,System.Action`1,System.Action`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#Contains(System.ComponentModel.Composition.Primitives.ComposablePartCatalog)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#CopyTo(System.ComponentModel.Composition.Primitives.ComposablePartCatalog[],System.Int32)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#Count")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#Dispose(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#GetEnumerator()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#HasChanged")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#OnChanged(System.Object,System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#OnChanging(System.Object,System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#OnContainedCatalogChanged(System.Object,System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#OnContainedCatalogChanging(System.Object,System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#RaiseChangedEvent(System.Lazy`1>,System.Lazy`1>)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#RaiseChangingEvent(System.Lazy`1>,System.Lazy`1>,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#Remove(System.ComponentModel.Composition.Primitives.ComposablePartCatalog)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#SubscribeToCatalogNotifications(System.ComponentModel.Composition.Primitives.ComposablePartCatalog)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#SubscribeToCatalogNotifications(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#UnsubscribeFromCatalogNotifications(System.ComponentModel.Composition.Primitives.ComposablePartCatalog)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartCatalogCollection.#UnsubscribeFromCatalogNotifications(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ComposablePartCatalogDebuggerProxy.#.ctor(System.ComponentModel.Composition.Primitives.ComposablePartCatalog)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ComposablePartDefinition.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ComposablePartException.#.ctor(System.ComponentModel.Composition.CompositionErrorId,System.String,System.ComponentModel.Composition.Primitives.ICompositionElement,System.Exception)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ComposablePartException.#.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ComposablePartException.#GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#.ctor(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#Compose(System.ComponentModel.Composition.Hosting.CompositionBatch)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#CreateExport(System.ComponentModel.Composition.Primitives.ComposablePart,System.ComponentModel.Composition.Primitives.ExportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#Dispose(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#EnsureCanRun()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#EnsureCanSet`1(!!0)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#EnsureRunning()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#GetExportsCore(System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#GetUpdatedPartsList(System.ComponentModel.Composition.Hosting.CompositionBatch)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#Recompose(System.ComponentModel.Composition.Hosting.CompositionBatch,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#SourceProvider")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.#ThrowIfDisposed()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionBatch.#AddPart(System.ComponentModel.Composition.Primitives.ComposablePart)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionBatch.#.ctor(System.Collections.Generic.IEnumerable`1,System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionBatch.#PartsToAdd")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionBatch.#PartsToRemove")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionBatch.#RemovePart(System.ComponentModel.Composition.Primitives.ComposablePart)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionBatch+SingleExportComposablePart.#ImportDefinitions")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer.#.ctor(System.ComponentModel.Composition.Primitives.ComposablePartCatalog,System.Boolean,System.ComponentModel.Composition.Hosting.ExportProvider[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer.#Dispose(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer.#ReleaseExport(System.ComponentModel.Composition.Primitives.Export)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer.#ReleaseExport`1(System.Lazy`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer.#ReleaseExports(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer.#ReleaseExports`2(System.Collections.Generic.IEnumerable`1>)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionContainer.#ReleaseExports`1(System.Collections.Generic.IEnumerable`1>)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionContractMismatchException.#.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionContractMismatchException.#.ctor(System.String,System.Exception)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.CompositionElement.#.ctor(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.CompositionElementDebuggerProxy.#.ctor(System.ComponentModel.Composition.Primitives.CompositionElement)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.CompositionElementExtensions.#GetDisplayNameCore(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionError.#.ctor(System.ComponentModel.Composition.CompositionErrorId,System.String,System.ComponentModel.Composition.Primitives.ICompositionElement,System.Exception)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionError.#.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionError.#Create(System.ComponentModel.Composition.CompositionErrorId,System.ComponentModel.Composition.Primitives.ICompositionElement,System.Exception,System.String,System.Object[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionError.#GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionErrorDebuggerProxy.#.ctor(System.ComponentModel.Composition.CompositionError)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#BuildDefaultMessage()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#CalculatePaths(System.ComponentModel.Composition.CompositionException)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#.ctor(System.String,System.Exception,System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#Message")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#VisitCompositionException(System.ComponentModel.Composition.CompositionException,System.ComponentModel.Composition.CompositionException+VisitContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#VisitError(System.ComponentModel.Composition.CompositionError,System.ComponentModel.Composition.CompositionException+VisitContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#VisitException(System.Exception,System.ComponentModel.Composition.CompositionException+VisitContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#WriteElementGraph(System.Text.StringBuilder,System.ComponentModel.Composition.Primitives.ICompositionElement)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#WriteError(System.Text.StringBuilder,System.ComponentModel.Composition.CompositionError)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#WriteHeader(System.Text.StringBuilder,System.Int32,System.Int32)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#WritePath(System.Text.StringBuilder,System.Collections.Generic.IEnumerable`1,System.Int32)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException.#WritePaths(System.Text.StringBuilder,System.Collections.Generic.IEnumerable`1>)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionLock.#.cctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionLock.#.ctor(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionLock+CompositionLockHolder.#.ctor(System.ComponentModel.Composition.Hosting.CompositionLock)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionLock+CompositionLockHolder.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionLock.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionLock+EmptyLockHolder.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionLock.#EnterCompositionLock()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionLock.#ExitCompositionLock()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionResult.#Errors")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionResult`1.#Errors")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#.cctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#GetContractNameFromExport(System.Reflection.MemberInfo,System.ComponentModel.Composition.ExportAttribute)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#GetContractNameFromImport(System.ComponentModel.Composition.IAttributedImport,System.ComponentModel.Composition.ReflectionModel.ImportType)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#GetContractTypeFromImport(System.ComponentModel.Composition.IAttributedImport,System.ComponentModel.Composition.ReflectionModel.ImportType)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#GetDefaultTypeFromMember(System.Reflection.MemberInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#GetPartMetadataForType(System.Type,System.ComponentModel.Composition.CreationPolicy)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#GetRequiredMetadata(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#GetTypeIdentityFromExport(System.Reflection.MemberInfo,System.ComponentModel.Composition.ExportAttribute)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#GetTypeIdentityFromImport(System.ComponentModel.Composition.IAttributedImport,System.ComponentModel.Composition.ReflectionModel.ImportType)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#IsRecomposable(System.ComponentModel.Composition.Primitives.ComposablePart)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#IsValidAttributeType(System.Type,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices+MetadataList.#Add(System.Object,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices+MetadataList.#InferArrayType(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices+MetadataList.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices+MetadataList.#.cctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices+MetadataList.#ToArray()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#TryContributeMetadataValue(System.Collections.Generic.IDictionary`2,System.String,System.Object,System.Type,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#TryExportMetadataForMember(System.Reflection.MemberInfo,System.Collections.Generic.IDictionary`2&)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#TryFire`1(System.EventHandler`1,System.Object,!!0)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#TryInvoke(System.Action)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.CompositionServices.#TryInvoke`1(System.Func`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Diagnostics.CompositionTrace.#AssemblyLoadFailed(System.ComponentModel.Composition.Hosting.DirectoryCatalog,System.String,System.Exception)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Diagnostics.CompositionTrace.#PartDefinitionRejected(System.ComponentModel.Composition.Primitives.ComposablePartDefinition,System.ComponentModel.Composition.ChangeRejectedException)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ConstraintServices.#AndAlso`1(System.Linq.Expressions.Expression`1>,System.Linq.Expressions.Expression`1>)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ConstraintServices.#.cctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ConstraintServices.#CreateConstraint(System.Collections.Generic.IEnumerable`1>)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ConstraintServices.#CreateConstraint(System.String,System.String,System.Collections.Generic.IEnumerable`1>,System.ComponentModel.Composition.CreationPolicy)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ConstraintServices.#CreateContractConstraintBody(System.String,System.Linq.Expressions.ParameterExpression)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ConstraintServices.#CreateCreationPolicyContraint(System.ComponentModel.Composition.CreationPolicy,System.Linq.Expressions.ParameterExpression)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ConstraintServices.#CreateMetadataConstraintBody(System.Collections.Generic.IEnumerable`1>,System.Linq.Expressions.ParameterExpression)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ConstraintServices.#CreateMetadataContainsKeyExpression(System.Linq.Expressions.ParameterExpression,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ConstraintServices.#CreateMetadataOfTypeExpression(System.Linq.Expressions.ParameterExpression,System.String,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ConstraintServices.#CreateMetadataValueEqualsExpression(System.Linq.Expressions.ParameterExpression,System.Object,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ConstraintServices.#CreateTypeIdentityContraint(System.String,System.Linq.Expressions.ParameterExpression)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition.#.ctor(System.String,System.String,System.Collections.Generic.IEnumerable`1>,System.ComponentModel.Composition.Primitives.ImportCardinality,System.Boolean,System.Boolean,System.ComponentModel.Composition.CreationPolicy)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition.#IsConstraintSatisfiedBy(System.ComponentModel.Composition.Primitives.ExportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition.#MatchRequiredMatadata(System.ComponentModel.Composition.Primitives.ExportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#FindArrayElementType(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#FindGenericTypeName(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#GetGenericArity(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#GetTypeIdentity(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#GetTypeIdentityFromMethod(System.Reflection.MethodInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#TypeIdentityCache")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#WriteArrayType(System.Text.StringBuilder,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#WriteArrayTypeDimensions(System.Text.StringBuilder,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#WriteByRefType(System.Text.StringBuilder,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#WriteCustomModifiers(System.Text.StringBuilder,System.String,System.Type[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#WriteGenericType(System.Text.StringBuilder,System.Type,System.Boolean,System.Collections.Generic.Queue`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#WriteGenericTypeName(System.Text.StringBuilder,System.Type,System.Boolean,System.Collections.Generic.Queue`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#WriteNonGenericType(System.Text.StringBuilder,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#WritePointerType(System.Text.StringBuilder,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#WriteType(System.Text.StringBuilder,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#WriteTypeArgumentsString(System.Text.StringBuilder,System.Int32,System.Boolean,System.Collections.Generic.Queue`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ContractNameServices.#WriteTypeWithNamespace(System.Text.StringBuilder,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ContractServices.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ContractServices.#TryCast(System.Type,System.Object,System.Object&)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#Changed")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#Changing")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#DiffChanges(System.String[],System.String[],System.Collections.Generic.List`1>&,System.Collections.Generic.List`1>&)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog+DirectoryCatalogDebuggerProxy.#Assemblies")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog+DirectoryCatalogDebuggerProxy.#.ctor(System.ComponentModel.Composition.Hosting.DirectoryCatalog)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#Dispose(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#GetDisplayName()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#GetExports(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#GetFiles()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#GetFullPath(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#Initialize(System.String,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#LoadedFiles")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#OnChanged(System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#OnChanging(System.ComponentModel.Composition.Hosting.ComposablePartCatalogChangeEventArgs)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.DirectoryCatalog.#Refresh()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.DisposableReflectionComposablePart.#System.IDisposable.Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.DisposableReflectionComposablePart.#ReleaseInstanceIfNecessary(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ErrorBuilder.#CreateImportCardinalityMismatch(System.ComponentModel.Composition.ImportCardinalityMismatchException,System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExceptionBuilder.#CreateContainsNullElement(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExceptionBuilder.#CreateDiscoveryException(System.String,System.String[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExceptionBuilder.#CreateExportDefinitionNotOnThisComposablePart(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExceptionBuilder.#CreateImportDefinitionNotOnThisComposablePart(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExceptionBuilder.#CreateNotOverriddenByDerived(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExceptionBuilder.#CreateObjectDisposed(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExceptionBuilder.#Format(System.String,System.String[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.Export.#.cctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.Export.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.Export.#.ctor(System.ComponentModel.Composition.Primitives.ExportDefinition,System.Func`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.Export.#GetExportedValueCore()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.Export.#Value")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportAttribute.#.ctor(System.String,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ExportDefinition.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ExportDefinition.#.ctor(System.String,System.Collections.Generic.IDictionary`2)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ExportedDelegate.#ConvertMethodInfoToFuncOrActionType(System.Reflection.MethodInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ExportedDelegate.#CreateDelegate(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ExportedDelegate.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ExportedDelegate.#.cctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ExportedDelegate.#.ctor(System.Object,System.Reflection.MethodInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ExportingMember.#EnsureReadable()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ExportingMember.#.ctor(System.ComponentModel.Composition.Primitives.ExportDefinition,System.ComponentModel.Composition.ReflectionModel.ReflectionMember)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ExportingMember.#GetExportedValue(System.Object,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportMetadataAttribute.#.ctor(System.String,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#BuildImportDefinition(System.Type,System.Type,System.String,System.ComponentModel.Composition.Primitives.ImportCardinality)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#ExportsChanged")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#ExportsChanging")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#GetExportCore`2(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#GetExportCore`1(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#GetExportedValueCore`1(System.String,System.ComponentModel.Composition.Primitives.ImportCardinality)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#GetExportedValuesCore`1(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#GetExports(System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#GetExports(System.Type,System.Type,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#GetExportsCore(System.Type,System.Type,System.String,System.ComponentModel.Composition.Primitives.ImportCardinality)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#GetExportsCore`2(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#GetExportsCore`1(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportProvider.#TryGetExportsCore(System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition,System.Collections.Generic.IEnumerable`1&)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportsChangeEventArgs.#ChangedContractNames")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ExportsChangeEventArgs.#.ctor(System.Collections.Generic.IEnumerable`1,System.Collections.Generic.IEnumerable`1,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices.#CreateSemiStronglyTypedExport`2(System.ComponentModel.Composition.Primitives.Export)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices.#CreateSemiStronglyTypedExportFactory(System.Type,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices.#CreateStronglyTypedExportFactory(System.Type,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices.#CreateStronglyTypedExportOfT`1(System.ComponentModel.Composition.Primitives.Export)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices.#CreateStronglyTypedExportOfTM`2(System.ComponentModel.Composition.Primitives.Export)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices+DisposableLazy`2.#System.IDisposable.Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices+DisposableLazy`1.#.ctor(System.Func`1,System.IDisposable)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices+DisposableLazy`1.#System.IDisposable.Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices.#.cctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices.#GetExportedValueFromLazy`1(System.ComponentModel.Composition.Primitives.Export)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices.#IsDefaultMetadataViewType(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ExportServices.#IsDictionaryConstructorViewType(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#AddItemToLocalDictionary(System.Reflection.Emit.ILGenerator,System.Reflection.Emit.LocalBuilder,System.Object,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#AddLocalToLocalDictionary(System.Reflection.Emit.ILGenerator,System.Reflection.Emit.LocalBuilder,System.Object,System.Reflection.Emit.LocalBuilder)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#CreateGeneratorForPublicConstructor(System.Reflection.Emit.TypeBuilder,System.Type[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#.cctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#GetExceptionDataAndStoreInLocal(System.Reflection.Emit.ILGenerator,System.Reflection.Emit.LocalBuilder,System.Reflection.Emit.LocalBuilder)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#IsBoxingRequiredForValue(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#LoadDouble(System.Reflection.Emit.ILGenerator,System.Double)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#LoadEnumerable(System.Reflection.Emit.ILGenerator,System.Collections.IEnumerable)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#LoadFloat(System.Reflection.Emit.ILGenerator,System.Single)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#LoadInt(System.Reflection.Emit.ILGenerator,System.Int32)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#LoadLong(System.Reflection.Emit.ILGenerator,System.Int64)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#LoadNull(System.Reflection.Emit.ILGenerator)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#LoadString(System.Reflection.Emit.ILGenerator,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#LoadTypeOf(System.Reflection.Emit.ILGenerator,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.GenerationServices.#LoadValue(System.Reflection.Emit.ILGenerator,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ImportAttribute.#.ctor(System.String,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ImportCardinalityMismatchException.#.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ImportCardinalityMismatchException.#.ctor(System.String,System.Exception)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ImportDefinition.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ImportDefinition.#.ctor(System.String,System.ComponentModel.Composition.Primitives.ImportCardinality,System.Boolean,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ImportDefinition.#IsConstraintSatisfiedBy(System.ComponentModel.Composition.Primitives.ExportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ImportDefinition.#ToString()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#Dispose(System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+EngineContext.#AddPartManager(System.ComponentModel.Composition.Hosting.ImportEngine+PartManager)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+EngineContext.#Complete()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+EngineContext.#.ctor(System.ComponentModel.Composition.Hosting.ImportEngine,System.ComponentModel.Composition.Hosting.ImportEngine+EngineContext)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+EngineContext.#RemovePartManager(System.ComponentModel.Composition.Hosting.ImportEngine+PartManager)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#GetEngineContext(System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#GetPartManager(System.ComponentModel.Composition.Primitives.ComposablePart,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#.ctor(System.ComponentModel.Composition.Hosting.ExportProvider,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#InPrerequisiteLoop()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#OnExportsChanging(System.Object,System.ComponentModel.Composition.Hosting.ExportsChangeEventArgs)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+PartManager.#DisposeAllDependencies()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+PartManager.#GetImportedContractNames()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+PartManager.#GetSavedImport(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+PartManager.#.ctor(System.ComponentModel.Composition.Hosting.ImportEngine,System.ComponentModel.Composition.Primitives.ComposablePart)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+PartManager.#SetSavedImport(System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Primitives.Export[],System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+PartManager.#State")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+PartManager.#UpdateDisposableDependencies(System.ComponentModel.Composition.Primitives.ImportDefinition,System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#PreviewImports(System.ComponentModel.Composition.Primitives.ComposablePart,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+RecompositionManager.#AddIndexEntries(System.ComponentModel.Composition.Hosting.ImportEngine+PartManager)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+RecompositionManager.#GetAffectedImports(System.ComponentModel.Composition.Primitives.ComposablePart,System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+RecompositionManager.#GetAffectedParts(System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+RecompositionManager.#GetPartsImporting(System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+RecompositionManager.#IsAffectedImport(System.ComponentModel.Composition.Primitives.ImportDefinition,System.Collections.Generic.IEnumerable`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+RecompositionManager.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+RecompositionManager.#RemoveIndexEntries(System.ComponentModel.Composition.Hosting.ImportEngine+PartManager)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine+RecompositionManager.#UpdateImportIndex()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#ReleaseImports(System.ComponentModel.Composition.Primitives.ComposablePart,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#SatisfyImports(System.ComponentModel.Composition.Primitives.ComposablePart)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#SatisfyImportsOnce(System.ComponentModel.Composition.Primitives.ComposablePart)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#StopSatisfyingImports(System.ComponentModel.Composition.Hosting.ImportEngine+PartManager,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#TryPreviewImportsStateMachine(System.ComponentModel.Composition.Hosting.ImportEngine+PartManager,System.ComponentModel.Composition.Primitives.ComposablePart,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#TryRecomposeImport(System.ComponentModel.Composition.Hosting.ImportEngine+PartManager,System.Boolean,System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#TryRecomposeImports(System.ComponentModel.Composition.Hosting.ImportEngine+PartManager,System.Collections.Generic.IEnumerable`1,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#TrySatisfyImports(System.ComponentModel.Composition.Hosting.ImportEngine+PartManager,System.ComponentModel.Composition.Primitives.ComposablePart,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#TrySatisfyImportsStateMachine(System.ComponentModel.Composition.Hosting.ImportEngine+PartManager,System.ComponentModel.Composition.Primitives.ComposablePart)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.ImportEngine.#TrySatisfyImportSubset(System.ComponentModel.Composition.Hosting.ImportEngine+PartManager,System.Collections.Generic.IEnumerable`1,System.ComponentModel.Composition.Hosting.AtomicComposition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ImportingConstructorAttribute.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportingItem.#Cast(System.Type,System.ComponentModel.Composition.Primitives.Export)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportingItem.#CastExportsToCollectionImportType(System.ComponentModel.Composition.Primitives.Export[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportingItem.#.ctor(System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition,System.ComponentModel.Composition.ReflectionModel.ImportType)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportingMember.#EnsureCollectionIsWritable(System.Collections.Generic.ICollection`1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportingMember.#EnsureWritable()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportingMember.#GetNormalizedCollection(System.Type,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportingMember.#PopulateCollection(System.Collections.Generic.ICollection`1,System.Collections.IEnumerable)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportingMember.#SetCollectionMemberValue(System.Object,System.Collections.IEnumerable)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportingMember.#SetSingleMemberValue(System.Object,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ImportManyAttribute.#.ctor(System.String,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportType.#CreateLazyType(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportType.#GetStronglyTypedExport(System.ComponentModel.Composition.Primitives.Export)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportType.#.ctor(System.Type,System.ComponentModel.Composition.Primitives.ImportCardinality)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportType.#IsTypeAssignableCollectionType(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ImportType+SpecificLazyType.#.ctor(System.Type,System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.Lazy`2.#.ctor(System.Func`1,!1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.Lazy`2.#.ctor(System.Func`1,!1,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.Lazy`2.#.ctor(!1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.Lazy`2.#.ctor(!1,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo.#AreAccessorsValid(System.Reflection.MemberTypes,System.Reflection.MemberInfo[],System.String&)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo.#Equals(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo.#GetAccessors()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo.#GetHashCode()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo.#.ctor(System.Reflection.MemberInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo.#.ctor(System.Reflection.MemberTypes,System.Reflection.MemberInfo[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo.#op_Inequality(System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo,System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo.#op_Equality(System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo,System.ComponentModel.Composition.ReflectionModel.LazyMemberInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.LazyServices.#AsLazy`1(!!0)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.LazyServices.#GetNotNullValue`1(System.Lazy`1,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Lock.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Lock.#EnterReadLock()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Lock.#EnterWriteLock()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Lock.#ExitReadLock()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Lock.#ExitWriteLock()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Lock.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.MetadataAttributeAttribute.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.MetadataServices.#GetValue`1(System.Collections.Generic.IDictionary`2,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.MetadataViewGenerator.#GenerateFieldAssignmentFromLocalValue(System.Reflection.Emit.ILGenerator,System.Reflection.Emit.LocalBuilder,System.Reflection.Emit.FieldBuilder)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.MetadataViewGenerator.#GenerateInterfaceViewProxyType(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.MetadataViewGenerator.#GenerateLocalAssignmentFromDefaultAttribute(System.Reflection.Emit.ILGenerator,System.ComponentModel.DefaultValueAttribute[],System.Reflection.Emit.LocalBuilder)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.MetadataViewGenerator.#GenerateLocalAssignmentFromFlag(System.Reflection.Emit.ILGenerator,System.Reflection.Emit.LocalBuilder,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.MetadataViewGenerator.#GenerateView(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.MetadataViewGenerator.#.cctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.MetadataViewProvider.#GetMetadataView`1(System.Collections.Generic.IDictionary`2)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.MetadataViewProvider.#IsViewTypeValid(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.PartCreationPolicyAttribute.#.ctor(System.ComponentModel.Composition.CreationPolicy)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.PartMetadataAttribute.#.ctor(System.String,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.PartNotDiscoverableAttribute.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReadLock.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#Contains(System.Collections.Generic.KeyValuePair`2)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#ContainsKey(!0)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#CopyTo(System.Collections.Generic.KeyValuePair`2[],System.Int32)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#Count")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#GetEnumerator()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#System.Collections.Generic.ICollection`1>.Add(System.Collections.Generic.KeyValuePair`2)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#System.Collections.Generic.ICollection`1>.Clear()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#System.Collections.Generic.ICollection`1>.Remove(System.Collections.Generic.KeyValuePair`2)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#System.Collections.Generic.IDictionary`2.Add(!0,!1)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#System.Collections.Generic.IDictionary`2.Remove(!0)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#System.Collections.IEnumerable.GetEnumerator()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#Keys")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#.ctor(System.Collections.Generic.IDictionary`2)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#Item[!0]")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#TryGetValue(!0,!1&)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionary`2.#Values")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionaryDebuggerProxy`2.#Items")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.ReadOnlyDictionaryDebuggerProxy`2.#.ctor(Microsoft.Internal.Collections.ReadOnlyDictionary`2)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#Activate()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#CachedInstance")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#CreateInstance(System.Reflection.ConstructorInfo,System.Object[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#EnsureCardinality(System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Primitives.Export[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#EnsureGettable()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#EnsureSettable(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#GetConstructorArguments()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#GetExportedValue(System.ComponentModel.Composition.Primitives.ExportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#GetExportingMemberFromDefinition(System.ComponentModel.Composition.Primitives.ExportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#GetImportingItemFromDefinition(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#GetInstanceActivatingIfNeeded()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#NotifyImportSatisfied()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#.ctor(System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePartDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#.ctor(System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePartDefinition,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#RequiresActivation()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#SetImport(System.ComponentModel.Composition.ReflectionModel.ImportingItem,System.ComponentModel.Composition.Primitives.Export[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#SetNonPrerequisiteImports()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#TryGetImportValue(System.ComponentModel.Composition.Primitives.ImportDefinition,System.Object&)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.#UseImportedValues`1(System.Collections.Generic.IEnumerable`1,System.Action`3,System.Boolean)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePartDefinition.#ExportDefinitions")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePartDefinition.#GetConstructor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePartDefinition.#ImportDefinitions")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePartDefinition.#Metadata")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePartDefinition.#.ctor(System.ComponentModel.Composition.ReflectionModel.IReflectionPartCreationInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionExtensions.#CreateReflectionProperty(System.Reflection.MethodInfo,System.Reflection.MethodInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionExtensions.#ToLazyMember(System.Reflection.MemberInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionExtensions.#ToLazyMember(System.ComponentModel.Composition.ReflectionModel.ReflectionMember)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionExtensions.#ToReflectionProperty(System.Reflection.PropertyInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionExtensions.#ToReflectionWritableMember(System.Reflection.MemberInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionField.#CanWrite")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionField.#GetValue(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionField.#RequiresInstance")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionField.#ReturnType")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionField.#SetValue(System.Object,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionItem.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionMember.#DeclaringType")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionMember.#Name")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionMemberExportDefinition.#GetDisplayName()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionMemberImportDefinition.#GetDisplayName()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionMethod.#RequiresInstance")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionMethod.#ReturnType")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#GetExportingMember(System.ComponentModel.Composition.Primitives.ExportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#GetImportingMember(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#GetImportingParameter(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#GetPartType(System.ComponentModel.Composition.Primitives.ComposablePartDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#IsDisposalRequired(System.ComponentModel.Composition.Primitives.ComposablePartDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices.#IsImportingParameter(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices+LazyExportDefinition.#Metadata")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices+ReflectionPartCreationInfo.#GetConstructor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices+ReflectionPartCreationInfo.#GetMetadata()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices+ReflectionPartCreationInfo.#.ctor(System.Lazy`1,System.Boolean,System.Lazy`1>,System.Lazy`1>,System.Lazy`1>,System.ComponentModel.Composition.Primitives.ICompositionElement)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionParameter.#GetDisplayName()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionParameter.#Name")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionParameter.#ReturnType")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionParameterImportDefinition.#GetDisplayName()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionParameterImportDefinition.#ToImportingItem()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionProperty.#CanRead")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionProperty.#CanWrite")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionProperty.#GetValue(System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionProperty.#Name")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionProperty.#.ctor(System.Reflection.MethodInfo,System.Reflection.MethodInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionProperty.#RequiresInstance")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionProperty.#ReturnType")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionProperty.#SetValue(System.Object,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionServices.#GetAllProperties(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionServices.#GetDisplayName(System.Reflection.MemberInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionServices.#GetDisplayName(System.Type,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionServices.#TryGetGenericInterfaceType(System.Type,System.Type,System.Type&)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Requires.#IsInMembertypeSet(System.Reflection.MemberTypes,System.String,System.Reflection.MemberTypes)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Requires.#NotNull`1(!!0,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Requires.#NotNullElements`1(System.Collections.Generic.IEnumerable`1,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Requires.#NotNullElements`2(System.Collections.Generic.IEnumerable`1>,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Requires.#NotNullOrEmpty(System.String,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.SerializableCompositionElement.#.ctor(System.String,System.ComponentModel.Composition.Primitives.ICompositionElement)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Runtime.Serialization.SerializationServices.#GetValue`1(System.Runtime.Serialization.SerializationInfo,System.String)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.StringComparers.#ContractName")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.StringComparers.#MetadataKeyNames")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Diagnostics.TraceSourceTraceWriter.#CanWriteError")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Diagnostics.TraceSourceTraceWriter.#CanWriteInformation")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Diagnostics.TraceSourceTraceWriter.#CanWriteWarning")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Diagnostics.TraceSourceTraceWriter.#.cctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Diagnostics.TraceSourceTraceWriter.#WriteEvent(System.Diagnostics.TraceEventType,System.ComponentModel.Composition.Diagnostics.CompositionTraceId,System.String,System.Object[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Diagnostics.TraceWriter.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.TypeCatalog.#CreateIndex()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.TypeCatalog.#GetCandidateParts(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.TypeCatalog.#GetDisplayName()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.TypeCatalog.#GetExports(System.ComponentModel.Composition.Primitives.ImportDefinition)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.TypeCatalog.#GetTypesDisplay()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.TypeCatalog.#PartsInternal")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Hosting.TypeCatalog.#.ctor(System.Collections.Generic.IEnumerable`1,System.ComponentModel.Composition.Primitives.ICompositionElement)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.WeakReferenceCollection`1.#Add(!0)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.WeakReferenceCollection`1.#AliveItemsToList()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.WeakReferenceCollection`1.#CleanupDeadReferences()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.WeakReferenceCollection`1.#Clear()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.WeakReferenceCollection`1.#IndexOf(!0)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.WeakReferenceCollection`1.#Remove(!0)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.Collections.WeakReferenceCollection`1.#.ctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.WriteLock.#Dispose()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.Primitives.ContractBasedImportDefinition.#ValidateRequiredMetadata()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.LazyExportDefinition.#Metadata")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionInvoke.#DemandMemberAccess(System.Reflection.MemberInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionInvoke.#DemandMemberAccessIfNeeded(System.Type)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionInvoke.#DemandRestrictedMemberAccess(System.Reflection.MemberInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionInvoke.#.cctor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionInvoke.#SafeCreateInstance(System.Type,System.Object[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionInvoke.#SafeGetValue(System.Reflection.FieldInfo,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionInvoke.#SafeInvoke(System.Reflection.ConstructorInfo,System.Object[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionInvoke.#SafeInvoke(System.Reflection.MethodInfo,System.Object,System.Object[])")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionInvoke.#SafeSetValue(System.Reflection.FieldInfo,System.Object,System.Object)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionInvoke.#UnsafePermissionSet(System.Reflection.Assembly)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionPartCreationInfo.#GetConstructor()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionPartCreationInfo.#GetMetadata()")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.ReflectionModel.ReflectionPartCreationInfo.#.ctor(System.Lazy`1,System.Boolean,System.Lazy`1>,System.Lazy`1>,System.Lazy`1>,System.ComponentModel.Composition.Primitives.ICompositionElement)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionServices.#Assembly(System.Reflection.MemberInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionServices.#IsVisible(System.Reflection.ConstructorInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionServices.#IsVisible(System.Reflection.FieldInfo)")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "Microsoft.Internal.ReflectionServices.#IsVisible(System.Reflection.MethodInfo)")] -[module: SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Scope = "type", Target = "System.ComponentModel.Composition.ChangeRejectedException")] -[module: SuppressMessage("Microsoft.Usage", "CA2240:ImplementISerializableCorrectly", Scope = "type", Target = "System.ComponentModel.Composition.CompositionException")] -[module: SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Scope = "type", Target = "System.ComponentModel.Composition.CompositionException")] -[module: SuppressMessage("Microsoft.Security", "CA2116:AptcaMethodsShouldOnlyCallAptcaMethods", Scope = "member", Target = "System.ComponentModel.Composition.CompositionException+CompositionExceptionData.#System.Runtime.Serialization.ISafeSerializationData.CompleteDeserialization(System.Object)")] - - - diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/.gitattributes deleted file mode 100644 index 8381eda809e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -/Lazy.cs -crlf -/LazyOfTTMetadata.cs -crlf -/Tuple.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/.gitattributes deleted file mode 100644 index cd15fcf2076..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/.gitattributes +++ /dev/null @@ -1,38 +0,0 @@ -/AttributedModelServices.cs -crlf -/ChangeRejectedException.cs -crlf -/CompositionContractMismatchException.cs -crlf -/CompositionError.cs -crlf -/CompositionErrorDebuggerProxy.cs -crlf -/CompositionErrorId.cs -crlf -/CompositionException.cs -crlf -/CompositionResult.cs -crlf -/CompositionResultOfT.cs -crlf -/ConstraintServices.cs -crlf -/ContractNameServices.cs -crlf -/CreationPolicy.cs -crlf -/ErrorBuilder.cs -crlf -/ExceptionBuilder.cs -crlf -/ExportAttribute.cs -crlf -/ExportCardinalityCheckResult.cs -crlf -/ExportMetadataAttribute.cs -crlf -/ExportServices.DisposableLazy.cs -crlf -/ExportServices.cs -crlf -/IAttributedImport.cs -crlf -/ICompositionError.cs -crlf -/ICompositionService.cs -crlf -/IPartImportsSatisfiedNotification.cs -crlf -/ImportAttribute.cs -crlf -/ImportCardinalityMismatchException.cs -crlf -/ImportManyAttribute.cs -crlf -/ImportingConstructorAttribute.cs -crlf -/InheritedExportAttribute.cs -crlf -/MetadataAttributeAttribute.cs -crlf -/MetadataServices.cs -crlf -/MetadataViewGenerator.cs -crlf -/MetadataViewProvider.cs -crlf -/PartCreationPolicyAttribute.cs -crlf -/PartCreatorOfT.cs -crlf -/PartCreatorOfTTMetadata.cs -crlf -/PartLifetimeContextOfT.cs -crlf -/PartMetadataAttribute.cs -crlf -/PartNotDiscoverableAttribute.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/.gitattributes deleted file mode 100644 index 64069f9372e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -/AttributedExportDefinition.cs -crlf -/AttributedModelDiscovery.cs -crlf -/AttributedPartCreationInfo.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs deleted file mode 100644 index c06732adf8a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs +++ /dev/null @@ -1,65 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using System.Globalization; -using System.Linq; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; -using System.Threading; - -namespace System.ComponentModel.Composition.AttributedModel -{ - internal class AttributedExportDefinition : ExportDefinition - { - private readonly AttributedPartCreationInfo _partCreationInfo; - private readonly MemberInfo _member; - private readonly ExportAttribute _exportAttribute; - - private IDictionary _metadata; - - public AttributedExportDefinition(AttributedPartCreationInfo partCreationInfo, MemberInfo member, ExportAttribute exportAttribute) - : base(member.GetContractNameFromExport(exportAttribute), (IDictionary)null) - { - Assumes.NotNull(partCreationInfo); - Assumes.NotNull(member); - Assumes.NotNull(exportAttribute); - - this._partCreationInfo = partCreationInfo; - this._member = member; - this._exportAttribute = exportAttribute; - } - - public override IDictionary Metadata - { - get - { - if (this._metadata == null) - { - IDictionary metadata; - this._member.TryExportMetadataForMember(out metadata); - - string typeIdentity = this._member.GetTypeIdentityFromExport(this._exportAttribute); - metadata.Add(CompositionConstants.ExportTypeIdentityMetadataName, typeIdentity); - - var partMetadata = this._partCreationInfo.GetMetadata(); - if (partMetadata != null && partMetadata.ContainsKey(CompositionConstants.PartCreationPolicyMetadataName)) - { - metadata.Add(CompositionConstants.PartCreationPolicyMetadataName, partMetadata[CompositionConstants.PartCreationPolicyMetadataName]); - } - - this._metadata = metadata; - } - return this._metadata; - } - } - } - -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscovery.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscovery.cs deleted file mode 100644 index ed5fbb4b9bd..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscovery.cs +++ /dev/null @@ -1,138 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Diagnostics; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using System.Reflection; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.AttributedModel -{ - internal static class AttributedModelDiscovery - { - public static ComposablePartDefinition CreatePartDefinitionIfDiscoverable(Type type, ICompositionElement origin) - { - AttributedPartCreationInfo creationInfo = new AttributedPartCreationInfo(type, null, false, origin); - if (!creationInfo.IsPartDiscoverable()) - { - return null; - } - - return new ReflectionComposablePartDefinition(creationInfo); - } - - public static ReflectionComposablePartDefinition CreatePartDefinition(Type type, PartCreationPolicyAttribute partCreationPolicy, bool ignoreConstructorImports, ICompositionElement origin) - { - Assumes.NotNull(type); - - AttributedPartCreationInfo creationInfo = new AttributedPartCreationInfo(type, partCreationPolicy, ignoreConstructorImports, origin); - - return new ReflectionComposablePartDefinition(creationInfo); - } - - public static ReflectionComposablePart CreatePart(object attributedPart) - { - Assumes.NotNull(attributedPart); - - // If given an instance then we want to pass the default composition options because we treat it as a shared part - // TODO: ICompositionElement Give this def an origin indicating that it was added directly to the ComposablePartExportProvider. - - ReflectionComposablePartDefinition definition = AttributedModelDiscovery.CreatePartDefinition(attributedPart.GetType(), PartCreationPolicyAttribute.Shared, true, (ICompositionElement)null); - - return new ReflectionComposablePart(definition, attributedPart); - } - - public static ReflectionParameterImportDefinition CreateParameterImportDefinition(ParameterInfo parameter, ICompositionElement origin) - { - Requires.NotNull(parameter, "parameter"); - - ReflectionParameter reflectionParameter = parameter.ToReflectionParameter(); - IAttributedImport attributedImport = AttributedModelDiscovery.GetAttributedImport(reflectionParameter, parameter); - ImportType importType = new ImportType(reflectionParameter.ReturnType, attributedImport.Cardinality); - - if (importType.IsPartCreator) - { - return new PartCreatorParameterImportDefinition( - new Lazy(() => parameter), - origin, - new ContractBasedImportDefinition( - attributedImport.GetContractNameFromImport(importType), - attributedImport.GetTypeIdentityFromImport(importType), - CompositionServices.GetRequiredMetadata(importType.MetadataViewType), - attributedImport.Cardinality, - false, - true, - CreationPolicy.NonShared)); - } - else - { - return new ReflectionParameterImportDefinition( - new Lazy(() => parameter), - attributedImport.GetContractNameFromImport(importType), - attributedImport.GetTypeIdentityFromImport(importType), - CompositionServices.GetRequiredMetadata(importType.MetadataViewType), - attributedImport.Cardinality, - attributedImport.RequiredCreationPolicy, - origin); - } - } - - public static ReflectionMemberImportDefinition CreateMemberImportDefinition(MemberInfo member, ICompositionElement origin) - { - Requires.NotNull(member, "member"); - - ReflectionWritableMember reflectionMember = member.ToReflectionWritableMember(); - IAttributedImport attributedImport = AttributedModelDiscovery.GetAttributedImport(reflectionMember, member); - ImportType importType = new ImportType(reflectionMember.ReturnType, attributedImport.Cardinality); - - if (importType.IsPartCreator) - { - return new PartCreatorMemberImportDefinition( - new LazyMemberInfo(member), - origin, - new ContractBasedImportDefinition( - attributedImport.GetContractNameFromImport(importType), - attributedImport.GetTypeIdentityFromImport(importType), - CompositionServices.GetRequiredMetadata(importType.MetadataViewType), - attributedImport.Cardinality, - attributedImport.AllowRecomposition, - false, - CreationPolicy.NonShared)); - } - else - { - return new ReflectionMemberImportDefinition( - new LazyMemberInfo(member), - attributedImport.GetContractNameFromImport(importType), - attributedImport.GetTypeIdentityFromImport(importType), - CompositionServices.GetRequiredMetadata(importType.MetadataViewType), - attributedImport.Cardinality, - attributedImport.AllowRecomposition, - attributedImport.RequiredCreationPolicy, - origin); - } - } - - private static IAttributedImport GetAttributedImport(ReflectionItem item, ICustomAttributeProvider attributeProvider) - { - IAttributedImport[] imports = attributeProvider.GetAttributes(false); - - // For constructor parameters they may not have an ImportAttribute - if (imports.Length == 0) - { - return new ImportAttribute(); - } - - if (imports.Length > 1) - { - CompositionTrace.MemberMarkedWithMultipleImportAndImportMany(item); - } - - // Regardless of how many imports, always return the first one - return imports[0]; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs deleted file mode 100644 index 9bc3d2f705b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs +++ /dev/null @@ -1,446 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Diagnostics; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using System.Linq; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.AttributedModel -{ - internal class AttributedPartCreationInfo : IReflectionPartCreationInfo - { - private readonly Type _type; - private readonly bool _ignoreConstructorImports = false; - private readonly ICompositionElement _origin; - private PartCreationPolicyAttribute _partCreationPolicy = null; - private ConstructorInfo _constructor; - private IEnumerable _exports; - private IEnumerable _imports; - private HashSet _contractNamesOnNonInterfaces; - - public AttributedPartCreationInfo(Type type, PartCreationPolicyAttribute partCreationPolicy, bool ignoreConstructorImports, ICompositionElement origin) - { - Assumes.NotNull(type); - this._type = type; - this._ignoreConstructorImports = ignoreConstructorImports; - this._partCreationPolicy = partCreationPolicy; - this._origin = origin; - } - - public Type GetPartType() - { - return this._type; - } - - public Lazy GetLazyPartType() - { - return new Lazy(this.GetPartType, false); - } - - public ConstructorInfo GetConstructor() - { - if (this._constructor == null && !this._ignoreConstructorImports) - { - this._constructor = SelectPartConstructor(this._type); - } - return this._constructor; - } - - public IDictionary GetMetadata() - { - return this._type.GetPartMetadataForType(this.CreationPolicy); - } - - public IEnumerable GetExports() - { - DiscoverExportsAndImports(); - return this._exports; - } - - public IEnumerable GetImports() - { - DiscoverExportsAndImports(); - return this._imports; - } - - public bool IsDisposalRequired - { - get - { - return typeof(IDisposable).IsAssignableFrom(this.GetPartType()); - } - } - - public bool IsPartDiscoverable() - { - if (this._type.IsAttributeDefined()) - { - CompositionTrace.DefinitionMarkedWithPartNotDiscoverableAttribute(this._type); - return false; - } - - if (this._type.ContainsGenericParameters) - { - CompositionTrace.DefinitionContainsGenericsParameters(this._type); - return false; - } - - if (!HasExports()) - { - CompositionTrace.DefinitionContainsNoExports(this._type); - return false; - } - - return true; - } - - private bool HasExports() - { - return GetExportMembers(this._type).Any() || - GetInheritedExports(this._type).Any(); - } - - string ICompositionElement.DisplayName - { - get { return this.GetDisplayName(); } - } - - ICompositionElement ICompositionElement.Origin - { - get { return this._origin; } - } - - public override string ToString() - { - return GetDisplayName(); - } - - private string GetDisplayName() - { - return this.GetPartType().GetDisplayName(); - } - - private CreationPolicy CreationPolicy - { - get - { - if (this._partCreationPolicy == null) - { - this._partCreationPolicy = this._type.GetFirstAttribute() ?? PartCreationPolicyAttribute.Default; - } - return this._partCreationPolicy.CreationPolicy; - } - } - - private static ConstructorInfo SelectPartConstructor(Type type) - { - Assumes.NotNull(type); - - if (type.IsAbstract) - { - return null; - } - - // Only deal with non-static constructors - BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - - ConstructorInfo[] constructors = type.GetConstructors(flags); - - // Should likely only happen for static or abstract types - if (constructors.Length == 0) - { - return null; - } - - // Optimize single default constructor. - if (constructors.Length == 1 && constructors[0].GetParameters().Length == 0) - { - return constructors[0]; - } - - // Select the marked constructor if there is exactly one marked - IEnumerable importingConstructors = constructors.Where( - ctor => ctor.IsAttributeDefined()); - - switch (importingConstructors.GetCardinality()) - { - case EnumerableCardinality.One: - { - return importingConstructors.First(); - } - - case EnumerableCardinality.TwoOrMore: - { - // Return null, the part will error on instantiation. - return null; - } - } - - // If there are no marked constructors then select the default constructor - IEnumerable defaultConstructors = constructors.Where( - ctor => ctor.GetParameters().Length == 0); - - // There should only ever be zero or one default constructors - return defaultConstructors.SingleOrDefault(); - } - - private void DiscoverExportsAndImports() - { - // NOTE : in most cases both of these will be null or not null at the same time - // the only situation when that is not the case is when there was a failure during the previous discovery - // and one of them ended up not being set. In that case we will force the discovery again so that the same exception is thrown. - if ((this._exports != null) && (this._imports != null)) - { - return; - } - - this._exports = GetExportDefinitions(); - this._imports = GetImportDefinitions(); - } - - private IEnumerable GetExportDefinitions() - { - List exports = new List(); - - this._contractNamesOnNonInterfaces = new HashSet(); - - // GetExportMembers should only contain the type itself along with the members declared on it, - // it should not contain any base types, members on base types or interfaces on the type. - foreach (MemberInfo member in GetExportMembers(this._type)) - { - foreach (ExportAttribute exportAttribute in member.GetAttributes()) - { - var attributedExportDefinition = new AttributedExportDefinition(this, member, exportAttribute); - - if (exportAttribute.GetType() == CompositionServices.InheritedExportAttributeType) - { - // Any InheritedExports on the type itself are contributed during this pass - // and we need to do the book keeping for those. - if (!this._contractNamesOnNonInterfaces.Contains(attributedExportDefinition.ContractName)) - { - exports.Add(new ReflectionMemberExportDefinition(member.ToLazyMember(), attributedExportDefinition, this)); - this._contractNamesOnNonInterfaces.Add(attributedExportDefinition.ContractName); - } - } - else - { - exports.Add(new ReflectionMemberExportDefinition(member.ToLazyMember(), attributedExportDefinition, this)); - } - } - } - - // GetInheritedExports should only contain InheritedExports on base types or interfaces. - // The order of types returned here is important because it is used as a - // priority list of which InhertedExport to choose if multiple exists with - // the same contract name. Therefore ensure that we always return the types - // in the hiearchy from most derived to the lowest base type, followed - // by all the interfaces that this type implements. - foreach (Type type in GetInheritedExports(this._type)) - { - foreach (InheritedExportAttribute exportAttribute in type.GetAttributes()) - { - var attributedExportDefinition = new AttributedExportDefinition(this, type, exportAttribute); - - if (!this._contractNamesOnNonInterfaces.Contains(attributedExportDefinition.ContractName)) - { - exports.Add(new ReflectionMemberExportDefinition(type.ToLazyMember(), attributedExportDefinition, this)); - - if (!type.IsInterface) - { - this._contractNamesOnNonInterfaces.Add(attributedExportDefinition.ContractName); - } - } - } - } - - this._contractNamesOnNonInterfaces = null; // No need to hold this state around any longer - - return exports; - } - - private IEnumerable GetExportMembers(Type type) - { - BindingFlags flags = BindingFlags.DeclaredOnly | BindingFlags.Public | - BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static; - - // If the type is abstract only find local static exports - if (type.IsAbstract) - { - flags &= ~BindingFlags.Instance; - } - else if (IsExport(type)) - { - yield return type; - } - - // Walk the fields - foreach (var member in type.GetFields(flags)) - { - if (IsExport(member)) - { - yield return member; - } - } - - // Walk the properties - foreach (var member in type.GetProperties(flags)) - { - if (IsExport(member)) - { - yield return member; - } - } - - // Walk the methods - foreach (var member in type.GetMethods(flags)) - { - if (IsExport(member)) - { - yield return member; - } - } - } - - private IEnumerable GetInheritedExports(Type type) - { - // If the type is abstract we aren't interested in type level exports - if (type.IsAbstract) - { - yield break; - } - - // The order of types returned here is important because it is used as a - // priority list of which InhertedExport to choose if multiple exists with - // the same contract name. Therefore ensure that we always return the types - // in the hiearchy from most derived to the lowest base type, followed - // by all the interfaces that this type implements. - - Type currentType = type.BaseType; - - if (currentType == null) - { - yield break; - } - - // Stopping at object instead of null to help with performance. It is a noticable performance - // gain (~5%) if we don't have to try and pull the attributes we know don't exist on object. - // We also need the null check in case we're passed a type that doesn't live in the runtime context. - while (currentType != null && currentType != CompositionServices.ObjectType) - { - if (IsInheritedExport(currentType)) - { - yield return currentType; - } - currentType = currentType.BaseType; - } - - foreach (Type iface in type.GetInterfaces()) - { - if (IsInheritedExport(iface)) - { - yield return iface; - } - } - } - - private static bool IsExport(ICustomAttributeProvider attributeProvider) - { - return attributeProvider.IsAttributeDefined(false); - } - - private static bool IsInheritedExport(ICustomAttributeProvider attributedProvider) - { - return attributedProvider.IsAttributeDefined(false); - } - - private IEnumerable GetImportDefinitions() - { - List imports = new List(); - - foreach (MemberInfo member in GetImportMembers(this._type)) - { - ReflectionMemberImportDefinition importDefinition = AttributedModelDiscovery.CreateMemberImportDefinition(member, this); - imports.Add(importDefinition); - } - - var constructor = this.GetConstructor(); - - if (constructor != null) - { - foreach (ParameterInfo parameter in constructor.GetParameters()) - { - ReflectionParameterImportDefinition importDefinition = AttributedModelDiscovery.CreateParameterImportDefinition(parameter, this); - imports.Add(importDefinition); - } - } - - return imports; - } - - private IEnumerable GetImportMembers(Type type) - { - if (type.IsAbstract) - { - yield break; - } - - foreach (MemberInfo member in GetDeclaredOnlyImportMembers(type)) - { - yield return member; - } - - // Walk up the type chain until you hit object. - if (type.BaseType != null) - { - Type baseType = type.BaseType; - - // Stopping at object instead of null to help with performance. It is a noticable performance - // gain (~5%) if we don't have to try and pull the attributes we know don't exist on object. - // We also need the null check in case we're passed a type that doesn't live in the runtime context. - while (baseType != null && baseType != CompositionServices.ObjectType) - { - foreach (MemberInfo member in GetDeclaredOnlyImportMembers(baseType)) - { - yield return member; - } - baseType = baseType.BaseType; - } - } - } - - private IEnumerable GetDeclaredOnlyImportMembers(Type type) - { - BindingFlags flags = BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - - // Walk the fields - foreach (var member in type.GetFields(flags)) - { - if (IsImport(member)) - { - yield return member; - } - } - - // Walk the properties - foreach (var member in type.GetProperties(flags)) - { - if (IsImport(member)) - { - yield return member; - } - } - } - - private static bool IsImport(ICustomAttributeProvider attributeProvider) - { - return attributeProvider.IsAttributeDefined(false); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModelServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModelServices.cs deleted file mode 100644 index b2be75773a2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModelServices.cs +++ /dev/null @@ -1,161 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Runtime.Serialization; -using System.ComponentModel.Composition.AttributedModel; -using System.Reflection; -using System.Linq; -using Microsoft.Internal; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; - -namespace System.ComponentModel.Composition -{ - public static class AttributedModelServices - { - [SuppressMessage("Microsoft.Design", "CA1004")] - public static TMetadataView GetMetadataView(IDictionary metadata) - { - Requires.NotNull(metadata, "metadata"); - - return MetadataViewProvider.GetMetadataView(metadata); - } - - public static ComposablePart CreatePart(object attributedPart) - { - Requires.NotNull(attributedPart, "attributedPart"); - return AttributedModelDiscovery.CreatePart(attributedPart); - } - - public static ComposablePartDefinition CreatePartDefinition(Type type, ICompositionElement origin) - { - Requires.NotNull(type, "type"); - return AttributedModelServices.CreatePartDefinition(type, origin, false); - } - - public static ComposablePartDefinition CreatePartDefinition(Type type, ICompositionElement origin, bool ensureIsDiscoverable) - { - Requires.NotNull(type, "type"); - if (ensureIsDiscoverable) - { - return AttributedModelDiscovery.CreatePartDefinitionIfDiscoverable(type, origin); - } - else - { - return AttributedModelDiscovery.CreatePartDefinition(type, null, false, origin); - } - } - - public static string GetTypeIdentity(Type type) - { - Requires.NotNull(type, "type"); - - return ContractNameServices.GetTypeIdentity(type); - } - - public static string GetTypeIdentity(MethodInfo method) - { - Requires.NotNull(method, "method"); - - return ContractNameServices.GetTypeIdentityFromMethod(method); - } - - public static string GetContractName(Type type) - { - return AttributedModelServices.GetTypeIdentity(type); - } - - public static ComposablePart AddExportedValue(this CompositionBatch batch, T exportedValue) - { - Requires.NotNull(batch, "batch"); - string contractName = AttributedModelServices.GetContractName(typeof(T)); - - return batch.AddExportedValue(contractName, exportedValue); - } - - public static void ComposeExportedValue(this CompositionContainer container, T exportedValue) - { - Requires.NotNull(container, "container"); - - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue(exportedValue); - container.Compose(batch); - } - - public static ComposablePart AddExportedValue(this CompositionBatch batch, string contractName, T exportedValue) - { - Requires.NotNull(batch, "batch"); - - string typeIdentity = AttributedModelServices.GetTypeIdentity(typeof(T)); - - IDictionary metadata = new Dictionary(); - metadata.Add(CompositionConstants.ExportTypeIdentityMetadataName, typeIdentity); - - return batch.AddExport(new Export(contractName, metadata, () => exportedValue)); - } - - public static void ComposeExportedValue(this CompositionContainer container, string contractName, T exportedValue) - { - Requires.NotNull(container, "container"); - - CompositionBatch batch = new CompositionBatch(); - batch.AddExportedValue(contractName, exportedValue); - container.Compose(batch); - } - - public static ComposablePart AddPart(this CompositionBatch batch, object attributedPart) - { - Requires.NotNull(batch, "batch"); - Requires.NotNull(attributedPart, "attributedPart"); - - ComposablePart part = AttributedModelServices.CreatePart(attributedPart); - - batch.AddPart(part); - - return part; - } - - public static void ComposeParts(this CompositionContainer container, params object[] attributedParts) - { - Requires.NotNull(container, "container"); - Requires.NotNullOrNullElements(attributedParts, "attributedParts"); - - CompositionBatch batch = new CompositionBatch( - attributedParts.Select(attributedPart => AttributedModelServices.CreatePart(attributedPart)).ToArray(), - Enumerable.Empty()); - - container.Compose(batch); - } - - /// - /// Satisfies the imports of the specified attributed object exactly once and they will not - /// ever be recomposed. - /// - /// - /// The attributed object to set the imports. - /// - /// - /// is . - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - /// - /// The has been disposed of. - /// - public static ComposablePart SatisfyImportsOnce(this ICompositionService compositionService, object attributedPart) - { - Requires.NotNull(compositionService, "compositionService"); - Requires.NotNull(attributedPart, "attributedPart"); - - ComposablePart part = AttributedModelServices.CreatePart(attributedPart); - compositionService.SatisfyImportsOnce(part); - - return part; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ChangeRejectedException.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ChangeRejectedException.cs deleted file mode 100644 index db81e13fbd4..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ChangeRejectedException.cs +++ /dev/null @@ -1,69 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Security.Permissions; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition -{ - /// - /// The exception that is thrown when one or more recoverable errors occur during - /// composition which results in those changes being rejected. - /// - [Serializable] - public class ChangeRejectedException : CompositionException - { - /// - /// Initializes a new instance of the class. - /// - public ChangeRejectedException() - : this((string)null, (Exception)null) - { - } - - /// - /// Initializes a new instance of the class. - /// - public ChangeRejectedException(string message) - : this(message, (Exception)null) - { - } - - /// - /// Initializes a new instance of the class. - /// - public ChangeRejectedException(string message, Exception innerException) - : base(message, innerException, (IEnumerable)null) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// List of errors that occured while applying the changes. - public ChangeRejectedException(IEnumerable errors) - : base((string)null, (Exception)null, errors) - { - } - - /// - /// Gets a message that describes the exception. - /// - /// - /// A containing a message that describes the - /// . - /// - public override string Message - { - get - { - return string.Format(CultureInfo.CurrentCulture, - Strings.CompositionException_ChangesRejected, - base.Message); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionContractMismatchException.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionContractMismatchException.cs deleted file mode 100644 index f1a5f4968b8..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionContractMismatchException.cs +++ /dev/null @@ -1,90 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Runtime.Serialization; - -namespace System.ComponentModel.Composition -{ - /// - /// The exception that is thrown when the underlying exported value or metadata of an - /// or object cannot be - /// cast to T or TMetadataView, respectively. - /// - [Serializable] - public class CompositionContractMismatchException : Exception - { - /// - /// Initializes a new instance of the class. - /// - public CompositionContractMismatchException() - : this((string)null, (Exception)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message. - /// - /// - /// A containing a message that describes the - /// ; or to set - /// the property to its default value. - /// - public CompositionContractMismatchException(string message) - : this(message, (Exception)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message and exception that is the cause of the - /// exception. - /// - /// - /// A containing a message that describes the - /// ; or to set - /// the property to its default value. - /// - /// - /// The that is the underlying cause of the - /// ; or to set - /// the property to . - /// - public CompositionContractMismatchException(string message, Exception innerException) - : base(message, innerException) - { - } - -#if !SILVERLIGHT - - /// - /// Initializes a new instance of the class - /// with the specified serialization data. - /// - /// - /// The that holds the serialized object data about the - /// . - /// - /// - /// The that contains contextual information about the - /// source or destination. - /// - /// - /// is . - /// - /// - /// is missing a required value. - /// - /// - /// contains a value that cannot be cast to the correct type. - /// - [System.Security.SecuritySafeCritical] - protected CompositionContractMismatchException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - -#endif - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionError.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionError.cs deleted file mode 100644 index d5237502bc2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionError.cs +++ /dev/null @@ -1,188 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics; -using System.Globalization; -using System.Security.Permissions; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition -{ - /// - /// Represents an error that occurs during composition in a . - /// - [Serializable] - [DebuggerTypeProxy(typeof(CompositionErrorDebuggerProxy))] - public class CompositionError : ICompositionError - { - private readonly CompositionErrorId _id; - private readonly string _description; - private readonly Exception _exception; - - private readonly ICompositionElement _element; - - /// - /// Initializes a new instance of the class - /// with the specified error message. - /// - /// - /// A containing a message that describes the - /// ; or to set the - /// property to an empty string (""). - /// - public CompositionError(string message) - : this(CompositionErrorId.Unknown, message, (ICompositionElement)null, (Exception)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message and composition element that is the - /// cause of the composition error. - /// - /// - /// The that is the cause of the - /// ; or to set - /// the property to - /// . - /// - /// - /// A containing a message that describes the - /// ; or to set the - /// property to an empty string (""). - /// - public CompositionError(string message, ICompositionElement element) - : this(CompositionErrorId.Unknown, message, element, (Exception)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message and exception that is the cause of the - /// composition error. - /// - /// - /// A containing a message that describes the - /// ; or to set the - /// property to an empty string (""). - /// - /// - /// The that is the underlying cause of the - /// ; or to set - /// the property to . - /// - public CompositionError(string message, Exception exception) - : this(CompositionErrorId.Unknown, message, (ICompositionElement)null, exception) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message, and composition element and exception that - /// is the cause of the composition error. - /// - /// - /// A containing a message that describes the - /// ; or to set the - /// property to an empty string (""). - /// - /// - /// The that is the cause of the - /// ; or to set - /// the property to - /// . - /// - /// - /// The that is the underlying cause of the - /// ; or to set - /// the property to . - /// - public CompositionError(string message, ICompositionElement element, Exception exception) - : this(CompositionErrorId.Unknown, message, element, exception) - { - } - - internal CompositionError(CompositionErrorId id, string description, ICompositionElement element, Exception exception) - { - _id = id; - _description = description ?? string.Empty; - _element = element; - _exception = exception; - } - - /// - /// Gets the composition element that is the cause of the error. - /// - /// - /// The that is the cause of the - /// . The default is . - /// - public ICompositionElement Element - { - get { return _element; } - } - - /// - /// Gets the message that describes the composition error. - /// - /// - /// A containing a message that describes the - /// . - /// - public string Description - { - get { return _description; } - } - - /// - /// Gets the exception that is the underlying cause of the composition error. - /// - /// - /// The that is the underlying cause of the - /// . The default is . - /// - public Exception Exception - { - get { return _exception; } - } - - CompositionErrorId ICompositionError.Id - { - get { return _id; } - } - - Exception ICompositionError.InnerException - { - get { return Exception; } - } - - /// - /// Returns a string representation of the composition error. - /// - /// - /// A containing the property. - /// - public override string ToString() - { - return this.Description; - } - - internal static CompositionError Create(CompositionErrorId id, string format, params object[] parameters) - { - return Create(id, (ICompositionElement)null, (Exception)null, format, parameters); - } - - internal static CompositionError Create(CompositionErrorId id, ICompositionElement element, string format, params object[] parameters) - { - return Create(id, element, (Exception)null, format, parameters); - } - - internal static CompositionError Create(CompositionErrorId id, ICompositionElement element, Exception exception, string format, params object[] parameters) - { - return new CompositionError(id, string.Format(CultureInfo.CurrentCulture, format, parameters), element, exception); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionErrorDebuggerProxy.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionErrorDebuggerProxy.cs deleted file mode 100644 index eafbc0c20ba..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionErrorDebuggerProxy.cs +++ /dev/null @@ -1,37 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition -{ - internal class CompositionErrorDebuggerProxy - { - private readonly CompositionError _error; - - public CompositionErrorDebuggerProxy(CompositionError error) - { - Requires.NotNull(error, "error"); - - this._error = error; - } - - public string Description - { - get { return this._error.Description; } - } - - public Exception Exception - { - get { return this._error.Exception; } - } - - public ICompositionElement Element - { - get { return this._error.Element; } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionErrorId.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionErrorId.cs deleted file mode 100644 index b9eb3b6d16e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionErrorId.cs +++ /dev/null @@ -1,41 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition -{ - internal enum CompositionErrorId : int - { - Unknown = 0, - InvalidExportMetadata, - RequiredMetadataNotFound, - UnsupportedExportType, - ImportNotSetOnPart, - ImportEngine_ComposeTookTooManyIterations, - ImportEngine_ImportCardinalityMismatch, - ImportEngine_PartCycle, - ImportEngine_PartCannotSetImport, - ImportEngine_PartCannotGetExportedValue, - ImportEngine_PartCannotActivate, - ImportEngine_PreventedByExistingImport, - ImportEngine_InvalidStateForRecomposition, - ReflectionModel_PartConstructorMissing, - ReflectionModel_PartConstructorThrewException, - ReflectionModel_PartOnImportsSatisfiedThrewException, - ReflectionModel_ExportNotReadable, - ReflectionModel_ExportThrewException, - ReflectionModel_ExportMethodTooManyParameters, - ReflectionModel_ImportNotWritable, - ReflectionModel_ImportThrewException, - ReflectionModel_ImportNotAssignableFromExport, - ReflectionModel_ImportCollectionNull, - ReflectionModel_ImportCollectionNotWritable, - ReflectionModel_ImportCollectionConstructionThrewException, - ReflectionModel_ImportCollectionGetThrewException, - ReflectionModel_ImportCollectionIsReadOnlyThrewException, - ReflectionModel_ImportCollectionClearThrewException, - ReflectionModel_ImportCollectionAddThrewException, - ReflectionModel_ImportManyOnParameterCanOnlyBeAssigned, - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionException.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionException.cs deleted file mode 100644 index 39491ad433b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionException.cs +++ /dev/null @@ -1,340 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Globalization; -using System.Linq; -using System.Runtime.Serialization; -using System.Security.Permissions; -using System.Text; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition -{ - - /// - /// The exception that is thrown when one or more errors occur during composition in - /// a . - /// - [Serializable] - public class CompositionException : Exception - { - const string ErrorsKey = "Errors"; - private ReadOnlyCollection _errors; - -#if CLR40 && !SILVERLIGHT - [Serializable] - private struct CompositionExceptionData : ISafeSerializationData - { - public CompositionError[] _errors; - - void ISafeSerializationData.CompleteDeserialization(object obj) - { - CompositionException exception = obj as CompositionException; - - exception._errors = new ReadOnlyCollection(this._errors); - } - } -#endif - - /// - /// Initializes a new instance of the class. - /// - public CompositionException() - : this((string)null, (Exception)null, (IEnumerable)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message. - /// - /// - /// A containing a message that describes the - /// ; or to set - /// the property to its default value. - /// - public CompositionException(string message) - : this(message, (Exception)null, (IEnumerable)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message and exception that is the cause of the - /// exception. - /// - /// - /// A containing a message that describes the - /// ; or to set - /// the property to its default value. - /// - /// - /// The that is the underlying cause of the - /// ; or to set - /// the property to . - /// - public CompositionException(string message, Exception innerException) - : this(message, innerException, (IEnumerable)null) - { - } - - internal CompositionException(CompositionError error) - : this(new CompositionError[] { error }) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified errors. - /// - /// - /// An of objects - /// representing the errors that are the cause of the - /// ; or to set the - /// property to an empty . - /// - /// - /// contains an element that is . - /// - public CompositionException(IEnumerable errors) - : this((string)null, (Exception)null, errors) - { - } - - internal CompositionException(string message, Exception innerException, IEnumerable errors) - : base(message, innerException) - { - Requires.NullOrNotNullElements(errors, "errors"); -#if CLR40 && !SILVERLIGHT - SerializeObjectState += delegate(object exception, SafeSerializationEventArgs eventArgs) - { - var data = new CompositionExceptionData(); - if(this._errors != null) - { - data._errors = this._errors.Select(error => new CompositionError( - ((ICompositionError)error).Id, - error.Description, - error.Element.ToSerializableElement(), - error.Exception)).ToArray(); - } - else - { - data._errors = new CompositionError[0]; - } - - eventArgs.AddSerializedState(data); - }; -#endif - _errors = new ReadOnlyCollection(errors == null ? new CompositionError[0] : errors.ToArray()); - } - - /// - /// Gets the errors that are the cause of the exception. - /// - /// - /// An of objects - /// representing the errors that are the cause of the - /// . - /// - public ReadOnlyCollection Errors - { - get { return _errors; } - } - - /// - /// Gets a message that describes the exception. - /// - /// - /// A containing a message that describes the - /// . - /// - public override string Message - { - [System.Security.SecuritySafeCritical] - get - { - if (this.Errors.Count == 0) - { // If there are no errors, then we simply return base.Message, - // which will either use the default Exception message, or if - // one was specified; the user supplied message. - - return base.Message; - } - - return BuildDefaultMessage(); - } - } - - private string BuildDefaultMessage() - { - IEnumerable> paths = CalculatePaths(this); - - StringBuilder writer = new StringBuilder(); - - WriteHeader(writer, this.Errors.Count, paths.Count()); - WritePaths(writer, paths); - - return writer.ToString(); - } - - private static void WriteHeader(StringBuilder writer, int errorsCount, int pathCount) - { - if (errorsCount > 1 && pathCount > 1) - { - // The composition produced multiple composition errors, with {0} root causes. The root causes are provided below. - writer.AppendFormat( - CultureInfo.CurrentCulture, - Strings.CompositionException_MultipleErrorsWithMultiplePaths, - pathCount); - } - else if (errorsCount == 1 && pathCount > 1) - { - // The composition produced a single composition error, with {0} root causes. The root causes are provided below. - writer.AppendFormat( - CultureInfo.CurrentCulture, - Strings.CompositionException_SingleErrorWithMultiplePaths, - pathCount); - } - else - { - Assumes.IsTrue(errorsCount == 1); - Assumes.IsTrue(pathCount == 1); - - // The composition produced a single composition error. The root cause is provided below. - writer.AppendFormat( - CultureInfo.CurrentCulture, - Strings.CompositionException_SingleErrorWithSinglePath, - pathCount); - } - - writer.Append(' '); - writer.AppendLine(Strings.CompositionException_ReviewErrorProperty); - } - - private static void WritePaths(StringBuilder writer, IEnumerable> paths) - { - int ordinal = 0; - foreach (IEnumerable path in paths) - { - ordinal++; - WritePath(writer, path, ordinal); - } - } - - private static void WritePath(StringBuilder writer, IEnumerable path, int ordinal) - { - writer.AppendLine(); - writer.Append(ordinal.ToString(CultureInfo.CurrentCulture)); - writer.Append(Strings.CompositionException_PathsCountSeparator); - writer.Append(' '); - - WriteError(writer, path.First()); - - foreach (CompositionError error in path.Skip(1)) - { - writer.AppendLine(); - writer.Append(Strings.CompositionException_ErrorPrefix); - writer.Append(' '); - WriteError(writer, error); - } - } - - private static void WriteError(StringBuilder writer, CompositionError error) - { - writer.AppendLine(error.Description); - - if (error.Element != null) - { - WriteElementGraph(writer, error.Element); - } - } - - private static void WriteElementGraph(StringBuilder writer, ICompositionElement element) - { - // Writes the composition element and its origins in the format: - // Element: Export --> Part --> PartDefinition --> Catalog - - writer.AppendFormat(CultureInfo.CurrentCulture, Strings.CompositionException_ElementPrefix, element.DisplayName); - - while ((element = element.Origin) != null) - { - writer.AppendFormat(CultureInfo.CurrentCulture, Strings.CompositionException_OriginFormat, Strings.CompositionException_OriginSeparator, element.DisplayName); - } - - writer.AppendLine(); - } - - private static IEnumerable> CalculatePaths(CompositionException exception) - { - List> paths = new List>(); - - VisitContext context = new VisitContext(); - context.Path = new Stack(); - context.LeafVisitor = path => - { - // Take a snapshot of the path - paths.Add(path.Copy()); - }; - - VisitCompositionException(exception, context); - - return paths; - } - - private static void VisitCompositionException(CompositionException exception, VisitContext context) - { - foreach (CompositionError error in exception.Errors) - { - VisitError(error, context); - } - - if (exception.InnerException != null) - { - VisitException(exception.InnerException, context); - } - } - - private static void VisitError(CompositionError error, VisitContext context) - { - context.Path.Push(error); - - if (error.Exception == null) - { // This error is a root cause, so write - // out the stack from this point - - context.LeafVisitor(context.Path); - } - else - { - VisitException(error.Exception, context); - } - - context.Path.Pop(); - } - - private static void VisitException(Exception exception, VisitContext context) - { - CompositionException composition = exception as CompositionException; - if (composition != null) - { - VisitCompositionException(composition, context); - } - else - { - VisitError(new CompositionError(exception.Message, exception.InnerException), context); - } - } - - private struct VisitContext - { - public Stack Path; - public Action> LeafVisitor; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionResult.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionResult.cs deleted file mode 100644 index 3cdda7123bf..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionResult.cs +++ /dev/null @@ -1,86 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Microsoft.Internal.Collections; -using System.ComponentModel.Composition.Hosting; - -namespace System.ComponentModel.Composition -{ - internal struct CompositionResult - { - public static readonly CompositionResult SucceededResult = new CompositionResult(); - private readonly IEnumerable _errors; - - public CompositionResult(params CompositionError[] errors) - : this((IEnumerable)errors) - { - } - - public CompositionResult(IEnumerable errors) - { - this._errors = errors; - } - - public bool Succeeded - { - get { return this._errors == null || !this._errors.FastAny(); } - } - - public IEnumerable Errors - { - get { return this._errors ?? Enumerable.Empty(); } - } - - public CompositionResult MergeResult(CompositionResult result) - { - if (this.Succeeded) - { - return result; - } - if (result.Succeeded) - { - return this; - } - return MergeErrors(result._errors); - } - - public CompositionResult MergeError(CompositionError error) - { - return MergeErrors(new CompositionError[] { error }); - } - - public CompositionResult MergeErrors(IEnumerable errors) - { - return new CompositionResult(this._errors.ConcatAllowingNull(errors)); - } - - public CompositionResult ToResult(T value) - { - return new CompositionResult(value, this._errors); - } - - public void ThrowOnErrors() - { - ThrowOnErrors(null); - } - - public void ThrowOnErrors(AtomicComposition atomicComposition) - { - if (!this.Succeeded) - { - if (atomicComposition == null) - { - throw new CompositionException(this._errors); - } - else - { - throw new ChangeRejectedException(this._errors); - } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionResultOfT.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionResultOfT.cs deleted file mode 100644 index a891a841360..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CompositionResultOfT.cs +++ /dev/null @@ -1,79 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition -{ - internal struct CompositionResult - { - private readonly IEnumerable _errors; - private readonly T _value; - - public CompositionResult(T value) - : this(value, (CompositionError[])null) - { - } - - public CompositionResult(params CompositionError[] errors) - : this(default(T), (IEnumerable)errors) - { - } - - public CompositionResult(IEnumerable errors) - : this(default(T), errors) - { - } - - internal CompositionResult(T value, IEnumerable errors) - { - this._errors = errors; - this._value = value; - } - - public bool Succeeded - { - get { return this._errors == null || !this._errors.FastAny(); } - } - - public IEnumerable Errors - { - get { return this._errors ?? Enumerable.Empty(); } - } - - /// - /// Gets the value from the result, throwing a CompositionException if there are any errors. - /// - public T Value - { - get - { - ThrowOnErrors(); - - return this._value; - } - } - - internal CompositionResult ToResult() - { - return new CompositionResult(this._errors); - } - - internal CompositionResult ToResult() - { - return new CompositionResult(this._errors); - } - - private void ThrowOnErrors() - { - if (!this.Succeeded) - { - throw new CompositionException(this._errors); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ConstraintServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ConstraintServices.cs deleted file mode 100644 index 9f321e8bc64..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ConstraintServices.cs +++ /dev/null @@ -1,214 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition -{ - internal static class ConstraintServices - { - // NOTE : these are here as Reflection member search is pretty expensive, and we want that to be done once. - // Also, making these static would cause this class to fail loading if we rename members of ExportDefinition. - private static readonly PropertyInfo _exportDefinitionContractNameProperty = typeof(ExportDefinition).GetProperty("ContractName"); - private static readonly PropertyInfo _exportDefinitionMetadataProperty = typeof(ExportDefinition).GetProperty("Metadata"); - private static readonly MethodInfo _metadataContainsKeyMethod = typeof(IDictionary).GetMethod("ContainsKey"); - private static readonly MethodInfo _metadataItemMethod = typeof(IDictionary).GetMethod("get_Item"); - private static readonly MethodInfo _metadataEqualsMethod = typeof(object).GetMethod("Equals", new Type[] { typeof(object) }); - private static readonly MethodInfo _typeIsInstanceOfTypeMethod = typeof(Type).GetMethod("IsInstanceOfType"); - - public static Expression> CreateConstraint(IEnumerable> requiredMetadata) - { - ParameterExpression parameter = Expression.Parameter(typeof(ExportDefinition), "exportDefinition"); - Expression metadataConstraintBody = null; - - if (requiredMetadata != null) - { - metadataConstraintBody = ConstraintServices.CreateMetadataConstraintBody(requiredMetadata, parameter); - } - - if (metadataConstraintBody != null) - { - return Expression.Lambda>(metadataConstraintBody, parameter); - } - - return null; - } - - public static Expression> CreateConstraint(string contractName, string requiredTypeIdentity, IEnumerable> requiredMetadata, CreationPolicy requiredCreationPolicy) - { - ParameterExpression parameter = Expression.Parameter(typeof(ExportDefinition), "exportDefinition"); - - Expression constraintBody = ConstraintServices.CreateContractConstraintBody(contractName, parameter); - - if (!string.IsNullOrEmpty(requiredTypeIdentity)) - { - Expression typeIdentityConstraintBody = ConstraintServices.CreateTypeIdentityContraint(requiredTypeIdentity, parameter); - - constraintBody = Expression.AndAlso(constraintBody, typeIdentityConstraintBody); - } - - if (requiredMetadata != null) - { - Expression metadataConstraintBody = ConstraintServices.CreateMetadataConstraintBody(requiredMetadata, parameter); - if (metadataConstraintBody != null) - { - constraintBody = Expression.AndAlso(constraintBody, metadataConstraintBody); - } - } - - if (requiredCreationPolicy != CreationPolicy.Any) - { - Expression policyConstraintBody = ConstraintServices.CreateCreationPolicyContraint(requiredCreationPolicy, parameter); - - constraintBody = Expression.AndAlso(constraintBody, policyConstraintBody); - } - - Expression> constraint = Expression.Lambda>(constraintBody, parameter); - return constraint; - } - - private static Expression CreateContractConstraintBody(string contractName, ParameterExpression parameter) - { - Assumes.NotNull(parameter); - - // export.ContractName=; - return Expression.Equal( - Expression.Property(parameter, ConstraintServices._exportDefinitionContractNameProperty), - Expression.Constant(contractName ?? string.Empty, typeof(string))); - } - - private static Expression CreateMetadataConstraintBody(IEnumerable> requiredMetadata, ParameterExpression parameter) - { - Assumes.NotNull(requiredMetadata); - Assumes.NotNull(parameter); - - Expression body = null; - foreach (KeyValuePair requiredMetadataItem in requiredMetadata) - { - // export.Metadata.ContainsKey() - Expression metadataItemExpression = CreateMetadataContainsKeyExpression(parameter, requiredMetadataItem.Key); - - body = (body != null) ? Expression.AndAlso(body, metadataItemExpression) : metadataItemExpression; - body = Expression.AndAlso(body, CreateMetadataOfTypeExpression(parameter, requiredMetadataItem.Key, requiredMetadataItem.Value)); - } - - return body; - } - - private static Expression CreateCreationPolicyContraint(CreationPolicy policy, ParameterExpression parameter) - { - Assumes.IsTrue(policy != CreationPolicy.Any); - Assumes.NotNull(parameter); - - // !definition.Metadata.ContainsKey(CompositionConstants.PartCreationPolicyMetadataName) || - // CreationPolicy.Any.Equals(definition.Metadata[CompositionConstants.PartCreationPolicyMetadataName]) || - // policy.Equals(definition.Metadata[CompositionConstants.PartCreationPolicyMetadataName]); - - return Expression.MakeBinary(ExpressionType.OrElse, - Expression.MakeBinary(ExpressionType.OrElse, - Expression.Not(CreateMetadataContainsKeyExpression(parameter, CompositionConstants.PartCreationPolicyMetadataName)), - CreateMetadataValueEqualsExpression(parameter, CreationPolicy.Any, CompositionConstants.PartCreationPolicyMetadataName)), - CreateMetadataValueEqualsExpression(parameter, policy, CompositionConstants.PartCreationPolicyMetadataName)); - } - - private static Expression CreateTypeIdentityContraint(string requiredTypeIdentity, ParameterExpression parameter) - { - Assumes.NotNull(requiredTypeIdentity); - Assumes.NotNull(parameter); - - // definition.Metadata.ContainsKey(CompositionServices.ExportTypeIdentity) && - // requiredTypeIdentity.Equals(definition.Metadata[CompositionConstants.ExportTypeIdentityMetadataName]); - - return Expression.MakeBinary(ExpressionType.AndAlso, - CreateMetadataContainsKeyExpression(parameter, CompositionConstants.ExportTypeIdentityMetadataName), - CreateMetadataValueEqualsExpression(parameter, requiredTypeIdentity, CompositionConstants.ExportTypeIdentityMetadataName)); - } - - private static Expression CreateMetadataContainsKeyExpression(ParameterExpression parameter, string constantKey) - { - Assumes.NotNull(parameter, constantKey); - - // definition.Metadata.ContainsKey(constantKey) - return Expression.Call( - Expression.Property(parameter, ConstraintServices._exportDefinitionMetadataProperty), - ConstraintServices._metadataContainsKeyMethod, - Expression.Constant(constantKey)); - } - - private static Expression CreateMetadataOfTypeExpression(ParameterExpression parameter, string constantKey, Type constantType) - { - Assumes.NotNull(parameter, constantKey); - Assumes.NotNull(parameter, constantType); - - // constantType.IsInstanceOfType(definition.Metadata[constantKey]) - return Expression.Call( - Expression.Constant(constantType, typeof(Type)), - ConstraintServices._typeIsInstanceOfTypeMethod, - Expression.Call( - Expression.Property(parameter, ConstraintServices._exportDefinitionMetadataProperty), - ConstraintServices._metadataItemMethod, - Expression.Constant(constantKey)) - ); - } - - private static Expression CreateMetadataValueEqualsExpression(ParameterExpression parameter, object constantValue, string metadataName) - { - Assumes.NotNull(parameter, constantValue); - - // constantValue.Equals(definition.Metadata[CompositionServices.PartCreationPolicyMetadataName]) - return Expression.Call( - Expression.Constant(constantValue), - ConstraintServices._metadataEqualsMethod, - Expression.Call( - Expression.Property(parameter, ConstraintServices._exportDefinitionMetadataProperty), - ConstraintServices._metadataItemMethod, - Expression.Constant(metadataName))); - } - - public static Expression> CreatePartCreatorConstraint(Expression> baseConstraint, ImportDefinition productImportDefinition) - { - ParameterExpression exportDefinitionParameter = baseConstraint.Parameters[0]; - - // exportDefinition.Metadata - Expression metadataExpression = Expression.Property(exportDefinitionParameter, ConstraintServices._exportDefinitionMetadataProperty); - - // exportDefinition.Metadata.ContainsKey("ProductDefinition") - Expression containsProductExpression = Expression.Call( - metadataExpression, - ConstraintServices._metadataContainsKeyMethod, - Expression.Constant(CompositionConstants.ProductDefinitionMetadataName)); - - // exportDefinition.Metadata["ProductDefinition"] - Expression productExportDefinitionExpression = Expression.Call( - metadataExpression, - ConstraintServices._metadataItemMethod, - Expression.Constant(CompositionConstants.ProductDefinitionMetadataName)); - - // ProductImportDefinition.Contraint((ExportDefinition)exportDefinition.Metadata["ProductDefinition"]) - Expression productMatchExpression = - Expression.Invoke(productImportDefinition.Constraint, - Expression.Convert(productExportDefinitionExpression, typeof(ExportDefinition))); - - // baseContraint(exportDefinition) && - // exportDefinition.Metadata.ContainsKey("ProductDefinition") && - // ProductImportDefinition.Contraint((ExportDefinition)exportDefinition.Metadata["ProductDefinition"]) - Expression> constraint = - Expression.Lambda>( - Expression.AndAlso( - baseConstraint.Body, - Expression.AndAlso( - containsProductExpression, - productMatchExpression)), - exportDefinitionParameter); - - return constraint; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ContractNameServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ContractNameServices.cs deleted file mode 100644 index 4285722dec6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ContractNameServices.cs +++ /dev/null @@ -1,310 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Reflection; -using System.Text; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition -{ - internal static class ContractNameServices - { - const char NamespaceSeparator = '.'; - const char ArrayOpeningBracket = '['; - const char ArrayClosingBracket = ']'; - const char ArraySeparator = ','; - const char PointerSymbol = '*'; - const char ReferenceSymbol = '&'; - const char GenericArityBackQuote = '`'; - const char NestedClassSeparator = '+'; - const char ContractNameGenericOpeningBracket = '('; - const char ContractNameGenericClosingBracket = ')'; - const char ContractNameGenericArgumentSeparator = ','; - const char CustomModifiersSeparator = ' '; - - [ThreadStatic] - private static Dictionary typeIdentityCache; - - private static Dictionary TypeIdentityCache - { - get - { - return typeIdentityCache = typeIdentityCache ?? new Dictionary(); - } - } - - internal static string GetTypeIdentity(Type type) - { - Assumes.NotNull(type); - string typeIdentity = null; - - if (!TypeIdentityCache.TryGetValue(type, out typeIdentity)) - { - if (!type.IsAbstract && type.IsSubclassOf(typeof(Delegate))) - { - MethodInfo method = type.GetMethod("Invoke"); - typeIdentity = ContractNameServices.GetTypeIdentityFromMethod(method); - } - else - { - StringBuilder typeIdentityStringBuilder = new StringBuilder(); - WriteTypeWithNamespace(typeIdentityStringBuilder, type); - typeIdentity = typeIdentityStringBuilder.ToString(); - } - - TypeIdentityCache.Add(type, typeIdentity); - } - - return typeIdentity; - } - - internal static string GetTypeIdentityFromMethod(MethodInfo method) - { - StringBuilder methodNameStringBuilder = new StringBuilder(); - - WriteTypeWithNamespace(methodNameStringBuilder, method.ReturnType); - - methodNameStringBuilder.Append("("); - - ParameterInfo[] parameters = method.GetParameters(); - - for (int i = 0; i < parameters.Length; i++) - { - if (i != 0) - { - methodNameStringBuilder.Append(","); - } - - WriteTypeWithNamespace(methodNameStringBuilder, parameters[i].ParameterType); - } - methodNameStringBuilder.Append(")"); - - return methodNameStringBuilder.ToString(); - } - - private static void WriteTypeWithNamespace(StringBuilder typeName, Type type) - { - // Writes type with namesapce - if (!string.IsNullOrEmpty(type.Namespace)) - { - typeName.Append(type.Namespace); - typeName.Append(NamespaceSeparator); - } - WriteType(typeName, type); - } - - private static void WriteType(StringBuilder typeName, Type type) - { - // Writes type name - if (type.IsGenericType) - { - // - // Reflection format stores all the generic arguments (including the ones for parent types) on the leaf type. - // These arguments are placed in a queue and are written out based on generic arity (`X) of each type - // - Queue genericTypeArguments = new Queue(type.GetGenericArguments()); - WriteGenericType(typeName, type, type.IsGenericTypeDefinition, genericTypeArguments); - Assumes.IsTrue(genericTypeArguments.Count == 0, "Expecting genericTypeArguments queue to be empty."); - } - else - { - WriteNonGenericType(typeName, type); - } - } - - private static void WriteNonGenericType(StringBuilder typeName, Type type) - { - // - // Writes non-generic type - // - if (type.DeclaringType != null) - { - WriteType(typeName, type.DeclaringType); - typeName.Append(NestedClassSeparator); - } - if (type.IsArray) - { - WriteArrayType(typeName, type); - } - else if (type.IsPointer) - { - WritePointerType(typeName, type); - } - else if (type.IsByRef) - { - WriteByRefType(typeName, type); - } - else - { - typeName.Append(type.Name); - } - } - - private static void WriteArrayType(StringBuilder typeName, Type type) - { - // - // Writes array type e.g [] - // Note that jagged arrays are stored in reverse order - // e.g. C#: Int32[][,] Reflection: Int32[,][] - // we are following C# order for arrays - // - Type rootElementType = FindArrayElementType(type); - WriteType(typeName, rootElementType); - Type elementType = type; - do - { - WriteArrayTypeDimensions(typeName, elementType); - } - while ((elementType = elementType.GetElementType()) != null && elementType.IsArray); - } - - private static void WritePointerType(StringBuilder typeName, Type type) - { - // - // Writes pointer type e.g * - // - WriteType(typeName, type.GetElementType()); - typeName.Append(PointerSymbol); - } - - private static void WriteByRefType(StringBuilder typeName, Type type) - { - // - // Writes by ref type e.g & - // - WriteType(typeName, type.GetElementType()); - typeName.Append(ReferenceSymbol); - } - - private static void WriteArrayTypeDimensions(StringBuilder typeName, Type type) - { - // - // Writes array type dimensions e.g. [,,] - // - typeName.Append(ArrayOpeningBracket); - int rank = type.GetArrayRank(); - for (int i = 1; i < rank; i++) - { - typeName.Append(ArraySeparator); - } - typeName.Append(ArrayClosingBracket); - } - - private static void WriteGenericType(StringBuilder typeName, Type type, bool isDefinition, Queue genericTypeArguments) - { - // - // Writes generic type including parent generic types - // genericTypeArguments contains type arguments obtained from the most nested type - // isDefinition parameter indicates if we are dealing with generic type definition - // - if (type.DeclaringType != null) - { - if (type.DeclaringType.IsGenericType) - { - WriteGenericType(typeName, type.DeclaringType, isDefinition, genericTypeArguments); - } - else - { - WriteNonGenericType(typeName, type.DeclaringType); - } - typeName.Append(NestedClassSeparator); - } - WriteGenericTypeName(typeName, type, isDefinition, genericTypeArguments); - } - - private static void WriteGenericTypeName(StringBuilder typeName, Type type, bool isDefinition, Queue genericTypeArguments) - { - // - // Writes generic type name, e.g. generic name and generic arguments - // - Assumes.IsTrue(type.IsGenericType, "Expecting type to be a generic type"); - int genericArity = GetGenericArity(type); - string genericTypeName = FindGenericTypeName(type.GetGenericTypeDefinition().Name); - typeName.Append(genericTypeName); - WriteTypeArgumentsString(typeName, genericArity, isDefinition, genericTypeArguments); - } - - private static void WriteTypeArgumentsString(StringBuilder typeName, int argumentsCount, bool isDefinition, Queue genericTypeArguments) - { - // - // Writes type arguments in brackets, e.g. (, , ...) - // - if (argumentsCount == 0) - { - return; - } - typeName.Append(ContractNameGenericOpeningBracket); - for (int i = 0; i < argumentsCount; i++) - { - Assumes.IsTrue(genericTypeArguments.Count > 0, "Expecting genericTypeArguments to contain at least one Type"); - Type genericTypeArgument = genericTypeArguments.Dequeue(); - if (!isDefinition) - { - WriteTypeWithNamespace(typeName, genericTypeArgument); - } - typeName.Append(ContractNameGenericArgumentSeparator); - } - typeName.Remove(typeName.Length - 1, 1); - typeName.Append(ContractNameGenericClosingBracket); - } - - //internal for testability - internal static void WriteCustomModifiers(StringBuilder typeName, string customKeyword, Type[] types) - { - // - // Writes custom modifiers in the format: customKeyword(,,...) - // - typeName.Append(CustomModifiersSeparator); - typeName.Append(customKeyword); - Queue typeArguments = new Queue(types); - WriteTypeArgumentsString(typeName, types.Length, false, typeArguments); - Assumes.IsTrue(typeArguments.Count == 0, "Expecting genericTypeArguments queue to be empty."); - } - - private static Type FindArrayElementType(Type type) - { - // - // Gets array element type by calling GetElementType() until the element is not an array - // - Type elementType = type; - while ((elementType = elementType.GetElementType()) != null && elementType.IsArray) { } - return elementType; - } - - private static string FindGenericTypeName(string genericName) - { - // - // Gets generic type name omitting the backquote and arity indicator - // List`1 -> List - // Arity indicator is returned as output parameter - // - int indexOfBackQuote = genericName.IndexOf(GenericArityBackQuote); - if (indexOfBackQuote > -1) - { - genericName = genericName.Substring(0, indexOfBackQuote); - } - return genericName; - } - - private static int GetGenericArity(Type type) - { - if (type.DeclaringType == null) - { - return type.GetGenericArguments().Length; - } - - // The generic arity is equal to the difference in the number of generic arguments - // from the type and the declaring type. - - int delclaringTypeGenericArguments = type.DeclaringType.GetGenericArguments().Length; - int typeGenericArguments = type.GetGenericArguments().Length; - - Assumes.IsTrue(typeGenericArguments >= delclaringTypeGenericArguments); - - return typeGenericArguments - delclaringTypeGenericArguments; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CreationPolicy.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CreationPolicy.cs deleted file mode 100644 index 5a8d4cb158b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/CreationPolicy.cs +++ /dev/null @@ -1,36 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - /// - /// Option placed on a type that controls when the creates - /// a new instance of a . - /// - public enum CreationPolicy : int - { - /// - /// Let the choose the most appropriate - /// for the part given the current context. This is the default , with - /// the choosing by default - /// unless the or importer requests . - /// - Any = 0, - - /// - /// A single shared instance of the associated will be created - /// by the and shared by all requestors. - /// - Shared = 1, - - /// - /// A new non-shared instance of the associated will be created - /// by the for every requestor. - /// - NonShared = 2, - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/.gitattributes deleted file mode 100644 index 8ab95b78fe5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/.gitattributes +++ /dev/null @@ -1,6 +0,0 @@ -/CompositionTrace.cs -crlf -/CompositionTraceId.cs -crlf -/CompositionTraceSource.cs -crlf -/SilverlightTraceWriter.cs -crlf -/TraceSourceTraceWriter.cs -crlf -/TraceWriter.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTrace.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTrace.cs deleted file mode 100644 index ed0cb4bcc51..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTrace.cs +++ /dev/null @@ -1,106 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Diagnostics -{ - internal static class CompositionTrace - { - internal static void PartDefinitionResurrected(ComposablePartDefinition definition) - { - Assumes.NotNull(definition); - - if (CompositionTraceSource.CanWriteInformation) - { - CompositionTraceSource.WriteInformation(CompositionTraceId.Rejection_DefinitionResurrected, - Strings.CompositionTrace_Rejection_DefinitionResurrected, - definition.GetDisplayName()); - } - } - - internal static void PartDefinitionRejected(ComposablePartDefinition definition, ChangeRejectedException exception) - { - Assumes.NotNull(definition, exception); - - if (CompositionTraceSource.CanWriteWarning) - { - CompositionTraceSource.WriteWarning(CompositionTraceId.Rejection_DefinitionRejected, - Strings.CompositionTrace_Rejection_DefinitionRejected, - definition.GetDisplayName(), - exception.Message); - } - } - -#if !SILVERLIGHT - - internal static void AssemblyLoadFailed(DirectoryCatalog catalog, string fileName, Exception exception) - { - Assumes.NotNull(catalog, exception); - Assumes.NotNullOrEmpty(fileName); - - if (CompositionTraceSource.CanWriteWarning) - { - CompositionTraceSource.WriteWarning(CompositionTraceId.Discovery_AssemblyLoadFailed, - Strings.CompositionTrace_Discovery_AssemblyLoadFailed, - catalog.GetDisplayName(), - fileName, - exception.Message); - } - } - -#endif - - internal static void DefinitionMarkedWithPartNotDiscoverableAttribute(Type type) - { - Assumes.NotNull(type); - - if (CompositionTraceSource.CanWriteInformation) - { - CompositionTraceSource.WriteInformation(CompositionTraceId.Discovery_DefinitionMarkedWithPartNotDiscoverableAttribute, - Strings.CompositionTrace_Discovery_DefinitionMarkedWithPartNotDiscoverableAttribute, - type.GetDisplayName()); - } - } - - internal static void DefinitionContainsGenericsParameters(Type type) - { - Assumes.NotNull(type); - - if (CompositionTraceSource.CanWriteInformation) - { - CompositionTraceSource.WriteInformation(CompositionTraceId.Discovery_DefinitionContainsGenericParameters, - Strings.CompositionTrace_Discovery_DefinitionContainsGenericParameters, - type.GetDisplayName()); - } - } - - internal static void DefinitionContainsNoExports(Type type) - { - Assumes.NotNull(type); - - if (CompositionTraceSource.CanWriteInformation) - { - CompositionTraceSource.WriteInformation(CompositionTraceId.Discovery_DefinitionContainsNoExports, - Strings.CompositionTrace_Discovery_DefinitionContainsNoExports, - type.GetDisplayName()); - } - } - - internal static void MemberMarkedWithMultipleImportAndImportMany(ReflectionItem item) - { - Assumes.NotNull(item); - - if (CompositionTraceSource.CanWriteError) - { - CompositionTraceSource.WriteError(CompositionTraceId.Discovery_MemberMarkedWithMultipleImportAndImportMany, - Strings.CompositionTrace_Discovery_MemberMarkedWithMultipleImportAndImportMany, - item.GetDisplayName()); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTraceId.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTraceId.cs deleted file mode 100644 index 2fa8bcf45e8..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTraceId.cs +++ /dev/null @@ -1,24 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition.Diagnostics -{ - // NOTE: Do not change the trace ids of values that have already shipped, - // these leak out to TraceListerners which could take a dependency on them. - // This enum is a ushort deliberately, the maximum value of a trace id is 65535. - internal enum CompositionTraceId : ushort - { - // Rejection - - Rejection_DefinitionRejected = 1, - Rejection_DefinitionResurrected = 2, - - Discovery_AssemblyLoadFailed = 3, - Discovery_DefinitionMarkedWithPartNotDiscoverableAttribute = 4, - Discovery_DefinitionContainsGenericParameters = 5, - Discovery_DefinitionContainsNoExports = 6, - Discovery_MemberMarkedWithMultipleImportAndImportMany = 7, - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTraceSource.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTraceSource.cs deleted file mode 100644 index bf5ba23580b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/CompositionTraceSource.cs +++ /dev/null @@ -1,58 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Diagnostics -{ - internal static class CompositionTraceSource - { -#if SILVERLIGHT - private static readonly SilverlightTraceWriter Source = new SilverlightTraceWriter(); -#else - private static readonly TraceSourceTraceWriter Source = new TraceSourceTraceWriter(); -#endif - - public static bool CanWriteInformation - { - get { return Source.CanWriteInformation; } - } - - public static bool CanWriteWarning - { - get { return Source.CanWriteWarning; } - } - - public static bool CanWriteError - { - get { return Source.CanWriteError; } - } - - public static void WriteInformation(CompositionTraceId traceId, string format, params object[] arguments) - { - EnsureEnabled(CanWriteInformation); - - Source.WriteInformation(traceId, format, arguments); - } - - public static void WriteWarning(CompositionTraceId traceId, string format, params object[] arguments) - { - EnsureEnabled(CanWriteWarning); - - Source.WriteWarning(traceId, format, arguments); - } - - public static void WriteError(CompositionTraceId traceId, string format, params object[] arguments) - { - EnsureEnabled(CanWriteError); - - Source.WriteError(traceId, format, arguments); - } - - private static void EnsureEnabled(bool condition) - { - Assumes.IsTrue(condition, "To avoid unnecessary work when a trace level has not been enabled, check CanWriteXXX before calling this method."); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/SilverlightTraceWriter.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/SilverlightTraceWriter.cs deleted file mode 100644 index 11bfabd31e9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/SilverlightTraceWriter.cs +++ /dev/null @@ -1,90 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if SILVERLIGHT - -using System; -using System.Diagnostics; -using System.Globalization; -using System.Text; - -namespace System.ComponentModel.Composition.Diagnostics -{ - internal sealed class SilverlightTraceWriter : TraceWriter - { - private static readonly string SourceName = "System.ComponentModel.Composition"; - - public override bool CanWriteInformation - { - get { return false; } - } - - public override bool CanWriteWarning - { - get { return Debugger.IsLogging(); } - } - - public override bool CanWriteError - { - get { return Debugger.IsLogging(); } - } - - public override void WriteInformation(CompositionTraceId traceId, string format, params object[] arguments) - { - WriteEvent(TraceEventType.Information, traceId, format, arguments); - } - - public override void WriteWarning(CompositionTraceId traceId, string format, params object[] arguments) - { - WriteEvent(TraceEventType.Warning, traceId, format, arguments); - } - - public override void WriteError(CompositionTraceId traceId, string format, params object[] arguments) - { - WriteEvent(TraceEventType.Error, traceId, format, arguments); - } - - private static void WriteEvent(TraceEventType eventType, CompositionTraceId traceId, string format, params object[] arguments) - { - if (!Debugger.IsLogging()) - { - return; - } - - string logMessage = CreateLogMessage(eventType, traceId, format, arguments); - Debugger.Log(0, null, logMessage); - } - - internal static string CreateLogMessage(TraceEventType eventType, CompositionTraceId traceId, string format, params object[] arguments) - { - StringBuilder messageBuilder = new StringBuilder(); - - // Format taken from TraceListener.TraceEvent in full framework - messageBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0} {1}: {2} : ", - SourceName, eventType.ToString(), (int)traceId); - - if (arguments == null) - { - messageBuilder.Append(format); - } - else - { - messageBuilder.AppendFormat(CultureInfo.InvariantCulture, format, arguments); - } - - messageBuilder.AppendLine(); - - return messageBuilder.ToString(); - } - - // Copied from TraceEventType in full framework - internal enum TraceEventType - { - Error = 2, - Warning = 4, - Information = 8, - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/TraceSourceTraceWriter.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/TraceSourceTraceWriter.cs deleted file mode 100644 index b9ada437c2e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/TraceSourceTraceWriter.cs +++ /dev/null @@ -1,54 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; -using System.Diagnostics; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Diagnostics -{ - // Represents a trace writer that writes to a System.Diagnostics TraceSource - internal sealed class TraceSourceTraceWriter : TraceWriter - { - internal static readonly TraceSource Source = new TraceSource("System.ComponentModel.Composition", SourceLevels.Warning); - - public override bool CanWriteInformation - { - get { return Source.Switch.ShouldTrace(TraceEventType.Information); } - } - - public override bool CanWriteWarning - { - get { return Source.Switch.ShouldTrace(TraceEventType.Warning); } - } - - public override bool CanWriteError - { - get { return Source.Switch.ShouldTrace(TraceEventType.Error); } - } - - public override void WriteInformation(CompositionTraceId traceId, string format, params object[] arguments) - { - WriteEvent(TraceEventType.Information, traceId, format, arguments); - } - - public override void WriteWarning(CompositionTraceId traceId, string format, params object[] arguments) - { - WriteEvent(TraceEventType.Warning, traceId, format, arguments); - } - - public override void WriteError(CompositionTraceId traceId, string format, params object[] arguments) - { - WriteEvent(TraceEventType.Error, traceId, format, arguments); - } - - private static void WriteEvent(TraceEventType eventType, CompositionTraceId traceId, string format, params object[] arguments) - { - Source.TraceEvent(eventType, (int)traceId, format, arguments); - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/TraceWriter.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/TraceWriter.cs deleted file mode 100644 index da3415f677d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Diagnostics/TraceWriter.cs +++ /dev/null @@ -1,33 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- - -using System; - -namespace System.ComponentModel.Composition.Diagnostics -{ - internal abstract class TraceWriter - { - public abstract bool CanWriteInformation - { - get; - } - - public abstract bool CanWriteWarning - { - get; - } - - public abstract bool CanWriteError - { - get; - } - - public abstract void WriteInformation(CompositionTraceId traceId, string format, params object[] arguments); - - public abstract void WriteWarning(CompositionTraceId traceId, string format, params object[] arguments); - - public abstract void WriteError(CompositionTraceId traceId, string format, params object[] arguments); - } -} - diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ErrorBuilder.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ErrorBuilder.cs deleted file mode 100644 index 14ca13364e7..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ErrorBuilder.cs +++ /dev/null @@ -1,102 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition -{ - internal static class ErrorBuilder - { - public static CompositionError PreventedByExistingImport(ComposablePart part, ImportDefinition import) - { - return CompositionError.Create( - CompositionErrorId.ImportEngine_PreventedByExistingImport, - Strings.ImportEngine_PreventedByExistingImport, - import.ToElement().DisplayName, - part.ToElement().DisplayName); - } - - public static CompositionError InvalidStateForRecompposition(ComposablePart part) - { - return CompositionError.Create( - CompositionErrorId.ImportEngine_InvalidStateForRecomposition, - Strings.ImportEngine_InvalidStateForRecomposition, - part.ToElement().DisplayName); - } - - public static CompositionError ComposeTookTooManyIterations(int maximumNumberOfCompositionIterations) - { - return CompositionError.Create( - CompositionErrorId.ImportEngine_ComposeTookTooManyIterations, - Strings.ImportEngine_ComposeTookTooManyIterations, - maximumNumberOfCompositionIterations); - } - - public static CompositionError CreateImportCardinalityMismatch(ImportCardinalityMismatchException exception, ImportDefinition definition) - { - Assumes.NotNull(exception, definition); - - return CompositionError.Create( - CompositionErrorId.ImportEngine_ImportCardinalityMismatch, - exception.Message, - definition.ToElement(), - (Exception)null); - } - - public static CompositionError CreatePartCannotActivate(ComposablePart part, Exception innerException) - { - Assumes.NotNull(part, innerException); - - ICompositionElement element = part.ToElement(); - return CompositionError.Create( - CompositionErrorId.ImportEngine_PartCannotActivate, - element, - innerException, - Strings.ImportEngine_PartCannotActivate, - element.DisplayName); - } - - public static CompositionError CreatePartCannotSetImport(ComposablePart part, ImportDefinition definition, Exception innerException) - { - Assumes.NotNull(part, definition, innerException); - - ICompositionElement element = definition.ToElement(); - return CompositionError.Create( - CompositionErrorId.ImportEngine_PartCannotSetImport, - element, - innerException, - Strings.ImportEngine_PartCannotSetImport, - element.DisplayName, - part.ToElement().DisplayName); - } - - public static CompositionError CreateCannotGetExportedValue(ComposablePart part, ExportDefinition definition, Exception innerException) - { - Assumes.NotNull(part, definition, innerException); - - ICompositionElement element = definition.ToElement(); - return CompositionError.Create( - CompositionErrorId.ImportEngine_PartCannotGetExportedValue, - element, - innerException, - Strings.ImportEngine_PartCannotGetExportedValue, - element.DisplayName, - part.ToElement().DisplayName); - } - - public static CompositionError CreatePartCycle(ComposablePart part) - { - Assumes.NotNull(part); - - ICompositionElement element = part.ToElement(); - return CompositionError.Create( - CompositionErrorId.ImportEngine_PartCycle, - element, - Strings.ImportEngine_PartCycle, - element.DisplayName); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExceptionBuilder.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExceptionBuilder.cs deleted file mode 100644 index ed42b30f5df..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExceptionBuilder.cs +++ /dev/null @@ -1,78 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Globalization; -using System.Reflection; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition -{ - internal static class ExceptionBuilder - { - public static Exception CreateDiscoveryException(string messageFormat, params string[] arguments) - { - // DiscoveryError (Dev10:602872): This should go through the discovery error reporting when - // we add a way to report discovery errors properly. - return new InvalidOperationException(Format(messageFormat, arguments)); - } - - public static ArgumentException CreateContainsNullElement(string parameterName) - { - Assumes.NotNull(parameterName); - - string message = Format(Strings.Argument_NullElement, parameterName); - - return new ArgumentException(message, parameterName); - } - - public static ObjectDisposedException CreateObjectDisposed(object instance) - { - Assumes.NotNull(instance); - - return new ObjectDisposedException(instance.GetType().ToString()); - } - - public static NotImplementedException CreateNotOverriddenByDerived(string memberName) - { - Assumes.NotNullOrEmpty(memberName); - - string message = Format(Strings.NotImplemented_NotOverriddenByDerived, memberName); - - return new NotImplementedException(message); - } - - public static ArgumentException CreateExportDefinitionNotOnThisComposablePart(string parameterName) - { - Assumes.NotNullOrEmpty(parameterName); - - string message = Format(Strings.ExportDefinitionNotOnThisComposablePart, parameterName); - - return new ArgumentException(message, parameterName); - } - - public static ArgumentException CreateImportDefinitionNotOnThisComposablePart(string parameterName) - { - Assumes.NotNullOrEmpty(parameterName); - - string message = Format(Strings.ImportDefinitionNotOnThisComposablePart, parameterName); - - return new ArgumentException(message, parameterName); - } - - public static CompositionException CreateCannotGetExportedValue(ComposablePart part, ExportDefinition definition, Exception innerException) - { - Assumes.NotNull(part, definition, innerException); - - return new CompositionException( - ErrorBuilder.CreateCannotGetExportedValue(part, definition, innerException)); - } - - private static string Format(string format, params string[] arguments) - { - return String.Format(CultureInfo.CurrentCulture, format, arguments); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportAttribute.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportAttribute.cs deleted file mode 100644 index 6882f92a494..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportAttribute.cs +++ /dev/null @@ -1,144 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.Diagnostics.CodeAnalysis; - -namespace System.ComponentModel.Composition -{ - /// - /// Specifies that a type, property, field, or method provides a particular export. - /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, - AllowMultiple = true, Inherited = false)] - public class ExportAttribute : Attribute - { - /// - /// Initializes a new instance of the class, exporting the - /// type or member marked with this attribute under the default contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on the type of the - /// property or field, or the type itself, that is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public ExportAttribute() - : this((string)null, (Type)null) - { - } - - /// - /// Initializes a new instance of the class, exporting the - /// type or member marked with this attribute under a contract name derived from the - /// specified type. - /// - /// - /// A of which to derive the contract name to export the type or - /// member marked with this attribute, under; or to use the - /// default contract name. - /// - /// - /// - /// The contract name is the result of calling - /// on - /// . - /// - /// - /// The default contract name is the result of calling - /// on the type of the - /// property or field, or the type itself, that is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public ExportAttribute(Type contractType) - : this((string)null, contractType) - { - } - - /// - /// Initializes a new instance of the class, exporting the - /// type or member marked with this attribute under the specified contract name. - /// - /// - /// A containing the contract name to export the type or member - /// marked with this attribute, under; or or an empty string - /// ("") to use the default contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on the property or field - /// type, or the type itself that this is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public ExportAttribute(string contractName) - : this(contractName, (Type)null) - { - } - - /// - /// Initializes a new instance of the class, exporting the - /// type or member marked with this attribute under the specified contract name. - /// - /// - /// A containing the contract name to export the type or member - /// marked with this attribute, under; or or an empty string - /// ("") to use the default contract name. - /// - /// - /// A of which to derive the contract name to export the type or - /// member marked with this attribute, under; or to use the - /// default contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on the property or field - /// type, or the type itself that this is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public ExportAttribute(string contractName, Type contractType) - { - this.ContractName = contractName; - this.ContractType = contractType; - } - - /// - /// Gets the contract name to export the type or member under. - /// - /// - /// A containing the contract name to export the type or member - /// marked with this attribute, under. The default value is an empty string (""). - /// - public string ContractName { get; private set; } - - /// - /// Get the contract type that is exported by the member that this attribute is attached to. - /// - /// - /// A of the export that is be provided. The default value is - /// which means that the type will be obtained by looking at the type on - /// the member that this export is attached to. - /// - public Type ContractType { get; private set; } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportCardinalityCheckResult.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportCardinalityCheckResult.cs deleted file mode 100644 index 5786d48c5df..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportCardinalityCheckResult.cs +++ /dev/null @@ -1,14 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition -{ - internal enum ExportCardinalityCheckResult : int - { - Match, - NoExports, - TooManyExports - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportMetadataAttribute.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportMetadataAttribute.cs deleted file mode 100644 index 67a38cbd8f2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportMetadataAttribute.cs +++ /dev/null @@ -1,65 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition -{ - /// - /// Specifies metadata for a type, property, field, or method marked with the - /// . - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Field, - AllowMultiple = true, Inherited = false)] - public sealed class ExportMetadataAttribute : Attribute - { - /// - /// Initializes a new instance of the with the - /// specified name and metadata value. - /// - /// - /// A containing the name of the metadata value; or - /// to set the property to an empty - /// string (""). - /// - /// - /// An containing the metadata value. This can be - /// . - /// - public ExportMetadataAttribute(string name, object value) - { - this.Name = name ?? string.Empty; - this.Value = value; - } - - /// - /// Gets the name of the metadata value. - /// - /// - /// A containing the name of the metadata value. - /// - public string Name - { - get; - private set; - } - - /// - /// Gets the metadata value. - /// - /// - /// An containing the metadata value. - /// - public object Value - { - get; - private set; - } - - public bool IsMultiple - { - get; - set; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportServices.DisposableLazy.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportServices.DisposableLazy.cs deleted file mode 100644 index af8dc0ff8e6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportServices.DisposableLazy.cs +++ /dev/null @@ -1,50 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; -using System.Globalization; -using Microsoft.Internal; -using System.Collections.Generic; - -namespace System.ComponentModel.Composition -{ - partial class ExportServices - { - private sealed class DisposableLazy : Lazy, IDisposable - { - private IDisposable _disposable; - - public DisposableLazy(Func valueFactory, TMetadataView metadataView, IDisposable disposable) - : base(valueFactory, metadataView) - { - Assumes.NotNull(disposable); - - this._disposable = disposable; - } - - void IDisposable.Dispose() - { - this._disposable.Dispose(); - } - } - - private sealed class DisposableLazy : Lazy, IDisposable - { - private IDisposable _disposable; - - public DisposableLazy(Func valueFactory, IDisposable disposable) - : base(valueFactory) - { - Assumes.NotNull(disposable); - - this._disposable = disposable; - } - - void IDisposable.Dispose() - { - this._disposable.Dispose(); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportServices.cs deleted file mode 100644 index 9aa11951d59..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ExportServices.cs +++ /dev/null @@ -1,249 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition -{ - // Provides helpers for creating and dealing with Exports - internal static partial class ExportServices - { - private static readonly MethodInfo _createStronglyTypedLazyOfTM = typeof(ExportServices).GetMethod("CreateStronglyTypedLazyOfTM", BindingFlags.NonPublic | BindingFlags.Static); - private static readonly MethodInfo _createStronglyTypedLazyOfT = typeof(ExportServices).GetMethod("CreateStronglyTypedLazyOfT", BindingFlags.NonPublic | BindingFlags.Static); - private static readonly MethodInfo _createSemiStronglyTypedLazy = typeof(ExportServices).GetMethod("CreateSemiStronglyTypedLazy", BindingFlags.NonPublic | BindingFlags.Static); - private static readonly MethodInfo _createStronglyTypedExportFactoryOfT = typeof(ExportServices).GetMethod("CreateStronglyTypedExportFactoryOfT", BindingFlags.NonPublic | BindingFlags.Static); - private static readonly MethodInfo _createStronglyTypedExportFactoryOfTM = typeof(ExportServices).GetMethod("CreateStronglyTypedExportFactoryOfTM", BindingFlags.NonPublic | BindingFlags.Static); - - internal static readonly Type DefaultMetadataViewType = typeof(IDictionary); - internal static readonly Type DefaultExportedValueType = typeof(object); - - internal static bool IsDefaultMetadataViewType(Type metadataViewType) - { - Assumes.NotNull(metadataViewType); - - // Consider all types that IDictionary derives from, such - // as ICollection>, IEnumerable> - // and IEnumerable, as default metadata view - return metadataViewType.IsAssignableFrom(DefaultMetadataViewType); - } - - internal static bool IsDictionaryConstructorViewType(Type metadataViewType) - { - Assumes.NotNull(metadataViewType); - - // Does the view type have a constructor that is a Dictionary - return metadataViewType.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, - Type.DefaultBinder, - new Type[] { typeof(IDictionary) }, - new ParameterModifier[0]) != null; - } - - internal static Func CreateStronglyTypedLazyFactory(Type exportType, Type metadataViewType) - { - MethodInfo genericMethod = null; - if (metadataViewType != null) - { - genericMethod = _createStronglyTypedLazyOfTM.MakeGenericMethod(exportType ?? ExportServices.DefaultExportedValueType, metadataViewType); - } - else - { - genericMethod = _createStronglyTypedLazyOfT.MakeGenericMethod(exportType ?? ExportServices.DefaultExportedValueType); - } - Assumes.NotNull(genericMethod); - return (Func)Delegate.CreateDelegate(typeof(Func), genericMethod); - } - - internal static Func> CreateSemiStronglyTypedLazyFactory(Type exportType, Type metadataViewType) - { - MethodInfo genericMethod = _createSemiStronglyTypedLazy.MakeGenericMethod( - exportType ?? ExportServices.DefaultExportedValueType, - metadataViewType ?? ExportServices.DefaultMetadataViewType); - Assumes.NotNull(genericMethod); - return (Func>)Delegate.CreateDelegate(typeof(Func>), genericMethod); - } - - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] - internal static Lazy CreateStronglyTypedLazyOfTM(Export export) - { - IDisposable disposable = export as IDisposable; - if (disposable != null) - { - return new DisposableLazy( - () => ExportServices.GetCastedExportedValue(export), - AttributedModelServices.GetMetadataView(export.Metadata), - disposable); - } - else - { - return new Lazy( - () => ExportServices.GetCastedExportedValue(export), - AttributedModelServices.GetMetadataView(export.Metadata), - false); - } - } - - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] - internal static Lazy CreateStronglyTypedLazyOfT(Export export) - { - IDisposable disposable = export as IDisposable; - if (disposable != null) - { - return new DisposableLazy( - () => ExportServices.GetCastedExportedValue(export), - disposable); - } - else - { - return new Lazy(() => ExportServices.GetCastedExportedValue(export), false); - - } - } - - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] - internal static Lazy CreateSemiStronglyTypedLazy(Export export) - { - IDisposable disposable = export as IDisposable; - if (disposable != null) - { - return new DisposableLazy( - () => ExportServices.GetCastedExportedValue(export), - AttributedModelServices.GetMetadataView(export.Metadata), - disposable); - } - else - { - return new Lazy( - () => ExportServices.GetCastedExportedValue(export), - AttributedModelServices.GetMetadataView(export.Metadata), - false - ); - } - } - - internal static Func CreateStronglyTypedExportFactoryFactory(Type exportType, Type metadataType, ConstructorInfo constructor) - { - MethodInfo genericMethod = null; - if (metadataType == null) - { - genericMethod = _createStronglyTypedExportFactoryOfT.MakeGenericMethod(exportType); - } - else - { - genericMethod = _createStronglyTypedExportFactoryOfTM.MakeGenericMethod(exportType, metadataType); - } - - Assumes.NotNull(genericMethod); - Func exportFactoryFactory = (Func)Delegate.CreateDelegate(typeof(Func), genericMethod); - return (e) => exportFactoryFactory.Invoke(e, constructor); - } - - private static Tuple GetExportLifetimeContextFromExport(Export export) - { - T exportedValue; - Action disposeAction; - IDisposable disposable = null; - - CatalogExportProvider.PartCreatorExport partCreatorExport = export as CatalogExportProvider.PartCreatorExport; - - if (partCreatorExport != null) - { - // PartCreatorExport is the more optimized route - Export exportProduct = partCreatorExport.CreateExportProduct(); - exportedValue = GetCastedExportedValue(exportProduct); - disposable = exportProduct as IDisposable; - } - else - { - // If it comes from somewhere else we walk through the ComposablePartDefinition - var factoryPartDefinition = GetCastedExportedValue(export); - var part = factoryPartDefinition.CreatePart(); - var exportDef = factoryPartDefinition.ExportDefinitions.Single(); - - exportedValue = CastExportedValue(part.ToElement(), part.GetExportedValue(exportDef)); - disposable = part as IDisposable; - } - - if (disposable != null) - { - disposeAction = () => disposable.Dispose(); - } - else - { - disposeAction = () => { }; - } - - return new Tuple(exportedValue, disposeAction); - } - - private static object CreateStronglyTypedExportFactoryOfT(Export export, ConstructorInfo constructor) - { - Func> exportLifetimeContextCreator = () => ExportServices.GetExportLifetimeContextFromExport(export); - return constructor.Invoke(new object[] { exportLifetimeContextCreator }); - } - - private static object CreateStronglyTypedExportFactoryOfTM(Export export, ConstructorInfo constructor) - { - Func> exportLifetimeContextCreator = () => ExportServices.GetExportLifetimeContextFromExport(export); - return constructor.Invoke(new object[] { exportLifetimeContextCreator, AttributedModelServices.GetMetadataView(export.Metadata) }); - } - - internal static T GetCastedExportedValue(Export export) - { - return CastExportedValue(export.ToElement(), export.Value); - } - - internal static T CastExportedValue(ICompositionElement element, object exportedValue) - { - object typedExportedValue = null; - - bool succeeded = ContractServices.TryCast(typeof(T), exportedValue, out typedExportedValue); - if (!succeeded) - { - throw new CompositionContractMismatchException(string.Format(CultureInfo.CurrentCulture, - Strings.ContractMismatch_ExportedValueCannotBeCastToT, - element.DisplayName, - typeof(T))); - } - - return (T)typedExportedValue; - } - - internal static ExportCardinalityCheckResult CheckCardinality(ImportDefinition definition, IEnumerable exports) - { - EnumerableCardinality actualCardinality = exports.GetCardinality(); - - switch (actualCardinality) - { - case EnumerableCardinality.Zero: - if (definition.Cardinality == ImportCardinality.ExactlyOne) - { - return ExportCardinalityCheckResult.NoExports; - } - break; - - case EnumerableCardinality.TwoOrMore: - if (definition.Cardinality.IsAtMostOne()) - { - return ExportCardinalityCheckResult.TooManyExports; - } - break; - - default: - Assumes.IsTrue(actualCardinality == EnumerableCardinality.One); - break; - - } - - return ExportCardinalityCheckResult.Match; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/.gitattributes deleted file mode 100644 index 3fab40e5ea1..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/.gitattributes +++ /dev/null @@ -1,30 +0,0 @@ -/AggregateCatalog.cs -crlf -/AggregateExportProvider.cs -crlf -/AssemblyCatalog.cs -crlf -/AssemblyCatalogDebuggerProxy.cs -crlf -/AtomicComposition.cs -crlf -/AtomicCompositionExtensions.cs -crlf -/CatalogExportProvider.CatalogChangeProxy.cs -crlf -/CatalogExportProvider.CatalogExport.cs -crlf -/CatalogExportProvider.PartCreatorExport.cs -crlf -/CatalogExportProvider.cs -crlf -/ComposablePartCatalogChangeEventArgs.cs -crlf -/ComposablePartCatalogCollection.cs -crlf -/ComposablePartExportProvider.cs -crlf -/CompositionBatch.SingleExportComposablePart.cs -crlf -/CompositionBatch.cs -crlf -/CompositionConstants.cs -crlf -/CompositionContainer.cs -crlf -/CompositionLock.cs -crlf -/CompositionServices.cs -crlf -/DirectoryCatalog.DirectoryCatalogDebuggerProxy.cs -crlf -/DirectoryCatalog.cs -crlf -/ExportProvider.GetExportOverrides.cs -crlf -/ExportProvider.cs -crlf -/ExportsChangeEventArgs.cs -crlf -/INotifyComposablePartCatalogChanged.cs -crlf -/ImportEngine.EngineContext.cs -crlf -/ImportEngine.PartManager.cs -crlf -/ImportEngine.RecompositionManager.cs -crlf -/ImportEngine.cs -crlf -/TypeCatalog.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AggregateCatalog.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AggregateCatalog.cs deleted file mode 100644 index aba950333da..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AggregateCatalog.cs +++ /dev/null @@ -1,230 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Globalization; -using System.Linq; -using System.Linq.Expressions; -using System.Threading; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Hosting -{ - /// - /// A mutable collection of s. - /// - /// - /// This type is thread safe. - /// - public class AggregateCatalog : ComposablePartCatalog, INotifyComposablePartCatalogChanged - { - private ComposablePartCatalogCollection _catalogs = null; - private volatile int _isDisposed = 0; - private IQueryable _partsQuery; - - /// - /// Initializes a new instance of the class. - /// - public AggregateCatalog() - : this((IEnumerable)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified catalogs. - /// - /// - /// An of objects to add to the - /// . - /// - /// - /// is . - /// - /// - /// contains an element that is . - /// - public AggregateCatalog(params ComposablePartCatalog[] catalogs) - : this((IEnumerable)catalogs) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified catalogs. - /// - /// - /// An of objects to add - /// to the ; or to - /// create an that is empty. - /// - /// - /// contains an element that is . - /// - public AggregateCatalog(IEnumerable catalogs) - { - Requires.NullOrNotNullElements(catalogs, "catalogs"); - - this._catalogs = new ComposablePartCatalogCollection(catalogs, this.OnChanged, this.OnChanging); - this._partsQuery = this._catalogs.AsQueryable().SelectMany(catalog => catalog.Parts); - } - - /// - /// Notify when the contents of the Catalog has changed. - /// - public event EventHandler Changed - { - add - { - this._catalogs.Changed += value; - } - remove - { - this._catalogs.Changed -= value; - } - } - - /// - /// Notify when the contents of the Catalog has changing. - /// - public event EventHandler Changing - { - add - { - this._catalogs.Changing += value; - } - remove - { - this._catalogs.Changing -= value; - } - } - - /// - /// Gets the part definitions of the catalog. - /// - /// - /// A of objects of the - /// . - /// - /// - /// The has been disposed of. - /// - public override IQueryable Parts - { - get - { - this.ThrowIfDisposed(); - return this._partsQuery; - } - } - - /// - /// Returns the export definitions that match the constraint defined by the specified definition. - /// - /// - /// The that defines the conditions of the - /// objects to return. - /// - /// - /// An of containing the - /// objects and their associated - /// for objects that match the constraint defined - /// by . - /// - /// - /// is . - /// - /// - /// The has been disposed of. - /// - public override IEnumerable> GetExports(ImportDefinition definition) - { - this.ThrowIfDisposed(); - - Requires.NotNull(definition, "definition"); - - // delegate the query to each catalog and merge the results. - var exports = new List>(); - foreach (var catalog in this._catalogs) - { - foreach (var export in catalog.GetExports(definition)) - { - exports.Add(export); - } - } - return exports; - } - - /// - /// Gets the underlying catalogs of the catalog. - /// - /// - /// An of underlying objects - /// of the . - /// - /// - /// The has been disposed of. - /// - public ICollection Catalogs - { - get - { - this.ThrowIfDisposed(); - return this._catalogs; - } - } - - protected override void Dispose(bool disposing) - { - try - { - if (disposing) - { - // NOTE : According to http://msdn.microsoft.com/en-us/library/4bw5ewxy.aspx, the warning is bogus when used with Interlocked API. -#pragma warning disable 420 - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) -#pragma warning restore 420 - { - this._catalogs.Dispose(); - } - } - } - finally - { - base.Dispose(disposing); - } - } - - /// - /// Raises the event. - /// - /// - /// An containing the data for the event. - /// - protected virtual void OnChanged(ComposablePartCatalogChangeEventArgs e) - { - this._catalogs.OnChanged(this, e); - } - - /// - /// Raises the event. - /// - /// - /// An containing the data for the event. - /// - protected virtual void OnChanging(ComposablePartCatalogChangeEventArgs e) - { - this._catalogs.OnChanging(this, e); - } - - private void ThrowIfDisposed() - { - if (this._isDisposed == 1) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AggregateExportProvider.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AggregateExportProvider.cs deleted file mode 100644 index 62bfe70ce79..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AggregateExportProvider.cs +++ /dev/null @@ -1,219 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using Microsoft.Internal; -using Microsoft.Internal.Collections; -using System.Threading; - -namespace System.ComponentModel.Composition.Hosting -{ - public class AggregateExportProvider : ExportProvider , IDisposable - { - private ReadOnlyCollection _providers; - private volatile int _isDisposed = 0; - - /// - /// Initializes a new instance of the class. - /// - /// The prioritized list of export providers. - /// - /// - /// The will consult the providers in the order they have been specfied when - /// executing . - /// - /// - /// The does not take ownership of the specified providers. - /// That is, it will not try to dispose of any of them when it gets disposed. - /// - /// - public AggregateExportProvider(params ExportProvider[] providers) - : this(providers.AsEnumerable()) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The prioritized list of export providers. The providers are consulted in order in which they are supplied. - /// - /// - /// The will consult the providers in the order they have been specfied when - /// executing . - /// - /// - /// The does not take ownership of the specified providers. - /// That is, it will not try to dispose of any of them when it gets disposed. - /// - /// - public AggregateExportProvider(IEnumerable providers) - { - List providerList = new List(); - - if (providers != null) - { - // we are in the constructor, so there's no need to lock anything - foreach (var provider in providers) - { - if (provider == null) - { - throw ExceptionBuilder.CreateContainsNullElement("providers"); - } - - providerList.Add(provider); - - provider.ExportsChanged += this.OnExportChangedInternal; - provider.ExportsChanging += this.OnExportChangingInternal; - } - } - - // this will always fully copy the array - this._providers = new ReadOnlyCollection(providerList); - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases unmanaged and - optionally - managed resources - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // NOTE : According to http://msdn.microsoft.com/en-us/library/4bw5ewxy.aspx, the warning is bogus when used with Interlocked API. -#pragma warning disable 420 - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) -#pragma warning restore 420 - { - this._providers.ForEach(provider => - { - provider.ExportsChanged -= this.OnExportChangedInternal; - provider.ExportsChanging -= this.OnExportChangingInternal; - }); - } - } - } - - /// - /// Gets the export providers which the aggregate export provider aggregates. - /// - /// - /// A of objects - /// which the aggregates. - /// - /// - /// The has been disposed of. - /// - public ReadOnlyCollection Providers - { - get - { - this.ThrowIfDisposed(); - - return this._providers; - } - } - - /// - /// Returns all exports that match the conditions of the specified import. - /// - /// The that defines the conditions of the - /// to get. - /// - /// - /// An of objects that match - /// the conditions defined by , if found; otherwise, an - /// empty . - /// - /// - /// - /// The implementers should not treat the cardinality-related mismatches as errors, and are not - /// expected to throw exceptions in those cases. - /// For instance, if the import requests exactly one export and the provider has no matching exports or more than one, - /// it should return an empty of . - /// - /// - protected override IEnumerable GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) - { - this.ThrowIfDisposed(); - - if (definition.Cardinality == ImportCardinality.ZeroOrMore) - { - var exports = new List(); - foreach (var provider in this._providers) - { - foreach (var export in provider.GetExports(definition, atomicComposition)) - { - exports.Add(export); - } - } - return exports; - } - else - { - IEnumerable allExports = Enumerable.Empty(); - - // if asked for "one or less", the prioriry is at play - the first provider that agrees to return the value - // which best complies with the request, wins. - foreach (ExportProvider provider in this._providers) - { - IEnumerable exports; - bool cardinalityCheckResult = provider.TryGetExports(definition, atomicComposition, out exports); - bool anyExports = exports.FastAny(); - if (cardinalityCheckResult && anyExports) - { - // NOTE : if the provider returned nothing, we need to proceed, even if it indicated that the - // cardinality is correct - when asked for "one or less", the provider might - correctly - - // return an empty sequence, but we shouldn't be satisfied with that as providers down the list - // might have a value we are interested in. - return exports; - } - else - { - // TODO - // This is a sneaky thing that we do - if in the end no provider returns the exports with the right cardinality - // we simply return the aggregation of all exports they have restuned. This way the end result is still not waht we want - // but no information is lost. - // WE SHOULD fix this behavior, but this is ONLY possible if we can treat many exports as no exports for the sake of singles - if (anyExports) - { - allExports = allExports.Concat(exports); - } - } - } - - return allExports; - } - } - - private void OnExportChangedInternal(object sender, ExportsChangeEventArgs e) - { - this.OnExportsChanged(e); - } - - private void OnExportChangingInternal(object sender, ExportsChangeEventArgs e) - { - this.OnExportsChanging(e); - } - - private void ThrowIfDisposed() - { - if (this._isDisposed == 1) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs deleted file mode 100644 index b1e079b0746..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs +++ /dev/null @@ -1,301 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Security; -using System.Threading; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Hosting -{ - /// - /// An immutable ComposablePartCatalog created from a managed code assembly. - /// - /// - /// This type is thread safe. - /// - [DebuggerTypeProxy(typeof(AssemblyCatalogDebuggerProxy))] - public class AssemblyCatalog : ComposablePartCatalog, ICompositionElement - { - private readonly object _thisLock = new object(); - private readonly ICompositionElement _definitionOrigin; - private volatile Assembly _assembly = null; - private volatile TypeCatalog _innerCatalog = null; - private int _isDisposed = 0; - -#if !SILVERLIGHT - - /// - /// Initializes a new instance of the class - /// with the specified code base. - /// - /// - /// A containing the code base of the assembly containing the - /// attributed objects to add to the . - /// - /// - /// is . - /// - /// - /// is a zero-length string, contains only white space, - /// or contains one or more invalid characters as defined by . - /// - /// - /// The specified path, file name, or both exceed the system-defined maximum length. - /// - /// - /// The caller does not have path discovery permission. - /// - /// - /// is not found. - /// - /// - /// could not be loaded. - /// - /// -or- - /// - /// specified a directory. - /// - /// - /// is not a valid assembly - /// -or- - /// Version 2.0 or later of the common language runtime is currently loaded - /// and was compiled with a later version. - /// - /// - /// The assembly referenced by is loaded into the Load context. - /// - public AssemblyCatalog(string codeBase) - : this(codeBase, (ICompositionElement)null) - { - } - - internal AssemblyCatalog(string codeBase, ICompositionElement definitionOrigin) - : this(LoadAssembly(codeBase), definitionOrigin) - { - } - -#endif - - /// - /// Initializes a new instance of the class - /// with the specified assembly. - /// - /// - /// The containing the attributed objects to - /// add to the . - /// - /// - /// is . - /// - /// -or- - /// - /// was loaded in the reflection-only context. - /// - public AssemblyCatalog(Assembly assembly) - : this(assembly, (ICompositionElement)null) - { - } - - internal AssemblyCatalog(Assembly assembly, ICompositionElement definitionOrigin) - { - Requires.NotNull(assembly, "assembly"); - -#if !SILVERLIGHT - if (assembly.ReflectionOnly) - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.Argument_AssemblyReflectionOnly, "assembly"), "assembly"); - } -#endif - this._assembly = assembly; - this._definitionOrigin = definitionOrigin ?? this; - } - - /// - /// Gets the part definitions of the assembly catalog. - /// - /// - /// A of objects of the - /// . - /// - /// - /// The has been disposed of. - /// - public override IQueryable Parts - { - get - { - return this.InnerCatalog.Parts; - } - } - - /// - /// Returns the export definitions that match the constraint defined by the specified definition. - /// - /// - /// The that defines the conditions of the - /// objects to return. - /// - /// - /// An of containing the - /// objects and their associated - /// for objects that match the constraint defined - /// by . - /// - /// - /// is . - /// - /// - /// The has been disposed of. - /// - /// - /// - /// Overriders of this property should never return , if no - /// match the conditions defined by - /// , return an empty . - /// - /// - public override IEnumerable> GetExports(ImportDefinition definition) - { - return this.InnerCatalog.GetExports(definition); - } - - private TypeCatalog InnerCatalog - { - get - { - this.ThrowIfDisposed(); - - if (this._innerCatalog == null) - { - lock (this._thisLock) - { - if (this._innerCatalog == null) - { - var catalog = new TypeCatalog(this._assembly.GetTypes(), _definitionOrigin); - this._innerCatalog = catalog; - } - } - } - return this._innerCatalog; - } - } - - /// - /// Gets the assembly containing the attributed types contained within the assembly - /// catalog. - /// - /// - /// The containing the attributed objects - /// contained within the . - /// - public Assembly Assembly - { - get { return this._assembly; } - } - - /// - /// Gets the display name of the assembly catalog. - /// - /// - /// A containing a human-readable display name of the . - /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - string ICompositionElement.DisplayName - { - get { return this.GetDisplayName(); } - } - - /// - /// Gets the composition element from which the assembly catalog originated. - /// - /// - /// This property always returns . - /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ICompositionElement ICompositionElement.Origin - { - get { return null; } - } - - - /// - /// Returns a string representation of the assembly catalog. - /// - /// - /// A containing the string representation of the . - /// - public override string ToString() - { - return this.GetDisplayName(); - } - - protected override void Dispose(bool disposing) - { - try - { - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) - { - if (disposing) - { - if (this._innerCatalog != null) - { - this._innerCatalog.Dispose(); - } - } - } - } - finally - { - base.Dispose(disposing); - } - } - - private void ThrowIfDisposed() - { - if (this._isDisposed == 1) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - - private string GetDisplayName() - { - return string.Format(CultureInfo.CurrentCulture, - "{0} (Assembly=\"{1}\")", // NOLOC - GetType().Name, - this.Assembly.FullName); - } - -#if !SILVERLIGHT - - private static Assembly LoadAssembly(string codeBase) - { - Requires.NotNullOrEmpty(codeBase, "codeBase"); - - AssemblyName assemblyName; - - try - { - assemblyName = AssemblyName.GetAssemblyName(codeBase); - } - catch (ArgumentException) - { - assemblyName = new AssemblyName(); - assemblyName.CodeBase = codeBase; - } - - return Assembly.Load(assemblyName); - } -#endif - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxy.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxy.cs deleted file mode 100644 index 86aa5fad768..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxy.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using System.Linq; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.Hosting -{ - internal class AssemblyCatalogDebuggerProxy - { - private readonly AssemblyCatalog _catalog; - - public AssemblyCatalogDebuggerProxy(AssemblyCatalog catalog) - { - Requires.NotNull(catalog, "catalog"); - - this._catalog = catalog; - } - - public Assembly Assembly - { - get { return this._catalog.Assembly; } - } - - public ReadOnlyCollection Parts - { - // NOTE: This shouldn't be cached, so that on every query of - // the current value of the underlying catalog is respected. - // We use ReadOnlyCollection as arrays do not have the - // appropriate debugger display attributes applied to them. - get { return this._catalog.Parts.ToReadOnlyCollection(); } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AtomicComposition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AtomicComposition.cs deleted file mode 100644 index 4c027f73d3d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AtomicComposition.cs +++ /dev/null @@ -1,305 +0,0 @@ -using System; -using System.Diagnostics; -using System.Collections.Generic; -using Microsoft.Internal; -using System.Diagnostics.CodeAnalysis; - -namespace System.ComponentModel.Composition.Hosting -{ - /// - /// AtomicComposition provides lightweight atomicCompositional semantics to enable temporary - /// state to be managed for a series of nested atomicCompositions. Each atomicComposition maintains - /// queryable state along with a sequence of actions necessary to complete the state when - /// the atomicComposition is no longer in danger of being rolled back. State is completed or - /// rolled back when the atomicComposition is disposed, depending on the state of the - /// CompleteOnDipose property which defaults to false. The using(...) pattern in C# is a - /// convenient mechanism for defining atomicComposition scopes. - /// - /// The least obvious aspects of AtomicComposition deal with nesting. - /// - /// Firstly, no complete actions are actually performed until the outermost atomicComposition is - /// completed. Completeting or rolling back nested atomicCompositions serves only to change which - /// actions would be completed the outer atomicComposition. - /// - /// Secondly, state is added in the form of queries associated with an object key. The - /// key represents a unique object the state is being held on behalf of. The quieries are - /// accessed throught the Query methods which provide automatic chaining to execute queries - /// across the target atomicComposition and its inner atomicComposition as appropriate. - /// - /// Lastly, when a nested atomicComposition is created for a given outer the outer atomicComposition is locked. - /// It remains locked until the inner atomicComposition is disposed or completeed preventing the addition of - /// state, actions or other inner atomicCompositions. - /// - public class AtomicComposition : IDisposable - { - private readonly AtomicComposition _outerAtomicComposition; - private KeyValuePair[] _values; - private int _valueCount = 0; - private List _completeActionList; - private List _revertActionList; - private bool _isDisposed = false; - private bool _isCompleted = false; - private bool _containsInnerAtomicComposition = false; - - public AtomicComposition() - : this(null) - { - } - - public AtomicComposition(AtomicComposition outerAtomicComposition) - { - // Lock the inner atomicComposition so that we can assume nothing changes except on - // the innermost scope, and thereby optimize the query path - if (outerAtomicComposition != null) - { - this._outerAtomicComposition = outerAtomicComposition; - this._outerAtomicComposition.ContainsInnerAtomicComposition = true; - } - } - - public void SetValue(object key, object value) - { - ThrowIfDisposed(); - ThrowIfCompleteed(); - ThrowIfContainsInnerAtomicComposition(); - - Requires.NotNull(key, "key"); - - SetValueInternal(key, value); - } - - public bool TryGetValue(object key, out T value) - { - return TryGetValue(key, false, out value); - } - - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")] - public bool TryGetValue(object key, bool localAtomicCompositionOnly, out T value) - { - ThrowIfDisposed(); - ThrowIfCompleteed(); - - Requires.NotNull(key, "key"); - - return TryGetValueInternal(key, localAtomicCompositionOnly, out value); - } - - public void AddCompleteAction(Action completeAction) - { - ThrowIfDisposed(); - ThrowIfCompleteed(); - ThrowIfContainsInnerAtomicComposition(); - - Requires.NotNull(completeAction, "completeAction"); - - if (this._completeActionList == null) - { - this._completeActionList = new List(); - } - this._completeActionList.Add(completeAction); - } - - public void AddRevertAction(Action revertAction) - { - ThrowIfDisposed(); - ThrowIfCompleteed(); - ThrowIfContainsInnerAtomicComposition(); - - Requires.NotNull(revertAction, "revertAction"); - - if (this._revertActionList == null) - { - this._revertActionList = new List(); - } - this._revertActionList.Add(revertAction); - } - - public void Complete() - { - ThrowIfDisposed(); - ThrowIfCompleteed(); - - if (this._outerAtomicComposition == null) - { // Execute all the complete actions - FinalComplete(); - } - else - { // Copy the actions and state to the outer atomicComposition - CopyComplete(); - } - - this._isCompleted = true; - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - ThrowIfDisposed(); - this._isDisposed = true; - - if (this._outerAtomicComposition != null) - { - this._outerAtomicComposition.ContainsInnerAtomicComposition = false; - } - - // Revert is always immediate and involves forgetting information and - // exceuting any appropriate revert actions - if (!this._isCompleted) - { - if (this._revertActionList != null) - { - // Execute the revert actions in reverse order to ensure - // everything incrementally rollsback its state. - for (int i = this._revertActionList.Count - 1; i >= 0; i--) - { - Action action = this._revertActionList[i]; - action(); - } - this._revertActionList = null; - } - } - } - - private void FinalComplete() - { - // Completeting the outer most scope is easy, just execute all the actions - if (this._completeActionList != null) - { - foreach (Action action in this._completeActionList) - { - action(); - } - this._completeActionList = null; - } - } - - private void CopyComplete() - { - Assumes.NotNull(this._outerAtomicComposition); - - this._outerAtomicComposition.ContainsInnerAtomicComposition = false; - - // Inner scopes are much odder, because completeting them means coalescing them into the - // outer scope - the complete or revert actions are deferred until the outermost scope completes - // or any intermediate rolls back - if (this._completeActionList != null) - { - foreach (Action action in this._completeActionList) - { - this._outerAtomicComposition.AddCompleteAction(action); - } - } - - if (this._revertActionList != null) - { - foreach (Action action in this._revertActionList) - { - this._outerAtomicComposition.AddRevertAction(action); - } - } - - // We can copy over existing atomicComposition entries because they're either already chained or - // overwrite by design and can now be completed or rolled back together - for (var index = 0; index < this._valueCount; index++) - { - this._outerAtomicComposition.SetValueInternal( - this._values[index].Key, this._values[index].Value); - } - } - - private bool ContainsInnerAtomicComposition - { - set - { - if (value == true && this._containsInnerAtomicComposition == true) - { - throw new InvalidOperationException(Strings.AtomicComposition_AlreadyNested); - } - this._containsInnerAtomicComposition = value; - } - } - - private bool TryGetValueInternal(object key, bool localAtomicCompositionOnly, out T value) - { - for (var index = 0; index < this._valueCount; index++) - { - if (this._values[index].Key == key) - { - value = (T)this._values[index].Value; - return true; - } - } - - // If there's no atomicComposition available then recurse until we hit the outermost - // scope, where upon we go ahead and return null - if (!localAtomicCompositionOnly && this._outerAtomicComposition != null) - { - return this._outerAtomicComposition.TryGetValueInternal(key, localAtomicCompositionOnly, out value); - } - - value = default(T); - return false; - } - - private void SetValueInternal(object key, object value) - { - // Handle overwrites quickly - for (var index = 0; index < this._valueCount; index++) - { - if (this._values[index].Key == key) - { - this._values[index] = new KeyValuePair(key, value); - return; - } - } - - // Expand storage when needed - if (this._values == null || this._valueCount == this._values.Length) - { - var newQueries = new KeyValuePair[this._valueCount == 0 ? 5 : this._valueCount * 2]; - if (this._values != null) - { - Array.Copy(this._values, newQueries, this._valueCount); - } - this._values = newQueries; - } - - // Store a new entry - this._values[_valueCount] = new KeyValuePair(key, value); - this._valueCount++; - return; - } - - [DebuggerStepThrough] - private void ThrowIfContainsInnerAtomicComposition() - { - if (this._containsInnerAtomicComposition) - { - throw new InvalidOperationException(Strings.AtomicComposition_PartOfAnotherAtomicComposition); - } - } - - [DebuggerStepThrough] - private void ThrowIfCompleteed() - { - if (this._isCompleted) - { - throw new InvalidOperationException(Strings.AtomicComposition_AlreadyCompleted); - } - } - - [DebuggerStepThrough] - private void ThrowIfDisposed() - { - if (this._isDisposed) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AtomicCompositionExtensions.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AtomicCompositionExtensions.cs deleted file mode 100644 index 5756a0f9fab..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AtomicCompositionExtensions.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Diagnostics; -using System.Collections.Generic; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Hosting -{ - internal static class AtomicCompositionExtensions - { - internal static T GetValueAllowNull(this AtomicComposition atomicComposition, T defaultResultAndKey) where T : class - { - Assumes.NotNull(defaultResultAndKey); - - return GetValueAllowNull(atomicComposition, defaultResultAndKey, defaultResultAndKey); - } - - internal static T GetValueAllowNull(this AtomicComposition atomicComposition, object key, T defaultResult) - { - T result; - if (atomicComposition != null && atomicComposition.TryGetValue(key, out result)) - { - return result; - } - - return defaultResult; - } - - internal static void AddRevertActionAllowNull(this AtomicComposition atomicComposition, Action action) - { - Assumes.NotNull(action); - - if (atomicComposition == null) - { - action(); - } - else - { - atomicComposition.AddRevertAction(action); - } - } - - internal static void AddCompleteActionAllowNull(this AtomicComposition atomicComposition, Action action) - { - Assumes.NotNull(action); - - if (atomicComposition == null) - { - action(); - } - else - { - atomicComposition.AddCompleteAction(action); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogChangeProxy.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogChangeProxy.cs deleted file mode 100644 index d78db6d055b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogChangeProxy.cs +++ /dev/null @@ -1,67 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Threading; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.Hosting -{ - public partial class CatalogExportProvider : ExportProvider, IDisposable - { - private class CatalogChangeProxy : ComposablePartCatalog - { - private ComposablePartCatalog _originalCatalog; - private List _addedParts; - private HashSet _removedParts; - - public CatalogChangeProxy(ComposablePartCatalog originalCatalog, - IEnumerable addedParts, - IEnumerable removedParts) - { - this._originalCatalog = originalCatalog; - this._addedParts = new List(addedParts); - this._removedParts = new HashSet(removedParts); - } - - public override IQueryable Parts - { - get - { - return this._originalCatalog.Parts.Concat(this._addedParts).Except(this._removedParts); - } - } - - public override IEnumerable> GetExports( - ImportDefinition definition) - { - Requires.NotNull(definition, "definition"); - - var originalExports = this._originalCatalog.GetExports(definition); - var trimmedExports = originalExports.Where(partAndExport => - !this._removedParts.Contains(partAndExport.Item1)); - - var addedExports = new List>(); - foreach (var part in this._addedParts) - { - foreach (var export in part.ExportDefinitions) - { - if (definition.IsConstraintSatisfiedBy(export)) - { - addedExports.Add(new Tuple(part, export)); - } - } - } - return trimmedExports.Concat(addedExports); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs deleted file mode 100644 index 0741cf3f4f5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs +++ /dev/null @@ -1,132 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics.CodeAnalysis; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Hosting -{ - public partial class CatalogExportProvider - { - private class CatalogExport : Export - { - protected readonly CatalogExportProvider _catalogExportProvider; - protected readonly ComposablePartDefinition _partDefinition; - protected readonly ExportDefinition _definition; - protected ComposablePart _part; - - public CatalogExport(CatalogExportProvider catalogExportProvider, - ComposablePartDefinition partDefinition, ExportDefinition definition) - { - this._catalogExportProvider = catalogExportProvider; - this._partDefinition = partDefinition; - this._definition = definition; - } - - public override ExportDefinition Definition - { - get - { - return this._definition; - } - } - - protected virtual bool IsSharedPart - { - get - { - return true; - } - } - - protected override object GetExportedValueCore() - { - ComposablePart part = this._catalogExportProvider.GetComposablePart(this._partDefinition, this.IsSharedPart); - object exportedValue = this._catalogExportProvider.GetExportedValue(part, this._definition, this.IsSharedPart); - this._part = part; - - return exportedValue; - } - - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] - public static CatalogExport CreateExport(CatalogExportProvider catalogExportProvider, - ComposablePartDefinition partDefinition, ExportDefinition definition, CreationPolicy importCreationPolicy) - { - CreationPolicy partPolicy = partDefinition.Metadata.GetValue(CompositionConstants.PartCreationPolicyMetadataName); - bool isSharedPart = ShouldUseSharedPart(partPolicy, importCreationPolicy); - - if (isSharedPart) - { - return new CatalogExport(catalogExportProvider, partDefinition, definition); - } - else - { - return new NonSharedCatalogExport(catalogExportProvider, partDefinition, definition); - } - } - - private static bool ShouldUseSharedPart(CreationPolicy partPolicy, CreationPolicy importPolicy) - { - // Matrix that details which policy to use for a given part to satisfy a given import. - // Part.Any Part.Shared Part.NonShared - // Import.Any Shared Shared NonShared - // Import.Shared Shared Shared N/A - // Import.NonShared NonShared N/A NonShared - - switch (partPolicy) - { - case CreationPolicy.Any: - { - if (importPolicy == CreationPolicy.Any || - importPolicy == CreationPolicy.Shared) - { - return true; - } - return false; - } - - case CreationPolicy.NonShared: - { - Assumes.IsTrue(importPolicy != CreationPolicy.Shared); - return false; - } - - default: - { - Assumes.IsTrue(partPolicy == CreationPolicy.Shared); - Assumes.IsTrue(importPolicy != CreationPolicy.NonShared); - return true; - } - } - } - } - - private sealed class NonSharedCatalogExport : CatalogExport, IDisposable - { - public NonSharedCatalogExport(CatalogExportProvider catalogExportProvider, - ComposablePartDefinition partDefinition, ExportDefinition definition) - : base(catalogExportProvider, partDefinition, definition) - { - } - - protected override bool IsSharedPart - { - get - { - return false; - } - } - - void IDisposable.Dispose() - { - if (this._part != null) - { - this._catalogExportProvider.ReleasePart(this.Value, this._part, null); - this._part = null; - } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.PartCreatorExport.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.PartCreatorExport.cs deleted file mode 100644 index 14d4a42d137..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.PartCreatorExport.cs +++ /dev/null @@ -1,132 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using System.Linq; - -namespace System.ComponentModel.Composition.Hosting -{ - public partial class CatalogExportProvider - { - internal class PartCreatorExport : Export - { - private readonly CatalogExportProvider _catalogExportProvider; - private readonly ComposablePartDefinition _partDefinition; - private readonly ExportDefinition _exportDefinition; - private ExportDefinition _partCreatorExportDefinition; - private PartCreatorPartDefinition _partCreatorPartDefinition; - - public PartCreatorExport(CatalogExportProvider catalogExportProvider, ComposablePartDefinition partDefinition, ExportDefinition exportDefinition) - { - this._catalogExportProvider = catalogExportProvider; - this._partDefinition = partDefinition; - this._exportDefinition = exportDefinition; - this._partCreatorExportDefinition = new PartCreatorExportDefinition(this._exportDefinition); - } - - public override ExportDefinition Definition - { - get { return this._partCreatorExportDefinition; } - } - - protected override object GetExportedValueCore() - { - if (this._partCreatorPartDefinition == null) - { - this._partCreatorPartDefinition = new PartCreatorPartDefinition(this); - } - return this._partCreatorPartDefinition; - } - - public Export CreateExportProduct() - { - return new NonSharedCatalogExport(this._catalogExportProvider, this._partDefinition, this._exportDefinition); - } - - private class PartCreatorPartDefinition : ComposablePartDefinition - { - private readonly PartCreatorExport _partCreatorExport; - - public PartCreatorPartDefinition(PartCreatorExport partCreatorExport) - { - this._partCreatorExport = partCreatorExport; - } - - public override IEnumerable ExportDefinitions - { - get { return new ExportDefinition[] { this._partCreatorExport.Definition }; } - } - - public override IEnumerable ImportDefinitions - { - get { return Enumerable.Empty(); } - } - - public ExportDefinition PartCreatorExportDefinition - { - get { return this._partCreatorExport.Definition; } - } - - public Export CreateProductExport() - { - return this._partCreatorExport.CreateExportProduct(); - } - - public override ComposablePart CreatePart() - { - return new PartCreatorPart(this); - } - } - - private sealed class PartCreatorPart : ComposablePart, IDisposable - { - private readonly PartCreatorPartDefinition _definition; - private readonly Export _export; - - public PartCreatorPart(PartCreatorPartDefinition definition) - { - this._definition = definition; - this._export = definition.CreateProductExport(); - } - - public override IEnumerable ExportDefinitions - { - get { return this._definition.ExportDefinitions; } - } - - public override IEnumerable ImportDefinitions - { - get { return this._definition.ImportDefinitions; } - } - - public override object GetExportedValue(ExportDefinition definition) - { - if (definition != this._definition.PartCreatorExportDefinition) - { - throw ExceptionBuilder.CreateExportDefinitionNotOnThisComposablePart("definition"); - } - - return this._export.Value; - } - - public override void SetImport(ImportDefinition definition, IEnumerable exports) - { - throw ExceptionBuilder.CreateImportDefinitionNotOnThisComposablePart("definition"); - } - - public void Dispose() - { - IDisposable disposable = this._export as IDisposable; - - if (disposable != null) - { - disposable.Dispose(); - } - } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs deleted file mode 100644 index 5c00b5a004f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs +++ /dev/null @@ -1,816 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Diagnostics; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using System.Runtime.CompilerServices; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.Hosting -{ - public partial class CatalogExportProvider : ExportProvider, IDisposable - { - private readonly CompositionLock _lock; - private Dictionary _activatedParts = new Dictionary(); - private HashSet _rejectedParts = new HashSet(); - private ConditionalWeakTable> _conditionalReferencesForRecomposableParts = new ConditionalWeakTable>(); - private HashSet _partsToDispose = new HashSet(); - private ComposablePartCatalog _catalog; - private volatile bool _isDisposed = false; - private volatile bool _isRunning = false; - private ExportProvider _sourceProvider; - private ImportEngine _importEngine; - - /// - /// Initializes a new instance of the class. - /// - /// - /// The that the - /// uses to produce objects. - /// - /// - /// is . - /// - public CatalogExportProvider(ComposablePartCatalog catalog) - : this(catalog, false) - { - } - - public CatalogExportProvider(ComposablePartCatalog catalog, bool isThreadSafe) - { - Requires.NotNull(catalog, "catalog"); - - this._catalog = catalog; - - var notifyCatalogChanged = this._catalog as INotifyComposablePartCatalogChanged; - if (notifyCatalogChanged != null) - { - notifyCatalogChanged.Changing += this.OnCatalogChanging; - } - - this._lock = new CompositionLock(isThreadSafe); - } - - /// - /// Gets the composable part catalog that the provider users to - /// produce exports. - /// - /// - /// The that the - /// - /// uses to produce objects. - /// - /// - /// The has been disposed of. - /// - public ComposablePartCatalog Catalog - { - get - { - ThrowIfDisposed(); - - return this._catalog; - } - } - - /// - /// Gets the export provider which provides the provider access to additional - /// exports. - /// - /// - /// The which provides the - /// access to additional - /// objects. The default is . - /// - /// - /// is . - /// - /// - /// This property has already been set. - /// - /// -or- - /// - /// The methods on the - /// have already been accessed. - /// - /// - /// The has been disposed of. - /// - /// - /// This property must be set before accessing any methods on the - /// . - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification="EnsureCanSet ensures that the property is set only once, Dispose is not required")] - public ExportProvider SourceProvider - { - get - { - this.ThrowIfDisposed(); - using (this._lock.LockStateForRead()) - { - return this._sourceProvider; - } - } - set - { - this.ThrowIfDisposed(); - - Requires.NotNull(value, "value"); - - ImportEngine newImportEngine = null; - bool isThrowing = true; - try - { - newImportEngine = new ImportEngine(value, this._lock.IsThreadSafe); - value.ExportsChanging += this.OnExportsChangingInternal; - - using (this._lock.LockStateForWrite()) - { - this.EnsureCanSet(this._sourceProvider); - - this._sourceProvider = value; - this._importEngine = newImportEngine; - - isThrowing = false; - } - } - finally - { - if (isThrowing) - { - value.ExportsChanging -= this.OnExportsChangingInternal; - newImportEngine.Dispose(); - } - } - } - } - - /// - /// Releases unmanaged and - optionally - managed resources - /// - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases unmanaged and - optionally - managed resources - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - if (!this._isDisposed) - { - bool disposeLock = false; - INotifyComposablePartCatalogChanged catalogToUnsubscribeFrom = null; - HashSet partsToDispose = null; - ExportProvider sourceProviderToUnsubscribeFrom = null; - ImportEngine importEngineToDispose = null; - - try - { - using (this._lock.LockStateForWrite()) - { - if (!this._isDisposed) - { - catalogToUnsubscribeFrom = this._catalog as INotifyComposablePartCatalogChanged; - this._catalog = null; - - sourceProviderToUnsubscribeFrom = this._sourceProvider; - this._sourceProvider = null; - - importEngineToDispose = this._importEngine; - this._importEngine = null; - - partsToDispose = this._partsToDispose; - this._partsToDispose = new HashSet(); - this._activatedParts.Clear(); - this._conditionalReferencesForRecomposableParts = null; - - disposeLock = true; - this._isDisposed = true; - } - } - } - finally - { - if (catalogToUnsubscribeFrom != null) - { - catalogToUnsubscribeFrom.Changing -= this.OnCatalogChanging; - } - - if (sourceProviderToUnsubscribeFrom != null) - { - sourceProviderToUnsubscribeFrom.ExportsChanging -= this.OnExportsChangingInternal; - } - - if (importEngineToDispose != null) - { - importEngineToDispose.Dispose(); - } - - if (partsToDispose != null) - { - foreach (var part in partsToDispose) - { - part.Dispose(); - } - } - - if (disposeLock) - { - this._lock.Dispose(); - } - } - } - } - } - - /// - /// Returns all exports that match the conditions of the specified import. - /// - /// The that defines the conditions of the - /// to get. - /// - /// - /// An of objects that match - /// the conditions defined by , if found; otherwise, an - /// empty . - /// - /// - /// - /// The implementers should not treat the cardinality-related mismatches as errors, and are not - /// expected to throw exceptions in those cases. - /// For instance, if the import requests exactly one export and the provider has no matching exports or more than one, - /// it should return an empty of . - /// - /// - protected override IEnumerable GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) - { - this.ThrowIfDisposed(); - this.EnsureRunning(); - - // Use the version of the catalog appropriate to this atomicComposition - ComposablePartCatalog currentCatalog = atomicComposition.GetValueAllowNull(this._catalog); - - IPartCreatorImportDefinition partCreatorDefinition = definition as IPartCreatorImportDefinition; - bool isPartCreator = false; - - if (partCreatorDefinition != null) - { - definition = partCreatorDefinition.ProductImportDefinition; - isPartCreator = true; - } - - CreationPolicy importPolicy = definition.GetRequiredCreationPolicy(); - - List exports = new List(); - foreach (var partDefinitionAndExportDefinition in currentCatalog.GetExports(definition)) - { - if (!IsRejected(partDefinitionAndExportDefinition.Item1, atomicComposition)) - { - if (isPartCreator) - { - exports.Add(new PartCreatorExport(this, - partDefinitionAndExportDefinition.Item1, - partDefinitionAndExportDefinition.Item2)); - } - else - { - exports.Add(CatalogExport.CreateExport(this, - partDefinitionAndExportDefinition.Item1, - partDefinitionAndExportDefinition.Item2, - importPolicy)); - } - } - } - - return exports; - } - - private void OnExportsChangingInternal(object sender, ExportsChangeEventArgs e) - { - UpdateRejections(e.AddedExports.Concat(e.RemovedExports), e.AtomicComposition); - } - - private static ExportDefinition[] GetExportsFromPartDefinitions(IEnumerable partDefinitions) - { - List exports = new List(); - - foreach (var partDefinition in partDefinitions) - { - foreach (var export in partDefinition.ExportDefinitions) - { - exports.Add(export); - - // While creating a PartCreatorExportDefinition for every changed definition may not be the most - // efficient way to do this the PartCreatorExportDefinition is very efficient and doesn't do any - // real work unless its metadata is pulled on. If this turns out to be a bottleneck then we - // will need to start tracking all the PartCreator's we hand out and only send those which we - // have handed out. In fact we could do the same thing for all the Exports if we wished but - // that requires a cache management which we don't want to do at this point. - exports.Add(new PartCreatorExportDefinition(export)); - } - } - - return exports.ToArray(); - } - - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] - private void OnCatalogChanging(object sender, ComposablePartCatalogChangeEventArgs e) - { - using (var atomicComposition = new AtomicComposition(e.AtomicComposition)) - { - // Save the preview catalog to use in place of the original while handling - // this event - atomicComposition.SetValue(this._catalog, - new CatalogChangeProxy(this._catalog, e.AddedDefinitions, e.RemovedDefinitions)); - - IEnumerable addedExports = GetExportsFromPartDefinitions(e.AddedDefinitions); - IEnumerable removedExports = GetExportsFromPartDefinitions(e.RemovedDefinitions); - - // Remove any parts based on eliminated definitions (in a atomicComposition-friendly - // fashion) - foreach (var definition in e.RemovedDefinitions) - { - ComposablePart removedPart = null; - bool removed = false; - - using (this._lock.LockStateForRead()) - { - removed = this._activatedParts.TryGetValue(definition, out removedPart); - } - if (removed) - { - var capturedDefinition = definition; - ReleasePart(null, removedPart, atomicComposition); - atomicComposition.AddCompleteActionAllowNull(() => - { - using (this._lock.LockStateForWrite()) - { - this._activatedParts.Remove(capturedDefinition); - } - }); - } - } - - UpdateRejections(addedExports.ConcatAllowingNull(removedExports), atomicComposition); - - this.OnExportsChanging( - new ExportsChangeEventArgs(addedExports, removedExports, atomicComposition)); - - atomicComposition.AddCompleteAction(() => this.OnExportsChanged( - new ExportsChangeEventArgs(addedExports, removedExports, null))); - - atomicComposition.Complete(); - } - } - - private ComposablePart GetComposablePart(ComposablePartDefinition partDefinition, bool isSharedPart) - { - this.ThrowIfDisposed(); - this.EnsureRunning(); - - ComposablePart part; - - if (isSharedPart) - { - part = GetSharedPart(partDefinition); - } - else - { - part = partDefinition.CreatePart(); - - IDisposable disposablePart = part as IDisposable; - if (disposablePart != null) - { - using (this._lock.LockStateForWrite()) - { - this._partsToDispose.Add(disposablePart); - } - } - } - - return part; - } - - private ComposablePart GetSharedPart(ComposablePartDefinition partDefinition) - { - ComposablePart part; - bool found = false; - - using (this._lock.LockStateForRead()) - { - found = this._activatedParts.TryGetValue(partDefinition, out part); - } - - if (!found) - { - ComposablePart newPart = partDefinition.CreatePart(); - - using (this._lock.LockStateForWrite()) - { - found = this._activatedParts.TryGetValue(partDefinition, out part); - - if (!found) - { - part = newPart; - this._activatedParts.Add(partDefinition, part); - IDisposable disposablePart = part as IDisposable; - if (disposablePart != null) - { - this._partsToDispose.Add(disposablePart); - } - } - } - } - - return part; - } - - private object GetExportedValue(ComposablePart part, ExportDefinition export, bool isSharedPart) - { - this.ThrowIfDisposed(); - this.EnsureRunning(); - - Assumes.NotNull(part, export); - - object exportedValue = CompositionServices.GetExportedValueFromComposedPart( - this._importEngine, part, export); - - // Only hold conditional references for recomposable non-shared parts because we are - // already holding strong references to the shared parts. - if (exportedValue != null && !isSharedPart && part.IsRecomposable()) - { - SetConditionalReferenceForRecomposablePart(exportedValue, part); - } - - return exportedValue; - } - - private void ReleasePart(object exportedValue, ComposablePart part, AtomicComposition atomicComposition) - { - this.ThrowIfDisposed(); - this.EnsureRunning(); - - Assumes.NotNull(part); - - this._importEngine.ReleaseImports(part, atomicComposition); - - if (exportedValue != null) - { - atomicComposition.AddCompleteActionAllowNull(() => - { - using (this._lock.LockStateForWrite()) - { - this._conditionalReferencesForRecomposableParts.Remove(exportedValue); - } - }); - } - - IDisposable diposablePart = part as IDisposable; - if (diposablePart != null) - { - atomicComposition.AddCompleteActionAllowNull(() => - { - bool removed = false; - using (this._lock.LockStateForWrite()) - { - removed = this._partsToDispose.Remove(diposablePart); - } - if (removed) - { - diposablePart.Dispose(); - } - }); - } - } - - private void SetConditionalReferenceForRecomposablePart(object exportedValue, ComposablePart part) - { - Assumes.NotNull(exportedValue, part); - - List partList; - - using (this._lock.LockStateForWrite()) - { - if (!this._conditionalReferencesForRecomposableParts.TryGetValue(exportedValue, out partList)) - { - partList = new List(); - this._conditionalReferencesForRecomposableParts.Add(exportedValue, partList); - } - - // There is one really obscure case (one part exporting exact value multiple times) where - // the part may already be in the list but it isn't a scenario that is interesting so - // we simply always add. Later if we change this to support more than non-shared we may - // need to check if the part already exists to pervent adding it multiple times. - partList.Add(part); - } - } - - private bool IsRejected(ComposablePartDefinition definition, AtomicComposition atomicComposition) - { - // Check to see if we're currently working on the definition in question. - // Recursive queries always answer optimistically, as if the definition hasn't - // been rejected - because if it is we can discard all decisions that were based - // on the faulty assumption in the first place. - var forceRejectionTest = false; - if (atomicComposition != null) - { - var atomicCompositionQuery = GetAtomicCompositionQuery(atomicComposition); - AtomicCompositionQueryState state = atomicCompositionQuery(definition); - switch (state) - { - case AtomicCompositionQueryState.TreatAsRejected: - return true; - case AtomicCompositionQueryState.TreatAsValidated: - return false; - case AtomicCompositionQueryState.NeedsTesting: - forceRejectionTest = true; - break; - default: - Assumes.IsTrue(state == AtomicCompositionQueryState.Unknown); - // Need to do the work to determine the state - break; - } - } - - if (!forceRejectionTest) - { - // Next, anything that has been activated is not rejected - using (this._lock.LockStateForRead()) - { - if (this._activatedParts.ContainsKey(definition)) - { - return false; - } - - // Last stop before doing the hard work: check a specific registry of rejected parts - if (this._rejectedParts.Contains(definition)) - { - return true; - } - } - } - - // Determine whether or not the definition's imports can be satisfied - return DetermineRejection(definition, atomicComposition); - } - - private bool DetermineRejection(ComposablePartDefinition definition, AtomicComposition parentAtomicComposition) - { - ChangeRejectedException exception = null; - - using (var localAtomicComposition = new AtomicComposition(parentAtomicComposition)) - { - // The part definition we're currently working on is treated optimistically - // as if we know it hasn't been rejected. This handles recursion, and if we - // later decide that it has been rejected we'll discard all nested progress so - // all side-effects of the mistake are erased. - // - // Note that this means that recursive failures that would be detected by the - // import engine are not discovered by rejection currently. Loops among - // prerequisites, runaway import chains involving factories, and prerequisites - // that cannot be fully satisfied still result in runtime errors. Doing - // otherwise would be possible but potentially expensive - and could be a v2 - // improvement if deemed worthwhile. - UpdateAtomicCompositionQuery(localAtomicComposition, - def => definition.Equals(def), AtomicCompositionQueryState.TreatAsValidated); - - var newPart = definition.CreatePart(); - try - { - this._importEngine.PreviewImports(newPart, localAtomicComposition); - - // Reuse the partially-fleshed out part the next time we need a shared - // instance to keep the expense of pre-validation to a minimum. Note that - // _activatedParts holds references to both shared and non-shared parts. - // The non-shared parts will only be used for rejection purposes only but - // the shared parts will be handed out when requested via GetExports as - // well as be used for rejection purposes. - localAtomicComposition.AddCompleteActionAllowNull(() => - { - using (this._lock.LockStateForWrite()) - { - if (!this._activatedParts.ContainsKey(definition)) - { - this._activatedParts.Add(definition, newPart); - IDisposable newDisposablePart = newPart as IDisposable; - if (newDisposablePart != null) - { - this._partsToDispose.Add(newDisposablePart); - } - } - } - }); - - // Success! Complete any recursive work that was conditioned on this part's validation - localAtomicComposition.Complete(); - - return false; - } - catch (ChangeRejectedException ex) - { - exception = ex; - } - } - - // If we've reached this point then this part has been rejected so we need to - // record the rejection in our parent composition or execute it immediately if - // one doesn't exist. - parentAtomicComposition.AddCompleteActionAllowNull(() => - { - using (this._lock.LockStateForWrite()) - { - this._rejectedParts.Add(definition); - } - - CompositionTrace.PartDefinitionRejected(definition, exception); - - }); - if (parentAtomicComposition != null) - { - UpdateAtomicCompositionQuery(parentAtomicComposition, - def => definition.Equals(def), AtomicCompositionQueryState.TreatAsRejected); - } - - return true; - } - - private void UpdateRejections(IEnumerable changedExports, AtomicComposition atomicComposition) - { - using (var localAtomicComposition = new AtomicComposition(atomicComposition)) - { - // Reconsider every part definition that has been previously - // rejected to see if any of them can be added back. - var affectedRejections = new HashSet(); - var atomicCompositionQuery = GetAtomicCompositionQuery(localAtomicComposition); - - ComposablePartDefinition[] rejectedParts; - using (this._lock.LockStateForRead()) - { - rejectedParts = this._rejectedParts.ToArray(); - } - foreach (var definition in rejectedParts) - { - if (atomicCompositionQuery(definition) == AtomicCompositionQueryState.TreatAsValidated) - { - continue; - } - - foreach (var import in definition.ImportDefinitions.Where(ImportEngine.IsRequiredImportForPreview)) - { - if (changedExports.Any(export => import.IsConstraintSatisfiedBy(export))) - { - affectedRejections.Add(definition); - break; - } - } - } - UpdateAtomicCompositionQuery(localAtomicComposition, - def => affectedRejections.Contains(def), AtomicCompositionQueryState.NeedsTesting); - - // Determine if any of the resurrectable parts is now available so that we can - // notify listeners of the exact changes to exports - var resurrectedExports = new List(); - - foreach (var partDefinition in affectedRejections) - { - if (!IsRejected(partDefinition, localAtomicComposition)) - { - // Notify listeners of the newly available exports and - // prepare to remove the rejected part from the list of rejections - resurrectedExports.AddRange(partDefinition.ExportDefinitions); - - // Capture the local so that the closure below refers to the current definition - // in the loop and not the value of 'partDefinition' when the closure executes - var capturedPartDefinition = partDefinition; - localAtomicComposition.AddCompleteAction(() => - { - using (this._lock.LockStateForWrite()) - { - this._rejectedParts.Remove(capturedPartDefinition); - } - - CompositionTrace.PartDefinitionResurrected(capturedPartDefinition); - }); - } - } - - // Notify anyone sourcing exports that the resurrected exports have appeared - if (resurrectedExports.Any()) - { - this.OnExportsChanging( - new ExportsChangeEventArgs(resurrectedExports, new ExportDefinition[0], localAtomicComposition)); - - localAtomicComposition.AddCompleteAction(() => this.OnExportsChanged( - new ExportsChangeEventArgs(resurrectedExports, new ExportDefinition[0], null))); - } - - localAtomicComposition.Complete(); - } - } - - [DebuggerStepThrough] - private void ThrowIfDisposed() - { - if (this._isDisposed) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - - /// - /// EnsureCanRun must be called from within a lock. - /// - [DebuggerStepThrough] - private void EnsureCanRun() - { - if ((this._sourceProvider == null) || (this._importEngine == null)) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Strings.ObjectMustBeInitialized, "SourceProvider")); // NOLOC - } - } - - [DebuggerStepThrough] - private void EnsureRunning() - { - if (!this._isRunning) - { - using (this._lock.LockStateForWrite()) - { - if (!this._isRunning) - { - this.EnsureCanRun(); - this._isRunning = true; - } - } - } - } - - /// - /// EnsureCanSet must be called from within a lock. - /// - /// - /// - [DebuggerStepThrough] - private void EnsureCanSet(T currentValue) - where T : class - { - if ((this._isRunning) || (currentValue != null)) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Strings.ObjectAlreadyInitialized)); - } - } - - private Func GetAtomicCompositionQuery(AtomicComposition atomicComposition) - { - Func atomicCompositionQuery; - atomicComposition.TryGetValue(this, out atomicCompositionQuery); - - if (atomicCompositionQuery == null) - { - return (definition) => AtomicCompositionQueryState.Unknown; - } - - return atomicCompositionQuery; - } - - private void UpdateAtomicCompositionQuery( - AtomicComposition atomicComposition, - Func query, - AtomicCompositionQueryState state) - { - var parentQuery = GetAtomicCompositionQuery(atomicComposition); - Func newQuery = definition => - { - if (query(definition)) - { - return state; - } - return parentQuery(definition); - }; - - atomicComposition.SetValue(this, newQuery); - } - - private enum AtomicCompositionQueryState - { - Unknown, - TreatAsRejected, - TreatAsValidated, - NeedsTesting - }; - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartCatalogChangeEventArgs.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartCatalogChangeEventArgs.cs deleted file mode 100644 index bbb20feaf4e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartCatalogChangeEventArgs.cs +++ /dev/null @@ -1,81 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.Hosting -{ - /// - /// Provides data for the and - /// events. - /// - public class ComposablePartCatalogChangeEventArgs : EventArgs - { - /// - /// Initializes a new instance of the . - /// - /// - /// An of objects that - /// are being added to the . - /// - /// - /// An of objects that - /// are being removed from the . - /// - /// - /// A representing all tentative changes that will - /// be completed if the change is successful, or discarded if it is not. - /// if being applied outside a - /// or during a event. - /// - /// - /// or is . - /// - public ComposablePartCatalogChangeEventArgs(IEnumerable addedDefinitions, - IEnumerable removedDefinitions, AtomicComposition atomicComposition) - { - Requires.NotNull(addedDefinitions, "addedDefinitions"); - Requires.NotNull(removedDefinitions, "removedDefinitions"); - - this.AddedDefinitions = addedDefinitions.AsArray(); - this.RemovedDefinitions = removedDefinitions.AsArray(); - this.AtomicComposition = atomicComposition; - } - - /// - /// Gets the identifiers of the parts that have been added. - /// - /// - /// An of objects that - /// have been added to the . - /// - public IEnumerable AddedDefinitions { get; private set; } - - /// - /// Gets the identifiers of the parts that have been removed. - /// - /// - /// An of objects that - /// have been removed from from the . - /// - public IEnumerable RemovedDefinitions { get; private set; } - - /// - /// Gets the atomicComposition, if any, that this change applies to. - /// - /// - /// A that this set of changes applies too. - /// It can be if the changes are being applied outside a - /// or during a - /// event. - /// - /// When the value is non-null it should be used to record temporary changed state - /// and actions that will be executed when the atomicComposition is completeed. - /// - public AtomicComposition AtomicComposition { get; private set; } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs deleted file mode 100644 index 466ab688872..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs +++ /dev/null @@ -1,420 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.ObjectModel; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.Text; -using System.Threading; -using System.Diagnostics; -using Microsoft.Internal; -using Microsoft.Internal.Collections; -using System.Collections; - -namespace System.ComponentModel.Composition.Hosting -{ - /// - /// This class implements a threadsafe ICollection{T} of ComposablePartCatalog. - /// It is exposed as an ICollection(ComposablePartCatalog) - /// It is threadsafe, notifications are not marshalled using a SynchronizationContext. - /// It is Disposable. - /// - internal class ComposablePartCatalogCollection : ICollection, INotifyComposablePartCatalogChanged, IDisposable - { - private readonly Lock _lock = new Lock(); - private Action _onChanged; - private Action _onChanging; - private List _catalogs = new List(); - private volatile bool _isCopyNeeded = false; - private volatile bool _isDisposed = false; - private bool _hasChanged = false; - - public ComposablePartCatalogCollection(IEnumerable catalogs) - : this(catalogs, null, null) - { - } - - public ComposablePartCatalogCollection( - IEnumerable catalogs, - Action onChanged, - Action onChanging) - { - catalogs = catalogs ?? Enumerable.Empty(); - this._catalogs = new List(catalogs); - this._onChanged = onChanged; - this._onChanging = onChanging; - - SubscribeToCatalogNotifications(catalogs); - } - - public void Add(ComposablePartCatalog item) - { - Requires.NotNull(item, "item"); - - this.ThrowIfDisposed(); - - var addedParts = new Lazy>(() => item.Parts.ToArray(), false); - - using (var atomicComposition = new AtomicComposition()) - { - this.RaiseChangingEvent(addedParts, null, atomicComposition); - - using (new WriteLock(this._lock)) - { - if (this._isCopyNeeded) - { - this._catalogs = new List(this._catalogs); - this._isCopyNeeded = false; - } - this._hasChanged = true; - this._catalogs.Add(item); - } - - this.SubscribeToCatalogNotifications(item); - - // Complete after the catalog changes are written - atomicComposition.Complete(); - } - - this.RaiseChangedEvent(addedParts, null); - } - - /// - /// Notify when the contents of the Catalog has changed. - /// - public event EventHandler Changed; - - /// - /// Notify when the contents of the Catalog has changing. - /// - public event EventHandler Changing; - - public void Clear() - { - this.ThrowIfDisposed(); - - // No action is required if we are already empty - ComposablePartCatalog[] catalogs = null; - using (new ReadLock(this._lock)) - { - if (this._catalogs.Count == 0) - { - return; - } - catalogs = this._catalogs.ToArray(); - } - - //TODO-MT: This is pretty suspect - we can easily eliminate catalogs that aren't listed as being - // removed. Then again, the idea of trying to mutate the catalog on two threads at the same time is pretty - // suspect to begin with. When would that ever result in a meaningful composition? - - // We are doing this outside of the lock, so it's possible that the catalog will continute propagating events from things - // we are about to unsubscribe from. Given the non-specificity of our event, in the worst case scenario we would simply fire - // unnecessary events. - - var removedParts = new Lazy>(() => catalogs.SelectMany(catalog => catalog.Parts).ToArray(), false); - - // Validate the changes before applying them - using (var atomicComposition = new AtomicComposition()) - { - this.RaiseChangingEvent(null, removedParts, atomicComposition); - this.UnsubscribeFromCatalogNotifications(catalogs); - - using (new WriteLock(this._lock)) - { - this._catalogs = new List(); - - this._isCopyNeeded = false; - this._hasChanged = true; - } - - // Complete after the catalog changes are written - atomicComposition.Complete(); - } - - this.RaiseChangedEvent(null, removedParts); - } - - public bool Contains(ComposablePartCatalog item) - { - Requires.NotNull(item, "item"); - - this.ThrowIfDisposed(); - - using (new ReadLock(this._lock)) - { - return this._catalogs.Contains(item); - } - } - - public void CopyTo(ComposablePartCatalog[] array, int arrayIndex) - { - this.ThrowIfDisposed(); - - using (new ReadLock(this._lock)) - { - this._catalogs.CopyTo(array, arrayIndex); - } - } - - public int Count - { - get - { - this.ThrowIfDisposed(); - - using (new ReadLock(this._lock)) - { - return this._catalogs.Count; - } - } - } - - public bool IsReadOnly - { - get - { - this.ThrowIfDisposed(); - - return false; - } - } - - public bool Remove(ComposablePartCatalog item) - { - Requires.NotNull(item, "item"); - - this.ThrowIfDisposed(); - - using (new ReadLock(this._lock)) - { - if (!this._catalogs.Contains(item)) - { - return false; - } - } - - bool isSuccessfulRemoval = false; - - var removedParts = new Lazy>(() => item.Parts.ToArray(), false); - using (var atomicComposition = new AtomicComposition()) - { - this.RaiseChangingEvent(null, removedParts, atomicComposition); - - using (new WriteLock(this._lock)) - { - if (_isCopyNeeded) - { - this._catalogs = new List(this._catalogs); - this._isCopyNeeded = false; - } - - isSuccessfulRemoval = this._catalogs.Remove(item); - if (isSuccessfulRemoval) - { - this._hasChanged = true; - } - } - - this.UnsubscribeFromCatalogNotifications(item); - - // Complete after the catalog changes are written - atomicComposition.Complete(); - } - - this.RaiseChangedEvent(null, removedParts); - - return isSuccessfulRemoval; - } - - internal bool HasChanged - { - get - { - this.ThrowIfDisposed(); - - using (new ReadLock(this._lock)) - { - return this._hasChanged; - } - } - } - - public IEnumerator GetEnumerator() - { - this.ThrowIfDisposed(); - - using (new ReadLock(this._lock)) - { - IEnumerator enumerator = this._catalogs.GetEnumerator(); - this._isCopyNeeded = true; - return enumerator; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return this.GetEnumerator(); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - if (!this._isDisposed) - { - bool disposeLock = false; - IEnumerable catalogs = null; - try - { - using (new WriteLock(this._lock)) - { - if (!this._isDisposed) - { - disposeLock = true; - - catalogs = this._catalogs; - this._catalogs = null; - - this._isDisposed = true; - } - } - } - finally - { - if (catalogs != null) - { - this.UnsubscribeFromCatalogNotifications(catalogs); - catalogs.ForEach(catalog => catalog.Dispose()); - } - - if (disposeLock) - { - this._lock.Dispose(); - } - } - } - } - } - - private void RaiseChangedEvent( - Lazy> addedDefinitions, - Lazy> removedDefinitions) - { - if (this._onChanged == null || this.Changed == null) - { - return; - } - - var added = (addedDefinitions == null ? Enumerable.Empty() : addedDefinitions.Value); - var removed = (removedDefinitions == null ? Enumerable.Empty() : removedDefinitions.Value); - - this._onChanged.Invoke(new ComposablePartCatalogChangeEventArgs(added, removed, null)); - } - - public void OnChanged(object sender, ComposablePartCatalogChangeEventArgs e) - { - var changedEvent = this.Changed; - if (changedEvent != null) - { - changedEvent(sender, e); - } - } - - private void RaiseChangingEvent( - Lazy> addedDefinitions, - Lazy> removedDefinitions, - AtomicComposition atomicComposition) - { - if (this._onChanging == null || this.Changing == null) - { - return; - } - var added = (addedDefinitions == null ? Enumerable.Empty() : addedDefinitions.Value); - var removed = (removedDefinitions == null ? Enumerable.Empty() : removedDefinitions.Value); - - this._onChanging.Invoke(new ComposablePartCatalogChangeEventArgs(added, removed, atomicComposition)); - } - - public void OnChanging(object sender, ComposablePartCatalogChangeEventArgs e) - { - var changingEvent = this.Changing; - if (changingEvent != null) - { - changingEvent(sender, e); - } - } - - private void OnContainedCatalogChanged(object sender, ComposablePartCatalogChangeEventArgs e) - { - if (this._onChanged == null || this.Changed == null) - { - return; - } - - this._onChanged.Invoke(e); - } - - private void OnContainedCatalogChanging(object sender, ComposablePartCatalogChangeEventArgs e) - { - if (this._onChanging == null || this.Changing == null) - { - return; - } - - this._onChanging.Invoke(e); - } - - private void SubscribeToCatalogNotifications(ComposablePartCatalog catalog) - { - INotifyComposablePartCatalogChanged notifyCatalog = catalog as INotifyComposablePartCatalogChanged; - if (notifyCatalog != null) - { - notifyCatalog.Changed += this.OnContainedCatalogChanged; - notifyCatalog.Changing += this.OnContainedCatalogChanging; - } - } - - private void SubscribeToCatalogNotifications(IEnumerable catalogs) - { - foreach (var catalog in catalogs) - { - SubscribeToCatalogNotifications(catalog); - } - } - - private void UnsubscribeFromCatalogNotifications(ComposablePartCatalog catalog) - { - INotifyComposablePartCatalogChanged notifyCatalog = catalog as INotifyComposablePartCatalogChanged; - if (notifyCatalog != null) - { - notifyCatalog.Changed -= this.OnContainedCatalogChanged; - notifyCatalog.Changing -= this.OnContainedCatalogChanging; - } - } - - private void UnsubscribeFromCatalogNotifications(IEnumerable catalogs) - { - foreach (var catalog in catalogs) - { - UnsubscribeFromCatalogNotifications(catalog); - } - } - - private void ThrowIfDisposed() - { - if (this._isDisposed) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartExportProvider.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartExportProvider.cs deleted file mode 100644 index e8c68eab905..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ComposablePartExportProvider.cs +++ /dev/null @@ -1,396 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics; -using System.Globalization; -using System.Linq; -using System.Threading; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Hosting -{ - public class ComposablePartExportProvider : ExportProvider, IDisposable - { - private List _parts = new List(); - private volatile bool _isDisposed = false; - private volatile bool _isRunning = false; - private CompositionLock _lock = null; - private ExportProvider _sourceProvider; - private ImportEngine _importEngine; - private volatile bool _currentlyComposing; - - /// - /// Initializes a new instance of the class. - /// - public ComposablePartExportProvider() : - this(false) - { - } - - public ComposablePartExportProvider(bool isThreadSafe) - { - this._lock = new CompositionLock(isThreadSafe); - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases unmanaged and - optionally - managed resources - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - if (!this._isDisposed) - { - bool disposeLock = false; - ImportEngine oldImportEngine = null; - try - { - using (this._lock.LockStateForWrite()) - { - if (!this._isDisposed) - { - oldImportEngine = this._importEngine; - this._importEngine = null; - this._sourceProvider = null; - this._isDisposed = true; - disposeLock = true; - } - } - } - finally - { - if (oldImportEngine != null) - { - oldImportEngine.Dispose(); - } - - if (disposeLock) - { - this._lock.Dispose(); - } - } - } - } - } - - /// - /// Gets the export provider which provides the provider access to - /// exports. - /// - /// - /// The which provides the - /// access to objects. - /// The default is . - /// - /// - /// is . - /// - /// - /// This property has already been set. - /// - /// -or- - /// - /// The methods on the - /// have already been accessed. - /// - /// - /// The has been disposed of. - /// - /// - /// This property must be set before accessing any methods on the - /// . - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "EnsureCanSet ensures that the property is set only once, Dispose is not required")] - public ExportProvider SourceProvider - { - get - { - this.ThrowIfDisposed(); - - return this._sourceProvider; - } - set - { - this.ThrowIfDisposed(); - - Requires.NotNull(value, "value"); - using (this._lock.LockStateForWrite()) - { - this.EnsureCanSet(this._sourceProvider); - this._sourceProvider = value; - } - - // This should be safe to do outside the lock, because only the first setter will ever win - // and others will throw - ImportEngine importEngine = new ImportEngine(this._sourceProvider, this._lock.IsThreadSafe); - Thread.MemoryBarrier(); - this._importEngine = importEngine; - } - } - - /// - /// Returns all exports that match the conditions of the specified import. - /// - /// The that defines the conditions of the - /// to get. - /// - /// - /// An of objects that match - /// the conditions defined by , if found; otherwise, an - /// empty . - /// - /// - /// - /// The implementers should not treat the cardinality-related mismatches as errors, and are not - /// expected to throw exceptions in those cases. - /// For instance, if the import requests exactly one export and the provider has no matching exports or more than one, - /// it should return an empty of . - /// - /// - protected override IEnumerable GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) - { - this.ThrowIfDisposed(); - this.EnsureRunning(); - - // Determine whether there is a composition atomicComposition-specific list of parts to use, - // failing that use the usual list. We never change the list of parts in place, - // but rather copy, change and write a new list atomically. Therefore all we need - // to do here is to read the _parts member. - List parts = null; - using (this._lock.LockStateForRead()) - { - parts = atomicComposition.GetValueAllowNull(this, this._parts); - } - - if (parts.Count == 0) - { - return Enumerable.Empty(); - } - - List exports = new List(); - foreach (var part in parts) - { - foreach (var exportDefinition in part.ExportDefinitions) - { - if (definition.IsConstraintSatisfiedBy(exportDefinition)) - { - exports.Add(this.CreateExport(part, exportDefinition)); - } - } - } - return exports; - } - - public void Compose(CompositionBatch batch) - { - this.ThrowIfDisposed(); - this.EnsureRunning(); - - Requires.NotNull(batch, "batch"); - - // Quick exit test can be done prior to cloning since it's just an optimization, not a - // change in behavior - if ((batch.PartsToAdd.Count == 0) && (batch.PartsToRemove.Count == 0)) - { - return; - } - - CompositionResult result = CompositionResult.SucceededResult; - - // Clone the batch, so that the external changes wouldn't happen half-way thorugh compose - // NOTE : this does not guarantee the atomicity of cloning, which is not the goal anyway, - // rather the fact that all subsequent calls will deal with an unchanging batch - batch = new CompositionBatch(batch.PartsToAdd, batch.PartsToRemove); - - var newParts = GetUpdatedPartsList(batch); - - // Allow only recursive calls from the import engine to see the changes until - // they've been verified ... - using (var atomicComposition = new AtomicComposition()) - { - // Don't allow reentrant calls to compose during previewing to prevent - // corrupted state. - if (this._currentlyComposing) - { - throw new InvalidOperationException(Strings.ReentrantCompose); - } - - this._currentlyComposing = true; - - try - { - // In the meantime recursive calls need to be able to see the list as well - atomicComposition.SetValue(this, newParts); - - // Recompose any existing imports effected by the these changes first so that - // adapters, resurrected parts, etc. can all play their role in satisfying - // imports for added parts - this.Recompose(batch, atomicComposition); - - // Ensure that required imports can be satisfied - foreach (ComposablePart part in batch.PartsToAdd) - { - // collect the result of previewing all the adds in the batch - try - { - this._importEngine.PreviewImports(part, atomicComposition); - } - catch (ChangeRejectedException ex) - { - result = result.MergeResult(new CompositionResult(ex.Errors)); - } - } - - result.ThrowOnErrors(atomicComposition); - - // Complete the new parts since they passed previewing.` - using (this._lock.LockStateForWrite()) - { - this._parts = newParts; - } - - atomicComposition.Complete(); - } - finally - { - this._currentlyComposing = false; - } - } - - // Satisfy Imports - // - Satisfy imports on all newly added component parts - foreach (ComposablePart part in batch.PartsToAdd) - { - result = result.MergeResult(CompositionServices.TryInvoke(() => - this._importEngine.SatisfyImports(part))); - } - - // return errors - result.ThrowOnErrors(); - } - - private List GetUpdatedPartsList(CompositionBatch batch) - { - Assumes.NotNull(batch); - - // Copy the current list of parts - we are about to modify it - // This is an OK thing to do as this is the only method that can modify the List AND Compose can - // only be executed on one thread at a time - thus two different threads cannot tramp over each other - List parts = null; - using (this._lock.LockStateForRead()) - { - parts = this._parts.ToList(); // this copies the list - } - - foreach (ComposablePart part in batch.PartsToAdd) - { - parts.Add(part); - } - - foreach (ComposablePart part in batch.PartsToRemove) - { - parts.Remove(part); - } - - return parts; - } - - private void Recompose(CompositionBatch batch, AtomicComposition atomicComposition) - { - Assumes.NotNull(batch); - - // Unregister any removed component parts - foreach (ComposablePart part in batch.PartsToRemove) - { - this._importEngine.ReleaseImports(part, atomicComposition); - } - - // Recompose any imports effected by the these changes (the changes are - // observable through GetExports in the appropriate atomicComposition, thus we can fire - // the event - IEnumerable addedExports = batch.PartsToAdd.Count != 0 ? - batch.PartsToAdd.SelectMany(part => part.ExportDefinitions).ToArray() : - new ExportDefinition[0]; - - IEnumerable removedExports = batch.PartsToRemove.Count != 0 ? - batch.PartsToRemove.SelectMany(part => part.ExportDefinitions).ToArray() : - new ExportDefinition[0]; - - this.OnExportsChanging( - new ExportsChangeEventArgs(addedExports, removedExports, atomicComposition)); - - atomicComposition.AddCompleteAction(() => this.OnExportsChanged( - new ExportsChangeEventArgs(addedExports, removedExports, null))); - } - - private Export CreateExport(ComposablePart part, ExportDefinition export) - { - return new Export(export, () => GetExportedValue(part, export)); - } - - private object GetExportedValue(ComposablePart part, ExportDefinition export) - { - this.ThrowIfDisposed(); - this.EnsureRunning(); - - return CompositionServices.GetExportedValueFromComposedPart(this._importEngine, part, export); - } - - [DebuggerStepThrough] - private void ThrowIfDisposed() - { - if (this._isDisposed) - { - throw new ObjectDisposedException(this.GetType().Name); - } - } - - [DebuggerStepThrough] - private void EnsureCanRun() - { - if ((this._sourceProvider == null) || (this._importEngine == null)) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Strings.ObjectMustBeInitialized, "SourceProvider")); // NOLOC - } - } - - [DebuggerStepThrough] - private void EnsureRunning() - { - if (!this._isRunning) - { - using (this._lock.LockStateForWrite()) - { - if (!this._isRunning) - { - this.EnsureCanRun(); - this._isRunning = true; - } - } - } - } - - [DebuggerStepThrough] - private void EnsureCanSet(T currentValue) - where T : class - { - if ((this._isRunning) || (currentValue != null)) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Strings.ObjectAlreadyInitialized)); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionBatch.SingleExportComposablePart.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionBatch.SingleExportComposablePart.cs deleted file mode 100644 index a2d2f7a3cff..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionBatch.SingleExportComposablePart.cs +++ /dev/null @@ -1,62 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Hosting -{ - partial class CompositionBatch - { - // Represents a part that exports a single export - private class SingleExportComposablePart : ComposablePart - { - private readonly Export _export; - - public SingleExportComposablePart(Export export) - { - Assumes.NotNull(export); - - this._export = export; - } - - public override IDictionary Metadata - { - get { return MetadataServices.EmptyMetadata; } - } - - public override IEnumerable ExportDefinitions - { - get { return new ExportDefinition[] { _export.Definition }; } - } - - public override IEnumerable ImportDefinitions - { - get { return Enumerable.Empty(); } - } - - public override object GetExportedValue(ExportDefinition definition) - { - Requires.NotNull(definition, "definition"); - - if (definition != _export.Definition) - { - throw ExceptionBuilder.CreateExportDefinitionNotOnThisComposablePart("definition"); - } - - return _export.Value; - } - - public override void SetImport(ImportDefinition definition, IEnumerable exports) - { - Requires.NotNull(definition, "definition"); - Requires.NotNullOrNullElements(exports, "exports"); - - throw ExceptionBuilder.CreateImportDefinitionNotOnThisComposablePart("definition"); - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionBatch.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionBatch.cs deleted file mode 100644 index 62f0a4d4416..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionBatch.cs +++ /dev/null @@ -1,174 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using Microsoft.Internal; -using System.Collections.ObjectModel; -using System.Diagnostics.CodeAnalysis; - -namespace System.ComponentModel.Composition.Hosting -{ - public partial class CompositionBatch - { - private object _lock = new object(); - private bool _copyNeededForAdd; - private bool _copyNeededForRemove; - private List _partsToAdd; - private ReadOnlyCollection _readOnlyPartsToAdd; - private List _partsToRemove; - private ReadOnlyCollection _readOnlyPartsToRemove; - - /// - /// Initializes a new instance of the class. - /// - public CompositionBatch() : - this(null, null) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The parts to add. - /// The parts to remove. - public CompositionBatch(IEnumerable partsToAdd, IEnumerable partsToRemove) - { - this._partsToAdd = new List(); - if (partsToAdd != null) - { - foreach (var part in partsToAdd) - { - if (part == null) - { - throw ExceptionBuilder.CreateContainsNullElement("partsToAdd"); - } - this._partsToAdd.Add(part); - } - } - this._readOnlyPartsToAdd = this._partsToAdd.AsReadOnly(); - - this._partsToRemove = new List(); - if (partsToRemove != null) - { - foreach (var part in partsToRemove) - { - if (part == null) - { - throw ExceptionBuilder.CreateContainsNullElement("partsToRemove"); - } - this._partsToRemove.Add(part); - } - } - this._readOnlyPartsToRemove = this._partsToRemove.AsReadOnly(); - } - - /// - /// Returns the collection of parts that will be added. - /// - /// The parts to be added. - public ReadOnlyCollection PartsToAdd - { - get - { - lock (this._lock) - { - this._copyNeededForAdd = true; - return this._readOnlyPartsToAdd; - } - } - } - - /// - /// Returns the collection of parts that will be removed. - /// - /// The parts to be removed. - public ReadOnlyCollection PartsToRemove - { - get - { - lock (this._lock) - { - this._copyNeededForRemove = true; - return this._readOnlyPartsToRemove; - } - } - } - - /// - /// Adds the specified part to the . - /// - /// - /// The part. - /// - /// - /// is . - /// - public void AddPart(ComposablePart part) - { - Requires.NotNull(part, "part"); - lock (this._lock) - { - if (this._copyNeededForAdd) - { - this._partsToAdd = new List(this._partsToAdd); - this._readOnlyPartsToAdd = this._partsToAdd.AsReadOnly(); - this._copyNeededForAdd = false; - } - this._partsToAdd.Add(part); - } - } - - /// - /// Removes the specified part from the . - /// - /// - /// The part. - /// - /// - /// is . - /// - public void RemovePart(ComposablePart part) - { - Requires.NotNull(part, "part"); - lock (this._lock) - { - if (this._copyNeededForRemove) - { - this._partsToRemove = new List(this._partsToRemove); - this._readOnlyPartsToRemove = this._partsToRemove.AsReadOnly(); - this._copyNeededForRemove = false; - } - this._partsToRemove.Add(part); - } - } - - /// - /// Adds the specified export to the . - /// - /// - /// The to add to the . - /// - /// - /// A that can be used remove the - /// from the . - /// - /// - /// is . - /// - /// - /// - public ComposablePart AddExport(Export export) - { - Requires.NotNull(export, "export"); - - ComposablePart part = new SingleExportComposablePart(export); - - this.AddPart(part); - - return part; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionConstants.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionConstants.cs deleted file mode 100644 index e8cbaa144a2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionConstants.cs +++ /dev/null @@ -1,20 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Hosting -{ - public static class CompositionConstants - { - private const string CompositionNamespace = "System.ComponentModel.Composition"; - - public const string PartCreationPolicyMetadataName = CompositionNamespace + ".CreationPolicy"; - public const string ExportTypeIdentityMetadataName = "ExportTypeIdentity"; - internal const string ProductDefinitionMetadataName = "ProductDefinition"; - - internal const string PartCreatorContractName = CompositionNamespace + ".Contracts.ExportFactory"; - internal static readonly string PartCreatorTypeIdentity = AttributedModelServices.GetTypeIdentity(typeof(ComposablePartDefinition)); - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionContainer.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionContainer.cs deleted file mode 100644 index bdbd5c0595d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionContainer.cs +++ /dev/null @@ -1,410 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using Microsoft.Internal; -using Microsoft.Internal.Collections; -using System.Threading; - -namespace System.ComponentModel.Composition.Hosting -{ - public partial class CompositionContainer : ExportProvider, ICompositionService, IDisposable - { - private ImportEngine _importEngine; - private ComposablePartExportProvider _partExportProvider; - private AggregateExportProvider _aggregatingExportProvider; - private ExportProvider _rootProvider; - private CatalogExportProvider _catalogExportProvider; - private readonly ReadOnlyCollection _providers; - private volatile int _isDisposed = 0; - - /// - /// Initializes a new instance of the class. - /// - public CompositionContainer() - : this((ComposablePartCatalog)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified export providers. - /// - /// - /// A of objects which provide - /// the access to objects, - /// or to set to an empty - /// . - /// - /// - /// contains an element that is . - /// - public CompositionContainer(params ExportProvider[] providers) : - this((ComposablePartCatalog)null, providers) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified catalog and export providers. - /// - /// - /// A of objects which provide - /// the access to objects, - /// or to set to an empty - /// . - /// - /// - /// contains an element that is . - /// - public CompositionContainer(ComposablePartCatalog catalog, params ExportProvider[] providers): - this(catalog, false, providers) - { - } - - public CompositionContainer(ComposablePartCatalog catalog, bool isThreadSafe, params ExportProvider[] providers) - { - this._importEngine = new ImportEngine(this, isThreadSafe); - this._partExportProvider = new ComposablePartExportProvider(isThreadSafe); - this._partExportProvider.SourceProvider = this; - this._providers = new ReadOnlyCollection(providers != null ? (ExportProvider[])providers.Clone() : new ExportProvider[0]); - - List providerList = new List(); - - providerList.Add(this._partExportProvider); - - if (catalog != null) - { - this._catalogExportProvider = new CatalogExportProvider(catalog, isThreadSafe); - this._catalogExportProvider.SourceProvider = this; - - providerList.Add(this._catalogExportProvider); - } - - foreach (var provider in this._providers) - { - if (provider == null) - { - throw ExceptionBuilder.CreateContainsNullElement("providers"); - } - providerList.Add(provider); - } - - // we only build the aggregating provider if necessary - that is, if we have more than one provider to aggregate - if (providerList.Count > 1) - { - this._aggregatingExportProvider = new AggregateExportProvider(providerList); - this._rootProvider = this._aggregatingExportProvider; - } - else - { - Assumes.IsTrue(providerList.Count == 1); - this._rootProvider = providerList[0]; - } - - this._rootProvider.ExportsChanged += this.OnExportsChangedInternal; - this._rootProvider.ExportsChanging += this.OnExportsChangingInternal; - } - - /// - /// Gets the catalog which provides the container access to exports produced - /// from composable parts. - /// - /// - /// The which provides the - /// access to exports produced from - /// objects. The default is . - /// - /// - /// The has been disposed of. - /// - public ComposablePartCatalog Catalog - { - get - { - ThrowIfDisposed(); - - if (_catalogExportProvider != null) - { - return _catalogExportProvider.Catalog; - } - - return null; - } - } - - /// - /// Gets the export providers which provide the container access to additional exports. - /// - /// - /// A of objects - /// which provide the access to additional - /// objects. The default is an empty - /// . - /// - /// - /// The has been disposed of. - /// - public ReadOnlyCollection Providers - { - get - { - this.ThrowIfDisposed(); - - return this._providers; - } - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases unmanaged and - optionally - managed resources - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // NOTE : According to http://msdn.microsoft.com/en-us/library/4bw5ewxy.aspx, the warning is bogus when used with Interlocked API. -#pragma warning disable 420 - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) -#pragma warning restore 420 - { - this._rootProvider.ExportsChanged -= this.OnExportsChangedInternal; - this._rootProvider.ExportsChanging -= this.OnExportsChangingInternal; - if (this._aggregatingExportProvider != null) - { - this._aggregatingExportProvider.Dispose(); - } - this._partExportProvider.Dispose(); - if (this._catalogExportProvider != null) - { - this._catalogExportProvider.Dispose(); - } - this._importEngine.Dispose(); - } - } - } - - public void Compose(CompositionBatch batch) - { - Requires.NotNull(batch, "batch"); - - this.ThrowIfDisposed(); - this._partExportProvider.Compose(batch); - } - - /// - /// Releases the from the . The behavior - /// may vary depending on the implementation of the that produced - /// the instance. As a general rule non shared exports should be early - /// released causing them to be detached from the container. - /// - /// For example the will only release - /// an if it comes from a that was constructed - /// under a context. Release in this context means walking - /// the dependency chain of the s, detaching references from the container and - /// calling Dispose on the s as needed. If the - /// was constructed under a context the - /// will do nothing as it may be in use by other requestors. - /// Those will only be detached when the container is itself disposed. - /// - /// that needs to be released. - /// - /// is . - /// - [SuppressMessage("Microsoft.Performance", "CA1822")] - public void ReleaseExport(Export export) - { - Requires.NotNull(export, "export"); - - IDisposable dependency = export as IDisposable; - - if (dependency != null) - { - dependency.Dispose(); - } - } - - /// - /// Releases the from the . The behavior - /// may vary depending on the implementation of the that produced - /// the instance. As a general rule non shared exports should be early - /// released causing them to be detached from the container. - /// - /// For example the will only release - /// an if it comes from a that was constructed - /// under a context. Release in this context means walking - /// the dependency chain of the s, detaching references from the container and - /// calling Dispose on the s as needed. If the - /// was constructed under a context the - /// will do nothing as it may be in use by other requestors. - /// Those will only be detached when the container is itself disposed. - /// - /// that needs to be released. - /// - /// is . - /// - [SuppressMessage("Microsoft.Performance", "CA1822")] - public void ReleaseExport(Lazy export) - { - Requires.NotNull(export, "export"); - - IDisposable dependency = export as IDisposable; - - if (dependency != null) - { - dependency.Dispose(); - } - } - - /// - /// Releases a set of s from the . - /// See also . - /// - /// s that need to be released. - /// - /// is . - /// - /// - /// contains an element that is . - /// - public void ReleaseExports(IEnumerable exports) - { - Requires.NotNullOrNullElements(exports, "exports"); - - foreach (Export export in exports) - { - this.ReleaseExport(export); - } - } - - /// - /// Releases a set of s from the . - /// See also . - /// - /// s that need to be released. - /// - /// is . - /// - /// - /// contains an element that is . - /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public void ReleaseExports(IEnumerable> exports) - { - Requires.NotNullOrNullElements(exports, "exports"); - - foreach (Lazy export in exports) - { - this.ReleaseExport(export); - } - } - - /// - /// Releases a set of s from the . - /// See also . - /// - /// s that need to be released. - /// - /// is . - /// - /// - /// contains an element that is . - /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public void ReleaseExports(IEnumerable> exports) - { - Requires.NotNullOrNullElements(exports, "exports"); - - foreach (Lazy export in exports) - { - this.ReleaseExport(export); - } - } - - /// - /// Sets the imports of the specified composable part exactly once and they will not - /// ever be recomposed. - /// - /// - /// The to set the imports. - /// - /// - /// is . - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - /// - /// The has been disposed of. - /// - public void SatisfyImportsOnce(ComposablePart part) - { - this.ThrowIfDisposed(); - this._importEngine.SatisfyImportsOnce(part); - } - - internal void OnExportsChangedInternal(object sender, ExportsChangeEventArgs e) - { - this.OnExportsChanged(e); - } - - internal void OnExportsChangingInternal(object sender, ExportsChangeEventArgs e) - { - this.OnExportsChanging(e); - } - - /// - /// Returns all exports that match the conditions of the specified import. - /// - /// The that defines the conditions of the - /// to get. - /// - /// - /// An of objects that match - /// the conditions defined by , if found; otherwise, an - /// empty . - /// - /// - /// - /// The implementers should not treat the cardinality-related mismatches as errors, and are not - /// expected to throw exceptions in those cases. - /// For instance, if the import requests exactly one export and the provider has no matching exports or more than one, - /// it should return an empty of . - /// - /// - protected override IEnumerable GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition) - { - this.ThrowIfDisposed(); - - IEnumerable exports = null; - this._rootProvider.TryGetExports(definition, atomicComposition, out exports); - - return exports; - } - - [DebuggerStepThrough] - private void ThrowIfDisposed() - { - if (this._isDisposed == 1) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionLock.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionLock.cs deleted file mode 100644 index b3dd0ea062f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionLock.cs +++ /dev/null @@ -1,153 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#define SINGLETHREADEDLOCKENFORCEMENT -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics; -using System.Linq; -using System.Runtime.CompilerServices; -using Microsoft.Internal; -using Microsoft.Internal.Collections; -using System.Threading; - -namespace System.ComponentModel.Composition.Hosting -{ - // This a a lock class that needs to be held in order to perform any mutation of the parts/parts state in the composition - // Today's implementation relies on the AppDomain-wide re-entrant lock for changes on the composition, and a narrow lock for changes in - // the state of the specific ImportEngine - // Today we make several assumptions to ensure thread-safety: - // 1. Each composition doesn't change lock affinity - // 2. Every part of the system that updates the status of the parts (in our case ImportEngine) needs to hold the same wide - lock - // 3. State of the import engine that gets accessed outside of the wide lock needs to be accessed in the context of the narrow lock - // 4. Narrow lock CAN be taken inside the wide lock - // 5. Wide lock CANNOT be taken inside the narrow lock - // 6. No 3rd party code will EVER get called inside the narrow lock - // Sadly, this means that we WILL be calling 3rd party code under a lock, but as long as the lock is re-entrant and they can't invoke us on anotehr thread - // we have no issue, other than potential overlocking - internal sealed class CompositionLock : IDisposable - { - // narrow lock - private readonly Lock _stateLock = null; - // wide lock - private static object _compositionLock = new object(); - - private int _isDisposed = 0; - private bool _isThreadSafe = false; - - private static readonly EmptyLockHolder _EmptyLockHolder = new EmptyLockHolder(); - - public CompositionLock(bool isThreadSafe) - { - this._isThreadSafe = isThreadSafe; - if (isThreadSafe) - { - this._stateLock = new Lock(); - } - } - - public void Dispose() - { - if (this._isThreadSafe) - { - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) - { - this._stateLock.Dispose(); - } - } - } - - public bool IsThreadSafe - { - get - { - return this._isThreadSafe; - } - } - - private void EnterCompositionLock() - { -#pragma warning disable 618 - if (this._isThreadSafe) - { - Monitor.Enter(_compositionLock); - } -#pragma warning restore 618 - } - - private void ExitCompositionLock() - { - if (this._isThreadSafe) - { - Monitor.Exit(_compositionLock); - } - } - - public IDisposable LockComposition() - { - if (this._isThreadSafe) - { - return new CompositionLockHolder(this); - } - else - { - return _EmptyLockHolder; - } - } - - public IDisposable LockStateForRead() - { - if (this._isThreadSafe) - { - return new ReadLock(this._stateLock); - } - else - { - return _EmptyLockHolder; - } - } - - public IDisposable LockStateForWrite() - { - if (this._isThreadSafe) - { - return new WriteLock(this._stateLock); - } - else - { - return _EmptyLockHolder; - } - } - - // NOTE : this should NOT be changed to a struct as ImportEngine relies on it - public sealed class CompositionLockHolder : IDisposable - { - private CompositionLock _lock; - private int _isDisposed; - - public CompositionLockHolder(CompositionLock @lock) - { - this._lock = @lock; - - this._isDisposed = 0; - this._lock.EnterCompositionLock(); - } - - public void Dispose() - { - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) - { - this._lock.ExitCompositionLock(); - } - } - } - - private sealed class EmptyLockHolder : IDisposable - { - public void Dispose() - { - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionServices.cs deleted file mode 100644 index 5a7d9851e57..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionServices.cs +++ /dev/null @@ -1,522 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.Primitives; -using System.Globalization; -using System.Linq; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition.ReflectionModel; - -namespace System.ComponentModel.Composition.Hosting -{ - internal static class CompositionServices - { - internal static readonly Type InheritedExportAttributeType = typeof(InheritedExportAttribute); - internal static readonly Type ExportAttributeType = typeof(ExportAttribute); - internal static readonly Type AttributeType = typeof(Attribute); - internal static readonly Type ObjectType = typeof(object); - - private static readonly string[] reservedMetadataNames = new string[] - { - CompositionConstants.PartCreationPolicyMetadataName - }; - - internal static Type GetDefaultTypeFromMember(this MemberInfo member) - { - Assumes.NotNull(member); - - switch (member.MemberType) - { - case MemberTypes.Property: - return ((PropertyInfo)member).PropertyType; - - case MemberTypes.NestedType: - case MemberTypes.TypeInfo: - return ((Type)member); - - case MemberTypes.Field: - default: - Assumes.IsTrue(member.MemberType == MemberTypes.Field); - return ((FieldInfo)member).FieldType; - } - } - - internal static string GetContractNameFromExport(this MemberInfo member, ExportAttribute export) - { - if (!string.IsNullOrEmpty(export.ContractName)) - { - return export.ContractName; - } - - if (export.ContractType != null) - { - return AttributedModelServices.GetContractName(export.ContractType); - } - - if (member.MemberType == MemberTypes.Method) - { - return AttributedModelServices.GetTypeIdentity((MethodInfo)member); - } - - return AttributedModelServices.GetContractName(member.GetDefaultTypeFromMember()); - } - - internal static string GetTypeIdentityFromExport(this MemberInfo member, ExportAttribute export) - { - if (export.ContractType != null) - { - return AttributedModelServices.GetTypeIdentity(export.ContractType); - } - - if (member.MemberType == MemberTypes.Method) - { - return AttributedModelServices.GetTypeIdentity((MethodInfo)member); - } - - return AttributedModelServices.GetTypeIdentity(member.GetDefaultTypeFromMember()); - } - - internal static Type GetContractTypeFromImport(this IAttributedImport import, ImportType importType) - { - if (import.ContractType != null) - { - return import.ContractType; - } - - return importType.ContractType; - } - - internal static string GetContractNameFromImport(this IAttributedImport import, ImportType importType) - { - if (!string.IsNullOrEmpty(import.ContractName)) - { - return import.ContractName; - } - - Type contractType = import.GetContractTypeFromImport(importType); - - return AttributedModelServices.GetContractName(contractType); - } - - internal static string GetTypeIdentityFromImport(this IAttributedImport import, ImportType importType) - { - Type contractType = import.GetContractTypeFromImport(importType); - - // For our importers we treat object as not having a type identity - if (contractType == CompositionServices.ObjectType) - { - return null; - } - - return AttributedModelServices.GetTypeIdentity(contractType); - } - - internal static IDictionary GetPartMetadataForType(this Type type, CreationPolicy creationPolicy) - { - IDictionary dictionary = new Dictionary(StringComparers.MetadataKeyNames); - - if (creationPolicy != CreationPolicy.Any) - { - dictionary.Add(CompositionConstants.PartCreationPolicyMetadataName, creationPolicy); - } - - foreach (PartMetadataAttribute partMetadata in type.GetAttributes()) - { - if (reservedMetadataNames.Contains(partMetadata.Name, StringComparers.MetadataKeyNames) - || dictionary.ContainsKey(partMetadata.Name)) - { - // Perhaps we should log an error here so that people know this value is being ignored. - continue; - } - - dictionary.Add(partMetadata.Name, partMetadata.Value); - } - - if (dictionary.Count == 0) - { - return MetadataServices.EmptyMetadata; - } - else - { - return dictionary; - } - } - - internal static void TryExportMetadataForMember(this MemberInfo member, out IDictionary dictionary) - { - dictionary = new Dictionary(); - - foreach (var attr in member.GetAttributes()) - { - var provider = attr as ExportMetadataAttribute; - - if (provider != null) - { - if (reservedMetadataNames.Contains(provider.Name, StringComparers.MetadataKeyNames)) - { - throw ExceptionBuilder.CreateDiscoveryException(Strings.Discovery_ReservedMetadataNameUsed, member.GetDisplayName(), provider.Name); - } - - // we pass "null" for valueType which would make it inferred. We don;t have additional type information when metadata - // goes through the ExportMetadataAttribute path - if (!dictionary.TryContributeMetadataValue(provider.Name, provider.Value, null, provider.IsMultiple)) - { - throw ExceptionBuilder.CreateDiscoveryException(Strings.Discovery_DuplicateMetadataNameValues, member.GetDisplayName(), provider.Name); - } - } - else - { - Type attrType = attr.GetType(); - if ((attrType != CompositionServices.ExportAttributeType) && attrType.IsAttributeDefined(true)) - { - bool allowsMultiple = false; - AttributeUsageAttribute usage = attrType.GetFirstAttribute(true); - - if (usage != null) - { - allowsMultiple = usage.AllowMultiple; - } - - foreach (PropertyInfo pi in attrType.GetProperties()) - { - if (pi.DeclaringType == CompositionServices.ExportAttributeType || pi.DeclaringType == CompositionServices.AttributeType) - { - // Don't contribute metadata properies from the base attribute types. - continue; - } - - if (reservedMetadataNames.Contains(pi.Name, StringComparers.MetadataKeyNames)) - { - throw ExceptionBuilder.CreateDiscoveryException(Strings.Discovery_ReservedMetadataNameUsed, member.GetDisplayName(), provider.Name); - } - - object value = pi.GetValue(attr, null); - - if (value != null && !IsValidAttributeType(value.GetType())) - { - throw ExceptionBuilder.CreateDiscoveryException(Strings.Discovery_MetadataContainsValueWithInvalidType, pi.GetDisplayName(), value.GetType().GetDisplayName()); - } - - if (!dictionary.TryContributeMetadataValue(pi.Name, value, pi.PropertyType, allowsMultiple)) - { - throw ExceptionBuilder.CreateDiscoveryException(Strings.Discovery_DuplicateMetadataNameValues, member.GetDisplayName(), pi.Name); - } - } - } - } - } - - // Need Keys.ToArray because we alter the dictionary in the loop - foreach (var key in dictionary.Keys.ToArray()) - { - var list = dictionary[key] as MetadataList; - if (list != null) - { - dictionary[key] = list.ToArray(); - } - } - - return; - } - - private static bool TryContributeMetadataValue(this IDictionary dictionary, string name, object value, Type valueType, bool allowsMultiple) - { - object metadataValue; - if (!dictionary.TryGetValue(name, out metadataValue)) - { - if (allowsMultiple) - { - var list = new MetadataList(); - list.Add(value, valueType); - value = list; - } - - dictionary.Add(name, value); - } - else - { - var list = metadataValue as MetadataList; - if (!allowsMultiple || list == null) - { - // Either single value already found when should be multiple - // or a duplicate name already exists - dictionary.Remove(name); - return false; - } - - list.Add(value, valueType); - } - return true; - } - - private class MetadataList - { - private Type _arrayType = null; - private bool _containsNulls = false; - private static readonly Type ObjectType = typeof(object); - private static readonly Type TypeType = typeof(Type); - private Collection _innerList = new Collection(); - - public void Add(object item, Type itemType) - { - this._containsNulls |= (item == null); - - // if we've been passed typeof(object), we basically have no type inmformation - if (itemType == ObjectType) - { - itemType = null; - } - - // if we have no type information, get it from the item, if we can - if ((itemType == null) && (item != null)) - { - itemType = item.GetType(); - } - - // Types are special, because the are abstract classes, so if the item casts to Type, we assume System.Type - if (item is Type) - { - itemType = TypeType; - } - - // only try to call this if we got a meaningful type - if (itemType != null) - { - this.InferArrayType(itemType); - } - - this._innerList.Add(item); - } - - private void InferArrayType(Type itemType) - { - Assumes.NotNull(itemType); - - if (this._arrayType == null) - { - // this is the first typed element we've been given, it sets the type of the array - this._arrayType = itemType; - } - else - { - // if there's a disagreement on the array type, we flip to Object - // NOTE : we can try to do better in the future to find common base class, but given that we support very limited set of types - // in metadata right now, it's a moot point - if (this._arrayType != itemType) - { - this._arrayType = ObjectType; - } - } - } - - public Array ToArray() - { - if (this._arrayType == null) - { - // if the array type has not been set, assume Object - this._arrayType = ObjectType; - } - else if (this._containsNulls && this._arrayType.IsValueType) - { - // if the array type is a value type and we have seen nulls, then assume Object - this._arrayType = ObjectType; - } - - Array array = Array.CreateInstance(this._arrayType, this._innerList.Count); - - for(int i = 0; i < array.Length; i++) - { - array.SetValue(this._innerList[i], i); - } - return array; - } - } - - //UNDONE: Need to add these warnings somewhere...Dev10:472538 should address this. - //internal static CompositionResult MatchRequiredMetadata(this IDictionary metadata, IEnumerable requiredMetadata, string contractName) - //{ - // Assumes.IsTrue(metadata != null); - - // var result = CompositionResult.SucceededResult; - - // var missingMetadata = (requiredMetadata == null) ? null : requiredMetadata.Except(metadata.Keys); - // if (missingMetadata != null && missingMetadata.Any()) - // { - // result = result.MergeIssue( - // CompositionError.CreateIssueAsWarning(CompositionErrorId.RequiredMetadataNotFound, - // Strings.RequiredMetadataNotFound, - // contractName, - // string.Join(", ", missingMetadata.ToArray()))); - - // return new CompositionResult(false, result.Issues); - // } - - // return result; - //} - - internal static IEnumerable> GetRequiredMetadata(Type metadataViewType) - { - if ((metadataViewType == null) || - ExportServices.IsDefaultMetadataViewType(metadataViewType) || - ExportServices.IsDictionaryConstructorViewType(metadataViewType) || - !metadataViewType.IsInterface) - { - return Enumerable.Empty>(); - } - - // A metadata view is required to be an Intrerface, and therefore only properties are allowed - List properties = metadataViewType.GetAllProperties(). - Where(property => property.GetFirstAttribute() == null). - ToList(); - - // NOTE : this is a carefully found balance between eager and delay-evaluation - the properties are filtered once and upfront - // whereas the key/Type pairs are created every time. The latter is fine as KVPs are structs and as such copied on access regardless. - // This also allows us to avoid creation of List which - at least according to FxCop - leads to isues with NGEN - return properties.Select(property => new KeyValuePair(property.Name, property.PropertyType)); - } - - internal static object GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition) - { - try - { - engine.SatisfyImports(part); - } - catch (CompositionException ex) - { - throw ExceptionBuilder.CreateCannotGetExportedValue(part, definition, ex); - } - - try - { - return part.GetExportedValue(definition); - } - catch (ComposablePartException ex) - { - throw ExceptionBuilder.CreateCannotGetExportedValue(part, definition, ex); - } - } - - internal static bool IsRecomposable(this ComposablePart part) - { - return part.ImportDefinitions.Any(import => import.IsRecomposable); - } - - internal static CompositionResult TryInvoke(Func action) - { - try - { - T value = action(); - return new CompositionResult(value); - } - catch (CompositionException ex) - { - return new CompositionResult(ex.Errors); - } - } - - internal static CompositionResult TryInvoke(Action action) - { - try - { - action(); - return CompositionResult.SucceededResult; - } - catch (CompositionException ex) - { - return new CompositionResult(ex.Errors); - } - } - - internal static CompositionResult TryFire(EventHandler _delegate, object sender, TEventArgs e) - where TEventArgs : EventArgs - { - CompositionResult result = CompositionResult.SucceededResult; - foreach (EventHandler _subscriber in _delegate.GetInvocationList()) - { - try - { - _subscriber.Invoke(sender, e); - } - catch (CompositionException ex) - { - result = result.MergeErrors(ex.Errors); - } - } - - return result; - } - - internal static CreationPolicy GetRequiredCreationPolicy(this ImportDefinition definition) - { - ContractBasedImportDefinition contractDefinition = definition as ContractBasedImportDefinition; - - if (contractDefinition != null) - { - return contractDefinition.RequiredCreationPolicy; - } - - return CreationPolicy.Any; - } - - /// - /// Returns a value indicating whether cardinality is - /// or - /// . - /// - internal static bool IsAtMostOne(this ImportCardinality cardinality) - { - return cardinality == ImportCardinality.ZeroOrOne || cardinality == ImportCardinality.ExactlyOne; - } - - private static bool IsValidAttributeType(Type type) - { - return IsValidAttributeType(type, true); - } - - private static bool IsValidAttributeType(Type type, bool arrayAllowed) - { - Assumes.NotNull(type); - // Definitions of valid attribute type taken from C# 3.0 Specification section 17.1.3. - - // One of the following types: bool, byte, char, double, float, int, long, sbyte, short, string, uint, ulong, ushort. - if (type.IsPrimitive) - { - return true; - } - - if (type == typeof(string)) - { - return true; - } - - // An enum type, provided it has public accessibility and the types in which it is nested (if any) also have public accessibility - if (type.IsEnum && type.IsVisible) - { - return true; - } - - if (typeof(Type).IsAssignableFrom(type)) - { - return true; - } - - // Single-dimensional arrays of the above types. - if (arrayAllowed && type.IsArray && - type.GetArrayRank() == 1 && - IsValidAttributeType(type.GetElementType(), false)) - { - return true; - } - - return false; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.DirectoryCatalogDebuggerProxy.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.DirectoryCatalogDebuggerProxy.cs deleted file mode 100644 index 074cf6166d8..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.DirectoryCatalogDebuggerProxy.cs +++ /dev/null @@ -1,71 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using System.Linq; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.Hosting -{ - partial class DirectoryCatalog - { - internal class DirectoryCatalogDebuggerProxy - { - private readonly DirectoryCatalog _catalog; - - public DirectoryCatalogDebuggerProxy(DirectoryCatalog catalog) - { - Requires.NotNull(catalog, "catalog"); - - this._catalog = catalog; - } - - public ReadOnlyCollection Assemblies - { - get - { - return this._catalog._assemblyCatalogs.Values.Select(catalog => catalog.Assembly) - .ToReadOnlyCollection(); - } - } - - public string SearchPattern - { - get { return this._catalog.SearchPattern; } - } - - public string Path - { - get { return this._catalog._path; } - } - - public string FullPath - { - get { return this._catalog._fullPath; } - } - - public ReadOnlyCollection LoadedFiles - { - get { return this._catalog._loadedFiles; } - } - - public ReadOnlyCollection Parts - { - // NOTE: This shouldn't be cached, so that on every query of - // the current value of the underlying catalog is respected. - // We use ReadOnlyCollection as arrays do not have the - // appropriate debugger display attributes applied to them. - get { return this._catalog.Parts.ToReadOnlyCollection(); } - } - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs deleted file mode 100644 index be49bdbfca9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs +++ /dev/null @@ -1,542 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !SILVERLIGHT - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel.Composition.Diagnostics; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -using IOPath = System.IO.Path; - -namespace System.ComponentModel.Composition.Hosting -{ - [DebuggerTypeProxy(typeof(DirectoryCatalogDebuggerProxy))] - public partial class DirectoryCatalog : ComposablePartCatalog, INotifyComposablePartCatalogChanged, ICompositionElement - { - private readonly Lock _thisLock = new Lock(); - private ComposablePartCatalogCollection _catalogCollection; - private Dictionary _assemblyCatalogs; - private volatile bool _isDisposed = false; - private string _path; - private string _fullPath; - private string _searchPattern; - private ReadOnlyCollection _loadedFiles; - private IQueryable _partsQuery; - - /// - /// Creates a catalog of s based on all the *.dll files - /// in the given directory path. - /// - /// Possible exceptions that can be thrown are any that or - /// can throw. - /// - /// - /// Path to the directory to scan for assemblies to add to the catalog. - /// The path needs to be absolute or relative to - /// - /// - /// If is a zero-length string, contains only white space, or - /// contains one or more implementation-specific invalid characters. - /// - /// - /// is . - /// - /// - /// The specified is invalid (for example, it is on an unmapped drive). - /// - /// - /// The specified , file name, or both exceed the system-defined maximum length. - /// For example, on Windows-based platforms, paths must be less than 248 characters and file names must - /// be less than 260 characters. - /// - /// - /// The caller does not have the required permission. - /// - public DirectoryCatalog(string path) : this(path, "*.dll") - { - } - - /// - /// Creates a catalog of s based on all the given searchPattern - /// over the files in the given directory path. - /// - /// Possible exceptions that can be thrown are any that or - /// can throw. - /// - /// - /// Path to the directory to scan for assemblies to add to the catalog. - /// The path needs to be absolute or relative to - /// - /// - /// Any valid searchPattern that will accept. - /// - /// - /// If is a zero-length string, contains only white space, or - /// contains one or more implementation-specific invalid characters. Or - /// does not contain a valid pattern. - /// - /// - /// is or is . - /// - /// - /// The specified is invalid (for example, it is on an unmapped drive). - /// - /// - /// The specified , file name, or both exceed the system-defined maximum length. - /// For example, on Windows-based platforms, paths must be less than 248 characters and file names must - /// be less than 260 characters. - /// - /// - /// The caller does not have the required permission. - /// - public DirectoryCatalog(string path, string searchPattern) - { - Requires.NotNullOrEmpty(path, "path"); - this.Initialize(path, searchPattern); - } - - /// - /// Translated absolute path of the path passed into the constructor of . - /// - public string FullPath - { - get - { - return this._fullPath; - } - } - - /// - /// Set of files that have currently been loaded into the catalog. - /// - public ReadOnlyCollection LoadedFiles - { - get - { - using (new ReadLock(this._thisLock)) - { - return this._loadedFiles; - } - } - } - - /// - /// Path passed into the constructor of . - /// - public string Path - { - get - { - return this._path; - } - } - - /// - /// Gets the part definitions of the directory catalog. - /// - /// - /// A of objects of the - /// . - /// - /// - /// The has been disposed of. - /// - public override IQueryable Parts - { - get - { - this.ThrowIfDisposed(); - return this._partsQuery; - } - } - - /// - /// SearchPattern passed into the constructor of , or the default *.dll. - /// - public string SearchPattern - { - get - { - return this._searchPattern; - } - } - - /// - /// Notify when the contents of the Catalog has changed. - /// - public event EventHandler Changed; - - /// - /// Notify when the contents of the Catalog has changing. - /// - public event EventHandler Changing; - - /// - /// Releases unmanaged and - optionally - managed resources - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected override void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (!this._isDisposed) - { - bool disposeLock = false; - ComposablePartCatalogCollection catalogs = null; - - try - { - using (new WriteLock(this._thisLock)) - { - if (!this._isDisposed) - { - disposeLock = true; - catalogs = this._catalogCollection; - this._catalogCollection = null; - this._assemblyCatalogs = null; - this._isDisposed = true; - } - } - } - finally - { - if (catalogs != null) - { - catalogs.Dispose(); - } - - if (disposeLock) - { - this._thisLock.Dispose(); - } - } - } - } - } - finally - { - base.Dispose(disposing); - } - } - - /// - /// Returns the export definitions that match the constraint defined by the specified definition. - /// - /// - /// The that defines the conditions of the - /// objects to return. - /// - /// - /// An of containing the - /// objects and their associated - /// for objects that match the constraint defined - /// by . - /// - /// - /// is . - /// - /// - /// The has been disposed of. - /// - public override IEnumerable> GetExports(ImportDefinition definition) - { - this.ThrowIfDisposed(); - - Requires.NotNull(definition, "definition"); - - return this._catalogCollection.SelectMany(catalog => catalog.GetExports(definition)); - } - - /// - /// Raises the event. - /// - /// - /// An containing the data for the event. - /// - protected virtual void OnChanged(ComposablePartCatalogChangeEventArgs e) - { - EventHandler changedEvent = this.Changed; - if (changedEvent != null) - { - changedEvent(this, e); - } - } - - /// - /// Raises the event. - /// - /// - /// An containing the data for the event. - /// - protected virtual void OnChanging(ComposablePartCatalogChangeEventArgs e) - { - EventHandler changingEvent = this.Changing; - if (changingEvent != null) - { - changingEvent(this, e); - } - } - - /// - /// Refreshes the s with the latest files in the directory that match - /// the searchPattern. If any files have been added they will be added to the catalog and if any files were - /// removed they will be removed from the catalog. For files that have been removed keep in mind that the - /// assembly cannot be unloaded from the process so s for those files - /// will simply be removed from the catalog. - /// - /// Possible exceptions that can be thrown are any that or - /// can throw. - /// - /// - /// The specified has been removed since object construction. - /// - public void Refresh() - { - this.ThrowIfDisposed(); - Assumes.NotNull(this._loadedFiles); - - List> catalogsToAdd; - List> catalogsToRemove; - ComposablePartDefinition[] addedDefinitions; - ComposablePartDefinition[] removedDefinitions; - object changeReferenceObject; - string[] afterFiles; - string[] beforeFiles; - - while (true) - { - afterFiles = this.GetFiles(); - - using (new ReadLock(this._thisLock)) - { - changeReferenceObject = this._loadedFiles; - beforeFiles = this._loadedFiles.ToArray(); - } - - this.DiffChanges(beforeFiles, afterFiles, out catalogsToAdd, out catalogsToRemove); - - // Don't go any further if there's no work to do - if (catalogsToAdd.Count == 0 && catalogsToRemove.Count == 0) - { - return; - } - - // Notify listeners to give them a preview before completeting the changes - addedDefinitions = catalogsToAdd - .SelectMany(cat => cat.Item2.Parts) - .ToArray(); - - removedDefinitions = catalogsToRemove - .SelectMany(cat => cat.Item2.Parts) - .ToArray(); - - using (var atomicComposition = new AtomicComposition()) - { - var changingArgs = new ComposablePartCatalogChangeEventArgs(addedDefinitions, removedDefinitions, atomicComposition); - this.OnChanging(changingArgs); - - // if the change went through then write the catalog changes - using (new WriteLock(this._thisLock)) - { - if (changeReferenceObject != this._loadedFiles) - { - // Someone updated the list while we were diffing so we need to try the diff again - continue; - } - - foreach (var catalogToAdd in catalogsToAdd) - { - this._assemblyCatalogs.Add(catalogToAdd.Item1, catalogToAdd.Item2); - this._catalogCollection.Add(catalogToAdd.Item2); - } - - foreach (var catalogToRemove in catalogsToRemove) - { - this._assemblyCatalogs.Remove(catalogToRemove.Item1); - this._catalogCollection.Remove(catalogToRemove.Item2); - } - - this._partsQuery = this._catalogCollection.AsQueryable().SelectMany(catalog => catalog.Parts); - this._loadedFiles = afterFiles.ToReadOnlyCollection(); - - // Lastly complete any changes added to the atomicComposition during the change event - atomicComposition.Complete(); - - // Break out of the while(true) - break; - } // WriteLock - } // AtomicComposition - } // while (true) - - var changedArgs = new ComposablePartCatalogChangeEventArgs(addedDefinitions, removedDefinitions, null); - this.OnChanged(changedArgs); - } - - /// - /// Returns a string representation of the directory catalog. - /// - /// - /// A containing the string representation of the . - /// - public override string ToString() - { - return GetDisplayName(); - } - - private AssemblyCatalog CreateAssemblyCatalogGuarded(string assemblyFilePath) - { - Exception exception = null; - - try - { - return new AssemblyCatalog(assemblyFilePath, this); - } - catch (FileNotFoundException ex) - { // Files should always exists but don't blow up here if they don't - exception = ex; - } - catch (FileLoadException ex) - { // File was found but could not be loaded - exception = ex; - } - catch (BadImageFormatException ex) - { // Dlls that contain native code are not loaded, but do not invalidate the Directory - exception = ex; - } - catch (ReflectionTypeLoadException ex) - { // Dlls that have missing Managed dependencies are not loaded, but do not invalidate the Directory - exception = ex; - } - - CompositionTrace.AssemblyLoadFailed(this, assemblyFilePath, exception); - - return null; - } - - private void DiffChanges(string[] beforeFiles, string[] afterFiles, - out List> catalogsToAdd, - out List> catalogsToRemove) - { - catalogsToAdd = new List>(); - catalogsToRemove = new List>(); - - IEnumerable filesToAdd = afterFiles.Except(beforeFiles); - foreach (string file in filesToAdd) - { - AssemblyCatalog catalog = CreateAssemblyCatalogGuarded(file); - - if (catalog != null) - { - catalogsToAdd.Add(new Tuple(file, catalog)); - } - } - - IEnumerable filesToRemove = beforeFiles.Except(afterFiles); - using (new ReadLock(this._thisLock)) - { - foreach (string file in filesToRemove) - { - AssemblyCatalog catalog; - if (this._assemblyCatalogs.TryGetValue(file, out catalog)) - { - catalogsToRemove.Add(new Tuple(file, catalog)); - } - } - } - } - - private string GetDisplayName() - { - return string.Format(CultureInfo.CurrentCulture, - "{0} (Path=\"{1}\")", // NOLOC - this.GetType().Name, - this._path); - } - - private string[] GetFiles() - { - return Directory.GetFiles(this._fullPath, this._searchPattern); - } - - private static string GetFullPath(string path) - { - if (!IOPath.IsPathRooted(path) && AppDomain.CurrentDomain.BaseDirectory != null) - { - path = IOPath.Combine(AppDomain.CurrentDomain.BaseDirectory, path); - } - - return IOPath.GetFullPath(path); - } - - private void Initialize(string path, string searchPattern) - { - this._path = path; - this._fullPath = GetFullPath(path); - this._searchPattern = searchPattern; - this._assemblyCatalogs = new Dictionary(); - this._catalogCollection = new ComposablePartCatalogCollection(null); - - this._loadedFiles = GetFiles().ToReadOnlyCollection(); - - foreach (string file in this._loadedFiles) - { - AssemblyCatalog assemblyCatalog = null; - assemblyCatalog = CreateAssemblyCatalogGuarded(file); - - if (assemblyCatalog != null) - { - this._assemblyCatalogs.Add(file, assemblyCatalog); - this._catalogCollection.Add(assemblyCatalog); - } - } - this._partsQuery = this._catalogCollection.AsQueryable().SelectMany(catalog => catalog.Parts); - } - - private void ThrowIfDisposed() - { - if (this._isDisposed) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - - /// - /// Gets the display name of the directory catalog. - /// - /// - /// A containing a human-readable display name of the . - /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - string ICompositionElement.DisplayName - { - get { return this.GetDisplayName(); } - } - - /// - /// Gets the composition element from which the directory catalog originated. - /// - /// - /// This property always returns . - /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ICompositionElement ICompositionElement.Origin - { - get { return null; } - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs deleted file mode 100644 index 01f2175f331..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs +++ /dev/null @@ -1,817 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using System.Linq.Expressions; -using System.Collections.ObjectModel; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.Hosting -{ - public abstract partial class ExportProvider - { - /// - /// Returns the export with the contract name derived from the specified type parameter, - /// throwing an exception if there is not exactly one matching export. - /// - /// - /// The type of the object to return. The contract name is also - /// derived from this type parameter. - /// - /// - /// The object with the contract name derived from - /// . - /// - /// - /// - /// The returned object is an instance of - /// underneath, where - /// TMetadataView - /// is and where TKey - /// is and TValue is . - /// - /// - /// The contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// - /// There are zero objects with the contract name derived - /// from in the . - /// - /// -or- - /// - /// There are more than one objects with the contract name - /// derived from in the . - /// - /// - /// - /// The has been disposed of. - /// - public Lazy GetExport() - { - return this.GetExport((string)null); - } - - /// - /// Returns the export with the specified contract name, throwing an exception if there - /// is not exactly one matching export. - /// - /// - /// The type of the object to return. - /// - /// - /// A containing the contract name of the - /// object to return; or or an empty string ("") to use the - /// default contract name. - /// - /// - /// The object with the specified contract name. - /// - /// - /// - /// The returned object is an instance of - /// underneath, where - /// TMetadataView - /// is and where TKey - /// is and TValue is . - /// - /// - /// The contract name is the result of calling - /// on . - /// - /// - /// The default contract name is compared using a case-sensitive, non-linguistic - /// comparison using . - /// - /// - /// - /// - /// There are zero objects with the specified contract name - /// in the . - /// - /// -or- - /// - /// There are more than one objects with the specified contract - /// name in the . - /// - /// - /// - /// The has been disposed of. - /// - public Lazy GetExport(string contractName) - { - return this.GetExportCore(contractName); - } - - /// - /// Returns the export with the contract name derived from the specified type parameter, - /// throwing an exception if there is not exactly one matching export. - /// - /// - /// The type of the object to return. The - /// contract name is also derived from this type parameter. - /// - /// - /// The type of the metadata view of the object - /// to return. - /// - /// - /// The object with the contract name derived - /// from . - /// - /// - /// - /// The contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// - /// There are zero objects with the contract - /// name derived from in the - /// . - /// - /// -or- - /// - /// There are more than one objects with the - /// contract name derived from in the - /// . - /// - /// - /// - /// is not a valid metadata view type. - /// - /// - /// The has been disposed of. - /// - public Lazy GetExport() - { - return this.GetExport((string)null); - } - - /// - /// Returns the export with the specified contract name, throwing an exception if there - /// is not exactly one matching export. - /// - /// - /// The type of the object to return. - /// - /// - /// The type of the metadata view of the object - /// to return. - /// - /// - /// A containing the contract name of the - /// object to return; or - /// or an empty string ("") to use the default contract name. - /// - /// - /// The object with the specified contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// - /// There are zero objects with the - /// specified contract name in the . - /// - /// -or- - /// - /// There are more than one objects with the - /// specified contract name in the . - /// - /// - /// - /// is not a valid metadata view type. - /// - /// - /// The has been disposed of. - /// - public Lazy GetExport(string contractName) - { - return this.GetExportCore(contractName); - } - - /// - /// Returns the exports with the specified contract name. - /// - /// - /// The of the objects to return. - /// - /// - /// The of the metadata view of the objects to - /// return. - /// - /// - /// A containing the contract name of the - /// object to return; or - /// or an empty string ("") to use the default contract name. - /// - /// - /// An containing the objects - /// with the specified contract name, if found; otherwise, an empty - /// . - /// - /// - /// - /// The returned objects are instances of - /// underneath, where T - /// is and TMetadataView is - /// . - /// - /// - /// The default contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// is . - /// - /// - /// is not a valid metadata view type. - /// - /// - /// The has been disposed of. - /// - [SuppressMessage("Microsoft.Design", "CA1006")] - public IEnumerable> GetExports(Type type, Type metadataViewType, string contractName) - { - IEnumerable exports = this.GetExportsCore(type, metadataViewType, contractName, ImportCardinality.ZeroOrMore); - Collection> result = new Collection>(); - - Func> typedExportFactory = ExportServices.CreateSemiStronglyTypedLazyFactory(type, metadataViewType); - foreach (Export export in exports) - { - result.Add(typedExportFactory.Invoke(export)); - } - - return result; - } - - /// - /// Returns the exports with the contract name derived from the specified type parameter. - /// - /// - /// The type of the objects to return. The contract name is also - /// derived from this type parameter. - /// - /// - /// An containing the objects - /// with the contract name derived from , if found; otherwise, - /// an empty . - /// - /// - /// - /// The returned objects are instances of - /// underneath, where - /// TMetadataView - /// is and where TKey - /// is and TValue is . - /// - /// - /// The contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// The has been disposed of. - /// - [SuppressMessage("Microsoft.Design", "CA1006")] - public IEnumerable> GetExports() - { - return this.GetExports((string)null); - } - - /// - /// Returns the exports with the specified contract name. - /// - /// - /// The type of the objects to return. - /// - /// - /// A containing the contract name of the - /// objects to return; or or an empty string ("") to use the - /// default contract name. - /// - /// - /// An containing the objects - /// with the specified contract name, if found; otherwise, an empty - /// . - /// - /// - /// - /// The returned objects are instances of - /// underneath, where - /// TMetadataView - /// is and where TKey - /// is and TValue is . - /// - /// - /// The default contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// The has been disposed of. - /// - [SuppressMessage("Microsoft.Design", "CA1006")] - public IEnumerable> GetExports(string contractName) - { - return this.GetExportsCore(contractName); - } - - /// - /// Returns the exports with the contract name derived from the specified type parameter. - /// - /// - /// The type of the objects to return. The - /// contract name is also derived from this type parameter. - /// - /// - /// The type of the metadata view of the objects - /// to return. - /// - /// - /// An containing the - /// objects with the contract name derived from - /// , if found; otherwise, an empty - /// . - /// - /// - /// - /// The contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// is not a valid metadata view type. - /// - /// - /// The has been disposed of. - /// - [SuppressMessage("Microsoft.Design", "CA1006")] - public IEnumerable> GetExports() - { - return this.GetExports((string)null); - } - - /// - /// Returns the exports with the specified contract name. - /// - /// - /// The type of the objects to return. The - /// contract name is also derived from this type parameter. - /// - /// - /// The type of the metadata view of the objects - /// to return. - /// - /// - /// A containing the contract name of the - /// objects to return; or - /// or an empty string ("") to use the default contract name. - /// - /// - /// An containing the - /// objects with the specified contract name if - /// found; otherwise, an empty . - /// - /// - /// - /// The default contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// is not a valid metadata view type. - /// - /// - /// The has been disposed of. - /// - [SuppressMessage("Microsoft.Design", "CA1006")] - public IEnumerable> GetExports(string contractName) - { - return this.GetExportsCore(contractName); - } - - /// - /// Returns the exported value with the contract name derived from the specified type - /// parameter, throwing an exception if there is not exactly one matching exported value. - /// - /// - /// The type of the exported value to return. The contract name is also - /// derived from this type parameter. - /// - /// - /// The exported with the contract name derived from - /// . - /// - /// - /// - /// The contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// The underlying exported value cannot be cast to . - /// - /// - /// - /// There are zero exported values with the contract name derived from - /// in the . - /// - /// -or- - /// - /// There are more than one exported values with the contract name derived from - /// in the . - /// - /// - /// - /// The has been disposed of. - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - public T GetExportedValue() - { - return this.GetExportedValue((string)null); - } - - /// - /// Returns the exported value with the specified contract name, throwing an exception - /// if there is not exactly one matching exported value. - /// - /// - /// The type of the exported value to return. - /// - /// - /// A containing the contract name of the exported value to return, - /// or or an empty string ("") to use the default contract name. - /// - /// - /// The exported with the specified contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// The underlying exported value cannot be cast to . - /// - /// - /// - /// There are zero exported values with the specified contract name in the - /// . - /// - /// -or- - /// - /// There are more than one exported values with the specified contract name in the - /// . - /// - /// - /// - /// The has been disposed of. - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - public T GetExportedValue(string contractName) - { - return this.GetExportedValueCore(contractName, ImportCardinality.ExactlyOne); - } - - /// - /// Returns the exported value with the contract name derived from the specified type - /// parameter, throwing an exception if there is more than one matching exported value. - /// - /// - /// The type of the exported value to return. The contract name is also - /// derived from this type parameter. - /// - /// - /// The exported with the contract name derived from - /// , if found; otherwise, the default value for - /// . - /// - /// - /// - /// If the exported value is not found, then this method returns the appropriate - /// default value for ; for example, 0 (zero) for integer - /// types, for Boolean types, and - /// for reference types. - /// - /// - /// The contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// The underlying exported value cannot be cast to . - /// - /// - /// - /// There are more than one exported values with the contract name derived from - /// in the . - /// - /// - /// - /// The has been disposed of. - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - public T GetExportedValueOrDefault() - { - return this.GetExportedValueOrDefault((string)null); - } - - /// - /// Returns the exported value with the specified contract name, throwing an exception - /// if there is more than one matching exported value. - /// - /// - /// The type of the exported value to return. - /// - /// - /// A containing the contract name of the exported value to return, - /// or or an empty string ("") to use the default contract name. - /// - /// - /// The exported with the specified contract name, if found; - /// otherwise, the default value for . - /// - /// - /// - /// If the exported value is not found, then this method returns the appropriate - /// default value for ; for example, 0 (zero) for integer - /// types, for Boolean types, and - /// for reference types. - /// - /// - /// The default contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// The underlying exported value cannot be cast to . - /// - /// - /// There are more than one exported values with the specified contract name in the - /// . - /// - /// - /// The has been disposed of. - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - public T GetExportedValueOrDefault(string contractName) - { - return this.GetExportedValueCore(contractName, ImportCardinality.ZeroOrOne); - } - - /// - /// Returns the exported values with the contract name derived from the specified type - /// parameter. - /// - /// - /// The type of the exported value to return. The contract name is also - /// derived from this type parameter. - /// - /// - /// An containing the exported values with the contract name - /// derived from the specified type parameter, if found; otherwise, an empty - /// . - /// - /// - /// - /// The contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// One or more of the underlying exported values cannot be cast to - /// . - /// - /// - /// The has been disposed of. - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - public IEnumerable GetExportedValues() - { - return this.GetExportedValues((string)null); - } - - /// - /// Returns the exported values with the specified contract name. - /// - /// - /// The type of the exported value to return. - /// - /// - /// A containing the contract name of the exported values to - /// return; or or an empty string ("") to use the default - /// contract name. - /// - /// - /// An containing the exported values with the specified - /// contract name, if found; otherwise, an empty . - /// - /// - /// - /// The default contract name is the result of calling - /// on . - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - /// - /// One or more of the underlying exported values cannot be cast to - /// . - /// - /// - /// The has been disposed of. - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - public IEnumerable GetExportedValues(string contractName) - { - return this.GetExportedValuesCore(contractName); - } - - private IEnumerable GetExportedValuesCore(string contractName) - { - IEnumerable exports = this.GetExportsCore(typeof(T), (Type)null, contractName, ImportCardinality.ZeroOrMore); - - Collection result = new Collection(); - foreach (Export export in exports) - { - result.Add(ExportServices.GetCastedExportedValue(export)); - } - return result; - } - - private T GetExportedValueCore(string contractName, ImportCardinality cardinality) - { - Assumes.IsTrue(cardinality.IsAtMostOne()); - - Export export = this.GetExportsCore(typeof(T), (Type)null, contractName, cardinality).SingleOrDefault(); - - return (export != null) ? ExportServices.GetCastedExportedValue(export) : default(T); - } - - private IEnumerable> GetExportsCore(string contractName) - { - IEnumerable exports = this.GetExportsCore(typeof(T), (Type)null, contractName, ImportCardinality.ZeroOrMore); - - Collection> result = new Collection>(); - foreach (Export export in exports) - { - result.Add(ExportServices.CreateStronglyTypedLazyOfT(export)); - } - return result; - } - - private IEnumerable> GetExportsCore(string contractName) - { - IEnumerable exports = this.GetExportsCore(typeof(T), typeof(TMetadataView), contractName, ImportCardinality.ZeroOrMore); - - Collection> result = new Collection>(); - foreach (Export export in exports) - { - result.Add(ExportServices.CreateStronglyTypedLazyOfTM(export)); - } - return result; - } - - private Lazy GetExportCore(string contractName) - { - Export export = this.GetExportsCore(typeof(T), typeof(TMetadataView), contractName, ImportCardinality.ExactlyOne).SingleOrDefault(); - - return (export != null) ? ExportServices.CreateStronglyTypedLazyOfTM(export) : null; - } - - private Lazy GetExportCore(string contractName) - { - Export export = this.GetExportsCore(typeof(T), null, contractName, ImportCardinality.ExactlyOne).SingleOrDefault(); - - return (export != null) ? ExportServices.CreateStronglyTypedLazyOfT(export) : null; - } - - private IEnumerable GetExportsCore(Type type, Type metadataViewType, string contractName, ImportCardinality cardinality) - { - // Only 'type' cannot be null - the other parameters have sensible defaults. - Requires.NotNull(type, "type"); - - if (string.IsNullOrEmpty(contractName)) - { - contractName = AttributedModelServices.GetContractName(type); - } - - if (metadataViewType == null) - { - metadataViewType = ExportServices.DefaultMetadataViewType; - } - - if (!MetadataViewProvider.IsViewTypeValid(metadataViewType)) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Strings.InvalidMetadataView, metadataViewType.Name)); - } - - ImportDefinition importDefinition = BuildImportDefinition(type, metadataViewType, contractName, cardinality); - return this.GetExports(importDefinition, null); - } - - private static ImportDefinition BuildImportDefinition(Type type, Type metadataViewType, string contractName, ImportCardinality cardinality) - { - Assumes.NotNull(type, metadataViewType, contractName); - - IEnumerable> requiredMetadata = CompositionServices.GetRequiredMetadata(metadataViewType); - - string requiredTypeIdentity = null; - if (type != typeof(object)) - { - requiredTypeIdentity = AttributedModelServices.GetTypeIdentity(type); - } - - return new ContractBasedImportDefinition(contractName, requiredTypeIdentity, requiredMetadata, cardinality, false, true, CreationPolicy.Any); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.cs deleted file mode 100644 index 015996ecf24..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.cs +++ /dev/null @@ -1,231 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Globalization; -using System.Linq; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Hosting -{ - /// - /// Defines the base class for export providers, which provide - /// methods for retrieving objects. - /// - public abstract partial class ExportProvider - { - /// - /// Initializes a new instance of the class. - /// - protected ExportProvider() - { - } - - /// - /// Occurs when the exports in the have changed. - /// - public event EventHandler ExportsChanged; - - /// - /// Occurs when the exports in the are changing. - /// - public event EventHandler ExportsChanging; - - /// - /// Returns all exports that match the conditions of the specified import. - /// - /// - /// The that defines the conditions of the - /// objects to get. - /// - /// - /// An of objects that match - /// the conditions defined by , if found; otherwise, an - /// empty . - /// - /// - /// is . - /// - /// - /// - /// is and - /// there are zero objects that match the conditions of the specified - /// . - /// - /// -or- - /// - /// is or - /// and there are more than one - /// objects that match the conditions of the specified . - /// - /// - public IEnumerable GetExports(ImportDefinition definition) - { - return GetExports(definition, null); - } - - /// - /// Returns all exports that match the conditions of the specified import. - /// - /// - /// The that defines the conditions of the - /// objects to get. - /// - /// - /// An of objects that match - /// the conditions defined by , if found; otherwise, an - /// empty . - /// - /// - /// is . - /// - /// - /// - /// is and - /// there are zero objects that match the conditions of the specified - /// . - /// - /// -or- - /// - /// is or - /// and there are more than one - /// objects that match the conditions of the specified . - /// - /// - public IEnumerable GetExports(ImportDefinition definition, AtomicComposition atomicComposition) - { - Requires.NotNull(definition, "definition"); - - IEnumerable exports; - ExportCardinalityCheckResult result = this.TryGetExportsCore(definition, atomicComposition, out exports); - switch(result) - { - case ExportCardinalityCheckResult.Match: - return exports; - case ExportCardinalityCheckResult.NoExports: - throw new ImportCardinalityMismatchException(string.Format(CultureInfo.CurrentCulture, Strings.CardinalityMismatch_NoExports, definition.Constraint.Body.ToString())); - default: - Assumes.IsTrue(result == ExportCardinalityCheckResult.TooManyExports); - throw new ImportCardinalityMismatchException(string.Format(CultureInfo.CurrentCulture, Strings.CardinalityMismatch_TooManyExports, definition.Constraint.Body.ToString())); - } - } - - /// - /// Returns all exports that match the conditions of the specified import. - /// - /// - /// The that defines the conditions of the - /// objects to get. - /// - /// - /// When this method returns, contains an of - /// objects that match the conditions defined by , if found; - /// otherwise, an empty . - /// - /// - /// if is - /// or and - /// there are zero objects that match the conditions of the specified - /// . if - /// is or - /// and there is exactly one - /// that matches the conditions of the specified ; otherwise, - /// . - /// - /// - /// is . - /// - public bool TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, out IEnumerable exports) - { - Requires.NotNull(definition, "definition"); - - exports = null; - ExportCardinalityCheckResult result = this.TryGetExportsCore(definition, atomicComposition, out exports); - return (result == ExportCardinalityCheckResult.Match); - } - - /// - /// Returns all exports that match the constraint defined by the specified definition. - /// - /// - /// The that defines the conditions of the - /// objects to return. - /// - /// - /// An of objects that match - /// the conditions defined by , if found; otherwise, an - /// empty . - /// - /// - /// - /// Overriders of this method should not treat cardinality-related mismatches - /// as errors, and should not throw exceptions in those cases. For instance, - /// if is - /// and there are zero objects that match the conditions of the - /// specified , an should be returned. - /// - /// - protected abstract IEnumerable GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition); - - /// - /// Raises the event. - /// - /// - /// An containing the data for the event. - /// - protected virtual void OnExportsChanged(ExportsChangeEventArgs e) - { - EventHandler changedEvent = this.ExportsChanged; - if (changedEvent != null) - { - CompositionResult result = CompositionServices.TryFire(changedEvent, this, e); - result.ThrowOnErrors(e.AtomicComposition); - } - } - - /// - /// Raises the event. - /// - /// - /// An containing the data for the event. - /// - protected virtual void OnExportsChanging(ExportsChangeEventArgs e) - { - EventHandler changingEvent = this.ExportsChanging; - if (changingEvent != null) - { - CompositionResult result = CompositionServices.TryFire(changingEvent, this, e); - result.ThrowOnErrors(e.AtomicComposition); - } - } - - private ExportCardinalityCheckResult TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, out IEnumerable exports) - { - Assumes.NotNull(definition); - - exports = this.GetExportsCore(definition, atomicComposition); - - if (exports == null) - { - exports = Enumerable.Empty(); - } - - var checkResult = ExportServices.CheckCardinality(definition, exports); - - // Export providers treat >1 match as zero for cardinality 0-1 imports - // If this policy is moved we need to revisit the assumption that the - // ImportEngine made during previewing the only required imports to - // now also preview optional imports. - if (checkResult == ExportCardinalityCheckResult.TooManyExports && - definition.Cardinality == ImportCardinality.ZeroOrOne) - { - checkResult = ExportCardinalityCheckResult.Match; - exports = Enumerable.Empty(); - } - - return checkResult; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportsChangeEventArgs.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportsChangeEventArgs.cs deleted file mode 100644 index 58f962fbf43..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportsChangeEventArgs.cs +++ /dev/null @@ -1,110 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using Microsoft.Internal; -using Microsoft.Internal.Collections; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.Hosting -{ - /// - /// Provides data for the and - /// events. - /// - public class ExportsChangeEventArgs : EventArgs - { - private IEnumerable _changedContractNames = null; - - /// - /// Initializes a new instance of the class with - /// the specified changed export definitions. - /// - /// - /// An of s of the exports - /// that have been added. - /// - /// - /// An of s of the exports - /// that have been removed. - /// - /// - /// A representing all tentative changes that will - /// be completed if the change is successful, or discarded if it is not. - /// if being applied outside a - /// or during a event. - /// - /// - /// or is . - /// - public ExportsChangeEventArgs(IEnumerable addedExports, - IEnumerable removedExports, AtomicComposition atomicComposition) - { - Requires.NotNull(addedExports, "addedExports"); - Requires.NotNull(removedExports, "removedExports"); - - this.AddedExports = addedExports.AsArray(); - this.RemovedExports = removedExports.AsArray(); - this.AtomicComposition = atomicComposition; - } - - /// - /// Gets the export definitions for the exports that have been added. - /// - /// - /// A of ExportDefinitions representing - /// the exports that have been added to the . - /// - public IEnumerable AddedExports { get; private set; } - - /// - /// Gets the export definitions for the exports that have been removed. - /// - /// - /// A of ExportDefinitions representing - /// the exports that have been added to the . - /// - public IEnumerable RemovedExports { get; private set; } - - /// - /// Gets the contract names of the exports that have changed. - /// - /// - /// A of strings representing the contract names of - /// the exports that have changed in the . - /// - public IEnumerable ChangedContractNames - { - get - { - if (this._changedContractNames == null) - { - this._changedContractNames = this.AddedExports - .Concat(this.RemovedExports) - .Select(export => export.ContractName) - .Distinct() - .ToArray(); - } - return this._changedContractNames; - } - } - - /// - /// Gets the atomicComposition, if any, that this change applies to. - /// - /// - /// A that this set of changes applies too. - /// - /// It can be if the changes are being applied outside a - /// or during a - /// event. - /// - /// When the value is non-null it should be used to record temporary changed state - /// and actions that will be executed when the atomicComposition is completeed. - /// - public AtomicComposition AtomicComposition { get; private set; } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/INotifyComposablePartCatalogChanged.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/INotifyComposablePartCatalogChanged.cs deleted file mode 100644 index 4e5f8259631..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/INotifyComposablePartCatalogChanged.cs +++ /dev/null @@ -1,19 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace System.ComponentModel.Composition.Hosting -{ - /// - /// Notifications when a ComposablePartCatalog changes. - /// - public interface INotifyComposablePartCatalogChanged - { - event EventHandler Changed; - event EventHandler Changing; - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.EngineContext.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.EngineContext.cs deleted file mode 100644 index 890b01952cb..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.EngineContext.cs +++ /dev/null @@ -1,84 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics; -using System.Linq; -using System.Runtime.CompilerServices; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.Hosting -{ - public partial class ImportEngine - { - /// - /// Used to wrap the start and stop of enforcing export changes don't - /// break required imports. This context is stored in a AtomicComposition. - /// - private class EngineContext - { - private ImportEngine _importEngine; - private List _addedPartManagers = new List(); - private List _removedPartManagers = new List(); - private EngineContext _parentEngineContext; - - public EngineContext(ImportEngine importEngine, EngineContext parentEngineContext) - { - this._importEngine = importEngine; - this._parentEngineContext = parentEngineContext; - } - - public void AddPartManager(PartManager part) - { - Assumes.NotNull(part); - if (!this._removedPartManagers.Remove(part)) - { - this._addedPartManagers.Add(part); - } - } - - public void RemovePartManager(PartManager part) - { - Assumes.NotNull(part); - if (!this._addedPartManagers.Remove(part)) - { - this._removedPartManagers.Add(part); - } - } - - public IEnumerable GetAddedPartManagers() - { - if (this._parentEngineContext != null) - { - return this._addedPartManagers.ConcatAllowingNull(this._parentEngineContext.GetAddedPartManagers()); - } - return this._addedPartManagers; - } - - public IEnumerable GetRemovedPartManagers() - { - if (this._parentEngineContext != null) - { - return this._removedPartManagers.ConcatAllowingNull(this._parentEngineContext.GetRemovedPartManagers()); - } - return this._removedPartManagers; - } - - public void Complete() - { - foreach (var partManager in this._addedPartManagers) - { - this._importEngine.StartSatisfyingImports(partManager, null); - } - - foreach (var partManager in this._removedPartManagers) - { - this._importEngine.StopSatisfyingImports(partManager, null); - } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.PartManager.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.PartManager.cs deleted file mode 100644 index d092c670113..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.PartManager.cs +++ /dev/null @@ -1,211 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics; -using System.Linq; -using System.Runtime.CompilerServices; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.Hosting -{ - public partial class ImportEngine - { - /// - /// Used by the to manage the composition of a given part. - /// It stores things like the list of disposable exports used to satisfy the imports as - /// well as the caching of the exports discovered during previewing of a part. - /// - private class PartManager - { - private Dictionary> _importedDisposableExports; - private Dictionary _importCache; - private string[] _importedContractNames; - private ComposablePart _part; - private ImportState _state = ImportState.NoImportsSatisfied; - private readonly ImportEngine _importEngine; - - public PartManager(ImportEngine importEngine, ComposablePart part) - { - this._importEngine = importEngine; - this._part = part; - } - - public ComposablePart Part - { - get - { - return this._part; - } - } - - public ImportState State - { - get - { - using (this._importEngine._lock.LockStateForRead()) - { - return this._state; - } - } - set - { - using (this._importEngine._lock.LockStateForWrite()) - { - this._state = value; - } - } - } - - public bool TrackingImports { get; set; } - - public IEnumerable GetImportedContractNames() - { - if (this.Part == null) - { - return Enumerable.Empty(); - } - - if (this._importedContractNames == null) - { - this._importedContractNames = this.Part.ImportDefinitions.Select(import => import.ContractName ?? ImportDefinition.EmptyContractName).Distinct().ToArray(); - } - return this._importedContractNames; - } - - public CompositionResult TrySetImport(ImportDefinition import, IEnumerable exports) - { - try - { - this.Part.SetImport(import, exports); - UpdateDisposableDependencies(import, exports); - return CompositionResult.SucceededResult; - } - catch (CompositionException ex) - { // Pulling on one of the exports failed - - return new CompositionResult( - ErrorBuilder.CreatePartCannotSetImport(Part, import, ex)); - } - catch (ComposablePartException ex) - { // Type mismatch between export and import - - return new CompositionResult( - ErrorBuilder.CreatePartCannotSetImport(Part, import, ex)); - } - } - - public void SetSavedImport(ImportDefinition import, Export[] exports, AtomicComposition atomicComposition) - { - if (atomicComposition != null) - { - var savedExports = this.GetSavedImport(import); - - // Add a revert action to revert the stored exports - // in the case that this atomicComposition gets rolled back. - atomicComposition.AddRevertAction(() => - this.SetSavedImport(import, savedExports, null)); - } - - if (this._importCache == null) - { - this._importCache = new Dictionary(); - } - - this._importCache[import] = exports; - } - - public Export[] GetSavedImport(ImportDefinition import) - { - Export[] exports = null; - if (this._importCache != null) - { - // We don't care about the return value we just want the exports - // and if it isn't present we just return the initialized null value - this._importCache.TryGetValue(import, out exports); - } - return exports; - } - - public void ClearSavedImports() - { - this._importCache = null; - } - - public CompositionResult TryOnComposed() - { - try - { - this.Part.Activate(); - return CompositionResult.SucceededResult; - } - catch (ComposablePartException ex) - { // Type failed to be constructed, imports could not be set, etc - return new CompositionResult( - ErrorBuilder.CreatePartCannotActivate(this.Part, ex)); - } - } - - public void UpdateDisposableDependencies(ImportDefinition import, IEnumerable exports) - { - // Determine if there are any new disposable exports, optimizing for the most - // likely case, which is that there aren't any - List disposableExports = null; - foreach (var disposableExport in exports.OfType()) - { - if (disposableExports == null) - { - disposableExports = new List(); - } - disposableExports.Add(disposableExport); - } - - // Dispose any existing references previously set on this import - List oldDisposableExports = null; - if (this._importedDisposableExports != null && - this._importedDisposableExports.TryGetValue(import, out oldDisposableExports)) - { - oldDisposableExports.ForEach(disposable => disposable.Dispose()); - - // If there aren't any replacements, get rid of the old storage - if (disposableExports == null) - { - this._importedDisposableExports.Remove(import); - if (!this._importedDisposableExports.FastAny()) - { - this._importedDisposableExports = null; - } - - return; - } - } - - // Record the new collection - if (disposableExports != null) - { - if (this._importedDisposableExports == null) - { - this._importedDisposableExports = new Dictionary>(); - } - this._importedDisposableExports[import] = disposableExports; - } - } - - public void DisposeAllDependencies() - { - if (this._importedDisposableExports != null) - { - IEnumerable dependencies = this._importedDisposableExports.Values - .SelectMany(exports => exports); - - this._importedDisposableExports = null; - - dependencies.ForEach(disposableExport => disposableExport.Dispose()); - } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.RecompositionManager.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.RecompositionManager.cs deleted file mode 100644 index ff3eb19dee6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.RecompositionManager.cs +++ /dev/null @@ -1,159 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics; -using System.Linq; -using System.Runtime.CompilerServices; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.Hosting -{ - public partial class ImportEngine - { - /// - /// Used by the to effiecently store and retrieve the list of parts - /// that will be affected by changes to exports. This allows the to properly - /// block breaking changes and also recompose imports as appropriate. - /// - private class RecompositionManager - { - private WeakReferenceCollection _partsToIndex = new WeakReferenceCollection(); - private WeakReferenceCollection _partsToUnindex = new WeakReferenceCollection(); - private Dictionary> _partManagerIndex = new Dictionary>(); - - public void AddPartToIndex(PartManager partManager) - { - this._partsToIndex.Add(partManager); - } - - public void AddPartToUnindex(PartManager partManager) - { - this._partsToUnindex.Add(partManager); - } - - public IEnumerable GetAffectedParts(IEnumerable changedContractNames) - { - this.UpdateImportIndex(); - - List parts = new List(); - - parts.AddRange(GetPartsImporting(ImportDefinition.EmptyContractName)); - - foreach (string contractName in changedContractNames) - { - parts.AddRange(GetPartsImporting(contractName)); - } - - return parts; - } - - public static IEnumerable GetAffectedImports(ComposablePart part, IEnumerable changedExports) - { - return part.ImportDefinitions.Where(import => IsAffectedImport(import, changedExports)); - } - - private static bool IsAffectedImport(ImportDefinition import, IEnumerable changedExports) - { - // This could be more efficient still if the export definitions were indexed by contract name, - // only worth revisiting if we need to squeeze more performance out of recomposition - foreach (var export in changedExports) - { - if (import.IsConstraintSatisfiedBy(export)) - { - return true; - } - } - - return false; - } - - public IEnumerable GetPartsImporting(string contractName) - { - WeakReferenceCollection partManagerList; - if (!this._partManagerIndex.TryGetValue(contractName, out partManagerList)) - { - return Enumerable.Empty(); - } - - return partManagerList.AliveItemsToList(); - } - - private void AddIndexEntries(PartManager partManager) - { - foreach (string contractName in partManager.GetImportedContractNames()) - { - WeakReferenceCollection indexEntries; - if (!this._partManagerIndex.TryGetValue(contractName, out indexEntries)) - { - indexEntries = new WeakReferenceCollection(); - this._partManagerIndex.Add(contractName, indexEntries); - } - - if (!indexEntries.Contains(partManager)) - { - indexEntries.Add(partManager); - } - } - } - - private void RemoveIndexEntries(PartManager partManager) - { - foreach (string contractName in partManager.GetImportedContractNames()) - { - WeakReferenceCollection indexEntries; - if (this._partManagerIndex.TryGetValue(contractName, out indexEntries)) - { - indexEntries.Remove(partManager); - var aliveItems = indexEntries.AliveItemsToList(); - - if (aliveItems.Count == 0) - { - this._partManagerIndex.Remove(contractName); - } - } - } - } - - private void UpdateImportIndex() - { - var partsToIndex = this._partsToIndex.AliveItemsToList(); - this._partsToIndex.Clear(); - - var partsToUnindex = this._partsToUnindex.AliveItemsToList(); - this._partsToUnindex.Clear(); - - if (partsToIndex.Count == 0 && partsToUnindex.Count == 0) - { - return; - } - - foreach (var partManager in partsToIndex) - { - var index = partsToUnindex.IndexOf(partManager); - - // If the same part is being added and removed we can ignore both - if (index >= 0) - { - partsToUnindex[index] = null; - } - else - { - AddIndexEntries(partManager); - } - } - - foreach (var partManager in partsToUnindex) - { - if (partManager != null) - { - RemoveIndexEntries(partManager); - } - } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.cs deleted file mode 100644 index 29bd329c3ca..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ImportEngine.cs +++ /dev/null @@ -1,754 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics; -using System.Linq; -using System.Runtime.CompilerServices; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.Hosting -{ - // This class guarantees thread-safety under the follwoing conditions: - // - Each composition is executed on a single thread - // - No recomposition ever takes place - // - The class is created with isThreadSafe=true - public partial class ImportEngine : ICompositionService, IDisposable - { - private const int MaximumNumberOfCompositionIterations = 100; - - private volatile bool _isDisposed; - private ExportProvider _sourceProvider; - private Stack _recursionStateStack = new Stack(); - private ConditionalWeakTable _partManagers = new ConditionalWeakTable(); - private RecompositionManager _recompositionManager = new RecompositionManager(); - private readonly CompositionLock _lock = null; - - /// - /// Initializes a new instance of the class. - /// - /// - /// The which provides the - /// access to s. - /// - public ImportEngine(ExportProvider sourceProvider) - : this(sourceProvider, false) - { - } - - public ImportEngine(ExportProvider sourceProvider, bool isThreadSafe) - { - Requires.NotNull(sourceProvider, "sourceProvider"); - - this._sourceProvider = sourceProvider; - this._sourceProvider.ExportsChanging += this.OnExportsChanging; - this._lock = new CompositionLock(isThreadSafe); - } - - /// - /// Previews all the required imports for the given to - /// ensure they can all be satisified. The preview does not actually set the imports - /// only ensures that they exist in the source provider. If the preview succeeds then - /// the also enforces that changes to exports in the source - /// provider will not break any of the required imports. If this enforcement needs to be - /// lifted for this part then needs to be called for this - /// . - /// - /// - /// The to preview the required imports. - /// - /// - /// - /// An error occurred during previewing and is null. - /// will contain a collection of errors that occurred. - /// The pre-existing composition is in an unknown state, depending on the errors that occured. - /// - /// - /// An error occurred during the previewing and is not null. - /// will contain a collection of errors that occurred. - /// The pre-existing composition remains in valid state. - /// - /// - /// The has been disposed of. - /// - public void PreviewImports(ComposablePart part, AtomicComposition atomicComposition) - { - this.ThrowIfDisposed(); - - Requires.NotNull(part, "part"); - - // NOTE : this is a very intricate area threading-wise, please use caution when changing, otherwise state corruption or deadlocks will ensue - // The gist of what we are doing is as follows: - // We need to lock the composition, as we will proceed modifying our internal state. The tricky part is when we release the lock - // Due to the fact that some actions will take place AFTER we leave this method, we need to KEEP THAT LOCK HELD until the transation is commiited or rolled back - // This is the reason we CAN'T use "using here. - // Instead, if the transaction is present we will queue up the release of the lock, otherwise we will release it when we exit this method - // We add the "release" lock to BOTH Commit and Revert queues, because they are mutually exclusive, and we need to release the lock regardless. - - // This will take the lock, if necesary - IDisposable compositionLockHolder = this._lock.IsThreadSafe ? this._lock.LockComposition() : null; - bool compositionLockTaken = (compositionLockHolder != null); - try - { - // revert actions are processed in the reverse order, so we have to add the "release lock" action now - if (compositionLockTaken && (atomicComposition != null)) - { - atomicComposition.AddRevertAction(() => compositionLockHolder.Dispose()); - } - - var partManager = GetPartManager(part, true); - var result = TryPreviewImportsStateMachine(partManager, part, atomicComposition); - result.ThrowOnErrors(atomicComposition); - - StartSatisfyingImports(partManager, atomicComposition); - - // Add the "release lock" to the commit actions - if (compositionLockTaken && (atomicComposition != null)) - { - atomicComposition.AddCompleteAction(() => compositionLockHolder.Dispose()); - } - } - finally - { - // We haven't updated the queues, so we can release the lock now - if (compositionLockTaken && (atomicComposition == null)) - { - compositionLockHolder.Dispose(); - } - } - } - - /// - /// Satisfies the imports of the specified composable part. If the satisfy succeeds then - /// the also enforces that changes to exports in the source - /// provider will not break any of the required imports. If this enforcement needs to be - /// lifted for this part then needs to be called for this - /// . - /// - /// - /// The to set the imports. - /// - /// - /// is . - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - /// - /// The has been disposed of. - /// - public void SatisfyImports(ComposablePart part) - { - this.ThrowIfDisposed(); - - Requires.NotNull(part, "part"); - - // NOTE : the following two calls use the state lock - PartManager partManager = this.GetPartManager(part, true); - if (partManager.State == ImportState.Composed) - { - return; - } - - using (this._lock.LockComposition()) - { - var result = TrySatisfyImports(partManager, part, true); - result.ThrowOnErrors(); // throw CompositionException not ChangeRejectedException - } - } - - /// - /// Sets the imports of the specified composable part exactly once and they will not - /// ever be recomposed. - /// - /// - /// The to set the imports. - /// - /// - /// is . - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - /// - /// The has been disposed of. - /// - public void SatisfyImportsOnce(ComposablePart part) - { - this.ThrowIfDisposed(); - - Requires.NotNull(part, "part"); - - // NOTE : the following two calls use the state lock - PartManager partManager = this.GetPartManager(part, true); - if (partManager.State == ImportState.Composed) - { - return; - } - - using (this._lock.LockComposition()) - { - var result = TrySatisfyImports(partManager, part, false); - result.ThrowOnErrors(); // throw CompositionException not ChangeRejectedException - } - } - - /// - /// Removes any state stored in the for the associated - /// and releases all the s used to - /// satisfy the imports on the . - /// - /// Also removes the enforcement for changes that would break a required import on - /// . - /// - /// - /// The to release the imports on. - /// - /// - /// The that the release imports is running under. - /// - public void ReleaseImports(ComposablePart part, AtomicComposition atomicComposition) - { - this.ThrowIfDisposed(); - - Requires.NotNull(part, "part"); - - using (this._lock.LockComposition()) - { - PartManager partManager = this.GetPartManager(part, false); - if (partManager != null) - { - this.StopSatisfyingImports(partManager, atomicComposition); - } - } - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases unmanaged and - optionally - managed resources - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - if (!this._isDisposed) - { - bool disposeLock = false; - ExportProvider sourceProviderToUnsubscribeFrom = null; - using (this._lock.LockStateForWrite()) - { - if (!this._isDisposed) - { - sourceProviderToUnsubscribeFrom = this._sourceProvider; - this._sourceProvider = null; - this._recompositionManager = null; - this._partManagers = null; - this._isDisposed = true; - disposeLock = true; - } - } - - if (sourceProviderToUnsubscribeFrom != null) - { - sourceProviderToUnsubscribeFrom.ExportsChanging -= this.OnExportsChanging; - } - - if (disposeLock) - { - this._lock.Dispose(); - } - } - } - } - - private CompositionResult TryPreviewImportsStateMachine(PartManager partManager, - ComposablePart part, AtomicComposition atomicComposition) - { - var result = CompositionResult.SucceededResult; - - if (partManager.State == ImportState.ImportsPreviewing) - { - // We shouldn't nomally ever hit this case but if we do - // then we should just error with a cycle error. - return new CompositionResult(ErrorBuilder.CreatePartCycle(part)); - } - - // Transition from NoImportsStatisified to ImportsPreviewed - if (partManager.State == ImportState.NoImportsSatisfied) - { - partManager.State = ImportState.ImportsPreviewing; - - var requiredImports = part.ImportDefinitions.Where(IsRequiredImportForPreview); - - // If this atomicComposition gets rolledback for any reason we need to reset our state - atomicComposition.AddRevertActionAllowNull(() => partManager.State = ImportState.NoImportsSatisfied); - - result = result.MergeResult( - this.TrySatisfyImportSubset(partManager, requiredImports, atomicComposition)); - - if (!result.Succeeded) - { - partManager.State = ImportState.NoImportsSatisfied; - return result; - } - - partManager.State = ImportState.ImportsPreviewed; - } - - return result; - } - - private CompositionResult TrySatisfyImportsStateMachine(PartManager partManager, ComposablePart part) - { - var result = CompositionResult.SucceededResult; - - while (partManager.State < ImportState.Composed) - { - var previousState = partManager.State; - - switch (partManager.State) - { - // "ed" states which represent a some sort of steady state and will - // attempt to do a state transition - case ImportState.NoImportsSatisfied: - case ImportState.ImportsPreviewed: - { - partManager.State = ImportState.PreExportImportsSatisfying; - - var prereqImports = part.ImportDefinitions.Where(import => import.IsPrerequisite); - result = result.MergeResult( - this.TrySatisfyImportSubset(partManager, prereqImports, null)); - - partManager.State = ImportState.PreExportImportsSatisfied; - break; - } - case ImportState.PreExportImportsSatisfied: - { - partManager.State = ImportState.PostExportImportsSatisfying; - - var requiredImports = part.ImportDefinitions.Where(import => !import.IsPrerequisite); - - result = result.MergeResult( - this.TrySatisfyImportSubset(partManager, requiredImports, null)); - - partManager.State = ImportState.PostExportImportsSatisfied; - break; - } - case ImportState.PostExportImportsSatisfied: - { - partManager.State = ImportState.ComposedNotifying; - - partManager.ClearSavedImports(); - result = result.MergeResult(partManager.TryOnComposed()); - - partManager.State = ImportState.Composed; - break; - } - - - // "ing" states which represent some sort of cycle - // These state should always return, error or not, instead of breaking - case ImportState.ImportsPreviewing: - { - // We shouldn't nomally ever hit this case but if we do - // then we should just error with a cycle error. - return new CompositionResult(ErrorBuilder.CreatePartCycle(part)); - } - case ImportState.PreExportImportsSatisfying: - case ImportState.PostExportImportsSatisfying: - { - if (InPrerequisiteLoop()) - { - return result.MergeError(ErrorBuilder.CreatePartCycle(part)); - } - // Cycles in post export imports are allowed so just return in that case - return result; - } - case ImportState.ComposedNotifying: - { - // We are currently notifying so don't notify again just return - return result; - } - } - - // if an error occured while doing a state transition - if (!result.Succeeded) - { - // revert to the previous state and return the error - partManager.State = previousState; - return result; - } - } - return result; - } - - private CompositionResult TrySatisfyImports(PartManager partManager, ComposablePart part, bool shouldTrackImports) - { - Assumes.NotNull(part); - - var result = CompositionResult.SucceededResult; - - // get out if the part is already composed - if (partManager.State == ImportState.Composed) - { - return result; - } - - // Track number of recursive iterations and throw an exception before the stack - // fills up and debugging the root cause becomes tricky - if (this._recursionStateStack.Count >= MaximumNumberOfCompositionIterations) - { - return result.MergeError( - ErrorBuilder.ComposeTookTooManyIterations(MaximumNumberOfCompositionIterations)); - } - - // Maintain the stack to detect whether recursive loops cross prerequisites - this._recursionStateStack.Push(partManager); - try - { - result = result.MergeResult( - TrySatisfyImportsStateMachine(partManager, part)); - } - finally - { - this._recursionStateStack.Pop(); - } - - if (shouldTrackImports) - { - StartSatisfyingImports(partManager, null); - } - - return result; - } - - private CompositionResult TrySatisfyImportSubset(PartManager partManager, - IEnumerable imports, AtomicComposition atomicComposition) - { - CompositionResult result = CompositionResult.SucceededResult; - - var part = partManager.Part; - foreach (ImportDefinition import in imports) - { - var exports = partManager.GetSavedImport(import); - - if (exports == null) - { - CompositionResult> exportsResult = TryGetExports( - this._sourceProvider, part, import, atomicComposition); - - if (!exportsResult.Succeeded) - { - result = result.MergeResult(exportsResult.ToResult()); - continue; - } - exports = exportsResult.Value.AsArray(); - } - - if (atomicComposition == null) - { - result = result.MergeResult( - partManager.TrySetImport(import, exports)); - } - else - { - partManager.SetSavedImport(import, exports, atomicComposition); - } - } - return result; - } - - private void OnExportsChanging(object sender, ExportsChangeEventArgs e) - { - CompositionResult result = CompositionResult.SucceededResult; - - // Prepare for the recomposition effort by minimizing the amount of work we'll have to do later - AtomicComposition atomicComposition = e.AtomicComposition; - - IEnumerable affectedParts = this._recompositionManager.GetAffectedParts(e.ChangedContractNames); - - // When in a atomicComposition account for everything that isn't yet reflected in the - // index - if (atomicComposition != null) - { - EngineContext engineContext; - if (atomicComposition.TryGetValue(this, out engineContext)) - { - // always added the new part managers to see if they will also be - // affected by these changes - affectedParts = affectedParts.ConcatAllowingNull(engineContext.GetAddedPartManagers()) - .Except(engineContext.GetRemovedPartManagers()); - } - } - - var changedExports = e.AddedExports.ConcatAllowingNull(e.RemovedExports); - - foreach (var partManager in affectedParts) - { - result = result.MergeResult(this.TryRecomposeImports(partManager, changedExports, atomicComposition)); - } - - result.ThrowOnErrors(atomicComposition); - } - - private CompositionResult TryRecomposeImports(PartManager partManager, - IEnumerable changedExports, AtomicComposition atomicComposition) - { - var result = CompositionResult.SucceededResult; - - switch (partManager.State) - { - case ImportState.ImportsPreviewed: - case ImportState.Composed: - // Validate states to continue. - break; - - default: - { - // All other states are invalid and for recomposition. - return new CompositionResult(ErrorBuilder.InvalidStateForRecompposition(partManager.Part)); - } - } - - var affectedImports = RecompositionManager.GetAffectedImports(partManager.Part, changedExports); - bool partComposed = (partManager.State == ImportState.Composed); - - bool recomposedImport = false; - foreach (var import in affectedImports) - { - result = result.MergeResult( - TryRecomposeImport(partManager, partComposed, import, atomicComposition)); - - recomposedImport = true; - } - - // Knowing that the part has already been composed before and that the only possible - // changes are to recomposable imports, we can safely go ahead and do this now or - // schedule it for later - if (result.Succeeded && recomposedImport && partComposed) - { - if (atomicComposition == null) - { - result = result.MergeResult(partManager.TryOnComposed()); - } - else - { - atomicComposition.AddCompleteAction(() => partManager.TryOnComposed().ThrowOnErrors()); - } - } - - return result; - } - - private CompositionResult TryRecomposeImport(PartManager partManager, bool partComposed, - ImportDefinition import, AtomicComposition atomicComposition) - { - if (partComposed && !import.IsRecomposable) - { - return new CompositionResult(ErrorBuilder.PreventedByExistingImport(partManager.Part, import)); - } - - // During recomposition you must always requery with the new atomicComposition you cannot use any - // cached value in the part manager - var exportsResult = TryGetExports(this._sourceProvider, partManager.Part, import, atomicComposition); - if (!exportsResult.Succeeded) - { - return exportsResult.ToResult(); - } - var exports = exportsResult.Value.AsArray(); - - if (partComposed) - { - // Knowing that the part has already been composed before and that the only possible - // changes are to recomposable imports, we can safely go ahead and do this now or - // schedule it for later - if (atomicComposition == null) - { - return partManager.TrySetImport(import, exports); - } - else - { - atomicComposition.AddCompleteAction(() => partManager.TrySetImport(import, exports).ThrowOnErrors()); - } - } - else - { - partManager.SetSavedImport(import, exports, atomicComposition); - } - - return CompositionResult.SucceededResult; - } - - private void StartSatisfyingImports(PartManager partManager, AtomicComposition atomicComposition) - { - // When not running in a atomicCompositional state, schedule reindexing after ensuring - // that this isn't a redundant addition - if (atomicComposition == null) - { - if (!partManager.TrackingImports) - { - partManager.TrackingImports = true; - this._recompositionManager.AddPartToIndex(partManager); - } - } - else - { - // While in a atomicCompositional state use a less efficient but effective means - // of achieving the same results - GetEngineContext(atomicComposition).AddPartManager(partManager); - } - } - - private void StopSatisfyingImports(PartManager partManager, AtomicComposition atomicComposition) - { - // When not running in a atomicCompositional state, schedule reindexing after ensuring - // that this isn't a redundant removal - if (atomicComposition == null) - { - this._partManagers.Remove(partManager.Part); - - // Take care of lifetime requirements - partManager.DisposeAllDependencies(); - - if (partManager.TrackingImports) - { - partManager.TrackingImports = false; - this._recompositionManager.AddPartToUnindex(partManager); - } - } - else - { - // While in a atomicCompositional state use a less efficient but effective means - // of achieving the same results - GetEngineContext(atomicComposition).RemovePartManager(partManager); - } - } - - private PartManager GetPartManager(ComposablePart part, bool createIfNotpresent) - { - PartManager partManager = null; - using (this._lock.LockStateForRead()) - { - if (this._partManagers.TryGetValue(part, out partManager)) - { - return partManager; - } - } - - if (createIfNotpresent) - { - using (this._lock.LockStateForWrite()) - { - if (!this._partManagers.TryGetValue(part, out partManager)) - { - partManager = new PartManager(this, part); - this._partManagers.Add(part, partManager); - } - } - } - return partManager; - } - - - private EngineContext GetEngineContext(AtomicComposition atomicComposition) - { - Assumes.NotNull(atomicComposition); - - EngineContext engineContext; - if (!atomicComposition.TryGetValue(this, true, out engineContext)) - { - EngineContext parentContext; - atomicComposition.TryGetValue(this, false, out parentContext); - engineContext = new EngineContext(this, parentContext); - atomicComposition.SetValue(this, engineContext); - atomicComposition.AddCompleteAction(engineContext.Complete); - } - return engineContext; - } - - private bool InPrerequisiteLoop() - { - PartManager firstPart = this._recursionStateStack.First(); - PartManager lastPart = null; - - foreach (PartManager testPart in this._recursionStateStack.Skip(1)) - { - if (testPart.State == ImportState.PreExportImportsSatisfying) - { - return true; - } - - if (testPart == firstPart) - { - lastPart = testPart; - break; - } - } - - // This should only be called when a loop has been detected - so it should always be on the stack - Assumes.IsTrue(lastPart == firstPart); - return false; - } - - [DebuggerStepThrough] - private void ThrowIfDisposed() - { - if (this._isDisposed) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - - private static CompositionResult> TryGetExports(ExportProvider provider, - ComposablePart part, ImportDefinition definition, AtomicComposition atomicComposition) - { - try - { - var exports = provider.GetExports(definition, atomicComposition).AsArray(); - return new CompositionResult>(exports); - } - catch (ImportCardinalityMismatchException ex) - { - // Either not enough or too many exports that match the definition - CompositionException exception = new CompositionException(ErrorBuilder.CreateImportCardinalityMismatch(ex, definition)); - - return new CompositionResult>( - ErrorBuilder.CreatePartCannotSetImport(part, definition, exception)); - } - } - - internal static bool IsRequiredImportForPreview(ImportDefinition import) - { - return import.Cardinality == ImportCardinality.ExactlyOne; - } - - // Ordering of this enum is important so be sure to use caution if you - // try to reorder them. - private enum ImportState - { - NoImportsSatisfied = 0, - ImportsPreviewing = 1, - ImportsPreviewed = 2, - PreExportImportsSatisfying = 3, - PreExportImportsSatisfied = 4, - PostExportImportsSatisfying = 5, - PostExportImportsSatisfied = 6, - ComposedNotifying = 7, - Composed = 8, - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/TypeCatalog.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/TypeCatalog.cs deleted file mode 100644 index cabc1e5dc5c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/TypeCatalog.cs +++ /dev/null @@ -1,347 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.AttributedModel; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Hosting -{ - /// - /// An immutable ComposablePartCatalog created from a type array or a list of managed types. This class is threadsafe. - /// It is Disposable. - /// - [DebuggerTypeProxy(typeof(ComposablePartCatalogDebuggerProxy))] - public class TypeCatalog : ComposablePartCatalog, ICompositionElement - { - private readonly object _thisLock = new object(); - private Type[] _types = null; - private volatile IQueryable _queryableParts; - private volatile bool _isDisposed = false; - private readonly ICompositionElement _definitionOrigin; - private readonly Lazy>> _contractPartIndex; - - /// - /// Initializes a new instance of the class - /// with the specified types. - /// - /// - /// An of attributed objects to add to the - /// . - /// - /// - /// is . - /// - /// - /// contains an element that is . - /// - /// -or- - /// - /// contains an element that was loaded in the Reflection-only context. - /// - public TypeCatalog(params Type[] types) - : this(types, (ICompositionElement)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified types. - /// - /// - /// An of attributed objects to add - /// to the . - /// - /// - /// is . - /// - /// - /// contains an element that is . - /// - /// -or- - /// - /// contains an element that was loaded in the reflection-only context. - /// - public TypeCatalog(IEnumerable types) - : this(types, (ICompositionElement)null) - { - } - - internal TypeCatalog(IEnumerable types, ICompositionElement definitionOrigin) - { - Requires.NotNull(types, "types"); - - foreach (Type type in types) - { - if (type == null) - { - throw ExceptionBuilder.CreateContainsNullElement("types"); - } -#if !SILVERLIGHT - if (type.Assembly.ReflectionOnly) - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.Argument_ElementReflectionOnlyType, "types"), "types"); - } -#endif - } - - this._types = types.ToArray(); - this._definitionOrigin = definitionOrigin ?? this; -#if !SILVERLIGHT - this._contractPartIndex = new Lazy>>(this.CreateIndex, true); -#else - this._contractPartIndex = new Lazy>>(this.CreateIndex); -#endif - - } - - /// - /// Gets the part definitions of the catalog. - /// - /// - /// A of objects of the - /// . - /// - /// - /// The has been disposed of. - /// - public override IQueryable Parts - { - get - { - this.ThrowIfDisposed(); - - return this.PartsInternal; - } - } - - /// - /// Gets the display name of the type catalog. - /// - /// - /// A containing a human-readable display name of the . - /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - string ICompositionElement.DisplayName - { - get { return this.GetDisplayName(); } - } - - /// - /// Gets the composition element from which the type catalog originated. - /// - /// - /// This property always returns . - /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - ICompositionElement ICompositionElement.Origin - { - get { return null; } - } - - private IQueryable PartsInternal - { - get - { - if (this._queryableParts == null) - { - lock (this._thisLock) - { - if (this._queryableParts == null) - { - Assumes.NotNull(this._types); - - var collection = new List(); - foreach (Type type in this._types) - { - var definition = AttributedModelDiscovery.CreatePartDefinitionIfDiscoverable(type, _definitionOrigin); - if (definition != null) - { - collection.Add(definition); - } - } - IQueryable queryableParts = collection.AsQueryable(); - Thread.MemoryBarrier(); - - this._types = null; - this._queryableParts = queryableParts; - } - } - } - - return this._queryableParts; - } - } - - /// - /// Returns the export definitions that match the constraint defined by the specified definition. - /// - /// - /// The that defines the conditions of the - /// objects to return. - /// - /// - /// An of containing the - /// objects and their associated - /// for objects that match the constraint defined - /// by . - /// - /// - /// is . - /// - /// - /// The has been disposed of. - /// - /// - /// - /// Overriders of this property should never return , if no - /// match the conditions defined by - /// , return an empty . - /// - /// - public override IEnumerable> GetExports(ImportDefinition definition) - { - this.ThrowIfDisposed(); - - Requires.NotNull(definition, "definition"); - - IEnumerable candidateParts = this.GetCandidateParts(definition); - if (candidateParts == null) - { - return Enumerable.Empty>(); - } - - var exports = new List>(); - foreach (var part in candidateParts) - { - foreach (var export in part.ExportDefinitions) - { - if (definition.IsConstraintSatisfiedBy(export)) - { - exports.Add(new Tuple(part, export)); - } - } - } - return exports; - } - - private IEnumerable GetCandidateParts(ImportDefinition definition) - { - string contractName = definition.ContractName; - - // Empty string represents a non-contract based import and thus the constraint needs - // to be applied to all the possible exports in this catalog. - if (string.IsNullOrEmpty(contractName)) - { - return this.PartsInternal; - } - - List candidateParts = null; - if (this._contractPartIndex.Value.TryGetValue(contractName, out candidateParts)) - { - return candidateParts; - } - else - { - return null; - } - } - - private IDictionary> CreateIndex() - { - Dictionary> index = new Dictionary>(StringComparers.ContractName); - - foreach (var part in this.PartsInternal) - { - foreach (string contractName in part.ExportDefinitions.Select(export => export.ContractName).Distinct()) - { - List contractParts = null; - if (!index.TryGetValue(contractName, out contractParts)) - { - contractParts = new List(); - index.Add(contractName, contractParts); - } - contractParts.Add(part); - } - } - return index; - } - - /// - /// Returns a string representation of the type catalog. - /// - /// - /// A containing the string representation of the . - /// - public override string ToString() - { - return this.GetDisplayName(); - } - - protected override void Dispose(bool disposing) - { - if (disposing) - { - this._isDisposed = true; - } - - base.Dispose(disposing); - } - - private string GetDisplayName() - { - return String.Format(CultureInfo.CurrentCulture, - Strings.TypeCatalog_DisplayNameFormat, - this.GetType().Name, - this.GetTypesDisplay()); - } - - private string GetTypesDisplay() - { - int count = this.PartsInternal.Count(); - if (count == 0) - { - return Strings.TypeCatalog_Empty; - } - - const int displayCount = 2; - StringBuilder builder = new StringBuilder(); - foreach (ReflectionComposablePartDefinition definition in this.PartsInternal.Take(displayCount)) - { - if (builder.Length > 0) - { - builder.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator); - builder.Append(" "); - } - - builder.Append(definition.GetPartType().GetDisplayName()); - } - - if (count > displayCount) - { // Add an elipse to indicate that there - // are more types than actually listed - builder.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator); - builder.Append(" ..."); - } - - return builder.ToString(); - } - - private void ThrowIfDisposed() - { - if (this._isDisposed) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/IAttributedImport.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/IAttributedImport.cs deleted file mode 100644 index a2f9c166d27..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/IAttributedImport.cs +++ /dev/null @@ -1,17 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - internal interface IAttributedImport - { - string ContractName { get; } - Type ContractType { get; } - bool AllowRecomposition { get; } - CreationPolicy RequiredCreationPolicy { get; } - ImportCardinality Cardinality { get; } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ICompositionError.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ICompositionError.cs deleted file mode 100644 index a31430ff72d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ICompositionError.cs +++ /dev/null @@ -1,29 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - // Internal interface for providing access to the composition error - // identifier for an exception or error that participates in composition. - internal interface ICompositionError - { - CompositionErrorId Id - { - get; - } - - ICompositionElement Element - { - get; - } - - Exception InnerException - { - get; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ICompositionService.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ICompositionService.cs deleted file mode 100644 index 45a4dd90162..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ICompositionService.cs +++ /dev/null @@ -1,34 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - /// - /// Provides methods for composing objects. - /// - public interface ICompositionService - { - /// - /// Sets the imports of the specified composable part exactly once and they will not - /// ever be recomposed. - /// - /// - /// The to set the imports. - /// - /// - /// is . - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - /// - /// The has been disposed of. - /// - void SatisfyImportsOnce(ComposablePart part); - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/IPartImportsSatisfiedNotification.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/IPartImportsSatisfiedNotification.cs deleted file mode 100644 index 60d592016ca..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/IPartImportsSatisfiedNotification.cs +++ /dev/null @@ -1,12 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition -{ - public interface IPartImportsSatisfiedNotification - { - void OnImportsSatisfied(); - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportAttribute.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportAttribute.cs deleted file mode 100644 index b4015271fbc..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportAttribute.cs +++ /dev/null @@ -1,181 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics.CodeAnalysis; - -namespace System.ComponentModel.Composition -{ - /// - /// Specifies that a property, field, or parameter imports a particular export. - /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, - AllowMultiple = false, Inherited = false)] - public class ImportAttribute : Attribute, IAttributedImport - { - /// - /// Initializes a new instance of the class, importing the - /// export with the default contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on the property, field, - /// or parameter type that this is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public ImportAttribute() - : this((string)null) - { - } - - /// - /// Initializes a new instance of the class, importing the - /// export with the contract name derived from the specified type. - /// - /// - /// A of which to derive the contract name of the export to import, or - /// to use the default contract name. - /// - /// - /// - /// The contract name is the result of calling - /// on - /// . - /// - /// - /// The default contract name is the result of calling - /// on the property, field, - /// or parameter type that is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public ImportAttribute(Type contractType) - : this((string)null, contractType) - { - } - - /// - /// Initializes a new instance of the class, importing the - /// export with the specified contract name. - /// - /// - /// A containing the contract name of the export to import, or - /// or an empty string ("") to use the default contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on the property, field, - /// or parameter type that is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public ImportAttribute(string contractName) - : this(contractName, (Type)null) - { - } - - public ImportAttribute(string contractName, Type contractType) - { - this.ContractName = contractName; - this.ContractType = contractType; - } - - /// - /// Gets the contract name of the export to import. - /// - /// - /// A containing the contract name of the export to import. The - /// default value is an empty string (""). - /// - public string ContractName { get; private set; } - - /// - /// Get the contract type of the export to import. - /// - /// - /// A of the export that this import is expecting. The default value is - /// which means that the type will be obtained by looking at the type on - /// the member that this import is attached to. If the type is then the - /// importer is delaring they can accept any exported type. - /// - public Type ContractType { get; private set; } - - /// - /// Gets or sets a value indicating whether the property, field or parameter will be set - /// to its type's default value when an export with the contract name is not present in - /// the container. - /// - /// - /// if the property, field or parameter will be set - /// its type's default value when an export with the is not - /// present in the ; otherwise, . - /// The default value is . - /// - /// - /// - /// The default value of a property's, field's or parameter's type is - /// for reference types and 0 for numeric value types. For - /// other value types, the default value will be each field of the value type - /// initialized to zero, if the field is a value type or if - /// the field is a reference type. - /// - /// - public bool AllowDefault { get; set; } - - /// - /// Gets or sets a value indicating whether the property or field will be recomposed - /// when exports that provide the same contract that this import expects, have changed - /// in the container. - /// - /// - /// if the property or field allows for recomposition when exports - /// that provide the same are added or removed from the - /// ; otherwise, . - /// The default value is . - /// - public bool AllowRecomposition { get; set; } - - /// - /// Gets or sets a value indicating that the importer requires a specific - /// for the exports used to satisfy this import. T - /// - /// - /// - default value, used if the importer doesn't - /// require a specific . - /// - /// - Requires that all exports used should be shared - /// by everyone in the container. - /// - /// - Requires that all exports used should be - /// non-shared in a container and thus everyone gets their own instance. - /// - public CreationPolicy RequiredCreationPolicy { get; set; } - - ImportCardinality IAttributedImport.Cardinality - { - get - { - if (this.AllowDefault == true) - { - return ImportCardinality.ZeroOrOne; - } - return ImportCardinality.ExactlyOne; - } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportCardinalityMismatchException.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportCardinalityMismatchException.cs deleted file mode 100644 index 9048f5c6362..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportCardinalityMismatchException.cs +++ /dev/null @@ -1,91 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Runtime.Serialization; - -namespace System.ComponentModel.Composition -{ - /// - /// The exception that is thrown when the cardinality of a - /// does not match the cardinality of the objects available in an - /// . - /// - [Serializable] - public class ImportCardinalityMismatchException : Exception - { - /// - /// Initializes a new instance of the class. - /// - public ImportCardinalityMismatchException() - : this((string)null, (Exception)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message. - /// - /// - /// A containing a message that describes the - /// ; or to set - /// the property to its default value. - /// - public ImportCardinalityMismatchException(string message) - : this(message, (Exception)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message and exception that is the cause of the - /// exception. - /// - /// - /// A containing a message that describes the - /// ; or to set - /// the property to its default value. - /// - /// - /// The that is the underlying cause of the - /// ; or to set - /// the property to . - /// - public ImportCardinalityMismatchException(string message, Exception innerException) - : base(message, innerException) - { - } - -#if !SILVERLIGHT - - /// - /// Initializes a new instance of the class - /// with the specified serialization data. - /// - /// - /// The that holds the serialized object data about the - /// . - /// - /// - /// The that contains contextual information about the - /// source or destination. - /// - /// - /// is . - /// - /// - /// is missing a required value. - /// - /// - /// contains a value that cannot be cast to the correct type. - /// - [System.Security.SecuritySafeCritical] - protected ImportCardinalityMismatchException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } -#endif //!SILVERLIGHT - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportManyAttribute.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportManyAttribute.cs deleted file mode 100644 index 79f706f6044..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportManyAttribute.cs +++ /dev/null @@ -1,152 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics.CodeAnalysis; - -namespace System.ComponentModel.Composition -{ - /// - /// Specifies that a property, field, or parameter imports a particular set of exports. - /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, - AllowMultiple = false, Inherited = false)] - public class ImportManyAttribute : Attribute, IAttributedImport - { - /// - /// Initializes a new instance of the class, importing the - /// set of exports with the default contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on the element\item type of - /// theproperty, field, or parameter type that this is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public ImportManyAttribute() - : this((string)null) - { - } - - /// - /// Initializes a new instance of the class, importing the - /// set of exports with the contract name derived from the specified type. - /// - /// - /// A of which to derive the contract name of the exports to import, or - /// to use the default contract name. - /// - /// - /// - /// The contract name is the result of calling - /// on - /// . - /// - /// - /// The default contract name is the result of calling - /// on the property, field, - /// or parameter type that is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public ImportManyAttribute(Type contractType) - : this((string)null, contractType) - { - } - - /// - /// Initializes a new instance of the class, importing the - /// set of exports with the specified contract name. - /// - /// - /// A containing the contract name of the exports to import, or - /// or an empty string ("") to use the default contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on the property, field, - /// or parameter type that is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public ImportManyAttribute(string contractName) - : this(contractName, (Type)null) - { - } - - public ImportManyAttribute(string contractName, Type contractType) - { - this.ContractName = contractName; - this.ContractType = contractType; - } - - /// - /// Gets the contract name of the exports to import. - /// - /// - /// A containing the contract name of the exports to import. The - /// default value is an empty string (""). - /// - public string ContractName { get; private set; } - - /// - /// Get the contract type of the export to import. - /// - /// - /// A of the export that this import is expecting. The default value is - /// which means that the type will be obtained by looking at the type on - /// the member that this import is attached to. If the type is then the - /// importer is delaring they can accept any exported type. - /// - public Type ContractType { get; private set; } - - /// - /// Gets or sets a value indicating whether the property or field will be recomposed - /// when exports that provide the same contract that this import expects, have changed - /// in the container. - /// - /// - /// if the property or field allows for recomposition when exports - /// that provide the same are added or removed from the - /// ; otherwise, . - /// The default value is . - /// - public bool AllowRecomposition { get; set; } - - /// - /// Gets or sets a value indicating that the importer requires a specific - /// for the exports used to satisfy this import. T - /// - /// - /// - default value, used if the importer doesn't - /// require a specific . - /// - /// - Requires that all exports used should be shared - /// by everyone in the container. - /// - /// - Requires that all exports used should be - /// non-shared in a container and thus everyone gets their own instance. - /// - public CreationPolicy RequiredCreationPolicy { get; set; } - - ImportCardinality IAttributedImport.Cardinality - { - get { return ImportCardinality.ZeroOrMore; } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportingConstructorAttribute.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportingConstructorAttribute.cs deleted file mode 100644 index 2263316d43c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ImportingConstructorAttribute.cs +++ /dev/null @@ -1,28 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Diagnostics.CodeAnalysis; - -namespace System.ComponentModel.Composition -{ - /// - /// Specifies that a constructor should be used when constructing an attributed part. - /// - /// - /// By default, only a default parameter-less constructor, if available, is used to - /// construct an attributed part. Use this attribute to indicate that a specific constructor - /// should be used. - /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] - [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] - public class ImportingConstructorAttribute : Attribute - { - /// - /// Initializes a new instance of the class. - /// - public ImportingConstructorAttribute() - { - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/InheritedExportAttribute.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/InheritedExportAttribute.cs deleted file mode 100644 index ab42dfab9ab..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/InheritedExportAttribute.cs +++ /dev/null @@ -1,122 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.Diagnostics.CodeAnalysis; - -namespace System.ComponentModel.Composition -{ - /// - /// Specifies that a type or interface that provides a particular export. - /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = true)] - public class InheritedExportAttribute : ExportAttribute - { - /// - /// Initializes a new instance of the class, exporting the - /// type marked with this attribute under the default contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on the type itself, - /// that is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public InheritedExportAttribute() - : this((string)null, (Type)null) - { - } - - /// - /// Initializes a new instance of the class, exporting the - /// type marked with this attribute under a contract name derived from the specified type. - /// - /// - /// A of which to derive the contract name to export the type - /// marked with this attribute, under; or to use the - /// default contract name. - /// - /// - /// - /// The contract name is the result of calling - /// on - /// . - /// - /// - /// The default contract name is the result of calling - /// on the type of the - /// itself, that is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public InheritedExportAttribute(Type contractType) - : this((string)null, contractType) - { - } - - /// - /// Initializes a new instance of the class, exporting the - /// type or member marked with this attribute under the specified contract name. - /// - /// - /// A containing the contract name to export the type - /// marked with this attribute, under; or or an empty string - /// ("") to use the default contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on - /// the type itself that this is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public InheritedExportAttribute(string contractName) - : this(contractName, (Type)null) - { - } - - /// - /// Initializes a new instance of the class, exporting the - /// type or member marked with this attribute under the specified contract name. - /// - /// - /// A containing the contract name to export the type - /// marked with this attribute, under; or or an empty string - /// ("") to use the default contract name. - /// - /// - /// A of which to derive the contract name to export the type - /// marked with this attribute, under; or to use the - /// default contract name. - /// - /// - /// - /// The default contract name is the result of calling - /// on - /// the type itself that this is marked with this attribute. - /// - /// - /// The contract name is compared using a case-sensitive, non-linguistic comparison - /// using . - /// - /// - public InheritedExportAttribute(string contractName, Type contractType) - : base(contractName, contractType) - { - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataAttributeAttribute.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataAttributeAttribute.cs deleted file mode 100644 index 59aad485329..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataAttributeAttribute.cs +++ /dev/null @@ -1,23 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition -{ - /// - /// Specifies that an attribute can be used to provide metadata for a type, property, field, - /// or method marked with the . - /// - [AttributeUsage(AttributeTargets.Class, - AllowMultiple=false, Inherited=true)] - public sealed class MetadataAttributeAttribute : Attribute - { - /// - /// Initializes a new instance of the class. - /// - public MetadataAttributeAttribute() - { - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataServices.cs deleted file mode 100644 index 6446c665ea8..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataServices.cs +++ /dev/null @@ -1,50 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition -{ - internal static class MetadataServices - { - public static readonly IDictionary EmptyMetadata = new ReadOnlyDictionary(null); - - public static IDictionary AsReadOnly(this IDictionary metadata) - { - if (metadata == null) - { - return EmptyMetadata; - } - - if (metadata is ReadOnlyDictionary) - { - return metadata; - } - - return new ReadOnlyDictionary(metadata); - } - - public static T GetValue(this IDictionary metadata, string key) - { - Assumes.NotNull(metadata, "metadata"); - - object untypedValue = true; - if (!metadata.TryGetValue(key, out untypedValue)) - { - return default(T); - } - - if (untypedValue is T) - { - return (T)untypedValue; - } - else - { - return default(T); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataViewGenerator.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataViewGenerator.cs deleted file mode 100644 index e582774eaa4..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataViewGenerator.cs +++ /dev/null @@ -1,321 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Globalization; -using System.Linq; -using System.Reflection; -using System.Threading; -using Microsoft.Internal; -using System.Reflection.Emit; -using System.Collections; - -namespace System.ComponentModel.Composition -{ - // // Assume TMetadataView is - // //interface Foo - // //{ - // // public typeRecord1 Record1 { get; } - // // public typeRecord2 Record2 { get; } - // // public typeRecord3 Record3 { get; } - // // public typeRecord4 Record4 { get; } - // //} - // // The class to be generated will look approximately like: - // public class __Foo__MedataViewProxy : TMetadataView - // { - // public __Foo__MedataViewProxy (IDictionary metadata) - // { - // if(metadata == null) - // { - // throw InvalidArgumentException("metadata"); - // } - // try - // { - // Record1 = (typeRecord1)Record1; - // Record2 = (typeRecord1)Record2; - // Record3 = (typeRecord1)Record3; - // Record4 = (typeRecord1)Record4; - // } - // catch(InvalidCastException ice) - // { - // //Annotate exception .Data with diagnostic info - // } - // catch(NulLReferenceException ice) - // { - // //Annotate exception .Data with diagnostic info - // } - // } - // // Interface - // public typeRecord1 Record1 { get; } - // public typeRecord2 Record2 { get; } - // public typeRecord3 Record3 { get; } - // public typeRecord4 Record4 { get; } - // } - internal static class MetadataViewGenerator - { - public const string MetadataViewType = "MetadataViewType"; - public const string MetadataItemKey = "MetadataItemKey"; - public const string MetadataItemTargetType = "MetadataItemTargetType"; - public const string MetadataItemSourceType = "MetadataItemSourceType"; - public const string MetadataItemValue = "MetadataItemValue"; - - private static Lock _lock = new Lock(); - private static Dictionary _proxies = new Dictionary(); - - private static AssemblyName ProxyAssemblyName = new AssemblyName(string.Format(CultureInfo.InvariantCulture, "MetadataViewProxies_{0}", Guid.NewGuid())); - private static AssemblyBuilder ProxyAssemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(ProxyAssemblyName, AssemblyBuilderAccess.Run); - private static ModuleBuilder ProxyModuleBuilder = ProxyAssemblyBuilder.DefineDynamicModule("MetadataViewProxiesModule"); - private static Type[] CtorArgumentTypes = new Type[] { typeof(IDictionary) }; - private static MethodInfo _mdvDictionaryTryGet = CtorArgumentTypes[0].GetMethod("TryGetValue"); - private static readonly MethodInfo ObjectGetType = typeof(object).GetMethod("GetType", Type.EmptyTypes); - - public static Type GenerateView(Type viewType) - { - Assumes.NotNull(viewType); - Assumes.IsTrue(viewType.IsInterface); - - Type proxyType; - bool foundProxy; - - using (new ReadLock(_lock)) - { - foundProxy = _proxies.TryGetValue(viewType, out proxyType); - } - - // No factory exists - if(!foundProxy) - { - // Try again under a write lock if still none generate the proxy - using (new WriteLock(_lock)) - { - foundProxy = _proxies.TryGetValue(viewType, out proxyType); - - if (!foundProxy) - { - proxyType = GenerateInterfaceViewProxyType(viewType); - Assumes.NotNull(proxyType); - - _proxies.Add(viewType, proxyType); - } - } - } - return proxyType; - } - - private static void GenerateLocalAssignmentFromDefaultAttribute(this ILGenerator IL, DefaultValueAttribute[] attrs, LocalBuilder local) - { - if (attrs.Length > 0) - { - DefaultValueAttribute defaultAttribute = attrs[0]; - IL.LoadValue(defaultAttribute.Value); - if ((defaultAttribute.Value != null) && (defaultAttribute.Value.GetType().IsValueType)) - { - IL.Emit(OpCodes.Box, defaultAttribute.Value.GetType()); - } - IL.Emit(OpCodes.Stloc, local); - } - } - - private static void GenerateFieldAssignmentFromLocalValue(this ILGenerator IL, LocalBuilder local, FieldBuilder field) - { - IL.Emit(OpCodes.Ldarg_0); - IL.Emit(OpCodes.Ldloc, local); - IL.Emit(field.FieldType.IsValueType ? OpCodes.Unbox_Any : OpCodes.Castclass, field.FieldType); - IL.Emit(OpCodes.Stfld, field); - } - - private static void GenerateLocalAssignmentFromFlag(this ILGenerator IL, LocalBuilder local, bool flag) - { - IL.Emit(flag ? OpCodes.Ldc_I4_1 : OpCodes.Ldc_I4_0); - IL.Emit(OpCodes.Stloc, local); - } - - // This must be called with _readerWriterLock held for Write - private static Type GenerateInterfaceViewProxyType(Type viewType) - { - // View type is an interface let's cook an implementation - Type proxyType; - TypeBuilder proxyTypeBuilder; - Type[] interfaces = { viewType }; - - proxyTypeBuilder = ProxyModuleBuilder.DefineType( - string.Format(CultureInfo.InvariantCulture, "_proxy_{0}_{1}", viewType.FullName, Guid.NewGuid()), - TypeAttributes.Public, - typeof(object), - interfaces); - - // Implement Constructor - ILGenerator proxyCtorIL = proxyTypeBuilder.CreateGeneratorForPublicConstructor(CtorArgumentTypes); - LocalBuilder exception = proxyCtorIL.DeclareLocal(typeof(Exception)); - LocalBuilder exceptionData = proxyCtorIL.DeclareLocal(typeof(IDictionary)); - LocalBuilder sourceType = proxyCtorIL.DeclareLocal(typeof(Type)); - LocalBuilder value = proxyCtorIL.DeclareLocal(typeof(object)); - LocalBuilder usesExportedMD = proxyCtorIL.DeclareLocal(typeof(bool)); - - Label tryConstructView = proxyCtorIL.BeginExceptionBlock(); - - // Implement interface properties - foreach (PropertyInfo propertyInfo in viewType.GetAllProperties()) - { - string fieldName = string.Format(CultureInfo.InvariantCulture, "_{0}_{1}", propertyInfo.Name, Guid.NewGuid()); - - // Cache names and type for exception - string propertyName = string.Format(CultureInfo.InvariantCulture, "{0}", propertyInfo.Name); - - Type[] propertyTypeArguments = new Type[] { propertyInfo.PropertyType }; - Type[] optionalModifiers = null; - Type[] requiredModifiers = null; - -#if !SILVERLIGHT - // PropertyInfo does not support GetOptionalCustomModifiers and GetRequiredCustomModifiers on Silverlight - optionalModifiers = propertyInfo.GetOptionalCustomModifiers(); - requiredModifiers = propertyInfo.GetRequiredCustomModifiers(); - Array.Reverse(optionalModifiers); - Array.Reverse(requiredModifiers); -#endif - // Generate field - FieldBuilder proxyFieldBuilder = proxyTypeBuilder.DefineField( - fieldName, - propertyInfo.PropertyType, - FieldAttributes.Private); - - // Generate property - PropertyBuilder proxyPropertyBuilder = proxyTypeBuilder.DefineProperty( - propertyName, - PropertyAttributes.None, - propertyInfo.PropertyType, - propertyTypeArguments); - - // Generate constructor code for retrieving the metadata value and setting the field - Label tryCastValue = proxyCtorIL.BeginExceptionBlock(); - Label innerTryCastValue; - - DefaultValueAttribute[] attrs = propertyInfo.GetAttributes(false); - if(attrs.Length > 0) - { - innerTryCastValue = proxyCtorIL.BeginExceptionBlock(); - } - - // In constructor set the backing field with the value from the dictionary - Label doneGettingDefaultValue = proxyCtorIL.DefineLabel(); - GenerateLocalAssignmentFromFlag(proxyCtorIL, usesExportedMD, true); - - proxyCtorIL.Emit(OpCodes.Ldarg_1); - proxyCtorIL.Emit(OpCodes.Ldstr, propertyInfo.Name); - proxyCtorIL.Emit(OpCodes.Ldloca, value); - proxyCtorIL.Emit(OpCodes.Callvirt, _mdvDictionaryTryGet); - proxyCtorIL.Emit(OpCodes.Brtrue, doneGettingDefaultValue); - - proxyCtorIL.GenerateLocalAssignmentFromFlag(usesExportedMD, false); - proxyCtorIL.GenerateLocalAssignmentFromDefaultAttribute(attrs, value); - - proxyCtorIL.MarkLabel(doneGettingDefaultValue); - proxyCtorIL.GenerateFieldAssignmentFromLocalValue(value, proxyFieldBuilder); - proxyCtorIL.Emit(OpCodes.Leave, tryCastValue); - - // catch blocks for innerTryCastValue start here - if (attrs.Length > 0) - { - proxyCtorIL.BeginCatchBlock(typeof(InvalidCastException)); - { - Label notUsesExportedMd = proxyCtorIL.DefineLabel(); - proxyCtorIL.Emit(OpCodes.Ldloc, usesExportedMD); - proxyCtorIL.Emit(OpCodes.Brtrue, notUsesExportedMd); - proxyCtorIL.Emit(OpCodes.Rethrow); - proxyCtorIL.MarkLabel(notUsesExportedMd); - proxyCtorIL.GenerateLocalAssignmentFromDefaultAttribute(attrs, value); - proxyCtorIL.GenerateFieldAssignmentFromLocalValue(value, proxyFieldBuilder); - } - proxyCtorIL.EndExceptionBlock(); - } - - // catch blocks for tryCast start here - proxyCtorIL.BeginCatchBlock(typeof(NullReferenceException)); - { - proxyCtorIL.Emit(OpCodes.Stloc, exception); - - proxyCtorIL.GetExceptionDataAndStoreInLocal(exception, exceptionData); - proxyCtorIL.AddItemToLocalDictionary(exceptionData, MetadataItemKey, propertyName); - proxyCtorIL.AddItemToLocalDictionary(exceptionData, MetadataItemTargetType, propertyInfo.PropertyType); - proxyCtorIL.Emit(OpCodes.Rethrow); - } - - proxyCtorIL.BeginCatchBlock(typeof(InvalidCastException)); - { - proxyCtorIL.Emit(OpCodes.Stloc, exception); - - proxyCtorIL.GetExceptionDataAndStoreInLocal(exception, exceptionData); - proxyCtorIL.AddItemToLocalDictionary(exceptionData, MetadataItemKey, propertyName); - proxyCtorIL.AddItemToLocalDictionary(exceptionData, MetadataItemTargetType, propertyInfo.PropertyType); - proxyCtorIL.Emit(OpCodes.Rethrow); - } - - proxyCtorIL.EndExceptionBlock(); - - if (propertyInfo.CanWrite) - { - // The MetadataView '{0}' is invalid because property '{1}' has a property set method. - throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, - Strings.InvalidSetterOnMetadataField, - viewType, - propertyName)); - } - if (propertyInfo.CanRead) - { - // Generate "get" method implementation. - MethodBuilder getMethodBuilder = proxyTypeBuilder.DefineMethod( - string.Format(CultureInfo.InvariantCulture, "get_{0}", propertyName), - MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.NewSlot | MethodAttributes.Virtual | MethodAttributes.Final, - CallingConventions.HasThis, - propertyInfo.PropertyType, - requiredModifiers, - optionalModifiers, - Type.EmptyTypes, null, null); - - proxyTypeBuilder.DefineMethodOverride(getMethodBuilder, propertyInfo.GetGetMethod()); - ILGenerator getMethodIL = getMethodBuilder.GetILGenerator(); - getMethodIL.Emit(OpCodes.Ldarg_0); - getMethodIL.Emit(OpCodes.Ldfld, proxyFieldBuilder); - getMethodIL.Emit(OpCodes.Ret); - - proxyPropertyBuilder.SetGetMethod(getMethodBuilder); - } - } - - proxyCtorIL.Emit(OpCodes.Leave, tryConstructView); - - // catch blocks for constructView start here - proxyCtorIL.BeginCatchBlock(typeof(NullReferenceException)); - { - proxyCtorIL.Emit(OpCodes.Stloc, exception); - - proxyCtorIL.GetExceptionDataAndStoreInLocal(exception, exceptionData); - proxyCtorIL.AddItemToLocalDictionary(exceptionData, MetadataViewType, viewType); - proxyCtorIL.Emit(OpCodes.Rethrow); - } - proxyCtorIL.BeginCatchBlock(typeof(InvalidCastException)); - { - proxyCtorIL.Emit(OpCodes.Stloc, exception); - - proxyCtorIL.GetExceptionDataAndStoreInLocal(exception, exceptionData); - proxyCtorIL.Emit(OpCodes.Ldloc, value); - proxyCtorIL.Emit(OpCodes.Call, ObjectGetType); - proxyCtorIL.Emit(OpCodes.Stloc, sourceType); - proxyCtorIL.AddItemToLocalDictionary(exceptionData, MetadataViewType, viewType); - proxyCtorIL.AddLocalToLocalDictionary(exceptionData, MetadataItemSourceType, sourceType); - proxyCtorIL.AddLocalToLocalDictionary(exceptionData, MetadataItemValue, value); - proxyCtorIL.Emit(OpCodes.Rethrow); - } - proxyCtorIL.EndExceptionBlock(); - - // Finished implementing interface and constructor - proxyCtorIL.Emit(OpCodes.Ret); - proxyType = proxyTypeBuilder.CreateType(); - - return proxyType; - } - - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataViewProvider.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataViewProvider.cs deleted file mode 100644 index 8e22770cad6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/MetadataViewProvider.cs +++ /dev/null @@ -1,106 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using Microsoft.Internal; -using System.Globalization; -using System.Runtime.InteropServices; -using System.Diagnostics.CodeAnalysis; - -namespace System.ComponentModel.Composition -{ - internal static class MetadataViewProvider - { - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] - public static TMetadataView GetMetadataView(IDictionary metadata) - { - Type metadataViewType = typeof(TMetadataView); - - // If the Metadata dictionary is cast compatible with the passed in type - if (metadataViewType.IsAssignableFrom(typeof(IDictionary))) - { - return (TMetadataView)metadata; - } - // otherwise is it a metadata view - else - { - Type proxyType; - if (metadataViewType.IsInterface) - { - try - { - proxyType = MetadataViewGenerator.GenerateView(metadataViewType); - } - catch (TypeLoadException ex) - { - throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, Strings.NotSupportedInterfaceMetadataView, metadataViewType.FullName), ex); - } - } - else - { - proxyType = metadataViewType; - } - - // Now we have the type for the proxy create it - try - { - return (TMetadataView)proxyType.SafeCreateInstance(metadata); - } - catch (MissingMethodException ex) - { - // Unable to create an Instance of the Metadata view '{0}' because a constructor could not be selected. Ensure that the type implements a constructor which takes an argument of type IDictionary. - throw new CompositionContractMismatchException(string.Format(CultureInfo.CurrentCulture, - Strings.CompositionException_MetadataViewInvalidConstructor, - proxyType.AssemblyQualifiedName), ex); - } - catch (TargetInvocationException ex) - { - //Unwrap known failures that we want to present as CompositionContractMismatchException - if(metadataViewType.IsInterface) - { - if(ex.InnerException.GetType() == typeof(InvalidCastException)) - { - // Unable to create an Instance of the Metadata view {0} because the exporter exported the metadata for the item {1} with the value {2} as type {3} but the view imports it as type {4}. - throw new CompositionContractMismatchException(string.Format(CultureInfo.CurrentCulture, - Strings.ContractMismatch_InvalidCastOnMetadataField, - ex.InnerException.Data[MetadataViewGenerator.MetadataViewType], - ex.InnerException.Data[MetadataViewGenerator.MetadataItemKey], - ex.InnerException.Data[MetadataViewGenerator.MetadataItemValue], - ex.InnerException.Data[MetadataViewGenerator.MetadataItemSourceType], - ex.InnerException.Data[MetadataViewGenerator.MetadataItemTargetType]), ex); - } - else if (ex.InnerException.GetType() == typeof(NullReferenceException)) - { - // Unable to create an Instance of the Metadata view {0} because the exporter exported the metadata for the item {1} with a null value and null is not a valid value for type {2}. - throw new CompositionContractMismatchException(string.Format(CultureInfo.CurrentCulture, - Strings.ContractMismatch_NullReferenceOnMetadataField, - ex.InnerException.Data[MetadataViewGenerator.MetadataViewType], - ex.InnerException.Data[MetadataViewGenerator.MetadataItemKey], - ex.InnerException.Data[MetadataViewGenerator.MetadataItemTargetType]), ex); - } - } - throw; - } - } - } - - public static bool IsViewTypeValid(Type metadataViewType) - { - Assumes.NotNull(metadataViewType); - - // If the Metadata dictionary is cast compatible with the passed in type - if (ExportServices.IsDefaultMetadataViewType(metadataViewType) - || metadataViewType.IsInterface - || ExportServices.IsDictionaryConstructorViewType(metadataViewType)) - { - return true; - } - - return false; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartCreationPolicyAttribute.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartCreationPolicyAttribute.cs deleted file mode 100644 index 844fb3925de..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartCreationPolicyAttribute.cs +++ /dev/null @@ -1,36 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - /// - /// Specifies for a given . - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] - public sealed class PartCreationPolicyAttribute : Attribute - { - internal static PartCreationPolicyAttribute Default = new PartCreationPolicyAttribute(CreationPolicy.Any); - internal static PartCreationPolicyAttribute Shared = new PartCreationPolicyAttribute(CreationPolicy.Shared); - - /// - /// Initializes a new instance of the class. - /// - public PartCreationPolicyAttribute(CreationPolicy creationPolicy) - { - this.CreationPolicy = creationPolicy; - } - - /// - /// Gets or sets a value indicating the creation policy of the attributed part. - /// - /// - /// One of the values indicating the creation policy of the - /// attributed part. The default is - /// . - /// - public CreationPolicy CreationPolicy { get; private set; } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartCreatorOfT.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartCreatorOfT.cs deleted file mode 100644 index 37198b1b214..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartCreatorOfT.cs +++ /dev/null @@ -1,29 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using Microsoft.Internal; - -#if SILVERLIGHT - -namespace System.ComponentModel.Composition -{ - public class PartCreator - { - private readonly Func> _creator; - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public PartCreator(Func> creator) - { - Requires.NotNull(creator, "creator"); - this._creator = creator; - } - - public PartLifetimeContext CreatePart() - { - return this._creator(); - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartCreatorOfTTMetadata.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartCreatorOfTTMetadata.cs deleted file mode 100644 index c352adfd839..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartCreatorOfTTMetadata.cs +++ /dev/null @@ -1,28 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -#if SILVERLIGHT - -namespace System.ComponentModel.Composition -{ - public class PartCreator : PartCreator - { - private readonly TMetadata _metadata; - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public PartCreator(Func> creator, TMetadata metadata) - : base(creator) - { - this._metadata = metadata; - } - - public TMetadata Metadata - { - get { return this._metadata; } - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartLifetimeContextOfT.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartLifetimeContextOfT.cs deleted file mode 100644 index 75aea437971..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartLifetimeContextOfT.cs +++ /dev/null @@ -1,33 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -#if SILVERLIGHT - -namespace System.ComponentModel.Composition -{ - public sealed class PartLifetimeContext : IDisposable - { - private readonly T _exportedValue; - private readonly Action _dispose; - - public PartLifetimeContext(T exportedValue, Action dispose) - { - this._exportedValue = exportedValue; - this._dispose = dispose; - } - - public T ExportedValue - { - get { return this._exportedValue; } - } - - public void Dispose() - { - this._dispose(); - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartMetadataAttribute.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartMetadataAttribute.cs deleted file mode 100644 index a700a293c1b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartMetadataAttribute.cs +++ /dev/null @@ -1,58 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - /// - /// Specifies metadata for a type to be used as a and - /// . - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] - public sealed class PartMetadataAttribute : Attribute - { - /// - /// Initializes a new instance of the with the - /// specified name and metadata value. - /// - /// - /// A containing the name of the metadata value; or - /// to use an empty string (""). - /// - /// - /// An containing the metadata value. This can be - /// . - /// - public PartMetadataAttribute(string name, object value) - { - this.Name = name ?? string.Empty; - this.Value = value; - } - - /// - /// Gets the name of the metadata value. - /// - /// - /// A containing the name of the metadata value. - /// - public string Name - { - get; - private set; - } - - /// - /// Gets the metadata value. - /// - /// - /// An containing the metadata value. - /// - public object Value - { - get; - private set; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartNotDiscoverableAttribute.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartNotDiscoverableAttribute.cs deleted file mode 100644 index 1436a6a9725..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/PartNotDiscoverableAttribute.cs +++ /dev/null @@ -1,23 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - /// - /// Place on a type that should not be discovered as a in - /// a . - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] - public sealed class PartNotDiscoverableAttribute : Attribute - { - /// - /// Initializes a new instance of the class. - /// - public PartNotDiscoverableAttribute() - { - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/.gitattributes deleted file mode 100644 index 5aa9b2a9d55..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/.gitattributes +++ /dev/null @@ -1,17 +0,0 @@ -/ComposablePart.cs -crlf -/ComposablePartCatalog.cs -crlf -/ComposablePartCatalogDebuggerProxy.cs -crlf -/ComposablePartDefinition.cs -crlf -/ComposablePartException.cs -crlf -/CompositionElement.cs -crlf -/CompositionElementDebuggerProxy.cs -crlf -/CompositionElementExtensions.cs -crlf -/ContractBasedImportDefinition.cs -crlf -/Export.cs -crlf -/ExportDefinition.cs -crlf -/ExportedDelegate.cs -crlf -/ICompositionElement.cs -crlf -/IPartCreatorImportDefinition.cs -crlf -/ImportCardinality.cs -crlf -/ImportDefinition.cs -crlf -/SerializableCompositionElement.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePart.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePart.cs deleted file mode 100644 index 3b74eecc307..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePart.cs +++ /dev/null @@ -1,210 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; - -namespace System.ComponentModel.Composition.Primitives -{ - /// - /// Defines the base class for composable parts, which - /// import and produce exported values. - /// - public abstract class ComposablePart - { - /// - /// Initializes a new instance of the class. - /// - protected ComposablePart() - { - } - - /// - /// Gets the export definitions that describe the exported values provided by the part. - /// - /// - /// An of objects describing - /// the exported values provided by the . - /// - /// - /// The has been disposed of. - /// - /// - /// - /// - /// If the was created from a - /// , this property should return the result of - /// . - /// - /// - /// - /// - /// Overriders of this property should never return . - /// If the does not have exports, return an empty - /// instead. - /// - /// - /// - public abstract IEnumerable ExportDefinitions { get; } - - /// - /// Gets the import definitions that describe the imports required by the part. - /// - /// - /// An of objects describing - /// the imports required by the . - /// - /// - /// The has been disposed of. - /// - /// - /// - /// - /// If the was created from a - /// , this property should return the result of - /// . - /// - /// - /// - /// - /// Overrides of this property should never return . - /// If the does not have imports, return an empty - /// instead. - /// - /// - /// - public abstract IEnumerable ImportDefinitions { get; } - - /// - /// Gets the metadata of the part. - /// - /// - /// An containing the metadata of the - /// . The default is an empty, read-only - /// . - /// - /// - /// The has been disposed of. - /// - /// - /// - /// - /// If the was created from a - /// , this property should return the result of - /// . - /// - /// - /// - /// - /// Overriders of this property should return a read-only - /// object with a case-sensitive, - /// non-linguistic comparer, such as , - /// and should never return . If the - /// does not contain metadata, return an - /// empty instead. - /// - /// - /// - public virtual IDictionary Metadata - { - get - { - return MetadataServices.EmptyMetadata; - } - } - - /// - /// Called by the composition engine when all required imports on the part have been - /// satisfied. - /// - /// - /// The has been disposed of. - /// - /// - /// An error occurred activating the . - /// - public virtual void Activate() - { - } - - /// - /// Gets the exported value described by the specified definition. - /// - /// - /// One of the objects from the - /// property describing the exported value - /// to return. - /// - /// - /// The exported value described by . - /// - /// - /// is . - /// - /// - /// did not originate from the - /// property on the . - /// - /// - /// One or more pre-requisite imports, indicated by , - /// have not been set. - /// - /// - /// The has been disposed of. - /// - /// - /// An error occurred getting the exported value described by the . - /// - public abstract object GetExportedValue(ExportDefinition definition); - - /// - /// Sets the import described by the specified definition with the specified exports. - /// - /// - /// One of the objects from the - /// property describing the import to be set. - /// - /// - /// An of objects of which - /// to set the import described by . - /// - /// - /// is . - /// - /// -or- - /// - /// is . - /// - /// - /// did not originate from the - /// property on the . - /// - /// -or- - /// - /// contains an element that is . - /// - /// -or- - /// - /// is empty and is - /// . - /// - /// -or- - /// - /// contains more than one element and - /// is or - /// . - /// - /// - /// has been previously called and - /// is . - /// - /// - /// The has been disposed of. - /// - /// - /// An error occurred setting the import described by the . - /// - public abstract void SetImport(ImportDefinition definition, IEnumerable exports); - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs deleted file mode 100644 index 22fe9a20ff4..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs +++ /dev/null @@ -1,129 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Linq.Expressions; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Primitives -{ - /// - /// Defines the base class for composable part catalogs, which produce - /// and return objects. - /// - /// - /// This type is thread safe. - /// - [DebuggerTypeProxy(typeof(ComposablePartCatalogDebuggerProxy))] - public abstract class ComposablePartCatalog : IDisposable - { - private bool _isDisposed; - - /// - /// Initializes a new instance of the class. - /// - protected ComposablePartCatalog() - { - } - - /// - /// Gets the part definitions of the catalog. - /// - /// - /// A of objects of the - /// . - /// - /// - /// The has been disposed of. - /// - /// - /// - /// Overriders of this property should never return . - /// - /// - public abstract IQueryable Parts - { - get; - } - - /// - /// Returns the export definitions that match the constraint defined by the specified definition. - /// - /// - /// The that defines the conditions of the - /// objects to return. - /// - /// - /// An of containing the - /// objects and their associated - /// for objects that match the constraint defined - /// by . - /// - /// - /// is . - /// - /// - /// The has been disposed of. - /// - /// - /// - /// Overriders of this property should never return , if no - /// match the conditions defined by - /// , return an empty . - /// - /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public virtual IEnumerable> GetExports(ImportDefinition definition) - { - this.ThrowIfDisposed(); - - Requires.NotNull(definition, "definition"); - - var exports = new List>(); - foreach (var part in this.Parts) - { - foreach (var export in part.ExportDefinitions) - { - if (definition.IsConstraintSatisfiedBy(export)) - { - exports.Add(new Tuple(part, export)); - } - } - } - return exports; - - } - - /// - /// Releases the unmanaged resources used by the and - /// optionally releases the managed resources. - /// - /// - /// to release both managed and unmanaged resources; - /// to release only unmanaged resources. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - this._isDisposed = true; - } - - private void ThrowIfDisposed() - { - if (this._isDisposed) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxy.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxy.cs deleted file mode 100644 index 3d5f72af59b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxy.cs +++ /dev/null @@ -1,33 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.ObjectModel; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.Primitives -{ - // This proxy is needed to pretty up ComposablePartCatalog.Parts; IQueryable - // instances are not displayed in a very friendly way in the debugger. - internal class ComposablePartCatalogDebuggerProxy - { - private readonly ComposablePartCatalog _catalog; - - public ComposablePartCatalogDebuggerProxy(ComposablePartCatalog catalog) - { - Requires.NotNull(catalog, "catalog"); - - this._catalog = catalog; - } - - public ReadOnlyCollection Parts - { - // NOTE: This shouldn't be cached, so that on every query of - // the current value of the underlying catalog is respected. - // We use ReadOnlyCollection as arrays do not have the - // appropriate debugger display attributes applied to them. - get { return this._catalog.Parts.ToReadOnlyCollection(); } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartDefinition.cs deleted file mode 100644 index 979022a4f82..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartDefinition.cs +++ /dev/null @@ -1,102 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; - -namespace System.ComponentModel.Composition.Primitives -{ - /// - /// Defines the base class for composable part definitions, which - /// describe, and allow the creation of, objects. - /// - public abstract class ComposablePartDefinition - { - /// - /// Initializes a new instance of the class. - /// - protected ComposablePartDefinition() - { - } - - /// - /// Gets the export definitions that describe the exported values provided by parts - /// created by the definition. - /// - /// - /// An of objects describing - /// the exported values provided by objects created by the - /// . - /// - /// - /// - /// Overrides of this property should never return . - /// If the objects created by the - /// do not provide exported values, return - /// an empty instead. - /// - /// - public abstract IEnumerable ExportDefinitions { get; } - - /// - /// Gets the import definitions that describe the imports required by parts created - /// by the definition. - /// - /// - /// An of objects describing - /// the imports required by objects created by the - /// . - /// - /// - /// - /// Overriders of this property should never return . - /// If the objects created by the - /// do not have imports, return an empty - /// instead. - /// - /// - public abstract IEnumerable ImportDefinitions { get; } - - /// - /// Gets the metadata of the definition. - /// - /// - /// An containing the metadata of the - /// . The default is an empty, read-only - /// . - /// - /// - /// - /// - /// Overriders of this property should return a read-only - /// object with a case-sensitive, - /// non-linguistic comparer, such as , - /// and should never return . If the - /// does contain metadata, - /// return an empty instead. - /// - /// - /// - public virtual IDictionary Metadata - { - get { return MetadataServices.EmptyMetadata; } - } - - /// - /// Creates a new instance of a part that the definition describes. - /// - /// - /// The created . - /// - /// - /// - /// - /// Derived types overriding this method should return a new instance of a - /// on every invoke and should never return - /// . - /// - /// - /// - public abstract ComposablePart CreatePart(); - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartException.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartException.cs deleted file mode 100644 index 2f05593f13a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartException.cs +++ /dev/null @@ -1,214 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.Runtime.Serialization; -using System.Security.Permissions; -using Microsoft.Internal; - -#if !SILVERLIGHT -using Microsoft.Internal.Runtime.Serialization; -#endif - -namespace System.ComponentModel.Composition.Primitives -{ - /// - /// The exception that is thrown when an error occurs when calling methods on a - /// . - /// - [Serializable] - public class ComposablePartException : Exception, ICompositionError - { - private readonly CompositionErrorId _id; - private readonly ICompositionElement _element; - - /// - /// Initializes a new instance of the class. - /// - public ComposablePartException() - : this(CompositionErrorId.Unknown, (string)null, (ICompositionElement)null, (Exception)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message. - /// - /// - /// A containing a message that describes the - /// ; or to set - /// the property to its default value. - /// - /// - /// The that is the cause of the - /// ; or to set - /// the property to - /// . - /// - public ComposablePartException(string message) - : this(CompositionErrorId.Unknown, message, (ICompositionElement)null, (Exception)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message and composition element that is the cause of - /// the exception. - /// - /// - /// A containing a message that describes the - /// ; or to set - /// the property to its default value. - /// - public ComposablePartException(string message, ICompositionElement element) - : this(CompositionErrorId.Unknown, message, element, (Exception)null) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message and exception that is the cause of the - /// exception. - /// - /// - /// A containing a message that describes the - /// ; or to set - /// the property to its default value. - /// - /// - /// The that is the underlying cause of the - /// ; or to set - /// the property to . - /// - public ComposablePartException(string message, Exception innerException) - : this(CompositionErrorId.Unknown, message, (ICompositionElement)null, innerException) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified error message, and composition element and exception that - /// are the cause of the exception. - /// - /// - /// A containing a message that describes the - /// ; or to set - /// the property to its default value. - /// - /// - /// The that is the cause of the - /// ; or to set - /// the property to - /// . - /// - /// - /// The that is the underlying cause of the - /// ; or to set - /// the property to . - /// - public ComposablePartException(string message, ICompositionElement element, Exception innerException) - : this(CompositionErrorId.Unknown, message, element, innerException) - { - } - - internal ComposablePartException(CompositionErrorId id, string message) - : this(id, message, (ICompositionElement)null, (Exception)null) - { - } - - internal ComposablePartException(CompositionErrorId id, string message, Exception exception) - : this(id, message, (ICompositionElement)null, exception) - { - } - - internal ComposablePartException(CompositionErrorId id, string message, ICompositionElement element) - : this(id, message, (ICompositionElement)element, (Exception)null) - { - } - - internal ComposablePartException(CompositionErrorId id, string message, ICompositionElement element, Exception innerException) - : base(message, innerException) - { - _id = id; - _element = element; - } - -#if !SILVERLIGHT - - /// - /// Initializes a new instance of the class - /// with the specified serialization data. - /// - /// - /// The that holds the serialized object data about the - /// . - /// - /// - /// The that contains contextual information about the - /// source or destination. - /// - /// - /// is . - /// - /// - /// is missing a required value. - /// - /// - /// contains a value that cannot be cast to the correct type. - /// - [System.Security.SecuritySafeCritical] - protected ComposablePartException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - _id = info.GetValue("Id"); - _element = info.GetValue("Element"); - } - -#endif - - /// - /// Gets the composition element that is the cause of the exception. - /// - /// - /// The that is the cause of the - /// . The default is . - /// - public ICompositionElement Element - { - get { return _element; } - } - - CompositionErrorId ICompositionError.Id - { - get { return _id; } - } - -#if !SILVERLIGHT - - /// - /// Gets the serialization data of the exception. - /// - /// - /// The that holds the serialized object data about the - /// . - /// - /// - /// The that contains contextual information about the - /// source or destination. - /// - /// - /// is . - /// - [System.Security.SecurityCritical] - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - - info.AddValue("Id", _id); - info.AddValue("Element", _element.ToSerializableElement()); - } - -#endif - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElement.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElement.cs deleted file mode 100644 index 4cb34de38d7..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElement.cs +++ /dev/null @@ -1,30 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Diagnostics; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Primitives -{ - // Represents the ICompositionElement placeholder for an - // object that does not implement ICompositionElement - [DebuggerTypeProxy(typeof(CompositionElementDebuggerProxy))] - [Serializable] - internal class CompositionElement : SerializableCompositionElement - { - private static readonly ICompositionElement UnknownOrigin = new SerializableCompositionElement(Strings.CompositionElement_UnknownOrigin, (ICompositionElement)null); - private readonly object _underlyingObject; - - public CompositionElement(object underlyingObject) - : base(underlyingObject.ToString(), UnknownOrigin) - { - this._underlyingObject = underlyingObject; - } - - public object UnderlyingObject - { - get { return _underlyingObject; } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElementDebuggerProxy.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElementDebuggerProxy.cs deleted file mode 100644 index 9a12a7d99f3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElementDebuggerProxy.cs +++ /dev/null @@ -1,39 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Primitives -{ - // Because the debugger displays only the members available on ICompositionElement - // when viewing CompositionError.Element in the watch and data tips windows, we - // need this proxy so that the underlying object wrapped by the CompositionElement - // placeholder is displayed by default. - internal class CompositionElementDebuggerProxy - { - private readonly CompositionElement _element; - - public CompositionElementDebuggerProxy(CompositionElement element) - { - Requires.NotNull(element, "element"); - - this._element = element; - } - - public string DisplayName - { - get { return this._element.DisplayName; } - } - - public ICompositionElement Origin - { - get { return this._element.Origin; } - } - - public object UnderlyingObject - { - get { return this._element.UnderlyingObject; } - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElementExtensions.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElementExtensions.cs deleted file mode 100644 index 62fe9678d3e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/CompositionElementExtensions.cs +++ /dev/null @@ -1,82 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Primitives -{ - internal static class CompositionElementExtensions - { -#if !SILVERLIGHT - public static ICompositionElement ToSerializableElement(this ICompositionElement element) - { - return SerializableCompositionElement.FromICompositionElement(element); - } -#endif - public static ICompositionElement ToElement(this Export export) - { - // First try the export - ICompositionElement element = export as ICompositionElement; - if (element != null) - { - return element; - } - - // Otherwise, try the definition - return ToElement(export.Definition); - } - - public static ICompositionElement ToElement(this ExportDefinition definition) - { - return ToElementCore(definition); - } - - public static ICompositionElement ToElement(this ImportDefinition definition) - { - return ToElementCore(definition); - } - - public static ICompositionElement ToElement(this ComposablePart part) - { - return ToElementCore(part); - } - - public static ICompositionElement ToElement(this ComposablePartDefinition definition) - { - return ToElementCore(definition); - } - - public static string GetDisplayName(this ComposablePartDefinition definition) - { - return GetDisplayNameCore(definition); - } - - public static string GetDisplayName(this ComposablePartCatalog catalog) - { - return GetDisplayNameCore(catalog); - } - - private static string GetDisplayNameCore(object value) - { - ICompositionElement element = value as ICompositionElement; - if (element != null) - { - return element.DisplayName; - } - - return value.ToString(); - } - - private static ICompositionElement ToElementCore(object value) - { - ICompositionElement element = value as ICompositionElement; - if (element != null) - { - return element; - } - - return new CompositionElement(value); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs deleted file mode 100644 index 010fad17899..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs +++ /dev/null @@ -1,309 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Linq.Expressions; -using Microsoft.Internal; -using System.Globalization; - -namespace System.ComponentModel.Composition.Primitives -{ - /// - /// Represents a contract name and metadata-based import - /// required by a object. - /// - public class ContractBasedImportDefinition : ImportDefinition - { - // Unlike contract name, required metadata has a sensible default; set it to an empty - // enumerable, so that derived definitions only need to override ContractName by default. - private readonly IEnumerable> _requiredMetadata = Enumerable.Empty>(); - private Expression> _constraint; - private readonly CreationPolicy _requiredCreationPolicy = CreationPolicy.Any; - private readonly string _requiredTypeIdentity = null; - private bool _isRequiredMetadataValidated = false; - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// Derived types calling this constructor can optionally override the - /// , , - /// , , - /// , - /// and properties. - /// - /// - protected ContractBasedImportDefinition() - { - } - - /// - /// Initializes a new instance of the class - /// with the specified contract name, required metadataq, cardinality, value indicating - /// if the import definition is recomposable and a value indicating if the import definition - /// is a prerequisite. - /// - /// - /// A containing the contract name of the - /// required by the . - /// - /// - /// The type identity of the export type expected. Use - /// to generate a type identity for a given type. If no specific type is required pass . - /// - /// - /// An of objects containing - /// the metadata names of the required by the - /// ; or to - /// set the property to an empty . - /// - /// - /// One of the values indicating the - /// cardinality of the objects required by the - /// . - /// - /// - /// if the can be satisfied - /// multiple times throughout the lifetime of a , otherwise, - /// . - /// - /// - /// if the is required to be - /// satisfied before a can start producing exported - /// objects; otherwise, . - /// - /// - /// A value indicating that the importer requires a specific for - /// the exports used to satisfy this import. If no specific is needed - /// pass the default . - /// - /// - /// is . - /// - /// - /// is an empty string (""). - /// - /// -or- - /// - /// contains an element that is . - /// - /// -or- - /// - /// is not one of the - /// values. - /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public ContractBasedImportDefinition(string contractName, string requiredTypeIdentity, IEnumerable> requiredMetadata, - ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, CreationPolicy requiredCreationPolicy) - : base(contractName, cardinality, isRecomposable, isPrerequisite) - { - Requires.NotNullOrEmpty(contractName, "contractName"); - - this._requiredTypeIdentity = requiredTypeIdentity; - - if (requiredMetadata != null) - { - this._requiredMetadata = requiredMetadata; - } - - this._requiredCreationPolicy = requiredCreationPolicy; - } - - /// - /// The type identity of the export type expected. - /// - /// - /// A that is generated by - /// on the type that this import expects. If the value is then this import - /// doesn't expect a particular type. - /// - public virtual string RequiredTypeIdentity - { - get { return this._requiredTypeIdentity; } - } - - /// - /// Gets the metadata names of the export required by the import definition. - /// - /// - /// An of pairs of metadata keys and types of the required by the - /// . The default is an empty - /// . - /// - /// - /// - /// Overriders of this property should never return - /// or return an that contains an element that is - /// . If the definition does not contain required metadata, - /// return an empty instead. - /// - /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public virtual IEnumerable> RequiredMetadata - { - get - { - // NOTE : unlike other arguments, we validate this one as late as possible, because its validation may lead to type loading - this.ValidateRequiredMetadata(); - - return this._requiredMetadata; - } - } - - private void ValidateRequiredMetadata() - { - if (!this._isRequiredMetadataValidated) - { - foreach (KeyValuePair metadataItem in this._requiredMetadata) - { - if ((metadataItem.Key == null) || (metadataItem.Value == null)) - { - throw new InvalidOperationException( - string.Format(CultureInfo.CurrentCulture, Strings.Argument_NullElement, "requiredMetadata")); - } - } - this._isRequiredMetadataValidated = true; - } - } - - /// - /// Gets or sets a value indicating that the importer requires a specific - /// for the exports used to satisfy this import. T - /// - /// - /// - default value, used if the importer doesn't - /// require a specific . - /// - /// - Requires that all exports used should be shared - /// by everyone in the container. - /// - /// - Requires that all exports used should be - /// non-shared in a container and thus everyone gets their own instance. - /// - public virtual CreationPolicy RequiredCreationPolicy - { - get { return this._requiredCreationPolicy; } - } - - /// - /// Gets an expression that defines conditions that must be matched for the import - /// described by the import definition to be satisfied. - /// - /// - /// A containing a - /// that defines the conditions that must be matched for the - /// to be satisfied by an . - /// - /// - /// - /// This property returns an expression that defines conditions based on the - /// , , - /// , and - /// properties. - /// - /// - public override Expression> Constraint - { - get - { - if (this._constraint == null) - { - this._constraint = ConstraintServices.CreateConstraint(this.ContractName, this.RequiredTypeIdentity, this.RequiredMetadata, this.RequiredCreationPolicy); - } - - return this._constraint; - } - } - - /// - /// Executes an optimized version of the contraint given by the property - /// - /// - /// A definition for a used to determine if it satisfies the - /// requirements for this . - /// - /// - /// if the satisfies the requirements for - /// this , otherwise returns . - /// - /// - /// - /// Overrides of this method can provide a more optimized execution of the - /// property but the result should remain consistent. - /// - /// - /// - /// is . - /// - public override bool IsConstraintSatisfiedBy(ExportDefinition exportDefinition) - { - Requires.NotNull(exportDefinition, "exportDefinition"); - - if (!StringComparers.ContractName.Equals(this.ContractName, exportDefinition.ContractName)) - { - return false; - } - - return MatchRequiredMatadata(exportDefinition); - } - - private bool MatchRequiredMatadata(ExportDefinition definition) - { - if (!string.IsNullOrEmpty(this.RequiredTypeIdentity)) - { - string exportTypeIdentity = definition.Metadata.GetValue(CompositionConstants.ExportTypeIdentityMetadataName); - - if (!StringComparers.ContractName.Equals(this.RequiredTypeIdentity, exportTypeIdentity)) - { - return false; - } - } - - foreach (KeyValuePair metadataItem in this.RequiredMetadata) - { - string metadataKey = metadataItem.Key; - Type metadataValueType = metadataItem.Value; - - object metadataValue = null; - if (!definition.Metadata.TryGetValue(metadataKey, out metadataValue)) - { - return false; - } - - if (metadataValue != null) - { - // the metadata value is not null, we can rely on IsInstanceOfType to do the right thing - if (!metadataValueType.IsInstanceOfType(metadataValue)) - { - return false; - } - } - else - { - // this is an unfortunate special case - typeof(object).IsInstanceofType(null) == false - // basically nulls are not considered valid values for anything - // We want them to match anything that is a reference type - if (metadataValueType.IsValueType) - { - // this is a pretty expensive check, but we only invoke it when metadata values are null, which is very rare - return false; - } - } - } - - if (this.RequiredCreationPolicy == CreationPolicy.Any) - { - return true; - } - - CreationPolicy exportPolicy = definition.Metadata.GetValue(CompositionConstants.PartCreationPolicyMetadataName); - return exportPolicy == CreationPolicy.Any || - exportPolicy == this.RequiredCreationPolicy; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/Export.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/Export.cs deleted file mode 100644 index 8beaa09b907..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/Export.cs +++ /dev/null @@ -1,245 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Microsoft.Internal; -using System.Threading; - -namespace System.ComponentModel.Composition.Primitives -{ - /// - /// Represents an export. That is, a type that is made up of a delay-created exported value - /// and metadata that describes that object. - /// - public class Export - { - private readonly ExportDefinition _definition; - private readonly Func _exportedValueGetter; - private static readonly object _EmptyValue = new object(); - private volatile object _exportedValue = Export._EmptyValue; - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// Derived types calling this constructor must override - /// and . - /// - /// - protected Export() - { - } - - /// - /// Initializes a new instance of the class - /// with the specified contract name and exported value getter. - /// - /// - /// A containing the contract name of the - /// . - /// - /// - /// A that is called to create the exported value of the - /// . This allows the creation of the object to be delayed - /// - /// - /// is . - /// - /// -or- - /// - /// is . - /// - /// - /// is an empty string (""). - /// - public Export(string contractName, Func exportedValueGetter) - : this(new ExportDefinition(contractName, (IDictionary)null), exportedValueGetter) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified contract name, metadata and exported value getter. - /// - /// - /// A containing the contract name of the - /// . - /// - /// - /// An containing the metadata of the - /// ; or to set the - /// property to an empty, read-only - /// . - /// - /// - /// A that is called to create the exported value of the - /// . This allows the creation of the object to be delayed. - /// - /// - /// is . - /// - /// -or- - /// - /// is . - /// - /// - /// is an empty string (""). - /// - public Export(string contractName, IDictionary metadata, Func exportedValueGetter) - : this(new ExportDefinition(contractName, metadata), exportedValueGetter) - { - } - - /// - /// Initializes a new instance of the class - /// with the specified export definition and exported value getter. - /// - /// - /// An that describes the contract that the - /// satisfies. - /// - /// - /// A that is called to create the exported value of the - /// . This allows the creation of the object to be delayed. - /// - /// - /// is . - /// - /// -or- - /// - /// is . - /// - public Export(ExportDefinition definition, Func exportedValueGetter) - { - Requires.NotNull(definition, "definition"); - Requires.NotNull(exportedValueGetter, "exportedValueGetter"); - - this._definition = definition; - this._exportedValueGetter = exportedValueGetter; - } - - /// - /// Gets the definition that describes the contract that the export satisfies. - /// - /// - /// An that describes the contract that - /// the satisfies. - /// - /// - /// This property was not overridden by a derived class. - /// - /// - /// - /// Overriders of this property should never return - /// . - /// - /// - public virtual ExportDefinition Definition - { - get - { - if (_definition != null) - { - return _definition; - } - - throw ExceptionBuilder.CreateNotOverriddenByDerived("Definition"); - } - } - - /// - /// Gets the metadata of the export. - /// - /// - /// An containing the metadata of the - /// . - /// - /// - /// The property was not overridden by a derived class. - /// - /// - /// - /// This property returns the value of - /// of the property. - /// - /// - public IDictionary Metadata - { - get { return Definition.Metadata; } - } - - /// - /// Returns the exported value of the export. - /// - /// - /// The exported of the . - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - /// - /// The current instance is an instance of and the underlying - /// exported value cannot be cast to T. - /// - /// - /// The method was not overridden by a derived class. - /// - public object Value - { - get - { - // NOTE : the logic below guarantees that the value will be set exactly once. It DOES NOT, however, guarantee that GetExportedValueCore() will be executed - // more than once, as locking would be required for that. The said locking is problematic, as we can't reliable call 3rd party code under a lock. - if (this._exportedValue == Export._EmptyValue) - { - object exportedValue = this.GetExportedValueCore(); - - // NOTE : According to http://msdn.microsoft.com/en-us/library/4bw5ewxy.aspx, the warning is bogus when used with Interlocked API. -#pragma warning disable 420 - Interlocked.CompareExchange(ref this._exportedValue, exportedValue, Export._EmptyValue); -#pragma warning restore 420 - } - - return this._exportedValue; - } - } - - /// - /// Returns the exported value of the export. - /// - /// - /// The exported of the . - /// - /// - /// An error occurred during composition. will - /// contain a collection of errors that occurred. - /// - /// - /// The current instance is an instance of and the underlying - /// exported value cannot be cast to T. - /// - /// - /// The method was not overridden by a derived class. - /// - /// - /// - /// Overriders of this method should never return - /// . - /// - /// - [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] - protected virtual object GetExportedValueCore() - { - if (this._exportedValueGetter != null) - { - return this._exportedValueGetter.Invoke(); - } - - throw ExceptionBuilder.CreateNotOverriddenByDerived("GetExportedValueCore"); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ExportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ExportDefinition.cs deleted file mode 100644 index f4bf8291a7e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ExportDefinition.cs +++ /dev/null @@ -1,131 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Primitives -{ - /// - /// Describes the contract that an object satisfies. - /// - public class ExportDefinition - { - // Unlike contract name, metadata has a sensible default; set it to an empty bag, - // so that derived definitions only need to override ContractName by default. - private readonly IDictionary _metadata = MetadataServices.EmptyMetadata; - private readonly string _contractName; - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// Derived types calling this constructor must override - /// and optionally, . By default, - /// returns an empty, read-only dictionary. - /// - /// - protected ExportDefinition() - { - } - - /// - /// Initializes a new instance of the class with - /// the specified contract name and metadata. - /// - /// - /// A containing the contract name of the - /// . - /// - /// - /// An containing the metadata of the - /// ; or to set the - /// property to an empty, read-only - /// . - /// - /// - /// is . - /// - /// - /// is an empty string (""). - /// - public ExportDefinition(string contractName, IDictionary metadata) - { - Requires.NotNullOrEmpty(contractName, "contractName"); - - _contractName = contractName; - - if (metadata != null) - { - _metadata = metadata.AsReadOnly(); - } - } - - /// - /// Gets the contract name of the export definition. - /// - /// - /// A containing the contract name of the - /// . - /// - /// - /// The property was not overridden by a derived class. - /// - /// - /// - /// Overriders of this property should never return - /// or an empty string (""). - /// - /// - public virtual string ContractName - { - get - { - if (_contractName != null) - { - return _contractName; - } - - throw ExceptionBuilder.CreateNotOverriddenByDerived("ContractName"); - } - } - - /// - /// Gets the metadata of the export definition. - /// - /// - /// An containing the metadata of the - /// . The default is an empty, read-only - /// . - /// - /// - /// - /// - /// Overriders of this property should return a read-only - /// object with a case-sensitive, - /// non-linguistic comparer, such as , - /// and should never return . - /// If the does not contain metadata - /// return an empty instead. - /// - /// - /// - public virtual IDictionary Metadata - { - get { return _metadata; } - } - - /// - /// Returns a string representation of the export definition. - /// - /// - /// A containing the value of the property. - /// - public override string ToString() - { - return this.ContractName; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs deleted file mode 100644 index d6bc6297170..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs +++ /dev/null @@ -1,97 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Diagnostics.CodeAnalysis; -using System.Reflection; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Primitives -{ - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] - public class ExportedDelegate - { - private object _instance; - private MethodInfo _method; - - protected ExportedDelegate() { } -#if !SILVERLIGHT - [System.Security.SecurityCritical] -#endif - public ExportedDelegate(object instance, MethodInfo method) - { - Requires.NotNull(method, "method"); - - this._instance = instance; - this._method = method; - } - - public virtual Delegate CreateDelegate(Type delegateType) - { - Requires.NotNull(delegateType, "delegateType"); - - if (delegateType == typeof(Delegate) || delegateType == typeof(MulticastDelegate)) - { - Type funcOrAction = ConvertMethodInfoToFuncOrActionType(this._method); - - if (funcOrAction != null) - { - delegateType = funcOrAction; - } - else - { - return null; - } - } - - return Delegate.CreateDelegate(delegateType, this._instance, this._method, false); - } - - private static Type[] _funcTypes = - { - typeof(Func<>), typeof(Func<,>), typeof(Func<,,>), typeof(Func<,,,>), typeof(Func<,,,,>) -#if CLR40 && !SILVERLIGHT - , typeof(Func<,,,,,>), typeof(Func<,,,,,,>), typeof(Func<,,,,,,,>), typeof(Func<,,,,,,,,>) -#endif - }; - - private static Type[] _actionTypes = - { - typeof(Action), typeof(Action<>), typeof(Action<,>), typeof(Action<,,>), typeof(Action<,,,>) -#if CLR40 && !SILVERLIGHT - , typeof(Action<,,,,>), typeof(Action<,,,,,>), typeof(Action<,,,,,,>), typeof(Action<,,,,,,,>) -#endif - }; - - private static Type ConvertMethodInfoToFuncOrActionType(MethodInfo method) - { - ParameterInfo[] parameters = method.GetParameters(); - - bool isVoid = method.ReturnType == typeof(void); - Type[] typeArray = isVoid ? _actionTypes : _funcTypes; - - if (parameters.Length >= typeArray.Length) - { - return null; - } - - Type[] genericArgTypes = new Type[parameters.Length + (isVoid ? 0 : 1)]; - - for (int i = 0; i < parameters.Length; i++) - { - genericArgTypes[i] = parameters[i].ParameterType; - } - - if (!isVoid) - { - genericArgTypes[parameters.Length] = method.ReturnType; - } - - Type delegateType = typeArray[parameters.Length].IsGenericType ? - typeArray[parameters.Length].MakeGenericType(genericArgTypes) : - typeArray[parameters.Length]; - - return delegateType; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ICompositionElement.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ICompositionElement.cs deleted file mode 100644 index 6c4863ef067..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ICompositionElement.cs +++ /dev/null @@ -1,44 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition.Primitives -{ - /// - /// Represents an element that participates in composition. - /// - public interface ICompositionElement - { - /// - /// Gets the display name of the composition element. - /// - /// - /// A containing a human-readable display name of the . - /// - /// - /// - /// Implementors of this property should never return or an empty - /// string (""). - /// - /// - string DisplayName - { - get; - } - - /// - /// Gets the composition element from which the current composition element - /// originated. - /// - /// - /// A from which the current - /// originated, or - /// if the is the root composition element. - /// - ICompositionElement Origin - { - get; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/IPartCreatorImportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/IPartCreatorImportDefinition.cs deleted file mode 100644 index 307481c847f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/IPartCreatorImportDefinition.cs +++ /dev/null @@ -1,12 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition.Primitives -{ - internal interface IPartCreatorImportDefinition - { - ContractBasedImportDefinition ProductImportDefinition { get; } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ImportCardinality.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ImportCardinality.cs deleted file mode 100644 index d59dc9bea0b..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ImportCardinality.cs +++ /dev/null @@ -1,28 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition.Primitives -{ - /// - /// Indicates the cardinality of the objects required by an . - /// - public enum ImportCardinality - { - /// - /// Zero or one objects are required by an . - /// - ZeroOrOne = 0, - - /// - /// Exactly one object is required by an . - /// - ExactlyOne = 1, - - /// - /// Zero or more objects are required by an . - /// - ZeroOrMore = 2, - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ImportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ImportDefinition.cs deleted file mode 100644 index 9c81b51c90f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ImportDefinition.cs +++ /dev/null @@ -1,236 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq.Expressions; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Primitives -{ - /// - /// Represents an import required by a object. - /// - public class ImportDefinition - { - internal static readonly string EmptyContractName = string.Empty; - private readonly Expression> _constraint; - private readonly ImportCardinality _cardinality = ImportCardinality.ExactlyOne; - private readonly string _contractName = EmptyContractName; - private readonly bool _isRecomposable; - private readonly bool _isPrerequisite = true; - private Func _compiledConstraint; - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// Derived types calling this constructor must override the - /// property, and optionally, the , - /// and - /// properties. - /// - /// - protected ImportDefinition() - { - } - - /// - /// Initializes a new instance of the class - /// with the specified constraint, cardinality, value indicating if the import - /// definition is recomposable and a value indicating if the import definition - /// is a prerequisite. - /// - /// - /// A containing a - /// that defines the conditions that must be matched for the - /// to be satisfied by an . - /// - /// - /// The contract name of the export that this import is interested in. The contract name - /// property is used as guidance and not automatically enforced in the constraint. If - /// the contract name is a required in the constraint then it should be added to the constraint - /// by the caller of this constructor. - /// - /// - /// One of the values indicating the - /// cardinality of the objects required by the - /// . - /// - /// - /// if the can be satisfied - /// multiple times throughout the lifetime of a , otherwise, - /// . - /// - /// - /// if the is required to be - /// satisfied before a can start producing exported - /// objects; otherwise, . - /// - /// - /// is . - /// - /// - /// is not one of the - /// values. - /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public ImportDefinition(Expression> constraint, string contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite) - : this(contractName, cardinality, isRecomposable, isPrerequisite) - { - Requires.NotNull(constraint, "constraint"); - - this._constraint = constraint; - } - - internal ImportDefinition(string contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite) - { - if ( - (cardinality != ImportCardinality.ExactlyOne) && - (cardinality != ImportCardinality.ZeroOrMore) && - (cardinality != ImportCardinality.ZeroOrOne) - ) - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentOutOfRange_InvalidEnum, "cardinality", cardinality, typeof(ImportCardinality).Name), "cardinality"); - } - - this._contractName = contractName ?? EmptyContractName; - this._cardinality = cardinality; - this._isRecomposable = isRecomposable; - this._isPrerequisite = isPrerequisite; - } - - /// - /// Gets the contract name of the export required by the import definition. - /// - /// - /// A containing the contract name of the - /// required by the . This property should - /// return for imports that do not require a specific - /// contract name. - /// - public virtual string ContractName - { - get { return this._contractName; } - } - - /// - /// Gets the cardinality of the exports required by the import definition. - /// - /// - /// One of the values indicating the - /// cardinality of the objects required by the - /// . The default is - /// - /// - public virtual ImportCardinality Cardinality - { - get { return this._cardinality; } - } - - /// - /// Gets an expression that defines conditions that must be matched for the import - /// described by the import definition to be satisfied. - /// - /// - /// A containing a - /// that defines the conditions that must be matched for the - /// to be satisfied by an . - /// - /// - /// The property was not overridden by a derived class. - /// - /// - /// - /// Overriders of this property should never return . - /// - /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public virtual Expression> Constraint - { - get - { - if (this._constraint != null) - { - return this._constraint; - } - - throw ExceptionBuilder.CreateNotOverriddenByDerived("Constraint"); - } - } - - /// - /// Gets a value indicating whether the import definition is required to be - /// satisfied before a part can start producing exported values. - /// - /// - /// if the is required to be - /// satisfied before a can start producing exported - /// objects; otherwise, . The default is . - /// - public virtual bool IsPrerequisite - { - get { return this._isPrerequisite; } - } - - /// - /// Gets a value indicating whether the import definition can be satisfied multiple times. - /// - /// - /// if the can be satisfied - /// multiple times throughout the lifetime of a , otherwise, - /// . The default is . - /// - public virtual bool IsRecomposable - { - get { return this._isRecomposable; } - } - - /// - /// Executes of the constraint provided by the property - /// against a given to determine if this - /// can be satisfied by the given . - /// - /// - /// A definition for a used to determine if it satisfies the - /// requirements for this . - /// - /// - /// if the satisfies the requirements for - /// this , otherwise returns . - /// - /// - /// - /// Overrides of this method can provide a more optimized execution of the - /// property but the result should remain consistent. - /// - /// - /// - /// is . - /// - public virtual bool IsConstraintSatisfiedBy(ExportDefinition exportDefinition) - { - Requires.NotNull(exportDefinition, "exportDefinition"); - - if (this._compiledConstraint == null) - { - this._compiledConstraint = this.Constraint.Compile(); - } - - return this._compiledConstraint.Invoke(exportDefinition); - } - - /// - /// Returns a string representation of the import definition. - /// - /// - /// A containing the value of the property. - /// - public override string ToString() - { - return this.Constraint.Body.ToString(); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/SerializableCompositionElement.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/SerializableCompositionElement.cs deleted file mode 100644 index f84d5a1ec50..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/SerializableCompositionElement.cs +++ /dev/null @@ -1,57 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.Primitives -{ - // As most objects that implement ICompositionElement (such as Export, ComposablePart, - // ComposablePartCatalog, etc) are not serializable, this class is used as a serializable - // placeholder for these types when ICompositionElement is used within serializable types, - // such as CompositionException, CompositionIssue, etc. - [Serializable] - internal class SerializableCompositionElement : ICompositionElement - { - private readonly string _displayName; - private readonly ICompositionElement _origin; - - public SerializableCompositionElement(string displayName, ICompositionElement origin) - { -#if !SILVERLIGHT - Assumes.IsTrue(origin == null || origin.GetType().IsSerializable); -#endif - this._displayName = displayName ?? string.Empty; - this._origin = origin; - } - - public string DisplayName - { - get { return this._displayName; } - } - - public ICompositionElement Origin - { - get { return this._origin; } - } - - public override string ToString() - { - return this.DisplayName; - } - - public static ICompositionElement FromICompositionElement(ICompositionElement element) - { - if (element == null) - { // Null is always serializable - - return null; - } - - ICompositionElement origin = FromICompositionElement(element.Origin); - - // Otherwise, we need to create a serializable wrapper - return new SerializableCompositionElement(element.DisplayName, origin); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/.gitattributes deleted file mode 100644 index 8fcb7fbb6d5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/.gitattributes +++ /dev/null @@ -1,28 +0,0 @@ -/DisposableReflectionComposablePart.cs -crlf -/ExportingMember.cs -crlf -/IReflectionPartCreationInfo.cs -crlf -/ImportType.cs -crlf -/ImportingItem.cs -crlf -/ImportingMember.cs -crlf -/ImportingParameter.cs -crlf -/LazyMemberInfo.cs -crlf -/PartCreatorExportDefinition.cs -crlf -/PartCreatorMemberImportDefinition.cs -crlf -/PartCreatorParameterImportDefinition.cs -crlf -/ReflectionComposablePart.cs -crlf -/ReflectionComposablePartDefinition.cs -crlf -/ReflectionExtensions.cs -crlf -/ReflectionField.cs -crlf -/ReflectionImportDefinition.cs -crlf -/ReflectionItem.cs -crlf -/ReflectionItemType.cs -crlf -/ReflectionMember.cs -crlf -/ReflectionMemberExportDefinition.cs -crlf -/ReflectionMemberImportDefinition.cs -crlf -/ReflectionMethod.cs -crlf -/ReflectionModelServices.cs -crlf -/ReflectionParameter.cs -crlf -/ReflectionParameterImportDefinition.cs -crlf -/ReflectionProperty.cs -crlf -/ReflectionType.cs -crlf -/ReflectionWritableMember.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/DisposableReflectionComposablePart.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/DisposableReflectionComposablePart.cs deleted file mode 100644 index c6b9854691a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/DisposableReflectionComposablePart.cs +++ /dev/null @@ -1,57 +0,0 @@ - -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal sealed class DisposableReflectionComposablePart : ReflectionComposablePart, IDisposable - { - private volatile int _isDisposed = 0; - - public DisposableReflectionComposablePart(ReflectionComposablePartDefinition definition) - : base(definition) - { - } - - protected override void ReleaseInstanceIfNecessary(object instance) - { - IDisposable disposable = instance as IDisposable; - if (disposable != null) - { - disposable.Dispose(); - } - } - - protected override void EnsureRunning() - { - base.EnsureRunning(); - if (this._isDisposed == 1) - { - throw ExceptionBuilder.CreateObjectDisposed(this); - } - } - - void IDisposable.Dispose() - { - // NOTE : According to http://msdn.microsoft.com/en-us/library/4bw5ewxy.aspx, the warning is bogus when used with Interlocked API. -#pragma warning disable 420 - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) -#pragma warning restore 420 - { - this.ReleaseInstanceIfNecessary(this.CachedInstance); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ExportingMember.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ExportingMember.cs deleted file mode 100644 index 5276e7a1528..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ExportingMember.cs +++ /dev/null @@ -1,93 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Globalization; -using System.Reflection; -using Microsoft.Internal; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class ExportingMember - { - private readonly ExportDefinition _definition; - private readonly ReflectionMember _member; - private object _cachedValue = null; - private volatile bool _isValueCached = false; - - public ExportingMember(ExportDefinition definition, ReflectionMember member) - { - Assumes.NotNull(definition, member); - - this._definition = definition; - this._member = member; - } - - public bool RequiresInstance - { - get { return _member.RequiresInstance; } - } - - public ExportDefinition Definition - { - get { return _definition; } - } - - public object GetExportedValue(object instance, object @lock) - { - this.EnsureReadable(); - - if (!this._isValueCached) - { - object exportedValue; - try - { - exportedValue = this._member.GetValue(instance); - } - catch (TargetInvocationException exception) - { // Member threw an exception. Avoid letting this - // leak out as a 'raw' unhandled exception, instead, - // we'll add some context and rethrow. - - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ExportThrewException, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ExportThrewException, - this._member.GetDisplayName()), - Definition.ToElement(), - exception.InnerException); - } - - lock (@lock) - { - if (!this._isValueCached) - { - this._cachedValue = exportedValue; - Thread.MemoryBarrier(); - - this._isValueCached = true; - } - } - } - - return this._cachedValue; - } - - private void EnsureReadable() - { - if (!this._member.CanRead) - { // Property does not have a getter - - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ExportNotReadable, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ExportNotReadable, - this._member.GetDisplayName()), - Definition.ToElement()); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/IReflectionPartCreationInfo.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/IReflectionPartCreationInfo.cs deleted file mode 100644 index ac2a31a98f0..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/IReflectionPartCreationInfo.cs +++ /dev/null @@ -1,22 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Reflection; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal interface IReflectionPartCreationInfo : ICompositionElement - { - Type GetPartType(); - Lazy GetLazyPartType(); - ConstructorInfo GetConstructor(); - IDictionary GetMetadata(); - IEnumerable GetExports(); - IEnumerable GetImports(); - bool IsDisposalRequired { get; } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportType.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportType.cs deleted file mode 100644 index 60da83d83a9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportType.cs +++ /dev/null @@ -1,140 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; -using Microsoft.Internal; -using Microsoft.Internal.Collections; -using System.Reflection; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - // Describes the import type of a Reflection-based import definition - internal class ImportType - { - private static readonly Type LazyOfTType = typeof(Lazy<>); - private static readonly Type LazyOfTMType = typeof(Lazy<,>); - private const string ExportFactoryTypeName = "System.ComponentModel.Composition.ExportFactory"; - - private readonly Type _type; - private readonly bool _isAssignableCollectionType; - private readonly Type _contractType; - private Func _castSingleValue; - - public ImportType(Type type, ImportCardinality cardinality) - { - Assumes.NotNull(type); - - this._type = type; - this._contractType = type; - - if (cardinality == ImportCardinality.ZeroOrMore) - { - this._isAssignableCollectionType = IsTypeAssignableCollectionType(type); - this._contractType = CheckForCollection(type); - } - - this._contractType = CheckForLazyAndPartCreator(this._contractType); - } - - public bool IsAssignableCollectionType - { - get { return this._isAssignableCollectionType; } - } - - public Type ElementType { get; private set; } - - public Type ActualType - { - get { return this._type; } - } - - public bool IsPartCreator { get; private set; } - - public Type ContractType { get { return this._contractType; } } - - public Func CastExport { get { return this._castSingleValue; } } - - public Type MetadataViewType { get; private set; } - - private Type CheckForCollection(Type type) - { - this.ElementType = CollectionServices.GetEnumerableElementType(type); - if (this.ElementType != null) - { - return this.ElementType; - } - return type; - } - - private Type CheckForLazyAndPartCreator(Type type) - { - if (type.IsGenericType) - { - Type genericType = type.GetGenericTypeDefinition(); - Type[] arguments = type.GetGenericArguments(); - - if (genericType == LazyOfTType) - { - this._castSingleValue = ExportServices.CreateStronglyTypedLazyFactory(arguments[0], null); - return arguments[0]; - } - - if (genericType == LazyOfTMType) - { - this.MetadataViewType = arguments[1]; - this._castSingleValue = ExportServices.CreateStronglyTypedLazyFactory(arguments[0], arguments[1]); - return arguments[0]; - } - - if ( - type.FullName.StartsWith(ExportFactoryTypeName, StringComparison.Ordinal) && - ((arguments.Length == 1) || (arguments.Length == 2))) - { - // Func> - Type exportLifetimeContextCreatorType = typeof(Func<>).MakeGenericType(typeof(Tuple<,>).MakeGenericType(arguments[0], typeof(Action))); - ConstructorInfo constructor = null; - - if (arguments.Length == 1) - { - constructor = type.GetConstructor(new Type[] { exportLifetimeContextCreatorType }); - } - else - { - Assumes.IsTrue(arguments.Length == 2); - constructor = type.GetConstructor(new Type[] { exportLifetimeContextCreatorType, arguments[1] }); - } - - if (constructor != null) - { - this.IsPartCreator = true; - if (arguments.Length == 1) - { - this._castSingleValue = ExportServices.CreateStronglyTypedExportFactoryFactory(arguments[0], null, constructor); - } - else - { - Assumes.IsTrue(arguments.Length == 2); - this._castSingleValue = ExportServices.CreateStronglyTypedExportFactoryFactory(arguments[0], arguments[1], constructor); - this.MetadataViewType = arguments[1]; - } - - return arguments[0]; - } - } - } - - return type; - } - - private static bool IsTypeAssignableCollectionType(Type type) - { - if (type.IsArray || CollectionServices.IsEnumerableOfT(type)) - { - return true; - } - - return false; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingItem.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingItem.cs deleted file mode 100644 index 3b07368b974..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingItem.cs +++ /dev/null @@ -1,116 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Globalization; -using System.Linq; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal abstract class ImportingItem - { - private readonly ContractBasedImportDefinition _definition; - private readonly ImportType _importType; - - protected ImportingItem(ContractBasedImportDefinition definition, ImportType importType) - { - Assumes.NotNull(definition); - - this._definition = definition; - this._importType = importType; - } - - public ContractBasedImportDefinition Definition - { - get { return this._definition; } - } - - public ImportType ImportType - { - get { return this._importType; } - } - - public object CastExportsToImportType(Export[] exports) - { - if (this.Definition.Cardinality == ImportCardinality.ZeroOrMore) - { - return CastExportsToCollectionImportType(exports); - } - else - { - return CastExportsToSingleImportType(exports); - } - } - - private object CastExportsToCollectionImportType(Export[] exports) - { - Assumes.NotNull(exports); - - // Element type could be null if the actually import type of the member is not a collection - // This particular case will end up failing when we set the member. - Type elementType = this.ImportType.ElementType ?? typeof(object); - - Array array = Array.CreateInstance(elementType, exports.Length); - - for (int i = 0; i < array.Length; i++) - { - object value = CastSingleExportToImportType(elementType, exports[i]); - - array.SetValue(value, i); - } - - return array; - } - - private object CastExportsToSingleImportType(Export[] exports) - { - Assumes.NotNull(exports); - Assumes.IsTrue(exports.Length < 2); - - if (exports.Length == 0) - { - return null; - } - - return CastSingleExportToImportType(this.ImportType.ActualType, exports[0]); - } - - private object CastSingleExportToImportType(Type type, Export export) - { - if (this.ImportType.CastExport != null) - { - return this.ImportType.CastExport(export); - } - - return Cast(type, export); - } - - private object Cast(Type type, Export export) - { - // TODO: Need to catch CompositionException to provide - // additional information about what member we're setting - // and the current dependency graph. - object value = export.Value; - - object result; - if (!ContractServices.TryCast(type, value, out result)) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ImportNotAssignableFromExport, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ImportNotAssignableFromExport, - export.ToElement().DisplayName, - type.FullName), - this.Definition.ToElement()); - } - - return result; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs deleted file mode 100644 index 6e5cffe183a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs +++ /dev/null @@ -1,253 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class ImportingMember : ImportingItem - { - private readonly ReflectionWritableMember _member; - - public ImportingMember(ContractBasedImportDefinition definition, ReflectionWritableMember member, ImportType importType) - : base(definition, importType) - { - Assumes.NotNull(definition, member); - - this._member = member; - } - - public void SetExportedValue(object instance, object value) - { - if (RequiresCollectionNormalization()) - { - this.SetCollectionMemberValue(instance, (IEnumerable)value); - } - else - { - this.SetSingleMemberValue(instance, value); - } - } - - private bool RequiresCollectionNormalization() - { - if (this.Definition.Cardinality != ImportCardinality.ZeroOrMore) - { // If we're not looking at a collection import, then don't - // 'normalize' the collection. - - return false; - } - - if (this._member.CanWrite && this.ImportType.IsAssignableCollectionType) - { // If we can simply replace the entire value of the property/field, then - // we don't need to 'normalize' the collection. - - return false; - } - - return true; - } - - private void SetSingleMemberValue(object instance, object value) - { - EnsureWritable(); - - try - { - this._member.SetValue(instance, value); - } - catch (TargetInvocationException exception) - { // Member threw an exception. Avoid letting this - // leak out as a 'raw' unhandled exception, instead, - // we'll add some context and rethrow. - - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ImportThrewException, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ImportThrewException, - this._member.GetDisplayName()), - Definition.ToElement(), - exception.InnerException); - } - } - - private void EnsureWritable() - { - if (!this._member.CanWrite) - { // Property does not have a setter, or - // field is marked as read-only. - - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ImportNotWritable, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ImportNotWritable, - this._member.GetDisplayName()), - Definition.ToElement()); - } - } - - private void SetCollectionMemberValue(object instance, IEnumerable values) - { - Assumes.NotNull(values); - - ICollection collection = null; - Type itemType = CollectionServices.GetCollectionElementType(this.ImportType.ActualType); - if (itemType != null) - { - collection = GetNormalizedCollection(itemType, instance); - } - - EnsureCollectionIsWritable(collection); - PopulateCollection(collection, values); - } - - private ICollection GetNormalizedCollection(Type itemType, object instance) - { - Assumes.NotNull(itemType); - - object collectionObject = null; - - if (this._member.CanRead) - { - try - { - collectionObject = this._member.GetValue(instance); - } - catch (TargetInvocationException exception) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ImportCollectionGetThrewException, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ImportCollectionGetThrewException, - this._member.GetDisplayName()), - this.Definition.ToElement(), - exception.InnerException); - } - } - - if (collectionObject == null) - { - ConstructorInfo constructor = this.ImportType.ActualType.GetConstructor(Type.EmptyTypes); - - // If it contains a default public constructor create a new instance. - if (constructor != null) - { - try - { - collectionObject = constructor.SafeInvoke(); - } - catch (TargetInvocationException exception) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ImportCollectionConstructionThrewException, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ImportCollectionConstructionThrewException, - this._member.GetDisplayName(), - this.ImportType.ActualType.FullName), - this.Definition.ToElement(), - exception.InnerException); - } - - SetSingleMemberValue(instance, collectionObject); - } - } - - if (collectionObject == null) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ImportCollectionNull, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ImportCollectionNull, - this._member.GetDisplayName()), - this.Definition.ToElement()); - } - - return CollectionServices.GetCollectionWrapper(itemType, collectionObject); - } - - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] - private void EnsureCollectionIsWritable(ICollection collection) - { - bool isReadOnly = true; - - try - { - if (collection != null) - { - isReadOnly = collection.IsReadOnly; - } - } - catch (Exception exception) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ImportCollectionIsReadOnlyThrewException, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ImportCollectionIsReadOnlyThrewException, - this._member.GetDisplayName(), - collection.GetType().FullName), - this.Definition.ToElement(), - exception); - } - - if (isReadOnly) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ImportCollectionNotWritable, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ImportCollectionNotWritable, - this._member.GetDisplayName()), - this.Definition.ToElement()); - } - } - - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] - private void PopulateCollection(ICollection collection, IEnumerable values) - { - Assumes.NotNull(collection, values); - - try - { - collection.Clear(); - } - catch (Exception exception) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ImportCollectionClearThrewException, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ImportCollectionClearThrewException, - this._member.GetDisplayName(), - collection.GetType().FullName), - this.Definition.ToElement(), - exception); - } - - foreach (object value in values) - { - try - { - collection.Add(value); - } - catch (Exception exception) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ImportCollectionAddThrewException, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ImportCollectionAddThrewException, - this._member.GetDisplayName(), - collection.GetType().FullName), - this.Definition.ToElement(), - exception); - } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingParameter.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingParameter.cs deleted file mode 100644 index a454189613a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ImportingParameter.cs +++ /dev/null @@ -1,16 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class ImportingParameter : ImportingItem - { - public ImportingParameter(ContractBasedImportDefinition definition, ImportType importType) - : base(definition, importType) - { - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs deleted file mode 100644 index 6b492cf7308..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs +++ /dev/null @@ -1,207 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using System.Reflection; -using System.Threading; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - public struct LazyMemberInfo - { - private readonly MemberTypes _memberType; - private MemberInfo[] _accessors; - private readonly Func _accessorsCreator; - - public LazyMemberInfo(MemberInfo member) - { - Requires.NotNull(member, "member"); - EnsureSupportedMemberType(member.MemberType, "member"); - - this._accessorsCreator = null; - this._memberType = member.MemberType; - - switch(this._memberType) - { - case MemberTypes.Property: - PropertyInfo property = (PropertyInfo)member; - Assumes.NotNull(property); - this._accessors = new MemberInfo[] { property.GetGetMethod(true), property.GetSetMethod(true) }; - break; - case MemberTypes.Event: - EventInfo event_ = (EventInfo)member; - this._accessors = new MemberInfo[] { event_.GetRaiseMethod(true), event_.GetAddMethod(true), event_.GetRemoveMethod(true) }; - break; - default: - this._accessors = new MemberInfo[] { member }; - break; - } - } - - public LazyMemberInfo(MemberTypes memberType, params MemberInfo[] accessors) - { - EnsureSupportedMemberType(memberType, "memberType"); - Requires.NotNull(accessors, "accessors"); - - string errorMessage; - if (!LazyMemberInfo.AreAccessorsValid(memberType, accessors, out errorMessage)) - { - throw new ArgumentException(errorMessage, "accessors"); - } - - this._memberType = memberType; - this._accessors = accessors; - this._accessorsCreator = null; - } - - public LazyMemberInfo(MemberTypes memberType, Func accessorsCreator) - { - EnsureSupportedMemberType(memberType, "memberType"); - Requires.NotNull(accessorsCreator, "accessorsCreator"); - - this._memberType = memberType; - this._accessors = null; - this._accessorsCreator = accessorsCreator; - } - - public MemberTypes MemberType - { - get { return this._memberType; } - } - - public MemberInfo[] GetAccessors() - { - if ((this._accessors == null) && (this._accessorsCreator != null)) - { - MemberInfo[] accessors = this._accessorsCreator.Invoke(); - - string errorMessage; - if (!LazyMemberInfo.AreAccessorsValid(this.MemberType, accessors, out errorMessage)) - { - throw new InvalidOperationException(errorMessage); - } - - this._accessors = accessors; - } - - return this._accessors; - } - - public override int GetHashCode() - { - if (this._accessorsCreator != null) - { - return this.MemberType.GetHashCode() ^ this._accessorsCreator.GetHashCode(); - } - else - { - Assumes.NotNull(this._accessors); - Assumes.NotNull(this._accessors[0]); - return this.MemberType.GetHashCode() ^ this._accessors[0].GetHashCode(); - } - } - - public override bool Equals(object obj) - { - LazyMemberInfo that = (LazyMemberInfo)obj; - - // Difefrent member types mean different members - if (this._memberType != that._memberType) - { - return false; - } - - // if any of the lazy memebers create accessors in a delay-loaded fashion, we simply compare the creators - if ((this._accessorsCreator != null) || (that._accessorsCreator != null)) - { - return object.Equals(this._accessorsCreator, that._accessorsCreator); - } - - // we are dealing with explicitly passed accessors in both cases - Assumes.NotNull(this._accessors); - Assumes.NotNull(that._accessors); - return this._accessors.SequenceEqual(that._accessors); - } - - public static bool operator ==(LazyMemberInfo left, LazyMemberInfo right) - { - return left.Equals(right); - } - - public static bool operator !=(LazyMemberInfo left, LazyMemberInfo right) - { - return !left.Equals(right); - } - - private static void EnsureSupportedMemberType(MemberTypes memberType, string argument) - { - MemberTypes supportedTypes = MemberTypes.TypeInfo | MemberTypes.NestedType | MemberTypes.Constructor | MemberTypes.Field | MemberTypes.Method | MemberTypes.Property | MemberTypes.Event; - Requires.IsInMembertypeSet(memberType, argument, supportedTypes); - } - - private static bool AreAccessorsValid(MemberTypes memberType, MemberInfo[] accessors, out string errorMessage) - { - errorMessage = string.Empty; - if (accessors == null) - { - errorMessage = Strings.LazyMemberInfo_AccessorsNull; - return false; - } - - if (accessors.All(accessor => accessor == null)) - { - errorMessage = Strings.LazyMemberInfo_NoAccessors; - return false; - } - - switch (memberType) - { - case MemberTypes.Property: - if (accessors.Length != 2) - { - errorMessage = Strings.LazyMemberInfo_InvalidPropertyAccessors_Cardinality; - return false; - } - - if (accessors.Where(accessor => (accessor != null) && (accessor.MemberType != MemberTypes.Method)).Any()) - { - errorMessage = Strings.LazyMemberinfo_InvalidPropertyAccessors_AccessorType; - return false; - } - - break; - - case MemberTypes.Event: - if (accessors.Length != 3) - { - errorMessage = Strings.LazyMemberInfo_InvalidEventAccessors_Cardinality; - return false; - } - - if (accessors.Where(accessor => (accessor != null) && (accessor.MemberType != MemberTypes.Method)).Any()) - { - errorMessage = Strings.LazyMemberinfo_InvalidPropertyAccessors_AccessorType; - return false; - } - - break; - - default: - if ( - (accessors.Length != 1) || - ((accessors.Length == 1) && (accessors[0].MemberType != memberType))) - { - errorMessage = string.Format(CultureInfo.CurrentCulture, Strings.LazyMemberInfo_InvalidAccessorOnSimpleMember, memberType); - return false; - } - - break; - } - return true; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorExportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorExportDefinition.cs deleted file mode 100644 index 2b135441a39..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorExportDefinition.cs +++ /dev/null @@ -1,62 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class PartCreatorExportDefinition : ExportDefinition - { - private readonly ExportDefinition _productDefinition; - private IDictionary _metadata; - - public PartCreatorExportDefinition(ExportDefinition productDefinition) - : base() - { - this._productDefinition = productDefinition; - } - - public override string ContractName - { - get - { - return CompositionConstants.PartCreatorContractName; - } - } - - public override IDictionary Metadata - { - get - { - if (this._metadata == null) - { - var metadata = new Dictionary(this._productDefinition.Metadata); - metadata[CompositionConstants.ExportTypeIdentityMetadataName] = CompositionConstants.PartCreatorTypeIdentity; - metadata[CompositionConstants.ProductDefinitionMetadataName] = this._productDefinition; - - this._metadata = metadata.AsReadOnly(); - } - return this._metadata; - } - } - - internal static bool IsProductConstraintSatisfiedBy(ImportDefinition productImportDefinition, ExportDefinition exportDefinition) - { - object productValue = null; - if (exportDefinition.Metadata.TryGetValue(CompositionConstants.ProductDefinitionMetadataName, out productValue)) - { - ExportDefinition productDefinition = productValue as ExportDefinition; - - if (productDefinition != null) - { - return productImportDefinition.IsConstraintSatisfiedBy(productDefinition); - } - } - - return false; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorMemberImportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorMemberImportDefinition.cs deleted file mode 100644 index 8eb39638fe3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorMemberImportDefinition.cs +++ /dev/null @@ -1,48 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq.Expressions; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class PartCreatorMemberImportDefinition : ReflectionMemberImportDefinition, IPartCreatorImportDefinition - { - private readonly ContractBasedImportDefinition _productImportDefinition; - - public PartCreatorMemberImportDefinition( - LazyMemberInfo importingLazyMember, - ICompositionElement origin, - ContractBasedImportDefinition productImportDefinition) - : base(importingLazyMember, CompositionConstants.PartCreatorContractName, CompositionConstants.PartCreatorTypeIdentity, - productImportDefinition.RequiredMetadata, productImportDefinition.Cardinality, productImportDefinition.IsRecomposable, CreationPolicy.Any, origin) - { - Assumes.NotNull(productImportDefinition); - this._productImportDefinition = productImportDefinition; - } - - public ContractBasedImportDefinition ProductImportDefinition { get { return this._productImportDefinition; } } - - public override bool IsConstraintSatisfiedBy(ExportDefinition exportDefinition) - { - if (!base.IsConstraintSatisfiedBy(exportDefinition)) - { - return false; - } - - return PartCreatorExportDefinition.IsProductConstraintSatisfiedBy(this._productImportDefinition, exportDefinition); - } - - public override Expression> Constraint - { - get - { - return ConstraintServices.CreatePartCreatorConstraint(base.Constraint, this._productImportDefinition); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorParameterImportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorParameterImportDefinition.cs deleted file mode 100644 index df498e2a057..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/PartCreatorParameterImportDefinition.cs +++ /dev/null @@ -1,48 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq.Expressions; -using System.Reflection; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class PartCreatorParameterImportDefinition : ReflectionParameterImportDefinition, IPartCreatorImportDefinition - { - private readonly ContractBasedImportDefinition _productImportDefinition; - - public PartCreatorParameterImportDefinition( - Lazy importingLazyParameter, - ICompositionElement origin, - ContractBasedImportDefinition productImportDefinition) - : base(importingLazyParameter, CompositionConstants.PartCreatorContractName, CompositionConstants.PartCreatorTypeIdentity, - productImportDefinition.RequiredMetadata, productImportDefinition.Cardinality, CreationPolicy.Any, origin) - { - Assumes.NotNull(productImportDefinition); - this._productImportDefinition = productImportDefinition; - } - - public ContractBasedImportDefinition ProductImportDefinition { get { return this._productImportDefinition; } } - - public override bool IsConstraintSatisfiedBy(ExportDefinition exportDefinition) - { - if (!base.IsConstraintSatisfiedBy(exportDefinition)) - { - return false; - } - return PartCreatorExportDefinition.IsProductConstraintSatisfiedBy(this._productImportDefinition, exportDefinition); - } - - public override Expression> Constraint - { - get - { - return ConstraintServices.CreatePartCreatorConstraint(base.Constraint, this._productImportDefinition); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs deleted file mode 100644 index 908b99baa41..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs +++ /dev/null @@ -1,565 +0,0 @@ - -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - // This - internal class ReflectionComposablePart : ComposablePart, ICompositionElement - { - private readonly ReflectionComposablePartDefinition _definition; - private readonly Dictionary _importValues = new Dictionary(); - private readonly Dictionary _importsCache = new Dictionary(); - private readonly Dictionary _exportsCache = new Dictionary(); - private bool _invokeImportsSatisfied = true; - private bool _invokingImportsSatisfied = false; - private bool _initialCompositionComplete = false; - private volatile object _cachedInstance; - private object _lock = new object(); - - public ReflectionComposablePart(ReflectionComposablePartDefinition definition) - { - Requires.NotNull(definition, "definition"); - - this._definition = definition; - } - - public ReflectionComposablePart(ReflectionComposablePartDefinition definition, object attributedPart) - { - Requires.NotNull(definition, "definition"); - Requires.NotNull(attributedPart, "attributedPart"); - - this._definition = definition; - - if (attributedPart is ValueType) - { - throw new ArgumentException(Strings.ArgumentValueType, "attributedPart"); - } - this._cachedInstance = attributedPart; - } - - protected virtual void EnsureRunning() - { - } - - protected virtual void ReleaseInstanceIfNecessary(object instance) - { - } - - protected object CachedInstance - { - get - { - lock (this._lock) - { - return this._cachedInstance; - } - } - } - - public ReflectionComposablePartDefinition Definition - { - get - { - this.EnsureRunning(); - return this._definition; - } - } - - public override IDictionary Metadata - { - get - { - this.EnsureRunning(); - return this.Definition.Metadata; - } - } - - public sealed override IEnumerable ImportDefinitions - { - get - { - this.EnsureRunning(); - return this.Definition.ImportDefinitions; - } - } - - public sealed override IEnumerable ExportDefinitions - { - get - { - this.EnsureRunning(); - return this.Definition.ExportDefinitions; - } - } - - - string ICompositionElement.DisplayName - { - get { return GetDisplayName(); } - } - - ICompositionElement ICompositionElement.Origin - { - get { return Definition; } - } - - // This is the ONLY method which is not executed under the ImportEngine composition lock. - // We need to protect all state that is accesses - public override object GetExportedValue(ExportDefinition definition) - { - // given the implementation of the ImportEngine, this iwll be called under a lock if the part is still being composed - // This is only called outside of the lock when the part is fully composed - // based on that we only protect: - // _exportsCache - and thus all calls to GetExportingMemberFromDefinition - // access to _importValues - // access to _initialCompositionComplete - // access to _instance - this.EnsureRunning(); - Requires.NotNull(definition, "definition"); - - ExportingMember member = null; - lock (this._lock) - { - member = GetExportingMemberFromDefinition(definition); - if (member == null) - { - throw ExceptionBuilder.CreateExportDefinitionNotOnThisComposablePart("definition"); - } - this.EnsureGettable(); - } - - return this.GetExportedValue(member); - } - - public override void SetImport(ImportDefinition definition, IEnumerable exports) - { - this.EnsureRunning(); - - Requires.NotNull(definition, "definition"); - Requires.NotNull(exports, "exports"); - - ImportingItem item = GetImportingItemFromDefinition(definition); - if (item == null) - { - throw ExceptionBuilder.CreateImportDefinitionNotOnThisComposablePart("definition"); - } - - EnsureSettable(definition); - - // Avoid walking over exports many times - Export[] exportsAsArray = exports.AsArray(); - EnsureCardinality(definition, exportsAsArray); - - SetImport(item, exportsAsArray); - } - - public override void Activate() - { - this.EnsureRunning(); - - this.SetNonPrerequisiteImports(); - - // Whenever we are composed/recomposed notify the instance - this.NotifyImportSatisfied(); - - lock (this._lock) - { - this._initialCompositionComplete = true; - } - } - - public override string ToString() - { - return this.GetDisplayName(); - } - - private object GetExportedValue(ExportingMember member) - { - object instance = null; - if (member.RequiresInstance) - { // Only activate the instance if we actually need to - - instance = this.GetInstanceActivatingIfNeeded(); - } - - return member.GetExportedValue(instance, this._lock); - } - - private void SetImport(ImportingItem item, Export[] exports) - { - object value = item.CastExportsToImportType(exports); - - lock (this._lock) - { - this._invokeImportsSatisfied = true; - this._importValues[item.Definition] = value; - } - } - - private object GetInstanceActivatingIfNeeded() - { - if (this._cachedInstance != null) - { - return this._cachedInstance; - } - else - { - ConstructorInfo constructor = null; - object[] arguments = null; - // determine whether activation is required, and collect necessary information for activation - // we need to do that under a lock - lock (this._lock) - { - if (!this.RequiresActivation()) - { - return null; - } - - constructor = this.Definition.GetConstructor(); - if (constructor == null) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_PartConstructorMissing, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_PartConstructorMissing, - this.Definition.GetPartType().FullName), - this.Definition.ToElement()); - } - arguments = this.GetConstructorArguments(); - } - - // create instance outside of the lock - object createdInstance = this.CreateInstance(constructor, arguments); - - // set the created instance - lock (this._lock) - { - if (this._cachedInstance == null) - { - this._cachedInstance = createdInstance; - createdInstance = null; - } - } - - // if the instance has been already set - if (createdInstance == null) - { - this.ReleaseInstanceIfNecessary(createdInstance); - } - } - - return this._cachedInstance; - } - - private object[] GetConstructorArguments() - { - ReflectionParameterImportDefinition[] parameterImports = this.ImportDefinitions.OfType().ToArray(); - object[] arguments = new object[parameterImports.Length]; - - this.UseImportedValues( - parameterImports, - (import, definition, value) => - { - if (definition.Cardinality == ImportCardinality.ZeroOrMore && !import.ImportType.IsAssignableCollectionType) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_ImportManyOnParameterCanOnlyBeAssigned, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_ImportManyOnParameterCanOnlyBeAssigned, - this.Definition.GetPartType().FullName, - definition.ImportingLazyParameter.Value.Name), - this.Definition.ToElement()); - } - - arguments[definition.ImportingLazyParameter.Value.Position] = value; - }, - true); - - return arguments; - } - - // alwayc called under a lock - private bool RequiresActivation() - { - // If we have any imports then we need activation - // (static imports are not supported) - if (this.ImportDefinitions.Any()) - { - return true; - } - - // If we have any instance exports, then we also - // need activation. - return this.ExportDefinitions.Any(definition => - { - ExportingMember member = GetExportingMemberFromDefinition(definition); - - return member.RequiresInstance; - }); - } - - // this is called under a lock - private void EnsureGettable() - { - // If we're already composed then we know that - // all pre-req imports have been satisfied - if (_initialCompositionComplete) - { - return; - } - - // Make sure all pre-req imports have been set - foreach (ImportDefinition definition in ImportDefinitions.Where(definition => definition.IsPrerequisite)) - { - if (!this._importValues.ContainsKey(definition)) - { - throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, - Strings.InvalidOperation_GetExportedValueBeforePrereqImportSet, - definition.ToElement().DisplayName)); - } - } - } - - private void EnsureSettable(ImportDefinition definition) - { - lock (this._lock) - { - if (this._initialCompositionComplete && !definition.IsRecomposable) - { - throw new InvalidOperationException(Strings.InvalidOperation_DefinitionCannotBeRecomposed); - } - } - } - - private static void EnsureCardinality(ImportDefinition definition, Export[] exports) - { - Requires.NullOrNotNullElements(exports, "exports"); - - ExportCardinalityCheckResult result = ExportServices.CheckCardinality(definition, exports); - - switch (result) - { - case ExportCardinalityCheckResult.NoExports: - throw new ArgumentException(Strings.Argument_ExportsEmpty, "exports"); - - case ExportCardinalityCheckResult.TooManyExports: - throw new ArgumentException(Strings.Argument_ExportsTooMany, "exports"); - - default: - Assumes.IsTrue(result == ExportCardinalityCheckResult.Match); - break; - } - } - - private object CreateInstance(ConstructorInfo constructor, object[] arguments) - { - Exception exception = null; - object instance = null; - - try - { - instance = constructor.SafeInvoke(arguments); - } - catch (TypeInitializationException ex) - { - exception = ex; - } - catch (TargetInvocationException ex) - { - exception = ex.InnerException; - } - - if (exception != null) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_PartConstructorThrewException, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_PartConstructorThrewException, - Definition.GetPartType().FullName), - Definition.ToElement(), - exception); - } - - return instance; - } - - private void SetNonPrerequisiteImports() - { - IEnumerable members = this.ImportDefinitions.Where(import => !import.IsPrerequisite); - - // NOTE: Dev10 484204 The validation is turned off for post imports because of it broke declarative composition - this.UseImportedValues(members, SetExportedValueForImport, false); - } - - private void SetExportedValueForImport(ImportingItem import, ImportDefinition definition, object value) - { - ImportingMember importMember = (ImportingMember)import; - - object instance = this.GetInstanceActivatingIfNeeded(); - - importMember.SetExportedValue(instance, value); - } - - private void UseImportedValues(IEnumerable definitions, Action useImportValue, bool errorIfMissing) - where TImportDefinition : ImportDefinition - { - var result = CompositionResult.SucceededResult; - - foreach (var definition in definitions) - { - ImportingItem import = GetImportingItemFromDefinition(definition); - - object value; - if (!TryGetImportValue(definition, out value)) - { - if (!errorIfMissing) - { - continue; - } - - if (definition.Cardinality == ImportCardinality.ExactlyOne) - { - var error = CompositionError.Create( - CompositionErrorId.ImportNotSetOnPart, - Strings.ImportNotSetOnPart, - this.Definition.GetPartType().FullName, - definition.ToString()); - result = result.MergeError(error); - continue; - } - else - { - value = import.CastExportsToImportType(new Export[0]); - } - } - - useImportValue(import, definition, value); - } - - result.ThrowOnErrors(); - } - - private bool TryGetImportValue(ImportDefinition definition, out object value) - { - lock (this._lock) - { - if (this._importValues.TryGetValue(definition, out value)) - { - this._importValues.Remove(definition); - return true; - } - } - - value = null; - return false; - } - - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] - private void NotifyImportSatisfied() - { - if (this._invokeImportsSatisfied && !this._invokingImportsSatisfied) - { - IPartImportsSatisfiedNotification notify = this.GetInstanceActivatingIfNeeded() as IPartImportsSatisfiedNotification; - if (notify != null) - { - try - { - // Reentrancy on composition notifications is allowed, so set this first to avoid - // an infinte loop of notifications. - this._invokingImportsSatisfied = true; - - notify.OnImportsSatisfied(); - } - catch (Exception exception) - { - throw new ComposablePartException( - CompositionErrorId.ReflectionModel_PartOnImportsSatisfiedThrewException, - String.Format(CultureInfo.CurrentCulture, - Strings.ReflectionModel_PartOnImportsSatisfiedThrewException, - Definition.GetPartType().FullName), - Definition.ToElement(), - exception); - } - finally - { - this._invokingImportsSatisfied = false; - } - - this._invokeImportsSatisfied = false; - } - } - } - - // this is always called under a lock - private ExportingMember GetExportingMemberFromDefinition(ExportDefinition definition) - { - ExportingMember result; - if (!_exportsCache.TryGetValue(definition, out result)) - { - result = GetExportingMember(definition); - if (result != null) - { - _exportsCache[definition] = result; - } - } - - return result; - } - - private ImportingItem GetImportingItemFromDefinition(ImportDefinition definition) - { - ImportingItem result; - if (!_importsCache.TryGetValue(definition, out result)) - { - result = GetImportingItem(definition); - if (result != null) - { - _importsCache[definition] = result; - } - } - - return result; - } - - private static ImportingItem GetImportingItem(ImportDefinition definition) - { - ReflectionImportDefinition reflectionDefinition = definition as ReflectionImportDefinition; - if (reflectionDefinition != null) - { - return reflectionDefinition.ToImportingItem(); - } - - // Don't recognize it - return null; - } - - private static ExportingMember GetExportingMember(ExportDefinition definition) - { - ReflectionMemberExportDefinition exportDefinition = definition as ReflectionMemberExportDefinition; - if (exportDefinition != null) - { - return exportDefinition.ToExportingMember(); - } - - // Don't recognize it - return null; - } - - private string GetDisplayName() - { - return this.Definition.GetPartType().GetDisplayName(); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs deleted file mode 100644 index 347fa2ed8fb..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs +++ /dev/null @@ -1,151 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Reflection; -using System.Threading; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class ReflectionComposablePartDefinition : ComposablePartDefinition, ICompositionElement - { - private readonly IReflectionPartCreationInfo _creationInfo; - - private volatile IEnumerable _imports; - private volatile IEnumerable _exports; - private volatile IDictionary _metadata; - private volatile ConstructorInfo _constructor; - private object _lock = new object(); - - public ReflectionComposablePartDefinition(IReflectionPartCreationInfo creationInfo) - { - Assumes.NotNull(creationInfo); - this._creationInfo = creationInfo; - } - - public Type GetPartType() - { - return this._creationInfo.GetPartType(); - } - - public Lazy GetLazyPartType() - { - return this._creationInfo.GetLazyPartType(); - } - - public ConstructorInfo GetConstructor() - { - if (this._constructor == null) - { - ConstructorInfo constructor = this._creationInfo.GetConstructor(); - lock (this._lock) - { - if (this._constructor == null) - { - this._constructor = constructor; - } - } - } - - return this._constructor; - } - - public override IEnumerable ExportDefinitions - { - get - { - if (this._exports == null) - { - ExportDefinition[] exports = this._creationInfo.GetExports().ToArray(); - lock (this._lock) - { - if (this._exports == null) - { - this._exports = exports; - } - } - } - return this._exports; - } - } - - public override IEnumerable ImportDefinitions - { - get - { - if (this._imports == null) - { - ImportDefinition[] imports = this._creationInfo.GetImports().ToArray(); - lock (this._lock) - { - if (this._imports == null) - { - this._imports = imports; - } - } - } - return this._imports; - } - } - - public override IDictionary Metadata - { - get - { - if (this._metadata == null) - { - IDictionary metadata = this._creationInfo.GetMetadata().AsReadOnly(); - lock (this._lock) - { - if (this._metadata == null) - { - this._metadata = metadata; - } - } - } - return this._metadata; - } - } - - internal bool IsDisposalRequired - { - get - { - return this._creationInfo.IsDisposalRequired; - } - } - - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] - public override ComposablePart CreatePart() - { - if (this.IsDisposalRequired) - { - return new DisposableReflectionComposablePart(this); - } - else - { - return new ReflectionComposablePart(this); - } - } - - string ICompositionElement.DisplayName - { - get { return this._creationInfo.DisplayName; } - } - - ICompositionElement ICompositionElement.Origin - { - get { return this._creationInfo.Origin; } - } - - public override string ToString() - { - return this._creationInfo.DisplayName; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionExtensions.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionExtensions.cs deleted file mode 100644 index 47a3b97dedb..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionExtensions.cs +++ /dev/null @@ -1,134 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Reflection; -using Microsoft.Internal; -using System.Threading; -using System.Collections.Generic; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal static class ReflectionExtensions - { - public static ReflectionMember ToReflectionMember(this LazyMemberInfo lazyMember) - { - MemberInfo[] accessors = lazyMember.GetAccessors(); - MemberTypes memberType = lazyMember.MemberType; - - switch (memberType) - { - case MemberTypes.Field: - Assumes.IsTrue(accessors.Length == 1); - return ((FieldInfo)accessors[0]).ToReflectionField(); - - case MemberTypes.Property: - Assumes.IsTrue(accessors.Length == 2); - return ReflectionExtensions.CreateReflectionProperty((MethodInfo)accessors[0], (MethodInfo)accessors[1]); - - case MemberTypes.NestedType: - case MemberTypes.TypeInfo: - return ((Type)accessors[0]).ToReflectionType(); - - default: - Assumes.IsTrue(memberType == MemberTypes.Method); - return ((MethodInfo)accessors[0]).ToReflectionMethod(); - } - } - - public static LazyMemberInfo ToLazyMember(this ReflectionMember reflectionMember) - { - Assumes.NotNull(reflectionMember); - - if (reflectionMember.ItemType == ReflectionItemType.Property) - { - ReflectionProperty reflectionProperty = reflectionMember as ReflectionProperty; - Assumes.NotNull(reflectionProperty); - - MemberInfo[] accessors = new MemberInfo[] { reflectionProperty.UnderlyingGetMethod, reflectionProperty.UnderlyingSetMethod }; - return new LazyMemberInfo(MemberTypes.Property, accessors); - } - else - { - return new LazyMemberInfo(reflectionMember.UnderlyingMember.MemberType, reflectionMember.UnderlyingMember); - } - } - - public static LazyMemberInfo ToLazyMember(this MemberInfo member) - { - Assumes.NotNull(member); - - if (member.MemberType == MemberTypes.Property) - { - PropertyInfo property = member as PropertyInfo; - Assumes.NotNull(property); - - MemberInfo[] accessors = new MemberInfo[] { property.GetGetMethod(true), property.GetSetMethod(true)}; - return new LazyMemberInfo(MemberTypes.Property, accessors); - } - else - { - return new LazyMemberInfo(member); - } - } - - public static ReflectionWritableMember ToReflectionWriteableMember(this LazyMemberInfo lazyMember) - { - Assumes.IsTrue((lazyMember.MemberType == MemberTypes.Field) || (lazyMember.MemberType == MemberTypes.Property)); - - ReflectionWritableMember reflectionMember = lazyMember.ToReflectionMember() as ReflectionWritableMember; - Assumes.NotNull(reflectionMember); - - return reflectionMember; - } - - - public static ReflectionProperty ToReflectionProperty(this PropertyInfo property) - { - Assumes.NotNull(property); - return CreateReflectionProperty(property.GetGetMethod(true), property.GetSetMethod(true)); - } - - public static ReflectionProperty CreateReflectionProperty(MethodInfo getMethod, MethodInfo setMethod) - { - Assumes.IsTrue(getMethod != null || setMethod != null); - - return new ReflectionProperty(getMethod, setMethod); - } - - public static ReflectionParameter ToReflectionParameter(this ParameterInfo parameter) - { - Assumes.NotNull(parameter); - return new ReflectionParameter(parameter); - } - - public static ReflectionMethod ToReflectionMethod(this MethodInfo method) - { - Assumes.NotNull(method); - return new ReflectionMethod(method); - } - - public static ReflectionField ToReflectionField(this FieldInfo field) - { - Assumes.NotNull(field); - return new ReflectionField(field); - } - - public static ReflectionType ToReflectionType(this Type type) - { - Assumes.NotNull(type); - return new ReflectionType(type); - } - - public static ReflectionWritableMember ToReflectionWritableMember(this MemberInfo member) - { - Assumes.NotNull(member); - if (member.MemberType == MemberTypes.Property) - { - return ((PropertyInfo)member).ToReflectionProperty(); - } - - return ((FieldInfo)member).ToReflectionField(); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionField.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionField.cs deleted file mode 100644 index 38879361ce2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionField.cs +++ /dev/null @@ -1,67 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Reflection; -using Microsoft.Internal; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class ReflectionField : ReflectionWritableMember - { - private readonly FieldInfo _field; - - public ReflectionField(FieldInfo field) - { - Assumes.NotNull(field); - - this._field = field; - } - - public FieldInfo UndelyingField - { - get { return this._field; } - } - - public override MemberInfo UnderlyingMember - { - get { return this.UndelyingField; } - } - - public override bool CanRead - { - get { return true; } - } - - public override bool CanWrite - { - get { return !this.UndelyingField.IsInitOnly; } - } - - public override bool RequiresInstance - { - get { return !this.UndelyingField.IsStatic; } - } - - public override Type ReturnType - { - get { return this.UndelyingField.FieldType; } - } - - public override ReflectionItemType ItemType - { - get { return ReflectionItemType.Field; } - } - - public override object GetValue(object instance) - { - return this.UndelyingField.SafeGetValue(instance); - } - - public override void SetValue(object instance, object value) - { - this.UndelyingField.SafeSetValue(instance, value); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionImportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionImportDefinition.cs deleted file mode 100644 index 95f61bcecba..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionImportDefinition.cs +++ /dev/null @@ -1,52 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using System.Globalization; -using System.Reflection; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal abstract class ReflectionImportDefinition : ContractBasedImportDefinition, ICompositionElement - { - private readonly ICompositionElement _origin; - - public ReflectionImportDefinition( - string contractName, - string requiredTypeIdentity, - IEnumerable> requiredMetadata, - ImportCardinality cardinality, - bool isRecomposable, - bool isPrerequisite, - CreationPolicy requiredCreationPolicy, - ICompositionElement origin) - : base(contractName, requiredTypeIdentity, requiredMetadata, cardinality, isRecomposable, isPrerequisite, requiredCreationPolicy) - { - this._origin = origin; - } - - string ICompositionElement.DisplayName - { - get { return this.GetDisplayName(); } - } - - ICompositionElement ICompositionElement.Origin - { - get { return this._origin; } - } - - public override string ToString() - { - return this.GetDisplayName(); - } - - public abstract ImportingItem ToImportingItem(); - - protected abstract string GetDisplayName(); - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionItem.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionItem.cs deleted file mode 100644 index 97420f14bc6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionItem.cs +++ /dev/null @@ -1,16 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Reflection; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal abstract class ReflectionItem - { - public abstract string Name { get; } - public abstract string GetDisplayName(); - public abstract Type ReturnType { get; } - public abstract ReflectionItemType ItemType { get; } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionItemType.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionItemType.cs deleted file mode 100644 index 2607fecaad8..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionItemType.cs +++ /dev/null @@ -1,16 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal enum ReflectionItemType : int - { - Parameter = 0, - Field = 1, - Property = 2, - Method = 3, - Type = 4, - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMember.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMember.cs deleted file mode 100644 index 9ccbc4d55e9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMember.cs +++ /dev/null @@ -1,42 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Reflection; -using Microsoft.Internal; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal abstract class ReflectionMember : ReflectionItem - { - public abstract bool CanRead - { - get; - } - - public Type DeclaringType - { - get { return this.UnderlyingMember.DeclaringType; } - } - - public override string Name - { - get { return this.UnderlyingMember.Name; } - } - - public override string GetDisplayName() - { - return this.UnderlyingMember.GetDisplayName(); - } - - public abstract bool RequiresInstance - { - get; - } - - public abstract MemberInfo UnderlyingMember { get; } - - public abstract object GetValue(object instance); - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberExportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberExportDefinition.cs deleted file mode 100644 index ac81434fbb6..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberExportDefinition.cs +++ /dev/null @@ -1,89 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.ComponentModel.Composition.ReflectionModel; -using System.Globalization; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class ReflectionMemberExportDefinition : ExportDefinition, ICompositionElement - { - private readonly LazyMemberInfo _member; - private readonly ExportDefinition _exportDefinition; - private readonly ICompositionElement _origin; - private IDictionary _metadata; - - public ReflectionMemberExportDefinition(LazyMemberInfo member, ExportDefinition exportDefinition, ICompositionElement origin) - { - Assumes.NotNull(exportDefinition); - - this._member = member; - this._exportDefinition = exportDefinition; - this._origin = origin; - } - - public override string ContractName - { - get { return this._exportDefinition.ContractName; } - } - - public LazyMemberInfo ExportingLazyMember - { - get { return this._member; } - } - - public override IDictionary Metadata - { - get - { - if (this._metadata == null) - { - var metadata = this._exportDefinition.Metadata ?? MetadataServices.EmptyMetadata; - this._metadata = metadata.AsReadOnly(); - } - return this._metadata; - } - } - - string ICompositionElement.DisplayName - { - get { return this.GetDisplayName(); } - } - - ICompositionElement ICompositionElement.Origin - { - get { return this._origin; } - } - - public override string ToString() - { - return this.GetDisplayName(); - } - - public ExportingMember ToExportingMember() - { - return new ExportingMember(this, this.ToReflectionMember()); - } - - private ReflectionMember ToReflectionMember() - { - return this.ExportingLazyMember.ToReflectionMember(); - } - - private string GetDisplayName() - { - return string.Format(CultureInfo.CurrentCulture, - "{0} (ContractName=\"{1}\")", // NOLOC - this.ToReflectionMember().GetDisplayName(), - this.ContractName); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberImportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberImportDefinition.cs deleted file mode 100644 index af179fb86ef..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberImportDefinition.cs +++ /dev/null @@ -1,56 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel.Composition.ReflectionModel; -using System.Globalization; -using System.Reflection; -using Microsoft.Internal; -using Microsoft.Internal.Collections; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class ReflectionMemberImportDefinition : ReflectionImportDefinition - { - private LazyMemberInfo _importingLazyMember; - - public ReflectionMemberImportDefinition( - LazyMemberInfo importingLazyMember, - string contractName, - string requiredTypeIdentity, - IEnumerable> requiredMetadata, - ImportCardinality cardinality, - bool isRecomposable, - CreationPolicy requiredCreationPolicy, - ICompositionElement origin) - : base(contractName, requiredTypeIdentity, requiredMetadata, cardinality, isRecomposable, false, requiredCreationPolicy, origin) - { - Assumes.NotNull(contractName); - - this._importingLazyMember = importingLazyMember; - } - - public override ImportingItem ToImportingItem() - { - ReflectionWritableMember member = this.ImportingLazyMember.ToReflectionWriteableMember(); - return new ImportingMember(this, member, new ImportType(member.ReturnType, this.Cardinality)); - } - - public LazyMemberInfo ImportingLazyMember - { - get { return this._importingLazyMember; } - } - - protected override string GetDisplayName() - { - return string.Format( - CultureInfo.CurrentCulture, - "{0} (ContractName=\"{1}\")", // NOLOC - this.ImportingLazyMember.ToReflectionMember().GetDisplayName(), - this.ContractName); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMethod.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMethod.cs deleted file mode 100644 index 9dd963ddb09..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionMethod.cs +++ /dev/null @@ -1,70 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.Reflection; -using Microsoft.Internal; -using System.Threading; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal partial class ReflectionMethod : ReflectionMember - { - private readonly MethodInfo _method; - - public ReflectionMethod(MethodInfo method) - { - Assumes.NotNull(method); - - this._method = method; - } - - public MethodInfo UnderlyingMethod - { - get { return this._method; } - } - - public override MemberInfo UnderlyingMember - { - get { return this.UnderlyingMethod; } - } - - public override bool CanRead - { - get { return true; } - } - - public override bool RequiresInstance - { - get { return !this.UnderlyingMethod.IsStatic; } - } - - public override Type ReturnType - { - get { return this.UnderlyingMethod.ReturnType; } - } - - public override ReflectionItemType ItemType - { - get { return ReflectionItemType.Method; } - } - - public override object GetValue(object instance) - { - return SafeCreateExportedDelegate(instance, _method); - } -#if !SILVERLIGHT - [System.Security.SecuritySafeCritical] -#endif - private static ExportedDelegate SafeCreateExportedDelegate(object instance, MethodInfo method) - { - // We demand member access in place of the [SecurityCritical] - // attribute on ExportDelegate constructor - ReflectionInvoke.DemandMemberAccessIfNeeded(method); - - return new ExportedDelegate(instance, method); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs deleted file mode 100644 index 72cd0f817f3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs +++ /dev/null @@ -1,444 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using System.Reflection; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.ReflectionModel -{ -#if !SILVERLIGHT - [System.Security.SecurityCritical] -#endif - public static class ReflectionModelServices - { - public static Lazy GetPartType(ComposablePartDefinition partDefinition) - { - Requires.NotNull(partDefinition, "partDefinition"); - - ReflectionComposablePartDefinition reflectionPartDefinition = partDefinition as ReflectionComposablePartDefinition; - if (reflectionPartDefinition == null) - { - throw new ArgumentException( - string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidPartDefinition, partDefinition.GetType()), - "partDefinition"); - } - - return reflectionPartDefinition.GetLazyPartType(); - } - - public static bool IsDisposalRequired(ComposablePartDefinition partDefinition) - { - Requires.NotNull(partDefinition, "partDefinition"); - - ReflectionComposablePartDefinition reflectionPartDefinition = partDefinition as ReflectionComposablePartDefinition; - if (reflectionPartDefinition == null) - { - throw new ArgumentException( - string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidPartDefinition, partDefinition.GetType()), - "partDefinition"); - } - - return reflectionPartDefinition.IsDisposalRequired; - } - - public static LazyMemberInfo GetExportingMember(ExportDefinition exportDefinition) - { - Requires.NotNull(exportDefinition, "exportDefinition"); - - ReflectionMemberExportDefinition reflectionExportDefinition = exportDefinition as ReflectionMemberExportDefinition; - if (reflectionExportDefinition == null) - { - throw new ArgumentException( - string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidExportDefinition, exportDefinition.GetType()), - "exportDefinition"); - } - - return reflectionExportDefinition.ExportingLazyMember; - } - - public static LazyMemberInfo GetImportingMember(ImportDefinition importDefinition) - { - Requires.NotNull(importDefinition, "importDefinition"); - - ReflectionMemberImportDefinition reflectionMemberImportDefinition = importDefinition as ReflectionMemberImportDefinition; - if (reflectionMemberImportDefinition == null) - { - throw new ArgumentException( - string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidMemberImportDefinition, importDefinition.GetType()), - "importDefinition"); - } - - return reflectionMemberImportDefinition.ImportingLazyMember; - } - - public static Lazy GetImportingParameter(ImportDefinition importDefinition) - { - Requires.NotNull(importDefinition, "importDefinition"); - - ReflectionParameterImportDefinition reflectionParameterImportDefinition = importDefinition as ReflectionParameterImportDefinition; - if (reflectionParameterImportDefinition == null) - { - throw new ArgumentException( - string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidParameterImportDefinition, importDefinition.GetType()), - "importDefinition"); - } - - return reflectionParameterImportDefinition.ImportingLazyParameter; - } - - public static bool IsImportingParameter(ImportDefinition importDefinition) - { - Requires.NotNull(importDefinition, "importDefinition"); - - ReflectionImportDefinition reflectionImportDefinition = importDefinition as ReflectionImportDefinition; - if (reflectionImportDefinition == null) - { - throw new ArgumentException( - string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidImportDefinition, importDefinition.GetType()), - "importDefinition"); - } - - return (importDefinition is ReflectionParameterImportDefinition); - } - - internal static bool IsExportFactoryImportDefinition(ImportDefinition importDefinition) - { - Requires.NotNull(importDefinition, "importDefinition"); - - ReflectionImportDefinition reflectionImportDefinition = importDefinition as ReflectionImportDefinition; - if (reflectionImportDefinition == null) - { - throw new ArgumentException( - string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidImportDefinition, importDefinition.GetType()), - "importDefinition"); - } - - return (importDefinition is IPartCreatorImportDefinition); - } - - internal static ContractBasedImportDefinition GetPartCreatorProductImportDefinition(ImportDefinition importDefinition) - { - Requires.NotNull(importDefinition, "importDefinition"); - - IPartCreatorImportDefinition partCreatorImportDefinition = importDefinition as IPartCreatorImportDefinition; - if (partCreatorImportDefinition == null) - { - throw new ArgumentException( - string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidImportDefinition, importDefinition.GetType()), - "importDefinition"); - } - - return partCreatorImportDefinition.ProductImportDefinition; - } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public static ComposablePartDefinition CreatePartDefinition( - Lazy partType, - bool isDisposalRequired, - Lazy> imports, - Lazy> exports, - Lazy> metadata, - ICompositionElement origin) - { - Requires.NotNull(partType, "partType"); - - return new ReflectionComposablePartDefinition( - new ReflectionPartCreationInfo( - partType, - isDisposalRequired, - imports, - exports, - metadata, - origin)); - } - - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public static ExportDefinition CreateExportDefinition( - LazyMemberInfo exportingMember, - string contractName, - Lazy> metadata, - ICompositionElement origin) - { - Requires.NotNullOrEmpty(contractName, "contractName"); - Requires.IsInMembertypeSet(exportingMember.MemberType, "exportingMember", MemberTypes.Field | MemberTypes.Property | MemberTypes.NestedType | MemberTypes.TypeInfo | MemberTypes.Method); - - return new ReflectionMemberExportDefinition( - exportingMember, - new LazyExportDefinition(contractName, metadata), - origin); - } - - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public static ContractBasedImportDefinition CreateImportDefinition( - LazyMemberInfo importingMember, - string contractName, - string requiredTypeIdentity, - IEnumerable> requiredMetadata, - ImportCardinality cardinality, - bool isRecomposable, - CreationPolicy requiredCreationPolicy, - ICompositionElement origin) - { - return CreateImportDefinition(importingMember, contractName, requiredTypeIdentity, requiredMetadata, cardinality, isRecomposable, requiredCreationPolicy, false, origin); - } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - internal static ContractBasedImportDefinition CreateImportDefinition( - LazyMemberInfo importingMember, - string contractName, - string requiredTypeIdentity, - IEnumerable> requiredMetadata, - ImportCardinality cardinality, - bool isRecomposable, - CreationPolicy requiredCreationPolicy, - bool isExportFactory, - ICompositionElement origin) - { - Requires.NotNullOrEmpty(contractName, "contractName"); - Requires.IsInMembertypeSet(importingMember.MemberType, "importingMember", MemberTypes.Property | MemberTypes.Field); - - if (isExportFactory) - { - return new PartCreatorMemberImportDefinition( - importingMember, - origin, - new ContractBasedImportDefinition( - contractName, - requiredTypeIdentity, - requiredMetadata, - cardinality, - isRecomposable, - false, - CreationPolicy.NonShared)); - } - else - { - return new ReflectionMemberImportDefinition( - importingMember, - contractName, - requiredTypeIdentity, - requiredMetadata, - cardinality, - isRecomposable, - requiredCreationPolicy, - origin); - } - } - - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - public static ContractBasedImportDefinition CreateImportDefinition( - Lazy parameter, - string contractName, - string requiredTypeIdentity, - IEnumerable> requiredMetadata, - ImportCardinality cardinality, - CreationPolicy requiredCreationPolicy, - ICompositionElement origin) - { - return CreateImportDefinition(parameter, contractName, requiredTypeIdentity, requiredMetadata, cardinality, requiredCreationPolicy, false, origin); - } - - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] - internal static ContractBasedImportDefinition CreateImportDefinition( - Lazy parameter, - string contractName, - string requiredTypeIdentity, - IEnumerable> requiredMetadata, - ImportCardinality cardinality, - CreationPolicy requiredCreationPolicy, - bool isExportFactory, - ICompositionElement origin) - { - Requires.NotNull(parameter, "parameter"); - Requires.NotNullOrEmpty(contractName, "contractName"); - - if (isExportFactory) - { - return new PartCreatorParameterImportDefinition( - parameter, - origin, - new ContractBasedImportDefinition( - contractName, - requiredTypeIdentity, - requiredMetadata, - cardinality, - false, - true, - CreationPolicy.NonShared)); - } - else - { - return new ReflectionParameterImportDefinition( - parameter, - contractName, - requiredTypeIdentity, - requiredMetadata, - cardinality, - requiredCreationPolicy, - origin); - } - } - } - internal class ReflectionPartCreationInfo : IReflectionPartCreationInfo - { - private readonly Lazy _partType; - private readonly Lazy> _imports; - private readonly Lazy> _exports; - private readonly Lazy> _metadata; - private readonly ICompositionElement _origin; - private ConstructorInfo _constructor; - private bool _isDisposalRequired; - - public ReflectionPartCreationInfo( - Lazy partType, - bool isDisposalRequired, - Lazy> imports, - Lazy> exports, - Lazy> metadata, - ICompositionElement origin) - { - Assumes.NotNull(partType); - - this._partType = partType; - this._isDisposalRequired = isDisposalRequired; - this._imports = imports; - this._exports = exports; - this._metadata = metadata; - this._origin = origin; - } - - public Type GetPartType() - { - return this._partType.GetNotNullValue("type"); - } - - public Lazy GetLazyPartType() - { - return this._partType; - } - - public ConstructorInfo GetConstructor() - { - if (this._constructor == null) - { - ConstructorInfo[] constructors = null; - constructors = this.GetImports() - .OfType() - .Select(parameterImport => parameterImport.ImportingLazyParameter.Value.Member) - .OfType() - .Distinct() - .ToArray(); - - if (constructors.Length == 1) - { - this._constructor = constructors[0]; - } - else if (constructors.Length == 0) - { - this._constructor = this.GetPartType().GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, Type.EmptyTypes, null); - } - } - return this._constructor; - } - - public bool IsDisposalRequired - { - get - { - return this._isDisposalRequired; - } - } - - public IDictionary GetMetadata() - { - return (this._metadata != null) ? this._metadata.Value : null; - } - - public IEnumerable GetExports() - { - if (this._exports == null) - { - yield break; - } - - IEnumerable exports = this._exports.Value; - - if (exports == null) - { - yield break; - } - - foreach (ExportDefinition export in exports) - { - ReflectionMemberExportDefinition reflectionExport = export as ReflectionMemberExportDefinition; - if (reflectionExport == null) - { - throw new InvalidOperationException( - string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidExportDefinition, export.GetType())); - } - yield return reflectionExport; - } - } - - public IEnumerable GetImports() - { - if (this._imports == null) - { - yield break; - } - - IEnumerable imports = this._imports.Value; - - if (imports == null) - { - yield break; - } - - foreach (ImportDefinition import in imports) - { - ReflectionImportDefinition reflectionImport = import as ReflectionImportDefinition; - if (reflectionImport == null) - { - throw new InvalidOperationException( - string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidMemberImportDefinition, import.GetType())); - } - yield return reflectionImport; - } - } - - public string DisplayName - { - get { return this.GetPartType().GetDisplayName(); } - } - - public ICompositionElement Origin - { - get { return this._origin; } - } - } - - internal class LazyExportDefinition : ExportDefinition - { - private readonly Lazy> _metadata; - - public LazyExportDefinition(string contractName, Lazy> metadata) - : base(contractName, (IDictionary)null) - { - this._metadata = metadata; - } - - public override IDictionary Metadata - { - get - { - return this._metadata.Value; - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionParameter.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionParameter.cs deleted file mode 100644 index 75312471560..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionParameter.cs +++ /dev/null @@ -1,52 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Globalization; -using System.Reflection; -using Microsoft.Internal; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class ReflectionParameter : ReflectionItem - { - private readonly ParameterInfo _parameter; - - public ReflectionParameter(ParameterInfo parameter) - { - Assumes.NotNull(parameter); - - this._parameter = parameter; - } - - public ParameterInfo UnderlyingParameter - { - get { return this._parameter; } - } - - public override string Name - { - get { return this.UnderlyingParameter.Name; } - } - - public override string GetDisplayName() - { - return string.Format( - CultureInfo.CurrentCulture, - "{0} (Parameter=\"{1}\")", // NOLOC - this.UnderlyingParameter.Member.GetDisplayName(), - this.UnderlyingParameter.Name); - } - - public override Type ReturnType - { - get { return this.UnderlyingParameter.ParameterType; } - } - - public override ReflectionItemType ItemType - { - get { return ReflectionItemType.Parameter; } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionParameterImportDefinition.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionParameterImportDefinition.cs deleted file mode 100644 index 93e62387413..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionParameterImportDefinition.cs +++ /dev/null @@ -1,55 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Globalization; -using System.Reflection; -using Microsoft.Internal; -using System.ComponentModel.Composition.ReflectionModel; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class ReflectionParameterImportDefinition : ReflectionImportDefinition - { - private Lazy _importingLazyParameter; - - public ReflectionParameterImportDefinition( - Lazy importingLazyParameter, - string contractName, - string requiredTypeIdentity, - IEnumerable> requiredMetadata, - ImportCardinality cardinality, - CreationPolicy requiredCreationPolicy, - ICompositionElement origin) - : base(contractName, requiredTypeIdentity, requiredMetadata, cardinality, false, true, requiredCreationPolicy, origin) - { - Assumes.NotNull(importingLazyParameter); - - this._importingLazyParameter = importingLazyParameter; - } - - public override ImportingItem ToImportingItem() - { - return new ImportingParameter(this, new ImportType(this.ImportingLazyParameter.GetNotNullValue("parameter").ParameterType, this.Cardinality)); - } - - public Lazy ImportingLazyParameter - { - get { return this._importingLazyParameter; } - } - - protected override string GetDisplayName() - { - ParameterInfo parameter = this.ImportingLazyParameter.GetNotNullValue("parameter"); - return string.Format( - CultureInfo.CurrentCulture, - "{0} (Parameter=\"{1}\", ContractName=\"{2}\")", // NOLOC - parameter.Member.GetDisplayName(), - parameter.Name, - this.ContractName); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionProperty.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionProperty.cs deleted file mode 100644 index af62622fa9e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionProperty.cs +++ /dev/null @@ -1,124 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Reflection; -using Microsoft.Internal; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - // Instead of representing properties as an actual PropertyInfo, we need to - // represent them as two MethodInfo objects one for each accessor. This is so - // that cached attribute part can go from a metadata token -> XXXInfo without - // needing to walk all members of a particular type. Unfortunately, (probably - // because you never see one of them in an IL stream), Reflection does not allow - // you to go from a metadata token -> PropertyInfo like it does with types, - // fields, and methods. - - internal class ReflectionProperty : ReflectionWritableMember - { - private readonly MethodInfo _getMethod; - private readonly MethodInfo _setMethod; - - public ReflectionProperty(MethodInfo getMethod, MethodInfo setMethod) - { - Assumes.IsTrue(getMethod != null || setMethod != null); - - this._getMethod = getMethod; - this._setMethod = setMethod; - } - - public override MemberInfo UnderlyingMember - { - get { return this.UnderlyingGetMethod ?? this.UnderlyingSetMethod; } - } - - public override bool CanRead - { - get { return this.UnderlyingGetMethod != null; } - } - - public override bool CanWrite - { - get { return this.UnderlyingSetMethod != null; } - } - - public MethodInfo UnderlyingGetMethod - { - get { return this._getMethod; } - } - - public MethodInfo UnderlyingSetMethod - { - get { return this._setMethod; } - } - - public override string Name - { - get - { - MethodInfo method = this.UnderlyingGetMethod ?? this.UnderlyingSetMethod; - - string name = method.Name; - - Assumes.IsTrue(name.Length > 4); - - // Remove 'get_' or 'set_' - return name.Substring(4); - } - } - - public override string GetDisplayName() - { - return ReflectionServices.GetDisplayName(this.DeclaringType, this.Name); - } - - public override bool RequiresInstance - { - get - { - MethodInfo method = this.UnderlyingGetMethod ?? this.UnderlyingSetMethod; - - return !method.IsStatic; - } - } - - public override Type ReturnType - { - get - { - if (this.UnderlyingGetMethod != null) - { - return this.UnderlyingGetMethod.ReturnType; - } - - ParameterInfo[] parameters = this.UnderlyingSetMethod.GetParameters(); - - Assumes.IsTrue(parameters.Length > 0); - - return parameters[parameters.Length - 1].ParameterType; - } - } - - public override ReflectionItemType ItemType - { - get { return ReflectionItemType.Property; } - } - - public override object GetValue(object instance) - { - Assumes.NotNull(this._getMethod); - - return this.UnderlyingGetMethod.SafeInvoke(instance); - } - - public override void SetValue(object instance, object value) - { - Assumes.NotNull(this._setMethod); - - this.UnderlyingSetMethod.SafeInvoke(instance, value); - } - - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionType.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionType.cs deleted file mode 100644 index 6d754d516a0..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionType.cs +++ /dev/null @@ -1,58 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.AttributedModel; -using System.Reflection; -using Microsoft.Internal; -using System.Threading; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal class ReflectionType : ReflectionMember - { - private Type _type; - - public ReflectionType(Type type) - { - Assumes.NotNull(type); - - this._type = type; - } - - public override MemberInfo UnderlyingMember - { - get { return this._type; } - } - - public Type UnderlyingType - { - get { return this._type; } - } - - public override bool CanRead - { - get { return true; } - } - - public override bool RequiresInstance - { - get { return true; } - } - - public override Type ReturnType - { - get { return this._type; } - } - - public override ReflectionItemType ItemType - { - get { return ReflectionItemType.Type; } - } - - public override object GetValue(object instance) - { - return instance; - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionWritableMember.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionWritableMember.cs deleted file mode 100644 index 7640b3b1749..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/ReflectionModel/ReflectionWritableMember.cs +++ /dev/null @@ -1,19 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Reflection; -using Microsoft.Internal; - -namespace System.ComponentModel.Composition.ReflectionModel -{ - internal abstract class ReflectionWritableMember : ReflectionMember - { - public abstract bool CanWrite - { - get; - } - - public abstract void SetValue(object instance, object value); - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/Lazy.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/Lazy.cs deleted file mode 100644 index 6d3b11acfb3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/Lazy.cs +++ /dev/null @@ -1,80 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !CLR40 -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using Microsoft.Internal; - -namespace System -{ - public class Lazy - { - private T _value = default(T); - private volatile bool _isValueCreated = false; - private Func _valueFactory = null; - private object _lock; - - public Lazy() - : this(() => Activator.CreateInstance()) - { - } - - public Lazy(bool isThreadSafe) - : this(() => Activator.CreateInstance(), isThreadSafe) - { - } - - public Lazy(Func valueFactory): - this(valueFactory, true) - { - } - - public Lazy(Func valueFactory, bool isThreadSafe) - { - Requires.NotNull(valueFactory, "valueFactory"); - if(isThreadSafe) - { - this._lock = new object(); - } - - this._valueFactory = valueFactory; - } - - - public T Value - { - get - { - if (!this._isValueCreated) - { - if(this._lock != null) - { - Monitor.Enter(this._lock); - } - - try - { - T value = this._valueFactory.Invoke(); - this._valueFactory = null; - Thread.MemoryBarrier(); - this._value = value; - this._isValueCreated = true; - } - finally - { - if(this._lock != null) - { - Monitor.Exit(this._lock); - } - } - } - return this._value; - } - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/LazyOfTTMetadata.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/LazyOfTTMetadata.cs deleted file mode 100644 index 287babe3abd..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/LazyOfTTMetadata.cs +++ /dev/null @@ -1,51 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace System -{ -#if CLR40 && !SILVERLIGHT - [Serializable] -#endif - public class Lazy : Lazy - { - private TMetadata _metadata; - - public Lazy(Func valueFactory, TMetadata metadata) : - base(valueFactory) - { - this._metadata = metadata; - } - - public Lazy(TMetadata metadata) : - base() - { - this._metadata = metadata; - } - - - public Lazy(TMetadata metadata, bool isThreadSafe) : - base(isThreadSafe) - { - this._metadata = metadata; - } - - public Lazy(Func valueFactory, TMetadata metadata, bool isThreadSafe) : - base(valueFactory, isThreadSafe) - { - this._metadata = metadata; - } - - public TMetadata Metadata - { - get - { - return this._metadata; - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/Tuple.cs b/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/Tuple.cs deleted file mode 100644 index 03a48286d3c..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/Tuple.cs +++ /dev/null @@ -1,52 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if !CLR40 -using System; - -namespace System -{ - // This is a very minimalistic implementation of Tuple'2 that allows us - // to compile and work on versions of .Net eariler then 4.0. - public struct Tuple - { - public Tuple(TItem1 item1, TItem2 item2) - { - this = new Tuple(); - this.Item1 = item1; - this.Item2 = item2; - } - - public TItem1 Item1 { get; private set; } - public TItem2 Item2 { get; private set; } - - public override bool Equals(object obj) - { - if (obj is Tuple) - { - Tuple that = (Tuple)obj; - return object.Equals(this.Item1, that.Item1) && object.Equals(this.Item2, that.Item2); - } - else - { - return false; - } - } - - public override int GetHashCode() - { - return ((this.Item1 != null) ? this.Item1.GetHashCode() : 0) ^ ((this.Item2 != null) ? this.Item2.GetHashCode() : 0); - } - - public static bool operator ==(Tuple left, Tuple right) - { - return left.Equals(right); - } - - public static bool operator !=(Tuple left, Tuple right) - { - return !left.Equals(right); - } - } -} -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/.gitattributes deleted file mode 100644 index 76da6c303b5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -/AssemblyInfo.cs -crlf -/Strings.Designer.cs -crlf -/Strings.resx -crlf -/SuppressMessages.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/AssemblyInfo.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/AssemblyInfo.cs deleted file mode 100644 index 50e0aec6670..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ -[assembly: System.CLSCompliant(true)] -[assembly: System.Reflection.AssemblyTitle("System.ComponentModel.Composition.Initialization")] -[assembly: System.Reflection.AssemblyCopyright("(c) Microsoft Corporation. All rights reserved.")] -[assembly: System.Reflection.AssemblyVersion("2010.02.11")] diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Composition.Initialization.csproj b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Composition.Initialization.csproj deleted file mode 100644 index c9e17ab9b17..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Composition.Initialization.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Migrated rules for Composition.Initialization.ruleset - - - - ..\..\bin - $(DefineConstants);TRACE - 1570;1572;1573;1591;1699 - - - FULLCLR;SILVERLIGHT - 10.0.20805 - 2.0 - Library - System.ComponentModel.Composition.Initialization - System.ComponentModel.Composition.Initialization - $(OutputPath)\System.ComponentModel.Composition.Initialization.xml - {A497DC28-0A3B-4BAD-B964-B8B436686D98} - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - true - - - - - - - - - {1BBA5101-D4F0-48B8-A5D6-7B23A099DCE3} - ComponentModel - - - - - - - - - - - - - - - - - - True - True - Strings.resx - - - - - - - - - ResXFileCodeGenerator - Strings.Designer.cs - Designer - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Composition.InitializationSL.csproj b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Composition.InitializationSL.csproj deleted file mode 100644 index 27a77b8040d..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Composition.InitializationSL.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - Migrated rules for Composition.Initialization.ruleset - - - - true - $(DefineConstants);SILVERLIGHT - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - ..\..\bin\SL - v3.5 - 1570;1572;1573;1591;1699 - - - FULLCLR;SILVERLIGHT - 9.0.30729 - 2.0 - Library - System.ComponentModel.Composition.Initialization - System.ComponentModel.Composition.Initialization - $(OutputPath)\System.ComponentModel.Composition.Initialization.xml - {A497DC28-0A3B-4BAD-B964-B8B436686D98} - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - true - - - - - - - - - {1BBA5101-D4F0-48B8-A5D6-7B23A099DCE3} - ComponentModelSL - - - - - - - - - - - - - - - - - - True - True - Strings.resx - - - - - - - - - ResXFileCodeGenerator - Strings.Designer.cs - Designer - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/.gitattributes deleted file mode 100644 index 3dc648d1be9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -/Lock.Reader.cs -crlf -/Lock.Writer.cs -crlf -/Lock.cs -crlf -/Requires.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Lock.Reader.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Lock.Reader.cs deleted file mode 100644 index 3f81a68ade9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Lock.Reader.cs +++ /dev/null @@ -1,32 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; - -namespace Microsoft.Internal -{ - internal struct ReadLock : IDisposable - { - private readonly Lock _lock; - private int _isDisposed; - - public ReadLock(Lock @lock) - { - this._isDisposed = 0; - this._lock = @lock; - this._lock.EnterReadLock(); - } - - public void Dispose() - { - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) - { - this._lock.ExitReadLock(); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Lock.Writer.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Lock.Writer.cs deleted file mode 100644 index e9d7088020f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Lock.Writer.cs +++ /dev/null @@ -1,32 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; - -namespace Microsoft.Internal -{ - internal struct WriteLock : IDisposable - { - private readonly Lock _lock; - private int _isDisposed; - - public WriteLock(Lock @lock) - { - this._isDisposed = 0; - this._lock = @lock; - this._lock.EnterWriteLock(); - } - - public void Dispose() - { - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) - { - this._lock.ExitWriteLock(); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Lock.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Lock.cs deleted file mode 100644 index 7cd7ac2ee5e..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Lock.cs +++ /dev/null @@ -1,79 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; - -namespace Microsoft.Internal -{ - internal sealed class Lock : IDisposable - { -#if (!SILVERLIGHT) - private ReaderWriterLockSlim _thisLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion); - private int _isDisposed = 0; - public void EnterReadLock() - { - this._thisLock.EnterReadLock(); - } - - public void EnterWriteLock() - { - this._thisLock.EnterWriteLock(); - } - - public void ExitReadLock() - { - this._thisLock.ExitReadLock(); - } - - public void ExitWriteLock() - { - this._thisLock.ExitWriteLock(); - } - - public void Dispose() - { - if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0) - { - this._thisLock.Dispose(); - } - } - -#else - // ReaderWriterLockSlim is not yet implemented on SilverLight - // Satisfies our requirements until it is implemented - object _thisLock = new object(); - - public Lock() - { - } - - public void EnterReadLock() - { - Monitor.Enter(this._thisLock); - } - - public void EnterWriteLock() - { - Monitor.Enter(this._thisLock); - } - - public void ExitReadLock() - { - Monitor.Exit(this._thisLock); - } - - public void ExitWriteLock() - { - Monitor.Exit(this._thisLock); - } - - public void Dispose() - { - } -#endif - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Requires.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Requires.cs deleted file mode 100644 index c7c2d31c1e2..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Microsoft/Internal/Requires.cs +++ /dev/null @@ -1,39 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Globalization; -using System.Reflection; -using System.ComponentModel.Composition; -using System.Text; - -namespace Microsoft.Internal -{ - internal static class Requires - { - [DebuggerStepThrough] - public static void NotNull(T value, string parameterName) - where T : class - { - if (value == null) - { - throw new ArgumentNullException(parameterName); - } - } - - [DebuggerStepThrough] - public static void NotNullOrEmpty(string value, string parameterName) - { - NotNull(value, parameterName); - - if (value.Length == 0) - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentException_EmptyString, parameterName), parameterName); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Strings.Designer.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Strings.Designer.cs deleted file mode 100644 index 9fe4543a0b1..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Strings.Designer.cs +++ /dev/null @@ -1,108 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.21114.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace System.ComponentModel.Composition { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Strings { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Strings() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.ComponentModel.Composition.Initialization.Strings", typeof(Strings).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to '{0}' cannot be an empty string ("").. - /// - internal static string ArgumentException_EmptyString { - get { - return ResourceManager.GetString("ArgumentException_EmptyString", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot call SatisfyImports on a object of type '{0}' because it is marked with one or more ExportAttributes.. - /// - internal static string ArgumentException_TypeHasExports { - get { - return ResourceManager.GetString("ArgumentException_TypeHasExports", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Catalog is trying to transition to an invalid state. Occurs when you call DownloadAsync more than once or CancelAsync is called at an incorrect time.. - /// - internal static string InvalidOperationException_DeploymentCatalogInvalidStateChange { - get { - return ResourceManager.GetString("InvalidOperationException_DeploymentCatalogInvalidStateChange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The package downloaded successfully but an error occurred while reading the contents of the package. See the inner exception for more details.. - /// - internal static string InvalidOperationException_ErrorReadingXap { - get { - return ResourceManager.GetString("InvalidOperationException_ErrorReadingXap", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The container has already been initialized either by another call to InitializeContainer or by someone causing the default container to be constructed. Ensure that InitializeContainer is one of the first things that happens in the application host to ensure that it is ready for the first composition.. - /// - internal static string InvalidOperationException_GlobalContainerAlreadyInitialized { - get { - return ResourceManager.GetString("InvalidOperationException_GlobalContainerAlreadyInitialized", resourceCulture); - } - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Strings.resx b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Strings.resx deleted file mode 100644 index b451d64391f..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/Strings.resx +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Cannot call SatisfyImports on a object of type '{0}' because it is marked with one or more ExportAttributes. - - - The container has already been initialized either by another call to InitializeContainer or by someone causing the default container to be constructed. Ensure that InitializeContainer is one of the first things that happens in the application host to ensure that it is ready for the first composition. - - - '{0}' cannot be an empty string (""). - - - Catalog is trying to transition to an invalid state. Occurs when you call DownloadAsync more than once or CancelAsync is called at an incorrect time. - - - The package downloaded successfully but an error occurred while reading the contents of the package. See the inner exception for more details. - - \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/SuppressMessages.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/SuppressMessages.cs deleted file mode 100644 index 76dc008cee5..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/SuppressMessages.cs +++ /dev/null @@ -1,8 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Diagnostics.CodeAnalysis; - -[module: SuppressMessage("Microsoft.MSInternal", "CA905:SystemNamespacesRequireApproval", Scope = "namespace", Target = "System.ComponentModel.Composition.Hosting")] -[module: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.ComponentModel.Composition.Hosting")] \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/.gitattributes deleted file mode 100644 index af342c37220..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/.gitattributes +++ /dev/null @@ -1,5 +0,0 @@ -/CompositionInitializer.AssemblyList.cs -crlf -/CompositionInitializer.cs -crlf -/ExportFactoryOfT.cs -crlf -/ExportFactoryOfTTMetadata.cs -crlf -/ExportLifetimeContextOfT.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/CompositionInitializer.AssemblyList.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/CompositionInitializer.AssemblyList.cs deleted file mode 100644 index 6e8347208b7..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/CompositionInitializer.AssemblyList.cs +++ /dev/null @@ -1,36 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Windows; -using System.Windows.Resources; - -namespace System.ComponentModel.Composition -{ - public static partial class CompositionInitializer - { - // This method is the only Silverlight specific code dependency in CompositionHost - private static List GetAssemblyList() - { - var assemblies = new List(); - - // While this may seem like somewhat of a hack, walking the AssemblyParts in the active - // deployment object is the only way to get the list of assemblies loaded by the XAP. - foreach (AssemblyPart ap in Deployment.Current.Parts) - { - StreamResourceInfo sri = Application.GetResourceStream(new Uri(ap.Source, UriKind.Relative)); - if (sri != null) - { - // Keep in mind that calling Load on an assembly that is already loaded will - // be a no-op and simply return the already loaded assembly object. - Assembly assembly = ap.Load(sri.Stream); - assemblies.Add(assembly); - } - } - - return assemblies; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/CompositionInitializer.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/CompositionInitializer.cs deleted file mode 100644 index 1416b6e82bb..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/CompositionInitializer.cs +++ /dev/null @@ -1,104 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Globalization; -using System.Linq; -using System.Reflection; - -namespace System.ComponentModel.Composition -{ - public static partial class CompositionInitializer - { - /// - /// Will satisfy the imports on a object instance based on a - /// registered with the . By default if no - /// is registered the first time this is called it will be initialized to a catalog - /// that contains all the assemblies loaded by the initial application XAP. - /// - /// - /// Object instance that contains s that need to be satisfied. - /// - /// - /// is . - /// - /// - /// contains s applied on its type. - /// - /// - /// One or more of the imports on the object instance could not be satisfied. - /// - /// - /// One or more of the imports on the object instance caused an error while composing. - /// - public static void SatisfyImports(object attributedPart) - { - if (attributedPart == null) - { - throw new ArgumentNullException("attributedPart"); - } - ComposablePart part = AttributedModelServices.CreatePart(attributedPart); - CompositionInitializer.SatisfyImports(part); - } - - - /// - /// Will satisfy the imports on a part based on a - /// registered with the . By default if no - /// is registered the first time this is called it will be initialized to a catalog - /// that contains all the assemblies loaded by the initial application XAP. - /// - /// - /// Part with imports that need to be satisfied. - /// - /// - /// is . - /// - /// - /// contains s applied on its type. - /// - /// - /// One or more of the imports on the object instance could not be satisfied. - /// - /// - /// One or more of the imports on the object instance caused an error while composing. - /// - public static void SatisfyImports(ComposablePart part) - { - if (part == null) - { - throw new ArgumentNullException("part"); - } - - var batch = new CompositionBatch(); - - batch.AddPart(part); - - if (part.ExportDefinitions.Any()) - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, - Strings.ArgumentException_TypeHasExports, part.ToString()), "part"); - } - - CompositionContainer container = null; - - // Ignoring return value because we don't need to know if we created it or not - CompositionHost.TryGetOrCreateContainer(_createContainer, out container); - - container.Compose(batch); - } - - private static Func _createContainer = CreateCompositionContainer; - private static CompositionContainer CreateCompositionContainer() - { - var assemblyCatalogs = GetAssemblyList() - .Select(assembly => new AssemblyCatalog(assembly)); - - var aggCatalog = new AggregateCatalog(assemblyCatalogs); - - return new CompositionContainer(aggCatalog); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/ExportFactoryOfT.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/ExportFactoryOfT.cs deleted file mode 100644 index 1ee66281ff9..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/ExportFactoryOfT.cs +++ /dev/null @@ -1,30 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using Microsoft.Internal; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - public class ExportFactory - { - private Func> _exportLifetimeContextCreator; - - public ExportFactory(Func> exportLifetimeContextCreator) - { - if (exportLifetimeContextCreator == null) - { - throw new ArgumentNullException("exportLifetimeContextCreator"); - } - - this._exportLifetimeContextCreator = exportLifetimeContextCreator; - } - - public ExportLifetimeContext CreateExport() - { - Tuple untypedLifetimeContext = this._exportLifetimeContextCreator.Invoke(); - return new ExportLifetimeContext(untypedLifetimeContext.Item1, untypedLifetimeContext.Item2); - } - } -} diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/ExportFactoryOfTTMetadata.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/ExportFactoryOfTTMetadata.cs deleted file mode 100644 index feb4097a64a..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/ExportFactoryOfTTMetadata.cs +++ /dev/null @@ -1,25 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; - -namespace System.ComponentModel.Composition -{ - public class ExportFactory : ExportFactory - { - private readonly TMetadata _metadata; - - public ExportFactory(Func> exportLifetimeContextCreator, TMetadata metadata) - : base(exportLifetimeContextCreator) - { - this._metadata = metadata; - } - - public TMetadata Metadata - { - get { return this._metadata; } - } - } -} - diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/ExportLifetimeContextOfT.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/ExportLifetimeContextOfT.cs deleted file mode 100644 index f1182da5fd3..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/ExportLifetimeContextOfT.cs +++ /dev/null @@ -1,38 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.ComponentModel.Composition.Primitives; -using System.Linq; - -namespace System.ComponentModel.Composition -{ - public sealed class ExportLifetimeContext : IDisposable - { - private readonly T _value; - private readonly Action _disposeAction; - - public ExportLifetimeContext(T value, Action disposeAction) - { - this._value = value; - this._disposeAction = disposeAction; - } - - public T Value - { - get - { - return this._value; - } - } - - public void Dispose() - { - if (this._disposeAction != null) - { - this._disposeAction.Invoke(); - } - } - } -} - diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/.gitattributes b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/.gitattributes deleted file mode 100644 index 2dacd9d3491..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -/CompositionHost.cs -crlf -/DeploymentCatalog.cs -crlf -/Package.cs -crlf diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/CompositionHost.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/CompositionHost.cs deleted file mode 100644 index 33d65fd6499..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/CompositionHost.cs +++ /dev/null @@ -1,113 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Globalization; -using System.Threading; -using System.ComponentModel.Composition.Primitives; -namespace System.ComponentModel.Composition.Hosting -{ - public static class CompositionHost - { - // Field is internal only to assist in testing - internal static CompositionContainer _container = null; - private static object _lockObject = new object(); - - /// - /// This method can be used to initialize the global container used by - /// in case where the default container doesn't provide enough flexibility. - /// - /// If this method is needed it should be called exactly once and as early as possible in the application host. It will need - /// to be called before the first call to - /// - /// - /// that should be used instead of the default global container. - /// - /// - /// is . - /// - /// - /// Either or has already been called or someone has already made use of the global - /// container via . In either case you need to ensure that it - /// is called only once and that it is called early in the application host startup code. - /// - public static void Initialize(CompositionContainer container) - { - if (container == null) - { - throw new ArgumentNullException("container"); - } - - CompositionContainer globalContainer = null; - bool alreadyCreated = TryGetOrCreateContainer(() => container, out globalContainer); - - if (alreadyCreated) - { - throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, - Strings.InvalidOperationException_GlobalContainerAlreadyInitialized)); - } - } - - /// - /// This method can be used to initialize the global container used by - /// in case where the default container doesn't provide enough flexibility. - /// - /// If this method is needed it should be called exactly once and as early as possible in the application host. It will need - /// to be called before the first call to - /// - /// - /// An array of that should be used to initialize the with. - /// - /// - /// is . - /// - /// - /// Either or has already been called or someone has already made use of the global - /// container via . In either case you need to ensure that it - /// is called only once and that it is called early in the application host startup code. - /// - public static CompositionContainer Initialize(params ComposablePartCatalog[] catalogs) - { - AggregateCatalog aggregateCatalog = new AggregateCatalog(catalogs); - CompositionContainer container = new CompositionContainer(aggregateCatalog); - try - { - CompositionHost.Initialize(container); - } - catch - { - container.Dispose(); - - // NOTE : this is important, as this prevents the disposal of the catalogs passed as input arguments - aggregateCatalog.Catalogs.Clear(); - aggregateCatalog.Dispose(); - - throw; - } - - return container; - } - - - - internal static bool TryGetOrCreateContainer(Func createContainer, out CompositionContainer globalContainer) - { - bool alreadyCreated = true; - if (_container == null) - { - var container = createContainer.Invoke(); - lock (_lockObject) - { - if (_container == null) - { - Thread.MemoryBarrier(); - _container = container; - alreadyCreated = false; - } - } - } - globalContainer = _container; - return alreadyCreated; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/DeploymentCatalog.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/DeploymentCatalog.cs deleted file mode 100644 index e6042b1caa1..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/DeploymentCatalog.cs +++ /dev/null @@ -1,420 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Threading; -using Microsoft.Internal; - -#if (SILVERLIGHT) -namespace System.ComponentModel.Composition.Hosting -{ - /// - /// Implements a MEF catalog that supports Asynchronous download of Silverlast Xap files. - /// - public class DeploymentCatalog : ComposablePartCatalog, INotifyComposablePartCatalogChanged - { - static class State - { - public const int Created = 0; - public const int Initialized = 1000; - public const int DownloadStarted = 2000; - public const int DownloadCompleted = 3000; - public const int DownloadCancelled = 4000; - } - - private Lock _lock = new Lock(); - private volatile bool _isDisposed = false; - private Uri _uri = null; - private int _state = State.Created; - private AggregateCatalog _catalogCollection = new AggregateCatalog(); - private WebClient _webClient = null; - - /// - /// Construct a Deployment catalog with the parts from the main Xap. - /// - public DeploymentCatalog() - { - this.DiscoverParts(Package.CurrentAssemblies); - this._state = State.Initialized; - } - - /// - /// Construct a Deployment catalog with a string form relative uri. - /// - /// - /// A relative Uri to the Download Xap file - /// . - /// - /// - /// The argument is null or an empty string. - /// - public DeploymentCatalog(string uriRelative) - { - Requires.NotNullOrEmpty(uriRelative, "uriRelative"); - this._uri = new Uri(uriRelative, UriKind.Relative); - } - - /// - /// Construct a Deployment catalog with the parts from uri. - /// - /// - /// A Uri to the Download Xap file - /// . - /// - /// - /// The argument is null. - /// - public DeploymentCatalog(Uri uri) - { - Requires.NotNull(uri, "uri"); - this._uri = uri; - } - - /// - /// Notify when the contents of the Catalog has changed. - /// - public event EventHandler Changed; - - /// - /// Notify when the contents of the Catalog is changing. - /// - public event EventHandler Changing; - - /// - /// Notify when the download has been completed. - /// - public event EventHandler DownloadCompleted; - - /// - /// Notify when the contents of the Progress of the download has changed. - /// - public event EventHandler DownloadProgressChanged; - - /// - /// Retrieve or create the WebClient. - /// - /// - /// The has been disposed of. - /// - private WebClient WebClient - { - get - { - this.ThrowIfDisposed(); - if(this._webClient == null) - { - Interlocked.CompareExchange(ref this._webClient, new WebClient(), null); - } - return this._webClient; - } - } - - /// - /// Gets the part definitions of the Deployment catalog. - /// - /// - /// A of objects of the - /// . - /// - /// - /// The has been disposed of. - /// - public override IQueryable Parts - { - get - { - this.ThrowIfDisposed(); - return this._catalogCollection.Parts; - } - } - - /// - /// Gets the Uri of this catalog - /// - /// - /// The has been disposed of. - /// - public Uri Uri - { - get - { - this.ThrowIfDisposed(); - return this._uri; - } - } - - /// - /// - /// - /// - /// - /// The has been disposed of. - /// - private void DiscoverParts(IEnumerable assemblies) - { - this.ThrowIfDisposed(); - - var addedDefinitions = new List(); - var addedCatalogs = new Dictionary(); - using(new ReadLock(this._lock)) - { - foreach (var assembly in assemblies) - { - if (addedCatalogs.ContainsKey(assembly.FullName)) - { - // Nothing to do because the assembly has already been added. - continue; - } - - var catalog = new AssemblyCatalog(assembly); - addedDefinitions.AddRange(catalog.Parts); - addedCatalogs.Add(assembly.FullName, catalog); - } - } - - // Generate notifications - using (var atomicComposition = new AtomicComposition()) - { - var changingArgs = new ComposablePartCatalogChangeEventArgs(addedDefinitions, Enumerable.Empty(), atomicComposition); - this.OnChanging(changingArgs); - - using (new WriteLock(this._lock)) - { - foreach (var item in addedCatalogs) - { - this._catalogCollection.Catalogs.Add(item.Value); - } - } - atomicComposition.Complete(); - } - - var changedArgs = new ComposablePartCatalogChangeEventArgs(addedDefinitions, Enumerable.Empty(), null); - this.OnChanged(changedArgs); - } - - /// - /// Returns the export definitions that match the constraint defined by the specified definition. - /// - /// - /// The that defines the conditions of the - /// objects to return. - /// - /// - /// An of containing the - /// objects and their associated - /// for objects that match the constraint defined - /// by . - /// - /// - /// is . - /// - /// - /// The has been disposed of. - /// - public override IEnumerable> GetExports(ImportDefinition definition) - { - this.ThrowIfDisposed(); - Requires.NotNull(definition, "definition"); - - return this._catalogCollection.GetExports(definition); - } - - /// - /// Cancel the async operation. - /// - public void CancelAsync() - { - ThrowIfDisposed(); - MutateStateOrThrow(State.DownloadCancelled, State.DownloadStarted); - this.WebClient.CancelAsync(); - } - - /// - /// Begin the asynchronous download. - /// - public void DownloadAsync() - { - ThrowIfDisposed(); - - if (Interlocked.CompareExchange(ref this._state, State.DownloadStarted, State.Created) == State.Created) - { - // Created with Downloadable content do download - this.WebClient.OpenReadCompleted += new OpenReadCompletedEventHandler(HandleOpenReadCompleted); - this.WebClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(HandleDownloadProgressChanged); - this.WebClient.OpenReadAsync(Uri, this); - } - else - { - // Created with LocalAssemblies - MutateStateOrThrow(State.DownloadCompleted, State.Initialized); - - this.OnDownloadCompleted(new AsyncCompletedEventArgs(null, false, this)); - } - } - - void HandleDownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) - { - EventHandler downloadProgressChangedEvent = this.DownloadProgressChanged; - if (downloadProgressChangedEvent != null) - { - downloadProgressChangedEvent(this, e); - } - } - - private void HandleOpenReadCompleted(object sender, OpenReadCompletedEventArgs e) - { - Exception error = e.Error; - bool cancelled = e.Cancelled; - - // Possible valid current states are DownloadStarted and DownloadCancelled. - int currentState = Interlocked.CompareExchange(ref this._state, State.DownloadCompleted, State.DownloadStarted); - - if (currentState != State.DownloadStarted) - { - cancelled = true; - } - - if (error == null && !cancelled) - { - try - { - var assemblies = Package.LoadPackagedAssemblies(e.Result); - this.DiscoverParts(assemblies); - } - catch (Exception ex) - { - error = new InvalidOperationException(Strings.InvalidOperationException_ErrorReadingXap, ex); - } - } - - this.OnDownloadCompleted(new AsyncCompletedEventArgs(error, cancelled, this)); - } - - /// - /// Raises the event. - /// - /// - /// An containing the data for the event. - /// - protected virtual void OnChanged(ComposablePartCatalogChangeEventArgs e) - { - EventHandler changedEvent = this.Changed; - if (changedEvent != null) - { - changedEvent(this, e); - } - } - - /// - /// Raises the event. - /// - /// - /// An containing the data for the event. - /// - protected virtual void OnChanging(ComposablePartCatalogChangeEventArgs e) - { - EventHandler changingEvent = this.Changing; - if (changingEvent != null) - { - changingEvent(this, e); - } - } - - /// - /// Raises the event. - /// - /// - /// An containing the data for the event. - /// - protected virtual void OnDownloadCompleted(AsyncCompletedEventArgs e) - { - EventHandler downloadCompletedEvent = this.DownloadCompleted; - if (downloadCompletedEvent != null) - { - downloadCompletedEvent(this, e); - } - } - - /// - /// Raises the event. - /// - /// - /// An containing the data for the event. - /// - protected virtual void OnDownloadProgressChanged(DownloadProgressChangedEventArgs e) - { - EventHandler downloadProgressChangedEvent = this.DownloadProgressChanged; - if (downloadProgressChangedEvent != null) - { - downloadProgressChangedEvent(this, e); - } - } - - protected override void Dispose(bool disposing) - { - try - { - if (disposing) - { - if (!this._isDisposed) - { - AggregateCatalog catalogs = null; - bool disposeLock = false; - try - { - using (new WriteLock(this._lock)) - { - if (!this._isDisposed) - { - disposeLock = true; - catalogs = this._catalogCollection; - this._catalogCollection = null; - this._isDisposed = true; - } - } - } - finally - { - if (catalogs != null) - { - catalogs.Dispose(); - } - - if (disposeLock) - { - this._lock.Dispose(); - } - } - } - } - } - finally - { - base.Dispose(disposing); - } - } - - private void ThrowIfDisposed() - { - if (this._isDisposed) - { - throw new ObjectDisposedException(this.GetType().ToString()); - } - } - - private void MutateStateOrThrow(int toState, int fromState) - { - int currentState = Interlocked.CompareExchange(ref this._state, toState, fromState); - if(currentState != fromState) - { - throw new InvalidOperationException(Strings.InvalidOperationException_DeploymentCatalogInvalidStateChange); - } - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/Package.cs b/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/Package.cs deleted file mode 100644 index a91e5945f05..00000000000 --- a/mcs/class/System.ComponentModel.Composition/src/Composition.Initialization/System/ComponentModel/Composition/Hosting/Package.cs +++ /dev/null @@ -1,113 +0,0 @@ -// ----------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. -// ----------------------------------------------------------------------- -#if(SILVERLIGHT) -using System; -using System.Collections.Generic; -using System.IO; -using System.Net; -using System.Reflection; -using System.Windows; -using System.Windows.Resources; -using System.Xml; -using System.ComponentModel; - -namespace System.ComponentModel.Composition.Hosting -{ - /// - /// Helper functions for accessing the Silverlight manifest - /// - internal static class Package - { - /// - /// Retrieves The current list of assemblies for the application XAP load. Depends on the Deployment.Current property being setup and - /// so can only be accessed after the Application object has be completely constructed. - /// No caching occurs at this level. - /// - public static IEnumerable CurrentAssemblies - { - get - { - var assemblies = new List(); - - // While this may seem like somewhat of a hack, walking the AssemblyParts in the active - // deployment object is the only way to get the list of assemblies loaded by the initial XAP. - foreach (AssemblyPart ap in Deployment.Current.Parts) - { - StreamResourceInfo sri = Application.GetResourceStream(new Uri(ap.Source, UriKind.Relative)); - if (sri != null) - { - // Keep in mind that calling Load on an assembly that is already loaded will - // be a no-op and simply return the already loaded assembly object. - Assembly assembly = ap.Load(sri.Stream); - assemblies.Add(assembly); - } - } - - return assemblies; - } - } - - - public static IEnumerable LoadPackagedAssemblies(Stream packageStream) - { - List assemblies = new List(); - StreamResourceInfo packageStreamInfo = new StreamResourceInfo(packageStream, null); - - IEnumerable parts = GetDeploymentParts(packageStreamInfo); - - foreach (AssemblyPart ap in parts) - { - StreamResourceInfo sri = Application.GetResourceStream( - packageStreamInfo, new Uri(ap.Source, UriKind.Relative)); - - assemblies.Add(ap.Load(sri.Stream)); - } - packageStream.Close(); - return assemblies; - } - - /// - /// Only reads AssemblyParts and does not support external parts (aka Platform Extensions or TPEs). - /// - private static IEnumerable GetDeploymentParts(StreamResourceInfo xapStreamInfo) - { - Uri manifestUri = new Uri("AppManifest.xaml", UriKind.Relative); - StreamResourceInfo manifestStreamInfo = Application.GetResourceStream(xapStreamInfo, manifestUri); - List assemblyParts = new List(); - - // The code assumes the following format in AppManifest.xaml - // - // - // - // - // ... - // - // - // - if (manifestStreamInfo != null) - { - Stream manifestStream = manifestStreamInfo.Stream; - using (XmlReader reader = XmlReader.Create(manifestStream)) - { - if (reader.ReadToFollowing("AssemblyPart")) - { - do - { - string source = reader.GetAttribute("Source"); - - if (source != null) - { - assemblyParts.Add(new AssemblyPart() { Source = source }); - } - } - while (reader.ReadToNextSibling("AssemblyPart")); - } - } - } - - return assemblyParts; - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs b/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs new file mode 100644 index 00000000000..5ff50e119df --- /dev/null +++ b/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs @@ -0,0 +1,59 @@ +namespace System.ComponentModel.DataAnnotations.Resources +{ +static class DataAnnotationsResources +{ + public const string ArgumentIsNullOrWhitespace = "ArgumentIsNullOrWhitespace"; + public const string AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties = "AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties"; + public const string AttributeStore_Unknown_Property = "AttributeStore_Unknown_Property"; + public const string Common_PropertyNotFound = "Common_PropertyNotFound"; + public const string CompareAttribute_MustMatch = "CompareAttribute_MustMatch"; + public const string CompareAttribute_UnknownProperty = "CompareAttribute_UnknownProperty"; + public const string CreditCardAttribute_Invalid = "CreditCardAttribute_Invalid"; + public const string CustomValidationAttribute_Method_Must_Return_ValidationResult = "CustomValidationAttribute_Method_Must_Return_ValidationResult"; + public const string CustomValidationAttribute_Method_Not_Found = "CustomValidationAttribute_Method_Not_Found"; + public const string CustomValidationAttribute_Method_Required = "CustomValidationAttribute_Method_Required"; + public const string CustomValidationAttribute_Method_Signature = "CustomValidationAttribute_Method_Signature"; + public const string CustomValidationAttribute_Type_Conversion_Failed = "CustomValidationAttribute_Type_Conversion_Failed"; + public const string CustomValidationAttribute_Type_Must_Be_Public = "CustomValidationAttribute_Type_Must_Be_Public"; + public const string CustomValidationAttribute_ValidationError = "{0} is not valid."; + public const string CustomValidationAttribute_ValidatorType_Required = "CustomValidationAttribute_ValidatorType_Required"; + public const string DataTypeAttribute_EmptyDataTypeString = "DataTypeAttribute_EmptyDataTypeString"; + public const string DisplayAttribute_PropertyNotSet = "The {0} property has not been set. Use the {1} method to get the value."; + public const string EmailAddressAttribute_Invalid = "EmailAddressAttribute_Invalid"; + public const string EnumDataTypeAttribute_TypeCannotBeNull = "EnumDataTypeAttribute_TypeCannotBeNull"; + public const string EnumDataTypeAttribute_TypeNeedsToBeAnEnum = "EnumDataTypeAttribute_TypeNeedsToBeAnEnum"; + public const string FileExtensionsAttribute_Invalid = "FileExtensionsAttribute_Invalid"; + public const string LocalizableString_LocalizationFailed = "Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'."; + public const string MaxLengthAttribute_InvalidMaxLength = "MaxLengthAttribute_InvalidMaxLength"; + public const string MaxLengthAttribute_ValidationError = "MaxLengthAttribute_ValidationError"; + public const string MetadataTypeAttribute_TypeCannotBeNull = "MetadataTypeAttribute_TypeCannotBeNull"; + public const string MinLengthAttribute_InvalidMinLength = "MinLengthAttribute_InvalidMinLength"; + public const string MinLengthAttribute_ValidationError = "MinLengthAttribute_ValidationError"; + public const string PhoneAttribute_Invalid = "PhoneAttribute_Invalid"; + public const string RangeAttribute_ArbitraryTypeNotIComparable = "RangeAttribute_ArbitraryTypeNotIComparable"; + public const string RangeAttribute_MinGreaterThanMax = "RangeAttribute_MinGreaterThanMax"; + public const string RangeAttribute_Must_Set_Min_And_Max = "RangeAttribute_Must_Set_Min_And_Max"; + public const string RangeAttribute_Must_Set_Operand_Type = "RangeAttribute_Must_Set_Operand_Type"; + public const string RangeAttribute_ValidationError = "The field {0} must be between {1} and {2}."; + public const string RegexAttribute_ValidationError = "The field {0} must match the regular expression {1}."; + public const string RegularExpressionAttribute_Empty_Pattern = "The pattern must be set to a valid regular expression."; + public const string RequiredAttribute_ValidationError = "RequiredAttribute_ValidationError"; + public const string StringLengthAttribute_InvalidMaxLength = "StringLengthAttribute_InvalidMaxLength"; + public const string StringLengthAttribute_ValidationError = "The field {0} must be a string with a maximum length of {1}."; + public const string StringLengthAttribute_ValidationErrorIncludingMinimum = "StringLengthAttribute_ValidationErrorIncludingMinimum"; + public const string UIHintImplementation_ControlParameterKeyIsNotAString = "UIHintImplementation_ControlParameterKeyIsNotAString"; + public const string UIHintImplementation_ControlParameterKeyIsNull = "UIHintImplementation_ControlParameterKeyIsNull"; + public const string UIHintImplementation_ControlParameterKeyOccursMoreThanOnce = "UIHintImplementation_ControlParameterKeyOccursMoreThanOnce"; + public const string UIHintImplementation_NeedEvenNumberOfControlParameters = "UIHintImplementation_NeedEvenNumberOfControlParameters"; + public const string UrlAttribute_Invalid = "UrlAttribute_Invalid"; + public const string ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource = "ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource"; + public const string ValidationAttribute_IsValid_NotImplemented = "ValidationAttribute_IsValid_NotImplemented"; + public const string ValidationAttribute_NeedBothResourceTypeAndResourceName = "ValidationAttribute_NeedBothResourceTypeAndResourceName"; + public const string ValidationAttribute_ResourcePropertyNotStringType = "ValidationAttribute_ResourcePropertyNotStringType"; + public const string ValidationAttribute_ResourceTypeDoesNotHaveProperty = "ValidationAttribute_ResourceTypeDoesNotHaveProperty"; + public const string ValidationAttribute_ValidationError = "The field {0} is invalid."; + public const string ValidationContextServiceContainer_ItemAlreadyExists = "ValidationContextServiceContainer_ItemAlreadyExists"; + public const string Validator_InstanceMustMatchValidationContextInstance = "Validator_InstanceMustMatchValidationContextInstance"; + public const string Validator_Property_Value_Wrong_Type = "Validator_Property_Value_Wrong_Type"; +} +} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_2_0.csproj b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_2_0.csproj deleted file mode 100644 index 004785cb1d9..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_2_0.csproj +++ /dev/null @@ -1,120 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F3112064-6311-48A9-992B-A68DD3C62133} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.ComponentModel.DataAnnotations - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_4_0.csproj b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_4_0.csproj deleted file mode 100644 index 1bcf43c8a8b..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_4_0.csproj +++ /dev/null @@ -1,127 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {82CAAC49-507E-446E-A6FB-2C875E8F2C4E} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.ComponentModel.DataAnnotations - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_2_0.csproj b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_2_0.csproj deleted file mode 100644 index 6d9dde4f654..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_2_0.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AE2FDFD3-791C-4B7F-AC47-46926705614B} - Library - 1699 - bin\Debug\System.ComponentModel.DataAnnotations-tests-net_2_0 - True - False - - Properties - - - System.ComponentModel.DataAnnotations_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {F3112064-6311-48A9-992B-A68DD3C62133} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_4_0.csproj b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_4_0.csproj deleted file mode 100644 index bf7fdedc0fa..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_4_0.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6AF2102B-5842-4069-8C1C-10FDE5340860} - Library - 1699 - bin\Debug\System.ComponentModel.DataAnnotations-tests-net_4_0 - True - False - - Properties - - - System.ComponentModel.DataAnnotations_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {82CAAC49-507E-446E-A6FB-2C875E8F2C4E} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ColumnAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ColumnAttribute.cs deleted file mode 100644 index c015d65f165..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ColumnAttribute.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// ColumnAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] - public class ColumnAttribute : Attribute - { - public ColumnAttribute () - { - } - - public ColumnAttribute (string name) - { - Name = name; - } - - public string Name { get; private set; } - - public int Order { get; set; } - - public string TypeName { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ComplexTypeAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ComplexTypeAttribute.cs deleted file mode 100644 index a3796e01b2e..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ComplexTypeAttribute.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// ComplexTypeAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Class, AllowMultiple = false)] - public class ComplexTypeAttribute : Attribute - { - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedAttribute.cs deleted file mode 100644 index ad3cdab1f5a..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedAttribute.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// DatabaseGeneratedAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] - public class DatabaseGeneratedAttribute : Attribute - { - public DatabaseGeneratedAttribute (DatabaseGeneratedOption databaseGeneratedOption) - { - DatabaseGeneratedOption = databaseGeneratedOption; - } - - public DatabaseGeneratedOption DatabaseGeneratedOption { get; private set; } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedOption.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedOption.cs deleted file mode 100644 index 051c606d5ae..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedOption.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// DatabaseGeneratedOption.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -namespace System.ComponentModel.DataAnnotations.Schema -{ - public enum DatabaseGeneratedOption - { - None, - Identity, - Computed - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ForeignKeyAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ForeignKeyAttribute.cs deleted file mode 100644 index 9a3d0083bb4..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ForeignKeyAttribute.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// ForeignKeyAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] - public class ForeignKeyAttribute : Attribute - { - public ForeignKeyAttribute (string name) - { - Name = name; - } - - public string Name { get; private set; } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/InversePropertyAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/InversePropertyAttribute.cs deleted file mode 100644 index 155a3b900fa..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/InversePropertyAttribute.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// InversePropertyAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] - public class InversePropertyAttribute : Attribute - { - public InversePropertyAttribute (string property) - { - Property = property; - } - - public string Property { get; private set; } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/NotMappedAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/NotMappedAttribute.cs deleted file mode 100644 index 5d66ccc4152..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/NotMappedAttribute.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// NotMappedAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] - public class NotMappedAttribute : Attribute - { - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/TableAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/TableAttribute.cs deleted file mode 100644 index 65f7912a004..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/TableAttribute.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// TableAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false)] - public class TableAttribute : Attribute - { - public TableAttribute (string name) - { - Name = name; - } - - public string Name { get; private set; } - - public string Schema { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources index 7fdb746ad04..df43b5ed4b0 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources +++ b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources @@ -2,29 +2,52 @@ ../../build/common/Locale.cs ../../build/common/MonoTODOAttribute.cs Assembly/AssemblyInfo.cs -System.ComponentModel.DataAnnotations/AssociatedMetadataTypePropertyDescriptor.cs -System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs -System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs -System.ComponentModel.DataAnnotations/AssociationAttribute.cs -System.ComponentModel.DataAnnotations/ControlParameters.cs -System.ComponentModel.DataAnnotations/ConcurrencyCheckAttribute.cs -System.ComponentModel.DataAnnotations/CustomValidationAttribute.cs -System.ComponentModel.DataAnnotations/DataType.cs -System.ComponentModel.DataAnnotations/DataTypeAttribute.cs -System.ComponentModel.DataAnnotations/DisplayAttribute.cs -System.ComponentModel.DataAnnotations/DisplayColumnAttribute.cs -System.ComponentModel.DataAnnotations/DisplayFormatAttribute.cs -System.ComponentModel.DataAnnotations/EditableAttribute.cs -System.ComponentModel.DataAnnotations/EnumDataTypeAttribute.cs -System.ComponentModel.DataAnnotations/IValidatableObject.cs -System.ComponentModel.DataAnnotations/MetadataTypeAttribute.cs -System.ComponentModel.DataAnnotations/RangeAttribute.cs -System.ComponentModel.DataAnnotations/RegularExpressionAttribute.cs -System.ComponentModel.DataAnnotations/RequiredAttribute.cs -System.ComponentModel.DataAnnotations/ScaffoldColumnAttribute.cs -System.ComponentModel.DataAnnotations/ScaffoldTableAttribute.cs -System.ComponentModel.DataAnnotations/StringLengthAttribute.cs -System.ComponentModel.DataAnnotations/UIHintAttribute.cs -System.ComponentModel.DataAnnotations/UrlAttribute.cs -System.ComponentModel.DataAnnotations/ValidationAttribute.cs -System.ComponentModel.DataAnnotations/ValidationException.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AssociationAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/BindableTypeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/CompareAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ConcurrencyCheckAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/CreditCardAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/CustomValidationAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/DataType.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/DataTypeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/DisplayAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/DisplayColumnAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/DisplayFormatAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/EditableAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/EmailAddressAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/EnumDataTypeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/FileExtensionsAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/FilterUIHintAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/IValidatableObject.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/KeyAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/LocalizableString.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/MaxLengthAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/MetadataPropertyDescriptorWrapper.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/MetadataTypeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/MinLengthAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/PhoneAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/RangeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/RegularExpressionAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/RequiredAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ScaffoldAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/ColumnAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/ComplexTypeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/DatabaseGeneratedAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/DatabaseGeneratedOption.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/ForeignKeyAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/InversePropertyAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/NotMappedAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/TableAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/StringLengthAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/TimestampAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/UIHintAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/UrlAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationAttributeStore.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationContext.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationException.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationResult.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Validator.cs +DataAnnotationsResources.cs diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypePropertyDescriptor.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypePropertyDescriptor.cs deleted file mode 100644 index 2c1b013d3cd..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypePropertyDescriptor.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// AssociatedMetadataTypeTypeDescriptionProvider.cs -// -// Author: -// Marek Habersack -// -// Copyright (C) 2009 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if !MOBILE -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Reflection; - -namespace System.ComponentModel.DataAnnotations -{ - class AssociatedMetadataTypePropertyDescriptor : ReflectionPropertyDescriptor - { - MemberInfo metaTypeMember; - - public AssociatedMetadataTypePropertyDescriptor (PropertyInfo typeProperty, MemberInfo metaTypeMember) - : base (typeProperty) - { - this.metaTypeMember = metaTypeMember; - } - - protected override void FillAttributes (IList attributeList) - { - base.FillAttributes (attributeList); - if (metaTypeMember == null) - return; - - object[] attributes = metaTypeMember.GetCustomAttributes (false); - if (attributes == null || attributes.Length == 0) - return; - - foreach (object o in attributes) { - var attr = o as Attribute; - if (attr == null) - continue; - - attributeList.Add (attr); - } - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs deleted file mode 100644 index 212999a5e35..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// AssociatedMetadataTypeTypeDescriptionProvider.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if !MOBILE -using System; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - public class AssociatedMetadataTypeTypeDescriptionProvider : TypeDescriptionProvider - { - Type type; - Type associatedMetadataType; - - public AssociatedMetadataTypeTypeDescriptionProvider (Type type) - { - if (type == null) - throw new ArgumentNullException ("type"); - - this.type = type; - } - - public AssociatedMetadataTypeTypeDescriptionProvider (Type type, Type associatedMetadataType) - { - if (type == null) - throw new ArgumentNullException ("type"); - if (associatedMetadataType == null) - throw new ArgumentNullException ("associatedMetadataType"); - - this.type = type; - this.associatedMetadataType = associatedMetadataType; - } - - public override ICustomTypeDescriptor GetTypeDescriptor (Type objectType, object instance) - { - return new AssociatedMetadataTypeTypeDescriptor (base.GetTypeDescriptor (objectType, instance), type, associatedMetadataType); - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs deleted file mode 100644 index 12307ff4b3b..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs +++ /dev/null @@ -1,170 +0,0 @@ -// -// AssociatedMetadataTypeTypeDescriptionProvider.cs -// -// Author: -// Marek Habersack -// -// Copyright (C) 2009 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if !MOBILE -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Reflection; - -namespace System.ComponentModel.DataAnnotations -{ - class AssociatedMetadataTypeTypeDescriptor : CustomTypeDescriptor - { - Type type; - Type associatedMetadataType; - bool associatedMetadataTypeChecked; - PropertyDescriptorCollection properties; - - Type AssociatedMetadataType { - get { - if (!associatedMetadataTypeChecked && associatedMetadataType == null) - associatedMetadataType = FindMetadataType (); - - return associatedMetadataType; - } - } - - public AssociatedMetadataTypeTypeDescriptor (ICustomTypeDescriptor parent, Type type) - : this (parent, type, null) - { - } - - public AssociatedMetadataTypeTypeDescriptor (ICustomTypeDescriptor parent, Type type, Type associatedMetadataType) - : base (parent) - { - this.type = type; - this.associatedMetadataType = associatedMetadataType; - } - - void CopyAttributes (object[] from, List to) - { - foreach (object o in from) { - Attribute a = o as Attribute; - if (a == null) - continue; - - to.Add (a); - } - } - - public override AttributeCollection GetAttributes () - { - var attributes = new List (); - CopyAttributes (type.GetCustomAttributes (true), attributes); - - Type metaType = AssociatedMetadataType; - if (metaType != null) - CopyAttributes (metaType.GetCustomAttributes (true), attributes); - - return new AttributeCollection (attributes.ToArray ()); - } - - public override PropertyDescriptorCollection GetProperties () - { - // Code partially copied from TypeDescriptor.TypeInfo.GetProperties - if (properties != null) - return properties; - - Dictionary metaMembers = null; - var propertiesHash = new Dictionary (); // name - null - var propertiesList = new List (); - Type currentType = type; - Type metaType = AssociatedMetadataType; - - if (metaType != null) { - metaMembers = new Dictionary (); - MemberInfo[] members = metaType.GetMembers (BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly); - - foreach (MemberInfo member in members) { - switch (member.MemberType) { - case MemberTypes.Field: - case MemberTypes.Property: - break; - - default: - continue; - } - - string name = member.Name; - if (metaMembers.ContainsKey (name)) - continue; - - metaMembers.Add (name, member); - } - } - - // Getting properties type by type, because in the case of a property in the child type, where - // the "new" keyword is used and also the return type is changed Type.GetProperties returns - // also the parent property. - // - // Note that we also have to preserve the properties order here. - // - while (currentType != null && currentType != typeof (object)) { - PropertyInfo[] props = currentType.GetProperties (BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly); - foreach (PropertyInfo property in props) { - string propName = property.Name; - - if (property.GetIndexParameters ().Length == 0 && property.CanRead && !propertiesHash.ContainsKey (propName)) { - MemberInfo metaMember; - - if (metaMembers != null) - metaMembers.TryGetValue (propName, out metaMember); - else - metaMember = null; - propertiesList.Add (new AssociatedMetadataTypePropertyDescriptor (property, metaMember)); - propertiesHash.Add (propName, true); - } - } - currentType = currentType.BaseType; - } - - properties = new PropertyDescriptorCollection ((PropertyDescriptor[]) propertiesList.ToArray (), true); - return properties; - } - - Type FindMetadataType () - { - associatedMetadataTypeChecked = true; - if (type == null) - return null; - - object[] attrs = type.GetCustomAttributes (typeof (MetadataTypeAttribute), true); - if (attrs == null || attrs.Length == 0) - return null; - - var attr = attrs [0] as MetadataTypeAttribute; - if (attr == null) - return null; - - return attr.MetadataClassType; - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociationAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociationAttribute.cs deleted file mode 100644 index 7624c6090b9..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociationAttribute.cs +++ /dev/null @@ -1,89 +0,0 @@ -// -// AssociationAttribute.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class AssociationAttribute : Attribute - { - static readonly char[] keySplitChars = { ',' }; - - IEnumerable otherKeyMembers; - IEnumerable thisKeyMembers; - - public bool IsForeignKey { get; set; } - public string Name { get; private set; } - public string OtherKey { get; private set; } - - public IEnumerable OtherKeyMembers { - get { - if (otherKeyMembers == null) - otherKeyMembers = GetKeyMembers (OtherKey); - - return otherKeyMembers; - } - } - - public string ThisKey { get; private set; } - - public IEnumerable ThisKeyMembers { - get { - if (thisKeyMembers == null) - thisKeyMembers = GetKeyMembers (ThisKey); - - return thisKeyMembers; - } - } - - public AssociationAttribute (string name, string thisKey, string otherKey) - { - this.Name = name; - this.ThisKey = thisKey; - this.OtherKey = otherKey; - } - - IEnumerable GetKeyMembers (string key) - { - // .NET emulation - if (key == null) - throw new NullReferenceException (".NET emulation"); - - string nows = key.Replace (" ", String.Empty); - if (nows.Length == 0) - return new string[] { String.Empty }; - - return nows.Split (keySplitChars); - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog deleted file mode 100644 index 1bfd423525f..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog +++ /dev/null @@ -1,64 +0,0 @@ -2010-05-26 Marek Habersack - - * ValidationAttribute.cs: cope with null/empty ErrorMessageString - in FormatErrorMessage - -2010-05-12 Marek Habersack - - * ValidationException.cs: partially implemented - - * ValidationAttribute.cs: implemented - - * RequiredAttribute.cs: implemented. Fixes bug #604100 - - * AssociationAttribute.cs, ConcurrencyCheckAttribute.cs, - CustomValidationAttribute.cs, EditableAttribute.cs, - EnumDataTypeAttribute.cs, IValidatableObject.cs, - ValidationContext.cs, ValidationResult.cs: added - -2009-09-15 Marek Habersack - - * DataTypeAttribute.cs: implemented GetDataTypeName - -2009-06-23 Marek Habersack - - * ValidationAttribute.cs: error message must not ever be empty. - - * UIHintAttribute.cs: do not throw NIEX from the constructor. - - * DataTypeAttribute.cs: implemented correct DisplayFormat - intialization for DataType.Time. - - * AssociatedMetadataTypeTypeDescriptor.cs: implemented retrieving - attributes of the associated metadata type, as well as merging of - attribute collections between metadata and main type properties. - - * AssociatedMetadataTypePropertyDescriptor.cs: added. Helper class - which merges attributes from the metadata type (if any) with those - associated with property from the "main" type. - -2009-04-23 Marek Habersack - - * AssociatedMetadataTypeTypeDescriptor.cs: added - doesn't add any - real functionality yet. - - * AssociatedMetadataTypeTypeDescriptionProvider.cs: implemented - all the methods. - -2008-10-14 Atsushi Enomoto - - * AssociatedMetadataTypeTypeDescriptionProvider.cs - DataType.cs - DataTypeAttribute.cs - DisplayColumnAttribute.cs - DisplayFormatAttribute.cs - MetadataTypeAttribute.cs - RangeAttribute.cs - RegularExpressionAttribute.cs - RequiredAttribute.cs - ScaffoldColumnAttribute.cs - ScaffoldTableAttribute.cs - StringLengthAttribute.cs - UIHintAttribute.cs - ValidationAttribute.cs - ValidationException.cs: initial checkin. mostly stubs. diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CompareAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CompareAttribute.cs deleted file mode 100644 index afec3c9a089..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CompareAttribute.cs +++ /dev/null @@ -1,118 +0,0 @@ -// -// CompareAttribute.cs -// -// Authors: -// Pablo Ruiz García -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Linq; -using System.Globalization; -using System.ComponentModel; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class CompareAttribute : ValidationAttribute - { - private const string DefaultErrorMessage = "'{0}' and '{1}' do not match."; - private const string NonExistingPropertyErrorMessage = "Could not find a property named {0}."; - private string _otherProperty; - private string _otherPropertyDisplayName; - - public CompareAttribute (string otherProperty) - : base (() => DefaultErrorMessage) - { - if (string.IsNullOrEmpty (otherProperty)) - throw new ArgumentNullException ("otherProperty"); - - _otherProperty = otherProperty; - } - - public string OtherProperty { get { return _otherProperty; } } - public string OtherPropertyDisplayName { get { return _otherPropertyDisplayName; } } - public override bool RequiresValidationContext { get { return true; } } - - private IEnumerable GetPropertyAttributes (Type type, string propertyName) - { -#if MOBILE - return TypeDescriptor.GetProperties (type).Find (propertyName, false).Attributes.OfType (); -#else - // Using AMTTDP seems the way to go to be able to relay on attributes declared - // by means of associated classes not directly decorating the property. - // See: http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.associatedmetadatatypetypedescriptionprovider.aspx - return new AssociatedMetadataTypeTypeDescriptionProvider (type) - .GetTypeDescriptor (type) - .GetProperties () - .Find (propertyName, false) - .Attributes.OfType (); -#endif - } - - private void ResolveOtherPropertyDisplayName (ValidationContext context) - { - if (_otherPropertyDisplayName == null) - { - // NOTE: From my own tests, it seems MS.NET looksup displayName from various sources, what follows - // is a best guess from my on tests, however, I am probably missing some corner cases. (pruiz) - var attributes = GetPropertyAttributes (context.ObjectType, _otherProperty); - var displayAttr = attributes.FirstOrDefault (x => x is DisplayAttribute) as DisplayAttribute; - var displayNameAttr = attributes.FirstOrDefault (x => x is DisplayNameAttribute) as DisplayNameAttribute; - - if (displayAttr != null) _otherPropertyDisplayName = displayAttr.GetName (); - else if (displayNameAttr != null) _otherPropertyDisplayName = displayNameAttr.DisplayName; - _otherPropertyDisplayName = _otherProperty; - } - } - - public override string FormatErrorMessage (string name) - { - var oname = string.IsNullOrEmpty (_otherPropertyDisplayName) ? _otherProperty : _otherPropertyDisplayName; - return string.Format (ErrorMessageString, name, oname); - } - - protected override ValidationResult IsValid(object value, ValidationContext context) - { - var property = context.ObjectType.GetProperty (_otherProperty); - - if (property == null) { - string message = string.Format (NonExistingPropertyErrorMessage, _otherProperty); - return new ValidationResult (message); - } - - // XXX: Could not find a better place to call this, as this is - // the only place we have access to a ValidationContext. (pruiz) - ResolveOtherPropertyDisplayName (context); - - return object.Equals (property.GetValue (context.ObjectInstance, null), value) ? null - : new ValidationResult (FormatErrorMessage (context.DisplayName)); - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ConcurrencyCheckAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ConcurrencyCheckAttribute.cs deleted file mode 100644 index 6d5cdc72435..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ConcurrencyCheckAttribute.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// ConcurrencyCheckAttribute.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class ConcurrencyCheckAttribute : Attribute - { - public ConcurrencyCheckAttribute () - { - } - } -} -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ControlParameters.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ControlParameters.cs deleted file mode 100644 index 98f7c5a81dc..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ControlParameters.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// ControlParameters.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace System.ComponentModel.DataAnnotations -{ - sealed class ControlParameters : IEquatable - { - Dictionary dictionary; - readonly object[] parameters; - - public ControlParameters (object[] parameters) - { - this.parameters = parameters; - } - - public Dictionary Dictionary { - get { - return dictionary ?? (dictionary = CreateDictionary ()); - } - } - - public bool Equals (ControlParameters other) - { - if (parameters == null || other.parameters == null) - return ReferenceEquals (parameters, other.parameters); - - if (parameters.Length != other.parameters.Length) - return false; - - try { - return Dictionary.OrderBy (l => l.Key).SequenceEqual (other.Dictionary.OrderBy (l => l.Key)); - } catch (InvalidOperationException) { - return false; - } - } - - Dictionary CreateDictionary () - { - if (parameters == null || parameters.Length == 0) { - return new Dictionary (0); - } - - if (parameters.Length % 2 != 0) - throw new InvalidOperationException (); - - var dict = new Dictionary (); - for (int i = 0; i < parameters.Length; ) { - var key = parameters [i++] as string; - if (key == null) - throw new InvalidOperationException (); - - try { - dict.Add (key, parameters[i++]); - } catch (System.ArgumentException) { - throw new InvalidOperationException (); - } - } - - return dict; - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs deleted file mode 100644 index 66fdc90759c..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// CreditCardAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Linq; -using System.Globalization; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class CreditCardAttribute : DataTypeAttribute - { - private const string DefaultErrorMessage = "The {0} field is not a valid credit card number."; - - public CreditCardAttribute () - : base(DataType.CreditCard) - { - // XXX: There is no .ctor accepting Func on DataTypeAttribute.. :? - base.ErrorMessage = DefaultErrorMessage; - } - - public override bool IsValid(object value) - { - if (value == null) - return true; - - if (string.IsNullOrEmpty(value as string)) - return false; - - // Remove any invalid characters.. - var creditCardNumber = (value as string).Replace("-", "").Replace(" ", ""); - - if (creditCardNumber.Any (x => !Char.IsDigit (x))) - return false; - - // Performan a Luhn-based check against credit card number. - // - // See: http://en.wikipedia.org/wiki/Luhn_algorithm - // See: http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers - - return true; - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CustomValidationAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CustomValidationAttribute.cs deleted file mode 100644 index 618dd881891..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CustomValidationAttribute.cs +++ /dev/null @@ -1,141 +0,0 @@ -// -// CustomValidationAttribute.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010-2011 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; -using System.Reflection; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = true)] - public sealed class CustomValidationAttribute : ValidationAttribute - { - Tuple typeId; - MethodInfo validationMethod; - bool validationMethodChecked; - bool validationMethodSignatureValid; - int validationMethodParamCount; - - public string Method { get; private set; } - - public override object TypeId { - get { return typeId; } - } - - public Type ValidatorType { get; private set; } - - public CustomValidationAttribute (Type validatorType, string method) - { - this.ValidatorType = validatorType; - this.Method = method; - this.typeId = new Tuple (method, validatorType); - } - - public override string FormatErrorMessage (string name) - { - ThrowIfAttributeNotWellFormed (); - return String.Format ("{0} is not valid.", name); - } - - // LAMESPEC: MSDN doesn't document it at all, but corcompare shows it in the type - protected override ValidationResult IsValid (object value, ValidationContext validationContext) - { - ThrowIfAttributeNotWellFormed (); - object[] p; - - if (validationMethodParamCount == 2) - p = new object [] {value, validationContext}; - else - p = new object [] {value}; - try { - return validationMethod.Invoke (null, p) as ValidationResult; - } catch (TargetInvocationException ex) { - if (ex.InnerException != null) - throw ex.InnerException; - throw; - } - } - - void ThrowIfAttributeNotWellFormed () - { - Type type = ValidatorType; - if (type == null) - throw new InvalidOperationException ("The CustomValidationAttribute.ValidatorType was not specified."); - - if (type.IsNotPublic) - throw new InvalidOperationException (String.Format ("The custom validation type '{0}' must be public.", type.Name)); - - string method = Method; - if (String.IsNullOrEmpty (method)) - throw new InvalidOperationException ("The CustomValidationAttribute.Method was not specified."); - - if (validationMethod == null) { - if (!validationMethodChecked) { - validationMethod = type.GetMethod (method, BindingFlags.Public | BindingFlags.Static); - validationMethodChecked = true; - } - - if (validationMethod == null) - throw new InvalidOperationException ( - String.Format ("The CustomValidationAttribute method '{0}' does not exist in type '{1}' or is not public and static.", - method, type.Name)); - - if (!typeof (ValidationResult).IsAssignableFrom (validationMethod.ReturnType)) - throw new InvalidOperationException (String.Format ("The CustomValidationAttribute method '{0}' in type '{1}' must return System.ComponentModel.DataAnnotations.ValidationResult. Use System.ComponentModel.DataAnnotations.ValidationResult.Success to represent success.", method, type.Name)); - - validationMethodSignatureValid = true; - ParameterInfo[] parameters = validationMethod.GetParameters (); - if (parameters == null) - validationMethodSignatureValid = false; - else { - validationMethodParamCount = parameters.Length; - switch (validationMethodParamCount) { - case 1: - break; - - case 2: - if (parameters [1].ParameterType != typeof (ValidationContext)) - validationMethodSignatureValid = false; - break; - - default: - validationMethodSignatureValid = false; - break; - } - } - } - - if (!validationMethodSignatureValid) - throw new InvalidOperationException (String.Format ("The CustomValidationAttribute method '{0}' in type '{1}' must match the expected signature: public static ValidationResult MethodTwo(object value, ValidationContext context). The value can be strongly typed. The ValidationContext parameter is optional.", method, type.Name)); - - } - } -} -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataType.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataType.cs deleted file mode 100644 index 5ad56e74984..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// DataType.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008-2011 Novell Inc. http://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.ComponentModel.DataAnnotations -{ - public enum DataType - { - Custom, - DateTime, - Date, - Time, - Duration, - PhoneNumber, - Currency, - Text, - Html, - MultilineText, - EmailAddress, - Password, - Url, -#if NET_4_0 - ImageUrl, -#endif -#if NET_4_5 - CreditCard, - PostalCode, - Upload -#endif - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataTypeAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataTypeAttribute.cs deleted file mode 100644 index 3a373db8545..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataTypeAttribute.cs +++ /dev/null @@ -1,109 +0,0 @@ -// -// DataTypeAttribute.cs -// -// Author: -// Atsushi Enomoto -// Pablo Ruiz García -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// Copyright (C) 2013 Pablo Ruiz García -// -// 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.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ -#if NET_4_0 - [AttributeUsage (AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false)] -#else - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#endif - public class DataTypeAttribute : ValidationAttribute - { - public DataTypeAttribute (DataType dataType) - { - DataType = dataType; - - DisplayFormatAttribute displayFormat; - switch (dataType) { - case DataType.Time: - displayFormat = new DisplayFormatAttribute (); - displayFormat.ApplyFormatInEditMode = true; - displayFormat.ConvertEmptyStringToNull = true; - displayFormat.DataFormatString = "{0:t}"; -#if NET_4_0 - displayFormat.HtmlEncode = true; -#endif - break; - case DataType.Date: - displayFormat = new DisplayFormatAttribute (); - displayFormat.ApplyFormatInEditMode = true; - displayFormat.ConvertEmptyStringToNull = true; - displayFormat.DataFormatString = "{0:d}"; -#if NET_4_0 - displayFormat.HtmlEncode = true; -#endif - break; - case DataType.Currency: - displayFormat = new DisplayFormatAttribute (); - displayFormat.ApplyFormatInEditMode = false; - displayFormat.ConvertEmptyStringToNull = true; - displayFormat.DataFormatString = "{0:C}"; -#if NET_4_0 - displayFormat.HtmlEncode = true; -#endif - break; - - default: - displayFormat = null; - break; - } - - DisplayFormat = displayFormat; - } - - public DataTypeAttribute (string customDataType) - { - CustomDataType = customDataType; - } - - public string CustomDataType { get; private set; } - public DataType DataType { get; private set; } - public DisplayFormatAttribute DisplayFormat { get; protected set; } - - public virtual string GetDataTypeName () - { - DataType dt = DataType; - if (dt == DataType.Custom) - return CustomDataType; - - return dt.ToString (); - } - - public override bool IsValid (object value) - { - // Returns alwasy true - // See: http://msdn.microsoft.com/en-us/library/cc679235.aspx - return true; - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayAttribute.cs deleted file mode 100644 index ffdd5bdad7f..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayAttribute.cs +++ /dev/null @@ -1,160 +0,0 @@ -// -// DisplayAttribute.cs -// -// Author: -// David Stone -// -// Copyright (C) 2010 David Stone -// -// -// 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.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ -#if NET_4_0 - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple = false)] - public sealed class DisplayAttribute : Attribute - { - public Type ResourceType { get; set; } - - public string Description { get; set; } - public string GroupName { get; set; } - public string Name { get; set; } - public string ShortName { get; set; } - public string Prompt { get; set; } - - const string property_not_set_message = "The {0} property has not been set. Use the Get{0} method to get the value."; - const string localization_failed_message = "Cannot retrieve property '{0}' because localization failed. Type '{1} is not public or does not contain a public static string property with the name '{2}'."; - - bool? _autoGenerateField; - public bool AutoGenerateField { - get { - if (!_autoGenerateField.HasValue) { - throw new InvalidOperationException (string.Format (property_not_set_message, "AutoGenerateField")); - } - - return _autoGenerateField.Value; - } - set { _autoGenerateField = value; } - } - - bool? _autoGenerateFilter; - public bool AutoGenerateFilter { - get { - if (_autoGenerateFilter == null) { - throw new InvalidOperationException (string.Format (property_not_set_message, "AutoGenerateFilter")); - } - - return _autoGenerateFilter.Value; - } - set { _autoGenerateFilter = value; } - } - - int? _order; - public int Order { - get { - if (_order == null) - throw new InvalidOperationException (string.Format (property_not_set_message, "Order")); - - return _order.Value; - } - set { _order = value; } - } - - private string GetLocalizedString (string propertyName, string key) - { - // If we don't have a resource or a key, go ahead and fall back on the key - if (ResourceType == null || key == null) - return key; - - var property = ResourceType.GetProperty (key); - - // Strings are only valid if they are public static strings - var isValid = false; - if (ResourceType.IsVisible && property != null && property.PropertyType == typeof(string)) { - var getter = property.GetGetMethod (); - - // Gotta have a public static getter on the property - if (getter != null && getter.IsStatic && getter.IsPublic) { - isValid = true; - } - } - - // If it's not valid, go ahead and throw an InvalidOperationException - if (!isValid) { - var message = string.Format (localization_failed_message, propertyName, ResourceType.ToString (), key); - throw new InvalidOperationException (message); - } - - return (string)property.GetValue (null, null); - - } - - #region Consumer Methods - public bool? GetAutoGenerateField () - { - return _autoGenerateField; - } - - public bool? GetAutoGenerateFilter () - { - return _autoGenerateFilter; - } - - public int? GetOrder () - { - return _order; - } - - public string GetName () - { - return GetLocalizedString ("Name", Name); - } - - public string GetShortName () - { - // Short name falls back on Name if the short name isn't set - return GetLocalizedString ("ShortName", ShortName) ?? GetName (); - } - - public string GetDescription () - { - return GetLocalizedString ("Description", Description); - } - - public string GetPrompt () - { - return GetLocalizedString ("Prompt", Prompt); - } - - public string GetGroupName () - { - return GetLocalizedString ("GroupName", GroupName); - } - - #endregion - - } -#endif -} - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayColumnAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayColumnAttribute.cs deleted file mode 100644 index 301ee94cd18..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayColumnAttribute.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// DisplayColumnAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://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.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Class, Inherited = true, AllowMultiple = false)] - public class DisplayColumnAttribute : Attribute - { - public DisplayColumnAttribute (string displayColumn) - : this (displayColumn, null) - { - } - - public DisplayColumnAttribute (string displayColumn, string sortColumn) - : this (displayColumn, sortColumn, false) - { - } - - public DisplayColumnAttribute (string displayColumn, string sortColumn, bool sortDescending) - { - DisplayColumn = displayColumn; - SortColumn = sortColumn; - SortDescending = sortDescending; - } - - public string DisplayColumn { get; private set; } - public string SortColumn { get; private set; } - public bool SortDescending { get; private set; } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.cs deleted file mode 100644 index 4c48a83d2f0..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// DisplayFormatAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://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.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] - public class DisplayFormatAttribute : Attribute - { - public bool ApplyFormatInEditMode { get; set; } - public bool ConvertEmptyStringToNull { get; set; } - public string DataFormatString { get; set; } - public string NullDisplayText { get; set; } -#if NET_4_0 - public bool HtmlEncode { get; set; } -#endif - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EditableAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EditableAttribute.cs deleted file mode 100644 index abfba998c24..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EditableAttribute.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// EditableAttribute.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class EditableAttribute : Attribute - { - public bool AllowEdit { get; private set; } - public bool AllowInitialValue { get; set; } - - public EditableAttribute (bool allowEdit) - { - this.AllowEdit = allowEdit; - } - } -} -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs deleted file mode 100644 index 5d79b926c19..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs +++ /dev/null @@ -1,313 +0,0 @@ -// -// EmailAddressAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Globalization; -using System.Text.RegularExpressions; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class EmailAddressAttribute : DataTypeAttribute - { - private const string DefaultErrorMessage = "The {0} field is not a valid e-mail address."; - const string AtomCharacters = "!#$%&'*+-/=?^_`{|}~"; - - static bool IsLetterOrDigit (char c) - { - return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'); - } - - static bool IsAtom (char c) - { - return IsLetterOrDigit (c) || AtomCharacters.IndexOf (c) != -1; - } - - static bool IsDomain (char c) - { - return IsLetterOrDigit (c) || c == '-'; - } - - static bool SkipAtom (string text, ref int index) - { - int startIndex = index; - - while (index < text.Length && IsAtom (text[index])) - index++; - - return index > startIndex; - } - - static bool SkipSubDomain (string text, ref int index) - { - if (!IsDomain (text[index]) || text[index] == '-') - return false; - - index++; - - while (index < text.Length && IsDomain (text[index])) - index++; - - return true; - } - - static bool SkipDomain (string text, ref int index) - { - if (!SkipSubDomain (text, ref index)) - return false; - - while (index < text.Length && text[index] == '.') { - index++; - - if (index == text.Length) - return false; - - if (!SkipSubDomain (text, ref index)) - return false; - } - - return true; - } - - static bool SkipQuoted (string text, ref int index) - { - bool escaped = false; - - // skip over leading '"' - index++; - - while (index < text.Length) { - if (text[index] == (byte) '\\') { - escaped = !escaped; - } else if (!escaped) { - if (text[index] == (byte) '"') - break; - } else { - escaped = false; - } - - index++; - } - - if (index >= text.Length || text[index] != (byte) '"') - return false; - - index++; - - return true; - } - - static bool SkipWord (string text, ref int index) - { - if (text[index] == (byte) '"') - return SkipQuoted (text, ref index); - - return SkipAtom (text, ref index); - } - - static bool SkipIPv4Literal (string text, ref int index) - { - int groups = 0; - - while (index < text.Length && groups < 4) { - int startIndex = index; - int value = 0; - - while (index < text.Length && text[index] >= '0' && text[index] <= '9') { - value = (value * 10) + (text[index] - '0'); - index++; - } - - if (index == startIndex || index - startIndex > 3 || value > 255) - return false; - - groups++; - - if (groups < 4 && index < text.Length && text[index] == '.') - index++; - } - - return groups == 4; - } - - static bool IsHexDigit (char c) - { - return (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f') || (c >= '0' && c <= '9'); - } - - // This needs to handle the following forms: - // - // IPv6-addr = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp - // IPv6-hex = 1*4HEXDIG - // IPv6-full = IPv6-hex 7(":" IPv6-hex) - // IPv6-comp = [IPv6-hex *5(":" IPv6-hex)] "::" [IPv6-hex *5(":" IPv6-hex)] - // ; The "::" represents at least 2 16-bit groups of zeros - // ; No more than 6 groups in addition to the "::" may be - // ; present - // IPv6v4-full = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal - // IPv6v4-comp = [IPv6-hex *3(":" IPv6-hex)] "::" - // [IPv6-hex *3(":" IPv6-hex) ":"] IPv4-address-literal - // ; The "::" represents at least 2 16-bit groups of zeros - // ; No more than 4 groups in addition to the "::" and - // ; IPv4-address-literal may be present - static bool SkipIPv6Literal (string text, ref int index) - { - bool compact = false; - int colons = 0; - - while (index < text.Length) { - int startIndex = index; - - while (index < text.Length && IsHexDigit (text[index])) - index++; - - if (index >= text.Length) - break; - - if (index > startIndex && colons > 2 && text[index] == '.') { - // IPv6v4 - index = startIndex; - - if (!SkipIPv4Literal (text, ref index)) - return false; - - break; - } - - int count = index - startIndex; - if (count > 4) - return false; - - if (text[index] != ':') - break; - - startIndex = index; - while (index < text.Length && text[index] == ':') - index++; - - count = index - startIndex; - if (count > 2) - return false; - - if (count == 2) { - if (compact) - return false; - - compact = true; - colons += 2; - } else { - colons++; - } - } - - if (colons < 2) - return false; - - if (compact) - return colons < 6; - - return colons < 7; - } - - static bool Validate (string email) - { - int index = 0; - - if (email.Length == 0) - return false; - - if (!SkipWord (email, ref index) || index >= email.Length) - return false; - - while (index < email.Length && email[index] == '.') { - index++; - - if (!SkipWord (email, ref index) || index >= email.Length) - return false; - } - - if (index + 1 >= email.Length || email[index++] != '@') - return false; - - if (email[index] != '[') { - // domain - if (!SkipDomain (email, ref index)) - return false; - - return index == email.Length; - } - - // address literal - index++; - - // we need at least 8 more characters - if (index + 8 >= email.Length) - return false; - - var ipv6 = email.Substring (index, 5); - if (ipv6.ToLowerInvariant () == "ipv6:") { - index += "IPv6:".Length; - if (!SkipIPv6Literal (email, ref index)) - return false; - } else { - if (!SkipIPv4Literal (email, ref index)) - return false; - } - - if (index >= email.Length || email[index++] != ']') - return false; - - return index == email.Length; - } - - public EmailAddressAttribute () - : base(DataType.EmailAddress) - { - // XXX: There is no .ctor accepting Func on DataTypeAttribute.. :? - base.ErrorMessage = DefaultErrorMessage; - } - - public override bool IsValid(object value) - { - if (value == null) - return true; - - string email = value as string; - if (email == null) - return false; - - return Validate (email); - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EnumDataTypeAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EnumDataTypeAttribute.cs deleted file mode 100644 index a0efa1e846d..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EnumDataTypeAttribute.cs +++ /dev/null @@ -1,117 +0,0 @@ -// -// EnumDataTypeAttribute.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Globalization; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public sealed class EnumDataTypeAttribute : DataTypeAttribute - { - public Type EnumType { get; private set; } - - public EnumDataTypeAttribute (Type enumType) - : base (DataType.Custom) - { - this.EnumType = enumType; - } - - public override bool IsValid (object value) - { - Type type = EnumType; - - if (!type.IsEnum) - throw new InvalidOperationException ( - String.Format ("The type '{0}' needs to represent an enumeration type.", type.FullName) - ); - - if (value == null) - return true; - - Type valueType = value.GetType (); - if (valueType.IsEnum && valueType != type) - return false; - - string s = value as string; - if (s != null && s.Length == 0) - return true; - - if (s != null && (valueType == typeof (bool) || valueType == typeof (char) || valueType == typeof (float))) - return false; - - object o; - - if (s != null) { - try { - o = Enum.Parse (type, s); - } catch { - return false; - } - } else if (valueType.IsEnum) - o = value; - else { - try { - o = Enum.ToObject (type, value); - } catch { - return false; - } - } - - object[] attrs = type.GetCustomAttributes (typeof (FlagsAttribute), true); - if (attrs != null && attrs.Length > 0) { - string sval = Convert.ChangeType (o, Enum.GetUnderlyingType (type), CultureInfo.InvariantCulture).ToString (); - - // This looks weird, but what happens here is that if we have a - // mismatch, the above type change will make sval equal o.ToString - // () and if we have a match, then sval will be string - // representation of the enum member's value. So, if we have an - // enum: - // - // [Flags] - // enum Test - // { - // One = 1, - // Two = 2 - // } - // - // And the passed value was 3, then o.ToString () == "One, Two" and - // sval == "3". If the passed value was 33, though, o.ToString () == - // "33" and sval == "33" - thus we DON'T have a match. - return !sval.Equals (o.ToString ()); - } - - return Enum.IsDefined (type, o); - } - } -} -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FileExtensionsAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FileExtensionsAttribute.cs deleted file mode 100644 index de9c384d64a..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FileExtensionsAttribute.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// FileExtensionAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Linq; -using System.Globalization; -using System.Text.RegularExpressions; - -namespace System.ComponentModel.DataAnnotations -{ - // See: http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.fileextensionsattribute.aspx - - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class FileExtensionsAttribute : DataTypeAttribute - { - private const string DefaultErrorMessage = "The {0} field only accepts files with the following extensions: {1}."; - private const string DefaultExtensions = "png,jpg,jpeg,gif"; - - public FileExtensionsAttribute () - : base (DataType.Upload) - { - // XXX: There is no .ctor accepting Func on DataTypeAttribute.. :? - base.ErrorMessage = DefaultErrorMessage; - this.Extensions = DefaultExtensions; - } - - public string Extensions { get; set; } - - private string[] GetExtensionList () - { - return (Extensions ?? "").Split (','); - } - - private string GetExtension (string filename) - { - var parts = filename.Split ('.'); - return parts.Length > 0 ? parts [parts.Length - 1] : ""; - } - - public override string FormatErrorMessage (string name) - { - var extensions = GetExtensionList().Aggregate ((cur, next) => cur + ", " + next); - return string.Format (ErrorMessageString, name, extensions); - } - - public override bool IsValid(object value) - { - if (value == null) - return true; - - if (value is string) - { - var str = value as string; - var ext = GetExtension (str); - return GetExtensionList ().Any (x => string.Equals (x, ext, StringComparison.InvariantCultureIgnoreCase)); - } - - return false; - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FilterUIHintAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FilterUIHintAttribute.cs deleted file mode 100644 index 870e4092d86..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FilterUIHintAttribute.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// FilterUIHintAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_0 - -using System.Runtime.CompilerServices; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] - public sealed class FilterUIHintAttribute : Attribute - { - readonly ControlParameters controlParameters; - - public FilterUIHintAttribute (string filterUIHint) - : this (filterUIHint, null, null) - { - } - - public FilterUIHintAttribute (string filterUIHint, string presentationLayer) - : this (filterUIHint, presentationLayer, null) - { - } - - public FilterUIHintAttribute (string filterUIHint, string presentationLayer, params object[] controlParameters) - { - FilterUIHint = filterUIHint; - PresentationLayer = presentationLayer; - this.controlParameters = new ControlParameters (controlParameters); - } - - public IDictionary ControlParameters { - get { - return controlParameters.Dictionary; - } - } - - public string FilterUIHint { get; private set; } - - public string PresentationLayer { get; private set; } - - public override object TypeId { - get { - return this; - } - } - - public override int GetHashCode () - { - return RuntimeHelpers.GetHashCode (FilterUIHint) ^ - RuntimeHelpers.GetHashCode (PresentationLayer); - } - - public override bool Equals (object obj) - { - var fha = obj as FilterUIHintAttribute; - if (fha == null) - return false; - - return fha.FilterUIHint == FilterUIHint && - fha.PresentationLayer == PresentationLayer && - fha.controlParameters.Equals (controlParameters); - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/IValidatableObject.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/IValidatableObject.cs deleted file mode 100644 index cf68fc3669c..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/IValidatableObject.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// IValidatableObject.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - public interface IValidatableObject - { - IEnumerable Validate (ValidationContext validationContext); - } -} -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/KeyAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/KeyAttribute.cs deleted file mode 100644 index 37cde191cc3..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/KeyAttribute.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// KeyAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_0 - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class KeyAttribute : Attribute - { - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MaxLengthAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MaxLengthAttribute.cs deleted file mode 100644 index 84fab2a3a63..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MaxLengthAttribute.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// MaxLengthAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Globalization; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class MaxLengthAttribute : ValidationAttribute - { - private const string DefaultErrorMessage = "The field {0} must be a string or array type with a maximum length of '{1}'."; - private const string InvalidLengthErrorMessage = "MaxLengthAttribute must have a Length value that is greater than zero. " + - "Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length."; - private bool _maxLength = true; - - public MaxLengthAttribute () - : base (() => DefaultErrorMessage) - { - } - - public MaxLengthAttribute (int length) - : this () - { - Length = length; - _maxLength = false; - } - - public int Length { get; private set; } - - public override string FormatErrorMessage (string name) - { - return string.Format (ErrorMessageString, name, Length); - } - - public override bool IsValid (object value) - { - // See: http://msdn.microsoft.com/en-us/library/gg696614.aspx - - if (this.Length == 0 || this.Length < -1) - throw new InvalidOperationException (InvalidLengthErrorMessage); - - // Weird, but using 'MaxLength' with no length seems to be valid - // and we should be returning true, and not throwing. (pablo) - if (value != null && !_maxLength) { - - if (value is string) { - return (value as string).Length <= this.Length; - } - - if (value is Array) { - return (value as Array).Length <= this.Length; - } - - // NOTE: from my tests, MS.NET does not support IEnumerable as value. :( - } - - return true; - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MetadataTypeAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MetadataTypeAttribute.cs deleted file mode 100644 index 4fdae6c4c2a..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MetadataTypeAttribute.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// MetadataTypeAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://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.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Class, AllowMultiple = false)] - public sealed class MetadataTypeAttribute : Attribute - { - public MetadataTypeAttribute (Type metadataClassType) - { - MetadataClassType = metadataClassType; - } - - public Type MetadataClassType { get; private set; } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MinLengthAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MinLengthAttribute.cs deleted file mode 100644 index ff30f7646d3..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MinLengthAttribute.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -// MinLengthAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Globalization; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class MinLengthAttribute : ValidationAttribute - { - private const string DefaultErrorMessage = "The field {0} must be a string or array type with a minimum length of '{1}'."; - private const string InvalidLengthErrorMessage = "MinLengthAttribute must have a Length value that is zero or greater."; - - public MinLengthAttribute () - { - } - - public MinLengthAttribute (int length) - { - Length = length; - } - - public int Length { get; private set; } - - public override string FormatErrorMessage (string name) - { - return string.Format (ErrorMessageString, name, Length); - } - - public override bool IsValid (object value) - { - if (this.Length < 0) - throw new InvalidOperationException (InvalidLengthErrorMessage); - - if (value != null) { - - if (value is string) { - return (value as string).Length >= this.Length; - } - - if (value is Array) { - return (value as Array).Length >= this.Length; - } - - // NOTE: from my tests, MS.NET does not support IEnumerable as value. :( - } - - return true; - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/PhoneAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/PhoneAttribute.cs deleted file mode 100644 index 58cec3b6a4c..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/PhoneAttribute.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// PhoneAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Globalization; -using System.Text.RegularExpressions; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class PhoneAttribute : DataTypeAttribute - { - private const string DefaultErrorMessage = "The {0} field is not a valid phone number."; - private const string _regexStr = @"^\+?(\d[\d-. ]+)?(\([\d-. ]+\))?[\d-. ]+\d$"; - private static Regex _regex = new Regex (_regexStr, RegexOptions.IgnoreCase | RegexOptions.Compiled); - - public PhoneAttribute () - : base(DataType.PhoneNumber) - { - // XXX: There is no .ctor accepting Func on DataTypeAttribute.. :? - base.ErrorMessage = DefaultErrorMessage; - } - - public override bool IsValid(object value) - { - if (value == null) - return true; - - if (value is string) - { - var str = value as string; - return !string.IsNullOrEmpty(str) ? _regex.IsMatch(str) : false; - } - - return false; - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RangeAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RangeAttribute.cs deleted file mode 100644 index 9bf52669df9..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RangeAttribute.cs +++ /dev/null @@ -1,191 +0,0 @@ -// -// RangeAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://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.Globalization; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ -#if NET_4_0 - [AttributeUsage (AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] -#else - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#endif - public class RangeAttribute : ValidationAttribute - { - Func comparer; - TypeConverter cvt; - - public object Maximum { get; private set; } - public object Minimum { get; private set; } - public Type OperandType { get; private set; } - - IComparable MaximumComparable { - get { return Maximum as IComparable; } - } - - IComparable MinimumComparable { - get { return Minimum as IComparable; } - } - - RangeAttribute () - : base (GetDefaultErrorMessage) - { - } - - public RangeAttribute (double minimum, double maximum) : this () - { - Minimum = minimum; - Maximum = maximum; - OperandType = typeof (double); - } - - public RangeAttribute (int minimum, int maximum) : this () - { - Minimum = minimum; - Maximum = maximum; - OperandType = typeof (int); - } - - public RangeAttribute (Type type, string minimum, string maximum) : this () - { -#if !NET_4_0 - if (type == null) - throw new ArgumentNullException ("type"); -#endif - OperandType = type; - Minimum = minimum; - Maximum = maximum; -#if !NET_4_0 - comparer = SetupComparer (); -#endif - } - - static string GetDefaultErrorMessage () - { - return "The field {0} must be between {1} and {2}."; - } - - public override string FormatErrorMessage (string name) - { - if (comparer == null) - comparer = SetupComparer (); - - return String.Format (ErrorMessageString, name, Minimum, Maximum); - } - - // LAMESPEC: does not throw ValidationException when value is out of range - public override bool IsValid (object value) - { - if (comparer == null) - comparer = SetupComparer (); - - if (value == null) - return true; - - string s = value as string; - if (s != null && s.Length == 0) - return true; - - try { - if (comparer != null) - return comparer (value); - - return false; - } catch (FormatException) { - return false; - } catch (InvalidCastException) { - return false; - } - } - - Func SetupComparer () - { - Type ot = OperandType; - - object min = Minimum, max = Maximum; -#if NET_4_0 - if (min == null || max == null) - throw new InvalidOperationException ("The minimum and maximum values must be set."); -#endif - if (min is int) - return new Func (CompareInt); - - if (min is double) - return new Func (CompareDouble); - - if (ot == null) - throw new InvalidOperationException ("The OperandType must be set when strings are used for minimum and maximum values."); - - if (!typeof(IComparable).IsAssignableFrom (ot)) { -#if NET_4_0 - string message = String.Format ("The type {0} must implement System.IComparable", ot.FullName); - throw new InvalidOperationException (message); -#else - throw new ArgumentException ("object"); -#endif - } - - string smin = min as string, smax = max as string; - cvt = TypeDescriptor.GetConverter (ot); - Minimum = cvt.ConvertFromString (smin); - Maximum = cvt.ConvertFromString (smax); - - return new Func (CompareArbitrary); - } - - bool CompareInt (object value) - { - int cv = Convert.ToInt32 (value); - - return MinimumComparable.CompareTo (cv) <= 0 && MaximumComparable.CompareTo (cv) >= 0; - } - - bool CompareDouble (object value) - { - double cv = Convert.ToDouble (value); - - return MinimumComparable.CompareTo (cv) <= 0 && MaximumComparable.CompareTo (cv) >= 0; - } - - bool CompareArbitrary (object value) - { - object cv; - if (value != null && value.GetType () == OperandType) - cv = value; - else if (cvt != null) - cv = cvt.ConvertFrom (value); - else - cv = null; - - return MinimumComparable.CompareTo (cv) <= 0 && MaximumComparable.CompareTo (cv) >= 0; - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.cs deleted file mode 100644 index d4d304171f5..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// RegularExpressionAttribute.cs -// -// Author: -// Atsushi Enomoto -// Antoine Cailliau -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// Copyright (C) 20011 Maximux Scris. http://maximux.net -// - -// -// 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.Globalization; -using System.ComponentModel; -using System.Text.RegularExpressions; - -namespace System.ComponentModel.DataAnnotations -{ - -#if NET_4_0 - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter, AllowMultiple = false)] -#else - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#endif - public class RegularExpressionAttribute : ValidationAttribute - { - public RegularExpressionAttribute (string pattern) - : base(GetDefaultErrorMessage) - { - if (pattern == null) - throw new ArgumentNullException("pattern"); - Pattern = pattern; - } - - public string Pattern { get; private set; } - - static string GetDefaultErrorMessage () - { - return "The field {0} must match the regular expression {1}."; - } - - public override string FormatErrorMessage (string name) - { - return string.Format (ErrorMessageString, name, Pattern); - } - - // LAMESPEC: does not throw ValidationException when value does not match the regular expression - public override bool IsValid (object value) - { - if (value == null) - return true; - - string str = (string) value; - Regex regex = new Regex(Pattern); - return regex.IsMatch(str); - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RequiredAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RequiredAttribute.cs deleted file mode 100644 index da77782eb29..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RequiredAttribute.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// RequiredAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008-2010 Novell Inc. http://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.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ -#if NET_4_0 - [AttributeUsage (AttributeTargets.Parameter|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#else - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#endif - public class RequiredAttribute : ValidationAttribute - { -#if NET_4_0 - public bool AllowEmptyStrings { get; set; } -#endif - - public override bool IsValid (object value) - { - if (value == null) - return false; - - string s = value as string; - if (s != null -#if NET_4_0 - && !AllowEmptyStrings -#endif - ) - return s.Length > 0; - - return true; - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldColumnAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldColumnAttribute.cs deleted file mode 100644 index c893658625f..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldColumnAttribute.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// RequiredAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://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.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] - public class ScaffoldColumnAttribute : Attribute - { - public ScaffoldColumnAttribute (bool scaffold) - { - Scaffold = scaffold; - } - - [MonoTODO] - public bool Scaffold { get; private set; } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldTableAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldTableAttribute.cs deleted file mode 100644 index 505f775ebdc..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldTableAttribute.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// RequiredAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://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.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Class, AllowMultiple = false)] - public class ScaffoldTableAttribute : Attribute - { - public ScaffoldTableAttribute (bool scaffold) - { - Scaffold = scaffold; - } - - [MonoTODO] - public bool Scaffold { get; private set; } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/StringLengthAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/StringLengthAttribute.cs deleted file mode 100644 index 20a59e74abc..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/StringLengthAttribute.cs +++ /dev/null @@ -1,99 +0,0 @@ -// -// StringLengthAttribute.cs -// -// Author: -// Atsushi Enomoto -// Marek Habersack -// -// Copyright (C) 2008-2010 Novell Inc. http://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.Globalization; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ -#if NET_4_0 - [AttributeUsage (AttributeTargets.Parameter|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#else - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#endif - public class StringLengthAttribute : ValidationAttribute - { - public int MaximumLength { get; private set; } -#if NET_4_0 - public int MinimumLength { get; set; } -#endif - public StringLengthAttribute (int maximumLength) - : base (GetDefaultErrorMessage) - { -#if !NET_4_0 - if (maximumLength < 0) - throw new ArgumentOutOfRangeException ("maximumLength", String.Format ("Actual value was {0}", maximumLength)); -#endif - MaximumLength = maximumLength; - } - - static string GetDefaultErrorMessage () - { - return "The field {0} must be a string with a maximum length of {1}."; - } - - public override string FormatErrorMessage (string name) - { -#if NET_4_0 - return String.Format (ErrorMessageString, name, MaximumLength, MinimumLength); -#else - return String.Format (ErrorMessageString, name, MaximumLength); -#endif - } - - public override bool IsValid (object value) - { - if (value == null) - return true; - - string str = (string)value; - int max = MaximumLength; -#if NET_4_0 - int min = MinimumLength; - - // LAMESPEC: documented to throw ArgumentOutOfRangeException - if (max < 0) - throw new InvalidOperationException ("The maximum length must be a nonnegative integer."); - - if (min > max) - throw new InvalidOperationException ( - String.Format ("The maximum value '{0}' must be greater than or equal to the minimum value '{1}'.", - max, min) - ); - - int len = str.Length; - return len <= max && len >= min; -#else - return str.Length <= max; -#endif - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/TimestampAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/TimestampAttribute.cs deleted file mode 100644 index 4d67b9c49b4..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/TimestampAttribute.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// TimestampAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_0 - -using System; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class TimestampAttribute : Attribute - { - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UIHintAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UIHintAttribute.cs deleted file mode 100644 index ec6e1159277..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UIHintAttribute.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -// UIHintAttribute.cs -// -// Authors: -// Atsushi Enomoto -// Marek Safar -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Runtime.CompilerServices; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = true)] - public class UIHintAttribute : Attribute - { - readonly ControlParameters controlParameters; - - public UIHintAttribute (string uiHint) - : this (uiHint, null) - { - } - - public UIHintAttribute (string uiHint, string presentationLayer) - : this (uiHint, presentationLayer, null) - { - } - - public UIHintAttribute (string uiHint, string presentationLayer, params object [] controlParameters) - { - UIHint = uiHint; - PresentationLayer = presentationLayer; - this.controlParameters = new ControlParameters (controlParameters); - } - - public IDictionary ControlParameters { - get { - return controlParameters.Dictionary; - } - } - - public string PresentationLayer { get; private set; } - - public string UIHint { get; private set; } - -#if NET_4_0 - public override object TypeId { - get { - return this; - } - } -#endif - - public override int GetHashCode () - { - return RuntimeHelpers.GetHashCode (UIHint) ^ - RuntimeHelpers.GetHashCode (PresentationLayer); - } - - public override bool Equals (object obj) - { - var ha = obj as UIHintAttribute; - if (ha == null) - return false; - - return ha.UIHint == UIHint && - ha.PresentationLayer == PresentationLayer && - ha.controlParameters.Equals (controlParameters); - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UrlAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UrlAttribute.cs deleted file mode 100644 index 4fa0dec8218..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UrlAttribute.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// UrlAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public sealed class UrlAttribute : DataTypeAttribute - { - public UrlAttribute () - : base (DataType.Url) - { - } - - public override bool IsValid (object value) - { - if (value == null) - return true; - - var s = value as string; - return s != null && Uri.IsWellFormedUriString (s, UriKind.Absolute); - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttribute.cs deleted file mode 100644 index d95ff90b3a5..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttribute.cs +++ /dev/null @@ -1,270 +0,0 @@ -// -// ValidationAttribute.cs -// -// Authors: -// Atsushi Enomoto -// Marek Habersack -// -// Copyright (C) 2008-2010 Novell Inc. http://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.ComponentModel; -using System.Reflection; -using System.Globalization; - -namespace System.ComponentModel.DataAnnotations -{ - public abstract class ValidationAttribute : Attribute - { - const string DEFAULT_ERROR_MESSAGE = "The field {0} is invalid."; -#if NET_4_0 - object nestedCallLock = new object (); - bool nestedCall; -#else - string errorMessageResourceName; - string errorMessageString; - Type errorMessageResourceType; -#endif - string errorMessage; - string fallbackErrorMessage; - Func errorMessageAccessor; - - protected ValidationAttribute () - { - } - - protected ValidationAttribute (Func errorMessageAccessor) - { - this.errorMessageAccessor = errorMessageAccessor; - } - - protected ValidationAttribute (string errorMessage) - { - fallbackErrorMessage = errorMessage; - } - - public virtual string FormatErrorMessage (string name) - { - string format = ErrorMessageString; - if (String.IsNullOrEmpty (format)) - return String.Empty; - - return String.Format (ErrorMessageString, name); - } -#if NET_4_0 - public string ErrorMessage { - get { return errorMessage; } - set { - errorMessage = value; - if (errorMessage != null) - errorMessageAccessor = null; - } - } - public string ErrorMessageResourceName { get; set; } - public Type ErrorMessageResourceType { get; set; } -#else - public string ErrorMessage { - get { return errorMessage; } - - set { -#if !NET_4_0 - if (errorMessage != null) - throw new InvalidOperationException ("This property can be set only once."); -#endif - if (String.IsNullOrEmpty (value)) - throw new ArgumentException ("Value cannot be null or empty.", "value"); - - if (errorMessageResourceName != null || errorMessageResourceType != null) - throw new InvalidOperationException ("This property cannot be set because the attribute is already in the resource mode."); - - errorMessage = value; - } - } - - public string ErrorMessageResourceName { - get { return errorMessageResourceName; } - - set { - if (errorMessageResourceName != null) - throw new InvalidOperationException ("This property can be set only once."); - - if (String.IsNullOrEmpty (value)) - throw new ArgumentException ("Value cannot be null or empty.", "value"); - - errorMessageResourceName = value; - if (errorMessageResourceType != null) - errorMessageString = GetStringFromResourceAccessor (); - } - } - - public Type ErrorMessageResourceType { - get { return errorMessageResourceType; } - set { - errorMessageResourceType = value; - if (!String.IsNullOrEmpty (errorMessageResourceName)) - errorMessageString = GetStringFromResourceAccessor (); - } - } -#endif - protected string ErrorMessageString { - get { return GetStringFromResourceAccessor (); } - } - -#if NET_4_5 - // See: http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.validationattribute.requiresvalidationcontext.aspx - public virtual bool RequiresValidationContext { get { return false; } } -#endif - -#if NET_4_0 - NotImplementedException NestedNIEX () - { - return new NotImplementedException ("IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context)."); - } - - // - // This is the weirdest (to be gentle) idea ever... The IsValid (object) overload - // throws the NIEX when it is called from the default IsValid (object, - // ValidationContext) overload, but not when directly. And the reverse situation is - // true as well. That means, the calls detect the "nested" calls and that we need to - // protect the nestedCall flag... ugh - // - public virtual bool IsValid (object value) - { - lock (nestedCallLock) { - if (nestedCall) - throw NestedNIEX (); - try { - nestedCall = true; - return IsValid (value, null) == ValidationResult.Success; - } finally { - nestedCall = false; - } - } - } - - protected virtual ValidationResult IsValid (object value, ValidationContext validationContext) - { - lock (nestedCallLock) { - if (nestedCall) - throw NestedNIEX (); - - try { - nestedCall = true; - if (!IsValid (value)) { - // .NET emulation - if (validationContext == null) - throw new NullReferenceException (".NET emulation."); - string memberName = validationContext.MemberName; - return new ValidationResult (FormatErrorMessage (validationContext.DisplayName), memberName != null ? new string[] { memberName } : new string[] {}); - } - } finally { - nestedCall = false; - } - } - - return ValidationResult.Success; - } -#else - public abstract bool IsValid (object value); -#endif - -#if NET_4_0 - public ValidationResult GetValidationResult (object value, ValidationContext validationContext) - { - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - ValidationResult ret = IsValid (value, validationContext); - if (ret != null && String.IsNullOrEmpty (ret.ErrorMessage)) - ret.ErrorMessage = FormatErrorMessage (validationContext.DisplayName); - - return ret; - } -#endif - string GetStringFromResourceAccessor () - { - string resourceName = ErrorMessageResourceName; - Type resourceType = ErrorMessageResourceType; - string errorMessage = ErrorMessage; - - if (resourceName != null && errorMessage != null) - throw new InvalidOperationException ("Either ErrorMessage or ErrorMessageResourceName must be set, but not both."); - - if (resourceType == null ^ resourceName == null) - throw new InvalidOperationException ("Both ErrorMessageResourceType and ErrorMessageResourceName must be set on this attribute."); - - - - if (resourceType != null) { - PropertyInfo pi = resourceType.GetProperty (resourceName, BindingFlags.Public | BindingFlags.Static); - if (pi == null || !pi.CanRead) - throw new InvalidOperationException ( - String.Format ("Resource type '{0}' does not have an accessible static property named '{1}'.", - resourceType, resourceName) - ); - - if (pi.PropertyType != typeof (string)) - throw new InvalidOperationException ( - String.Format ("The property '{0}' on resource type '{1}' is not a string type.", - resourceName, resourceType) - ); - - return pi.GetValue (null, null) as string; - } - - if (errorMessage == null) { - if (errorMessageAccessor != null) - return errorMessageAccessor (); - - if (fallbackErrorMessage != null) - return fallbackErrorMessage; - else - return DEFAULT_ERROR_MESSAGE; - } - - return errorMessage; - } -#if NET_4_0 - public void Validate (object value, ValidationContext validationContext) - { - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - ValidationResult result = IsValid (value, validationContext); - if (result != null) { - string message = result.ErrorMessage; - if (message == null) - message = FormatErrorMessage (validationContext.DisplayName); - - throw new ValidationException (message, this, value); - } - } -#endif - public void Validate (object value, string name) - { - if (!IsValid (value)) - throw new ValidationException (FormatErrorMessage (name), this, value); - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttributeCollectionExtensions.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttributeCollectionExtensions.cs deleted file mode 100644 index 9dec3195cb7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttributeCollectionExtensions.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2011 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Reflection; - -namespace System.ComponentModel.DataAnnotations -{ - static class ValidationAttributeCollectionExtensions - { - public static void Validate (this AttributeCollection attributes, object value, ValidationContext validationContext, - ICollection validationResults, ref bool valid) - where TAttribute: ValidationAttribute - { - if (attributes == null || attributes == AttributeCollection.Empty || attributes.Count <= 0) - return; - - ValidationResult result; - foreach (TAttribute attr in attributes.OfType ()) { - result = attr.GetValidationResult (value, validationContext); - if (result != ValidationResult.Success) { - valid = false; - if (validationResults != null) - validationResults.Add (result); - } - } - } - - public static void ValidateExcept (this AttributeCollection attributes, object value, ValidationContext validationContext, - ICollection validationResults, ref bool valid) - where TAttribute: ValidationAttribute - { - if (attributes == null || attributes == AttributeCollection.Empty || attributes.Count <= 0) - return; - - ValidationResult result; - ValidationAttribute vattr; - foreach (Attribute attr in attributes) { - if (attr is TAttribute) - continue; - vattr = attr as ValidationAttribute; - if (vattr == null) - continue; - - result = vattr.GetValidationResult (value, validationContext); - if (result != ValidationResult.Success) { - valid = false; - if (validationResults != null) - validationResults.Add (result); - } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationContext.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationContext.cs deleted file mode 100644 index f39c4a42324..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationContext.cs +++ /dev/null @@ -1,160 +0,0 @@ -// -// ValidationContext.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Collections.Generic; -using System.ComponentModel.Design; - -namespace System.ComponentModel.DataAnnotations -{ - public sealed class ValidationContext : IServiceProvider - { - public string DisplayName { get; set; } - public IDictionary Items { get; private set; } - public string MemberName { get; set; } - public object ObjectInstance { get; private set; } - public Type ObjectType { get; private set; } - public IServiceContainer ServiceContainer { get; private set; } - - public ValidationContext (object instance, IServiceProvider serviceProvider, IDictionary items) - { - if (instance == null) - throw new ArgumentNullException ("instance"); - - ObjectInstance = instance; - ObjectType = instance.GetType (); - if (items != null) - Items = new Dictionary (items); - else - Items = new Dictionary (); - - DisplayName = instance.GetType ().Name; - - // LAMESPEC: MSDN says vc.ServiceContainer should be initialized with the passed container if it implements - // the IServiceContainer interface - not the case, though. - // - // IServiceContainer container = serviceProvider as IServiceContainer; - // if (container != null) - // ServiceContainer = container; - // else - ServiceContainer = new ValidationContextServiceContainer (); - } - -#if NET_4_5 - public ValidationContext (object instance) - : this (instance, null, null) - { - } - - public ValidationContext (object instance, IDictionary items) - : this (instance, null, items) - { - } - - // FIXME: According to MSDN, this should be defined in - // 4.5, Silverlight and PCL - [MonoTODO] - public void InitializeServiceProvider ( - Func serviceProvider) - { - throw new NotImplementedException (); - } -#endif - - public object GetService (Type serviceType) - { - return ServiceContainer.GetService (serviceType); - } - - sealed class ValidationContextServiceContainer : IServiceContainer - { - Dictionary services = new Dictionary (); - - public void AddService (Type serviceType, ServiceCreatorCallback callback, bool promote) - { - AddService (serviceType, (object)callback, promote); - } - - public void AddService (Type serviceType, ServiceCreatorCallback callback) - { - AddService (serviceType, callback, false); - } - - public void AddService (Type serviceType, object serviceInstance, bool promote) - { - if (serviceType == null) - throw new ArgumentNullException ("serviceType"); - - if (services.ContainsKey (serviceType)) - throw new ArgumentException ( - String.Format ("A service of type '{0}' already exists in the container.", serviceType) - ); - - services.Add (serviceType, serviceInstance); - } - - public void AddService (Type serviceType, object serviceInstance) - { - AddService (serviceType, serviceInstance, false); - } - - public void RemoveService (Type serviceType, bool promote) - { - if (serviceType == null) - throw new ArgumentNullException ("serviceType"); - - if (!services.ContainsKey (serviceType)) - return; - - services.Remove (serviceType); - } - - public void RemoveService (Type serviceType) - { - RemoveService (serviceType, false); - } - - public object GetService (Type serviceType) - { - if (serviceType == null) - throw new ArgumentNullException ("serviceType"); - - object o; - if (!services.TryGetValue (serviceType, out o)) - return null; - - var cb = o as ServiceCreatorCallback; - if (cb != null) - return cb (this, serviceType); - - return o; - } - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationException.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationException.cs deleted file mode 100644 index f12507a52a5..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationException.cs +++ /dev/null @@ -1,84 +0,0 @@ -// -// ValidationException.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008-2011 Novell Inc. http://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.ComponentModel; -using System.Runtime.Serialization; -using System.Security.Permissions; - -namespace System.ComponentModel.DataAnnotations -{ - [Serializable] - public class ValidationException : Exception - { - public ValidationException () - { - } - public ValidationException (string message) - : base (message) - { - } - public ValidationException (string message, Exception innerException) - : base (message, innerException) - { - } - - public ValidationException (string errorMessage, ValidationAttribute validatingAttribute, object value) - : base (errorMessage) - { - ValidationAttribute = validatingAttribute; - Value = value; - } - - protected ValidationException (SerializationInfo info, StreamingContext context) - : base (info, context) - { - throw new NotImplementedException (); - } -#if NET_4_0 - public ValidationException (ValidationResult validationResult, ValidationAttribute validatingAttribute, object value) - : this (validationResult != null ? validationResult.ErrorMessage : null, validatingAttribute, value) - { - this.ValidationResult = validationResult; - } - - public ValidationResult ValidationResult { get; private set; } -#endif - public ValidationAttribute ValidationAttribute { get; private set; } - public object Value { get; private set; } - -#if !NET_4_5 - [SecurityPermission (SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - public override void GetObjectData (SerializationInfo info, StreamingContext context) - { - throw new NotImplementedException (); - } -#endif - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationResult.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationResult.cs deleted file mode 100644 index 50afd2182c1..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationResult.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// ValidationResult.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - public class ValidationResult - { - public static readonly ValidationResult Success = null; // it is supposed to be null - - public string ErrorMessage { get; set; } - public IEnumerable MemberNames { get; private set; } - - public ValidationResult (string errorMessage) - : this (errorMessage, new string[] {}) - - { - } - - protected ValidationResult (ValidationResult validationResult) - { - } - - public ValidationResult (string errorMessage, IEnumerable memberNames) - { - ErrorMessage = errorMessage; - if (memberNames != null) - MemberNames = memberNames; - else - MemberNames = new string[] {}; - } - -#if NET_4_5 - public override string ToString () - { - // See: http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.validationresult.tostring.aspx - if (!string.IsNullOrEmpty (ErrorMessage)) - return ErrorMessage; - - return base.ToString (); - } -#endif - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/Validator.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/Validator.cs deleted file mode 100644 index 18f98fe2bf7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/Validator.cs +++ /dev/null @@ -1,206 +0,0 @@ -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2011 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Reflection; - -namespace System.ComponentModel.DataAnnotations -{ - // TODO: we could probably use some kind of type cache here - public static class Validator - { - public static bool TryValidateObject (object instance, ValidationContext validationContext, ICollection validationResults) - { - return TryValidateObject (instance, validationContext, validationResults, false); - } - - public static bool TryValidateObject (object instance, ValidationContext validationContext, ICollection validationResults, bool validateAllProperties) - { - if (instance == null) - throw new ArgumentNullException ("instance"); - - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - if (!Object.ReferenceEquals (instance, validationContext.ObjectInstance)) - throw new ArgumentException ("The instance provided must match the ObjectInstance on the ValidationContext supplied.", "instance"); - - bool valid = true; - Type instanceType = instance.GetType (); - TypeDescriptor.GetAttributes (instanceType).Validate (instance, validationContext, validationResults, ref valid); - - PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (instance); - if (properties != PropertyDescriptorCollection.Empty && properties.Count > 0) { - foreach (PropertyDescriptor pdesc in properties) { - object value = pdesc.GetValue (instance); - ValidateProperty (pdesc, value, validationContext, validationResults, validateAllProperties, ref valid); - } - } - - return valid; - } - - static void ValidateProperty (PropertyDescriptor pdesc, object value, ValidationContext validationContext, ICollection validationResults, - bool validateAll, ref bool valid) - { - AttributeCollection attributes = pdesc.Attributes; - attributes.Validate (value, validationContext, validationResults, ref valid); - if (validateAll) - attributes.ValidateExcept (value, validationContext, validationResults, ref valid); - } - - static PropertyDescriptor GetProperty (Type type, string propertyName, object value) - { - if (String.IsNullOrEmpty (propertyName)) - throw new ArgumentNullException ("propertyName"); - - PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (type); - PropertyDescriptor pdesc = null; - if (properties != PropertyDescriptorCollection.Empty && properties.Count > 0) - pdesc = properties.Find (propertyName, false); - - if (pdesc == null) - throw new ArgumentException (String.Format ("The type '{0}' does not contain a public property named '{1}'.", type.Name, propertyName), "propertyName"); - - Type valueType = value == null ? null : value.GetType (); - Type propertyType = pdesc.PropertyType; - bool invalidType = false; - - if (valueType == null) - invalidType = (propertyType.IsValueType && Nullable.GetUnderlyingType(propertyType) == null); - else - invalidType = !propertyType.IsAssignableFrom(valueType); - - if (invalidType) - throw new ArgumentException (String.Format ("The value of property '{0}' must be of type '{1}'.", propertyName, propertyType.FullName), "propertyName"); - - return pdesc; - } - - public static bool TryValidateProperty (object value, ValidationContext validationContext, ICollection validationResults) - { - // LAMESPEC: value can be null, validationContext must not - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - PropertyDescriptor pdesc = GetProperty (validationContext.ObjectType, validationContext.MemberName, value); - - bool valid = true; - ValidateProperty (pdesc, value, validationContext, validationResults, true, ref valid); - - return valid; - } - - public static bool TryValidateValue (object value, ValidationContext validationContext, ICollection validationResults, - IEnumerable validationAttributes) - { - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - ValidationResult result; - - // It appears .NET makes this call before checking whether - // validationAttributes is null... - ValidationAttribute vattr = validationAttributes.FirstOrDefault (attr => attr is RequiredAttribute); - if (vattr != null) { - result = vattr.GetValidationResult (value, validationContext); - if (result != ValidationResult.Success) { - if (validationResults != null) - validationResults.Add (result); - return false; - } - } - - if (validationAttributes == null) - return true; - - bool valid = true; - foreach (ValidationAttribute attr in validationAttributes) { - if (attr == null || (attr is RequiredAttribute)) - continue; - - result = attr.GetValidationResult (value, validationContext); - if (result != ValidationResult.Success) { - valid = false; - if (validationResults != null) - validationResults.Add (result); - } - } - - return valid; - } - - public static void ValidateObject (object instance, ValidationContext validationContext) - { - ValidateObject (instance, validationContext, false); - } - - public static void ValidateObject (object instance, ValidationContext validationContext, bool validateAllProperties) - { - if (instance == null) - throw new ArgumentNullException ("instance"); - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - var validationResults = new List (); - if (TryValidateObject (instance, validationContext, validationResults, validateAllProperties)) - return; - - ValidationResult result = validationResults.Count > 0 ? validationResults [0] : null; - throw new ValidationException (result, null, instance); - } - - public static void ValidateProperty (object value, ValidationContext validationContext) - { - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - var validationResults = new List (); - if (TryValidateProperty (value, validationContext, validationResults)) - return; - - ValidationResult result = validationResults.Count > 0 ? validationResults [0] : null; - throw new ValidationException (result, null, value); - } - - public static void ValidateValue (object value, ValidationContext validationContext, IEnumerable validationAttributes) - { - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - var validationResults = new List (); - if (TryValidateValue (value, validationContext, validationResults, validationAttributes)) - return; - - ValidationResult result = validationResults.Count > 0 ? validationResults [0] : null; - throw new ValidationException (result, null, value); - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs index 67ed9dac283..846ee326176 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs @@ -46,14 +46,12 @@ namespace MonoTests.System.ComponentModel.DataAnnotations var sla = new CreditCardAttribute (); Assert.IsTrue (sla.IsValid (null), "#A1-1"); - Assert.IsFalse (sla.IsValid (String.Empty), "#A1-2"); + Assert.IsTrue (sla.IsValid (String.Empty), "#A1-2"); Assert.IsFalse (sla.IsValid ("string"), "#A1-3"); Assert.IsTrue (sla.IsValid ("378282246310005"), "#A1-4"); Assert.IsTrue (sla.IsValid ("3782-8224-6310-005"), "#A1-5"); Assert.IsTrue (sla.IsValid ("371449635398431"), "#A-6"); -#if false Assert.IsFalse (sla.IsValid ("371449635498431"), "#A-6b"); -#endif Assert.IsFalse (sla.IsValid (true), "#A1-7"); Assert.IsFalse (sla.IsValid (DateTime.Now), "#A1-8"); } diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs index 0753fde5a69..3d54000c5dd 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs @@ -71,7 +71,7 @@ namespace MonoTests.System.ComponentModel.DataAnnotations public class DisplayAttributeTests { const string property_not_set_message = "The {0} property has not been set. Use the Get{0} method to get the value."; - const string localization_failed_message = "Cannot retrieve property '{0}' because localization failed. Type '{1} is not public or does not contain a public static string property with the name '{2}'."; + const string localization_failed_message = "Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'."; [Test] public void StringProperties_ReturnLiteralValues_Success() diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs index 09350cde8fd..552e3eae6a4 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs @@ -50,11 +50,6 @@ namespace MonoTests.System.ComponentModel.DataAnnotations "$A12345@example.com", "!def!xyz%abc@example.com", "_somename@example.com", - "valid.ipv4.addr@[123.1.72.10]", - "valid.ipv6.addr@[IPv6:0::1]", - "valid.ipv6.addr@[IPv6:2607:f0d0:1002:51::4]", - "valid.ipv6.addr@[IPv6:fe80::230:48ff:fe33:bc33]", - "valid.ipv6v4.addr@[IPv6:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:127.0.0.1]", }; static readonly object[] InvalidAddresses = new object[] { @@ -69,6 +64,12 @@ namespace MonoTests.System.ComponentModel.DataAnnotations "invalid@[127.0.0.1.]", "invalid@[127.0.0.1].", "invalid@[127.0.0.1]x", + + "valid.ipv4.addr@[123.1.72.10]", + "valid.ipv6.addr@[IPv6:0::1]", + "valid.ipv6.addr@[IPv6:2607:f0d0:1002:51::4]", + "valid.ipv6.addr@[IPv6:fe80::230:48ff:fe33:bc33]", + "valid.ipv6v4.addr@[IPv6:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:127.0.0.1]", }; [Test] diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs index 65778396502..163e1a738b7 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs @@ -90,26 +90,29 @@ namespace MonoTests.System.ComponentModel.DataAnnotations Assert.IsTrue (rea.IsValid (null), "Null does not match [A-Za-z]."); Assert.IsTrue (rea.IsValid ("A"), "'A' does not match [A-Za-z]."); Assert.IsTrue (rea.IsValid ("a"), "'a' does not match [A-Za-z]."); - Assert.IsTrue (rea.IsValid ("Bz"), "'Bz' does not match [A-Za-z]."); - Assert.IsTrue (rea.IsValid ("string"), "'string' does not match [A-Za-z]."); - Assert.IsFalse (rea.IsValid (String.Empty), "Empty string matches [A-Za-z]."); + Assert.IsFalse (rea.IsValid ("Bz"), "'Bz' does not match [A-Za-z]."); + Assert.IsFalse (rea.IsValid ("string"), "'string' does not match [A-Za-z]."); + Assert.IsTrue (rea.IsValid (String.Empty), "Empty string matches [A-Za-z]."); Assert.IsFalse (rea.IsValid ("0123456789"), "'0123456789' matches [A-Za-z]."); Assert.IsFalse (rea.IsValid ("0123456789"), "'0123456789A' matches [A-Za-z]."); - AssertExtensions.Throws (() => { - rea.IsValid (123); - }, "Casting does not fails"); - AssertExtensions.Throws (() => { - rea.IsValid (DateTime.Now); - }, "Casting does not fails"); + Assert.IsFalse (rea.IsValid (123), "Casting does not fails"); + Assert.IsFalse (rea.IsValid (DateTime.Now), "Casting does not fails"); rea = new RegularExpressionAttributePoker (""); - Assert.IsTrue (rea.IsValid (null), "null does not match empty pattern"); - Assert.IsTrue (rea.IsValid (String.Empty), "empty string does not match empty pattern"); - Assert.IsTrue (rea.IsValid ("string"), "'string' does not match empty pattern"); + + AssertExtensions.Throws (() => { + rea.IsValid (null); + }, "null does not match empty pattern"); + + AssertExtensions.Throws (() => { + rea.IsValid (String.Empty); + }, "empty string does not match empty pattern"); + + AssertExtensions.Throws (() => { + rea.IsValid ("string"); + }, "'string' does not match empty pattern"); - AssertExtensions.Throws (() => { - rea = new RegularExpressionAttributePoker (null); - }, "Null pattern allowed"); + rea = new RegularExpressionAttributePoker (null); } } } diff --git a/mcs/class/System.ComponentModel.DataAnnotations/mobile_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/mobile_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 3de14f5e0a7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/mobile_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources diff --git a/mcs/class/System.ComponentModel.DataAnnotations/mobile_static_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/mobile_static_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 3de14f5e0a7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/mobile_static_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources diff --git a/mcs/class/System.ComponentModel.DataAnnotations/monodroid_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/monodroid_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 3de14f5e0a7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/monodroid_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources diff --git a/mcs/class/System.ComponentModel.DataAnnotations/monotouch_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/monotouch_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 3de14f5e0a7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/monotouch_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources diff --git a/mcs/class/System.ComponentModel.DataAnnotations/net_4_0_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/net_4_0_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index a5a9a9d5359..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/net_4_0_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1,9 +0,0 @@ -#include System.ComponentModel.DataAnnotations.dll.sources - -System.ComponentModel.DataAnnotations/FilterUIHintAttribute.cs -System.ComponentModel.DataAnnotations/KeyAttribute.cs -System.ComponentModel.DataAnnotations/TimestampAttribute.cs -System.ComponentModel.DataAnnotations/ValidationAttributeCollectionExtensions.cs -System.ComponentModel.DataAnnotations/ValidationContext.cs -System.ComponentModel.DataAnnotations/ValidationResult.cs -System.ComponentModel.DataAnnotations/Validator.cs diff --git a/mcs/class/System.ComponentModel.DataAnnotations/net_4_5_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/net_4_5_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 49e068c167e..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/net_4_5_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1,17 +0,0 @@ -#include net_4_0_System.ComponentModel.DataAnnotations.dll.sources - -System.ComponentModel.DataAnnotations/MinLengthAttribute.cs -System.ComponentModel.DataAnnotations/MaxLengthAttribute.cs -System.ComponentModel.DataAnnotations/CreditCardAttribute.cs -System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs -System.ComponentModel.DataAnnotations/PhoneAttribute.cs -System.ComponentModel.DataAnnotations/FileExtensionsAttribute.cs -System.ComponentModel.DataAnnotations/CompareAttribute.cs -System.ComponentModel.DataAnnotations.Schema/ColumnAttribute.cs -System.ComponentModel.DataAnnotations.Schema/ComplexTypeAttribute.cs -System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedAttribute.cs -System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedOption.cs -System.ComponentModel.DataAnnotations.Schema/ForeignKeyAttribute.cs -System.ComponentModel.DataAnnotations.Schema/InversePropertyAttribute.cs -System.ComponentModel.DataAnnotations.Schema/NotMappedAttribute.cs -System.ComponentModel.DataAnnotations.Schema/TableAttribute.cs diff --git a/mcs/class/System.ComponentModel.DataAnnotations/xammac_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/xammac_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 3de14f5e0a7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/xammac_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources diff --git a/mcs/class/System.Configuration.Install/System.Configuration.Install-net_2_0.csproj b/mcs/class/System.Configuration.Install/System.Configuration.Install-net_2_0.csproj deleted file mode 100644 index 2c42625131c..00000000000 --- a/mcs/class/System.Configuration.Install/System.Configuration.Install-net_2_0.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C8B650EA-042C-4352-8224-03F759A682C6} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Configuration.Install - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Configuration.Install/System.Configuration.Install-net_4_0.csproj b/mcs/class/System.Configuration.Install/System.Configuration.Install-net_4_0.csproj deleted file mode 100644 index cc5eed324a1..00000000000 --- a/mcs/class/System.Configuration.Install/System.Configuration.Install-net_4_0.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {29529439-51F1-4953-8A5D-7ED8F7EB8FDB} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Configuration.Install - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - diff --git a/mcs/class/System.Configuration/System.Configuration-net_2_0.csproj b/mcs/class/System.Configuration/System.Configuration-net_2_0.csproj deleted file mode 100644 index 6c2ede7d037..00000000000 --- a/mcs/class/System.Configuration/System.Configuration-net_2_0.csproj +++ /dev/null @@ -1,208 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2695A2F2-2271-423D-8E0D-553DAB84E917} - Library - 1699,618 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Configuration - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A1ED72C-ADAB-4396-AB03-D0E26AA91E90} - System\System-net_2_0-1 - - - {E89F34AB-7AE2-41CA-B891-C8D1C9F02EB8} - System.XML\System.Xml-net_2_0 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - - - - - diff --git a/mcs/class/System.Configuration/System.Configuration-net_4_0.csproj b/mcs/class/System.Configuration/System.Configuration-net_4_0.csproj deleted file mode 100644 index d7a7a6970dc..00000000000 --- a/mcs/class/System.Configuration/System.Configuration-net_4_0.csproj +++ /dev/null @@ -1,208 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - Library - 1699,618 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Configuration - v4.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {C8452C42-726B-4C74-A086-00AFBC162B9A} - System\System-net_4_0-1 - - - {86DD6F16-A480-4248-AE96-301B2F973CD7} - System.XML\System.Xml-net_4_0 - - - {E15F571E-B653-4409-AF7C-F478DA81B959} - System.Security\System.Security-net_4_0 - - - - - - - diff --git a/mcs/class/System.Configuration/System.Configuration-tests-net_2_0.csproj b/mcs/class/System.Configuration/System.Configuration-tests-net_2_0.csproj deleted file mode 100644 index 9ac1884d4a2..00000000000 --- a/mcs/class/System.Configuration/System.Configuration-tests-net_2_0.csproj +++ /dev/null @@ -1,130 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5C13CE48-3692-4869-8205-730A86C0BE0F} - Library - 1699,618 - bin\Debug\System.Configuration-tests-net_2_0 - True - False - - Properties - - - System.Configuration_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {5A1ED72C-ADAB-4396-AB03-D0E26AA91E90} - System\System-net_2_0-1 - - - {E89F34AB-7AE2-41CA-B891-C8D1C9F02EB8} - System.XML\System.Xml-net_2_0 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - - - - - diff --git a/mcs/class/System.Configuration/System.Configuration-tests-net_4_0.csproj b/mcs/class/System.Configuration/System.Configuration-tests-net_4_0.csproj deleted file mode 100644 index b6816be5063..00000000000 --- a/mcs/class/System.Configuration/System.Configuration-tests-net_4_0.csproj +++ /dev/null @@ -1,130 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6F7A1231-B56F-4282-ADA8-6A3AA18DBA31} - Library - 1699,618 - bin\Debug\System.Configuration-tests-net_4_0 - True - False - - Properties - - - System.Configuration_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {C8452C42-726B-4C74-A086-00AFBC162B9A} - System\System-net_4_0-1 - - - {86DD6F16-A480-4248-AE96-301B2F973CD7} - System.XML\System.Xml-net_4_0 - - - {E15F571E-B653-4409-AF7C-F478DA81B959} - System.Security\System.Security-net_4_0 - - - - - - - diff --git a/mcs/class/System.Core/Makefile b/mcs/class/System.Core/Makefile index eeca6391a14..3480ca91098 100644 --- a/mcs/class/System.Core/Makefile +++ b/mcs/class/System.Core/Makefile @@ -4,7 +4,8 @@ include ../../build/rules.make LIBRARY = System.Core.dll -LIB_MCS_FLAGS = -d:INSIDE_SYSCORE -d:LIBC /r:System.dll -unsafe +REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,PFX_LEGACY_3_5 +LIB_MCS_FLAGS = $(REFERENCE_SOURCES_FLAGS) -d:INSIDE_SYSCORE -d:LIBC /r:System.dll -unsafe ifneq (2.1, $(FRAMEWORK_VERSION)) LIB_MCS_FLAGS += -d:NET_3_5 -nowarn:1720 diff --git a/mcs/class/System.Core/ReferenceSources/SR.cs b/mcs/class/System.Core/ReferenceSources/SR.cs new file mode 100644 index 00000000000..688bbd0a151 --- /dev/null +++ b/mcs/class/System.Core/ReferenceSources/SR.cs @@ -0,0 +1,66 @@ +// +// SR.cs: Manually collected resource strings for ReferenceSources +// +// Authors: +// Marek Safar +// +// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +partial class SR +{ + public const string MoreThanOneMatch = "MoreThanOneMatch"; + public const string NoElements = "NoElements"; + public const string PLINQ_CommonEnumerator_Current_NotStarted = "PLINQ_CommonEnumerator_Current_NotStarted"; + public const string PLINQ_DisposeRequested = "PLINQ_DisposeRequested"; + public const string PLINQ_EnumerationPreviouslyFailed = "PLINQ_EnumerationPreviouslyFailed"; + public const string PLINQ_ExternalCancellationRequested = "PLINQ_ExternalCancellationRequested"; + public const string ParallelEnumerable_BinaryOpMustUseAsParallel = "ParallelEnumerable_BinaryOpMustUseAsParallel"; + public const string ParallelEnumerable_WithCancellation_TokenSourceDisposed = "ParallelEnumerable_WithCancellation_TokenSourceDisposed"; + public const string ParallelEnumerable_WithMergeOptions_InvalidOptions = "ParallelEnumerable_WithMergeOptions_InvalidOptions"; + public const string ParallelEnumerable_WithQueryExecutionMode_InvalidMode = "ParallelEnumerable_WithQueryExecutionMode_InvalidMode"; + public const string ParallelPartitionable_IncorretElementCount = "ParallelPartitionable_IncorretElementCount"; + public const string ParallelPartitionable_NullElement = "ParallelPartitionable_NullElement"; + public const string ParallelPartitionable_NullReturn = "ParallelPartitionable_NullReturn"; + public const string ParallelQuery_DuplicateDOP = "ParallelQuery_DuplicateDOP"; + public const string ParallelQuery_DuplicateExecutionMode = "The WithExecutionMode operator may be used at most once in a query."; + public const string ParallelQuery_DuplicateMergeOptions = "ParallelQuery_DuplicateMergeOptions"; + public const string ParallelQuery_DuplicateTaskScheduler = "ParallelQuery_DuplicateTaskScheduler"; + public const string ParallelQuery_DuplicateWithCancellation = "ParallelQuery_DuplicateWithCancellation"; + public const string ParallelQuery_InvalidAsOrderedCall = "AsOrdered may only be called on the result of AsParallel, ParallelEnumerable.Range, or ParallelEnumerable.Repeat."; + public const string ParallelQuery_InvalidNonGenericAsOrderedCall = "ParallelQuery_InvalidNonGenericAsOrderedCall"; + public const string ParallelQuery_PartitionerNotOrderable = "ParallelQuery_PartitionerNotOrderable"; + public const string PartitionerQueryOperator_NullPartition = "PartitionerQueryOperator_NullPartition"; + public const string PartitionerQueryOperator_NullPartitionList = "PartitionerQueryOperator_NullPartitionList"; + public const string PartitionerQueryOperator_WrongNumberOfPartitions = "PartitionerQueryOperator_WrongNumberOfPartitions"; + public const string LockRecursionException_ReadAfterWriteNotAllowed = "LockRecursionException_ReadAfterWriteNotAllowed"; + public const string LockRecursionException_RecursiveReadNotAllowed = "LockRecursionException_RecursiveReadNotAllowed"; + public const string LockRecursionException_RecursiveUpgradeNotAllowed = "LockRecursionException_RecursiveUpgradeNotAllowed"; + public const string LockRecursionException_RecursiveWriteNotAllowed = "LockRecursionException_RecursiveWriteNotAllowed"; + public const string LockRecursionException_UpgradeAfterReadNotAllowed = "LockRecursionException_UpgradeAfterReadNotAllowed"; + public const string LockRecursionException_UpgradeAfterWriteNotAllowed = "LockRecursionException_UpgradeAfterWriteNotAllowed"; + public const string LockRecursionException_WriteAfterReadNotAllowed = "LockRecursionException_WriteAfterReadNotAllowed"; + public const string SynchronizationLockException_IncorrectDispose = "SynchronizationLockException_IncorrectDispose"; + public const string SynchronizationLockException_MisMatchedRead = "SynchronizationLockException_MisMatchedRead"; + public const string SynchronizationLockException_MisMatchedUpgrade = "SynchronizationLockException_MisMatchedUpgrade"; + public const string SynchronizationLockException_MisMatchedWrite = "SynchronizationLockException_MisMatchedWrite"; +} diff --git a/mcs/class/System.Core/ReferenceSources/Set.cs b/mcs/class/System.Core/ReferenceSources/Set.cs new file mode 100644 index 00000000000..533a9140740 --- /dev/null +++ b/mcs/class/System.Core/ReferenceSources/Set.cs @@ -0,0 +1,113 @@ +// Extracted from ../../../external/referencesource/System.Core/System/Linq/Enumerable.cs + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Threading; + +namespace System.Linq +{ + internal class Set + { + int[] buckets; + Slot[] slots; + int count; + int freeList; + IEqualityComparer comparer; + + public Set() : this(null) { } + + public Set(IEqualityComparer comparer) { + if (comparer == null) comparer = EqualityComparer.Default; + this.comparer = comparer; + buckets = new int[7]; + slots = new Slot[7]; + freeList = -1; + } + + // If value is not in set, add it and return true; otherwise return false + public bool Add(TElement value) { + return !Find(value, true); + } + + // Check whether value is in set + public bool Contains(TElement value) { + return Find(value, false); + } + + // If value is in set, remove it and return true; otherwise return false + public bool Remove(TElement value) { + int hashCode = InternalGetHashCode(value); + int bucket = hashCode % buckets.Length; + int last = -1; + for (int i = buckets[bucket] - 1; i >= 0; last = i, i = slots[i].next) { + if (slots[i].hashCode == hashCode && comparer.Equals(slots[i].value, value)) { + if (last < 0) { + buckets[bucket] = slots[i].next + 1; + } + else { + slots[last].next = slots[i].next; + } + slots[i].hashCode = -1; + slots[i].value = default(TElement); + slots[i].next = freeList; + freeList = i; + return true; + } + } + return false; + } + + bool Find(TElement value, bool add) { + int hashCode = InternalGetHashCode(value); + for (int i = buckets[hashCode % buckets.Length] - 1; i >= 0; i = slots[i].next) { + if (slots[i].hashCode == hashCode && comparer.Equals(slots[i].value, value)) return true; + } + if (add) { + int index; + if (freeList >= 0) { + index = freeList; + freeList = slots[index].next; + } + else { + if (count == slots.Length) Resize(); + index = count; + count++; + } + int bucket = hashCode % buckets.Length; + slots[index].hashCode = hashCode; + slots[index].value = value; + slots[index].next = buckets[bucket] - 1; + buckets[bucket] = index + 1; + } + return false; + } + + void Resize() { + int newSize = checked(count * 2 + 1); + int[] newBuckets = new int[newSize]; + Slot[] newSlots = new Slot[newSize]; + Array.Copy(slots, 0, newSlots, 0, count); + for (int i = 0; i < count; i++) { + int bucket = newSlots[i].hashCode % newSize; + newSlots[i].next = newBuckets[bucket] - 1; + newBuckets[bucket] = i + 1; + } + buckets = newBuckets; + slots = newSlots; + } + + internal int InternalGetHashCode(TElement value) + { + //[....] DevDivBugs 171937. work around comparer implementations that throw when passed null + return (value == null) ? 0 : comparer.GetHashCode(value) & 0x7FFFFFFF; + } + + internal struct Slot + { + internal int hashCode; + internal TElement value; + internal int next; + } + } +} \ No newline at end of file diff --git a/mcs/class/System.Core/System.Core-net_2_0.csproj b/mcs/class/System.Core/System.Core-net_2_0.csproj deleted file mode 100644 index d4bcfd9b3fd..00000000000 --- a/mcs/class/System.Core/System.Core-net_2_0.csproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - Library - 1699,1720 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Core - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;INSIDE_SYSCORE;LIBC;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;INSIDE_SYSCORE;LIBC;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - - - - - diff --git a/mcs/class/System.Core/System.Core-net_4_0.csproj b/mcs/class/System.Core/System.Core-net_4_0.csproj deleted file mode 100644 index bf38254b698..00000000000 --- a/mcs/class/System.Core/System.Core-net_4_0.csproj +++ /dev/null @@ -1,333 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - Library - 1699,1720 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - System.Core - v4.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {714C7BA8-AC9A-49C4-ADCA-CD4585EF1A46} - System\System-net_4_0 - - - {E9A655D1-EE99-467A-8F4B-CAC80E0E65BE} - Mono.Posix\Mono.Posix-net_4_0 - - - - - - - diff --git a/mcs/class/System.Core/System.Core-net_4_5.csproj b/mcs/class/System.Core/System.Core-net_4_5.csproj index d749c862b5d..ebdf4a6fd54 100644 --- a/mcs/class/System.Core/System.Core-net_4_5.csproj +++ b/mcs/class/System.Core/System.Core-net_4_5.csproj @@ -284,8 +284,6 @@ - - @@ -295,7 +293,12 @@ - + + + + + + - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {AAA3F683-244C-40EF-8EF8-A95938862A44} - corlib\corlib-net_2_0 - - - {5459507F-DC25-401C-A2F4-D5ECAC3A34E6} - System\System-bare-net_2_0 - - - {2CA4E20E-76B6-4A2D-B121-39C558BB6E28} - Mono.Posix\Mono.Posix-net_2_0 - - - - - - - diff --git a/mcs/class/System.Core/System.Core-plaincore-net_4_0.csproj b/mcs/class/System.Core/System.Core-plaincore-net_4_0.csproj deleted file mode 100644 index 4055d75ff7f..00000000000 --- a/mcs/class/System.Core/System.Core-plaincore-net_4_0.csproj +++ /dev/null @@ -1,337 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2D5DF73B-C3E5-40E6-94DA-EE49231F1FB4} - Library - 1699,1720 - ./../../class/lib/net_4_0/plaincore - True - True - true - Properties - - - System.Core - v4.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5889848E-305B-4B11-B3B1-A25761DAFE45} - corlib\corlib-net_4_0 - - - {ED114F49-84B3-4EF9-80EC-90D4EEF7FF8E} - System\System-secxml-net_4_0 - - - {98213707-7F8B-4D75-B5C7-DDF75BAB3534} - Mono.Posix\Mono.Posix-net_4_0 - - - - - - - diff --git a/mcs/class/System.Core/System.Core-plaincore-net_4_5.csproj b/mcs/class/System.Core/System.Core-plaincore-net_4_5.csproj index 2d1945f82ce..5e2dfb342bb 100644 --- a/mcs/class/System.Core/System.Core-plaincore-net_4_5.csproj +++ b/mcs/class/System.Core/System.Core-plaincore-net_4_5.csproj @@ -284,8 +284,6 @@ - - @@ -295,7 +293,12 @@ - + + + + + + - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - - - - - diff --git a/mcs/class/System.Core/System.Core-tests-net_4_0.csproj b/mcs/class/System.Core/System.Core-tests-net_4_0.csproj deleted file mode 100644 index c79aa90eb4b..00000000000 --- a/mcs/class/System.Core/System.Core-tests-net_4_0.csproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1B22CF44-569E-4724-B67C-D8C2229ED67A} - Library - 1699,1720 - bin\Debug\System.Core-tests-net_4_0 - True - False - true - Properties - - - System.Core_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;INSIDE_SYSCORE;LIBC;NET_3_5;FEATURE_CORE_DLR;FEATURE_REFEMIT;FEATURE_PDBEMIT - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {714C7BA8-AC9A-49C4-ADCA-CD4585EF1A46} - System\System-net_4_0 - - - {E9A655D1-EE99-467A-8F4B-CAC80E0E65BE} - Mono.Posix\Mono.Posix-net_4_0 - - - - - - - diff --git a/mcs/class/System.Core/System.Core.dll.sources b/mcs/class/System.Core/System.Core.dll.sources index 1c476016340..0f9b5ec6f1d 100644 --- a/mcs/class/System.Core/System.Core.dll.sources +++ b/mcs/class/System.Core/System.Core.dll.sources @@ -1,5 +1,8 @@ +../../build/common/SR.cs ../../build/common/Consts.cs Assembly/AssemblyInfo.cs +ReferenceSources/SR.cs +ReferenceSources/Set.cs System/Actions.cs System/Funcs.cs System/InvalidTimeZoneException.cs @@ -78,8 +81,6 @@ System.Security.Cryptography/SHA384CryptoServiceProvider.cs System.Security.Cryptography/SHA512Cng.cs System.Security.Cryptography/SHA512CryptoServiceProvider.cs System.Threading/LockRecursionException.cs -System.Threading/LockRecursionPolicy.cs -System.Threading/ReaderWriterLockSlim.cs System.Threading/ThreadLockState.cs System.Threading/ReaderWriterLockSlimExtensions.cs Microsoft.Win32.SafeHandles/SafePipeHandle.cs @@ -100,3 +101,4 @@ System.IO.Pipes/PipeTransmissionMode.cs System.IO.Pipes/PipeUnix.cs System.IO.Pipes/PipeWin32.cs System.IO/HandleInheritability.cs +../../../external/referencesource/System.Core/System/threading/ReaderWriterLockSlim/ReaderWriterLockSlim.cs diff --git a/mcs/class/System.Core/System.Linq/Enumerable.cs b/mcs/class/System.Core/System.Linq/Enumerable.cs index 80b1e3fa336..157b53c8be3 100644 --- a/mcs/class/System.Core/System.Linq/Enumerable.cs +++ b/mcs/class/System.Core/System.Linq/Enumerable.cs @@ -2765,14 +2765,14 @@ namespace System.Linq { Check.Source (source); + if (count <= 0) + return EmptyOf.Instance; + return CreateTakeIterator (source, count); } static IEnumerable CreateTakeIterator (IEnumerable source, int count) { - if (count <= 0) - yield break; - int counter = 0; foreach (TSource element in source) { yield return element; diff --git a/mcs/class/System.Core/System.Threading/LockRecursionPolicy.cs b/mcs/class/System.Core/System.Threading/LockRecursionPolicy.cs deleted file mode 100644 index 9429a1d2e94..00000000000 --- a/mcs/class/System.Core/System.Threading/LockRecursionPolicy.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * System.Threading.LockRecursionPolicy - * - * Author(s) - * Marek Safar - * - * 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.Threading -{ - [Serializable] - public enum LockRecursionPolicy - { - NoRecursion, - SupportsRecursion - } -} diff --git a/mcs/class/System.Core/System.Threading/ReaderWriterLockSlim.cs b/mcs/class/System.Core/System.Threading/ReaderWriterLockSlim.cs deleted file mode 100644 index f4c6de46ddb..00000000000 --- a/mcs/class/System.Core/System.Threading/ReaderWriterLockSlim.cs +++ /dev/null @@ -1,588 +0,0 @@ -// -// System.Threading.ReaderWriterLockSlim.cs -// -// Author: -// Jérémie "Garuma" Laval -// -// Copyright (c) 2010 Jérémie "Garuma" Laval -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Security.Permissions; -using System.Diagnostics; -using System.Threading; -using System.Runtime.CompilerServices; - -namespace System.Threading { - - [HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)] - [HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true, ExternalThreading = true)] - public class ReaderWriterLockSlim : IDisposable - { - /* Position of each bit isn't really important - * but their relative order is - */ - const int RwReadBit = 3; - - /* These values are used to manipulate the corresponding flags in rwlock field - */ - const int RwWait = 1; - const int RwWaitUpgrade = 2; - const int RwWrite = 4; - const int RwRead = 8; - - /* Some explanations: this field is the central point of the lock and keep track of all the requests - * that are being made. The 3 lowest bits are used as flag to track "destructive" lock entries - * (i.e attempting to take the write lock with or without having acquired an upgradeable lock beforehand). - * All the remaining bits are intepreted as the actual number of reader currently using the lock - * (which mean the lock is limited to 2^29 concurrent readers but since it's a high number there - * is no overflow safe guard to remain simple). - */ - int rwlock; - - readonly LockRecursionPolicy recursionPolicy; - readonly bool noRecursion; - - AtomicBoolean upgradableTaken = new AtomicBoolean (); - - /* These events are just here for the sake of having a CPU-efficient sleep - * when the wait for acquiring the lock is too long - */ -#if NET_4_0 - ManualResetEventSlim upgradableEvent = new ManualResetEventSlim (true); - ManualResetEventSlim writerDoneEvent = new ManualResetEventSlim (true); - ManualResetEventSlim readerDoneEvent = new ManualResetEventSlim (true); -#else - ManualResetEvent upgradableEvent = new ManualResetEvent (true); - ManualResetEvent writerDoneEvent = new ManualResetEvent (true); - ManualResetEvent readerDoneEvent = new ManualResetEvent (true); -#endif - - // This Stopwatch instance is used for all threads since .Elapsed is thread-safe - readonly static Stopwatch sw = Stopwatch.StartNew (); - - /* For performance sake, these numbers are manipulated via classic increment and - * decrement operations and thus are (as hinted by MSDN) not meant to be precise - */ - int numReadWaiters, numUpgradeWaiters, numWriteWaiters; - bool disposed; - - static int idPool = int.MinValue; - readonly int id = Interlocked.Increment (ref idPool); - - /* This dictionary is instanciated per thread for all existing ReaderWriterLockSlim instance. - * Each instance is defined by an internal integer id value used as a key in the dictionary. - * to avoid keeping unneeded reference to the instance and getting in the way of the GC. - * Since there is no LockCookie type here, all the useful per-thread infos concerning each - * instance are kept here. - */ - [ThreadStatic] - static Dictionary currentThreadState; - - /* Rwls tries to use this array as much as possible to quickly retrieve the thread-local - * informations so that it ends up being only an array lookup. When the number of thread - * using the instance goes past the length of the array, the code fallback to the normal - * dictionary - */ - ThreadLockState[] fastStateCache = new ThreadLockState[64]; - - public ReaderWriterLockSlim () : this (LockRecursionPolicy.NoRecursion) - { - } - - public ReaderWriterLockSlim (LockRecursionPolicy recursionPolicy) - { - this.recursionPolicy = recursionPolicy; - this.noRecursion = recursionPolicy == LockRecursionPolicy.NoRecursion; - } - - public void EnterReadLock () - { - TryEnterReadLock (-1); - } - - public bool TryEnterReadLock (int millisecondsTimeout) - { - bool dummy = false; - return TryEnterReadLock (millisecondsTimeout, ref dummy); - } - - bool TryEnterReadLock (int millisecondsTimeout, ref bool success) - { - ThreadLockState ctstate = CurrentThreadState; - - if (CheckState (ctstate, millisecondsTimeout, LockState.Read)) { - ++ctstate.ReaderRecursiveCount; - return true; - } - - // This is downgrading from upgradable, no need for check since - // we already have a sort-of read lock that's going to disappear - // after user calls ExitUpgradeableReadLock. - // Same idea when recursion is allowed and a write thread wants to - // go for a Read too. - if (ctstate.LockState.Has (LockState.Upgradable) - || (!noRecursion && ctstate.LockState.Has (LockState.Write))) { - RuntimeHelpers.PrepareConstrainedRegions (); - try {} - finally { - Interlocked.Add (ref rwlock, RwRead); - ctstate.LockState |= LockState.Read; - ++ctstate.ReaderRecursiveCount; - success = true; - } - - return true; - } - - ++numReadWaiters; - int val = 0; - long start = millisecondsTimeout == -1 ? 0 : sw.ElapsedMilliseconds; - - do { - /* Check if a writer is present (RwWrite) or if there is someone waiting to - * acquire a writer lock in the queue (RwWait | RwWaitUpgrade). - */ - if ((rwlock & (RwWrite | RwWait | RwWaitUpgrade)) > 0) { - writerDoneEvent.Wait (ComputeTimeout (millisecondsTimeout, start)); - continue; - } - - /* Optimistically try to add ourselves to the reader value - * if the adding was too late and another writer came in between - * we revert the operation. - */ - RuntimeHelpers.PrepareConstrainedRegions (); - try {} - finally { - if (((val = Interlocked.Add (ref rwlock, RwRead)) & (RwWrite | RwWait | RwWaitUpgrade)) == 0) { - /* If we are the first reader, reset the event to let other threads - * sleep correctly if they try to acquire write lock - */ - if (val >> RwReadBit == 1) - readerDoneEvent.Reset (); - - ctstate.LockState ^= LockState.Read; - ++ctstate.ReaderRecursiveCount; - --numReadWaiters; - success = true; - } else { - Interlocked.Add (ref rwlock, -RwRead); - } - } - if (success) - return true; - - writerDoneEvent.Wait (ComputeTimeout (millisecondsTimeout, start)); - } while (millisecondsTimeout == -1 || (sw.ElapsedMilliseconds - start) < millisecondsTimeout); - - --numReadWaiters; - return false; - } - - public bool TryEnterReadLock (TimeSpan timeout) - { - return TryEnterReadLock (CheckTimeout (timeout)); - } - - public void ExitReadLock () - { - RuntimeHelpers.PrepareConstrainedRegions (); - try {} - finally { - ThreadLockState ctstate = CurrentThreadState; - - if (!ctstate.LockState.Has (LockState.Read)) - throw new SynchronizationLockException ("The current thread has not entered the lock in read mode"); - - if (--ctstate.ReaderRecursiveCount == 0) { - ctstate.LockState ^= LockState.Read; - if (Interlocked.Add (ref rwlock, -RwRead) >> RwReadBit == 0) - readerDoneEvent.Set (); - } - } - } - - public void EnterWriteLock () - { - TryEnterWriteLock (-1); - } - - public bool TryEnterWriteLock (int millisecondsTimeout) - { - ThreadLockState ctstate = CurrentThreadState; - - if (CheckState (ctstate, millisecondsTimeout, LockState.Write)) { - ++ctstate.WriterRecursiveCount; - return true; - } - - ++numWriteWaiters; - bool isUpgradable = ctstate.LockState.Has (LockState.Upgradable); - bool registered = false; - bool success = false; - - RuntimeHelpers.PrepareConstrainedRegions (); - try { - /* If the code goes there that means we had a read lock beforehand - * that need to be suppressed, we also take the opportunity to register - * our interest in the write lock to avoid other write wannabe process - * coming in the middle - */ - if (isUpgradable && rwlock >= RwRead) { - try {} - finally { - if (Interlocked.Add (ref rwlock, RwWaitUpgrade - RwRead) >> RwReadBit == 0) - readerDoneEvent.Set (); - registered = true; - } - } - - int stateCheck = isUpgradable ? RwWaitUpgrade + RwWait : RwWait; - long start = millisecondsTimeout == -1 ? 0 : sw.ElapsedMilliseconds; - int registration = isUpgradable ? RwWaitUpgrade : RwWait; - - do { - int state = rwlock; - - if (state <= stateCheck) { - try {} - finally { - var toWrite = state + RwWrite - (registered ? registration : 0); - if (Interlocked.CompareExchange (ref rwlock, toWrite, state) == state) { - writerDoneEvent.Reset (); - ctstate.LockState ^= LockState.Write; - ++ctstate.WriterRecursiveCount; - --numWriteWaiters; - registered = false; - success = true; - } - } - if (success) - return true; - } - - state = rwlock; - - // We register our interest in taking the Write lock (if upgradeable it's already done) - if (!isUpgradable) { - while ((state & RwWait) == 0) { - try {} - finally { - if (Interlocked.CompareExchange (ref rwlock, state | RwWait, state) == state) - registered = true; - } - if (registered) - break; - state = rwlock; - } - } - - // Before falling to sleep - do { - if (rwlock <= stateCheck) - break; - if ((rwlock & RwWrite) != 0) - writerDoneEvent.Wait (ComputeTimeout (millisecondsTimeout, start)); - else if ((rwlock >> RwReadBit) > 0) - readerDoneEvent.Wait (ComputeTimeout (millisecondsTimeout, start)); - } while (millisecondsTimeout < 0 || (sw.ElapsedMilliseconds - start) < millisecondsTimeout); - } while (millisecondsTimeout < 0 || (sw.ElapsedMilliseconds - start) < millisecondsTimeout); - - --numWriteWaiters; - } finally { - if (registered) - Interlocked.Add (ref rwlock, isUpgradable ? -RwWaitUpgrade : -RwWait); - } - - return false; - } - - public bool TryEnterWriteLock (TimeSpan timeout) - { - return TryEnterWriteLock (CheckTimeout (timeout)); - } - - public void ExitWriteLock () - { - RuntimeHelpers.PrepareConstrainedRegions (); - try {} - finally { - ThreadLockState ctstate = CurrentThreadState; - - if (!ctstate.LockState.Has (LockState.Write)) - throw new SynchronizationLockException ("The current thread has not entered the lock in write mode"); - - if (--ctstate.WriterRecursiveCount == 0) { - bool isUpgradable = ctstate.LockState.Has (LockState.Upgradable); - ctstate.LockState ^= LockState.Write; - - int value = Interlocked.Add (ref rwlock, isUpgradable ? RwRead - RwWrite : -RwWrite); - writerDoneEvent.Set (); - if (isUpgradable && value >> RwReadBit == 1) - readerDoneEvent.Reset (); - } - } - } - - public void EnterUpgradeableReadLock () - { - TryEnterUpgradeableReadLock (-1); - } - - // - // Taking the Upgradable read lock is like taking a read lock - // but we limit it to a single upgradable at a time. - // - public bool TryEnterUpgradeableReadLock (int millisecondsTimeout) - { - ThreadLockState ctstate = CurrentThreadState; - - if (CheckState (ctstate, millisecondsTimeout, LockState.Upgradable)) { - ++ctstate.UpgradeableRecursiveCount; - return true; - } - - if (ctstate.LockState.Has (LockState.Read)) - throw new LockRecursionException ("The current thread has already entered read mode"); - - ++numUpgradeWaiters; - long start = millisecondsTimeout == -1 ? 0 : sw.ElapsedMilliseconds; - bool taken = false; - bool success = false; - - // We first try to obtain the upgradeable right - try { - while (!upgradableEvent.IsSet () || !taken) { - try {} - finally { - taken = upgradableTaken.TryRelaxedSet (); - } - if (taken) - break; - if (millisecondsTimeout != -1 && (sw.ElapsedMilliseconds - start) > millisecondsTimeout) { - --numUpgradeWaiters; - return false; - } - - upgradableEvent.Wait (ComputeTimeout (millisecondsTimeout, start)); - } - - upgradableEvent.Reset (); - - RuntimeHelpers.PrepareConstrainedRegions (); - try { - // Then it's a simple reader lock acquiring - TryEnterReadLock (ComputeTimeout (millisecondsTimeout, start), ref success); - } finally { - if (success) { - ctstate.LockState |= LockState.Upgradable; - ctstate.LockState &= ~LockState.Read; - --ctstate.ReaderRecursiveCount; - ++ctstate.UpgradeableRecursiveCount; - } else { - upgradableTaken.Value = false; - upgradableEvent.Set (); - } - } - - --numUpgradeWaiters; - } catch { - // An async exception occured, if we had taken the upgradable mode, release it - if (taken && !success) - upgradableTaken.Value = false; - } - - return success; - } - - public bool TryEnterUpgradeableReadLock (TimeSpan timeout) - { - return TryEnterUpgradeableReadLock (CheckTimeout (timeout)); - } - - public void ExitUpgradeableReadLock () - { - RuntimeHelpers.PrepareConstrainedRegions (); - try {} - finally { - ThreadLockState ctstate = CurrentThreadState; - - if (!ctstate.LockState.Has (LockState.Upgradable | LockState.Read)) - throw new SynchronizationLockException ("The current thread has not entered the lock in upgradable mode"); - - if (--ctstate.UpgradeableRecursiveCount == 0) { - upgradableTaken.Value = false; - upgradableEvent.Set (); - - ctstate.LockState &= ~LockState.Upgradable; - if (Interlocked.Add (ref rwlock, -RwRead) >> RwReadBit == 0) - readerDoneEvent.Set (); - } - } - - } - - public void Dispose () - { - if (disposed) - return; - - if (IsReadLockHeld || IsUpgradeableReadLockHeld || IsWriteLockHeld) - throw new SynchronizationLockException ("The lock is being disposed while still being used"); - - disposed = true; - } - - public bool IsReadLockHeld { - get { - return rwlock >= RwRead && CurrentThreadState.LockState.Has (LockState.Read); - } - } - - public bool IsWriteLockHeld { - get { - return (rwlock & RwWrite) > 0 && CurrentThreadState.LockState.Has (LockState.Write); - } - } - - public bool IsUpgradeableReadLockHeld { - get { - return upgradableTaken.Value && CurrentThreadState.LockState.Has (LockState.Upgradable); - } - } - - public int CurrentReadCount { - get { - return (rwlock >> RwReadBit) - (upgradableTaken.Value ? 1 : 0); - } - } - - public int RecursiveReadCount { - get { - return CurrentThreadState.ReaderRecursiveCount; - } - } - - public int RecursiveUpgradeCount { - get { - return CurrentThreadState.UpgradeableRecursiveCount; - } - } - - public int RecursiveWriteCount { - get { - return CurrentThreadState.WriterRecursiveCount; - } - } - - public int WaitingReadCount { - get { - return numReadWaiters; - } - } - - public int WaitingUpgradeCount { - get { - return numUpgradeWaiters; - } - } - - public int WaitingWriteCount { - get { - return numWriteWaiters; - } - } - - public LockRecursionPolicy RecursionPolicy { - get { - return recursionPolicy; - } - } - - ThreadLockState CurrentThreadState { - get { - int tid = Thread.CurrentThread.ManagedThreadId; - - return tid < fastStateCache.Length ? - fastStateCache [tid] ?? (fastStateCache[tid] = new ThreadLockState ()) : - GetGlobalThreadState (tid); - } - } - - ThreadLockState GetGlobalThreadState (int tid) - { - if (currentThreadState == null) - Interlocked.CompareExchange (ref currentThreadState, new Dictionary (), null); - - ThreadLockState state; - if (!currentThreadState.TryGetValue (id, out state)) - currentThreadState [id] = state = new ThreadLockState (); - - return state; - } - - bool CheckState (ThreadLockState state, int millisecondsTimeout, LockState validState) - { - if (disposed) - throw new ObjectDisposedException ("ReaderWriterLockSlim"); - - if (millisecondsTimeout < -1) - throw new ArgumentOutOfRangeException ("millisecondsTimeout"); - - // Detect and prevent recursion - LockState ctstate = state.LockState; - - if (ctstate != LockState.None && noRecursion && (!ctstate.Has (LockState.Upgradable) || validState == LockState.Upgradable)) - throw new LockRecursionException ("The current thread has already a lock and recursion isn't supported"); - - if (noRecursion) - return false; - - // If we already had right lock state, just return - if (ctstate.Has (validState)) - return true; - - // In read mode you can just enter Read recursively - if (ctstate == LockState.Read) - throw new LockRecursionException (); - - return false; - } - - static int CheckTimeout (TimeSpan timeout) - { - try { - return checked ((int)timeout.TotalMilliseconds); - } catch (System.OverflowException) { - throw new ArgumentOutOfRangeException ("timeout"); - } - } - - static int ComputeTimeout (int millisecondsTimeout, long start) - { - return millisecondsTimeout == -1 ? -1 : (int)Math.Max (sw.ElapsedMilliseconds - start - millisecondsTimeout, 1); - } - } -} diff --git a/mcs/class/System.Core/System/TimeZoneInfo.Android.cs b/mcs/class/System.Core/System/TimeZoneInfo.Android.cs index 72285cc0dab..b0f65d61dff 100644 --- a/mcs/class/System.Core/System/TimeZoneInfo.Android.cs +++ b/mcs/class/System.Core/System/TimeZoneInfo.Android.cs @@ -531,16 +531,11 @@ namespace System { return sign * (hour * 60) * 60; } - static readonly object _lock = new object (); - static TimeZoneInfo defaultZone; internal static TimeZoneInfo Local { get { - lock (_lock) { - if (defaultZone != null) - return defaultZone; - return defaultZone = GetTimeZone ("Local", GetDefaultTimeZoneName ()); - } + var id = GetDefaultTimeZoneName (); + return defaultZone = GetTimeZone (id, id); } } diff --git a/mcs/class/System.Core/System/TimeZoneInfo.cs b/mcs/class/System.Core/System/TimeZoneInfo.cs index f6fa19c0d34..2b36c15e30f 100644 --- a/mcs/class/System.Core/System/TimeZoneInfo.cs +++ b/mcs/class/System.Core/System/TimeZoneInfo.cs @@ -116,7 +116,14 @@ namespace System using (Stream stream = GetMonoTouchData (null)) { return BuildFromStream ("Local", stream); } -#elif LIBC +#else + if (IsWindows && LocalZoneKey != null) { + string name = (string)LocalZoneKey.GetValue ("TimeZoneKeyName"); + name = TrimSpecial (name); + if (name != null) + return TimeZoneInfo.FindSystemTimeZoneById (name); + } + var tz = Environment.GetEnvironmentVariable ("TZ"); if (tz != null) { if (tz == String.Empty) @@ -137,15 +144,6 @@ namespace System return null; } } -#else - if (IsWindows && LocalZoneKey != null) { - string name = (string)LocalZoneKey.GetValue ("TimeZoneKeyName"); - name = TrimSpecial (name); - if (name != null) - return TimeZoneInfo.FindSystemTimeZoneById (name); - } - - return null; #endif } @@ -426,12 +424,6 @@ namespace System return FromRegistryKey(id, key); } #endif -#if MONODROID - var timeZoneInfo = AndroidTimeZones.GetTimeZone (id, id); - if (timeZoneInfo == null) - throw new TimeZoneNotFoundException (); - return timeZoneInfo; -#else // Local requires special logic that already exists in the Local property (bug #326) if (id == "Local") return Local; @@ -439,12 +431,16 @@ namespace System using (Stream stream = GetMonoTouchData (id)) { return BuildFromStream (id, stream); } +#elif MONODROID + var timeZoneInfo = AndroidTimeZones.GetTimeZone (id, id); + if (timeZoneInfo == null) + throw new TimeZoneNotFoundException (); + return timeZoneInfo; #elif LIBC string filepath = Path.Combine (TimeZoneDirectory, id); return FindSystemTimeZoneByFileName (id, filepath); #else throw new NotImplementedException (); -#endif #endif } @@ -1179,9 +1175,9 @@ namespace System DateTime ttime = pair.Key; TimeType ttype = pair.Value; if (!ttype.IsDst) { - if (standardDisplayName != ttype.Name || baseUtcOffset.TotalSeconds != ttype.Offset) { + if (standardDisplayName != ttype.Name) standardDisplayName = ttype.Name; - daylightDisplayName = null; + if (baseUtcOffset.TotalSeconds != ttype.Offset) { baseUtcOffset = new TimeSpan (0, 0, ttype.Offset); if (adjustmentRules.Count > 0) // We ignore AdjustmentRules but store transitions. storeTransition = true; @@ -1217,10 +1213,11 @@ namespace System } dst_observed = false; } else { - if (daylightDisplayName != ttype.Name || dstDelta.TotalSeconds != ttype.Offset - baseUtcOffset.TotalSeconds) { + if (daylightDisplayName != ttype.Name) daylightDisplayName = ttype.Name; + if (dstDelta.TotalSeconds != ttype.Offset - baseUtcOffset.TotalSeconds) dstDelta = new TimeSpan(0, 0, ttype.Offset) - baseUtcOffset; - } + dst_start = ttime; dst_observed = true; } diff --git a/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs b/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs index 1cf514c7aab..19bfe4856cd 100644 --- a/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs +++ b/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs @@ -627,7 +627,7 @@ namespace MonoTests.System.Linq { // Contains (TSource) Assert.IsTrue (data.Contains (2)); for (int i = 0; i < 50; ++i) - Console.WriteLine (icoll.Contains (0));//Console.WriteLine (data.Contains (0)); + icoll.Contains (i);//Console.WriteLine (data.Contains (0)); IsFalse (data.Contains (0), data); // Contains (TSource, IEqualityComparer) diff --git a/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs b/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs index 6629133fc3d..d9fac1818d3 100644 --- a/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs +++ b/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs @@ -313,7 +313,7 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4, 5}; int [] result = {3, 4, 5}; - AssertAreSame (result, data.AsReallyParallel ().AsOrdered ().Skip (3).ToArray ()); + AssertAreSame (result, data.AsParallel ().AsOrdered ().Skip (3).ToArray ()); } [Test] @@ -322,7 +322,7 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4, 5}; int [] result = {3, 4, 5}; - AssertAreSame (result, data.AsReallyParallel ().AsOrdered ().Skip (3)); + AssertAreSame (result, data.AsParallel ().AsOrdered ().Skip (3)); } [Test] @@ -331,7 +331,7 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4, 5}; int [] result = {3, 4, 5}; - AssertAreSame (result, data.AsReallyParallel ().AsOrdered ().SkipWhile (i => i < 3)); + AssertAreSame (result, data.AsParallel ().AsOrdered ().SkipWhile (i => i < 3)); } [Test] @@ -340,7 +340,7 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4, 5}; int [] result = {0, 1, 2}; - AssertAreSame (result, data.AsReallyParallel ().AsOrdered ().Take (3)); + AssertAreSame (result, data.AsParallel ().AsOrdered ().Take (3)); } [Test] @@ -349,7 +349,7 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4, 5}; int [] result = {0, 1, 2}; - AssertAreSame (result, data.AsReallyParallel ().AsOrdered ().TakeWhile (i => i < 3)); + AssertAreSame (result, data.AsParallel ().AsOrdered ().TakeWhile (i => i < 3)); } [Test] @@ -371,7 +371,7 @@ namespace MonoTests.System.Linq IEnumerable expected = initial.SelectMany ((i) => Enumerable.Range (1, i)); ParallelTestHelper.Repeat (() => { - var actual = initial.AsReallyParallel ().AsOrdered ().SelectMany ((i) => Enumerable.Range (1, i)); + var actual = initial.AsParallel ().AsOrdered ().SelectMany ((i) => Enumerable.Range (1, i)); AssertAreSame (expected, actual); }); } @@ -381,7 +381,7 @@ namespace MonoTests.System.Linq { int [] data = {1, 2, 3}; - Assert.AreEqual (3, data.AsReallyParallel ().AsOrdered ().Last ()); + Assert.AreEqual (3, data.AsParallel ().AsOrdered ().Last ()); } [Test] @@ -389,7 +389,7 @@ namespace MonoTests.System.Linq { int [] data = {}; - Assert.AreEqual (default (int), data.AsReallyParallel ().AsOrdered ().LastOrDefault ()); + Assert.AreEqual (default (int), data.AsParallel ().AsOrdered ().LastOrDefault ()); } [Test] @@ -397,7 +397,7 @@ namespace MonoTests.System.Linq { int [] data = {1, 2, 3}; - Assert.AreEqual (1, data.AsReallyParallel ().AsOrdered ().First ()); + Assert.AreEqual (1, data.AsParallel ().AsOrdered ().First ()); } [Test] @@ -405,7 +405,7 @@ namespace MonoTests.System.Linq { int [] data = {}; - Assert.AreEqual (default (int), data.AsReallyParallel ().AsOrdered ().FirstOrDefault ()); + Assert.AreEqual (default (int), data.AsParallel ().AsOrdered ().FirstOrDefault ()); } [Test] @@ -414,8 +414,8 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4}; int [] result = {4, 3, 2, 1, 0}; - AssertAreSame (result, ((IEnumerable)data).Select ((i) => i).AsReallyParallel ().AsOrdered ().Reverse ()); - AssertAreSame (result, ParallelEnumerable.Range (0, 5).AsReallyParallel ().AsOrdered ().Reverse ()); + AssertAreSame (result, ((IEnumerable)data).Select ((i) => i).AsParallel ().AsOrdered ().Reverse ()); + AssertAreSame (result, ParallelEnumerable.Range (0, 5).AsParallel ().AsOrdered ().Reverse ()); } [Test] @@ -561,9 +561,9 @@ namespace MonoTests.System.Linq public void ElementAtTestCase() { //ParallelTestHelper.Repeat (() => { - Assert.AreEqual(1, baseEnumerable.AsReallyParallel ().AsOrdered ().ElementAt(0), "#1"); - Assert.AreEqual(51, baseEnumerable.AsReallyParallel ().AsOrdered ().ElementAt(50), "#2"); - Assert.AreEqual(489, baseEnumerable.AsReallyParallel ().AsOrdered ().ElementAt(488), "#3"); + Assert.AreEqual(1, baseEnumerable.AsParallel ().AsOrdered ().ElementAt(0), "#1"); + Assert.AreEqual(51, baseEnumerable.AsParallel ().AsOrdered ().ElementAt(50), "#2"); + Assert.AreEqual(489, baseEnumerable.AsParallel ().AsOrdered ().ElementAt(488), "#3"); //}); } @@ -591,12 +591,11 @@ namespace MonoTests.System.Linq { var items = new [] { 1, 2, 3 }; var items2 = new [] { 1, 2, 3, 4 }; - var actual = items.AsReallyParallel ().Join (items2.AsReallyParallel (), i => i, i => i, (e1, e2) => e1 + e2); + var actual = items.AsReallyParallel ().Join (items2.AsParallel (), i => i, i => i, (e1, e2) => e1 + e2); AreEquivalent (new[] { 2, 4, 6 }, actual); } [Test] - [Category ("NotWorking")] // Deadlocks randomly public void TestGroupBy () { int num = 100; @@ -624,12 +623,12 @@ namespace MonoTests.System.Linq public void TakeTestCase() { ParallelTestHelper.Repeat (() => { - ParallelQuery async_res = baseEnumerable.AsReallyParallel ().AsOrdered ().Take(800); + ParallelQuery async_res = baseEnumerable.AsParallel ().AsOrdered ().Take(800); IEnumerable sync = baseEnumerable.Take(800); AreEquivalent(sync, async_res); - async_res = baseEnumerable.AsReallyParallel ().AsOrdered ().Take(100); + async_res = baseEnumerable.AsParallel ().AsOrdered ().Take(100); sync = baseEnumerable.Take(100); AreEquivalent(sync, async_res); @@ -656,7 +655,7 @@ namespace MonoTests.System.Linq public void SkipTestCase() { ParallelTestHelper.Repeat (() => { - ParallelQuery async_res = baseEnumerable.AsReallyParallel ().AsOrdered().Skip (800); + ParallelQuery async_res = baseEnumerable.AsParallel ().AsOrdered().Skip (800); IEnumerable sync = baseEnumerable.Skip (800); AreEquivalent (sync, async_res); @@ -778,14 +777,14 @@ namespace MonoTests.System.Linq int [] result = {0, 1, 2}; - var array = coll.AsReallyParallel ().AsOrdered().ToArray (); + var array = coll.AsParallel ().AsOrdered().ToArray (); AssertAreSame (result, array); AssertIsOrdered (array, result.Length); Assert.AreEqual (typeof (int []), array.GetType ()); - array = Enumerable.Range (1, 100).Select ((i) => i).AsReallyParallel ().AsOrdered().ToArray (); + array = Enumerable.Range (1, 100).Select ((i) => i).AsParallel ().AsOrdered().ToArray (); result = Enumerable.Range (1, 100).ToArray (); AssertAreSame (result, array); @@ -897,12 +896,12 @@ namespace MonoTests.System.Linq var data2 = new int[] { 1, 2, 4 }; var data3 = new int[] { 1, 2, 3, 4 }; - Assert.IsTrue (data1.AsReallyParallel ().SequenceEqual (data1.AsReallyParallel ())); - Assert.IsTrue (data2.AsReallyParallel ().SequenceEqual (data2.AsReallyParallel ())); - Assert.IsTrue (data3.AsReallyParallel ().SequenceEqual (data3.AsReallyParallel ())); - Assert.IsFalse (data1.AsReallyParallel ().SequenceEqual (data2.AsReallyParallel ())); - Assert.IsFalse (data1.AsReallyParallel ().SequenceEqual (data3.AsReallyParallel ())); - Assert.IsFalse (data2.AsReallyParallel ().SequenceEqual (data3.AsReallyParallel ())); + Assert.IsTrue (data1.AsParallel ().SequenceEqual (data1.AsParallel ())); + Assert.IsTrue (data2.AsParallel ().SequenceEqual (data2.AsParallel ())); + Assert.IsTrue (data3.AsParallel ().SequenceEqual (data3.AsParallel ())); + Assert.IsFalse (data1.AsParallel ().SequenceEqual (data2.AsParallel ())); + Assert.IsFalse (data1.AsParallel ().SequenceEqual (data3.AsParallel ())); + Assert.IsFalse (data2.AsParallel ().SequenceEqual (data3.AsParallel ())); } [Test] diff --git a/mcs/class/System.Core/Test/System.Threading/ReaderWriterLockSlimTest.cs b/mcs/class/System.Core/Test/System.Threading/ReaderWriterLockSlimTest.cs index aef9fffbb55..8e2c3174504 100644 --- a/mcs/class/System.Core/Test/System.Threading/ReaderWriterLockSlimTest.cs +++ b/mcs/class/System.Core/Test/System.Threading/ReaderWriterLockSlimTest.cs @@ -401,9 +401,14 @@ namespace MonoTests.System.Threading { var v = new ReaderWriterLockSlim (); int local = 10; + int ready_count = 0; + int entered_count = 0; + const int thread_count = 10; - var r = from i in Enumerable.Range (1, 10) select new Thread (() => { + var r = from i in Enumerable.Range (1, thread_count) select new Thread (() => { + Interlocked.Increment (ref ready_count); v.EnterReadLock (); + Interlocked.Increment (ref entered_count); Assert.AreEqual (11, local); }); @@ -415,12 +420,16 @@ namespace MonoTests.System.Threading t.Start (); } - Thread.Sleep (200); + while (ready_count != thread_count) + Thread.Sleep (10); + + /* Extra up to 2s of sleep to ensure all threads got the chance to enter the lock */ + for (int i = 0; i < 200 && v.WaitingReadCount != thread_count; ++i) + Thread.Sleep (10); local = 11; - // FIXME: Don't rely on Thread.Sleep (200) Assert.AreEqual (0, v.WaitingWriteCount, "in waiting write"); - Assert.AreEqual (10, v.WaitingReadCount, "in waiting read"); + Assert.AreEqual (thread_count, v.WaitingReadCount, "in waiting read"); Assert.AreEqual (0, v.WaitingUpgradeCount, "in waiting upgrade"); v.ExitWriteLock (); diff --git a/mcs/class/System.Core/basic_System.Core.dll.sources b/mcs/class/System.Core/basic_System.Core.dll.sources index 4f5e43d1042..7406bccf12b 100644 --- a/mcs/class/System.Core/basic_System.Core.dll.sources +++ b/mcs/class/System.Core/basic_System.Core.dll.sources @@ -1,10 +1 @@ -#include System.Core.dll.sources - -../../build/common/Consts.cs -../../build/common/Locale.cs -../../build/common/MonoTODOAttribute.cs -../Mono.Security/Mono.Security.Cryptography/CryptoTools.cs -../Mono.Security/Mono.Security.Cryptography/SymmetricTransform.cs -../corlib/System.Threading/AtomicBoolean.cs -../corlib/System.Collections.Generic/CollectionDebuggerView.cs -../corlib/System.Collections/HashPrimeNumbers.cs +#include net_4_0_System.Core.dll.sources diff --git a/mcs/class/System.Core/mobile_common_System.Core.dll.sources b/mcs/class/System.Core/mobile_common_System.Core.dll.sources index 10e86231252..13bba555289 100644 --- a/mcs/class/System.Core/mobile_common_System.Core.dll.sources +++ b/mcs/class/System.Core/mobile_common_System.Core.dll.sources @@ -36,60 +36,12 @@ System.Linq/SortSequenceContext.cs System.Linq/IQueryProvider.cs System.Collections.Generic/HashSet.cs System.Security.Cryptography/Aes.cs -System.Threading/LockRecursionPolicy.cs -System.Threading/ReaderWriterLockSlim.cs System.Threading/ThreadLockState.cs System.Threading/ReaderWriterLockSlimExtensions.cs -System.Linq.Parallel.QueryNodes/QueryBaseNode.cs -System.Linq.Parallel.QueryNodes/QueryCastNode.cs -System.Linq.Parallel.QueryNodes/QueryChildNode.cs -System.Linq.Parallel.QueryNodes/QueryConcatNode.cs -System.Linq.Parallel.QueryNodes/QueryDefaultEmptyNode.cs -System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs -System.Linq.Parallel.QueryNodes/QueryHeadWorkerNode.cs -System.Linq.Parallel.QueryNodes/QueryJoinNode.cs -System.Linq.Parallel.QueryNodes/QueryMuxNode.cs -System.Linq.Parallel.QueryNodes/QueryOptionNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderByNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderGuardNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderedStreamNode.cs -System.Linq.Parallel.QueryNodes/QueryReverseNode.cs -System.Linq.Parallel.QueryNodes/QuerySelectManyNode.cs -System.Linq.Parallel.QueryNodes/QuerySelectNode.cs -System.Linq.Parallel.QueryNodes/QuerySetNode.cs -System.Linq.Parallel.QueryNodes/QueryStartNode.cs -System.Linq.Parallel.QueryNodes/QueryStreamNode.cs -System.Linq.Parallel.QueryNodes/QueryWhereNode.cs -System.Linq.Parallel.QueryNodes/QueryZipNode.cs -System.Linq.Parallel.QueryNodes/SetInclusion.cs -System.Linq.Parallel.QueryNodes/WrapHelper.cs -System.Linq.Parallel/AggregationList.cs -System.Linq.Parallel/ConcurrentGrouping.cs -System.Linq.Parallel/ConcurrentLookup.cs -System.Linq.Parallel/INodeVisitor.cs -System.Linq.Parallel/IVisitableNode.cs -System.Linq.Parallel/OrderingEnumerator.cs -System.Linq.Parallel/ParallelExecuter.cs -System.Linq.Parallel/ParallelPartitioner.cs -System.Linq.Parallel/ParallelQueryEnumerator.cs -System.Linq.Parallel/ParallelQuickSort.cs -System.Linq.Parallel/QueryCheckerVisitor.cs -System.Linq.Parallel/QueryIsOrderedVisitor.cs -System.Linq.Parallel/QueryOptions.cs -System.Linq.Parallel/RangeList.cs -System.Linq.Parallel/RepeatList.cs -System.Linq.Parallel/ReverseList.cs -System.Linq.Parallel/StripPartitioner.cs -System.Linq.Parallel/TemporaryArea.cs System.Linq/EnumerableExecutor.cs System.Linq/EnumerableExecutor_T.cs System.Linq/EnumerableQuery.cs System.Linq/EnumerableQuery_T.cs -System.Linq/OrderedParallelQuery.cs -System.Linq/ParallelEnumerable.cs -System.Linq/ParallelExecutionMode.cs -System.Linq/ParallelMergeOptions.cs -System.Linq/ParallelQuery.cs System.IO.MemoryMappedFiles/MemoryMappedFile.cs System.IO.MemoryMappedFiles/MemoryMappedFileAccess.cs System.IO.MemoryMappedFiles/MemoryMappedFileOptions.cs @@ -103,6 +55,149 @@ System.IO/HandleInheritability.cs System.Threading.Tasks/TaskExtensions.cs System.Linq.Expressions/Extensions.cs System.Linq.Expressions/ExpressionTransformer.cs +ReferenceSources/SR.cs +ReferenceSources/Set.cs +../../build/common/SR.cs +../../../external/referencesource/System.Core/System/threading/ReaderWriterLockSlim/ReaderWriterLockSlim.cs ../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs ../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs System.Linq.Expressions/DynamicExpressionVisitor.cs +../../../external/referencesource/System.Core/System/Linq/ParallelEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs +../../../external/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/IntValueEvent.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs + +ReferenceSources/Set.cs +ReferenceSources/SR.cs +../../build/common/SR.cs diff --git a/mcs/class/System.Core/net_4_0_System.Core.dll.sources b/mcs/class/System.Core/net_4_0_System.Core.dll.sources index ee0a10c7b1c..70802fd7a45 100644 --- a/mcs/class/System.Core/net_4_0_System.Core.dll.sources +++ b/mcs/class/System.Core/net_4_0_System.Core.dll.sources @@ -1,4 +1,5 @@ #include dynamic_System.Core.dll.sources +../../build/common/SR.cs Assembly/AssemblyInfo.cs System/Actions.cs System/Funcs.cs @@ -60,8 +61,6 @@ System.Security.Cryptography/SHA384CryptoServiceProvider.cs System.Security.Cryptography/SHA512Cng.cs System.Security.Cryptography/SHA512CryptoServiceProvider.cs System.Threading/LockRecursionException.cs -System.Threading/LockRecursionPolicy.cs -System.Threading/ReaderWriterLockSlim.cs System.Threading/ThreadLockState.cs System.Threading/ReaderWriterLockSlimExtensions.cs System.Threading.Tasks/TaskExtensions.cs @@ -90,49 +89,143 @@ System.IO.Pipes/PipeUnix.cs System.IO.Pipes/PipeWin32.cs System.IO/HandleInheritability.cs -System.Linq.Parallel/ParallelQueryEnumerator.cs -System.Linq/OrderedParallelQuery.cs -System.Linq/ParallelMergeOptions.cs -System.Linq/ParallelExecutionMode.cs -System.Linq/ParallelEnumerable.cs -System.Linq.Parallel/ParallelPartitioner.cs -System.Linq.Parallel/RangeList.cs -System.Linq.Parallel/StripPartitioner.cs -System.Linq.Parallel/RepeatList.cs -System.Linq.Parallel/ParallelQuickSort.cs -System.Linq.Parallel/OrderingEnumerator.cs -System.Linq.Parallel/AggregationList.cs -System.Linq.Parallel/ConcurrentLookup.cs -System.Linq.Parallel/ConcurrentGrouping.cs -System.Linq.Parallel/ReverseList.cs -System.Linq.Parallel/ParallelExecuter.cs -System.Linq.Parallel/TemporaryArea.cs -System.Linq/ParallelQuery.cs -System.Linq.Parallel.QueryNodes/QueryWhereNode.cs -System.Linq.Parallel.QueryNodes/QueryCastNode.cs -System.Linq.Parallel.QueryNodes/QueryConcatNode.cs -System.Linq.Parallel.QueryNodes/QueryDefaultEmptyNode.cs -System.Linq.Parallel.QueryNodes/QueryOptionNode.cs -System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs -System.Linq.Parallel.QueryNodes/QuerySelectNode.cs -System.Linq.Parallel.QueryNodes/QuerySelectManyNode.cs -System.Linq.Parallel.QueryNodes/QueryStreamNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderedStreamNode.cs -System.Linq.Parallel.QueryNodes/QueryStartNode.cs -System.Linq.Parallel.QueryNodes/QueryBaseNode.cs -System.Linq.Parallel.QueryNodes/QueryChildNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderGuardNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderByNode.cs -System.Linq.Parallel.QueryNodes/QueryMuxNode.cs -System.Linq.Parallel.QueryNodes/QueryZipNode.cs -System.Linq.Parallel.QueryNodes/QuerySetNode.cs -System.Linq.Parallel.QueryNodes/QueryReverseNode.cs -System.Linq.Parallel.QueryNodes/SetInclusion.cs -System.Linq.Parallel.QueryNodes/WrapHelper.cs -System.Linq.Parallel.QueryNodes/QueryHeadWorkerNode.cs -System.Linq.Parallel.QueryNodes/QueryJoinNode.cs -System.Linq.Parallel/INodeVisitor.cs -System.Linq.Parallel/IVisitableNode.cs -System.Linq.Parallel/QueryCheckerVisitor.cs -System.Linq.Parallel/QueryIsOrderedVisitor.cs -System.Linq.Parallel/QueryOptions.cs +#PLINQ +../../../external/referencesource/System.Core/System/Linq/ParallelEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs +../../../external/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/IntValueEvent.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs +../../../external/referencesource/System.Core/System/threading/ReaderWriterLockSlim/ReaderWriterLockSlim.cs + +ReferenceSources/Set.cs +ReferenceSources/SR.cs diff --git a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_2_0.csproj b/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_2_0.csproj deleted file mode 100644 index ad266ec02c1..00000000000 --- a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_2_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BB9C24C9-41DC-4F08-BBCE-3698C695332B} - Library - 1699,1720 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Data.DataSetExtensions - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_4_0.csproj b/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_4_0.csproj deleted file mode 100644 index dc34cca6eab..00000000000 --- a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_4_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B77F6D18-6B1F-40A2-B6CA-56E2553C16EF} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Data.DataSetExtensions - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {C385F6FA-0893-438F-AA08-32E08FF478AA} - System.Web\System.Web-net_4_0-1 - - - - - - - diff --git a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_2_0.csproj b/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_2_0.csproj deleted file mode 100644 index a8f9cc16a6c..00000000000 --- a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_2_0.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B9F3CFD2-99EE-49B0-986F-E6089E4E5CFA} - Library - 1699,1720,219,169 - bin\Debug\System.Data.DataSetExtensions-tests-net_2_0 - True - False - - Properties - - - System.Data.DataSetExtensions_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,1720,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720,219,169 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {BB9C24C9-41DC-4F08-BBCE-3698C695332B} - System.Data.DataSetExtensions\System.Data.DataSetExtensions-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_4_0.csproj b/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_4_0.csproj deleted file mode 100644 index 95042c56451..00000000000 --- a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_4_0.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5B198F7D-3E59-4145-8446-D1D06A88BBAD} - Library - 1699,219,169 - bin\Debug\System.Data.DataSetExtensions-tests-net_4_0 - True - False - - Properties - - - System.Data.DataSetExtensions_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {B77F6D18-6B1F-40A2-B6CA-56E2553C16EF} - System.Data.DataSetExtensions\System.Data.DataSetExtensions-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {C385F6FA-0893-438F-AA08-32E08FF478AA} - System.Web\System.Web-net_4_0-1 - - - - - - - diff --git a/mcs/class/System.Data.Entity/Assembly/AssemblyInfo.cs b/mcs/class/System.Data.Entity/Assembly/AssemblyInfo.cs new file mode 100644 index 00000000000..84393c411db --- /dev/null +++ b/mcs/class/System.Data.Entity/Assembly/AssemblyInfo.cs @@ -0,0 +1,67 @@ +// +// AssemblyInfo.cs +// +// Authors: +// Marek Safar (marek.safar@gmail.com) +// +// Copyright 2014 Xamarin Inc (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Reflection; +using System.Resources; +using System.Security; +using System.Security.Permissions; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about the assembly + +[assembly: AssemblyTitle ("System.Data.Entity.dll")] +[assembly: AssemblyDescription ("System.Data.Entity.dll")] +[assembly: AssemblyDefaultAlias ("System.Data.Entity.dll")] + +[assembly: AssemblyCompany (Consts.MonoCompany)] +[assembly: AssemblyProduct (Consts.MonoProduct)] +[assembly: AssemblyCopyright (Consts.MonoCopyright)] + +#if MOBILE +[assembly: AssemblyVersion ("4.0.0.0")] +[assembly: SatelliteContractVersion ("4.0.0.0")] +[assembly: AssemblyInformationalVersion ("4.0.50524.0")] +[assembly: AssemblyFileVersion ("4.0.50524.0")] +#else +[assembly: AssemblyVersion (Consts.FxVersion)] +[assembly: SatelliteContractVersion (Consts.FxVersion)] +[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)] +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] +#endif + +[assembly: NeutralResourcesLanguage ("en-US")] +[assembly: CLSCompliant (true)] +[assembly: AssemblyDelaySign (true)] + +[assembly: AssemblyKeyFile ("../ecma.pub")] + +[assembly: ComVisible (false)] + diff --git a/mcs/class/System.Data.Entity/EntityRes.cs b/mcs/class/System.Data.Entity/EntityRes.cs new file mode 100644 index 00000000000..1c7c71a33fa --- /dev/null +++ b/mcs/class/System.Data.Entity/EntityRes.cs @@ -0,0 +1,637 @@ +namespace System.Data.Entity +{ + static class EntityRes + { + public static string GetString (string message, params object[] args) + { + return message; + } + + public static string CtxAlias { + get { + return GetString ("CtxAlias"); + } + } + + public static string CtxAliasedNamespaceImport { + get { + return GetString ("CtxAliasedNamespaceImport"); + } + } + + public static string CtxAnd { + get { + return GetString ("CtxAnd"); + } + } + + public static string CtxAnyElement { + get { + return GetString ("CtxAnyElement"); + } + } + + public static string CtxApplyClause { + get { + return GetString ("CtxApplyClause"); + } + } + + public static string CtxBetween { + get { + return GetString ("CtxBetween"); + } + } + + public static string CtxCase { + get { + return GetString ("CtxCase"); + } + } + + public static string CtxCaseElse { + get { + return GetString ("CtxCaseElse"); + } + } + + public static string CtxCaseWhenThen { + get { + return GetString ("CtxCaseWhenThen"); + } + } + + public static string CtxCast { + get { + return GetString ("CtxCast"); + } + } + + public static string CtxCollatedOrderByClauseItem { + get { + return GetString ("CtxCollatedOrderByClauseItem"); + } + } + + public static string CtxCollectionTypeDefinition { + get { + return GetString ("CtxCollectionTypeDefinition"); + } + } + + public static string CtxCommandExpression { + get { + return GetString ("CtxCommandExpression"); + } + } + + public static string CtxCreateRef { + get { + return GetString ("CtxCreateRef"); + } + } + + public static string CtxDeref { + get { + return GetString ("CtxDeref"); + } + } + + public static string CtxDivide { + get { + return GetString ("CtxDivide"); + } + } + + public static string CtxElement { + get { + return GetString ("CtxElement"); + } + } + + public static string CtxEquals { + get { + return GetString ("CtxEquals"); + } + } + + public static string CtxEscapedIdentifier { + get { + return GetString ("CtxEscapedIdentifier"); + } + } + + public static string CtxExcept { + get { + return GetString ("CtxExcept"); + } + } + + public static string CtxExists { + get { + return GetString ("CtxExists"); + } + } + + public static string CtxExpressionList { + get { + return GetString ("CtxExpressionList"); + } + } + + public static string CtxFlatten { + get { + return GetString ("CtxFlatten"); + } + } + + public static string CtxFromApplyClause { + get { + return GetString ("CtxFromApplyClause"); + } + } + + public static string CtxFromClause { + get { + return GetString ("CtxFromClause"); + } + } + + public static string CtxFromClauseItem { + get { + return GetString ("CtxFromClauseItem"); + } + } + + public static string CtxFromClauseList { + get { + return GetString ("CtxFromClauseList"); + } + } + + public static string CtxFromJoinClause { + get { + return GetString ("CtxFromJoinClause"); + } + } + + public static string CtxFunctionDefinition { + get { + return GetString ("CtxFunctionDefinition"); + } + } + + public static string CtxGreaterThan { + get { + return GetString ("CtxGreaterThan"); + } + } + + public static string CtxGreaterThanEqual { + get { + return GetString ("CtxGreaterThanEqual"); + } + } + + public static string CtxGroupByClause { + get { + return GetString ("CtxGroupByClause"); + } + } + + public static string CtxGroupPartition { + get { + return GetString ("CtxGroupPartition"); + } + } + + public static string CtxHavingClause { + get { + return GetString ("CtxHavingClause"); + } + } + + public static string CtxIdentifier { + get { + return GetString ("CtxIdentifier"); + } + } + + public static string CtxIn { + get { + return GetString ("CtxIn"); + } + } + + public static string CtxIntersect { + get { + return GetString ("CtxIntersect"); + } + } + + public static string CtxIsNotNull { + get { + return GetString ("CtxIsNotNull"); + } + } + + public static string CtxIsNotOf { + get { + return GetString ("CtxIsNotOf"); + } + } + + public static string CtxIsNull { + get { + return GetString ("CtxIsNull"); + } + } + + public static string CtxIsOf { + get { + return GetString ("CtxIsOf"); + } + } + + public static string CtxJoinClause { + get { + return GetString ("CtxJoinClause"); + } + } + + public static string CtxJoinOnClause { + get { + return GetString ("CtxJoinOnClause"); + } + } + + public static string CtxKey { + get { + return GetString ("CtxKey"); + } + } + + public static string CtxLessThan { + get { + return GetString ("CtxLessThan"); + } + } + + public static string CtxLessThanEqual { + get { + return GetString ("CtxLessThanEqual"); + } + } + + public static string CtxLike { + get { + return GetString ("CtxLike"); + } + } + + public static string CtxLimitSubClause { + get { + return GetString ("CtxLimitSubClause"); + } + } + + public static string CtxLiteral { + get { + return GetString ("CtxLiteral"); + } + } + + public static string CtxMemberAccess { + get { + return GetString ("CtxMemberAccess"); + } + } + + public static string CtxMethod { + get { + return GetString ("CtxMethod"); + } + } + + public static string CtxMinus { + get { + return GetString ("CtxMinus"); + } + } + + public static string CtxModulus { + get { + return GetString ("CtxModulus"); + } + } + + public static string CtxMultiply { + get { + return GetString ("CtxMultiply"); + } + } + + public static string CtxMultisetCtor { + get { + return GetString ("CtxMultisetCtor"); + } + } + + public static string CtxNamespaceImport { + get { + return GetString ("CtxNamespaceImport"); + } + } + + public static string CtxNamespaceImportList { + get { + return GetString ("CtxNamespaceImportList"); + } + } + + public static string CtxNavigate { + get { + return GetString ("CtxNavigate"); + } + } + + public static string CtxNot { + get { + return GetString ("CtxNot"); + } + } + + public static string CtxNotBetween { + get { + return GetString ("CtxNotBetween"); + } + } + + public static string CtxNotEqual { + get { + return GetString ("CtxNotEqual"); + } + } + + public static string CtxNotIn { + get { + return GetString ("CtxNotIn"); + } + } + + public static string CtxNotLike { + get { + return GetString ("CtxNotLike"); + } + } + + public static string CtxNullLiteral { + get { + return GetString ("CtxNullLiteral"); + } + } + + public static string CtxOfType { + get { + return GetString ("CtxOfType"); + } + } + + public static string CtxOfTypeOnly { + get { + return GetString ("CtxOfTypeOnly"); + } + } + + public static string CtxOr { + get { + return GetString ("CtxOr"); + } + } + + public static string CtxOrderByClause { + get { + return GetString ("CtxOrderByClause"); + } + } + + public static string CtxOrderByClauseItem { + get { + return GetString ("CtxOrderByClauseItem"); + } + } + + public static string CtxOverlaps { + get { + return GetString ("CtxOverlaps"); + } + } + + public static string CtxParen { + get { + return GetString ("CtxParen"); + } + } + + public static string CtxPlus { + get { + return GetString ("CtxPlus"); + } + } + + public static string CtxQueryExpression { + get { + return GetString ("CtxQueryExpression"); + } + } + + public static string CtxQueryStatement { + get { + return GetString ("CtxQueryStatement"); + } + } + + public static string CtxRef { + get { + return GetString ("CtxRef"); + } + } + + public static string CtxRefTypeDefinition { + get { + return GetString ("CtxRefTypeDefinition"); + } + } + + public static string CtxRelationship { + get { + return GetString ("CtxRelationship"); + } + } + + public static string CtxRelationshipList { + get { + return GetString ("CtxRelationshipList"); + } + } + + public static string CtxRowCtor { + get { + return GetString ("CtxRowCtor"); + } + } + + public static string CtxRowTypeDefinition { + get { + return GetString ("CtxRowTypeDefinition"); + } + } + + public static string CtxSelectRowClause { + get { + return GetString ("CtxSelectRowClause"); + } + } + + public static string CtxSelectValueClause { + get { + return GetString ("CtxSelectValueClause"); + } + } + + public static string CtxSet { + get { + return GetString ("CtxSet"); + } + } + + public static string CtxSimpleIdentifier { + get { + return GetString ("CtxSimpleIdentifier"); + } + } + + public static string CtxSkipSubClause { + get { + return GetString ("CtxSkipSubClause"); + } + } + + public static string CtxTopSubClause { + get { + return GetString ("CtxTopSubClause"); + } + } + + public static string CtxTreat { + get { + return GetString ("CtxTreat"); + } + } + + public static string CtxTypeName { + get { + return GetString ("CtxTypeName"); + } + } + + public static string CtxTypeNameWithTypeSpec { + get { + return GetString ("CtxTypeNameWithTypeSpec"); + } + } + + public static string CtxUnaryMinus { + get { + return GetString ("CtxUnaryMinus"); + } + } + + public static string CtxUnaryPlus { + get { + return GetString ("CtxUnaryPlus"); + } + } + + public static string CtxUnion { + get { + return GetString ("CtxUnion"); + } + } + + public static string CtxUnionAll { + get { + return GetString ("CtxUnionAll"); + } + } + + public static string CtxWhereClause { + get { + return GetString ("CtxWhereClause"); + } + } + + public static string ParserFatalError { + get { + return GetString ("ParserFatalError"); + } + } + + public static string ParserInputError { + get { + return GetString ("ParserInputError"); + } + } + + public static string GenericSyntaxError { + get { + return GetString ("GenericSyntaxError"); + } + } + + public static string InvalidSchemaEncountered { + get { + return GetString ("InvalidSchemaEncountered"); + } + } + + + public static string ViewGen_Foreign_Key_ColumnOrder_Incorrect { + get { + return GetString ("ViewGen_Foreign_Key_ColumnOrder_Incorrect"); + } + } + + public static string ViewGen_CommaBlank { + get { + return GetString ("ViewGen_CommaBlank"); + } + } + + public static string Mapping_Default_OCMapping_Member_Type_Mismatch { + get { + return GetString ("Mapping_Default_OCMapping_Member_Type_Mismatch"); + } + } + + public static string EntityClient_ProviderSpecificError { + get { + return GetString ("EntityClient_ProviderSpecificError"); + } + } + + public const string EntityDataCategory_Context = "EntityDataCategory_Context"; + public const string DataCategory_Data = "DataCategory_Data"; + public const string EntityDataCategory_Source = "EntityDataCategory_Source"; + public const string EntityDataCategory_NamedConnectionString = "EntityDataCategory_NamedConnectionString"; + public const string DataCategory_Update = "DataCategory_Update"; + public const string EntityConnectionString_ProviderConnectionString = "EntityConnectionString_ProviderConnectionString"; + public const string DbParameter_Direction = "DbParameter_Direction"; + public const string DbParameter_Size = "DbParameter_Size"; + public const string DbParameter_SourceColumn = "DbParameter_SourceColumn"; + public const string EntityConnectionString_Provider = "EntityConnectionString_Provider"; + public const string DbParameter_SourceVersion = "DbParameter_SourceVersion"; + public const string EntityConnectionString_Metadata = "EntityConnectionString_Metadata"; + public const string EntityConnectionString_Name = "EntityConnectionString_Name"; + } +} \ No newline at end of file diff --git a/mcs/class/System.Data.Entity/EntityResCategoryAttribute.cs b/mcs/class/System.Data.Entity/EntityResCategoryAttribute.cs new file mode 100644 index 00000000000..6064b9d4e1e --- /dev/null +++ b/mcs/class/System.Data.Entity/EntityResCategoryAttribute.cs @@ -0,0 +1,12 @@ +using System.ComponentModel; + +namespace System.Data +{ + sealed class EntityResCategoryAttribute : CategoryAttribute + { + public EntityResCategoryAttribute (string category) + : base (category) + { + } + } +} \ No newline at end of file diff --git a/mcs/class/System.Data.Entity/EntityResDescriptionAttribute.cs b/mcs/class/System.Data.Entity/EntityResDescriptionAttribute.cs new file mode 100644 index 00000000000..de58f045739 --- /dev/null +++ b/mcs/class/System.Data.Entity/EntityResDescriptionAttribute.cs @@ -0,0 +1,12 @@ +using System.ComponentModel; + +namespace System.Data +{ + sealed class EntityResDescriptionAttribute : DescriptionAttribute + { + public EntityResDescriptionAttribute (string description) + : base (description) + { + } + } +} \ No newline at end of file diff --git a/mcs/class/System.Data.Entity/Error.cs b/mcs/class/System.Data.Entity/Error.cs new file mode 100644 index 00000000000..40a57cee774 --- /dev/null +++ b/mcs/class/System.Data.Entity/Error.cs @@ -0,0 +1,25 @@ +namespace System.Data.Entity +{ + static class Error + { + public static Exception ArgumentNull (string paramName) + { + return new ArgumentNullException (paramName); + } + + public static Exception ArgumentOutOfRange (string paramName) + { + return new ArgumentOutOfRangeException (paramName); + } + + public static Exception NotImplemented () + { + return new NotImplementedException (); + } + + public static Exception NotSupported () + { + return new NotSupportedException (); + } + } +} \ No newline at end of file diff --git a/mcs/class/System.Data.Entity/Makefile b/mcs/class/System.Data.Entity/Makefile new file mode 100644 index 00000000000..d3617e41f92 --- /dev/null +++ b/mcs/class/System.Data.Entity/Makefile @@ -0,0 +1,10 @@ +thisdir = class/System.Data.Entity +SUBDIRS = +include ../../build/rules.make + +LIBRARY = System.Data.Entity.dll +LIB_MCS_FLAGS = -r:System.dll -r:System.Core.dll -r:System.Data.dll -r:System.Xml.dll -r:System.Xml.Linq.dll -r:System.Transactions.dll \ + -r:System.Runtime.Serialization.dll -r:System.ComponentModel.DataAnnotations.dll -r:System.Configuration.dll \ + -warn:2 + +include ../../build/library.make diff --git a/mcs/class/System.Data.Entity/Strings.cs b/mcs/class/System.Data.Entity/Strings.cs new file mode 100644 index 00000000000..715b1a8e934 --- /dev/null +++ b/mcs/class/System.Data.Entity/Strings.cs @@ -0,0 +1,7721 @@ +namespace System.Data.Entity +{ + + + + public static class Strings + { + public static string ADP_CollectionParameterElementIsNull (object p0) + { + return SR.GetString ("ADP_CollectionParameterElementIsNull", p0 ); + } + + public static string ADP_CollectionParameterElementIsNullOrEmpty (object p0) + { + return SR.GetString ("ADP_CollectionParameterElementIsNullOrEmpty", p0 ); + } + + public static string ADP_ConnectionStringSyntax (object p0) + { + return SR.GetString ("ADP_ConnectionStringSyntax", p0 ); + } + + public static string ADP_DataReaderClosed (object p0) + { + return SR.GetString ("ADP_DataReaderClosed", p0 ); + } + + public static string ADP_InternalProviderError (object p0) + { + return SR.GetString ("ADP_InternalProviderError", p0 ); + } + + public static string ADP_InvalidBufferSizeOrIndex (object p0, object p1) + { + return SR.GetString ("ADP_InvalidBufferSizeOrIndex", p0, p1 ); + } + + public static string ADP_InvalidConnectionOptionValue (object p0) + { + return SR.GetString ("ADP_InvalidConnectionOptionValue", p0 ); + } + + public static string ADP_InvalidDataLength (object p0) + { + return SR.GetString ("ADP_InvalidDataLength", p0 ); + } + + public static string ADP_InvalidDataReaderMissingColumnForType (object p0, object p1) + { + return SR.GetString ("ADP_InvalidDataReaderMissingColumnForType", p0, p1 ); + } + + public static string ADP_InvalidDataReaderMissingDiscriminatorColumn (object p0, object p1) + { + return SR.GetString ("ADP_InvalidDataReaderMissingDiscriminatorColumn", p0, p1 ); + } + + public static string ADP_InvalidDataReaderUnableToMaterializeNonScalarType (object p0, object p1) + { + return SR.GetString ("ADP_InvalidDataReaderUnableToMaterializeNonScalarType", p0, p1 ); + } + + public static string ADP_InvalidDataType (object p0) + { + return SR.GetString ("ADP_InvalidDataType", p0 ); + } + + public static string ADP_InvalidDestinationBufferIndex (object p0, object p1) + { + return SR.GetString ("ADP_InvalidDestinationBufferIndex", p0, p1 ); + } + + public static string ADP_InvalidEnumerationValue (object p0, object p1) + { + return SR.GetString ("ADP_InvalidEnumerationValue", p0, p1 ); + } + + public static string ADP_InvalidSizeValue (object p0) + { + return SR.GetString ("ADP_InvalidSizeValue", p0 ); + } + + public static string ADP_InvalidSourceBufferIndex (object p0, object p1) + { + return SR.GetString ("ADP_InvalidSourceBufferIndex", p0, p1 ); + } + + public static string ADP_KeysRequiredForJoinOverNest (object p0) + { + return SR.GetString ("ADP_KeysRequiredForJoinOverNest", p0 ); + } + + public static string ADP_KeywordNotSupported (object p0) + { + return SR.GetString ("ADP_KeywordNotSupported", p0 ); + } + + public static string ADP_NestingNotSupported (object p0, object p1) + { + return SR.GetString ("ADP_NestingNotSupported", p0, p1 ); + } + + public static string ADP_NonSequentialChunkAccess (object p0, object p1, object p2) + { + return SR.GetString ("ADP_NonSequentialChunkAccess", p0, p1, p2 ); + } + + public static string ADP_NonSequentialColumnAccess (object p0, object p1) + { + return SR.GetString ("ADP_NonSequentialColumnAccess", p0, p1 ); + } + + public static string ADP_NoQueryMappingView (object p0, object p1) + { + return SR.GetString ("ADP_NoQueryMappingView", p0, p1 ); + } + + public static string ADP_UnknownDataTypeCode (object p0, object p1) + { + return SR.GetString ("ADP_UnknownDataTypeCode", p0, p1 ); + } + + public static string AliasNameAlreadyUsed (object p0) + { + return SR.GetString ("AliasNameAlreadyUsed", p0 ); + } + + public static string AliasNameIsAlreadyDefined (object p0) + { + return SR.GetString ("AliasNameIsAlreadyDefined", p0 ); + } + + public static string AllArtifactsMustTargetSameProvider_InvariantName (object p0, object p1) + { + return SR.GetString ("AllArtifactsMustTargetSameProvider_InvariantName", p0, p1 ); + } + + public static string AllArtifactsMustTargetSameProvider_ManifestToken (object p0, object p1) + { + return SR.GetString ("AllArtifactsMustTargetSameProvider_ManifestToken", p0, p1 ); + } + + public static string AmbiguousEntityContainerEnd (object p0, object p1) + { + return SR.GetString ("AmbiguousEntityContainerEnd", p0, p1 ); + } + + public static string AmbiguousFunctionAndType (object p0, object p1) + { + return SR.GetString ("AmbiguousFunctionAndType", p0, p1 ); + } + + public static string AmbiguousFunctionOverload (object p0, object p1) + { + return SR.GetString ("AmbiguousFunctionOverload", p0, p1 ); + } + + public static string AmbiguousMetadataMemberName (object p0, object p1, object p2) + { + return SR.GetString ("AmbiguousMetadataMemberName", p0, p1, p2 ); + } + + public static string ArgumentOutOfRange (object p0) + { + return SR.GetString ("ArgumentOutOfRange", p0 ); + } + + public static string ArgumentOutOfRangeExpectedPostiveNumber (object p0) + { + return SR.GetString ("ArgumentOutOfRangeExpectedPostiveNumber", p0 ); + } + + public static string ArgumentTypesAreIncompatible (object p0, object p1) + { + return SR.GetString ("ArgumentTypesAreIncompatible", p0, p1 ); + } + + public static string AssemblyMissingFromAssembliesToConsider (object p0) + { + return SR.GetString ("AssemblyMissingFromAssembliesToConsider", p0 ); + } + + public static string BadNamespaceOrAlias (object p0) + { + return SR.GetString ("BadNamespaceOrAlias", p0 ); + } + + public static string BadNavigationPropertyBadFromRoleType (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("BadNavigationPropertyBadFromRoleType", p0, p1, p2, p3, p4 ); + } + + public static string BadNavigationPropertyRelationshipNotRelationship (object p0) + { + return SR.GetString ("BadNavigationPropertyRelationshipNotRelationship", p0 ); + } + + public static string BadNavigationPropertyUndefinedRole (object p0, object p1) + { + return SR.GetString ("BadNavigationPropertyUndefinedRole", p0, p1 ); + } + + public static string BadParameterDirection (object p0, object p1, object p2, object p3) + { + return SR.GetString ("BadParameterDirection", p0, p1, p2, p3 ); + } + + public static string BadParameterDirectionForComposableFunctions (object p0, object p1, object p2, object p3) + { + return SR.GetString ("BadParameterDirectionForComposableFunctions", p0, p1, p2, p3 ); + } + + public static string BadPrecisionAndScale (object p0, object p1) + { + return SR.GetString ("BadPrecisionAndScale", p0, p1 ); + } + + public static string BetweenLimitsTypesAreNotCompatible (object p0, object p1) + { + return SR.GetString ("BetweenLimitsTypesAreNotCompatible", p0, p1 ); + } + + public static string BetweenLimitsTypesAreNotOrderComparable (object p0, object p1) + { + return SR.GetString ("BetweenLimitsTypesAreNotOrderComparable", p0, p1 ); + } + + public static string BetweenValueIsNotOrderComparable (object p0, object p1) + { + return SR.GetString ("BetweenValueIsNotOrderComparable", p0, p1 ); + } + + public static string BothMinAndMaxValueMustBeSpecifiedForNonConstantFacet (object p0, object p1) + { + return SR.GetString ("BothMinAndMaxValueMustBeSpecifiedForNonConstantFacet", p0, p1 ); + } + + public static string CannotCallNoncomposableFunction (object p0) + { + return SR.GetString ("CannotCallNoncomposableFunction", p0 ); + } + + public static string CannotConvertNumericLiteral (object p0, object p1) + { + return SR.GetString ("CannotConvertNumericLiteral", p0, p1 ); + } + + public static string CannotInstantiateAbstractType (object p0) + { + return SR.GetString ("CannotInstantiateAbstractType", p0 ); + } + + public static string CannotResolveNameToTypeOrFunction (object p0) + { + return SR.GetString ("CannotResolveNameToTypeOrFunction", p0 ); + } + + public static string CannotUseSystemNamespaceAsAlias (object p0) + { + return SR.GetString ("CannotUseSystemNamespaceAsAlias", p0 ); + } + + public static string CheckArgumentContainsNullFailed (object p0) + { + return SR.GetString ("CheckArgumentContainsNullFailed", p0 ); + } + + public static string CodeGen_ConstructorNoParameterless (object p0) + { + return SR.GetString ("CodeGen_ConstructorNoParameterless", p0 ); + } + + public static string Collections_CannotFillTryDifferentMergeOption (object p0, object p1) + { + return SR.GetString ("Collections_CannotFillTryDifferentMergeOption", p0, p1 ); + } + + public static string Collections_ExpectedCollectionGotReference (object p0, object p1, object p2) + { + return SR.GetString ("Collections_ExpectedCollectionGotReference", p0, p1, p2 ); + } + + public static string Collections_InvalidEntityStateLoad (object p0) + { + return SR.GetString ("Collections_InvalidEntityStateLoad", p0 ); + } + + public static string Collections_NoRelationshipSetMatched (object p0) + { + return SR.GetString ("Collections_NoRelationshipSetMatched", p0 ); + } + + public static string CompiledELinq_UnsupportedNamedParameterType (object p0, object p1) + { + return SR.GetString ("CompiledELinq_UnsupportedNamedParameterType", p0, p1 ); + } + + public static string CompiledELinq_UnsupportedNamedParameterUseAsType (object p0, object p1) + { + return SR.GetString ("CompiledELinq_UnsupportedNamedParameterUseAsType", p0, p1 ); + } + + public static string CompiledELinq_UnsupportedParameterTypes (object p0) + { + return SR.GetString ("CompiledELinq_UnsupportedParameterTypes", p0 ); + } + + public static string ComplexObject_ComplexChangeRequestedOnScalarProperty (object p0) + { + return SR.GetString ("ComplexObject_ComplexChangeRequestedOnScalarProperty", p0 ); + } + + public static string ComplexObject_NullableComplexTypesNotSupported (object p0) + { + return SR.GetString ("ComplexObject_NullableComplexTypesNotSupported", p0 ); + } + + public static string ComplexTypeAsReturnTypeAndDefinedEntitySet (object p0, object p1) + { + return SR.GetString ("ComplexTypeAsReturnTypeAndDefinedEntitySet", p0, p1 ); + } + + public static string ComplexTypeAsReturnTypeAndNestedComplexProperty (object p0, object p1, object p2) + { + return SR.GetString ("ComplexTypeAsReturnTypeAndNestedComplexProperty", p0, p1, p2 ); + } + + public static string ConcurrencyRedefinedOnSubTypeOfEntitySetType (object p0, object p1, object p2) + { + return SR.GetString ("ConcurrencyRedefinedOnSubTypeOfEntitySetType", p0, p1, p2 ); + } + + public static string ConstantFacetSpecifiedInSchema (object p0, object p1) + { + return SR.GetString ("ConstantFacetSpecifiedInSchema", p0, p1 ); + } + + public static string CouldNotResolveIdentifier (object p0) + { + return SR.GetString ("CouldNotResolveIdentifier", p0 ); + } + + public static string Cqt_Arithmetic_InvalidUnsignedTypeForUnaryMinus (object p0) + { + return SR.GetString ("Cqt_Arithmetic_InvalidUnsignedTypeForUnaryMinus", p0 ); + } + + public static string Cqt_Binary_CollectionsRequired (object p0) + { + return SR.GetString ("Cqt_Binary_CollectionsRequired", p0 ); + } + + public static string Cqt_Cast_InvalidCast (object p0, object p1) + { + return SR.GetString ("Cqt_Cast_InvalidCast", p0, p1 ); + } + + public static string Cqt_CommandTree_InvalidParameterName (object p0) + { + return SR.GetString ("Cqt_CommandTree_InvalidParameterName", p0 ); + } + + public static string Cqt_Constant_ClrEnumTypeDoesNotMatchEdmEnumType (object p0, object p1, object p2) + { + return SR.GetString ("Cqt_Constant_ClrEnumTypeDoesNotMatchEdmEnumType", p0, p1, p2 ); + } + + public static string Cqt_Constant_InvalidConstantType (object p0) + { + return SR.GetString ("Cqt_Constant_InvalidConstantType", p0 ); + } + + public static string Cqt_Constant_InvalidValueForType (object p0) + { + return SR.GetString ("Cqt_Constant_InvalidValueForType", p0 ); + } + + public static string Cqt_Copier_EndNotFound (object p0, object p1) + { + return SR.GetString ("Cqt_Copier_EndNotFound", p0, p1 ); + } + + public static string Cqt_Copier_EntityContainerNotFound (object p0) + { + return SR.GetString ("Cqt_Copier_EntityContainerNotFound", p0 ); + } + + public static string Cqt_Copier_EntitySetNotFound (object p0, object p1) + { + return SR.GetString ("Cqt_Copier_EntitySetNotFound", p0, p1 ); + } + + public static string Cqt_Copier_FunctionNotFound (object p0) + { + return SR.GetString ("Cqt_Copier_FunctionNotFound", p0 ); + } + + public static string Cqt_Copier_NavPropertyNotFound (object p0, object p1) + { + return SR.GetString ("Cqt_Copier_NavPropertyNotFound", p0, p1 ); + } + + public static string Cqt_Copier_PropertyNotFound (object p0, object p1) + { + return SR.GetString ("Cqt_Copier_PropertyNotFound", p0, p1 ); + } + + public static string Cqt_Copier_TypeNotFound (object p0) + { + return SR.GetString ("Cqt_Copier_TypeNotFound", p0 ); + } + + public static string Cqt_CrossJoin_DuplicateVariableNames (object p0, object p1, object p2) + { + return SR.GetString ("Cqt_CrossJoin_DuplicateVariableNames", p0, p1, p2 ); + } + + public static string Cqt_ExpressionLink_TypeMismatch (object p0, object p1) + { + return SR.GetString ("Cqt_ExpressionLink_TypeMismatch", p0, p1 ); + } + + public static string Cqt_Factory_MethodResultTypeNotSupported (object p0) + { + return SR.GetString ("Cqt_Factory_MethodResultTypeNotSupported", p0 ); + } + + public static string Cqt_Factory_NoSuchProperty (object p0, object p1) + { + return SR.GetString ("Cqt_Factory_NoSuchProperty", p0, p1 ); + } + + public static string Cqt_Function_CanonicalFunction_AmbiguousMatch (object p0) + { + return SR.GetString ("Cqt_Function_CanonicalFunction_AmbiguousMatch", p0 ); + } + + public static string Cqt_Function_CanonicalFunction_NotFound (object p0) + { + return SR.GetString ("Cqt_Function_CanonicalFunction_NotFound", p0 ); + } + + public static string Cqt_General_PolymorphicArgRequired (object p0) + { + return SR.GetString ("Cqt_General_PolymorphicArgRequired", p0 ); + } + + public static string Cqt_General_PolymorphicTypeRequired (object p0) + { + return SR.GetString ("Cqt_General_PolymorphicTypeRequired", p0 ); + } + + public static string Cqt_General_UnsupportedExpression (object p0) + { + return SR.GetString ("Cqt_General_UnsupportedExpression", p0 ); + } + + public static string Cqt_GroupBy_AggregateColumnExistsAsGroupColumn (object p0) + { + return SR.GetString ("Cqt_GroupBy_AggregateColumnExistsAsGroupColumn", p0 ); + } + + public static string Cqt_GroupBy_KeyNotEqualityComparable (object p0) + { + return SR.GetString ("Cqt_GroupBy_KeyNotEqualityComparable", p0 ); + } + + public static string Cqt_InvalidTypeForSetOperation (object p0, object p1) + { + return SR.GetString ("Cqt_InvalidTypeForSetOperation", p0, p1 ); + } + + public static string Cqt_NewInstance_CannotInstantiateAbstractType (object p0) + { + return SR.GetString ("Cqt_NewInstance_CannotInstantiateAbstractType", p0 ); + } + + public static string Cqt_NewInstance_CannotInstantiateMemberlessType (object p0) + { + return SR.GetString ("Cqt_NewInstance_CannotInstantiateMemberlessType", p0 ); + } + + public static string Cqt_RelNav_WrongSourceType (object p0) + { + return SR.GetString ("Cqt_RelNav_WrongSourceType", p0 ); + } + + public static string Cqt_UDF_FunctionDefinitionGenerationFailed (object p0) + { + return SR.GetString ("Cqt_UDF_FunctionDefinitionGenerationFailed", p0 ); + } + + public static string Cqt_UDF_FunctionDefinitionResultTypeMismatch (object p0, object p1, object p2) + { + return SR.GetString ("Cqt_UDF_FunctionDefinitionResultTypeMismatch", p0, p1, p2 ); + } + + public static string Cqt_UDF_FunctionDefinitionWithCircularReference (object p0) + { + return SR.GetString ("Cqt_UDF_FunctionDefinitionWithCircularReference", p0 ); + } + + public static string Cqt_UDF_FunctionHasNoDefinition (object p0) + { + return SR.GetString ("Cqt_UDF_FunctionHasNoDefinition", p0 ); + } + + public static string Cqt_Unary_CollectionRequired (object p0) + { + return SR.GetString ("Cqt_Unary_CollectionRequired", p0 ); + } + + public static string Cqt_Util_CheckListDuplicateName (object p0, object p1, object p2) + { + return SR.GetString ("Cqt_Util_CheckListDuplicateName", p0, p1, p2 ); + } + + public static string Cqt_Validator_InvalidIncompatibleParameterReferences (object p0) + { + return SR.GetString ("Cqt_Validator_InvalidIncompatibleParameterReferences", p0 ); + } + + public static string Cqt_Validator_InvalidIncorrectDataSpaceMetadata (object p0, object p1) + { + return SR.GetString ("Cqt_Validator_InvalidIncorrectDataSpaceMetadata", p0, p1 ); + } + + public static string Cqt_Validator_InvalidOtherWorkspaceMetadata (object p0) + { + return SR.GetString ("Cqt_Validator_InvalidOtherWorkspaceMetadata", p0 ); + } + + public static string Cqt_Validator_VarRefInvalid (object p0) + { + return SR.GetString ("Cqt_Validator_VarRefInvalid", p0 ); + } + + public static string Cqt_Validator_VarRefTypeMismatch (object p0) + { + return SR.GetString ("Cqt_Validator_VarRefTypeMismatch", p0 ); + } + + public static string CreateRefTypeIdentifierMustBeASubOrSuperType (object p0, object p1) + { + return SR.GetString ("CreateRefTypeIdentifierMustBeASubOrSuperType", p0, p1 ); + } + + public static string CreateRefTypeIdentifierMustSpecifyAnEntityType (object p0, object p1) + { + return SR.GetString ("CreateRefTypeIdentifierMustSpecifyAnEntityType", p0, p1 ); + } + + public static string CtxFunction (object p0) + { + return SR.GetString ("CtxFunction", p0 ); + } + + public static string CtxTypeCtor (object p0) + { + return SR.GetString ("CtxTypeCtor", p0 ); + } + + public static string CycleInTypeHierarchy (object p0) + { + return SR.GetString ("CycleInTypeHierarchy", p0 ); + } + + public static string DeRefArgIsNotOfRefType (object p0) + { + return SR.GetString ("DeRefArgIsNotOfRefType", p0 ); + } + + public static string DifferentSchemaVersionInCollection (object p0, object p1, object p2) + { + return SR.GetString ("DifferentSchemaVersionInCollection", p0, p1, p2 ); + } + + public static string DuplicateAnnotation (object p0, object p1) + { + return SR.GetString ("DuplicateAnnotation", p0, p1 ); + } + + public static string DuplicatedFunctionoverloads (object p0, object p1) + { + return SR.GetString ("DuplicatedFunctionoverloads", p0, p1 ); + } + + public static string DuplicatedInlineFunctionOverload (object p0) + { + return SR.GetString ("DuplicatedInlineFunctionOverload", p0 ); + } + + public static string DuplicateEndName (object p0) + { + return SR.GetString ("DuplicateEndName", p0 ); + } + + public static string DuplicateEntityContainerMemberName (object p0) + { + return SR.GetString ("DuplicateEntityContainerMemberName", p0 ); + } + + public static string DuplicateEntitySetTable (object p0, object p1, object p2) + { + return SR.GetString ("DuplicateEntitySetTable", p0, p1, p2 ); + } + + public static string DuplicateMemberName (object p0, object p1, object p2) + { + return SR.GetString ("DuplicateMemberName", p0, p1, p2 ); + } + + public static string DuplicateMemberNameInExtendedEntityContainer (object p0, object p1, object p2) + { + return SR.GetString ("DuplicateMemberNameInExtendedEntityContainer", p0, p1, p2 ); + } + + public static string DuplicatePropertyNameSpecifiedInEntityKey (object p0, object p1) + { + return SR.GetString ("DuplicatePropertyNameSpecifiedInEntityKey", p0, p1 ); + } + + public static string DuplicationOperation (object p0) + { + return SR.GetString ("DuplicationOperation", p0 ); + } + + public static string EdmVersionNotSupportedByRuntime (object p0, object p1) + { + return SR.GetString ("EdmVersionNotSupportedByRuntime", p0, p1 ); + } + + public static string ELinq_EdmFunctionAttributedFunctionWithWrongReturnType (object p0, object p1) + { + return SR.GetString ("ELinq_EdmFunctionAttributedFunctionWithWrongReturnType", p0, p1 ); + } + + public static string ELinq_EdmFunctionAttributeParameterNameNotValid (object p0, object p1, object p2) + { + return SR.GetString ("ELinq_EdmFunctionAttributeParameterNameNotValid", p0, p1, p2 ); + } + + public static string ELinq_InvalidOfTypeResult (object p0) + { + return SR.GetString ("ELinq_InvalidOfTypeResult", p0 ); + } + + public static string ELinq_NotPropertyOrField (object p0) + { + return SR.GetString ("ELinq_NotPropertyOrField", p0 ); + } + + public static string ELinq_UnboundParameterExpression (object p0) + { + return SR.GetString ("ELinq_UnboundParameterExpression", p0 ); + } + + public static string ELinq_UnexpectedTypeForNavigationProperty (object p0, object p1, object p2, object p3) + { + return SR.GetString ("ELinq_UnexpectedTypeForNavigationProperty", p0, p1, p2, p3 ); + } + + public static string ELinq_UnhandledBindingType (object p0) + { + return SR.GetString ("ELinq_UnhandledBindingType", p0 ); + } + + public static string ELinq_UnhandledExpressionType (object p0) + { + return SR.GetString ("ELinq_UnhandledExpressionType", p0 ); + } + + public static string ELinq_UnrecognizedMember (object p0) + { + return SR.GetString ("ELinq_UnrecognizedMember", p0 ); + } + + public static string ELinq_UnresolvableFunctionForExpression (object p0) + { + return SR.GetString ("ELinq_UnresolvableFunctionForExpression", p0 ); + } + + public static string ELinq_UnresolvableFunctionForMember (object p0, object p1) + { + return SR.GetString ("ELinq_UnresolvableFunctionForMember", p0, p1 ); + } + + public static string ELinq_UnresolvableFunctionForMethod (object p0, object p1) + { + return SR.GetString ("ELinq_UnresolvableFunctionForMethod", p0, p1 ); + } + + public static string ELinq_UnresolvableFunctionForMethodAmbiguousMatch (object p0, object p1) + { + return SR.GetString ("ELinq_UnresolvableFunctionForMethodAmbiguousMatch", p0, p1 ); + } + + public static string ELinq_UnresolvableFunctionForMethodNotFound (object p0, object p1) + { + return SR.GetString ("ELinq_UnresolvableFunctionForMethodNotFound", p0, p1 ); + } + + public static string ELinq_UnresolvableStoreFunctionForExpression (object p0) + { + return SR.GetString ("ELinq_UnresolvableStoreFunctionForExpression", p0 ); + } + + public static string ELinq_UnresolvableStoreFunctionForMember (object p0, object p1) + { + return SR.GetString ("ELinq_UnresolvableStoreFunctionForMember", p0, p1 ); + } + + public static string ELinq_UnsupportedAsUnicodeAndAsNonUnicode (object p0) + { + return SR.GetString ("ELinq_UnsupportedAsUnicodeAndAsNonUnicode", p0 ); + } + + public static string ELinq_UnsupportedCast (object p0, object p1) + { + return SR.GetString ("ELinq_UnsupportedCast", p0, p1 ); + } + + public static string ELinq_UnsupportedComparison (object p0) + { + return SR.GetString ("ELinq_UnsupportedComparison", p0 ); + } + + public static string ELinq_UnsupportedConstant (object p0) + { + return SR.GetString ("ELinq_UnsupportedConstant", p0 ); + } + + public static string ELinq_UnsupportedEnumerableType (object p0) + { + return SR.GetString ("ELinq_UnsupportedEnumerableType", p0 ); + } + + public static string ELinq_UnsupportedExpressionType (object p0) + { + return SR.GetString ("ELinq_UnsupportedExpressionType", p0 ); + } + + public static string ELinq_UnsupportedHeterogeneousInitializers (object p0) + { + return SR.GetString ("ELinq_UnsupportedHeterogeneousInitializers", p0 ); + } + + public static string ELinq_UnsupportedIsOrAs (object p0, object p1, object p2) + { + return SR.GetString ("ELinq_UnsupportedIsOrAs", p0, p1, p2 ); + } + + public static string ELinq_UnsupportedKeySelector (object p0) + { + return SR.GetString ("ELinq_UnsupportedKeySelector", p0 ); + } + + public static string ELinq_UnsupportedMethod (object p0) + { + return SR.GetString ("ELinq_UnsupportedMethod", p0 ); + } + + public static string ELinq_UnsupportedMethodSuggestedAlternative (object p0, object p1) + { + return SR.GetString ("ELinq_UnsupportedMethodSuggestedAlternative", p0, p1 ); + } + + public static string ELinq_UnsupportedNominalType (object p0) + { + return SR.GetString ("ELinq_UnsupportedNominalType", p0 ); + } + + public static string ELinq_UnsupportedNullConstant (object p0) + { + return SR.GetString ("ELinq_UnsupportedNullConstant", p0 ); + } + + public static string ELinq_UnsupportedPassthrough (object p0, object p1) + { + return SR.GetString ("ELinq_UnsupportedPassthrough", p0, p1 ); + } + + public static string ELinq_UnsupportedRefComparison (object p0, object p1) + { + return SR.GetString ("ELinq_UnsupportedRefComparison", p0, p1 ); + } + + public static string ELinq_UnsupportedRowComparison (object p0) + { + return SR.GetString ("ELinq_UnsupportedRowComparison", p0 ); + } + + public static string ELinq_UnsupportedRowMemberComparison (object p0) + { + return SR.GetString ("ELinq_UnsupportedRowMemberComparison", p0 ); + } + + public static string ELinq_UnsupportedRowTypeComparison (object p0) + { + return SR.GetString ("ELinq_UnsupportedRowTypeComparison", p0 ); + } + + public static string ELinq_UnsupportedStringRemoveCase (object p0, object p1) + { + return SR.GetString ("ELinq_UnsupportedStringRemoveCase", p0, p1 ); + } + + public static string ELinq_UnsupportedTrimStartTrimEndCase (object p0) + { + return SR.GetString ("ELinq_UnsupportedTrimStartTrimEndCase", p0 ); + } + + public static string ELinq_UnsupportedType (object p0) + { + return SR.GetString ("ELinq_UnsupportedType", p0 ); + } + + public static string ELinq_UnsupportedUseOfContextParameter (object p0) + { + return SR.GetString ("ELinq_UnsupportedUseOfContextParameter", p0 ); + } + + public static string ELinq_UnsupportedVBDatePartInvalidInterval (object p0, object p1, object p2) + { + return SR.GetString ("ELinq_UnsupportedVBDatePartInvalidInterval", p0, p1, p2 ); + } + + public static string ELinq_UnsupportedVBDatePartNonConstantInterval (object p0, object p1) + { + return SR.GetString ("ELinq_UnsupportedVBDatePartNonConstantInterval", p0, p1 ); + } + + public static string EmptyFile (object p0) + { + return SR.GetString ("EmptyFile", p0 ); + } + + public static string EmptyName (object p0) + { + return SR.GetString ("EmptyName", p0 ); + } + + public static string EndNameAlreadyDefinedDuplicate (object p0) + { + return SR.GetString ("EndNameAlreadyDefinedDuplicate", p0 ); + } + + public static string EndWithManyMultiplicityCannotHaveOperationsSpecified (object p0, object p1) + { + return SR.GetString ("EndWithManyMultiplicityCannotHaveOperationsSpecified", p0, p1 ); + } + + public static string EndWithoutMultiplicity (object p0, object p1) + { + return SR.GetString ("EndWithoutMultiplicity", p0, p1 ); + } + + public static string EntityClient_ConnectionStringMissingInfo (object p0) + { + return SR.GetString ("EntityClient_ConnectionStringMissingInfo", p0 ); + } + + public static string EntityClient_DbConnectionHasNoProvider (object p0) + { + return SR.GetString ("EntityClient_DbConnectionHasNoProvider", p0 ); + } + + public static string EntityClient_DoesNotImplementIServiceProvider (object p0) + { + return SR.GetString ("EntityClient_DoesNotImplementIServiceProvider", p0 ); + } + + public static string EntityClient_DuplicateParameterNames (object p0) + { + return SR.GetString ("EntityClient_DuplicateParameterNames", p0 ); + } + + public static string EntityClient_EntityParameterEdmTypeNotScalar (object p0) + { + return SR.GetString ("EntityClient_EntityParameterEdmTypeNotScalar", p0 ); + } + + public static string EntityClient_EntityParameterInconsistentEdmType (object p0, object p1) + { + return SR.GetString ("EntityClient_EntityParameterInconsistentEdmType", p0, p1 ); + } + + public static string EntityClient_ExecutingOnClosedConnection (object p0) + { + return SR.GetString ("EntityClient_ExecutingOnClosedConnection", p0 ); + } + + public static string EntityClient_FailedToGetInformation (object p0) + { + return SR.GetString ("EntityClient_FailedToGetInformation", p0 ); + } + + public static string EntityClient_FunctionImportMustBeNonComposable (object p0) + { + return SR.GetString ("EntityClient_FunctionImportMustBeNonComposable", p0 ); + } + + public static string EntityClient_IncompatibleNavigationPropertyResult (object p0, object p1) + { + return SR.GetString ("EntityClient_IncompatibleNavigationPropertyResult", p0, p1 ); + } + + public static string EntityClient_InvalidParameterDirection (object p0) + { + return SR.GetString ("EntityClient_InvalidParameterDirection", p0 ); + } + + public static string EntityClient_InvalidParameterName (object p0) + { + return SR.GetString ("EntityClient_InvalidParameterName", p0 ); + } + + public static string EntityClient_ItemCollectionsNotRegisteredInWorkspace (object p0) + { + return SR.GetString ("EntityClient_ItemCollectionsNotRegisteredInWorkspace", p0 ); + } + + public static string EntityClient_KeywordNotSupported (object p0) + { + return SR.GetString ("EntityClient_KeywordNotSupported", p0 ); + } + + public static string EntityClient_NestedNamedConnection (object p0) + { + return SR.GetString ("EntityClient_NestedNamedConnection", p0 ); + } + + public static string EntityClient_ProviderSpecificError (object p0) + { + return SR.GetString ("EntityClient_ProviderSpecificError", p0 ); + } + + public static string EntityClient_ReturnedNullOnProviderMethod (object p0, object p1) + { + return SR.GetString ("EntityClient_ReturnedNullOnProviderMethod", p0, p1 ); + } + + public static string EntityClient_UnableToFindFunctionImport (object p0, object p1) + { + return SR.GetString ("EntityClient_UnableToFindFunctionImport", p0, p1 ); + } + + public static string EntityClient_UnableToFindFunctionImportContainer (object p0) + { + return SR.GetString ("EntityClient_UnableToFindFunctionImportContainer", p0 ); + } + + public static string EntityClient_UnknownParameterType (object p0) + { + return SR.GetString ("EntityClient_UnknownParameterType", p0 ); + } + + public static string EntityClient_UnmappedFunctionImport (object p0) + { + return SR.GetString ("EntityClient_UnmappedFunctionImport", p0 ); + } + + public static string EntityClient_UnsupportedDbType (object p0, object p1) + { + return SR.GetString ("EntityClient_UnsupportedDbType", p0, p1 ); + } + + public static string EntityContainerAlreadyExists (object p0) + { + return SR.GetString ("EntityContainerAlreadyExists", p0 ); + } + + public static string EntityContainerCannotExtendItself (object p0) + { + return SR.GetString ("EntityContainerCannotExtendItself", p0 ); + } + + public static string EntityKey_DoesntMatchKeyOnEntity (object p0) + { + return SR.GetString ("EntityKey_DoesntMatchKeyOnEntity", p0 ); + } + + public static string EntityKey_EntitySetDoesNotMatch (object p0) + { + return SR.GetString ("EntityKey_EntitySetDoesNotMatch", p0 ); + } + + public static string EntityKey_EntityTypesDoNotMatch (object p0, object p1) + { + return SR.GetString ("EntityKey_EntityTypesDoNotMatch", p0, p1 ); + } + + public static string EntityKey_IncorrectNumberOfKeyValuePairs (object p0, object p1, object p2) + { + return SR.GetString ("EntityKey_IncorrectNumberOfKeyValuePairs", p0, p1, p2 ); + } + + public static string EntityKey_IncorrectValueType (object p0, object p1, object p2) + { + return SR.GetString ("EntityKey_IncorrectValueType", p0, p1, p2 ); + } + + public static string EntityKey_InvalidName (object p0) + { + return SR.GetString ("EntityKey_InvalidName", p0 ); + } + + public static string EntityKey_MissingKeyValue (object p0, object p1) + { + return SR.GetString ("EntityKey_MissingKeyValue", p0, p1 ); + } + + public static string EntityKey_NoCorrespondingOSpaceTypeForEnumKeyMember (object p0, object p1) + { + return SR.GetString ("EntityKey_NoCorrespondingOSpaceTypeForEnumKeyMember", p0, p1 ); + } + + public static string EntityKey_NullKeyValue (object p0, object p1) + { + return SR.GetString ("EntityKey_NullKeyValue", p0, p1 ); + } + + public static string EntityKeyMustBeScalar (object p0, object p1) + { + return SR.GetString ("EntityKeyMustBeScalar", p0, p1 ); + } + + public static string EntityKeyTypeCurrentlyNotSupported (object p0, object p1, object p2) + { + return SR.GetString ("EntityKeyTypeCurrentlyNotSupported", p0, p1, p2 ); + } + + public static string EntityKeyTypeCurrentlyNotSupportedInSSDL (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("EntityKeyTypeCurrentlyNotSupportedInSSDL", p0, p1, p2, p3, p4 ); + } + + public static string EntityParameterCollectionInvalidIndex (object p0, object p1) + { + return SR.GetString ("EntityParameterCollectionInvalidIndex", p0, p1 ); + } + + public static string EntityParameterCollectionInvalidParameterName (object p0) + { + return SR.GetString ("EntityParameterCollectionInvalidParameterName", p0 ); + } + + public static string EntityProxyTypeInfo_CannotSetEntityCollectionProperty (object p0, object p1) + { + return SR.GetString ("EntityProxyTypeInfo_CannotSetEntityCollectionProperty", p0, p1 ); + } + + public static string EntityProxyTypeInfo_DuplicateOSpaceType (object p0) + { + return SR.GetString ("EntityProxyTypeInfo_DuplicateOSpaceType", p0 ); + } + + public static string EntityProxyTypeInfo_ProxyMetadataIsUnavailable (object p0) + { + return SR.GetString ("EntityProxyTypeInfo_ProxyMetadataIsUnavailable", p0 ); + } + + public static string EntityReference_CannotAddMoreThanOneEntityToEntityReference (object p0, object p1) + { + return SR.GetString ("EntityReference_CannotAddMoreThanOneEntityToEntityReference", p0, p1 ); + } + + public static string EntityReference_ExpectedReferenceGotCollection (object p0, object p1, object p2) + { + return SR.GetString ("EntityReference_ExpectedReferenceGotCollection", p0, p1, p2 ); + } + + public static string EntitySetNotInCSPace (object p0) + { + return SR.GetString ("EntitySetNotInCSPace", p0 ); + } + + public static string EntitySetTypeHasNoKeys (object p0, object p1) + { + return SR.GetString ("EntitySetTypeHasNoKeys", p0, p1 ); + } + + public static string EnumMemberValueOutOfItsUnderylingTypeRange (object p0, object p1, object p2) + { + return SR.GetString ("EnumMemberValueOutOfItsUnderylingTypeRange", p0, p1, p2 ); + } + + public static string ExpressionTypeMustBeEntityType (object p0, object p1, object p2) + { + return SR.GetString ("ExpressionTypeMustBeEntityType", p0, p1, p2 ); + } + + public static string ExpressionTypeMustBeNominalType (object p0, object p1, object p2) + { + return SR.GetString ("ExpressionTypeMustBeNominalType", p0, p1, p2 ); + } + + public static string FacetNotAllowed (object p0, object p1) + { + return SR.GetString ("FacetNotAllowed", p0, p1 ); + } + + public static string FacetsOnNonScalarType (object p0) + { + return SR.GetString ("FacetsOnNonScalarType", p0 ); + } + + public static string FailedToFindClrTypeMapping (object p0) + { + return SR.GetString ("FailedToFindClrTypeMapping", p0 ); + } + + public static string FailedToFindCSpaceTypeMapping (object p0) + { + return SR.GetString ("FailedToFindCSpaceTypeMapping", p0 ); + } + + public static string FailedToFindOSpaceTypeMapping (object p0) + { + return SR.GetString ("FailedToFindOSpaceTypeMapping", p0 ); + } + + public static string FailedToResolveAggregateFunction (object p0) + { + return SR.GetString ("FailedToResolveAggregateFunction", p0 ); + } + + public static string FunctionImportCollectionAndRefParametersNotAllowed (object p0) + { + return SR.GetString ("FunctionImportCollectionAndRefParametersNotAllowed", p0 ); + } + + public static string FunctionImportComposableAndSideEffectingNotAllowed (object p0) + { + return SR.GetString ("FunctionImportComposableAndSideEffectingNotAllowed", p0 ); + } + + public static string FunctionImportEntitySetAndEntitySetPathDeclared (object p0) + { + return SR.GetString ("FunctionImportEntitySetAndEntitySetPathDeclared", p0 ); + } + + public static string FunctionImportEntityTypeDoesNotMatchEntitySet (object p0, object p1, object p2) + { + return SR.GetString ("FunctionImportEntityTypeDoesNotMatchEntitySet", p0, p1, p2 ); + } + + public static string FunctionImportNonNullableParametersNotAllowed (object p0) + { + return SR.GetString ("FunctionImportNonNullableParametersNotAllowed", p0 ); + } + + public static string FunctionImportReturnEntitiesButDoesNotSpecifyEntitySet (object p0) + { + return SR.GetString ("FunctionImportReturnEntitiesButDoesNotSpecifyEntitySet", p0 ); + } + + public static string FunctionImportSpecifiesEntitySetButNotEntityType (object p0) + { + return SR.GetString ("FunctionImportSpecifiesEntitySetButNotEntityType", p0 ); + } + + public static string FunctionImportUnknownEntitySet (object p0, object p1) + { + return SR.GetString ("FunctionImportUnknownEntitySet", p0, p1 ); + } + + public static string FunctionImportWithUnsupportedReturnTypeV1 (object p0) + { + return SR.GetString ("FunctionImportWithUnsupportedReturnTypeV1", p0 ); + } + + public static string FunctionImportWithUnsupportedReturnTypeV1_1 (object p0) + { + return SR.GetString ("FunctionImportWithUnsupportedReturnTypeV1_1", p0 ); + } + + public static string FunctionImportWithUnsupportedReturnTypeV2 (object p0) + { + return SR.GetString ("FunctionImportWithUnsupportedReturnTypeV2", p0 ); + } + + public static string FunctionWithNonEdmPrimitiveTypeNotSupported (object p0, object p1) + { + return SR.GetString ("FunctionWithNonEdmPrimitiveTypeNotSupported", p0, p1 ); + } + + public static string FunctionWithNonPrimitiveTypeNotSupported (object p0, object p1) + { + return SR.GetString ("FunctionWithNonPrimitiveTypeNotSupported", p0, p1 ); + } + + public static string GeneralExceptionAsQueryInnerException (object p0) + { + return SR.GetString ("GeneralExceptionAsQueryInnerException", p0 ); + } + + public static string Generated_View_Type_Super_Class (object p0) + { + return SR.GetString ("Generated_View_Type_Super_Class", p0 ); + } + + public static string Generated_Views_Invalid_Extent (object p0) + { + return SR.GetString ("Generated_Views_Invalid_Extent", p0 ); + } + + public static string GenericTypeNotSupported (object p0) + { + return SR.GetString ("GenericTypeNotSupported", p0 ); + } + + public static string InferRelationshipEndAmbiguous (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("InferRelationshipEndAmbiguous", p0, p1, p2, p3, p4 ); + } + + public static string InferRelationshipEndFailedNoEntitySetMatch (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("InferRelationshipEndFailedNoEntitySetMatch", p0, p1, p2, p3, p4 ); + } + + public static string InferRelationshipEndGivesAlreadyDefinedEnd (object p0, object p1) + { + return SR.GetString ("InferRelationshipEndGivesAlreadyDefinedEnd", p0, p1 ); + } + + public static string InvalidAction (object p0, object p1) + { + return SR.GetString ("InvalidAction", p0, p1 ); + } + + public static string InvalidAliasName (object p0) + { + return SR.GetString ("InvalidAliasName", p0 ); + } + + public static string InvalidAssociationTypeForUnion (object p0) + { + return SR.GetString ("InvalidAssociationTypeForUnion", p0 ); + } + + public static string InvalidBaseTypeForItemType (object p0, object p1) + { + return SR.GetString ("InvalidBaseTypeForItemType", p0, p1 ); + } + + public static string InvalidBaseTypeForNestedType (object p0, object p1) + { + return SR.GetString ("InvalidBaseTypeForNestedType", p0, p1 ); + } + + public static string InvalidBaseTypeForStructuredType (object p0, object p1) + { + return SR.GetString ("InvalidBaseTypeForStructuredType", p0, p1 ); + } + + public static string InvalidCast (object p0, object p1) + { + return SR.GetString ("InvalidCast", p0, p1 ); + } + + public static string InvalidCollectionForMapping (object p0) + { + return SR.GetString ("InvalidCollectionForMapping", p0 ); + } + + public static string InvalidCollectionSpecified (object p0) + { + return SR.GetString ("InvalidCollectionSpecified", p0 ); + } + + public static string InvalidComplexType (object p0, object p1, object p2, object p3) + { + return SR.GetString ("InvalidComplexType", p0, p1, p2, p3 ); + } + + public static string InvalidCtorArgumentType (object p0, object p1, object p2) + { + return SR.GetString ("InvalidCtorArgumentType", p0, p1, p2 ); + } + + public static string InvalidCtorUseOnType (object p0) + { + return SR.GetString ("InvalidCtorUseOnType", p0 ); + } + + public static string InvalidDateTimeOffsetLiteral (object p0) + { + return SR.GetString ("InvalidDateTimeOffsetLiteral", p0 ); + } + + public static string InvalidDay (object p0, object p1) + { + return SR.GetString ("InvalidDay", p0, p1 ); + } + + public static string InvalidDayInMonth (object p0, object p1, object p2) + { + return SR.GetString ("InvalidDayInMonth", p0, p1, p2 ); + } + + public static string InvalidDefaultBinaryWithNoMaxLength (object p0) + { + return SR.GetString ("InvalidDefaultBinaryWithNoMaxLength", p0 ); + } + + public static string InvalidDefaultBoolean (object p0) + { + return SR.GetString ("InvalidDefaultBoolean", p0 ); + } + + public static string InvalidDefaultDateTime (object p0, object p1) + { + return SR.GetString ("InvalidDefaultDateTime", p0, p1 ); + } + + public static string InvalidDefaultDateTimeOffset (object p0, object p1) + { + return SR.GetString ("InvalidDefaultDateTimeOffset", p0, p1 ); + } + + public static string InvalidDefaultDecimal (object p0, object p1, object p2) + { + return SR.GetString ("InvalidDefaultDecimal", p0, p1, p2 ); + } + + public static string InvalidDefaultFloatingPoint (object p0, object p1, object p2) + { + return SR.GetString ("InvalidDefaultFloatingPoint", p0, p1, p2 ); + } + + public static string InvalidDefaultGuid (object p0) + { + return SR.GetString ("InvalidDefaultGuid", p0 ); + } + + public static string InvalidDefaultIntegral (object p0, object p1, object p2) + { + return SR.GetString ("InvalidDefaultIntegral", p0, p1, p2 ); + } + + public static string InvalidDefaultTime (object p0, object p1) + { + return SR.GetString ("InvalidDefaultTime", p0, p1 ); + } + + public static string InvalidDeRefProperty (object p0, object p1, object p2) + { + return SR.GetString ("InvalidDeRefProperty", p0, p1, p2 ); + } + + public static string InvalidEDMVersion (object p0) + { + return SR.GetString ("InvalidEDMVersion", p0 ); + } + + public static string InvalidEndEntitySetTypeMismatch (object p0) + { + return SR.GetString ("InvalidEndEntitySetTypeMismatch", p0 ); + } + + public static string InvalidEndRoleInRelationshipConstraint (object p0, object p1) + { + return SR.GetString ("InvalidEndRoleInRelationshipConstraint", p0, p1 ); + } + + public static string InvalidEntityContainerNameInExtends (object p0) + { + return SR.GetString ("InvalidEntityContainerNameInExtends", p0 ); + } + + public static string InvalidEntityEndName (object p0, object p1) + { + return SR.GetString ("InvalidEntityEndName", p0, p1 ); + } + + public static string InvalidEntityParameterType (object p0) + { + return SR.GetString ("InvalidEntityParameterType", p0 ); + } + + public static string InvalidEntityRootTypeArgument (object p0, object p1) + { + return SR.GetString ("InvalidEntityRootTypeArgument", p0, p1 ); + } + + public static string InvalidEntitySetName (object p0) + { + return SR.GetString ("InvalidEntitySetName", p0 ); + } + + public static string InvalidEntitySetNameReference (object p0, object p1) + { + return SR.GetString ("InvalidEntitySetNameReference", p0, p1 ); + } + + public static string InvalidEntitySetType (object p0) + { + return SR.GetString ("InvalidEntitySetType", p0 ); + } + + public static string InvalidEntityTypeArgument (object p0, object p1, object p2, object p3) + { + return SR.GetString ("InvalidEntityTypeArgument", p0, p1, p2, p3 ); + } + + public static string InvalidEscapedIdentifier (object p0) + { + return SR.GetString ("InvalidEscapedIdentifier", p0 ); + } + + public static string InvalidEscapedIdentifierUnbalanced (object p0) + { + return SR.GetString ("InvalidEscapedIdentifierUnbalanced", p0 ); + } + + public static string InvalidExpressionResolutionClass (object p0, object p1) + { + return SR.GetString ("InvalidExpressionResolutionClass", p0, p1 ); + } + + public static string InvalidFileExtension (object p0, object p1, object p2) + { + return SR.GetString ("InvalidFileExtension", p0, p1, p2 ); + } + + public static string InvalidFromPropertyInRelationshipConstraint (object p0, object p1, object p2) + { + return SR.GetString ("InvalidFromPropertyInRelationshipConstraint", p0, p1, p2 ); + } + + public static string InvalidGroupIdentifierReference (object p0) + { + return SR.GetString ("InvalidGroupIdentifierReference", p0 ); + } + + public static string InvalidHour (object p0, object p1) + { + return SR.GetString ("InvalidHour", p0, p1 ); + } + + public static string InvalidImplicitRelationshipFromEnd (object p0) + { + return SR.GetString ("InvalidImplicitRelationshipFromEnd", p0 ); + } + + public static string InvalidImplicitRelationshipToEnd (object p0) + { + return SR.GetString ("InvalidImplicitRelationshipToEnd", p0 ); + } + + public static string InvalidInExprArgs (object p0, object p1) + { + return SR.GetString ("InvalidInExprArgs", p0, p1 ); + } + + public static string InvalidKeyArgument (object p0) + { + return SR.GetString ("InvalidKeyArgument", p0 ); + } + + public static string InvalidKeyKeyDefinedInBaseClass (object p0, object p1) + { + return SR.GetString ("InvalidKeyKeyDefinedInBaseClass", p0, p1 ); + } + + public static string InvalidKeyMember (object p0) + { + return SR.GetString ("InvalidKeyMember", p0 ); + } + + public static string InvalidKeyNoProperty (object p0, object p1) + { + return SR.GetString ("InvalidKeyNoProperty", p0, p1 ); + } + + public static string InvalidKeyNullablePart (object p0, object p1) + { + return SR.GetString ("InvalidKeyNullablePart", p0, p1 ); + } + + public static string InvalidKeyTypeForCollation (object p0) + { + return SR.GetString ("InvalidKeyTypeForCollation", p0 ); + } + + public static string InvalidLiteralFormat (object p0, object p1) + { + return SR.GetString ("InvalidLiteralFormat", p0, p1 ); + } + + public static string InvalidMemberNameMatchesTypeName (object p0, object p1) + { + return SR.GetString ("InvalidMemberNameMatchesTypeName", p0, p1 ); + } + + public static string InvalidMetadataMemberClassResolution (object p0, object p1, object p2) + { + return SR.GetString ("InvalidMetadataMemberClassResolution", p0, p1, p2 ); + } + + public static string InvalidMinute (object p0, object p1) + { + return SR.GetString ("InvalidMinute", p0, p1 ); + } + + public static string InvalidMonth (object p0, object p1) + { + return SR.GetString ("InvalidMonth", p0, p1 ); + } + + public static string InvalidMultiplicityFromRoleToPropertyNonNullableV1 (object p0, object p1) + { + return SR.GetString ("InvalidMultiplicityFromRoleToPropertyNonNullableV1", p0, p1 ); + } + + public static string InvalidMultiplicityFromRoleToPropertyNonNullableV2 (object p0, object p1) + { + return SR.GetString ("InvalidMultiplicityFromRoleToPropertyNonNullableV2", p0, p1 ); + } + + public static string InvalidMultiplicityFromRoleToPropertyNullableV1 (object p0, object p1) + { + return SR.GetString ("InvalidMultiplicityFromRoleToPropertyNullableV1", p0, p1 ); + } + + public static string InvalidMultiplicityFromRoleUpperBoundMustBeOne (object p0, object p1) + { + return SR.GetString ("InvalidMultiplicityFromRoleUpperBoundMustBeOne", p0, p1 ); + } + + public static string InvalidMultiplicityToRoleLowerBoundMustBeZero (object p0, object p1) + { + return SR.GetString ("InvalidMultiplicityToRoleLowerBoundMustBeZero", p0, p1 ); + } + + public static string InvalidMultiplicityToRoleUpperBoundMustBeMany (object p0, object p1) + { + return SR.GetString ("InvalidMultiplicityToRoleUpperBoundMustBeMany", p0, p1 ); + } + + public static string InvalidMultiplicityToRoleUpperBoundMustBeOne (object p0, object p1) + { + return SR.GetString ("InvalidMultiplicityToRoleUpperBoundMustBeOne", p0, p1 ); + } + + public static string InvalidName (object p0, object p1) + { + return SR.GetString ("InvalidName", p0, p1 ); + } + + public static string InvalidNamespaceInUsing (object p0) + { + return SR.GetString ("InvalidNamespaceInUsing", p0 ); + } + + public static string InvalidNamespaceOrAliasSpecified (object p0) + { + return SR.GetString ("InvalidNamespaceOrAliasSpecified", p0 ); + } + + public static string InvalidNullLiteralForNonNullableMember (object p0, object p1) + { + return SR.GetString ("InvalidNullLiteralForNonNullableMember", p0, p1 ); + } + + public static string InvalidNumberOfParametersForAggregateFunction (object p0) + { + return SR.GetString ("InvalidNumberOfParametersForAggregateFunction", p0 ); + } + + public static string InvalidParameterFormat (object p0) + { + return SR.GetString ("InvalidParameterFormat", p0 ); + } + + public static string InvalidParameterTypeForAggregateFunction (object p0, object p1) + { + return SR.GetString ("InvalidParameterTypeForAggregateFunction", p0, p1 ); + } + + public static string InvalidPlaceholderRootTypeArgument (object p0, object p1, object p2, object p3) + { + return SR.GetString ("InvalidPlaceholderRootTypeArgument", p0, p1, p2, p3 ); + } + + public static string InvalidPlaceholderTypeArgument (object p0, object p1, object p2, object p3, object p4, object p5) + { + return SR.GetString ("InvalidPlaceholderTypeArgument", p0, p1, p2, p3, p4, p5 ); + } + + public static string InvalidPrimitiveTypeKind (object p0) + { + return SR.GetString ("InvalidPrimitiveTypeKind", p0 ); + } + + public static string InvalidPropertyInRelationshipConstraint (object p0, object p1) + { + return SR.GetString ("InvalidPropertyInRelationshipConstraint", p0, p1 ); + } + + public static string InvalidPropertyType (object p0) + { + return SR.GetString ("InvalidPropertyType", p0 ); + } + + public static string InvalidQueryResultType (object p0) + { + return SR.GetString ("InvalidQueryResultType", p0 ); + } + + public static string InvalidRelationshipEndMultiplicity (object p0, object p1) + { + return SR.GetString ("InvalidRelationshipEndMultiplicity", p0, p1 ); + } + + public static string InvalidRelationshipEndType (object p0, object p1) + { + return SR.GetString ("InvalidRelationshipEndType", p0, p1 ); + } + + public static string InvalidRelationshipMember (object p0, object p1) + { + return SR.GetString ("InvalidRelationshipMember", p0, p1 ); + } + + public static string InvalidRelationshipSetName (object p0) + { + return SR.GetString ("InvalidRelationshipSetName", p0 ); + } + + public static string InvalidRelationshipSetType (object p0) + { + return SR.GetString ("InvalidRelationshipSetType", p0 ); + } + + public static string InvalidRootComplexType (object p0, object p1) + { + return SR.GetString ("InvalidRootComplexType", p0, p1 ); + } + + public static string InvalidRootRowType (object p0, object p1) + { + return SR.GetString ("InvalidRootRowType", p0, p1 ); + } + + public static string InvalidRowType (object p0, object p1, object p2, object p3) + { + return SR.GetString ("InvalidRowType", p0, p1, p2, p3 ); + } + + public static string InvalidSchemaEncountered (object p0) + { + return SR.GetString ("InvalidSchemaEncountered", p0 ); + } + + public static string InvalidSecond (object p0, object p1) + { + return SR.GetString ("InvalidSecond", p0, p1 ); + } + + public static string InvalidSimpleIdentifier (object p0) + { + return SR.GetString ("InvalidSimpleIdentifier", p0 ); + } + + public static string InvalidSimpleIdentifierNonASCII (object p0) + { + return SR.GetString ("InvalidSimpleIdentifierNonASCII", p0 ); + } + + public static string InvalidSize (object p0, object p1, object p2, object p3) + { + return SR.GetString ("InvalidSize", p0, p1, p2, p3 ); + } + + public static string InvalidStringArgument (object p0) + { + return SR.GetString ("InvalidStringArgument", p0 ); + } + + public static string InvalidSystemReferenceId (object p0, object p1, object p2, object p3) + { + return SR.GetString ("InvalidSystemReferenceId", p0, p1, p2, p3 ); + } + + public static string InvalidToPropertyInRelationshipConstraint (object p0, object p1, object p2) + { + return SR.GetString ("InvalidToPropertyInRelationshipConstraint", p0, p1, p2 ); + } + + public static string InvalidUnarySetOpArgument (object p0) + { + return SR.GetString ("InvalidUnarySetOpArgument", p0 ); + } + + public static string InvalidUnsignedTypeForUnaryMinusOperation (object p0) + { + return SR.GetString ("InvalidUnsignedTypeForUnaryMinusOperation", p0 ); + } + + public static string InvalidUseOfWebPath (object p0) + { + return SR.GetString ("InvalidUseOfWebPath", p0 ); + } + + public static string InvalidValueForParameterTypeSemanticsAttribute (object p0) + { + return SR.GetString ("InvalidValueForParameterTypeSemanticsAttribute", p0 ); + } + + public static string InvalidWithRelationshipTargetEndMultiplicity (object p0, object p1) + { + return SR.GetString ("InvalidWithRelationshipTargetEndMultiplicity", p0, p1 ); + } + + public static string InvalidYear (object p0, object p1) + { + return SR.GetString ("InvalidYear", p0, p1 ); + } + + public static string Iqt_General_UnsupportedOp (object p0) + { + return SR.GetString ("Iqt_General_UnsupportedOp", p0 ); + } + + public static string ItemCollectionAlreadyRegistered (object p0) + { + return SR.GetString ("ItemCollectionAlreadyRegistered", p0 ); + } + + public static string ItemDuplicateIdentity (object p0) + { + return SR.GetString ("ItemDuplicateIdentity", p0 ); + } + + public static string ItemInvalidIdentity (object p0) + { + return SR.GetString ("ItemInvalidIdentity", p0 ); + } + + public static string KeyMissingOnEntityType (object p0) + { + return SR.GetString ("KeyMissingOnEntityType", p0 ); + } + + public static string KeyMustBeCorrelated (object p0) + { + return SR.GetString ("KeyMustBeCorrelated", p0 ); + } + + public static string LiteralTypeNotFoundInMetadata (object p0) + { + return SR.GetString ("LiteralTypeNotFoundInMetadata", p0 ); + } + + public static string LiteralTypeNotSupported (object p0) + { + return SR.GetString ("LiteralTypeNotSupported", p0 ); + } + + public static string MalformedXml (object p0, object p1) + { + return SR.GetString ("MalformedXml", p0, p1 ); + } + + public static string Mapping_AbstractTypeMappingToNonAbstractType (object p0, object p1) + { + return SR.GetString ("Mapping_AbstractTypeMappingToNonAbstractType", p0, p1 ); + } + + public static string Mapping_AllQueryViewAtCompileTime (object p0) + { + return SR.GetString ("Mapping_AllQueryViewAtCompileTime", p0 ); + } + + public static string Mapping_AlreadyMapped_StorageEntityContainer (object p0) + { + return SR.GetString ("Mapping_AlreadyMapped_StorageEntityContainer", p0 ); + } + + public static string Mapping_CannotMapCLRTypeMultipleTimes (object p0) + { + return SR.GetString ("Mapping_CannotMapCLRTypeMultipleTimes", p0 ); + } + + public static string Mapping_Default_OCMapping_Clr_Member (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_Default_OCMapping_Clr_Member", p0, p1, p2 ); + } + + public static string Mapping_Default_OCMapping_Clr_Member2 (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_Default_OCMapping_Clr_Member2", p0, p1, p2 ); + } + + public static string Mapping_Default_OCMapping_Invalid_MemberType (object p0, object p1, object p2, object p3, object p4, object p5) + { + return SR.GetString ("Mapping_Default_OCMapping_Invalid_MemberType", p0, p1, p2, p3, p4, p5 ); + } + + public static string Mapping_Default_OCMapping_Member_Count_Mismatch (object p0, object p1) + { + return SR.GetString ("Mapping_Default_OCMapping_Member_Count_Mismatch", p0, p1 ); + } + + public static string Mapping_Default_OCMapping_MemberKind_Mismatch (object p0, object p1, object p2, object p3, object p4, object p5) + { + return SR.GetString ("Mapping_Default_OCMapping_MemberKind_Mismatch", p0, p1, p2, p3, p4, p5 ); + } + + public static string Mapping_Default_OCMapping_MultiplicityMismatch (object p0, object p1, object p2, object p3, object p4, object p5) + { + return SR.GetString ("Mapping_Default_OCMapping_MultiplicityMismatch", p0, p1, p2, p3, p4, p5 ); + } + + public static string Mapping_Duplicate_CdmAssociationSet_StorageMap (object p0) + { + return SR.GetString ("Mapping_Duplicate_CdmAssociationSet_StorageMap", p0 ); + } + + public static string Mapping_Duplicate_PropertyMap_CaseInsensitive (object p0) + { + return SR.GetString ("Mapping_Duplicate_PropertyMap_CaseInsensitive", p0 ); + } + + public static string Mapping_Duplicate_Type (object p0) + { + return SR.GetString ("Mapping_Duplicate_Type", p0 ); + } + + public static string Mapping_Empty_QueryView (object p0) + { + return SR.GetString ("Mapping_Empty_QueryView", p0 ); + } + + public static string Mapping_Empty_QueryView_OfType (object p0, object p1) + { + return SR.GetString ("Mapping_Empty_QueryView_OfType", p0, p1 ); + } + + public static string Mapping_Empty_QueryView_OfTypeOnly (object p0, object p1) + { + return SR.GetString ("Mapping_Empty_QueryView_OfTypeOnly", p0, p1 ); + } + + public static string Mapping_EntitySetMismatchOnAssociationSetEnd_QueryView (object p0, object p1, object p2, object p3) + { + return SR.GetString ("Mapping_EntitySetMismatchOnAssociationSetEnd_QueryView", p0, p1, p2, p3 ); + } + + public static string Mapping_Enum_EmptyValue (object p0) + { + return SR.GetString ("Mapping_Enum_EmptyValue", p0 ); + } + + public static string Mapping_Enum_InvalidValue (object p0) + { + return SR.GetString ("Mapping_Enum_InvalidValue", p0 ); + } + + public static string Mapping_Enum_OCMapping_MemberMismatch (object p0, object p1, object p2, object p3) + { + return SR.GetString ("Mapping_Enum_OCMapping_MemberMismatch", p0, p1, p2, p3 ); + } + + public static string Mapping_Enum_OCMapping_UnderlyingTypesMismatch (object p0, object p1, object p2, object p3) + { + return SR.GetString ("Mapping_Enum_OCMapping_UnderlyingTypesMismatch", p0, p1, p2, p3 ); + } + + public static string Mapping_EnumTypeMappingToNonEnumType (object p0, object p1) + { + return SR.GetString ("Mapping_EnumTypeMappingToNonEnumType", p0, p1 ); + } + + public static string Mapping_FunctionImport_CannotInferTargetFunctionKeys (object p0) + { + return SR.GetString ("Mapping_FunctionImport_CannotInferTargetFunctionKeys", p0 ); + } + + public static string Mapping_FunctionImport_ConditionValueTypeMismatch (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_FunctionImport_ConditionValueTypeMismatch", p0, p1, p2 ); + } + + public static string Mapping_FunctionImport_EntityTypeMappingForFunctionNotReturningEntitySet (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_EntityTypeMappingForFunctionNotReturningEntitySet", p0, p1); + } + + public static string Mapping_FunctionImport_FunctionAmbiguous (object p0) + { + return SR.GetString ("Mapping_FunctionImport_FunctionAmbiguous", p0 ); + } + + public static string Mapping_FunctionImport_FunctionImportDoesNotExist (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_FunctionImportDoesNotExist", p0, p1 ); + } + + public static string Mapping_FunctionImport_FunctionImportMappedMultipleTimes (object p0) + { + return SR.GetString ("Mapping_FunctionImport_FunctionImportMappedMultipleTimes", p0 ); + } + + public static string Mapping_FunctionImport_ImplicitMappingForAbstractReturnType (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_ImplicitMappingForAbstractReturnType", p0, p1 ); + } + + public static string Mapping_FunctionImport_ImportParameterHasNoCorrespondingTargetParameter (object p0) + { + return SR.GetString ("Mapping_FunctionImport_ImportParameterHasNoCorrespondingTargetParameter", p0 ); + } + + public static string Mapping_FunctionImport_IncompatibleEnumParameterType (object p0, object p1, object p2, object p3) + { + return SR.GetString ("Mapping_FunctionImport_IncompatibleEnumParameterType", p0, p1, p2, p3 ); + } + + public static string Mapping_FunctionImport_IncompatibleParameterMode (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_FunctionImport_IncompatibleParameterMode", p0, p1, p2 ); + } + + public static string Mapping_FunctionImport_IncompatibleParameterType (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_FunctionImport_IncompatibleParameterType", p0, p1, p2 ); + } + + public static string Mapping_FunctionImport_InvalidContentEntityTypeForEntitySet (object p0, object p1, object p2, object p3) + { + return SR.GetString ("Mapping_FunctionImport_InvalidContentEntityTypeForEntitySet", p0, p1, p2, p3); + } + + public static string Mapping_FunctionImport_PropertyNotMapped (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_FunctionImport_PropertyNotMapped", p0, p1, p2 ); + } + + public static string Mapping_FunctionImport_ResultMapping_InvalidCTypeCTExpected (object p0) + { + return SR.GetString ("Mapping_FunctionImport_ResultMapping_InvalidCTypeCTExpected", p0 ); + } + + public static string Mapping_FunctionImport_ResultMapping_InvalidCTypeETExpected (object p0) + { + return SR.GetString ("Mapping_FunctionImport_ResultMapping_InvalidCTypeETExpected", p0 ); + } + + public static string Mapping_FunctionImport_ResultMapping_InvalidSType (object p0) + { + return SR.GetString ("Mapping_FunctionImport_ResultMapping_InvalidSType", p0 ); + } + + public static string Mapping_FunctionImport_ResultMapping_MappedTypeDoesNotMatchReturnType (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_ResultMapping_MappedTypeDoesNotMatchReturnType", p0, p1); + } + + public static string Mapping_FunctionImport_ResultMappingCountDoesNotMatchResultCount (object p0) + { + return SR.GetString ("Mapping_FunctionImport_ResultMappingCountDoesNotMatchResultCount", p0 ); + } + + public static string Mapping_FunctionImport_RowsAffectedParameterDoesNotExist (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_RowsAffectedParameterDoesNotExist", p0, p1 ); + } + + public static string Mapping_FunctionImport_RowsAffectedParameterHasWrongMode (object p0, object p1, object p2, object p3) + { + return SR.GetString ("Mapping_FunctionImport_RowsAffectedParameterHasWrongMode", p0, p1, p2, p3); + } + + public static string Mapping_FunctionImport_RowsAffectedParameterHasWrongType (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_RowsAffectedParameterHasWrongType", p0, p1 ); + } + + public static string Mapping_FunctionImport_ScalarMappingToMulticolumnTVF (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_ScalarMappingToMulticolumnTVF", p0, p1 ); + } + + public static string Mapping_FunctionImport_ScalarMappingTypeMismatch (object p0, object p1, object p2, object p3) + { + return SR.GetString ("Mapping_FunctionImport_ScalarMappingTypeMismatch", p0, p1, p2, p3 ); + } + + public static string Mapping_FunctionImport_StoreFunctionDoesNotExist (object p0) + { + return SR.GetString ("Mapping_FunctionImport_StoreFunctionDoesNotExist", p0 ); + } + + public static string Mapping_FunctionImport_TargetFunctionMustBeComposable (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_TargetFunctionMustBeComposable", p0, p1 ); + } + + public static string Mapping_FunctionImport_TargetFunctionMustBeNonComposable (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_TargetFunctionMustBeNonComposable", p0, p1 ); + } + + public static string Mapping_FunctionImport_TargetParameterHasNoCorrespondingImportParameter (object p0) + { + return SR.GetString ("Mapping_FunctionImport_TargetParameterHasNoCorrespondingImportParameter", p0 ); + } + + public static string Mapping_FunctionImport_UnreachableIsTypeOf (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_UnreachableIsTypeOf", p0, p1 ); + } + + public static string Mapping_FunctionImport_UnreachableType (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_UnreachableType", p0, p1 ); + } + + public static string Mapping_FunctionImport_UnsupportedType (object p0, object p1) + { + return SR.GetString ("Mapping_FunctionImport_UnsupportedType", p0, p1 ); + } + + public static string Mapping_Invalid_Association_Type_For_Association_Set (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_Invalid_Association_Type_For_Association_Set", p0, p1, p2 ); + } + + public static string Mapping_Invalid_CSide_ScalarProperty (object p0) + { + return SR.GetString ("Mapping_Invalid_CSide_ScalarProperty", p0 ); + } + + public static string Mapping_Invalid_CSRootElementMissing (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_Invalid_CSRootElementMissing", p0, p1, p2 ); + } + + public static string Mapping_Invalid_Member_Mapping (object p0, object p1, object p2, object p3, object p4, object p5) + { + return SR.GetString ("Mapping_Invalid_Member_Mapping", p0, p1, p2, p3, p4, p5 ); + } + + public static string Mapping_Invalid_Query_Views_MissingSetClosure (object p0) + { + return SR.GetString ("Mapping_Invalid_Query_Views_MissingSetClosure", p0 ); + } + + public static string Mapping_Invalid_QueryView (object p0, object p1) + { + return SR.GetString ("Mapping_Invalid_QueryView", p0, p1 ); + } + + public static string Mapping_Invalid_QueryView_Type (object p0) + { + return SR.GetString ("Mapping_Invalid_QueryView_Type", p0 ); + } + + public static string Mapping_Invalid_QueryView2 (object p0, object p1) + { + return SR.GetString ("Mapping_Invalid_QueryView2", p0, p1 ); + } + + public static string Mapping_InvalidContent_AbstractEntity_FunctionMapping (object p0) + { + return SR.GetString ("Mapping_InvalidContent_AbstractEntity_FunctionMapping", p0 ); + } + + public static string Mapping_InvalidContent_AbstractEntity_IsOfType (object p0) + { + return SR.GetString ("Mapping_InvalidContent_AbstractEntity_IsOfType", p0 ); + } + + public static string Mapping_InvalidContent_AbstractEntity_Type (object p0) + { + return SR.GetString ("Mapping_InvalidContent_AbstractEntity_Type", p0 ); + } + + public static string Mapping_InvalidContent_Association_Set (object p0) + { + return SR.GetString ("Mapping_InvalidContent_Association_Set", p0 ); + } + + public static string Mapping_InvalidContent_Association_Type (object p0) + { + return SR.GetString ("Mapping_InvalidContent_Association_Type", p0 ); + } + + public static string Mapping_InvalidContent_AssociationSet_Condition (object p0) + { + return SR.GetString ("Mapping_InvalidContent_AssociationSet_Condition", p0 ); + } + + public static string Mapping_InvalidContent_Cdm_Member (object p0) + { + return SR.GetString ("Mapping_InvalidContent_Cdm_Member", p0 ); + } + + public static string Mapping_InvalidContent_Column (object p0) + { + return SR.GetString ("Mapping_InvalidContent_Column", p0 ); + } + + public static string Mapping_InvalidContent_Complex_Type (object p0) + { + return SR.GetString ("Mapping_InvalidContent_Complex_Type", p0 ); + } + + public static string Mapping_InvalidContent_ConditionMapping_Computed (object p0) + { + return SR.GetString ("Mapping_InvalidContent_ConditionMapping_Computed", p0 ); + } + + public static string Mapping_InvalidContent_ConditionMapping_InvalidMember (object p0) + { + return SR.GetString ("Mapping_InvalidContent_ConditionMapping_InvalidMember", p0 ); + } + + public static string Mapping_InvalidContent_ConditionMapping_InvalidPrimitiveTypeKind (object p0, object p1) + { + return SR.GetString ("Mapping_InvalidContent_ConditionMapping_InvalidPrimitiveTypeKind", p0, p1); + } + + public static string Mapping_InvalidContent_Duplicate_Cdm_Member (object p0) + { + return SR.GetString ("Mapping_InvalidContent_Duplicate_Cdm_Member", p0 ); + } + + public static string Mapping_InvalidContent_Duplicate_Condition_Member (object p0) + { + return SR.GetString ("Mapping_InvalidContent_Duplicate_Condition_Member", p0 ); + } + + public static string Mapping_InvalidContent_Emtpty_SetMap (object p0) + { + return SR.GetString ("Mapping_InvalidContent_Emtpty_SetMap", p0 ); + } + + public static string Mapping_InvalidContent_End (object p0) + { + return SR.GetString ("Mapping_InvalidContent_End", p0 ); + } + + public static string Mapping_InvalidContent_EndProperty (object p0) + { + return SR.GetString ("Mapping_InvalidContent_EndProperty", p0 ); + } + + public static string Mapping_InvalidContent_Entity_Set (object p0) + { + return SR.GetString ("Mapping_InvalidContent_Entity_Set", p0 ); + } + + public static string Mapping_InvalidContent_Entity_Type (object p0) + { + return SR.GetString ("Mapping_InvalidContent_Entity_Type", p0 ); + } + + public static string Mapping_InvalidContent_Entity_Type_For_Entity_Set (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_InvalidContent_Entity_Type_For_Entity_Set", p0, p1, p2 ); + } + + public static string Mapping_InvalidContent_EntityContainer (object p0) + { + return SR.GetString ("Mapping_InvalidContent_EntityContainer", p0 ); + } + + public static string Mapping_InvalidContent_ForeignKey_Association_Set (object p0) + { + return SR.GetString ("Mapping_InvalidContent_ForeignKey_Association_Set", p0 ); + } + + public static string Mapping_InvalidContent_ForeignKey_Association_Set_PKtoPK (object p0) + { + return SR.GetString ("Mapping_InvalidContent_ForeignKey_Association_Set_PKtoPK", p0 ); + } + + public static string Mapping_InvalidContent_StorageEntityContainer (object p0) + { + return SR.GetString ("Mapping_InvalidContent_StorageEntityContainer", p0 ); + } + + public static string Mapping_InvalidContent_Table (object p0) + { + return SR.GetString ("Mapping_InvalidContent_Table", p0 ); + } + + public static string Mapping_InvalidMappingSchema_Parsing (object p0) + { + return SR.GetString ("Mapping_InvalidMappingSchema_Parsing", p0 ); + } + + public static string Mapping_InvalidMappingSchema_validation (object p0) + { + return SR.GetString ("Mapping_InvalidMappingSchema_validation", p0 ); + } + + public static string Mapping_ItemWithSameNameExistsBothInCSpaceAndSSpace (object p0) + { + return SR.GetString ("Mapping_ItemWithSameNameExistsBothInCSpaceAndSSpace", p0 ); + } + + public static string Mapping_ModificationFunction_AmbiguousFunction (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_AmbiguousFunction", p0 ); + } + + public static string Mapping_ModificationFunction_AmbiguousResultBinding (object p0, object p1) + { + return SR.GetString ("Mapping_ModificationFunction_AmbiguousResultBinding", p0, p1 ); + } + + public static string Mapping_ModificationFunction_AssociationEndMappingForeignKeyAssociation (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_AssociationEndMappingForeignKeyAssociation", p0 ); + } + + public static string Mapping_ModificationFunction_AssociationEndMappingInvalidForEntityType (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_ModificationFunction_AssociationEndMappingInvalidForEntityType", p0, p1, p2); + } + + public static string Mapping_ModificationFunction_AssociationSetAmbiguous (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_AssociationSetAmbiguous", p0 ); + } + + public static string Mapping_ModificationFunction_AssociationSetCardinality (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_AssociationSetCardinality", p0 ); + } + + public static string Mapping_ModificationFunction_AssociationSetDoesNotExist (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_AssociationSetDoesNotExist", p0 ); + } + + public static string Mapping_ModificationFunction_AssociationSetFromRoleIsNotEntitySet (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_AssociationSetFromRoleIsNotEntitySet", p0 ); + } + + public static string Mapping_ModificationFunction_AssociationSetNotMappedForOperation (object p0, object p1, object p2, object p3) + { + return SR.GetString ("Mapping_ModificationFunction_AssociationSetNotMappedForOperation", p0, p1, p2, p3); + } + + public static string Mapping_ModificationFunction_AssociationSetRoleDoesNotExist (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_AssociationSetRoleDoesNotExist", p0 ); + } + + public static string Mapping_ModificationFunction_ComplexTypeNotFound (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_ComplexTypeNotFound", p0 ); + } + + public static string Mapping_ModificationFunction_MissingEntityType (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_MissingEntityType", p0 ); + } + + public static string Mapping_ModificationFunction_MissingParameter (object p0, object p1) + { + return SR.GetString ("Mapping_ModificationFunction_MissingParameter", p0, p1 ); + } + + public static string Mapping_ModificationFunction_MissingSetClosure (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_MissingSetClosure", p0 ); + } + + public static string Mapping_ModificationFunction_MultipleEndsOfAssociationMapped (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_ModificationFunction_MultipleEndsOfAssociationMapped", p0, p1, p2); + } + + public static string Mapping_ModificationFunction_NotValidFunction (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_NotValidFunction", p0 ); + } + + public static string Mapping_ModificationFunction_NotValidFunctionParameter (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_ModificationFunction_NotValidFunctionParameter", p0, p1, p2 ); + } + + public static string Mapping_ModificationFunction_ParameterBoundTwice (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_ParameterBoundTwice", p0 ); + } + + public static string Mapping_ModificationFunction_ParameterNotFound (object p0, object p1) + { + return SR.GetString ("Mapping_ModificationFunction_ParameterNotFound", p0, p1 ); + } + + public static string Mapping_ModificationFunction_PropertyNotFound (object p0, object p1) + { + return SR.GetString ("Mapping_ModificationFunction_PropertyNotFound", p0, p1 ); + } + + public static string Mapping_ModificationFunction_PropertyNotKey (object p0, object p1) + { + return SR.GetString ("Mapping_ModificationFunction_PropertyNotKey", p0, p1 ); + } + + public static string Mapping_ModificationFunction_PropertyParameterTypeMismatch (object p0, object p1, object p2, object p3, object p4, object p5) + { + return SR.GetString ("Mapping_ModificationFunction_PropertyParameterTypeMismatch", p0, p1, p2, p3, p4, p5); + } + + public static string Mapping_ModificationFunction_RedundantEntityTypeMapping (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_RedundantEntityTypeMapping", p0 ); + } + + public static string Mapping_ModificationFunction_UnknownFunction (object p0) + { + return SR.GetString ("Mapping_ModificationFunction_UnknownFunction", p0 ); + } + + public static string Mapping_ModificationFunction_WrongComplexType (object p0, object p1) + { + return SR.GetString ("Mapping_ModificationFunction_WrongComplexType", p0, p1 ); + } + + public static string Mapping_NotFound_EntityContainer (object p0) + { + return SR.GetString ("Mapping_NotFound_EntityContainer", p0 ); + } + + public static string Mapping_Object_InvalidType (object p0) + { + return SR.GetString ("Mapping_Object_InvalidType", p0 ); + } + + public static string Mapping_Provider_WrongConnectionType (object p0) + { + return SR.GetString ("Mapping_Provider_WrongConnectionType", p0 ); + } + + public static string Mapping_Provider_WrongManifestType (object p0) + { + return SR.GetString ("Mapping_Provider_WrongManifestType", p0 ); + } + + public static string Mapping_ProviderReturnsNullType (object p0) + { + return SR.GetString ("Mapping_ProviderReturnsNullType", p0 ); + } + + public static string Mapping_QueryView_Duplicate_OfType (object p0, object p1) + { + return SR.GetString ("Mapping_QueryView_Duplicate_OfType", p0, p1 ); + } + + public static string Mapping_QueryView_Duplicate_OfTypeOnly (object p0, object p1) + { + return SR.GetString ("Mapping_QueryView_Duplicate_OfTypeOnly", p0, p1 ); + } + + public static string Mapping_QueryView_For_Base_Type (object p0, object p1) + { + return SR.GetString ("Mapping_QueryView_For_Base_Type", p0, p1 ); + } + + public static string Mapping_QueryView_PropertyMaps (object p0) + { + return SR.GetString ("Mapping_QueryView_PropertyMaps", p0 ); + } + + public static string Mapping_QueryView_TypeName_Not_Defined (object p0) + { + return SR.GetString ("Mapping_QueryView_TypeName_Not_Defined", p0 ); + } + + public static string Mapping_QueryViewMultipleTypeInTypeName (object p0) + { + return SR.GetString ("Mapping_QueryViewMultipleTypeInTypeName", p0 ); + } + + public static string Mapping_Storage_InvalidSpace (object p0) + { + return SR.GetString ("Mapping_Storage_InvalidSpace", p0 ); + } + + public static string Mapping_StoreTypeMismatch_ScalarPropertyMapping (object p0, object p1) + { + return SR.GetString ("Mapping_StoreTypeMismatch_ScalarPropertyMapping", p0, p1 ); + } + + public static string Mapping_TableName_QueryView (object p0) + { + return SR.GetString ("Mapping_TableName_QueryView", p0 ); + } + + public static string Mapping_UnsupportedExpressionKind_QueryView (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_UnsupportedExpressionKind_QueryView", p0, p1, p2 ); + } + + public static string Mapping_UnsupportedFunctionCall_QueryView (object p0, object p1) + { + return SR.GetString ("Mapping_UnsupportedFunctionCall_QueryView", p0, p1 ); + } + + public static string Mapping_UnsupportedInitialization_QueryView (object p0, object p1) + { + return SR.GetString ("Mapping_UnsupportedInitialization_QueryView", p0, p1 ); + } + + public static string Mapping_UnsupportedPropertyKind_QueryView (object p0, object p1, object p2) + { + return SR.GetString ("Mapping_UnsupportedPropertyKind_QueryView", p0, p1, p2 ); + } + + public static string Mapping_UnsupportedScanTarget_QueryView (object p0, object p1) + { + return SR.GetString ("Mapping_UnsupportedScanTarget_QueryView", p0, p1 ); + } + + public static string Mapping_Views_For_Extent_Not_Generated (object p0, object p1) + { + return SR.GetString ("Mapping_Views_For_Extent_Not_Generated", p0, p1 ); + } + + public static string Materializer_AddedEntityAlreadyExists (object p0) + { + return SR.GetString ("Materializer_AddedEntityAlreadyExists", p0 ); + } + + public static string Materializer_InvalidCastNullable (object p0, object p1) + { + return SR.GetString ("Materializer_InvalidCastNullable", p0, p1 ); + } + + public static string Materializer_InvalidCastReference (object p0, object p1) + { + return SR.GetString ("Materializer_InvalidCastReference", p0, p1 ); + } + + public static string Materializer_NullReferenceCast (object p0) + { + return SR.GetString ("Materializer_NullReferenceCast", p0 ); + } + + public static string Materializer_PropertyIsNotNullableWithName (object p0) + { + return SR.GetString ("Materializer_PropertyIsNotNullableWithName", p0 ); + } + + public static string Materializer_RecyclingEntity (object p0, object p1, object p2, object p3) + { + return SR.GetString ("Materializer_RecyclingEntity", p0, p1, p2, p3 ); + } + + public static string Materializer_SetInvalidValue (object p0, object p1, object p2, object p3) + { + return SR.GetString ("Materializer_SetInvalidValue", p0, p1, p2, p3 ); + } + + public static string MemberDoesNotBelongToEntityContainer (object p0, object p1) + { + return SR.GetString ("MemberDoesNotBelongToEntityContainer", p0, p1 ); + } + + public static string MemberInvalidIdentity (object p0) + { + return SR.GetString ("MemberInvalidIdentity", p0 ); + } + + public static string MinAndMaxMustBePositive (object p0, object p1) + { + return SR.GetString ("MinAndMaxMustBePositive", p0, p1 ); + } + + public static string MinAndMaxValueMustBeDifferentForNonConstantFacet (object p0, object p1) + { + return SR.GetString ("MinAndMaxValueMustBeDifferentForNonConstantFacet", p0, p1 ); + } + + public static string MinAndMaxValueMustBeSameForConstantFacet (object p0, object p1) + { + return SR.GetString ("MinAndMaxValueMustBeSameForConstantFacet", p0, p1 ); + } + + public static string MinMustBeLessThanMax (object p0, object p1, object p2) + { + return SR.GetString ("MinMustBeLessThanMax", p0, p1, p2 ); + } + + public static string MissingConstraintOnRelationshipType (object p0) + { + return SR.GetString ("MissingConstraintOnRelationshipType", p0 ); + } + + public static string MissingDefaultValueForConstantFacet (object p0, object p1) + { + return SR.GetString ("MissingDefaultValueForConstantFacet", p0, p1 ); + } + + public static string MissingEntityContainerEnd (object p0, object p1) + { + return SR.GetString ("MissingEntityContainerEnd", p0, p1 ); + } + + public static string MissingFacetDescription (object p0, object p1, object p2) + { + return SR.GetString ("MissingFacetDescription", p0, p1, p2 ); + } + + public static string MoreThanOneItemMatchesIdentity (object p0) + { + return SR.GetString ("MoreThanOneItemMatchesIdentity", p0 ); + } + + public static string MultipleDefinitionsOfParameter (object p0) + { + return SR.GetString ("MultipleDefinitionsOfParameter", p0 ); + } + + public static string MultipleDefinitionsOfVariable (object p0) + { + return SR.GetString ("MultipleDefinitionsOfVariable", p0 ); + } + + public static string NamespaceAliasAlreadyUsed (object p0) + { + return SR.GetString ("NamespaceAliasAlreadyUsed", p0 ); + } + + public static string NamespaceAlreadyImported (object p0) + { + return SR.GetString ("NamespaceAlreadyImported", p0 ); + } + + public static string NavigationPropertyRelationshipEndTypeMismatch (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("NavigationPropertyRelationshipEndTypeMismatch", p0, p1, p2, p3, p4 ); + } + + public static string NeedNotUseSystemNamespaceInUsing (object p0) + { + return SR.GetString ("NeedNotUseSystemNamespaceInUsing", p0 ); + } + + public static string NestedAggregateCannotBeUsedInAggregate (object p0, object p1) + { + return SR.GetString ("NestedAggregateCannotBeUsedInAggregate", p0, p1 ); + } + + public static string NestedClassNotSupported (object p0, object p1) + { + return SR.GetString ("NestedClassNotSupported", p0, p1 ); + } + + public static string NewTypeConflictsWithExistingType (object p0, object p1) + { + return SR.GetString ("NewTypeConflictsWithExistingType", p0, p1 ); + } + + public static string NoAggrFunctionOverloadMatch (object p0, object p1, object p2) + { + return SR.GetString ("NoAggrFunctionOverloadMatch", p0, p1, p2 ); + } + + public static string NoCanonicalAggrFunctionOverloadMatch (object p0, object p1, object p2) + { + return SR.GetString ("NoCanonicalAggrFunctionOverloadMatch", p0, p1, p2 ); + } + + public static string NoCanonicalFunctionOverloadMatch (object p0, object p1, object p2) + { + return SR.GetString ("NoCanonicalFunctionOverloadMatch", p0, p1, p2 ); + } + + public static string NoCodeGenNamespaceInStructuralAnnotation (object p0) + { + return SR.GetString ("NoCodeGenNamespaceInStructuralAnnotation", p0 ); + } + + public static string NoCollectionForSpace (object p0) + { + return SR.GetString ("NoCollectionForSpace", p0 ); + } + + public static string NoFunctionOverloadMatch (object p0, object p1, object p2) + { + return SR.GetString ("NoFunctionOverloadMatch", p0, p1, p2 ); + } + + public static string NoStoreTypeForEdmType (object p0, object p1) + { + return SR.GetString ("NoStoreTypeForEdmType", p0, p1 ); + } + + public static string NotAMemberOfCollection (object p0, object p1) + { + return SR.GetString ("NotAMemberOfCollection", p0, p1 ); + } + + public static string NotAMemberOfType (object p0, object p1) + { + return SR.GetString ("NotAMemberOfType", p0, p1 ); + } + + public static string NotASuperOrSubType (object p0, object p1) + { + return SR.GetString ("NotASuperOrSubType", p0, p1 ); + } + + public static string NotInNamespaceAlias (object p0, object p1, object p2) + { + return SR.GetString ("NotInNamespaceAlias", p0, p1, p2 ); + } + + public static string NotInNamespaceNoAlias (object p0, object p1) + { + return SR.GetString ("NotInNamespaceNoAlias", p0, p1 ); + } + + public static string NotNamespaceQualified (object p0) + { + return SR.GetString ("NotNamespaceQualified", p0 ); + } + + public static string NullParameterForEdmRelationshipAttribute (object p0, object p1) + { + return SR.GetString ("NullParameterForEdmRelationshipAttribute", p0, p1 ); + } + + public static string NullRelationshipNameforEdmRelationshipAttribute (object p0) + { + return SR.GetString ("NullRelationshipNameforEdmRelationshipAttribute", p0 ); + } + + public static string NumberOfTypeCtorIsLessThenFormalSpec (object p0) + { + return SR.GetString ("NumberOfTypeCtorIsLessThenFormalSpec", p0 ); + } + + public static string NumberOfTypeCtorIsMoreThenFormalSpec (object p0) + { + return SR.GetString ("NumberOfTypeCtorIsMoreThenFormalSpec", p0 ); + } + + public static string ObjectContext_AcceptAllChangesFailure (object p0) + { + return SR.GetString ("ObjectContext_AcceptAllChangesFailure", p0 ); + } + + public static string ObjectContext_CannotExplicitlyLoadDetachedRelationships (object p0) + { + return SR.GetString ("ObjectContext_CannotExplicitlyLoadDetachedRelationships", p0 ); + } + + public static string ObjectContext_CannotLoadReferencesUsingDifferentContext (object p0) + { + return SR.GetString ("ObjectContext_CannotLoadReferencesUsingDifferentContext", p0 ); + } + + public static string ObjectContext_ClientEntityRemovedFromStore (object p0) + { + return SR.GetString ("ObjectContext_ClientEntityRemovedFromStore", p0 ); + } + + public static string ObjectContext_EntitiesHaveDifferentType (object p0, object p1) + { + return SR.GetString ("ObjectContext_EntitiesHaveDifferentType", p0, p1 ); + } + + public static string ObjectContext_EntityContainerNotFoundForName (object p0) + { + return SR.GetString ("ObjectContext_EntityContainerNotFoundForName", p0 ); + } + + public static string ObjectContext_EntityMustBeUnchangedOrModified (object p0) + { + return SR.GetString ("ObjectContext_EntityMustBeUnchangedOrModified", p0 ); + } + + public static string ObjectContext_EntityMustBeUnchangedOrModifiedOrDeleted (object p0) + { + return SR.GetString ("ObjectContext_EntityMustBeUnchangedOrModifiedOrDeleted", p0 ); + } + + public static string ObjectContext_EntityNotInObjectSet_Delete (object p0, object p1, object p2, object p3) + { + return SR.GetString ("ObjectContext_EntityNotInObjectSet_Delete", p0, p1, p2, p3 ); + } + + public static string ObjectContext_EntityNotInObjectSet_Detach (object p0, object p1, object p2, object p3) + { + return SR.GetString ("ObjectContext_EntityNotInObjectSet_Detach", p0, p1, p2, p3 ); + } + + public static string ObjectContext_EntitySetNotFoundForName (object p0) + { + return SR.GetString ("ObjectContext_EntitySetNotFoundForName", p0 ); + } + + public static string ObjectContext_ExecuteFunctionCalledWithNonQueryFunction (object p0) + { + return SR.GetString ("ObjectContext_ExecuteFunctionCalledWithNonQueryFunction", p0 ); + } + + public static string ObjectContext_ExecuteFunctionCalledWithNullParameter (object p0) + { + return SR.GetString ("ObjectContext_ExecuteFunctionCalledWithNullParameter", p0 ); + } + + public static string ObjectContext_ExecuteFunctionCalledWithScalarFunction (object p0, object p1) + { + return SR.GetString ("ObjectContext_ExecuteFunctionCalledWithScalarFunction", p0, p1 ); + } + + public static string ObjectContext_ExecuteFunctionTypeMismatch (object p0, object p1) + { + return SR.GetString ("ObjectContext_ExecuteFunctionTypeMismatch", p0, p1 ); + } + + public static string ObjectContext_InvalidDefaultContainerName (object p0) + { + return SR.GetString ("ObjectContext_InvalidDefaultContainerName", p0 ); + } + + public static string ObjectContext_InvalidEntitySetForStoreQuery (object p0, object p1, object p2) + { + return SR.GetString ("ObjectContext_InvalidEntitySetForStoreQuery", p0, p1, p2 ); + } + + public static string ObjectContext_InvalidEntitySetInKey (object p0, object p1, object p2, object p3) + { + return SR.GetString ("ObjectContext_InvalidEntitySetInKey", p0, p1, p2, p3 ); + } + + public static string ObjectContext_InvalidEntitySetInKeyFromName (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("ObjectContext_InvalidEntitySetInKeyFromName", p0, p1, p2, p3, p4 ); + } + + public static string ObjectContext_InvalidEntitySetOnEntity (object p0, object p1) + { + return SR.GetString ("ObjectContext_InvalidEntitySetOnEntity", p0, p1 ); + } + + public static string ObjectContext_InvalidObjectSetTypeForEntitySet (object p0, object p1, object p2) + { + return SR.GetString ("ObjectContext_InvalidObjectSetTypeForEntitySet", p0, p1, p2 ); + } + + public static string ObjectContext_InvalidTypeForStoreQuery (object p0) + { + return SR.GetString ("ObjectContext_InvalidTypeForStoreQuery", p0 ); + } + + public static string ObjectContext_MultipleEntitySetsFoundInAllContainers (object p0) + { + return SR.GetString ("ObjectContext_MultipleEntitySetsFoundInAllContainers", p0 ); + } + + public static string ObjectContext_MultipleEntitySetsFoundInSingleContainer (object p0, object p1) + { + return SR.GetString ("ObjectContext_MultipleEntitySetsFoundInSingleContainer", p0, p1 ); + } + + public static string ObjectContext_NoEntitySetFoundForType (object p0) + { + return SR.GetString ("ObjectContext_NoEntitySetFoundForType", p0 ); + } + + public static string ObjectContext_NoMappingForEntityType (object p0) + { + return SR.GetString ("ObjectContext_NoMappingForEntityType", p0 ); + } + + public static string ObjectContext_NthElementInAddedState (object p0) + { + return SR.GetString ("ObjectContext_NthElementInAddedState", p0 ); + } + + public static string ObjectContext_NthElementIsDuplicate (object p0) + { + return SR.GetString ("ObjectContext_NthElementIsDuplicate", p0 ); + } + + public static string ObjectContext_NthElementIsNull (object p0) + { + return SR.GetString ("ObjectContext_NthElementIsNull", p0 ); + } + + public static string ObjectContext_NthElementNotInObjectStateManager (object p0) + { + return SR.GetString ("ObjectContext_NthElementNotInObjectStateManager", p0 ); + } + + public static string ObjectContext_TwoPropertiesMappedToSameColumn (object p0, object p1) + { + return SR.GetString ("ObjectContext_TwoPropertiesMappedToSameColumn", p0, p1 ); + } + + public static string ObjectParameter_InvalidParameterName (object p0) + { + return SR.GetString ("ObjectParameter_InvalidParameterName", p0 ); + } + + public static string ObjectParameter_InvalidParameterType (object p0) + { + return SR.GetString ("ObjectParameter_InvalidParameterType", p0 ); + } + + public static string ObjectParameterCollection_DuplicateParameterName (object p0) + { + return SR.GetString ("ObjectParameterCollection_DuplicateParameterName", p0 ); + } + + public static string ObjectParameterCollection_ParameterAlreadyExists (object p0) + { + return SR.GetString ("ObjectParameterCollection_ParameterAlreadyExists", p0 ); + } + + public static string ObjectParameterCollection_ParameterNameNotFound (object p0) + { + return SR.GetString ("ObjectParameterCollection_ParameterNameNotFound", p0 ); + } + + public static string ObjectQuery_InvalidQueryName (object p0) + { + return SR.GetString ("ObjectQuery_InvalidQueryName", p0 ); + } + + public static string ObjectQuery_QueryBuilder_InvalidResultType (object p0) + { + return SR.GetString ("ObjectQuery_QueryBuilder_InvalidResultType", p0 ); + } + + public static string ObjectQuery_Span_NoNavProp (object p0, object p1) + { + return SR.GetString ("ObjectQuery_Span_NoNavProp", p0, p1 ); + } + + public static string ObjectQuery_UnableToMaterializeArbitaryProjectionType (object p0) + { + return SR.GetString ("ObjectQuery_UnableToMaterializeArbitaryProjectionType", p0 ); + } + + public static string ObjectQuery_UnableToMaterializeArray (object p0, object p1) + { + return SR.GetString ("ObjectQuery_UnableToMaterializeArray", p0, p1 ); + } + + public static string ObjectStateEntry_CannotModifyKeyProperty (object p0) + { + return SR.GetString ("ObjectStateEntry_CannotModifyKeyProperty", p0 ); + } + + public static string ObjectStateEntry_ChangedInDifferentStateFromChanging (object p0, object p1) + { + return SR.GetString ("ObjectStateEntry_ChangedInDifferentStateFromChanging", p0, p1 ); + } + + public static string ObjectStateEntry_ChangeOnUnmappedComplexProperty (object p0) + { + return SR.GetString ("ObjectStateEntry_ChangeOnUnmappedComplexProperty", p0 ); + } + + public static string ObjectStateEntry_ChangeOnUnmappedProperty (object p0) + { + return SR.GetString ("ObjectStateEntry_ChangeOnUnmappedProperty", p0 ); + } + + public static string ObjectStateEntry_ComplexObjectUsedMultipleTimes (object p0, object p1) + { + return SR.GetString ("ObjectStateEntry_ComplexObjectUsedMultipleTimes", p0, p1 ); + } + + public static string ObjectStateEntry_NullOriginalValueForNonNullableProperty (object p0, object p1, object p2) + { + return SR.GetString ("ObjectStateEntry_NullOriginalValueForNonNullableProperty", p0, p1, p2 ); + } + + public static string ObjectStateEntry_SetModifiedOnInvalidProperty (object p0) + { + return SR.GetString ("ObjectStateEntry_SetModifiedOnInvalidProperty", p0 ); + } + + public static string ObjectStateEntry_SetModifiedStates (object p0) + { + return SR.GetString ("ObjectStateEntry_SetModifiedStates", p0 ); + } + + public static string ObjectStateEntry_SetOriginalComplexProperties (object p0) + { + return SR.GetString ("ObjectStateEntry_SetOriginalComplexProperties", p0 ); + } + + public static string ObjectStateEntry_SetOriginalPrimaryKey (object p0) + { + return SR.GetString ("ObjectStateEntry_SetOriginalPrimaryKey", p0 ); + } + + public static string ObjectStateEntry_UnableToEnumerateCollection (object p0, object p1) + { + return SR.GetString ("ObjectStateEntry_UnableToEnumerateCollection", p0, p1 ); + } + + public static string ObjectStateManager_ConflictingChangesOfRelationshipDetected (object p0, object p1) + { + return SR.GetString ("ObjectStateManager_ConflictingChangesOfRelationshipDetected", p0, p1 ); + } + + public static string ObjectStateManager_DoesnotAllowToReAddUnchangedOrModifiedOrDeletedEntity (object p0) + { + return SR.GetString ("ObjectStateManager_DoesnotAllowToReAddUnchangedOrModifiedOrDeletedEntity", p0 ); + } + + public static string ObjectStateManager_EntityTypeDoesnotMatchtoEntitySetType (object p0, object p1) + { + return SR.GetString ("ObjectStateManager_EntityTypeDoesnotMatchtoEntitySetType", p0, p1 ); + } + + public static string ObjectStateManager_GetEntityKeyRequiresObjectToHaveAKey (object p0) + { + return SR.GetString ("ObjectStateManager_GetEntityKeyRequiresObjectToHaveAKey", p0 ); + } + + public static string ObjectStateManager_NoEntryExistsForObject (object p0) + { + return SR.GetString ("ObjectStateManager_NoEntryExistsForObject", p0 ); + } + + public static string ObjectView_CannotResolveTheEntitySet (object p0) + { + return SR.GetString ("ObjectView_CannotResolveTheEntitySet", p0 ); + } + + public static string OfTypeExpressionElementTypeMustBeEntityType (object p0, object p1) + { + return SR.GetString ("OfTypeExpressionElementTypeMustBeEntityType", p0, p1 ); + } + + public static string OfTypeExpressionElementTypeMustBeNominalType (object p0, object p1) + { + return SR.GetString ("OfTypeExpressionElementTypeMustBeNominalType", p0, p1 ); + } + + public static string OfTypeOnlyTypeArgumentCannotBeAbstract (object p0) + { + return SR.GetString ("OfTypeOnlyTypeArgumentCannotBeAbstract", p0 ); + } + + public static string ParameterNameAlreadyDefinedDuplicate (object p0) + { + return SR.GetString ("ParameterNameAlreadyDefinedDuplicate", p0 ); + } + + public static string ParameterTypeNotSupported (object p0, object p1) + { + return SR.GetString ("ParameterTypeNotSupported", p0, p1 ); + } + + public static string ParameterWasNotDefined (object p0) + { + return SR.GetString ("ParameterWasNotDefined", p0 ); + } + + public static string PlaceholderExpressionMustBeCompatibleWithEdm64 (object p0, object p1) + { + return SR.GetString ("PlaceholderExpressionMustBeCompatibleWithEdm64", p0, p1 ); + } + + public static string PlaceholderExpressionMustBeConstant (object p0) + { + return SR.GetString ("PlaceholderExpressionMustBeConstant", p0 ); + } + + public static string PlaceholderExpressionMustBeGreaterThanOrEqualToZero (object p0) + { + return SR.GetString ("PlaceholderExpressionMustBeGreaterThanOrEqualToZero", p0 ); + } + + public static string PlaceholderSetArgTypeIsNotEqualComparable (object p0, object p1, object p2) + { + return SR.GetString ("PlaceholderSetArgTypeIsNotEqualComparable", p0, p1, p2 ); + } + + public static string PocoEntityWrapper_UnableToMaterializeArbitaryNavPropType (object p0, object p1) + { + return SR.GetString ("PocoEntityWrapper_UnableToMaterializeArbitaryNavPropType", p0, p1 ); + } + + public static string PocoEntityWrapper_UnableToSetFieldOrProperty (object p0, object p1) + { + return SR.GetString ("PocoEntityWrapper_UnableToSetFieldOrProperty", p0, p1 ); + } + + public static string PocoEntityWrapper_UnexpectedTypeForNavigationProperty (object p0, object p1) + { + return SR.GetString ("PocoEntityWrapper_UnexpectedTypeForNavigationProperty", p0, p1 ); + } + + public static string PrecisionMustBeGreaterThanScale (object p0, object p1) + { + return SR.GetString ("PrecisionMustBeGreaterThanScale", p0, p1 ); + } + + public static string PrecisionOutOfRange (object p0, object p1, object p2, object p3) + { + return SR.GetString ("PrecisionOutOfRange", p0, p1, p2, p3 ); + } + + public static string PropertyNameAlreadyDefinedDuplicate (object p0) + { + return SR.GetString ("PropertyNameAlreadyDefinedDuplicate", p0 ); + } + + public static string PropertyTypeAlreadyDefined (object p0) + { + return SR.GetString ("PropertyTypeAlreadyDefined", p0 ); + } + + public static string ProviderDoesNotSupportType (object p0) + { + return SR.GetString ("ProviderDoesNotSupportType", p0 ); + } + + public static string ProviderReturnedNullForGetDbInformation (object p0) + { + return SR.GetString ("ProviderReturnedNullForGetDbInformation", p0 ); + } + + public static string RefArgIsNotOfEntityType (object p0) + { + return SR.GetString ("RefArgIsNotOfEntityType", p0 ); + } + + public static string ReferenceToNonEntityType (object p0) + { + return SR.GetString ("ReferenceToNonEntityType", p0 ); + } + + public static string RefTypeIdentifierMustSpecifyAnEntityType (object p0, object p1) + { + return SR.GetString ("RefTypeIdentifierMustSpecifyAnEntityType", p0, p1 ); + } + + public static string RelatedEnd_CannotAddToFixedSizeArray (object p0) + { + return SR.GetString ("RelatedEnd_CannotAddToFixedSizeArray", p0 ); + } + + public static string RelatedEnd_CannotCreateRelationshipBetweenTrackedAndNoTrackedEntities (object p0) + { + return SR.GetString ("RelatedEnd_CannotCreateRelationshipBetweenTrackedAndNoTrackedEntities", p0 ); + } + + public static string RelatedEnd_CannotRemoveFromFixedSizeArray (object p0) + { + return SR.GetString ("RelatedEnd_CannotRemoveFromFixedSizeArray", p0 ); + } + + public static string RelatedEnd_CannotSerialize (object p0) + { + return SR.GetString ("RelatedEnd_CannotSerialize", p0 ); + } + + public static string RelatedEnd_EntitySetIsNotValidForRelationship (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("RelatedEnd_EntitySetIsNotValidForRelationship", p0, p1, p2, p3, p4 ); + } + + public static string RelatedEnd_InvalidContainedType_Collection (object p0, object p1) + { + return SR.GetString ("RelatedEnd_InvalidContainedType_Collection", p0, p1 ); + } + + public static string RelatedEnd_InvalidContainedType_Reference (object p0, object p1) + { + return SR.GetString ("RelatedEnd_InvalidContainedType_Reference", p0, p1 ); + } + + public static string RelatedEnd_InvalidNthElementContextForAttach (object p0) + { + return SR.GetString ("RelatedEnd_InvalidNthElementContextForAttach", p0 ); + } + + public static string RelatedEnd_InvalidNthElementNullForAttach (object p0) + { + return SR.GetString ("RelatedEnd_InvalidNthElementNullForAttach", p0 ); + } + + public static string RelatedEnd_InvalidNthElementStateForAttach (object p0) + { + return SR.GetString ("RelatedEnd_InvalidNthElementStateForAttach", p0 ); + } + + public static string RelatedEnd_InvalidRelationshipFixupDetected (object p0, object p1) + { + return SR.GetString ("RelatedEnd_InvalidRelationshipFixupDetected", p0, p1 ); + } + + public static string RelatedEnd_MismatchedMergeOptionOnLoad (object p0) + { + return SR.GetString ("RelatedEnd_MismatchedMergeOptionOnLoad", p0 ); + } + + public static string RelatedEnd_RelatedEndNotAttachedToContext (object p0) + { + return SR.GetString ("RelatedEnd_RelatedEndNotAttachedToContext", p0 ); + } + + public static string RelatedEndExprTypeMustBePromotoableToToEnd (object p0, object p1) + { + return SR.GetString ("RelatedEndExprTypeMustBePromotoableToToEnd", p0, p1 ); + } + + public static string RelationshipManager_CollectionAlreadyInitialized (object p0) + { + return SR.GetString ("RelationshipManager_CollectionAlreadyInitialized", p0 ); + } + + public static string RelationshipManager_CollectionRelationshipManagerAttached (object p0) + { + return SR.GetString ("RelationshipManager_CollectionRelationshipManagerAttached", p0 ); + } + + public static string RelationshipManager_InvalidTargetRole (object p0, object p1) + { + return SR.GetString ("RelationshipManager_InvalidTargetRole", p0, p1 ); + } + + public static string RelationshipManager_NavigationPropertyNotFound (object p0) + { + return SR.GetString ("RelationshipManager_NavigationPropertyNotFound", p0 ); + } + + public static string RelationshipManager_OwnerIsNotSourceType (object p0, object p1, object p2, object p3) + { + return SR.GetString ("RelationshipManager_OwnerIsNotSourceType", p0, p1, p2, p3 ); + } + + public static string RelationshipManager_ReferenceAlreadyInitialized (object p0) + { + return SR.GetString ("RelationshipManager_ReferenceAlreadyInitialized", p0 ); + } + + public static string RelationshipManager_RelationshipManagerAttached (object p0) + { + return SR.GetString ("RelationshipManager_RelationshipManagerAttached", p0 ); + } + + public static string RelationshipManager_UnableToFindRelationshipTypeInMetadata (object p0) + { + return SR.GetString ("RelationshipManager_UnableToFindRelationshipTypeInMetadata", p0 ); + } + + public static string RelationshipNameInNavigationPropertyNotValid (object p0, object p1, object p2) + { + return SR.GetString ("RelationshipNameInNavigationPropertyNotValid", p0, p1, p2 ); + } + + public static string RelationshipTargetMustBeUnique (object p0) + { + return SR.GetString ("RelationshipTargetMustBeUnique", p0 ); + } + + public static string RelationshipTypeExpected (object p0) + { + return SR.GetString ("RelationshipTypeExpected", p0 ); + } + + public static string RequiredFacetMissing (object p0, object p1) + { + return SR.GetString ("RequiredFacetMissing", p0, p1 ); + } + + public static string RoleTypeInEdmRelationshipAttributeIsInvalidType (object p0, object p1, object p2) + { + return SR.GetString ("RoleTypeInEdmRelationshipAttributeIsInvalidType", p0, p1, p2 ); + } + + public static string SameRoleNameOnRelationshipAttribute (object p0, object p1) + { + return SR.GetString ("SameRoleNameOnRelationshipAttribute", p0, p1 ); + } + + public static string SameRoleReferredInReferentialConstraint (object p0) + { + return SR.GetString ("SameRoleReferredInReferentialConstraint", p0 ); + } + + public static string ScaleOutOfRange (object p0, object p1, object p2, object p3) + { + return SR.GetString ("ScaleOutOfRange", p0, p1, p2, p3 ); + } + + public static string SimilarRelationshipEnd (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("SimilarRelationshipEnd", p0, p1, p2, p3, p4 ); + } + + public static string SourceTypeMustBePromotoableToFromEndRelationType (object p0, object p1) + { + return SR.GetString ("SourceTypeMustBePromotoableToFromEndRelationType", p0, p1 ); + } + + public static string SqlGen_CanonicalFunctionNotSupportedPriorSql10 (object p0) + { + return SR.GetString ("SqlGen_CanonicalFunctionNotSupportedPriorSql10", p0 ); + } + + public static string SqlGen_InvalidDatePartArgumentExpression (object p0, object p1) + { + return SR.GetString ("SqlGen_InvalidDatePartArgumentExpression", p0, p1 ); + } + + public static string SqlGen_InvalidDatePartArgumentValue (object p0, object p1, object p2) + { + return SR.GetString ("SqlGen_InvalidDatePartArgumentValue", p0, p1, p2 ); + } + + public static string SqlGen_PrimitiveTypeNotSupportedPriorSql10 (object p0) + { + return SR.GetString ("SqlGen_PrimitiveTypeNotSupportedPriorSql10", p0 ); + } + + public static string SqlGen_TypedNaNNotSupported (object p0) + { + return SR.GetString ("SqlGen_TypedNaNNotSupported", p0 ); + } + + public static string SqlGen_TypedNegativeInfinityNotSupported (object p0, object p1) + { + return SR.GetString ("SqlGen_TypedNegativeInfinityNotSupported", p0, p1 ); + } + + public static string SqlGen_TypedPositiveInfinityNotSupported (object p0, object p1) + { + return SR.GetString ("SqlGen_TypedPositiveInfinityNotSupported", p0, p1 ); + } + + public static string SqlProvider_InvalidGeographyColumn (object p0) + { + return SR.GetString ("SqlProvider_InvalidGeographyColumn", p0 ); + } + + public static string SqlProvider_InvalidGeometryColumn (object p0) + { + return SR.GetString ("SqlProvider_InvalidGeometryColumn", p0 ); + } + + public static string SqlProvider_NeedSqlDataReader (object p0) + { + return SR.GetString ("SqlProvider_NeedSqlDataReader", p0 ); + } + + public static string SqlSpatialServices_ProviderValueNotSqlType (object p0) + { + return SR.GetString ("SqlSpatialServices_ProviderValueNotSqlType", p0 ); + } + + public static string StorageEntityContainerNameMismatchWhileSpecifyingPartialMapping (object p0, object p1, object p2) + { + return SR.GetString ("StorageEntityContainerNameMismatchWhileSpecifyingPartialMapping", p0, p1, p2); + } + + public static string StoreItemCollectionMustHaveOneArtifact (object p0) + { + return SR.GetString ("StoreItemCollectionMustHaveOneArtifact", p0 ); + } + + public static string SystemNamespaceEncountered (object p0) + { + return SR.GetString ("SystemNamespaceEncountered", p0 ); + } + + public static string TableAndSchemaAreMutuallyExclusiveWithDefiningQuery (object p0) + { + return SR.GetString ("TableAndSchemaAreMutuallyExclusiveWithDefiningQuery", p0 ); + } + + public static string TargetRoleNameInNavigationPropertyNotValid (object p0, object p1, object p2, object p3) + { + return SR.GetString ("TargetRoleNameInNavigationPropertyNotValid", p0, p1, p2, p3 ); + } + + public static string TextNotAllowed (object p0) + { + return SR.GetString ("TextNotAllowed", p0 ); + } + + public static string TooManyAssociationEnds (object p0) + { + return SR.GetString ("TooManyAssociationEnds", p0 ); + } + + public static string TypeArgumentBelowMin (object p0) + { + return SR.GetString ("TypeArgumentBelowMin", p0 ); + } + + public static string TypeArgumentCountMismatch (object p0, object p1) + { + return SR.GetString ("TypeArgumentCountMismatch", p0, p1 ); + } + + public static string TypeArgumentExceedsMax (object p0) + { + return SR.GetString ("TypeArgumentExceedsMax", p0 ); + } + + public static string TypeDoesNotSupportFacet (object p0, object p1) + { + return SR.GetString ("TypeDoesNotSupportFacet", p0, p1 ); + } + + public static string TypeDoesNotSupportSpec (object p0) + { + return SR.GetString ("TypeDoesNotSupportSpec", p0 ); + } + + public static string TypeKindMismatch (object p0, object p1, object p2, object p3) + { + return SR.GetString ("TypeKindMismatch", p0, p1, p2, p3 ); + } + + public static string TypeMismatchRelationshipConstaint (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("TypeMismatchRelationshipConstaint", p0, p1, p2, p3, p4 ); + } + + public static string TypeMustBeEntityType (object p0, object p1, object p2) + { + return SR.GetString ("TypeMustBeEntityType", p0, p1, p2 ); + } + + public static string TypeMustBeNominalType (object p0, object p1, object p2) + { + return SR.GetString ("TypeMustBeNominalType", p0, p1, p2 ); + } + + public static string TypeNameAlreadyDefinedDuplicate (object p0) + { + return SR.GetString ("TypeNameAlreadyDefinedDuplicate", p0 ); + } + + public static string TypeNameNotFound (object p0) + { + return SR.GetString ("TypeNameNotFound", p0 ); + } + + public static string TypeNotInAssociationSet (object p0, object p1, object p2) + { + return SR.GetString ("TypeNotInAssociationSet", p0, p1, p2 ); + } + + public static string TypeNotInEntitySet (object p0, object p1, object p2) + { + return SR.GetString ("TypeNotInEntitySet", p0, p1, p2 ); + } + + public static string UnableToFindReflectedType (object p0, object p1) + { + return SR.GetString ("UnableToFindReflectedType", p0, p1 ); + } + + public static string UnableToResolveAssembly (object p0) + { + return SR.GetString ("UnableToResolveAssembly", p0 ); + } + + public static string UnacceptableUri (object p0) + { + return SR.GetString ("UnacceptableUri", p0 ); + } + + public static string UnexpectedRootElement (object p0, object p1, object p2) + { + return SR.GetString ("UnexpectedRootElement", p0, p1, p2 ); + } + + public static string UnexpectedRootElementNoNamespace (object p0, object p1, object p2) + { + return SR.GetString ("UnexpectedRootElementNoNamespace", p0, p1, p2 ); + } + + public static string UnexpectedTypeInCollection (object p0, object p1) + { + return SR.GetString ("UnexpectedTypeInCollection", p0, p1 ); + } + + public static string UnexpectedXmlAttribute (object p0) + { + return SR.GetString ("UnexpectedXmlAttribute", p0 ); + } + + public static string UnexpectedXmlElement (object p0) + { + return SR.GetString ("UnexpectedXmlElement", p0 ); + } + + public static string UnexpectedXmlNodeType (object p0) + { + return SR.GetString ("UnexpectedXmlNodeType", p0 ); + } + + public static string UnknownExpressionResolutionClass (object p0) + { + return SR.GetString ("UnknownExpressionResolutionClass", p0 ); + } + + public static string Update_AmbiguousForeignKey (object p0) + { + return SR.GetString ("Update_AmbiguousForeignKey", p0 ); + } + + public static string Update_ConcurrencyError (object p0) + { + return SR.GetString ("Update_ConcurrencyError", p0 ); + } + + public static string Update_GeneratedDependent (object p0) + { + return SR.GetString ("Update_GeneratedDependent", p0 ); + } + + public static string Update_InsertingOrUpdatingReferenceToDeletedEntity (object p0) + { + return SR.GetString ("Update_InsertingOrUpdatingReferenceToDeletedEntity", p0 ); + } + + public static string Update_MappingNotFound (object p0) + { + return SR.GetString ("Update_MappingNotFound", p0 ); + } + + public static string Update_MissingEntity (object p0, object p1) + { + return SR.GetString ("Update_MissingEntity", p0, p1 ); + } + + public static string Update_MissingFunctionMapping (object p0, object p1, object p2) + { + return SR.GetString ("Update_MissingFunctionMapping", p0, p1, p2 ); + } + + public static string Update_MissingRequiredEntity (object p0, object p1, object p2) + { + return SR.GetString ("Update_MissingRequiredEntity", p0, p1, p2 ); + } + + public static string Update_MissingRequiredRelationshipValue (object p0, object p1) + { + return SR.GetString ("Update_MissingRequiredRelationshipValue", p0, p1 ); + } + + public static string Update_MissingResultColumn (object p0) + { + return SR.GetString ("Update_MissingResultColumn", p0 ); + } + + public static string Update_ModifyingIdentityColumn (object p0, object p1, object p2) + { + return SR.GetString ("Update_ModifyingIdentityColumn", p0, p1, p2 ); + } + + public static string Update_NotSupportedComputedKeyColumn (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("Update_NotSupportedComputedKeyColumn", p0, p1, p2, p3, p4 ); + } + + public static string Update_NotSupportedIdentityType (object p0, object p1) + { + return SR.GetString ("Update_NotSupportedIdentityType", p0, p1 ); + } + + public static string Update_NotSupportedServerGenKey (object p0) + { + return SR.GetString ("Update_NotSupportedServerGenKey", p0 ); + } + + public static string Update_NullReturnValueForNonNullableMember (object p0, object p1) + { + return SR.GetString ("Update_NullReturnValueForNonNullableMember", p0, p1 ); + } + + public static string Update_NullValue (object p0) + { + return SR.GetString ("Update_NullValue", p0 ); + } + + public static string Update_RelationshipCardinalityConstraintViolation (object p0, object p1, object p2, object p3, object p4, object p5) + { + return SR.GetString ("Update_RelationshipCardinalityConstraintViolation", p0, p1, p2, p3, p4, p5); + } + + public static string Update_RelationshipCardinalityConstraintViolationSingleValue (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("Update_RelationshipCardinalityConstraintViolationSingleValue", p0, p1, p2, p3, p4); + } + + public static string Update_RelationshipCardinalityViolation (object p0, object p1, object p2, object p3, object p4, object p5) + { + return SR.GetString ("Update_RelationshipCardinalityViolation", p0, p1, p2, p3, p4, p5 ); + } + + public static string Update_ReturnValueHasUnexpectedType (object p0, object p1, object p2, object p3) + { + return SR.GetString ("Update_ReturnValueHasUnexpectedType", p0, p1, p2, p3 ); + } + + public static string Update_SqlEntitySetWithoutDmlFunctions (object p0, object p1, object p2) + { + return SR.GetString ("Update_SqlEntitySetWithoutDmlFunctions", p0, p1, p2 ); + } + + public static string Update_UnableToConvertRowsAffectedParameterToInt32 (object p0, object p1) + { + return SR.GetString ("Update_UnableToConvertRowsAffectedParameterToInt32", p0, p1 ); + } + + public static string Update_UnsupportedCastArgument (object p0) + { + return SR.GetString ("Update_UnsupportedCastArgument", p0 ); + } + + public static string Update_UnsupportedExpressionKind (object p0, object p1) + { + return SR.GetString ("Update_UnsupportedExpressionKind", p0, p1 ); + } + + public static string Update_UnsupportedExtentType (object p0, object p1) + { + return SR.GetString ("Update_UnsupportedExtentType", p0, p1 ); + } + + public static string Update_UnsupportedJoinType (object p0) + { + return SR.GetString ("Update_UnsupportedJoinType", p0 ); + } + + public static string Update_UnsupportedProjection (object p0) + { + return SR.GetString ("Update_UnsupportedProjection", p0 ); + } + + public static string Validator_NoKeyMembers (object p0) + { + return SR.GetString ("Validator_NoKeyMembers", p0 ); + } + + public static string Validator_NullableEntityKeyProperty (object p0, object p1) + { + return SR.GetString ("Validator_NullableEntityKeyProperty", p0, p1 ); + } + + public static string Validator_OSpace_ComplexPropertyNotComplex (object p0, object p1, object p2) + { + return SR.GetString ("Validator_OSpace_ComplexPropertyNotComplex", p0, p1, p2 ); + } + + public static string Validator_OSpace_Convention_AmbiguousClrType (object p0, object p1, object p2) + { + return SR.GetString ("Validator_OSpace_Convention_AmbiguousClrType", p0, p1, p2 ); + } + + public static string Validator_OSpace_Convention_AttributeAssemblyReferenced (object p0) + { + return SR.GetString ("Validator_OSpace_Convention_AttributeAssemblyReferenced", p0 ); + } + + public static string Validator_OSpace_Convention_BaseTypeIncompatible (object p0, object p1, object p2) + { + return SR.GetString ("Validator_OSpace_Convention_BaseTypeIncompatible", p0, p1, p2 ); + } + + public static string Validator_OSpace_Convention_BaseTypeNotLoaded (object p0, object p1) + { + return SR.GetString ("Validator_OSpace_Convention_BaseTypeNotLoaded", p0, p1 ); + } + + public static string Validator_OSpace_Convention_MissingOSpaceType (object p0) + { + return SR.GetString ("Validator_OSpace_Convention_MissingOSpaceType", p0 ); + } + + public static string Validator_OSpace_Convention_MissingRequiredProperty (object p0, object p1) + { + return SR.GetString ("Validator_OSpace_Convention_MissingRequiredProperty", p0, p1 ); + } + + public static string Validator_OSpace_Convention_MultipleTypesWithSameName (object p0) + { + return SR.GetString ("Validator_OSpace_Convention_MultipleTypesWithSameName", p0 ); + } + + public static string Validator_OSpace_Convention_NonPrimitiveTypeProperty (object p0, object p1, object p2) + { + return SR.GetString ("Validator_OSpace_Convention_NonPrimitiveTypeProperty", p0, p1, p2 ); + } + + public static string Validator_OSpace_Convention_RelationshipNotLoaded (object p0, object p1) + { + return SR.GetString ("Validator_OSpace_Convention_RelationshipNotLoaded", p0, p1 ); + } + + public static string Validator_OSpace_Convention_ScalarPropertyMissginGetterOrSetter (object p0, object p1, object p2) + { + return SR.GetString ("Validator_OSpace_Convention_ScalarPropertyMissginGetterOrSetter", p0, p1, p2); + } + + public static string Validator_OSpace_Convention_SSpaceOSpaceTypeMismatch (object p0, object p1) + { + return SR.GetString ("Validator_OSpace_Convention_SSpaceOSpaceTypeMismatch", p0, p1 ); + } + + public static string Validator_OSpace_Convention_Struct (object p0, object p1) + { + return SR.GetString ("Validator_OSpace_Convention_Struct", p0, p1 ); + } + + public static string Validator_OSpace_InvalidNavPropReturnType (object p0, object p1, object p2) + { + return SR.GetString ("Validator_OSpace_InvalidNavPropReturnType", p0, p1, p2 ); + } + + public static string Validator_OSpace_ScalarPropertyNotPrimitive (object p0, object p1, object p2) + { + return SR.GetString ("Validator_OSpace_ScalarPropertyNotPrimitive", p0, p1, p2 ); + } + + public static string Validator_UnsupportedEnumUnderlyingType (object p0) + { + return SR.GetString ("Validator_UnsupportedEnumUnderlyingType", p0 ); + } + + public static string ValueNotUnderstood (object p0, object p1) + { + return SR.GetString ("ValueNotUnderstood", p0, p1 ); + } + + public static string ViewGen_AssociationEndShouldBeMappedToKey (object p0, object p1) + { + return SR.GetString ("ViewGen_AssociationEndShouldBeMappedToKey", p0, p1 ); + } + + public static string ViewGen_AssociationSet_AsUserString (object p0, object p1, object p2) + { + return SR.GetString ("ViewGen_AssociationSet_AsUserString", p0, p1, p2 ); + } + + public static string ViewGen_AssociationSet_AsUserString_Negated (object p0, object p1, object p2) + { + return SR.GetString ("ViewGen_AssociationSet_AsUserString_Negated", p0, p1, p2 ); + } + + public static string ViewGen_AssociationSetKey_Missing (object p0, object p1, object p2) + { + return SR.GetString ("ViewGen_AssociationSetKey_Missing", p0, p1, p2 ); + } + + public static string ViewGen_Cannot_Disambiguate_MultiConstant (object p0, object p1) + { + return SR.GetString ("ViewGen_Cannot_Disambiguate_MultiConstant", p0, p1 ); + } + + public static string ViewGen_Cannot_Recover_Attributes (object p0, object p1, object p2) + { + return SR.GetString ("ViewGen_Cannot_Recover_Attributes", p0, p1, p2 ); + } + + public static string ViewGen_Cannot_Recover_Types (object p0, object p1) + { + return SR.GetString ("ViewGen_Cannot_Recover_Types", p0, p1 ); + } + + public static string Viewgen_CannotGenerateQueryViewUnderNoValidation (object p0) + { + return SR.GetString ("Viewgen_CannotGenerateQueryViewUnderNoValidation", p0 ); + } + + public static string ViewGen_Concurrency_Derived_Class (object p0, object p1, object p2) + { + return SR.GetString ("ViewGen_Concurrency_Derived_Class", p0, p1, p2 ); + } + + public static string ViewGen_Concurrency_Invalid_Condition (object p0, object p1) + { + return SR.GetString ("ViewGen_Concurrency_Invalid_Condition", p0, p1 ); + } + + public static string Viewgen_ConfigurationErrorMsg (object p0) + { + return SR.GetString ("Viewgen_ConfigurationErrorMsg", p0 ); + } + + public static string ViewGen_CQ_DomainConstraint (object p0) + { + return SR.GetString ("ViewGen_CQ_DomainConstraint", p0 ); + } + + public static string ViewGen_CQ_PartitionConstraint (object p0) + { + return SR.GetString ("ViewGen_CQ_PartitionConstraint", p0 ); + } + + public static string ViewGen_Duplicate_CProperties (object p0) + { + return SR.GetString ("ViewGen_Duplicate_CProperties", p0 ); + } + + public static string ViewGen_Duplicate_CProperties_IsMapped (object p0, object p1) + { + return SR.GetString ("ViewGen_Duplicate_CProperties_IsMapped", p0, p1 ); + } + + public static string ViewGen_EntitySet_AsUserString (object p0, object p1) + { + return SR.GetString ("ViewGen_EntitySet_AsUserString", p0, p1 ); + } + + public static string ViewGen_EntitySet_AsUserString_Negated (object p0, object p1) + { + return SR.GetString ("ViewGen_EntitySet_AsUserString_Negated", p0, p1 ); + } + + public static string ViewGen_EntitySetKey_Missing (object p0, object p1) + { + return SR.GetString ("ViewGen_EntitySetKey_Missing", p0, p1 ); + } + + public static string ViewGen_ErrorLog (object p0) + { + return SR.GetString ("ViewGen_ErrorLog", p0 ); + } + + public static string ViewGen_ErrorLog2 (object p0) + { + return SR.GetString ("ViewGen_ErrorLog2", p0 ); + } + + public static string Viewgen_ErrorPattern_ConditionMemberIsMapped (object p0) + { + return SR.GetString ("Viewgen_ErrorPattern_ConditionMemberIsMapped", p0 ); + } + + public static string Viewgen_ErrorPattern_DuplicateConditionValue (object p0) + { + return SR.GetString ("Viewgen_ErrorPattern_DuplicateConditionValue", p0 ); + } + + public static string Viewgen_ErrorPattern_NotNullConditionMappedToNullableMember (object p0, object p1) + { + return SR.GetString ("Viewgen_ErrorPattern_NotNullConditionMappedToNullableMember", p0, p1 ); + } + + public static string Viewgen_ErrorPattern_Partition_MultipleTypesMappedToSameTable_WithoutCondition (object p0, object p1) + { + return SR.GetString ("Viewgen_ErrorPattern_Partition_MultipleTypesMappedToSameTable_WithoutCondition", p0, p1); + } + + public static string Viewgen_ErrorPattern_TableMappedToMultipleES (object p0, object p1, object p2) + { + return SR.GetString ("Viewgen_ErrorPattern_TableMappedToMultipleES", p0, p1, p2 ); + } + + public static string ViewGen_Foreign_Key (object p0, object p1, object p2, object p3, object p4) + { + return SR.GetString ("ViewGen_Foreign_Key", p0, p1, p2, p3, p4 ); + } + + public static string ViewGen_Foreign_Key_LowerBound_MustBeOne (object p0, object p1, object p2) + { + return SR.GetString ("ViewGen_Foreign_Key_LowerBound_MustBeOne", p0, p1, p2 ); + } + + public static string ViewGen_Foreign_Key_Missing_Relationship_Mapping (object p0) + { + return SR.GetString ("ViewGen_Foreign_Key_Missing_Relationship_Mapping", p0 ); + } + + public static string ViewGen_Foreign_Key_Missing_Table_Mapping (object p0, object p1) + { + return SR.GetString ("ViewGen_Foreign_Key_Missing_Table_Mapping", p0, p1 ); + } + + public static string ViewGen_Foreign_Key_Not_Guaranteed_InCSpace (object p0) + { + return SR.GetString ("ViewGen_Foreign_Key_Not_Guaranteed_InCSpace", p0 ); + } + + public static string ViewGen_Foreign_Key_ParentTable_NotMappedToEnd (object p0, object p1, object p2, object p3, object p4, object p5) + { + return SR.GetString ("ViewGen_Foreign_Key_ParentTable_NotMappedToEnd", p0, p1, p2, p3, p4, p5 ); + } + + public static string ViewGen_Foreign_Key_UpperBound_MustBeOne (object p0, object p1, object p2) + { + return SR.GetString ("ViewGen_Foreign_Key_UpperBound_MustBeOne", p0, p1, p2 ); + } + + public static string ViewGen_HashOnMappingClosure_Not_Matching (object p0) + { + return SR.GetString ("ViewGen_HashOnMappingClosure_Not_Matching", p0 ); + } + + public static string ViewGen_InvalidCondition (object p0) + { + return SR.GetString ("ViewGen_InvalidCondition", p0 ); + } + + public static string ViewGen_KeyConstraint_Update_Violation_AssociationSet (object p0, object p1, object p2) + { + return SR.GetString ("ViewGen_KeyConstraint_Update_Violation_AssociationSet", p0, p1, p2 ); + } + + public static string ViewGen_KeyConstraint_Update_Violation_EntitySet (object p0, object p1, object p2, object p3) + { + return SR.GetString ("ViewGen_KeyConstraint_Update_Violation_EntitySet", p0, p1, p2, p3 ); + } + + public static string ViewGen_KeyConstraint_Violation (object p0, object p1, object p2, object p3, object p4, object p5) + { + return SR.GetString ("ViewGen_KeyConstraint_Violation", p0, p1, p2, p3, p4, p5 ); + } + + public static string ViewGen_Missing_Set_Mapping (object p0) + { + return SR.GetString ("ViewGen_Missing_Set_Mapping", p0 ); + } + + public static string ViewGen_Missing_Sets_Mapping (object p0) + { + return SR.GetString ("ViewGen_Missing_Sets_Mapping", p0 ); + } + + public static string ViewGen_Missing_Type_Mapping (object p0) + { + return SR.GetString ("ViewGen_Missing_Type_Mapping", p0 ); + } + + public static string Viewgen_MultipleFragmentsBetweenCandSExtentWithDistinct (object p0, object p1) + { + return SR.GetString ("Viewgen_MultipleFragmentsBetweenCandSExtentWithDistinct", p0, p1 ); + } + + public static string ViewGen_NegatedCellConstant (object p0) + { + return SR.GetString ("ViewGen_NegatedCellConstant", p0 ); + } + + public static string ViewGen_No_Default_Value (object p0, object p1) + { + return SR.GetString ("ViewGen_No_Default_Value", p0, p1 ); + } + + public static string ViewGen_No_Default_Value_For_Configuration (object p0) + { + return SR.GetString ("ViewGen_No_Default_Value_For_Configuration", p0 ); + } + + public static string ViewGen_NonKeyProjectedWithOverlappingPartitions (object p0) + { + return SR.GetString ("ViewGen_NonKeyProjectedWithOverlappingPartitions", p0 ); + } + + public static string ViewGen_NotNull_No_Projected_Slot (object p0) + { + return SR.GetString ("ViewGen_NotNull_No_Projected_Slot", p0 ); + } + + public static string Viewgen_NullableMappingForNonNullableColumn (object p0, object p1) + { + return SR.GetString ("Viewgen_NullableMappingForNonNullableColumn", p0, p1 ); + } + + public static string ViewGen_OneOfConst_IsEqualTo (object p0, object p1) + { + return SR.GetString ("ViewGen_OneOfConst_IsEqualTo", p0, p1 ); + } + + public static string ViewGen_OneOfConst_IsNonNullable (object p0) + { + return SR.GetString ("ViewGen_OneOfConst_IsNonNullable", p0 ); + } + + public static string ViewGen_OneOfConst_IsNotEqualTo (object p0, object p1) + { + return SR.GetString ("ViewGen_OneOfConst_IsNotEqualTo", p0, p1 ); + } + + public static string ViewGen_OneOfConst_IsNotOneOf (object p0, object p1) + { + return SR.GetString ("ViewGen_OneOfConst_IsNotOneOf", p0, p1 ); + } + + public static string ViewGen_OneOfConst_IsOneOf (object p0, object p1) + { + return SR.GetString ("ViewGen_OneOfConst_IsOneOf", p0, p1 ); + } + + public static string ViewGen_OneOfConst_IsOneOfTypes (object p0) + { + return SR.GetString ("ViewGen_OneOfConst_IsOneOfTypes", p0 ); + } + + public static string ViewGen_OneOfConst_MustBeEqualTo (object p0, object p1) + { + return SR.GetString ("ViewGen_OneOfConst_MustBeEqualTo", p0, p1 ); + } + + public static string ViewGen_OneOfConst_MustBeNonNullable (object p0) + { + return SR.GetString ("ViewGen_OneOfConst_MustBeNonNullable", p0 ); + } + + public static string ViewGen_OneOfConst_MustBeNull (object p0) + { + return SR.GetString ("ViewGen_OneOfConst_MustBeNull", p0 ); + } + + public static string ViewGen_OneOfConst_MustBeOneOf (object p0, object p1) + { + return SR.GetString ("ViewGen_OneOfConst_MustBeOneOf", p0, p1 ); + } + + public static string ViewGen_OneOfConst_MustNotBeEqualTo (object p0, object p1) + { + return SR.GetString ("ViewGen_OneOfConst_MustNotBeEqualTo", p0, p1 ); + } + + public static string ViewGen_OneOfConst_MustNotBeOneOf (object p0, object p1) + { + return SR.GetString ("ViewGen_OneOfConst_MustNotBeOneOf", p0, p1 ); + } + + public static string Viewgen_QV_RewritingNotFound (object p0) + { + return SR.GetString ("Viewgen_QV_RewritingNotFound", p0 ); + } + + public static string Viewgen_RightSideNotDisjoint (object p0) + { + return SR.GetString ("Viewgen_RightSideNotDisjoint", p0 ); + } + + public static string ViewGen_TableKey_Missing (object p0, object p1) + { + return SR.GetString ("ViewGen_TableKey_Missing", p0, p1 ); + } + + // Properties + public static string ADP_ClosedDataReaderError { + get { + return SR.GetString ("ADP_ClosedDataReaderError"); + } + } + + public static string ADP_GetSchemaTableIsNotSupported { + get { + return SR.GetString ("ADP_GetSchemaTableIsNotSupported"); + } + } + + public static string ADP_ImplicitlyClosedDataReaderError { + get { + return SR.GetString ("ADP_ImplicitlyClosedDataReaderError"); + } + } + + public static string ADP_InvalidDataDirectory { + get { + return SR.GetString ("ADP_InvalidDataDirectory"); + } + } + + public static string ADP_InvalidDataReaderFieldCountForScalarType { + get { + return SR.GetString ("ADP_InvalidDataReaderFieldCountForScalarType"); + } + } + + public static string ADP_InvalidDataReaderUnableToDetermineType { + get { + return SR.GetString ("ADP_InvalidDataReaderUnableToDetermineType"); + } + } + + public static string ADP_InvalidMultipartNameDelimiterUsage { + get { + return SR.GetString ("ADP_InvalidMultipartNameDelimiterUsage"); + } + } + + public static string ADP_KeysRequiredForNesting { + get { + return SR.GetString ("ADP_KeysRequiredForNesting"); + } + } + + public static string ADP_MustUseSequentialAccess { + get { + return SR.GetString ("ADP_MustUseSequentialAccess"); + } + } + + public static string ADP_NoData { + get { + return SR.GetString ("ADP_NoData"); + } + } + + public static string ADP_ProviderDoesNotSupportCommandTrees { + get { + return SR.GetString ("ADP_ProviderDoesNotSupportCommandTrees"); + } + } + + public static string AllElementsMustBeInSchema { + get { + return SR.GetString ("AllElementsMustBeInSchema"); + } + } + + public static string AmbiguousFunctionArguments { + get { + return SR.GetString ("AmbiguousFunctionArguments"); + } + } + + public static string ArgumentMustBeCSpaceType { + get { + return SR.GetString ("ArgumentMustBeCSpaceType"); + } + } + + public static string ArgumentMustBeOSpaceType { + get { + return SR.GetString ("ArgumentMustBeOSpaceType"); + } + } + + public static string ArrayTooSmall { + get { + return SR.GetString ("ArrayTooSmall"); + } + } + + public static string AtleastOneSSDLNeeded { + get { + return SR.GetString ("AtleastOneSSDLNeeded"); + } + } + + public static string BadNavigationPropertyRolesCannotBeTheSame { + get { + return SR.GetString ("BadNavigationPropertyRolesCannotBeTheSame"); + } + } + + public static string BetweenLimitsCannotBeUntypedNulls { + get { + return SR.GetString ("BetweenLimitsCannotBeUntypedNulls"); + } + } + + public static string CalculatedEnumValueOutOfRange { + get { + return SR.GetString ("CalculatedEnumValueOutOfRange"); + } + } + + public static string CannotCreateEmptyMultiset { + get { + return SR.GetString ("CannotCreateEmptyMultiset"); + } + } + + public static string CannotCreateMultisetofNulls { + get { + return SR.GetString ("CannotCreateMultisetofNulls"); + } + } + + public static string CannotLoadDifferentVersionOfSchemaInTheSameItemCollection { + get { + return SR.GetString ("CannotLoadDifferentVersionOfSchemaInTheSameItemCollection"); + } + } + + public static string CodeGen_PropertyDeclaringTypeIsValueType { + get { + return SR.GetString ("CodeGen_PropertyDeclaringTypeIsValueType"); + } + } + + public static string CodeGen_PropertyIsIndexed { + get { + return SR.GetString ("CodeGen_PropertyIsIndexed"); + } + } + + public static string CodeGen_PropertyIsStatic { + get { + return SR.GetString ("CodeGen_PropertyIsStatic"); + } + } + + public static string CodeGen_PropertyNoGetter { + get { + return SR.GetString ("CodeGen_PropertyNoGetter"); + } + } + + public static string CodeGen_PropertyNoSetter { + get { + return SR.GetString ("CodeGen_PropertyNoSetter"); + } + } + + public static string CodeGen_PropertyStrongNameIdentity { + get { + return SR.GetString ("CodeGen_PropertyStrongNameIdentity"); + } + } + + public static string CodeGen_PropertyUnsupportedForm { + get { + return SR.GetString ("CodeGen_PropertyUnsupportedForm"); + } + } + + public static string CodeGen_PropertyUnsupportedType { + get { + return SR.GetString ("CodeGen_PropertyUnsupportedType"); + } + } + + public static string Collections_InvalidEntityStateSource { + get { + return SR.GetString ("Collections_InvalidEntityStateSource"); + } + } + + public static string Collections_UnableToMergeCollections { + get { + return SR.GetString ("Collections_UnableToMergeCollections"); + } + } + + public static string CommandTextFunctionsCannotDeclareStoreFunctionName { + get { + return SR.GetString ("CommandTextFunctionsCannotDeclareStoreFunctionName"); + } + } + + public static string CommandTextFunctionsNotComposable { + get { + return SR.GetString ("CommandTextFunctionsNotComposable"); + } + } + + public static string ComplexObject_ComplexObjectAlreadyAttachedToParent { + get { + return SR.GetString ("ComplexObject_ComplexObjectAlreadyAttachedToParent"); + } + } + + public static string ComposableFunctionOrFunctionImportMustDeclareReturnType { + get { + return SR.GetString ("ComposableFunctionOrFunctionImportMustDeclareReturnType"); + } + } + + public static string ConcatBuiltinNotSupported { + get { + return SR.GetString ("ConcatBuiltinNotSupported"); + } + } + + public static string Cqt_Aggregate_InvalidFunction { + get { + return SR.GetString ("Cqt_Aggregate_InvalidFunction"); + } + } + + public static string Cqt_And_BooleanArgumentsRequired { + get { + return SR.GetString ("Cqt_And_BooleanArgumentsRequired"); + } + } + + public static string Cqt_Apply_DuplicateVariableNames { + get { + return SR.GetString ("Cqt_Apply_DuplicateVariableNames"); + } + } + + public static string Cqt_Arithmetic_NumericCommonType { + get { + return SR.GetString ("Cqt_Arithmetic_NumericCommonType"); + } + } + + public static string Cqt_Binding_CollectionRequired { + get { + return SR.GetString ("Cqt_Binding_CollectionRequired"); + } + } + + public static string Cqt_Binding_VariableNameNotValid { + get { + return SR.GetString ("Cqt_Binding_VariableNameNotValid"); + } + } + + public static string Cqt_Case_InvalidResultType { + get { + return SR.GetString ("Cqt_Case_InvalidResultType"); + } + } + + public static string Cqt_Case_WhensMustEqualThens { + get { + return SR.GetString ("Cqt_Case_WhensMustEqualThens"); + } + } + + public static string Cqt_CommandTree_InvalidDataSpace { + get { + return SR.GetString ("Cqt_CommandTree_InvalidDataSpace"); + } + } + + public static string Cqt_Comparison_ComparableRequired { + get { + return SR.GetString ("Cqt_Comparison_ComparableRequired"); + } + } + + public static string Cqt_Constant_InvalidType { + get { + return SR.GetString ("Cqt_Constant_InvalidType"); + } + } + + public static string Cqt_CrossJoin_AtLeastTwoInputs { + get { + return SR.GetString ("Cqt_CrossJoin_AtLeastTwoInputs"); + } + } + + public static string Cqt_DeRef_RefRequired { + get { + return SR.GetString ("Cqt_DeRef_RefRequired"); + } + } + + public static string Cqt_Distinct_InvalidCollection { + get { + return SR.GetString ("Cqt_Distinct_InvalidCollection"); + } + } + + public static string Cqt_Element_InvalidArgumentForUnwrapSingleProperty { + get { + return SR.GetString ("Cqt_Element_InvalidArgumentForUnwrapSingleProperty"); + } + } + + public static string Cqt_Exceptions_InvalidCommandTree { + get { + return SR.GetString ("Cqt_Exceptions_InvalidCommandTree"); + } + } + + public static string Cqt_ExpressionList_IncorrectElementCount { + get { + return SR.GetString ("Cqt_ExpressionList_IncorrectElementCount"); + } + } + + public static string Cqt_Factory_IncompatibleRelationEnds { + get { + return SR.GetString ("Cqt_Factory_IncompatibleRelationEnds"); + } + } + + public static string Cqt_Factory_NewCollectionInvalidCommonType { + get { + return SR.GetString ("Cqt_Factory_NewCollectionInvalidCommonType"); + } + } + + public static string Cqt_Factory_NoSuchRelationEnd { + get { + return SR.GetString ("Cqt_Factory_NoSuchRelationEnd"); + } + } + + public static string Cqt_Function_CommandTextInExpression { + get { + return SR.GetString ("Cqt_Function_CommandTextInExpression"); + } + } + + public static string Cqt_Function_NonComposableInExpression { + get { + return SR.GetString ("Cqt_Function_NonComposableInExpression"); + } + } + + public static string Cqt_Function_VoidResultInvalid { + get { + return SR.GetString ("Cqt_Function_VoidResultInvalid"); + } + } + + public static string Cqt_General_MetadataNotReadOnly { + get { + return SR.GetString ("Cqt_General_MetadataNotReadOnly"); + } + } + + public static string Cqt_General_NoProviderBooleanType { + get { + return SR.GetString ("Cqt_General_NoProviderBooleanType"); + } + } + + public static string Cqt_General_NoProviderIntegerType { + get { + return SR.GetString ("Cqt_General_NoProviderIntegerType"); + } + } + + public static string Cqt_General_NoProviderStringType { + get { + return SR.GetString ("Cqt_General_NoProviderStringType"); + } + } + + public static string Cqt_GetEntityRef_EntityRequired { + get { + return SR.GetString ("Cqt_GetEntityRef_EntityRequired"); + } + } + + public static string Cqt_GetRefKey_RefRequired { + get { + return SR.GetString ("Cqt_GetRefKey_RefRequired"); + } + } + + public static string Cqt_GroupBinding_CollectionRequired { + get { + return SR.GetString ("Cqt_GroupBinding_CollectionRequired"); + } + } + + public static string Cqt_GroupBinding_GroupVariableNameNotValid { + get { + return SR.GetString ("Cqt_GroupBinding_GroupVariableNameNotValid"); + } + } + + public static string Cqt_GroupBy_AtLeastOneKeyOrAggregate { + get { + return SR.GetString ("Cqt_GroupBy_AtLeastOneKeyOrAggregate"); + } + } + + public static string Cqt_GroupBy_MoreThanOneGroupAggregate { + get { + return SR.GetString ("Cqt_GroupBy_MoreThanOneGroupAggregate"); + } + } + + public static string Cqt_IsNull_CollectionNotAllowed { + get { + return SR.GetString ("Cqt_IsNull_CollectionNotAllowed"); + } + } + + public static string Cqt_IsNull_InvalidType { + get { + return SR.GetString ("Cqt_IsNull_InvalidType"); + } + } + + public static string Cqt_Join_DuplicateVariableNames { + get { + return SR.GetString ("Cqt_Join_DuplicateVariableNames"); + } + } + + public static string Cqt_Limit_ConstantOrParameterRefRequired { + get { + return SR.GetString ("Cqt_Limit_ConstantOrParameterRefRequired"); + } + } + + public static string Cqt_Limit_IntegerRequired { + get { + return SR.GetString ("Cqt_Limit_IntegerRequired"); + } + } + + public static string Cqt_Limit_NonNegativeLimitRequired { + get { + return SR.GetString ("Cqt_Limit_NonNegativeLimitRequired"); + } + } + + public static string Cqt_Metadata_EdmMemberIncorrectSpace { + get { + return SR.GetString ("Cqt_Metadata_EdmMemberIncorrectSpace"); + } + } + + public static string Cqt_Metadata_EntitySetEntityContainerNull { + get { + return SR.GetString ("Cqt_Metadata_EntitySetEntityContainerNull"); + } + } + + public static string Cqt_Metadata_EntitySetIncorrectSpace { + get { + return SR.GetString ("Cqt_Metadata_EntitySetIncorrectSpace"); + } + } + + public static string Cqt_Metadata_EntityTypeEmptyKeyMembersInvalid { + get { + return SR.GetString ("Cqt_Metadata_EntityTypeEmptyKeyMembersInvalid"); + } + } + + public static string Cqt_Metadata_EntityTypeNullKeyMembersInvalid { + get { + return SR.GetString ("Cqt_Metadata_EntityTypeNullKeyMembersInvalid"); + } + } + + public static string Cqt_Metadata_FunctionIncorrectSpace { + get { + return SR.GetString ("Cqt_Metadata_FunctionIncorrectSpace"); + } + } + + public static string Cqt_Metadata_FunctionParameterIncorrectSpace { + get { + return SR.GetString ("Cqt_Metadata_FunctionParameterIncorrectSpace"); + } + } + + public static string Cqt_Metadata_FunctionReturnParameterNull { + get { + return SR.GetString ("Cqt_Metadata_FunctionReturnParameterNull"); + } + } + + public static string Cqt_Metadata_TypeUsageIncorrectSpace { + get { + return SR.GetString ("Cqt_Metadata_TypeUsageIncorrectSpace"); + } + } + + public static string Cqt_NewInstance_CollectionTypeRequired { + get { + return SR.GetString ("Cqt_NewInstance_CollectionTypeRequired"); + } + } + + public static string Cqt_NewInstance_IncompatibleRelatedEntity_SourceTypeNotValid { + get { + return SR.GetString ("Cqt_NewInstance_IncompatibleRelatedEntity_SourceTypeNotValid"); + } + } + + public static string Cqt_NewInstance_StructuralTypeRequired { + get { + return SR.GetString ("Cqt_NewInstance_StructuralTypeRequired"); + } + } + + public static string Cqt_Not_BooleanArgumentRequired { + get { + return SR.GetString ("Cqt_Not_BooleanArgumentRequired"); + } + } + + public static string Cqt_Or_BooleanArgumentsRequired { + get { + return SR.GetString ("Cqt_Or_BooleanArgumentsRequired"); + } + } + + public static string Cqt_Property_InstanceRequiredForInstance { + get { + return SR.GetString ("Cqt_Property_InstanceRequiredForInstance"); + } + } + + public static string Cqt_Ref_PolymorphicArgRequired { + get { + return SR.GetString ("Cqt_Ref_PolymorphicArgRequired"); + } + } + + public static string Cqt_RelatedEntityRef_TargetEndFromDifferentRelationship { + get { + return SR.GetString ("Cqt_RelatedEntityRef_TargetEndFromDifferentRelationship"); + } + } + + public static string Cqt_RelatedEntityRef_TargetEndMustBeAtMostOne { + get { + return SR.GetString ("Cqt_RelatedEntityRef_TargetEndMustBeAtMostOne"); + } + } + + public static string Cqt_RelatedEntityRef_TargetEndSameAsSourceEnd { + get { + return SR.GetString ("Cqt_RelatedEntityRef_TargetEndSameAsSourceEnd"); + } + } + + public static string Cqt_RelatedEntityRef_TargetEntityNotCompatible { + get { + return SR.GetString ("Cqt_RelatedEntityRef_TargetEntityNotCompatible"); + } + } + + public static string Cqt_RelatedEntityRef_TargetEntityNotRef { + get { + return SR.GetString ("Cqt_RelatedEntityRef_TargetEntityNotRef"); + } + } + + public static string Cqt_RelNav_NoCompositions { + get { + return SR.GetString ("Cqt_RelNav_NoCompositions"); + } + } + + public static string Cqt_Skip_ConstantOrParameterRefRequired { + get { + return SR.GetString ("Cqt_Skip_ConstantOrParameterRefRequired"); + } + } + + public static string Cqt_Skip_IntegerRequired { + get { + return SR.GetString ("Cqt_Skip_IntegerRequired"); + } + } + + public static string Cqt_Skip_NonNegativeCountRequired { + get { + return SR.GetString ("Cqt_Skip_NonNegativeCountRequired"); + } + } + + public static string Cqt_Sort_EmptyCollationInvalid { + get { + return SR.GetString ("Cqt_Sort_EmptyCollationInvalid"); + } + } + + public static string Cqt_Sort_NonStringCollationInvalid { + get { + return SR.GetString ("Cqt_Sort_NonStringCollationInvalid"); + } + } + + public static string Cqt_Sort_OrderComparable { + get { + return SR.GetString ("Cqt_Sort_OrderComparable"); + } + } + + public static string Cqt_Util_CheckListEmptyInvalid { + get { + return SR.GetString ("Cqt_Util_CheckListEmptyInvalid"); + } + } + + public static string CtxAlias { + get { + return SR.GetString ("CtxAlias"); + } + } + + public static string CtxAliasedNamespaceImport { + get { + return SR.GetString ("CtxAliasedNamespaceImport"); + } + } + + public static string CtxAnd { + get { + return SR.GetString ("CtxAnd"); + } + } + + public static string CtxAnyElement { + get { + return SR.GetString ("CtxAnyElement"); + } + } + + public static string CtxApplyClause { + get { + return SR.GetString ("CtxApplyClause"); + } + } + + public static string CtxBetween { + get { + return SR.GetString ("CtxBetween"); + } + } + + public static string CtxCase { + get { + return SR.GetString ("CtxCase"); + } + } + + public static string CtxCaseElse { + get { + return SR.GetString ("CtxCaseElse"); + } + } + + public static string CtxCaseWhenThen { + get { + return SR.GetString ("CtxCaseWhenThen"); + } + } + + public static string CtxCast { + get { + return SR.GetString ("CtxCast"); + } + } + + public static string CtxCollatedOrderByClauseItem { + get { + return SR.GetString ("CtxCollatedOrderByClauseItem"); + } + } + + public static string CtxCollectionTypeDefinition { + get { + return SR.GetString ("CtxCollectionTypeDefinition"); + } + } + + public static string CtxCommandExpression { + get { + return SR.GetString ("CtxCommandExpression"); + } + } + + public static string CtxCreateRef { + get { + return SR.GetString ("CtxCreateRef"); + } + } + + public static string CtxDeref { + get { + return SR.GetString ("CtxDeref"); + } + } + + public static string CtxDivide { + get { + return SR.GetString ("CtxDivide"); + } + } + + public static string CtxElement { + get { + return SR.GetString ("CtxElement"); + } + } + + public static string CtxEquals { + get { + return SR.GetString ("CtxEquals"); + } + } + + public static string CtxEscapedIdentifier { + get { + return SR.GetString ("CtxEscapedIdentifier"); + } + } + + public static string CtxExcept { + get { + return SR.GetString ("CtxExcept"); + } + } + + public static string CtxExists { + get { + return SR.GetString ("CtxExists"); + } + } + + public static string CtxExpressionList { + get { + return SR.GetString ("CtxExpressionList"); + } + } + + public static string CtxFlatten { + get { + return SR.GetString ("CtxFlatten"); + } + } + + public static string CtxFromApplyClause { + get { + return SR.GetString ("CtxFromApplyClause"); + } + } + + public static string CtxFromClause { + get { + return SR.GetString ("CtxFromClause"); + } + } + + public static string CtxFromClauseItem { + get { + return SR.GetString ("CtxFromClauseItem"); + } + } + + public static string CtxFromClauseList { + get { + return SR.GetString ("CtxFromClauseList"); + } + } + + public static string CtxFromJoinClause { + get { + return SR.GetString ("CtxFromJoinClause"); + } + } + + public static string CtxFunctionDefinition { + get { + return SR.GetString ("CtxFunctionDefinition"); + } + } + + public static string CtxGreaterThan { + get { + return SR.GetString ("CtxGreaterThan"); + } + } + + public static string CtxGreaterThanEqual { + get { + return SR.GetString ("CtxGreaterThanEqual"); + } + } + + public static string CtxGroupByClause { + get { + return SR.GetString ("CtxGroupByClause"); + } + } + + public static string CtxGroupPartition { + get { + return SR.GetString ("CtxGroupPartition"); + } + } + + public static string CtxHavingClause { + get { + return SR.GetString ("CtxHavingClause"); + } + } + + public static string CtxIdentifier { + get { + return SR.GetString ("CtxIdentifier"); + } + } + + public static string CtxIn { + get { + return SR.GetString ("CtxIn"); + } + } + + public static string CtxIntersect { + get { + return SR.GetString ("CtxIntersect"); + } + } + + public static string CtxIsNotNull { + get { + return SR.GetString ("CtxIsNotNull"); + } + } + + public static string CtxIsNotOf { + get { + return SR.GetString ("CtxIsNotOf"); + } + } + + public static string CtxIsNull { + get { + return SR.GetString ("CtxIsNull"); + } + } + + public static string CtxIsOf { + get { + return SR.GetString ("CtxIsOf"); + } + } + + public static string CtxJoinClause { + get { + return SR.GetString ("CtxJoinClause"); + } + } + + public static string CtxJoinOnClause { + get { + return SR.GetString ("CtxJoinOnClause"); + } + } + + public static string CtxKey { + get { + return SR.GetString ("CtxKey"); + } + } + + public static string CtxLessThan { + get { + return SR.GetString ("CtxLessThan"); + } + } + + public static string CtxLessThanEqual { + get { + return SR.GetString ("CtxLessThanEqual"); + } + } + + public static string CtxLike { + get { + return SR.GetString ("CtxLike"); + } + } + + public static string CtxLimitSubClause { + get { + return SR.GetString ("CtxLimitSubClause"); + } + } + + public static string CtxLiteral { + get { + return SR.GetString ("CtxLiteral"); + } + } + + public static string CtxMemberAccess { + get { + return SR.GetString ("CtxMemberAccess"); + } + } + + public static string CtxMethod { + get { + return SR.GetString ("CtxMethod"); + } + } + + public static string CtxMinus { + get { + return SR.GetString ("CtxMinus"); + } + } + + public static string CtxModulus { + get { + return SR.GetString ("CtxModulus"); + } + } + + public static string CtxMultiply { + get { + return SR.GetString ("CtxMultiply"); + } + } + + public static string CtxMultisetCtor { + get { + return SR.GetString ("CtxMultisetCtor"); + } + } + + public static string CtxNamespaceImport { + get { + return SR.GetString ("CtxNamespaceImport"); + } + } + + public static string CtxNamespaceImportList { + get { + return SR.GetString ("CtxNamespaceImportList"); + } + } + + public static string CtxNavigate { + get { + return SR.GetString ("CtxNavigate"); + } + } + + public static string CtxNot { + get { + return SR.GetString ("CtxNot"); + } + } + + public static string CtxNotBetween { + get { + return SR.GetString ("CtxNotBetween"); + } + } + + public static string CtxNotEqual { + get { + return SR.GetString ("CtxNotEqual"); + } + } + + public static string CtxNotIn { + get { + return SR.GetString ("CtxNotIn"); + } + } + + public static string CtxNotLike { + get { + return SR.GetString ("CtxNotLike"); + } + } + + public static string CtxNullLiteral { + get { + return SR.GetString ("CtxNullLiteral"); + } + } + + public static string CtxOfType { + get { + return SR.GetString ("CtxOfType"); + } + } + + public static string CtxOfTypeOnly { + get { + return SR.GetString ("CtxOfTypeOnly"); + } + } + + public static string CtxOr { + get { + return SR.GetString ("CtxOr"); + } + } + + public static string CtxOrderByClause { + get { + return SR.GetString ("CtxOrderByClause"); + } + } + + public static string CtxOrderByClauseItem { + get { + return SR.GetString ("CtxOrderByClauseItem"); + } + } + + public static string CtxOverlaps { + get { + return SR.GetString ("CtxOverlaps"); + } + } + + public static string CtxParen { + get { + return SR.GetString ("CtxParen"); + } + } + + public static string CtxPlus { + get { + return SR.GetString ("CtxPlus"); + } + } + + public static string CtxQueryExpression { + get { + return SR.GetString ("CtxQueryExpression"); + } + } + + public static string CtxQueryStatement { + get { + return SR.GetString ("CtxQueryStatement"); + } + } + + public static string CtxRef { + get { + return SR.GetString ("CtxRef"); + } + } + + public static string CtxRefTypeDefinition { + get { + return SR.GetString ("CtxRefTypeDefinition"); + } + } + + public static string CtxRelationship { + get { + return SR.GetString ("CtxRelationship"); + } + } + + public static string CtxRelationshipList { + get { + return SR.GetString ("CtxRelationshipList"); + } + } + + public static string CtxRowCtor { + get { + return SR.GetString ("CtxRowCtor"); + } + } + + public static string CtxRowTypeDefinition { + get { + return SR.GetString ("CtxRowTypeDefinition"); + } + } + + public static string CtxSelectRowClause { + get { + return SR.GetString ("CtxSelectRowClause"); + } + } + + public static string CtxSelectValueClause { + get { + return SR.GetString ("CtxSelectValueClause"); + } + } + + public static string CtxSet { + get { + return SR.GetString ("CtxSet"); + } + } + + public static string CtxSimpleIdentifier { + get { + return SR.GetString ("CtxSimpleIdentifier"); + } + } + + public static string CtxSkipSubClause { + get { + return SR.GetString ("CtxSkipSubClause"); + } + } + + public static string CtxTopSubClause { + get { + return SR.GetString ("CtxTopSubClause"); + } + } + + public static string CtxTreat { + get { + return SR.GetString ("CtxTreat"); + } + } + + public static string CtxTypeName { + get { + return SR.GetString ("CtxTypeName"); + } + } + + public static string CtxTypeNameWithTypeSpec { + get { + return SR.GetString ("CtxTypeNameWithTypeSpec"); + } + } + + public static string CtxUnaryMinus { + get { + return SR.GetString ("CtxUnaryMinus"); + } + } + + public static string CtxUnaryPlus { + get { + return SR.GetString ("CtxUnaryPlus"); + } + } + + public static string CtxUnion { + get { + return SR.GetString ("CtxUnion"); + } + } + + public static string CtxUnionAll { + get { + return SR.GetString ("CtxUnionAll"); + } + } + + public static string CtxWhereClause { + get { + return SR.GetString ("CtxWhereClause"); + } + } + + public static string DefaultNotAllowed { + get { + return SR.GetString ("DefaultNotAllowed"); + } + } + + public static string DuplicateEnumMember { + get { + return SR.GetString ("DuplicateEnumMember"); + } + } + + public static string EdmMembersDefiningTypeDoNotAgreeWithMetadataType { + get { + return SR.GetString ("EdmMembersDefiningTypeDoNotAgreeWithMetadataType"); + } + } + + public static string ElementOperatorIsNotSupported { + get { + return SR.GetString ("ElementOperatorIsNotSupported"); + } + } + + public static string ELinq_AnonymousType { + get { + return SR.GetString ("ELinq_AnonymousType"); + } + } + + public static string ELinq_ClosureType { + get { + return SR.GetString ("ELinq_ClosureType"); + } + } + + public static string ELinq_CreateOrderedEnumerableNotSupported { + get { + return SR.GetString ("ELinq_CreateOrderedEnumerableNotSupported"); + } + } + + public static string ELinq_CycleDetected { + get { + return SR.GetString ("ELinq_CycleDetected"); + } + } + + public static string ELinq_EdmFunctionDirectCall { + get { + return SR.GetString ("ELinq_EdmFunctionDirectCall"); + } + } + + public static string ELinq_ExpressionMustBeIQueryable { + get { + return SR.GetString ("ELinq_ExpressionMustBeIQueryable"); + } + } + + public static string ELinq_MethodNotDirectlyCallable { + get { + return SR.GetString ("ELinq_MethodNotDirectlyCallable"); + } + } + + public static string ELinq_PropertyIndexNotSupported { + get { + return SR.GetString ("ELinq_PropertyIndexNotSupported"); + } + } + + public static string ELinq_SkipWithoutOrder { + get { + return SR.GetString ("ELinq_SkipWithoutOrder"); + } + } + + public static string ELinq_ThenByDoesNotFollowOrderBy { + get { + return SR.GetString ("ELinq_ThenByDoesNotFollowOrderBy"); + } + } + + public static string ELinq_UnsupportedBinding { + get { + return SR.GetString ("ELinq_UnsupportedBinding"); + } + } + + public static string ELinq_UnsupportedCastToDecimal { + get { + return SR.GetString ("ELinq_UnsupportedCastToDecimal"); + } + } + + public static string ELinq_UnsupportedConstructor { + get { + return SR.GetString ("ELinq_UnsupportedConstructor"); + } + } + + public static string ELinq_UnsupportedDifferentContexts { + get { + return SR.GetString ("ELinq_UnsupportedDifferentContexts"); + } + } + + public static string ELinq_UnsupportedInclude { + get { + return SR.GetString ("ELinq_UnsupportedInclude"); + } + } + + public static string ELinq_UnsupportedInitializers { + get { + return SR.GetString ("ELinq_UnsupportedInitializers"); + } + } + + public static string ELinq_UnsupportedMergeAs { + get { + return SR.GetString ("ELinq_UnsupportedMergeAs"); + } + } + + public static string ELinq_UnsupportedNestedFirst { + get { + return SR.GetString ("ELinq_UnsupportedNestedFirst"); + } + } + + public static string ELinq_UnsupportedNestedSingle { + get { + return SR.GetString ("ELinq_UnsupportedNestedSingle"); + } + } + + public static string ELinq_UnsupportedQueryableMethod { + get { + return SR.GetString ("ELinq_UnsupportedQueryableMethod"); + } + } + + public static string EmptyCommandText { + get { + return SR.GetString ("EmptyCommandText"); + } + } + + public static string EmptyDefiningQuery { + get { + return SR.GetString ("EmptyDefiningQuery"); + } + } + + public static string EmptySchemaTextReader { + get { + return SR.GetString ("EmptySchemaTextReader"); + } + } + + public static string Entity_EntityCantHaveMultipleChangeTrackers { + get { + return SR.GetString ("Entity_EntityCantHaveMultipleChangeTrackers"); + } + } + + public static string EntityClient_CannotCloneStoreProvider { + get { + return SR.GetString ("EntityClient_CannotCloneStoreProvider"); + } + } + + public static string EntityClient_CannotDeduceDbType { + get { + return SR.GetString ("EntityClient_CannotDeduceDbType"); + } + } + + public static string EntityClient_CannotGetCommandText { + get { + return SR.GetString ("EntityClient_CannotGetCommandText"); + } + } + + public static string EntityClient_CannotGetCommandTree { + get { + return SR.GetString ("EntityClient_CannotGetCommandTree"); + } + } + + public static string EntityClient_CannotReopenConnection { + get { + return SR.GetString ("EntityClient_CannotReopenConnection"); + } + } + + public static string EntityClient_CannotReprepareCommandDefinitionBasedCommand { + get { + return SR.GetString ("EntityClient_CannotReprepareCommandDefinitionBasedCommand"); + } + } + + public static string EntityClient_CannotSetCommandText { + get { + return SR.GetString ("EntityClient_CannotSetCommandText"); + } + } + + public static string EntityClient_CannotSetCommandTree { + get { + return SR.GetString ("EntityClient_CannotSetCommandTree"); + } + } + + public static string EntityClient_ClosedConnectionForUpdate { + get { + return SR.GetString ("EntityClient_ClosedConnectionForUpdate"); + } + } + + public static string EntityClient_CommandDefinitionExecutionFailed { + get { + return SR.GetString ("EntityClient_CommandDefinitionExecutionFailed"); + } + } + + public static string EntityClient_CommandDefinitionPreparationFailed { + get { + return SR.GetString ("EntityClient_CommandDefinitionPreparationFailed"); + } + } + + public static string EntityClient_CommandExecutionFailed { + get { + return SR.GetString ("EntityClient_CommandExecutionFailed"); + } + } + + public static string EntityClient_CommandTreeMetadataIncompatible { + get { + return SR.GetString ("EntityClient_CommandTreeMetadataIncompatible"); + } + } + + public static string EntityClient_ConnectionMustBeClosed { + get { + return SR.GetString ("EntityClient_ConnectionMustBeClosed"); + } + } + + public static string EntityClient_ConnectionNotOpen { + get { + return SR.GetString ("EntityClient_ConnectionNotOpen"); + } + } + + public static string EntityClient_ConnectionStateBroken { + get { + return SR.GetString ("EntityClient_ConnectionStateBroken"); + } + } + + public static string EntityClient_ConnectionStateClosed { + get { + return SR.GetString ("EntityClient_ConnectionStateClosed"); + } + } + + public static string EntityClient_ConnectionStringNeededBeforeOperation { + get { + return SR.GetString ("EntityClient_ConnectionStringNeededBeforeOperation"); + } + } + + public static string EntityClient_DataReaderIsStillOpen { + get { + return SR.GetString ("EntityClient_DataReaderIsStillOpen"); + } + } + + public static string EntityClient_EmptyParameterName { + get { + return SR.GetString ("EntityClient_EmptyParameterName"); + } + } + + public static string EntityClient_ErrorInBeginningTransaction { + get { + return SR.GetString ("EntityClient_ErrorInBeginningTransaction"); + } + } + + public static string EntityClient_ErrorInClosingConnection { + get { + return SR.GetString ("EntityClient_ErrorInClosingConnection"); + } + } + + public static string EntityClient_ExtraParametersWithNamedConnection { + get { + return SR.GetString ("EntityClient_ExtraParametersWithNamedConnection"); + } + } + + public static string EntityClient_FunctionImportEmptyCommandText { + get { + return SR.GetString ("EntityClient_FunctionImportEmptyCommandText"); + } + } + + public static string EntityClient_InvalidNamedConnection { + get { + return SR.GetString ("EntityClient_InvalidNamedConnection"); + } + } + + public static string EntityClient_InvalidStoredProcedureCommandText { + get { + return SR.GetString ("EntityClient_InvalidStoredProcedureCommandText"); + } + } + + public static string EntityClient_InvalidStoreProvider { + get { + return SR.GetString ("EntityClient_InvalidStoreProvider"); + } + } + + public static string EntityClient_InvalidTransactionForCommand { + get { + return SR.GetString ("EntityClient_InvalidTransactionForCommand"); + } + } + + public static string EntityClient_NoCommandText { + get { + return SR.GetString ("EntityClient_NoCommandText"); + } + } + + public static string EntityClient_NoConnectionForAdapter { + get { + return SR.GetString ("EntityClient_NoConnectionForAdapter"); + } + } + + public static string EntityClient_NoConnectionForCommand { + get { + return SR.GetString ("EntityClient_NoConnectionForCommand"); + } + } + + public static string EntityClient_NoStoreConnectionForUpdate { + get { + return SR.GetString ("EntityClient_NoStoreConnectionForUpdate"); + } + } + + public static string EntityClient_ProviderGeneralError { + get { + return SR.GetString ("EntityClient_ProviderGeneralError"); + } + } + + public static string EntityClient_RequiresNonStoreCommandTree { + get { + return SR.GetString ("EntityClient_RequiresNonStoreCommandTree"); + } + } + + public static string EntityClient_SettingsCannotBeChangedOnOpenConnection { + get { + return SR.GetString ("EntityClient_SettingsCannotBeChangedOnOpenConnection"); + } + } + + public static string EntityClient_StoreReaderFailed { + get { + return SR.GetString ("EntityClient_StoreReaderFailed"); + } + } + + public static string EntityClient_TooFewColumns { + get { + return SR.GetString ("EntityClient_TooFewColumns"); + } + } + + public static string EntityClient_TransactionAlreadyStarted { + get { + return SR.GetString ("EntityClient_TransactionAlreadyStarted"); + } + } + + public static string EntityClient_UnsupportedCommandType { + get { + return SR.GetString ("EntityClient_UnsupportedCommandType"); + } + } + + public static string EntityClient_ValueNotString { + get { + return SR.GetString ("EntityClient_ValueNotString"); + } + } + + public static string EntityKey_CannotChangeKey { + get { + return SR.GetString ("EntityKey_CannotChangeKey"); + } + } + + public static string EntityKey_DataRecordMustBeEntity { + get { + return SR.GetString ("EntityKey_DataRecordMustBeEntity"); + } + } + + public static string EntityKey_EntityKeyMustHaveValues { + get { + return SR.GetString ("EntityKey_EntityKeyMustHaveValues"); + } + } + + public static string EntityKey_InvalidQualifiedEntitySetName { + get { + return SR.GetString ("EntityKey_InvalidQualifiedEntitySetName"); + } + } + + public static string EntityKey_MissingEntitySetName { + get { + return SR.GetString ("EntityKey_MissingEntitySetName"); + } + } + + public static string EntityKey_NoNullsAllowedInKeyValuePairs { + get { + return SR.GetString ("EntityKey_NoNullsAllowedInKeyValuePairs"); + } + } + + public static string EntityKey_UnexpectedNull { + get { + return SR.GetString ("EntityKey_UnexpectedNull"); + } + } + + public static string EntityParameterCollectionRemoveInvalidObject { + get { + return SR.GetString ("EntityParameterCollectionRemoveInvalidObject"); + } + } + + public static string EntityParameterContainedByAnotherCollection { + get { + return SR.GetString ("EntityParameterContainedByAnotherCollection"); + } + } + + public static string EntityParameterNull { + get { + return SR.GetString ("EntityParameterNull"); + } + } + + public static string EntityProxyTypeInfo_ProxyHasWrongWrapper { + get { + return SR.GetString ("EntityProxyTypeInfo_ProxyHasWrongWrapper"); + } + } + + public static string EntityReference_CannotChangeReferentialConstraintProperty { + get { + return SR.GetString ("EntityReference_CannotChangeReferentialConstraintProperty"); + } + } + + public static string EntityReference_CannotSetSpecialKeys { + get { + return SR.GetString ("EntityReference_CannotSetSpecialKeys"); + } + } + + public static string EntityReference_EntityKeyValueMismatch { + get { + return SR.GetString ("EntityReference_EntityKeyValueMismatch"); + } + } + + public static string EntityReference_LessThanExpectedRelatedEntitiesFound { + get { + return SR.GetString ("EntityReference_LessThanExpectedRelatedEntitiesFound"); + } + } + + public static string EntityReference_MoreThanExpectedRelatedEntitiesFound { + get { + return SR.GetString ("EntityReference_MoreThanExpectedRelatedEntitiesFound"); + } + } + + public static string EntitySetInAnotherContainer { + get { + return SR.GetString ("EntitySetInAnotherContainer"); + } + } + + public static string EntityTypesDoNotAgree { + get { + return SR.GetString ("EntityTypesDoNotAgree"); + } + } + + public static string ExpressionCannotBeNull { + get { + return SR.GetString ("ExpressionCannotBeNull"); + } + } + + public static string ExpressionMustBeCollection { + get { + return SR.GetString ("ExpressionMustBeCollection"); + } + } + + public static string ExpressionMustBeNumericType { + get { + return SR.GetString ("ExpressionMustBeNumericType"); + } + } + + public static string ExpressionTypeMustBeBoolean { + get { + return SR.GetString ("ExpressionTypeMustBeBoolean"); + } + } + + public static string ExpressionTypeMustBeEqualComparable { + get { + return SR.GetString ("ExpressionTypeMustBeEqualComparable"); + } + } + + public static string ExpressionTypeMustNotBeCollection { + get { + return SR.GetString ("ExpressionTypeMustNotBeCollection"); + } + } + + public static string ExprIsNotValidEntitySetForCreateRef { + get { + return SR.GetString ("ExprIsNotValidEntitySetForCreateRef"); + } + } + + public static string ExtraInfo { + get { + return SR.GetString ("ExtraInfo"); + } + } + + public static string FacetDeclarationRequiresTypeAttribute { + get { + return SR.GetString ("FacetDeclarationRequiresTypeAttribute"); + } + } + + public static string FailedToRetrieveProviderManifest { + get { + return SR.GetString ("FailedToRetrieveProviderManifest"); + } + } + + public static string GeneralQueryError { + get { + return SR.GetString ("GeneralQueryError"); + } + } + + public static string Generated_Views_Changed { + get { + return SR.GetString ("Generated_Views_Changed"); + } + } + + public static string GeneratorErrorSeverityError { + get { + return SR.GetString ("GeneratorErrorSeverityError"); + } + } + + public static string GeneratorErrorSeverityUnknown { + get { + return SR.GetString ("GeneratorErrorSeverityUnknown"); + } + } + + public static string GeneratorErrorSeverityWarning { + get { + return SR.GetString ("GeneratorErrorSeverityWarning"); + } + } + + public static string GenericSyntaxError { + get { + return SR.GetString ("GenericSyntaxError"); + } + } + + public static string GroupingKeysMustBeEqualComparable { + get { + return SR.GetString ("GroupingKeysMustBeEqualComparable"); + } + } + + public static string GroupPartitionOutOfContext { + get { + return SR.GetString ("GroupPartitionOutOfContext"); + } + } + + public static string GroupVarNotFoundInScope { + get { + return SR.GetString ("GroupVarNotFoundInScope"); + } + } + + public static string HavingRequiresGroupClause { + get { + return SR.GetString ("HavingRequiresGroupClause"); + } + } + + public static string ImcompatibleCreateRefKeyElementType { + get { + return SR.GetString ("ImcompatibleCreateRefKeyElementType"); + } + } + + public static string ImcompatibleCreateRefKeyType { + get { + return SR.GetString ("ImcompatibleCreateRefKeyType"); + } + } + + public static string IncorrectProviderManifest { + get { + return SR.GetString ("IncorrectProviderManifest"); + } + } + + public static string InFromClause { + get { + return SR.GetString ("InFromClause"); + } + } + + public static string InGroupClause { + get { + return SR.GetString ("InGroupClause"); + } + } + + public static string InnerJoinMustHaveOnPredicate { + get { + return SR.GetString ("InnerJoinMustHaveOnPredicate"); + } + } + + public static string InRowCtor { + get { + return SR.GetString ("InRowCtor"); + } + } + + public static string InSelectProjectionList { + get { + return SR.GetString ("InSelectProjectionList"); + } + } + + public static string InvalidArgumentTypeForAggregateFunction { + get { + return SR.GetString ("InvalidArgumentTypeForAggregateFunction"); + } + } + + public static string InvalidCaseResultTypes { + get { + return SR.GetString ("InvalidCaseResultTypes"); + } + } + + public static string InvalidCaseWhenThenNullType { + get { + return SR.GetString ("InvalidCaseWhenThenNullType"); + } + } + + public static string InvalidCastExpressionType { + get { + return SR.GetString ("InvalidCastExpressionType"); + } + } + + public static string InvalidCastType { + get { + return SR.GetString ("InvalidCastType"); + } + } + + public static string InvalidCreateRefKeyType { + get { + return SR.GetString ("InvalidCreateRefKeyType"); + } + } + + public static string InvalidDistinctArgumentInCtor { + get { + return SR.GetString ("InvalidDistinctArgumentInCtor"); + } + } + + public static string InvalidDistinctArgumentInNonAggFunction { + get { + return SR.GetString ("InvalidDistinctArgumentInNonAggFunction"); + } + } + + public static string InvalidDocumentationBothTextAndStructure { + get { + return SR.GetString ("InvalidDocumentationBothTextAndStructure"); + } + } + + public static string InvalidEmptyIdentifier { + get { + return SR.GetString ("InvalidEmptyIdentifier"); + } + } + + public static string InvalidEmptyQuery { + get { + return SR.GetString ("InvalidEmptyQuery"); + } + } + + public static string InvalidEmptyQueryTextArgument { + get { + return SR.GetString ("InvalidEmptyQueryTextArgument"); + } + } + + public static string InvalidEnumUnderlyingType { + get { + return SR.GetString ("InvalidEnumUnderlyingType"); + } + } + + public static string InvalidFlattenArgument { + get { + return SR.GetString ("InvalidFlattenArgument"); + } + } + + public static string InvalidJoinLeftCorrelation { + get { + return SR.GetString ("InvalidJoinLeftCorrelation"); + } + } + + public static string InvalidMaxLengthSize { + get { + return SR.GetString ("InvalidMaxLengthSize"); + } + } + + public static string InvalidMetadataMemberName { + get { + return SR.GetString ("InvalidMetadataMemberName"); + } + } + + public static string InvalidMetadataPath { + get { + return SR.GetString ("InvalidMetadataPath"); + } + } + + public static string InvalidModeForWithRelationshipClause { + get { + return SR.GetString ("InvalidModeForWithRelationshipClause"); + } + } + + public static string InvalidNamespaceAlias { + get { + return SR.GetString ("InvalidNamespaceAlias"); + } + } + + public static string InvalidNullArithmetic { + get { + return SR.GetString ("InvalidNullArithmetic"); + } + } + + public static string InvalidNullComparison { + get { + return SR.GetString ("InvalidNullComparison"); + } + } + + public static string InvalidOperationMultipleEndsInAssociation { + get { + return SR.GetString ("InvalidOperationMultipleEndsInAssociation"); + } + } + + public static string InvalidOperatorSymbol { + get { + return SR.GetString ("InvalidOperatorSymbol"); + } + } + + public static string InvalidPredicateForCrossJoin { + get { + return SR.GetString ("InvalidPredicateForCrossJoin"); + } + } + + public static string InvalidPunctuatorSymbol { + get { + return SR.GetString ("InvalidPunctuatorSymbol"); + } + } + + public static string InvalidSavePoint { + get { + return SR.GetString ("InvalidSavePoint"); + } + } + + public static string InvalidScopeIndex { + get { + return SR.GetString ("InvalidScopeIndex"); + } + } + + public static string InvalidSelectValueAliasedExpression { + get { + return SR.GetString ("InvalidSelectValueAliasedExpression"); + } + } + + public static string InvalidSelectValueList { + get { + return SR.GetString ("InvalidSelectValueList"); + } + } + + public static string InvalidTypeForWithRelationshipClause { + get { + return SR.GetString ("InvalidTypeForWithRelationshipClause"); + } + } + + public static string Iqt_CTGen_UnexpectedAggregate { + get { + return SR.GetString ("Iqt_CTGen_UnexpectedAggregate"); + } + } + + public static string Iqt_CTGen_UnexpectedVarDef { + get { + return SR.GetString ("Iqt_CTGen_UnexpectedVarDef"); + } + } + + public static string Iqt_CTGen_UnexpectedVarDefList { + get { + return SR.GetString ("Iqt_CTGen_UnexpectedVarDefList"); + } + } + + public static string IsNullInvalidType { + get { + return SR.GetString ("IsNullInvalidType"); + } + } + + public static string LeftSetExpressionArgsMustBeCollection { + get { + return SR.GetString ("LeftSetExpressionArgsMustBeCollection"); + } + } + + public static string LikeArgMustBeStringType { + get { + return SR.GetString ("LikeArgMustBeStringType"); + } + } + + public static string LocalizedCollection { + get { + return SR.GetString ("LocalizedCollection"); + } + } + + public static string LocalizedColumn { + get { + return SR.GetString ("LocalizedColumn"); + } + } + + public static string LocalizedComplex { + get { + return SR.GetString ("LocalizedComplex"); + } + } + + public static string LocalizedEntity { + get { + return SR.GetString ("LocalizedEntity"); + } + } + + public static string LocalizedEntityContainerExpression { + get { + return SR.GetString ("LocalizedEntityContainerExpression"); + } + } + + public static string LocalizedEnumMember { + get { + return SR.GetString ("LocalizedEnumMember"); + } + } + + public static string LocalizedFunction { + get { + return SR.GetString ("LocalizedFunction"); + } + } + + public static string LocalizedInlineFunction { + get { + return SR.GetString ("LocalizedInlineFunction"); + } + } + + public static string LocalizedKeyword { + get { + return SR.GetString ("LocalizedKeyword"); + } + } + + public static string LocalizedLeft { + get { + return SR.GetString ("LocalizedLeft"); + } + } + + public static string LocalizedLine { + get { + return SR.GetString ("LocalizedLine"); + } + } + + public static string LocalizedMetadataMemberExpression { + get { + return SR.GetString ("LocalizedMetadataMemberExpression"); + } + } + + public static string LocalizedNamespace { + get { + return SR.GetString ("LocalizedNamespace"); + } + } + + public static string LocalizedNear { + get { + return SR.GetString ("LocalizedNear"); + } + } + + public static string LocalizedPrimitive { + get { + return SR.GetString ("LocalizedPrimitive"); + } + } + + public static string LocalizedReference { + get { + return SR.GetString ("LocalizedReference"); + } + } + + public static string LocalizedRight { + get { + return SR.GetString ("LocalizedRight"); + } + } + + public static string LocalizedRow { + get { + return SR.GetString ("LocalizedRow"); + } + } + + public static string LocalizedTerm { + get { + return SR.GetString ("LocalizedTerm"); + } + } + + public static string LocalizedType { + get { + return SR.GetString ("LocalizedType"); + } + } + + public static string LocalizedValueExpression { + get { + return SR.GetString ("LocalizedValueExpression"); + } + } + + public static string MalformedSingleQuotePayload { + get { + return SR.GetString ("MalformedSingleQuotePayload"); + } + } + + public static string MalformedStringLiteralPayload { + get { + return SR.GetString ("MalformedStringLiteralPayload"); + } + } + + public static string Mapping_ConditionValueTypeMismatch { + get { + return SR.GetString ("Mapping_ConditionValueTypeMismatch"); + } + } + + public static string Mapping_DifferentEdmStoreVersion { + get { + return SR.GetString ("Mapping_DifferentEdmStoreVersion"); + } + } + + public static string Mapping_DifferentMappingEdmStoreVersion { + get { + return SR.GetString ("Mapping_DifferentMappingEdmStoreVersion"); + } + } + + public static string Mapping_DistinctFlagInReadWriteContainer { + get { + return SR.GetString ("Mapping_DistinctFlagInReadWriteContainer"); + } + } + + public static string Mapping_General_Error { + get { + return SR.GetString ("Mapping_General_Error"); + } + } + + public static string Mapping_InvalidContent_Association_Type_Empty { + get { + return SR.GetString ("Mapping_InvalidContent_Association_Type_Empty"); + } + } + + public static string Mapping_InvalidContent_ConditionMapping_Both_Members { + get { + return SR.GetString ("Mapping_InvalidContent_ConditionMapping_Both_Members"); + } + } + + public static string Mapping_InvalidContent_ConditionMapping_Both_Values { + get { + return SR.GetString ("Mapping_InvalidContent_ConditionMapping_Both_Values"); + } + } + + public static string Mapping_InvalidContent_ConditionMapping_Either_Members { + get { + return SR.GetString ("Mapping_InvalidContent_ConditionMapping_Either_Members"); + } + } + + public static string Mapping_InvalidContent_ConditionMapping_Either_Values { + get { + return SR.GetString ("Mapping_InvalidContent_ConditionMapping_Either_Values"); + } + } + + public static string Mapping_InvalidContent_ConditionMapping_NonScalar { + get { + return SR.GetString ("Mapping_InvalidContent_ConditionMapping_NonScalar"); + } + } + + public static string Mapping_InvalidContent_Container_SubElement { + get { + return SR.GetString ("Mapping_InvalidContent_Container_SubElement"); + } + } + + public static string Mapping_InvalidContent_General { + get { + return SR.GetString ("Mapping_InvalidContent_General"); + } + } + + public static string Mapping_InvalidContent_IsTypeOfNotTerminated { + get { + return SR.GetString ("Mapping_InvalidContent_IsTypeOfNotTerminated"); + } + } + + public static string Mapping_InvalidContent_Table_Expected { + get { + return SR.GetString ("Mapping_InvalidContent_Table_Expected"); + } + } + + public static string Mapping_InvalidContent_TypeMapping_QueryView { + get { + return SR.GetString ("Mapping_InvalidContent_TypeMapping_QueryView"); + } + } + + public static string Mapping_ModificationFunction_In_Table_Context { + get { + return SR.GetString ("Mapping_ModificationFunction_In_Table_Context"); + } + } + + public static string Mapping_ModificationFunction_MissingVersion { + get { + return SR.GetString ("Mapping_ModificationFunction_MissingVersion"); + } + } + + public static string Mapping_ModificationFunction_Multiple_Types { + get { + return SR.GetString ("Mapping_ModificationFunction_Multiple_Types"); + } + } + + public static string Mapping_ModificationFunction_VersionMustBeCurrent { + get { + return SR.GetString ("Mapping_ModificationFunction_VersionMustBeCurrent"); + } + } + + public static string Mapping_ModificationFunction_VersionMustBeOriginal { + get { + return SR.GetString ("Mapping_ModificationFunction_VersionMustBeOriginal"); + } + } + + public static string Mapping_TypeName_For_First_QueryView { + get { + return SR.GetString ("Mapping_TypeName_For_First_QueryView"); + } + } + + public static string Materializer_CannotReEnumerateQueryResults { + get { + return SR.GetString ("Materializer_CannotReEnumerateQueryResults"); + } + } + + public static string Materializer_PropertyIsNotNullable { + get { + return SR.GetString ("Materializer_PropertyIsNotNullable"); + } + } + + public static string Materializer_UnsupportedType { + get { + return SR.GetString ("Materializer_UnsupportedType"); + } + } + + public static string Metadata_General_Error { + get { + return SR.GetString ("Metadata_General_Error"); + } + } + + public static string MethodInvocationNotSupported { + get { + return SR.GetString ("MethodInvocationNotSupported"); + } + } + + public static string MismatchNumberOfPropertiesinRelationshipConstraint { + get { + return SR.GetString ("MismatchNumberOfPropertiesinRelationshipConstraint"); + } + } + + public static string MissingName { + get { + return SR.GetString ("MissingName"); + } + } + + public static string MissingNamespaceAttribute { + get { + return SR.GetString ("MissingNamespaceAttribute"); + } + } + + public static string MultisetElemsAreNotTypeCompatible { + get { + return SR.GetString ("MultisetElemsAreNotTypeCompatible"); + } + } + + public static string NonComposableFunctionHasDisallowedAttribute { + get { + return SR.GetString ("NonComposableFunctionHasDisallowedAttribute"); + } + } + + public static string NonComposableFunctionMustNotDeclareReturnType { + get { + return SR.GetString ("NonComposableFunctionMustNotDeclareReturnType"); + } + } + + public static string NotBinaryTypeForTypeUsage { + get { + return SR.GetString ("NotBinaryTypeForTypeUsage"); + } + } + + public static string NotDateTimeOffsetTypeForTypeUsage { + get { + return SR.GetString ("NotDateTimeOffsetTypeForTypeUsage"); + } + } + + public static string NotDateTimeTypeForTypeUsage { + get { + return SR.GetString ("NotDateTimeTypeForTypeUsage"); + } + } + + public static string NotDecimalTypeForTypeUsage { + get { + return SR.GetString ("NotDecimalTypeForTypeUsage"); + } + } + + public static string NotStringTypeForTypeUsage { + get { + return SR.GetString ("NotStringTypeForTypeUsage"); + } + } + + public static string NotTimeTypeForTypeUsage { + get { + return SR.GetString ("NotTimeTypeForTypeUsage"); + } + } + + public static string NotValidInputPath { + get { + return SR.GetString ("NotValidInputPath"); + } + } + + public static string NullLiteralCannotBePromotedToCollectionOfNulls { + get { + return SR.GetString ("NullLiteralCannotBePromotedToCollectionOfNulls"); + } + } + + public static string ObjectContext_CannotAttachEntityWithoutKey { + get { + return SR.GetString ("ObjectContext_CannotAttachEntityWithoutKey"); + } + } + + public static string ObjectContext_CannotAttachEntityWithTemporaryKey { + get { + return SR.GetString ("ObjectContext_CannotAttachEntityWithTemporaryKey"); + } + } + + public static string ObjectContext_CannotDeleteEntityNotInObjectStateManager { + get { + return SR.GetString ("ObjectContext_CannotDeleteEntityNotInObjectStateManager"); + } + } + + public static string ObjectContext_CannotDetachEntityNotInObjectStateManager { + get { + return SR.GetString ("ObjectContext_CannotDetachEntityNotInObjectStateManager"); + } + } + + public static string ObjectContext_CannotSetDefaultContainerName { + get { + return SR.GetString ("ObjectContext_CannotSetDefaultContainerName"); + } + } + + public static string ObjectContext_CommitWithConceptualNull { + get { + return SR.GetString ("ObjectContext_CommitWithConceptualNull"); + } + } + + public static string ObjectContext_ContainerQualifiedEntitySetNameRequired { + get { + return SR.GetString ("ObjectContext_ContainerQualifiedEntitySetNameRequired"); + } + } + + public static string ObjectContext_EntityAlreadyExistsInObjectStateManager { + get { + return SR.GetString ("ObjectContext_EntityAlreadyExistsInObjectStateManager"); + } + } + + public static string ObjectContext_EntityNotTrackedOrHasTempKey { + get { + return SR.GetString ("ObjectContext_EntityNotTrackedOrHasTempKey"); + } + } + + public static string ObjectContext_EntitySetNameOrEntityKeyRequired { + get { + return SR.GetString ("ObjectContext_EntitySetNameOrEntityKeyRequired"); + } + } + + public static string ObjectContext_ExecuteCommandWithMixOfDbParameterAndValues { + get { + return SR.GetString ("ObjectContext_ExecuteCommandWithMixOfDbParameterAndValues"); + } + } + + public static string ObjectContext_InvalidCommandTimeout { + get { + return SR.GetString ("ObjectContext_InvalidCommandTimeout"); + } + } + + public static string ObjectContext_InvalidConnection { + get { + return SR.GetString ("ObjectContext_InvalidConnection"); + } + } + + public static string ObjectContext_InvalidConnectionString { + get { + return SR.GetString ("ObjectContext_InvalidConnectionString"); + } + } + + public static string ObjectContext_InvalidDataAdapter { + get { + return SR.GetString ("ObjectContext_InvalidDataAdapter"); + } + } + + public static string ObjectContext_InvalidEntityState { + get { + return SR.GetString ("ObjectContext_InvalidEntityState"); + } + } + + public static string ObjectContext_InvalidRelationshipState { + get { + return SR.GetString ("ObjectContext_InvalidRelationshipState"); + } + } + + public static string ObjectContext_MetadataHasChanged { + get { + return SR.GetString ("ObjectContext_MetadataHasChanged"); + } + } + + public static string ObjectContext_ObjectDisposed { + get { + return SR.GetString ("ObjectContext_ObjectDisposed"); + } + } + + public static string ObjectContext_ObjectNotFound { + get { + return SR.GetString ("ObjectContext_ObjectNotFound"); + } + } + + public static string ObjectContext_QualfiedEntitySetName { + get { + return SR.GetString ("ObjectContext_QualfiedEntitySetName"); + } + } + + public static string ObjectContext_RequiredMetadataNotAvailble { + get { + return SR.GetString ("ObjectContext_RequiredMetadataNotAvailble"); + } + } + + public static string ObjectContext_SelectorExpressionMustBeMemberAccess { + get { + return SR.GetString ("ObjectContext_SelectorExpressionMustBeMemberAccess"); + } + } + + public static string ObjectContext_StoreEntityNotPresentInClient { + get { + return SR.GetString ("ObjectContext_StoreEntityNotPresentInClient"); + } + } + + public static string ObjectParameterCollection_ParametersLocked { + get { + return SR.GetString ("ObjectParameterCollection_ParametersLocked"); + } + } + + public static string ObjectQuery_InvalidConnection { + get { + return SR.GetString ("ObjectQuery_InvalidConnection"); + } + } + + public static string ObjectQuery_InvalidEmptyQuery { + get { + return SR.GetString ("ObjectQuery_InvalidEmptyQuery"); + } + } + + public static string ObjectQuery_QueryBuilder_InvalidFilterPredicate { + get { + return SR.GetString ("ObjectQuery_QueryBuilder_InvalidFilterPredicate"); + } + } + + public static string ObjectQuery_QueryBuilder_InvalidGroupKeyList { + get { + return SR.GetString ("ObjectQuery_QueryBuilder_InvalidGroupKeyList"); + } + } + + public static string ObjectQuery_QueryBuilder_InvalidProjectionList { + get { + return SR.GetString ("ObjectQuery_QueryBuilder_InvalidProjectionList"); + } + } + + public static string ObjectQuery_QueryBuilder_InvalidQueryArgument { + get { + return SR.GetString ("ObjectQuery_QueryBuilder_InvalidQueryArgument"); + } + } + + public static string ObjectQuery_QueryBuilder_InvalidSkipCount { + get { + return SR.GetString ("ObjectQuery_QueryBuilder_InvalidSkipCount"); + } + } + + public static string ObjectQuery_QueryBuilder_InvalidSortKeyList { + get { + return SR.GetString ("ObjectQuery_QueryBuilder_InvalidSortKeyList"); + } + } + + public static string ObjectQuery_QueryBuilder_InvalidTopCount { + get { + return SR.GetString ("ObjectQuery_QueryBuilder_InvalidTopCount"); + } + } + + public static string ObjectQuery_QueryBuilder_NotSupportedLinqSource { + get { + return SR.GetString ("ObjectQuery_QueryBuilder_NotSupportedLinqSource"); + } + } + + public static string ObjectQuery_Span_IncludeRequiresEntityOrEntityCollection { + get { + return SR.GetString ("ObjectQuery_Span_IncludeRequiresEntityOrEntityCollection"); + } + } + + public static string ObjectQuery_Span_SpanPathSyntaxError { + get { + return SR.GetString ("ObjectQuery_Span_SpanPathSyntaxError"); + } + } + + public static string ObjectQuery_Span_WhiteSpacePath { + get { + return SR.GetString ("ObjectQuery_Span_WhiteSpacePath"); + } + } + + public static string ObjectQuery_UnableToMapResultType { + get { + return SR.GetString ("ObjectQuery_UnableToMapResultType"); + } + } + + public static string ObjectStateEntry_CannotAccessKeyEntryValues { + get { + return SR.GetString ("ObjectStateEntry_CannotAccessKeyEntryValues"); + } + } + + public static string ObjectStateEntry_CannotDeleteOnKeyEntry { + get { + return SR.GetString ("ObjectStateEntry_CannotDeleteOnKeyEntry"); + } + } + + public static string ObjectStateEntry_CannotModifyKeyEntryState { + get { + return SR.GetString ("ObjectStateEntry_CannotModifyKeyEntryState"); + } + } + + public static string ObjectStateEntry_CantModifyDetachedDeletedEntries { + get { + return SR.GetString ("ObjectStateEntry_CantModifyDetachedDeletedEntries"); + } + } + + public static string ObjectStateEntry_CantModifyRelationState { + get { + return SR.GetString ("ObjectStateEntry_CantModifyRelationState"); + } + } + + public static string ObjectStateEntry_CantModifyRelationValues { + get { + return SR.GetString ("ObjectStateEntry_CantModifyRelationValues"); + } + } + + public static string ObjectStateEntry_CantSetEntityKey { + get { + return SR.GetString ("ObjectStateEntry_CantSetEntityKey"); + } + } + + public static string ObjectStateEntry_CurrentValuesDoesNotExist { + get { + return SR.GetString ("ObjectStateEntry_CurrentValuesDoesNotExist"); + } + } + + public static string ObjectStateEntry_EntityMemberChangedWithoutEntityMemberChanging { + get { + return SR.GetString ("ObjectStateEntry_EntityMemberChangedWithoutEntityMemberChanging"); + } + } + + public static string ObjectStateEntry_InvalidState { + get { + return SR.GetString ("ObjectStateEntry_InvalidState"); + } + } + + public static string ObjectStateEntry_InvalidTypeForComplexTypeProperty { + get { + return SR.GetString ("ObjectStateEntry_InvalidTypeForComplexTypeProperty"); + } + } + + public static string ObjectStateEntry_OriginalValuesDoesNotExist { + get { + return SR.GetString ("ObjectStateEntry_OriginalValuesDoesNotExist"); + } + } + + public static string ObjectStateEntry_RelationshipAndKeyEntriesDoNotHaveRelationshipManagers { + get { + return SR.GetString ("ObjectStateEntry_RelationshipAndKeyEntriesDoNotHaveRelationshipManagers"); + } + } + + public static string ObjectStateManager_AcceptChangesEntityKeyIsNotValid { + get { + return SR.GetString ("ObjectStateManager_AcceptChangesEntityKeyIsNotValid"); + } + } + + public static string ObjectStateManager_CannotChangeRelationshipStateEntityAdded { + get { + return SR.GetString ("ObjectStateManager_CannotChangeRelationshipStateEntityAdded"); + } + } + + public static string ObjectStateManager_CannotChangeRelationshipStateEntityDeleted { + get { + return SR.GetString ("ObjectStateManager_CannotChangeRelationshipStateEntityDeleted"); + } + } + + public static string ObjectStateManager_CannotChangeRelationshipStateKeyEntry { + get { + return SR.GetString ("ObjectStateManager_CannotChangeRelationshipStateKeyEntry"); + } + } + + public static string ObjectStateManager_CannotFixUpKeyToExistingValues { + get { + return SR.GetString ("ObjectStateManager_CannotFixUpKeyToExistingValues"); + } + } + + public static string ObjectStateManager_CannotGetRelationshipManagerForDetachedPocoEntity { + get { + return SR.GetString ("ObjectStateManager_CannotGetRelationshipManagerForDetachedPocoEntity"); + } + } + + public static string ObjectStateManager_ChangeRelationshipStateNotSupportedForForeignKeyAssociations { + get { + return SR.GetString ("ObjectStateManager_ChangeRelationshipStateNotSupportedForForeignKeyAssociations"); + } + } + + public static string ObjectStateManager_ChangeStateFromAddedWithNullKeyIsInvalid { + get { + return SR.GetString ("ObjectStateManager_ChangeStateFromAddedWithNullKeyIsInvalid"); + } + } + + public static string ObjectStateManager_DetachedObjectStateEntriesDoesNotExistInObjectStateManager { + get { + return SR.GetString ("ObjectStateManager_DetachedObjectStateEntriesDoesNotExistInObjectStateManager"); + } + } + + public static string ObjectStateManager_EntityConflictsWithKeyEntry { + get { + return SR.GetString ("ObjectStateManager_EntityConflictsWithKeyEntry"); + } + } + + public static string ObjectStateManager_EntityNotTracked { + get { + return SR.GetString ("ObjectStateManager_EntityNotTracked"); + } + } + + public static string ObjectStateManager_InvalidKey { + get { + return SR.GetString ("ObjectStateManager_InvalidKey"); + } + } + + public static string ObjectStateManager_KeyPropertyDoesntMatchValueInKey { + get { + return SR.GetString ("ObjectStateManager_KeyPropertyDoesntMatchValueInKey"); + } + } + + public static string ObjectStateManager_KeyPropertyDoesntMatchValueInKeyForAttach { + get { + return SR.GetString ("ObjectStateManager_KeyPropertyDoesntMatchValueInKeyForAttach"); + } + } + + public static string ObjectStateManager_NoEntryExistForEntityKey { + get { + return SR.GetString ("ObjectStateManager_NoEntryExistForEntityKey"); + } + } + + public static string ObjectStateManager_ObjectStateManagerContainsThisEntityKey { + get { + return SR.GetString ("ObjectStateManager_ObjectStateManagerContainsThisEntityKey"); + } + } + + public static string ObjectView_AddNewOperationNotAllowedOnAbstractBindingList { + get { + return SR.GetString ("ObjectView_AddNewOperationNotAllowedOnAbstractBindingList"); + } + } + + public static string ObjectView_CannotReplacetheEntityorRow { + get { + return SR.GetString ("ObjectView_CannotReplacetheEntityorRow"); + } + } + + public static string ObjectView_IncompatibleArgument { + get { + return SR.GetString ("ObjectView_IncompatibleArgument"); + } + } + + public static string ObjectView_IndexBasedInsertIsNotSupported { + get { + return SR.GetString ("ObjectView_IndexBasedInsertIsNotSupported"); + } + } + + public static string ObjectView_WriteOperationNotAllowedOnReadOnlyBindingList { + get { + return SR.GetString ("ObjectView_WriteOperationNotAllowedOnReadOnlyBindingList"); + } + } + + public static string OnlyStoreConnectionsSupported { + get { + return SR.GetString ("OnlyStoreConnectionsSupported"); + } + } + + public static string OperationOnReadOnlyCollection { + get { + return SR.GetString ("OperationOnReadOnlyCollection"); + } + } + + public static string OperationOnReadOnlyItem { + get { + return SR.GetString ("OperationOnReadOnlyItem"); + } + } + + public static string OrderByKeyIsNotOrderComparable { + get { + return SR.GetString ("OrderByKeyIsNotOrderComparable"); + } + } + + public static string PlusLeftExpressionInvalidType { + get { + return SR.GetString ("PlusLeftExpressionInvalidType"); + } + } + + public static string PlusRightExpressionInvalidType { + get { + return SR.GetString ("PlusRightExpressionInvalidType"); + } + } + + public static string ProviderDidNotCreateACommandDefinition { + get { + return SR.GetString ("ProviderDidNotCreateACommandDefinition"); + } + } + + public static string ProviderDidNotReturnAProviderManifest { + get { + return SR.GetString ("ProviderDidNotReturnAProviderManifest"); + } + } + + public static string ProviderDidNotReturnAProviderManifestToken { + get { + return SR.GetString ("ProviderDidNotReturnAProviderManifestToken"); + } + } + + public static string ProviderDidNotReturnSpatialServices { + get { + return SR.GetString ("ProviderDidNotReturnSpatialServices"); + } + } + + public static string ProviderDoesNotSupportCreateDatabase { + get { + return SR.GetString ("ProviderDoesNotSupportCreateDatabase"); + } + } + + public static string ProviderDoesNotSupportCreateDatabaseScript { + get { + return SR.GetString ("ProviderDoesNotSupportCreateDatabaseScript"); + } + } + + public static string ProviderDoesNotSupportDatabaseExists { + get { + return SR.GetString ("ProviderDoesNotSupportDatabaseExists"); + } + } + + public static string ProviderDoesNotSupportDeleteDatabase { + get { + return SR.GetString ("ProviderDoesNotSupportDeleteDatabase"); + } + } + + public static string ProviderEscapeLikeArgumentReturnedNull { + get { + return SR.GetString ("ProviderEscapeLikeArgumentReturnedNull"); + } + } + + public static string ProviderManifestTokenNotFound { + get { + return SR.GetString ("ProviderManifestTokenNotFound"); + } + } + + public static string ProviderRequiresStoreCommandTree { + get { + return SR.GetString ("ProviderRequiresStoreCommandTree"); + } + } + + public static string ProviderReturnedNullForCreateCommandDefinition { + get { + return SR.GetString ("ProviderReturnedNullForCreateCommandDefinition"); + } + } + + public static string ProviderShouldOverrideEscapeLikeArgument { + get { + return SR.GetString ("ProviderShouldOverrideEscapeLikeArgument"); + } + } + + public static string RelatedEnd_CannotCreateRelationshipEntitiesInDifferentContexts { + get { + return SR.GetString ("RelatedEnd_CannotCreateRelationshipEntitiesInDifferentContexts"); + } + } + + public static string RelatedEnd_ConflictingChangeOfRelationshipDetected { + get { + return SR.GetString ("RelatedEnd_ConflictingChangeOfRelationshipDetected"); + } + } + + public static string RelatedEnd_InvalidEntityContextForAttach { + get { + return SR.GetString ("RelatedEnd_InvalidEntityContextForAttach"); + } + } + + public static string RelatedEnd_InvalidEntityStateForAttach { + get { + return SR.GetString ("RelatedEnd_InvalidEntityStateForAttach"); + } + } + + public static string RelatedEnd_InvalidOwnerStateForAttach { + get { + return SR.GetString ("RelatedEnd_InvalidOwnerStateForAttach"); + } + } + + public static string RelatedEnd_LoadCalledOnAlreadyLoadedNoTrackedRelatedEnd { + get { + return SR.GetString ("RelatedEnd_LoadCalledOnAlreadyLoadedNoTrackedRelatedEnd"); + } + } + + public static string RelatedEnd_LoadCalledOnNonEmptyNoTrackedRelatedEnd { + get { + return SR.GetString ("RelatedEnd_LoadCalledOnNonEmptyNoTrackedRelatedEnd"); + } + } + + public static string RelatedEnd_OwnerIsNull { + get { + return SR.GetString ("RelatedEnd_OwnerIsNull"); + } + } + + public static string RelatedEnd_RelatedEndNotFound { + get { + return SR.GetString ("RelatedEnd_RelatedEndNotFound"); + } + } + + public static string RelatedEnd_UnableToAddEntity { + get { + return SR.GetString ("RelatedEnd_UnableToAddEntity"); + } + } + + public static string RelatedEnd_UnableToAddRelationshipWithDeletedEntity { + get { + return SR.GetString ("RelatedEnd_UnableToAddRelationshipWithDeletedEntity"); + } + } + + public static string RelatedEnd_UnableToRemoveEntity { + get { + return SR.GetString ("RelatedEnd_UnableToRemoveEntity"); + } + } + + public static string RelatedEndExprTypeMustBeReference { + get { + return SR.GetString ("RelatedEndExprTypeMustBeReference"); + } + } + + public static string RelationshipFromEndIsAmbiguos { + get { + return SR.GetString ("RelationshipFromEndIsAmbiguos"); + } + } + + public static string RelationshipManager_CannotGetRelatEndForDetachedPocoEntity { + get { + return SR.GetString ("RelationshipManager_CannotGetRelatEndForDetachedPocoEntity"); + } + } + + public static string RelationshipManager_CircularRelationshipsWithReferentialConstraints { + get { + return SR.GetString ("RelationshipManager_CircularRelationshipsWithReferentialConstraints"); + } + } + + public static string RelationshipManager_CollectionInitializeIsForDeserialization { + get { + return SR.GetString ("RelationshipManager_CollectionInitializeIsForDeserialization"); + } + } + + public static string RelationshipManager_InconsistentReferentialConstraintProperties { + get { + return SR.GetString ("RelationshipManager_InconsistentReferentialConstraintProperties"); + } + } + + public static string RelationshipManager_InitializeIsForDeserialization { + get { + return SR.GetString ("RelationshipManager_InitializeIsForDeserialization"); + } + } + + public static string RelationshipManager_InvalidRelationshipManagerOwner { + get { + return SR.GetString ("RelationshipManager_InvalidRelationshipManagerOwner"); + } + } + + public static string RelationshipManager_UnableToRetrieveReferentialConstraintProperties { + get { + return SR.GetString ("RelationshipManager_UnableToRetrieveReferentialConstraintProperties"); + } + } + + public static string RelationshipManager_UnexpectedNull { + get { + return SR.GetString ("RelationshipManager_UnexpectedNull"); + } + } + + public static string RelationshipManager_UnexpectedNullContext { + get { + return SR.GetString ("RelationshipManager_UnexpectedNullContext"); + } + } + + public static string RelationshipToEndIsAmbiguos { + get { + return SR.GetString ("RelationshipToEndIsAmbiguos"); + } + } + + public static string ResultingExpressionTypeCannotBeNull { + get { + return SR.GetString ("ResultingExpressionTypeCannotBeNull"); + } + } + + public static string RightSetExpressionArgsMustBeCollection { + get { + return SR.GetString ("RightSetExpressionArgsMustBeCollection"); + } + } + + public static string RowCtorElementCannotBeNull { + get { + return SR.GetString ("RowCtorElementCannotBeNull"); + } + } + + public static string RowTypeWithoutProperty { + get { + return SR.GetString ("RowTypeWithoutProperty"); + } + } + + public static string SelectDistinctMustBeEqualComparable { + get { + return SR.GetString ("SelectDistinctMustBeEqualComparable"); + } + } + + public static string SourceUriUnknown { + get { + return SR.GetString ("SourceUriUnknown"); + } + } + + public static string Spatial_GeographyValueNotCompatibleWithSpatialServices { + get { + return SR.GetString ("Spatial_GeographyValueNotCompatibleWithSpatialServices"); + } + } + + public static string Spatial_GeometryValueNotCompatibleWithSpatialServices { + get { + return SR.GetString ("Spatial_GeometryValueNotCompatibleWithSpatialServices"); + } + } + + public static string Spatial_ProviderValueNotCompatibleWithSpatialServices { + get { + return SR.GetString ("Spatial_ProviderValueNotCompatibleWithSpatialServices"); + } + } + + public static string Spatial_WellKnownGeographyValueNotValid { + get { + return SR.GetString ("Spatial_WellKnownGeographyValueNotValid"); + } + } + + public static string Spatial_WellKnownGeometryValueNotValid { + get { + return SR.GetString ("Spatial_WellKnownGeometryValueNotValid"); + } + } + + public static string Spatial_WellKnownValueSerializationPropertyNotDirectlySettable { + get { + return SR.GetString ("Spatial_WellKnownValueSerializationPropertyNotDirectlySettable"); + } + } + + public static string SpatialWithUseStrongSpatialTypesFalse { + get { + return SR.GetString ("SpatialWithUseStrongSpatialTypesFalse"); + } + } + + public static string SqlGen_ApplyNotSupportedOnSql8 { + get { + return SR.GetString ("SqlGen_ApplyNotSupportedOnSql8"); + } + } + + public static string SqlGen_NiladicFunctionsCannotHaveParameters { + get { + return SR.GetString ("SqlGen_NiladicFunctionsCannotHaveParameters"); + } + } + + public static string SqlGen_ParameterForLimitNotSupportedOnSql8 { + get { + return SR.GetString ("SqlGen_ParameterForLimitNotSupportedOnSql8"); + } + } + + public static string SqlGen_ParameterForSkipNotSupportedOnSql8 { + get { + return SR.GetString ("SqlGen_ParameterForSkipNotSupportedOnSql8"); + } + } + + public static string SqlProvider_CredentialsMissingForMasterConnection { + get { + return SR.GetString ("SqlProvider_CredentialsMissingForMasterConnection"); + } + } + + public static string SqlProvider_DdlGeneration_CannotDeleteDatabaseNoInitialCatalog { + get { + return SR.GetString ("SqlProvider_DdlGeneration_CannotDeleteDatabaseNoInitialCatalog"); + } + } + + public static string SqlProvider_DdlGeneration_CannotTellIfDatabaseExists { + get { + return SR.GetString ("SqlProvider_DdlGeneration_CannotTellIfDatabaseExists"); + } + } + + public static string SqlProvider_DdlGeneration_MissingInitialCatalog { + get { + return SR.GetString ("SqlProvider_DdlGeneration_MissingInitialCatalog"); + } + } + + public static string SqlProvider_GeographyValueNotSqlCompatible { + get { + return SR.GetString ("SqlProvider_GeographyValueNotSqlCompatible"); + } + } + + public static string SqlProvider_GeometryValueNotSqlCompatible { + get { + return SR.GetString ("SqlProvider_GeometryValueNotSqlCompatible"); + } + } + + public static string SqlProvider_IncompleteCreateDatabase { + get { + return SR.GetString ("SqlProvider_IncompleteCreateDatabase"); + } + } + + public static string SqlProvider_IncompleteCreateDatabaseAggregate { + get { + return SR.GetString ("SqlProvider_IncompleteCreateDatabaseAggregate"); + } + } + + public static string SqlProvider_Sql2008RequiredForSpatial { + get { + return SR.GetString ("SqlProvider_Sql2008RequiredForSpatial"); + } + } + + public static string SqlProvider_SqlTypesAssemblyNotFound { + get { + return SR.GetString ("SqlProvider_SqlTypesAssemblyNotFound"); + } + } + + public static string SqlSpatialservices_CouldNotCreateWellKnownGeographyValueNoSrid { + get { + return SR.GetString ("SqlSpatialservices_CouldNotCreateWellKnownGeographyValueNoSrid"); + } + } + + public static string SqlSpatialservices_CouldNotCreateWellKnownGeographyValueNoWkbOrWkt { + get { + return SR.GetString ("SqlSpatialservices_CouldNotCreateWellKnownGeographyValueNoWkbOrWkt"); + } + } + + public static string SqlSpatialservices_CouldNotCreateWellKnownGeometryValueNoSrid { + get { + return SR.GetString ("SqlSpatialservices_CouldNotCreateWellKnownGeometryValueNoSrid"); + } + } + + public static string SqlSpatialservices_CouldNotCreateWellKnownGeometryValueNoWkbOrWkt { + get { + return SR.GetString ("SqlSpatialservices_CouldNotCreateWellKnownGeometryValueNoWkbOrWkt"); + } + } + + public static string StackOverflowInParser { + get { + return SR.GetString ("StackOverflowInParser"); + } + } + + public static string TopAndLimitCannotCoexist { + get { + return SR.GetString ("TopAndLimitCannotCoexist"); + } + } + + public static string TopAndSkipCannotCoexist { + get { + return SR.GetString ("TopAndSkipCannotCoexist"); + } + } + + public static string TVFReturnTypeRowHasNonScalarProperty { + get { + return SR.GetString ("TVFReturnTypeRowHasNonScalarProperty"); + } + } + + public static string TypeArgumentIsNotValid { + get { + return SR.GetString ("TypeArgumentIsNotValid"); + } + } + + public static string TypeArgumentMustBeLiteral { + get { + return SR.GetString ("TypeArgumentMustBeLiteral"); + } + } + + public static string TypeDeclaredAsAttributeAndElement { + get { + return SR.GetString ("TypeDeclaredAsAttributeAndElement"); + } + } + + public static string TypeMustBeDeclared { + get { + return SR.GetString ("TypeMustBeDeclared"); + } + } + + public static string TypeMustBeInheritableType { + get { + return SR.GetString ("TypeMustBeInheritableType"); + } + } + + public static string UnableToDetermineApplicationContext { + get { + return SR.GetString ("UnableToDetermineApplicationContext"); + } + } + + public static string UnableToDetermineStoreVersion { + get { + return SR.GetString ("UnableToDetermineStoreVersion"); + } + } + + public static string UnableToLoadResource { + get { + return SR.GetString ("UnableToLoadResource"); + } + } + + public static string UnknownAstCommandExpression { + get { + return SR.GetString ("UnknownAstCommandExpression"); + } + } + + public static string UnknownAstExpressionType { + get { + return SR.GetString ("UnknownAstExpressionType"); + } + } + + public static string UnknownBuiltInAstExpressionType { + get { + return SR.GetString ("UnknownBuiltInAstExpressionType"); + } + } + + public static string Update_AmbiguousServerGenIdentifier { + get { + return SR.GetString ("Update_AmbiguousServerGenIdentifier"); + } + } + + public static string Update_CircularRelationships { + get { + return SR.GetString ("Update_CircularRelationships"); + } + } + + public static string Update_ConstraintCycle { + get { + return SR.GetString ("Update_ConstraintCycle"); + } + } + + public static string Update_DuplicateKeys { + get { + return SR.GetString ("Update_DuplicateKeys"); + } + } + + public static string Update_ErrorLoadingRecord { + get { + return SR.GetString ("Update_ErrorLoadingRecord"); + } + } + + public static string Update_GeneralExecutionException { + get { + return SR.GetString ("Update_GeneralExecutionException"); + } + } + + public static string Update_InvalidChanges { + get { + return SR.GetString ("Update_InvalidChanges"); + } + } + + public static string Update_ReferentialConstraintIntegrityViolation { + get { + return SR.GetString ("Update_ReferentialConstraintIntegrityViolation"); + } + } + + public static string Update_WorkspaceMismatch { + get { + return SR.GetString ("Update_WorkspaceMismatch"); + } + } + + public static string Validator_BaseTypeHasMemberOfSameName { + get { + return SR.GetString ("Validator_BaseTypeHasMemberOfSameName"); + } + } + + public static string Validator_CollectionHasNoTypeUsage { + get { + return SR.GetString ("Validator_CollectionHasNoTypeUsage"); + } + } + + public static string Validator_CollectionTypesCannotHaveBaseType { + get { + return SR.GetString ("Validator_CollectionTypesCannotHaveBaseType"); + } + } + + public static string Validator_EmptyIdentity { + get { + return SR.GetString ("Validator_EmptyIdentity"); + } + } + + public static string Validator_FacetHasNoName { + get { + return SR.GetString ("Validator_FacetHasNoName"); + } + } + + public static string Validator_FacetTypeIsNull { + get { + return SR.GetString ("Validator_FacetTypeIsNull"); + } + } + + public static string Validator_ItemAttributeHasNullTypeUsage { + get { + return SR.GetString ("Validator_ItemAttributeHasNullTypeUsage"); + } + } + + public static string Validator_MemberHasNoName { + get { + return SR.GetString ("Validator_MemberHasNoName"); + } + } + + public static string Validator_MemberHasNullDeclaringType { + get { + return SR.GetString ("Validator_MemberHasNullDeclaringType"); + } + } + + public static string Validator_MemberHasNullTypeUsage { + get { + return SR.GetString ("Validator_MemberHasNullTypeUsage"); + } + } + + public static string Validator_MetadataPropertyHasNoName { + get { + return SR.GetString ("Validator_MetadataPropertyHasNoName"); + } + } + + public static string Validator_OSpace_Convention_NonMatchingUnderlyingTypes { + get { + return SR.GetString ("Validator_OSpace_Convention_NonMatchingUnderlyingTypes"); + } + } + + public static string Validator_RefTypeHasNullEntityType { + get { + return SR.GetString ("Validator_RefTypeHasNullEntityType"); + } + } + + public static string Validator_RefTypesCannotHaveBaseType { + get { + return SR.GetString ("Validator_RefTypesCannotHaveBaseType"); + } + } + + public static string Validator_TypeHasNoName { + get { + return SR.GetString ("Validator_TypeHasNoName"); + } + } + + public static string Validator_TypeHasNoNamespace { + get { + return SR.GetString ("Validator_TypeHasNoNamespace"); + } + } + + public static string Validator_TypeUsageHasNullEdmType { + get { + return SR.GetString ("Validator_TypeUsageHasNullEdmType"); + } + } + + public static string ViewGen_AND { + get { + return SR.GetString ("ViewGen_AND"); + } + } + + public static string ViewGen_CommaBlank { + get { + return SR.GetString ("ViewGen_CommaBlank"); + } + } + + public static string ViewGen_Entities { + get { + return SR.GetString ("ViewGen_Entities"); + } + } + + public static string ViewGen_EntityInstanceToken { + get { + return SR.GetString ("ViewGen_EntityInstanceToken"); + } + } + + public static string ViewGen_Error { + get { + return SR.GetString ("ViewGen_Error"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Disj_Eq { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Disj_Eq"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Disj_Subs { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Disj_Subs"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Disj_Subs_Ref { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Disj_Subs_Ref"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Disj_Unk { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Disj_Unk"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Eq_Disj { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Eq_Disj"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Eq_Subs { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Eq_Subs"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Eq_Subs_Ref { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Eq_Subs_Ref"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Eq_Unk { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Eq_Unk"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Eq_Unk_Association { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Eq_Unk_Association"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Sub_Disj { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Sub_Disj"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Sub_Eq { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Sub_Eq"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Sub_Eq_Ref { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Sub_Eq_Ref"); + } + } + + public static string Viewgen_ErrorPattern_Partition_Sub_Unk { + get { + return SR.GetString ("Viewgen_ErrorPattern_Partition_Sub_Unk"); + } + } + + public static string ViewGen_Extent { + get { + return SR.GetString ("ViewGen_Extent"); + } + } + + public static string Viewgen_NoJoinKeyOrFK { + get { + return SR.GetString ("Viewgen_NoJoinKeyOrFK"); + } + } + + public static string ViewGen_NotNull { + get { + return SR.GetString ("ViewGen_NotNull"); + } + } + + public static string ViewGen_Null { + get { + return SR.GetString ("ViewGen_Null"); + } + } + + public static string ViewGen_Tuples { + get { + return SR.GetString ("ViewGen_Tuples"); + } + } + + public static string WildcardEnumeratorReturnedNull { + get { + return SR.GetString ("WildcardEnumeratorReturnedNull"); + } + } + } +} \ No newline at end of file diff --git a/mcs/class/System.Data.Entity/System.Data.Entity.dll.sources b/mcs/class/System.Data.Entity/System.Data.Entity.dll.sources new file mode 100644 index 00000000000..32c55773a57 --- /dev/null +++ b/mcs/class/System.Data.Entity/System.Data.Entity.dll.sources @@ -0,0 +1,725 @@ +Assembly/AssemblyInfo.cs +../../build/common/Consts.cs +../../build/common/SR.cs +EntityRes.cs +EntityResCategoryAttribute.cs +EntityResDescriptionAttribute.cs +Error.cs +Strings.cs + +../../../external/referencesource/System.Data.Entity/misc/HResults.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/AbstractExpressions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Aggregates.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicCommandTreeVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/BasicExpressionVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbCommandTree.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbDeleteCommandTree.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbExpressionVisitor_TResultType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbFunctionCommandTree.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbInsertCommandTree.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbLambda.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationClause.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbModificationCommandTree.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbQueryCommandTree.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbSetClause.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DbUpdateCommandTree.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/DefaultExpressionVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBindings.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/DbExpressionBuilder.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/EdmFunctions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/ArgumentValidation.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Internal/EnumerableValidator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Row.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ExpressionBuilder/Spatial/SpatialEdmFunctions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/DbExpressionRules.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionCopier.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionDumper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionKeyGen.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionList.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ExpressionPrinter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ParameterRetriever.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/PatternMatchRules.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/Validator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/ViewSimplifier.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/Internal/XmlExpressionDumper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/OperatorExpressions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/RelationalExpressions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/CommandTrees/ValueExpressions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/DataRecord.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/DataRecordInfo.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/DbCommandDefinition.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/DbProviderManifest.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/DbProviderServices.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/DbXmlEnabledProviderManifest.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntityRecordInfo.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AliasedExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/AstNode.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/BuiltInExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CaseExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Command.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ConstructorExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/CreateRefExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/DotExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/FunctionDefinition.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupAggregateExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/GroupPartitionExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Identifier.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/Literal.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/MethodExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NamespaceImport.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/NavigationExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/ParenExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryParameter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/QueryStatement.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/RefExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/AST/TypeDefinition.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlErrorHelper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlLexerHelpers.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParser.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlParserHelpers.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/CqlQuery.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/EntitySqlParser.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/FunctionOverloadResolver.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParseResult.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/ParserOptions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticAnalyzer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/SemanticResolver.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/StaticContext.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntitySql/TypeResolver.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/EntityUtil.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/FieldMetadata.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/FieldNameLookup.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/DbTypeMap.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ColumnMapKeyBuilder.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CompensatingCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Coordinator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorFactory.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/CoordinatorScratchpad.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordState.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateFactory.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/RecordStateScratchpad.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Shaper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/ShaperFactory.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Translator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/Materialization/Util.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Internal/MultipartIdentifier.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheEntry.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/QueryCache/CompiledQueryCacheKey.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntityClientCacheKey.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/QueryCache/EntitySqlQueryCacheKey.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/QueryCache/LinqQueryCacheKey.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheEntry.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheKey.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/QueryCache/QueryCacheManager.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/QueryCache/ShaperFactoryQueryCacheKey.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/AliasGenerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/BoolExpr.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Clause.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/ConversionContext.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Converter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/DomainConstraint.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/IdentifierService.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/KnowledgeBase.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Literal.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/NegationPusher.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Sentence.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Simplifier.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Solver.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Vertex.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Boolean/Visitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/ByValueEqualityComparer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/CommandHelper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/DisposableCollectionWrapper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Helpers.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/InternalBase.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/KeyToListMap.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Memoizer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/MetadataHelper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/ModifiableIteratorCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Pair.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Set.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/Singleton.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/StringUtil.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/ThreadSafeList.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/TrailingSpaceComparer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Common/Utils/TreePrinter.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/DbConnectionOptions.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterCollectionHelper.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/DbParameterHelper.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/EntityAdapter.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommand.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/EntityCommandDefinition.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnection.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/EntityConnectionStringBuilder.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/EntityDataReader.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameter.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/EntityParameterCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderFactory.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/EntityProviderServices.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/EntityTransaction.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityClient/NameValuePair.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityCommandCompilationException.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityCommandExecutionException.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityException.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityKey.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Action.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/BooleanFacetDescriptionElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ByteFacetDescriptionElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/CollectionKind.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/CollectionTypeElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ConcurrencyMode.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Documentation.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainer.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSet.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerAssociationSetEnd.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySet.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerEntitySetDefiningQuery.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSet.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityContainerRelationshipSetEnd.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/EntityKeyElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ErrorCode.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetDescriptionElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FacetEnabledSchemaElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FilteredSchemaElementLookUpTable.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Function.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionCommandText.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/FunctionImportElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IntegerFacetDescriptionElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IRelationship.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IRelationshipEnd.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ISchemaElementLookUpTable.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ItemType.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/KeyProperty.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunction.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ModelFunctionTypeElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/NavigationProperty.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/OnOperation.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Operation.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Parameter.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/PrimitiveSchema.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Property.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceSchema.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferenceTypeElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraint.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReferentialConstraintRoleElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Relationship.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEnd.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RelationshipEndCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnType.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ReturnValue.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypeElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/RowTypePropertyElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ScalarType.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Schema.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaComplexType.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaDataModelOption.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTable.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaElementLookUpTableEnumerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumMember.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaEnumType.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaLookupTable.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaManager.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaType.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SridFacetDescriptionElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StoreGeneratedPattern.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredProperty.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StructuredType.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TextElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeModifier.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeRefElement.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeUsageBuilder.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Utils.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ValidationHelper.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/XmlSchemaResource.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntitySqlException.cs +../../../external/referencesource/System.Data.Entity/System/Data/EntityState.cs +../../../external/referencesource/System.Data.Entity/System/Data/IEntityAdapter.cs +../../../external/referencesource/System.Data.Entity/System/Data/IEntityStateEntry.cs +../../../external/referencesource/System.Data.Entity/System/Data/IEntityStateManager.cs +../../../external/referencesource/System.Data.Entity/System/Data/IExtendedDataRecord.cs +../../../external/referencesource/System.Data.Entity/System/Data/InternalMappingException.cs +../../../external/referencesource/System.Data.Entity/System/Data/InvalidCommandTreeException.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/BaseMetadataMappingVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/DefaultObjectMappingItemCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewContainer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/EntityViewGenerationAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMapping.ReturnTypeRenameMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingComposable.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/FunctionImportMappingNonComposable.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Mapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/MappingItemCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/MetadataMappingHasherVisitor.HashSourceBuilder.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ObjectAssociationEndMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ObjectComplexPropertyMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ObjectMemberMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ObjectMslConstructs.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ObjectNavigationPropertyMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ObjectPropertyMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ObjectTypeMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationSetMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageAssociationTypeMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexPropertyMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageComplexTypeMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageConditionPropertyMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageEndPropertyMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityContainerMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntitySetMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageEntityTypeMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingErrorCode.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingFragment.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemCollection.ViewDictionary.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingItemLoader.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageModificationFunctionMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMslConstructs.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StoragePropertyMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageScalarPropertyMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageSetMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/StorageTypeMapping.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/AssociationSetMetadata.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ChangeNode.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/CompositeKey.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/DynamicUpdateCommand.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractedStateEntry.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ExtractorMetadata.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionMappingTranslator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/FunctionUpdateCommand.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Graph.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/KeyManager.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.Evaluator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.ExtentPlaceholderCreator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.JoinPredicateVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/Propagator.JoinPropagator.SubstitutingCloneVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/PropagatorFlags.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/PropagatorResult.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RecordConverter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/RelationshipConstraintValidator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/SourceInterpreter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/TableChangeProcessor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UndirectedGraph.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommand.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCommandOrderer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateCompiler.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateExpressionVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/UpdateTranslator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/ViewLoader.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/BasicViewGenerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellCreator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellPartitioner.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CellTreeSimplifier.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ConfigViewGenerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/AliasedSlot.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/BooleanProjectedSlot.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CaseCqlBlock.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlBlock.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlIdentifiers.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/CqlWriter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/ExtentCqlBlock.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/JoinCqlBlock.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/SlotInfo.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGeneration/UnionCqlBlock.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/CqlGenerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/DiscriminatorMap.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/GeneratedView.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQuery.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryKB.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/FragmentQueryProcessor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/QueryRewriter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingPass.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingProcessor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingSimplifier.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RewritingValidator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/RoleBoolean.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/QueryRewriting/Tile.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpression.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolExpressionVisitors.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/BoolLiteral.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatement.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CaseStatementProjectedSlot.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Cell.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellIdBoolean.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellLabel.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellQuery.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNode.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeNodeVisitors.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeOpType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Constant.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ConstantProjectedSlot.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/Domain.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ErrorLog.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeafCellTreeNode.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/LeftCellWrapper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberDomainMap.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberMaps.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberPath.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectedSlot.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberProjectionIndex.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/MemberRestriction.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/NegatedConstant.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/OpCellTreeNode.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ProjectedSlot.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/QualifiedCellIdBoolean.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarConstant.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/ScalarRestriction.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeConstant.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/TypeRestriction.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/WithStatement.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExceptionHelpers.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ExternalCalls.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ViewGenErrorCode.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicCellRelation.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/BasicKeyConstraint.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/CellRelation.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ConstraintBase.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ErrorPatternMatcher.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ExtentKey.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ForeignConstraint.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/KeyConstraint.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/SchemaConstraints.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellRelation.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewCellSlot.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ViewKeyConstraint.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenContext.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewgenGatekeeper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/ViewGenResults.cs +../../../external/referencesource/System.Data.Entity/System/Data/Mapping/ViewValidator.cs +../../../external/referencesource/System.Data.Entity/System/Data/MappingException.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/AspProxy.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/CacheForPrimitiveTypes.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ClrPerspective.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Converter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/CustomAssemblyResolver.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/DataSpace.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/DefaultAssemblyResolver.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationEndMember.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSet.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationSetEnd.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AssociationType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AttributeKind.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/BuiltInKind.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/CollectionType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ComplexType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Documentation.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmConstants.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmFunction.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmMember.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmProperty.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EdmType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityContainer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySet.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBase.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntitySetBaseCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EntityTypeBase.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumMember.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/EnumType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Facet.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetDescription.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValueContainer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FacetValues.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FilteredReadOnlyMetadataCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/FunctionParameter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/GlobalItem.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ItemCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/LightweightCodeGenerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MemberCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataItem_Static.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataProperty.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/MetadataPropertyvalue.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationProperty.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/NavigationPropertyAccessor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/OperationAction.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ParameterMode.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/PrimitiveType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/PrimitiveTypeKind.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/ClrProviderManifest.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifest.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestFunctionBuilder.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/Provider/EdmProviderManifestSpatialFunctions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReadOnlyMetadataCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ReferentialConstraint.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RefType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipEndMember.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipMultiplicity.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipSet.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RowType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLink.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SafeLinkCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/SimpleType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/StructuralType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/TypeUsage.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/util.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/EdmError.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemCollection.OcAssemblyCache.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/EdmItemError.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/EdmSchemaError.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/EdmSchemaErrorSeverity.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/EdmValidator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Helper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/MappingMetadataHelper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactAssemblyResolver.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoader.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderComposite.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeFile.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderCompositeResource.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderFile.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderResource.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactLoaderXmlReaderWrapper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataCache.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataWorkspace.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ModelPerspective.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectHelper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectItemCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCache.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/AssemblyCacheEntry.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ImmutableAssemblyCacheEntry.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssembliesSet.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/KnownAssemblyEntry.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LoadMessageLogger.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/LockedAssemblyCache.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MetadataAssemblyHelper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/MutableAssemblyCacheEntry.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAssemblyLoader.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemAttributeAssemblyLoader.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemCachedAssemblyLoader.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemConventionAssemblyLoader.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemLoadingSessionData.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ObjectLayer/ObjectItemNoOpAssemblyLoader.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/ParameterTypeSemantics.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/Perspective.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/StoreItemCollection.Loader.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/TargetPerspective.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/TypeHelpers.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/TypeSemantics.cs +../../../external/referencesource/System.Data.Entity/System/Data/Metadata/XmlConstants.cs +../../../external/referencesource/System.Data.Entity/System/Data/MetadataException.cs +../../../external/referencesource/System.Data.Entity/System/Data/ObjectNotFoundException.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/AdditionalEntityFunctions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/CompiledQuery.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/ComplexObject.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexPropertyAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmComplexTypeAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEntityTypeAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmEnumTypeAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmFunctionAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmPropertyAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipNavigationPropertyAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmRelationshipRoleAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmScalarPropertyAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmSchemaAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EdmTypeAttribute.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityObject.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/EntityReference_TResultType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityChangeTracker.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithChangeTracker.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithKey.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithRelationships.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IRelatedEnd.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IRelationshipFixer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelatedEnd.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipFixer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipKind.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipManager.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipNavigation.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/StructuralObject.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/DataRecordObjectView.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/BindingContext.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/CompiledELinqQueryState.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ELinqQueryState.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/EntityExpressionVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionConverter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ExpressionVisitorHelpers.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Funcletizer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/InitializerFacet.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/LinqExpressionNormalizer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/MethodCallTranslator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ObjectQueryProvider.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/OrderByLifter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/ReflectionUtil.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialMethodCallTranslator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/SpatialPropertyTranslator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/Translator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ELinq/TypeSystem.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/EntityEntry.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/EntityFunctions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/FieldDescriptor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/BaseEntityWrapper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/ComplexTypeMaterializer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyFactory.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityProxyTypeInfo.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryBuilder.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntitySqlQueryState.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWithChangeTrackerStrategy.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWithKeyStrategy.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/EntityWrapperFactory.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/ForeignKeyFactory.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/IChangeTrackingStrategy.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/IEntityKeyStrategy.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/IEntityWrapper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/IPropertyAccessorStrategy.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/LazyLoadBehavior.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/LightweightEntityWrapper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/NullEntityWrapper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectFullSpanRewriter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryExecutionPlan.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectQueryState.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/ObjectSpanRewriter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/PocoEntityKeyStrategy.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/PocoPropertyAccessorStrategy.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/SnapshotChangeTrackingStrategy.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Internal/TransactionManager.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/IObjectSet.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/IObjectView.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/IObjectViewData.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/MergeOption.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/NextResultGenerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectContext.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectMaterializedEventArgs.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectParameterCollection.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_EntitySqlExtensions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectQuery_TResultType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectResult_TResultType.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectSet.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntry.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryBaseUpdatableDataRecord.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbDataRecord.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryDbUpdatableDataRecord.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateEntryOriginalDbUpdatableDataRecord.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManager.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectStateManagerMetadata.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectView.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewEntityCollectionData.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewFactory.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewListener.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ObjectViewQueryResultData.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/ProxyDataContractResolver.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/RefreshMode.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/RelationshipEntry.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/RelationshipWrapper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/SaveOptions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/Span.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/SpanIndex.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlFunctions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Objects/SqlClient/SqlSpatialFunctions.cs +../../../external/referencesource/System.Data.Entity/System/Data/OptimisticConcurrencyException.cs +../../../external/referencesource/System.Data.Entity/System/Data/PropertyConstraintException.cs +../../../external/referencesource/System.Data.Entity/System/Data/ProviderIncompatibleException.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/AncillaryOps.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/BasicValidator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMap.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapCopier.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapFactory.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ColumnMapVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Command.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Dump.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ExplicitDiscriminatorMap.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Metadata.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeCounter.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/NodeInfo.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Nodes.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/OpCopier.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Ops.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/PhysicalOps.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelOps.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RelPropertyHelper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Rule.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RulePatternOps.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/RuleProcessor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/ScalarOps.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Vars.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/Visitors.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/AggregatePushdown.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CodeGen.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapProcessor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ColumnMapTranslator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CommandPlan.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ConstraintManager.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/CTreeGenerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ITreeGenerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinElimination.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/JoinGraph.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/KeyPullup.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NestPullup.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/NominalTypeEliminator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Normalizer.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompiler.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PlanCompilerUtil.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Predicate.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PreProcessor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProjectionPruner.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyPushdownHelper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/PropertyRef.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/ProviderCommandInfoUtils.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/StructuredTypeInfo.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/SubqueryTrackingVisitor.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TransformationRules.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeInfo.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/TypeUtils.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Validator.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarInfo.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRefManager.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/VarRemapper.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataReader.cs +../../../external/referencesource/System.Data.Entity/System/Data/Query/ResultAssembly/BridgeDataRecord.cs +../../../external/referencesource/System.Data.Entity/System/Data/Spatial/DbGeography.cs +../../../external/referencesource/System.Data.Entity/System/Data/Spatial/DbGeographyWellKnownValue.cs +../../../external/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometry.cs +../../../external/referencesource/System.Data.Entity/System/Data/Spatial/DbGeometryWellKnownValue.cs +../../../external/referencesource/System.Data.Entity/System/Data/Spatial/DbSpatialDataReader.cs +../../../external/referencesource/System.Data.Entity/System/Data/Spatial/DbSpatialServices.cs +../../../external/referencesource/System.Data.Entity/System/Data/Spatial/DefaultSpatialServices.cs +../../../external/referencesource/System.Data.Entity/System/Data/Spatial/ExtensionMethods.cs +../../../external/referencesource/System.Data.Entity/System/Data/Spatial/Internal/SpatialExceptions.cs +../../../external/referencesource/System.Data.Entity/System/Data/Spatial/SpatialHelpers.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/IDbSpatialValue.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/DmlSqlGenerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/ISqlFragment.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/JoinSymbol.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/OptionalColumn.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ConformanceChecker.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Sql8ExpressionRewriter.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlBuilder.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlFunctionCallHandler.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlGenerator.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectClauseBuilder.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlSelectStatement.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SqlWriter.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/Symbol.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolPair.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolTable.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/SymbolUsageManager.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/TopClause.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderManifest.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderServices.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlProviderUtilities.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialDataReader.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlSpatialServices.Generated.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlTypesAssembly.cs +../../../external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlVersion.cs +../../../external/referencesource/System.Data.Entity/System/Data/UpdateException.cs +../../../external/referencesource/System.Data.Entity/Util/AppSettings.cs diff --git a/mcs/class/System.Data.Linq/Makefile b/mcs/class/System.Data.Linq/Makefile index ff9dd8fd02b..6a8469e3e30 100755 --- a/mcs/class/System.Data.Linq/Makefile +++ b/mcs/class/System.Data.Linq/Makefile @@ -12,17 +12,12 @@ LIB_MCS_FLAGS = \ /resource:./src/DbLinq/Schema/Dbml/DbmlSchema.xsd,DbLinq.Schema.Dbml.DbmlSchema.xsd \ /d:MONO_STRICT /d:MONO_DEPLOY -warn:1 -ifeq (2.0, $(FRAMEWORK_VERSION)) -# This is a .NET 3.5 only assembly, but built during the 2.0 build -LIB_MCS_FLAGS += -d:NET_3_5 -nowarn:1720 -endif - TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) EXTRA_DISTFILES = src/DbLinq/Schema/Dbml/DbmlSchema.xsd # This is a .NET 3.5+ assembly -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-System.Data.Linq.dll NO_INSTALL = yes diff --git a/mcs/class/System.Data.Linq/System.Data.Linq-net_2_0.csproj b/mcs/class/System.Data.Linq/System.Data.Linq-net_2_0.csproj deleted file mode 100644 index 6893a2f0364..00000000000 --- a/mcs/class/System.Data.Linq/System.Data.Linq-net_2_0.csproj +++ /dev/null @@ -1,424 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - Library - 1699,1720 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Data.Linq - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;MONO_STRICT;MONO_DEPLOY;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;MONO_STRICT;MONO_DEPLOY;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - - - - - - DbLinq.Schema.Dbml.DbmlSchema.xsd - - - - diff --git a/mcs/class/System.Data.Linq/System.Data.Linq-net_4_0.csproj b/mcs/class/System.Data.Linq/System.Data.Linq-net_4_0.csproj deleted file mode 100644 index f99cbb0b199..00000000000 --- a/mcs/class/System.Data.Linq/System.Data.Linq-net_4_0.csproj +++ /dev/null @@ -1,424 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EB50CF5B-D17A-4BEF-96C4-874FB8E61ACE} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Data.Linq - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;MONO_STRICT;MONO_DEPLOY - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;MONO_STRICT;MONO_DEPLOY - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - - - - - - DbLinq.Schema.Dbml.DbmlSchema.xsd - - - - diff --git a/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_2_0.csproj b/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_2_0.csproj deleted file mode 100644 index eee1f763d67..00000000000 --- a/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_2_0.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {50082F92-4608-4F6F-B2BB-338DC1B3B591} - Library - 1699,1720 - bin\Debug\System.Data.Linq-tests-net_2_0 - True - False - - Properties - - - System.Data.Linq_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;MONO_STRICT;MONO_DEPLOY;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;MONO_STRICT;MONO_DEPLOY;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - System.Data.Linq\System.Data.Linq-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - - - - - - DbLinq.Schema.Dbml.DbmlSchema.xsd - - - - diff --git a/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_4_0.csproj b/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_4_0.csproj deleted file mode 100644 index cfa72265e87..00000000000 --- a/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_4_0.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {39EF1F73-CB1D-4DA1-9237-094F4D0C996F} - Library - 1699 - bin\Debug\System.Data.Linq-tests-net_4_0 - True - False - - Properties - - - System.Data.Linq_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;MONO_STRICT;MONO_DEPLOY - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;MONO_STRICT;MONO_DEPLOY - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {EB50CF5B-D17A-4BEF-96C4-874FB8E61ACE} - System.Data.Linq\System.Data.Linq-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - - - - - - DbLinq.Schema.Dbml.DbmlSchema.xsd - - - - diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_2_0.csproj b/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_2_0.csproj deleted file mode 100644 index 68cb0f812a5..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_2_0.csproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FB31E958-0E46-4D09-80B2-EF1245FDDB87} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Data.OracleClient - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - - - - - diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_4_0.csproj b/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_4_0.csproj deleted file mode 100644 index b7dfb029fe8..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_4_0.csproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C9C42FD1-45A1-4A55-B019-6D05E33857FD} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Data.OracleClient - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {C8124AA3-044F-4027-BD71-4810346B8FB6} - System.EnterpriseServices\System.EnterpriseServices-net_4_0 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - - - - - diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_2_0.csproj b/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_2_0.csproj deleted file mode 100644 index dc651ac2322..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_2_0.csproj +++ /dev/null @@ -1,221 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F5A01B66-E44D-4901-9607-DB7BF2D6B572} - Library - 1699,618 - bin\Debug\System.Data.OracleClient-tests-net_2_0 - True - False - - Properties - - - System.Data.OracleClient_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FB31E958-0E46-4D09-80B2-EF1245FDDB87} - System.Data.OracleClient\System.Data.OracleClient-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - - - - - diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_4_0.csproj b/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_4_0.csproj deleted file mode 100644 index 29fcbea6157..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_4_0.csproj +++ /dev/null @@ -1,221 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {13C57C82-415F-43B9-A7B7-8395C30281FA} - Library - 1699,618 - bin\Debug\System.Data.OracleClient-tests-net_4_0 - True - False - - Properties - - - System.Data.OracleClient_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {C9C42FD1-45A1-4A55-B019-6D05E33857FD} - System.Data.OracleClient\System.Data.OracleClient-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {C8124AA3-044F-4027-BD71-4810346B8FB6} - System.EnterpriseServices\System.EnterpriseServices-net_4_0 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - - - - - diff --git a/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_2_0.csproj b/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_2_0.csproj deleted file mode 100644 index 18b69588385..00000000000 --- a/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_2_0.csproj +++ /dev/null @@ -1,220 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2BD87584-B572-4E15-9941-93776CE3C901} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Data.Services.Client - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {80B8A117-6BB4-4646-8BE9-863A5C105437} - System.Xml.Linq\System.Xml.Linq-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {65F08514-3634-45C8-8EEB-6BAEA2EDC0C8} - WindowsBase\WindowsBase-net_2_0 - - - - - - - - System.Data.Services.Client.resources - - - - diff --git a/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_4_0.csproj b/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_4_0.csproj deleted file mode 100644 index a95aa62c6a1..00000000000 --- a/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_4_0.csproj +++ /dev/null @@ -1,222 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {133BEBD5-0BA9-498E-AD69-16CF10D20D56} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Data.Services.Client - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {9D657157-DCA0-45BF-BB67-1FFB3CD8823A} - System.Xml.Linq\System.Xml.Linq-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {166B91FA-332C-48D9-9A0E-EF02794507BC} - WindowsBase\WindowsBase-net_4_0 - - - - - - - - System.Data.Services.Client.resources - - - - diff --git a/mcs/class/System.Data.Services/System.Data.Services-net_2_0.csproj b/mcs/class/System.Data.Services/System.Data.Services-net_2_0.csproj deleted file mode 100644 index c40c38d7c57..00000000000 --- a/mcs/class/System.Data.Services/System.Data.Services-net_2_0.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {09A92F36-0617-4D47-95BB-17AAB6588793} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Data.Services - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {3C6EB10D-5929-4CB4-81F2-7984FCECCDAA} - System.ServiceModel.Web\System.ServiceModel.Web-net_2_0 - - - {2BD87584-B572-4E15-9941-93776CE3C901} - System.Data.Services.Client\System.Data.Services.Client-net_2_0 - - - - - - - diff --git a/mcs/class/System.Data.Services/System.Data.Services-net_4_0.csproj b/mcs/class/System.Data.Services/System.Data.Services-net_4_0.csproj deleted file mode 100644 index 613024f6c0c..00000000000 --- a/mcs/class/System.Data.Services/System.Data.Services-net_4_0.csproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B6154CE4-03B9-4544-BE33-499C965ECDCD} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Data.Services - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {CB54BC7B-F3CD-43DC-B983-3FFFF41D01E1} - System.ServiceModel\System.ServiceModel-net_4_0-1 - - - {3867C3D0-36C4-4CC1-A8E5-5D15631B35D4} - System.ServiceModel.Web\System.ServiceModel.Web-net_4_0 - - - {133BEBD5-0BA9-498E-AD69-16CF10D20D56} - System.Data.Services.Client\System.Data.Services.Client-net_4_0 - - - {1C9B4EFC-57D5-4DEE-9D2F-0B505824623F} - System.ServiceModel.Activation\System.ServiceModel.Activation-net_4_0 - - - - - - - diff --git a/mcs/class/System.Data.Services/System.Data.Services-tests-net_2_0.csproj b/mcs/class/System.Data.Services/System.Data.Services-tests-net_2_0.csproj deleted file mode 100644 index 4a2a04d3551..00000000000 --- a/mcs/class/System.Data.Services/System.Data.Services-tests-net_2_0.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E5666F81-4D04-454B-A208-25A90186E92C} - Library - 1699 - bin\Debug\System.Data.Services-tests-net_2_0 - True - False - - Properties - - - System.Data.Services_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {09A92F36-0617-4D47-95BB-17AAB6588793} - System.Data.Services\System.Data.Services-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/System.Data.Services/System.Data.Services-tests-net_4_0.csproj b/mcs/class/System.Data.Services/System.Data.Services-tests-net_4_0.csproj deleted file mode 100644 index 39e81d4c2fb..00000000000 --- a/mcs/class/System.Data.Services/System.Data.Services-tests-net_4_0.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3FA35AB4-2275-4C88-8739-C72670C193DF} - Library - 1699 - bin\Debug\System.Data.Services-tests-net_4_0 - True - False - - Properties - - - System.Data.Services_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {B6154CE4-03B9-4544-BE33-499C965ECDCD} - System.Data.Services\System.Data.Services-net_4_0 - - - {CB54BC7B-F3CD-43DC-B983-3FFFF41D01E1} - System.ServiceModel\System.ServiceModel-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/System.Data/Makefile b/mcs/class/System.Data/Makefile index 2fb0b08ecd5..59772888b4d 100644 --- a/mcs/class/System.Data/Makefile +++ b/mcs/class/System.Data/Makefile @@ -2,27 +2,13 @@ thisdir = class/System.Data SUBDIRS = include ../../build/rules.make -# I have *no idea* why I need to do this. - -ifeq ($(PROFILE),atomic) -system = System.dll -else -system = $(topdir)/class/lib/$(PROFILE)/System.dll -endif - -ifneq (1, $(FRAMEWORK_VERSION_MAJOR)) -OTHER_LIB_MCS_FLAGS = -r:System.Configuration.dll \ - -r:System.Transactions.dll -endif - LIBRARY = System.Data.dll + LIB_MCS_FLAGS = \ -nowarn:649 \ -unsafe \ - -r:$(corlib) \ - -r:$(system) \ - -r:System.Xml.dll \ - + -r:System \ + -r:System.Xml.dll MOBILE := $(filter monotouch monodroid xammac mobile mobile_static, $(PROFILE)) ifdef MOBILE @@ -33,7 +19,8 @@ else LIB_MCS_FLAGS += \ -r:System.EnterpriseServices.dll \ -r:Mono.Data.Tds.dll \ - $(OTHER_LIB_MCS_FLAGS) + -r:System.Configuration.dll \ + -r:System.Transactions.dll endif TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.Core.dll -r:Mono.Data.Sqlite.dll -nowarn:618,169,612,219,168 diff --git a/mcs/class/System.Data/System.Data-net_2_0.csproj b/mcs/class/System.Data/System.Data-net_2_0.csproj deleted file mode 100644 index fc6d5c4bb65..00000000000 --- a/mcs/class/System.Data/System.Data-net_2_0.csproj +++ /dev/null @@ -1,439 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - Library - 1699,649 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Data - v2.0 - 512 - - - true - full - 1699,649 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,649 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {C21CB6AB-7059-4FA5-A23C-84EA0B854BB7} - Mono.Data.Tds\Mono.Data.Tds-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - - - - - diff --git a/mcs/class/System.Data/System.Data-net_4_0.csproj b/mcs/class/System.Data/System.Data-net_4_0.csproj deleted file mode 100644 index 50b72c09021..00000000000 --- a/mcs/class/System.Data/System.Data-net_4_0.csproj +++ /dev/null @@ -1,439 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0ADBE502-5524-4312-81B0-8456328C367C} - Library - 1699,649 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - System.Data - v4.0 - 512 - - - true - full - 1699,649 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,649 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {C8124AA3-044F-4027-BD71-4810346B8FB6} - System.EnterpriseServices\System.EnterpriseServices-net_4_0 - - - {6ECC0DBC-E614-4ABD-811F-0DE92E8314EA} - Mono.Data.Tds\Mono.Data.Tds-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {03A0E889-9E62-423F-B65E-40416E021F1B} - System.Transactions\System.Transactions-net_4_0 - - - - - - - diff --git a/mcs/class/System.Data/System.Data-tests-net_2_0.csproj b/mcs/class/System.Data/System.Data-tests-net_2_0.csproj deleted file mode 100644 index cb4d133e21b..00000000000 --- a/mcs/class/System.Data/System.Data-tests-net_2_0.csproj +++ /dev/null @@ -1,239 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {98528310-9599-43E7-B342-C9686B861C6E} - Library - 1699,649,618,169,612,219,168 - bin\Debug\System.Data-tests-net_2_0 - True - False - true - Properties - - - System.Data_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,649,618,169,612,219,168 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,649,618,169,612,219,168 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {C21CB6AB-7059-4FA5-A23C-84EA0B854BB7} - Mono.Data.Tds\Mono.Data.Tds-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - False - Mono.Data.Sqlite.dll - False - - - - - - - diff --git a/mcs/class/System.Data/System.Data-tests-net_4_0.csproj b/mcs/class/System.Data/System.Data-tests-net_4_0.csproj deleted file mode 100644 index b74933373e1..00000000000 --- a/mcs/class/System.Data/System.Data-tests-net_4_0.csproj +++ /dev/null @@ -1,238 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2473906B-8FEB-467D-8AD6-A55552D604B1} - Library - 1699,649,618,169,612,219,168 - bin\Debug\System.Data-tests-net_4_0 - True - False - true - Properties - - - System.Data_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,649,618,169,612,219,168 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,649,618,169,612,219,168 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {C8124AA3-044F-4027-BD71-4810346B8FB6} - System.EnterpriseServices\System.EnterpriseServices-net_4_0 - - - {6ECC0DBC-E614-4ABD-811F-0DE92E8314EA} - Mono.Data.Tds\Mono.Data.Tds-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {03A0E889-9E62-423F-B65E-40416E021F1B} - System.Transactions\System.Transactions-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {7B3F5668-ED1F-48EB-9897-E6BE6A1C8CB3} - Mono.Data.Sqlite\Mono.Data.Sqlite-net_2_0 - - - - - - - diff --git a/mcs/class/System.Data/System.Data.Common/DbEnumerator.cs b/mcs/class/System.Data/System.Data.Common/DbEnumerator.cs index 2a6c0da4885..7cad139dc3d 100644 --- a/mcs/class/System.Data/System.Data.Common/DbEnumerator.cs +++ b/mcs/class/System.Data/System.Data.Common/DbEnumerator.cs @@ -43,7 +43,6 @@ namespace System.Data.Common { readonly IDataReader reader; readonly bool closeReader; readonly SchemaInfo [] schema; - readonly object [] values; #endregion // Fields @@ -58,7 +57,6 @@ namespace System.Data.Common { { this.reader = reader; this.closeReader = closeReader; - this.values = new object [reader.FieldCount]; this.schema = LoadSchema (reader); } @@ -67,8 +65,13 @@ namespace System.Data.Common { #region Properties public object Current { - get { + get { + // DbDataRecordImpl does not do copy of the array + // and MoveNext would overwrite any previously filled data + var values = new object [reader.FieldCount]; reader.GetValues (values); + + // TODO: Should not allocate on every property call return new DbDataRecordImpl (schema, values); } } diff --git a/mcs/class/System.Data/System.Data/DataView.cs b/mcs/class/System.Data/System.Data/DataView.cs index 102e4f950f0..c0f2369985d 100644 --- a/mcs/class/System.Data/System.Data/DataView.cs +++ b/mcs/class/System.Data/System.Data/DataView.cs @@ -14,6 +14,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.ComponentModel; using System.Reflection; using System.Data.Common; @@ -1081,14 +1082,14 @@ namespace System.Data ListSortDescriptionCollection IBindingListView.SortDescriptions { get { - ListSortDescriptionCollection col = new ListSortDescriptionCollection (); + var l = new List (); for (int i = 0; i < sortColumns.Length; ++i) { ListSortDescription ldesc = new ListSortDescription ( new DataColumnPropertyDescriptor (sortColumns [i]), sortOrder [i]); - ((IList) col).Add (ldesc); + l.Add (ldesc); } - return col; + return new ListSortDescriptionCollection (l.ToArray ()); } } diff --git a/mcs/class/System.Design/System.Design-net_2_0.csproj b/mcs/class/System.Design/System.Design-net_2_0.csproj deleted file mode 100644 index f146ad3bfe2..00000000000 --- a/mcs/class/System.Design/System.Design-net_2_0.csproj +++ /dev/null @@ -1,438 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D3F4E3E9-C9E8-43D4-9E6C-A4AD4433592C} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Design - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;DRAWING_DESIGN_DEP - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;DRAWING_DESIGN_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {43A23ADA-35D9-4A48-BCE5-C21C081C6676} - Accessibility\Accessibility-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - False - System.Drawing.Design.dll - False - - - - - - - diff --git a/mcs/class/System.Design/System.Design-net_4_0.csproj b/mcs/class/System.Design/System.Design-net_4_0.csproj deleted file mode 100644 index 1731a55d65f..00000000000 --- a/mcs/class/System.Design/System.Design-net_4_0.csproj +++ /dev/null @@ -1,437 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3F28EF87-A1A7-42CE-B985-DE1E6EB14B06} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Design - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;DRAWING_DESIGN_DEP - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;DRAWING_DESIGN_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {C385F6FA-0893-438F-AA08-32E08FF478AA} - System.Web\System.Web-net_4_0-1 - - - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Managed.Windows.Forms\System.Windows.Forms-net_4_0 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {0978E130-1E7B-4627-A9CC-7489DB17BFF1} - Accessibility\Accessibility-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {1A2E7A4A-050C-4F3E-9776-79E7E44B48BE} - System.Drawing.Design\System.Drawing.Design-net_2_0 - - - - - - - diff --git a/mcs/class/System.Design/System.Design-tests-net_2_0.csproj b/mcs/class/System.Design/System.Design-tests-net_2_0.csproj deleted file mode 100644 index a60dee768ac..00000000000 --- a/mcs/class/System.Design/System.Design-tests-net_2_0.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D963664C-F52A-43CB-987B-D5B9563FA779} - Library - 1699 - bin\Debug\System.Design-tests-net_2_0 - True - False - - Properties - - - System.Design_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {31BD6BF1-0C7A-4C0A-AB48-091F2EBB4AAC} - System.Design\System.Design-net_2_0-1 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.Design/System.Design-tests-net_4_0.csproj b/mcs/class/System.Design/System.Design-tests-net_4_0.csproj deleted file mode 100644 index 825b539a850..00000000000 --- a/mcs/class/System.Design/System.Design-tests-net_4_0.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {613A0DE1-16FD-4E19-A31B-6D4CBA651BDD} - Library - 1699 - bin\Debug\System.Design-tests-net_4_0 - True - False - - Properties - - - System.Design_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {7D002453-8C26-4B11-8A26-B19877B73BDC} - System.Design\System.Design-net_4_0-1 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Managed.Windows.Forms\System.Windows.Forms-net_4_0 - - - - - - - diff --git a/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_2_0.csproj b/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_2_0.csproj deleted file mode 100644 index 0af954ff7a4..00000000000 --- a/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_2_0.csproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {38D88F62-36F7-4E60-BE74-09C0D2EFD4A0} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.DirectoryServices.Protocols - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {390BE0FB-F60C-4E2C-8C52-A221087F1355} - System.DirectoryServices\System.DirectoryServices-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_4_0.csproj b/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_4_0.csproj deleted file mode 100644 index 69ea41e14aa..00000000000 --- a/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_4_0.csproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D0F57A87-9EFE-424B-802F-539A23F233C0} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.DirectoryServices.Protocols - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {83BB158B-955E-443A-A0D7-9E8DDC5B8075} - System.DirectoryServices\System.DirectoryServices-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices-net_2_0.csproj b/mcs/class/System.DirectoryServices/System.DirectoryServices-net_2_0.csproj deleted file mode 100644 index 7d203c9d9bb..00000000000 --- a/mcs/class/System.DirectoryServices/System.DirectoryServices-net_2_0.csproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {390BE0FB-F60C-4E2C-8C52-A221087F1355} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.DirectoryServices - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {30C57C43-3A84-4E9F-A889-53CAE3C634C4} - Novell.Directory.Ldap\Novell.Directory.Ldap-net_2_0 - - - - - - - diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_0.csproj b/mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_0.csproj deleted file mode 100644 index 9ce3a9f3c37..00000000000 --- a/mcs/class/System.DirectoryServices/System.DirectoryServices-net_4_0.csproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {83BB158B-955E-443A-A0D7-9E8DDC5B8075} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.DirectoryServices - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {D6DA2E60-D81F-42EC-991E-ED2FFBD5094D} - Novell.Directory.Ldap\Novell.Directory.Ldap-net_4_0 - - - - - - - diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_2_0.csproj b/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_2_0.csproj deleted file mode 100644 index ddbc31865cc..00000000000 --- a/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_2_0.csproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F179583B-C57D-4274-BCB0-CF8E90C639B0} - Library - 1699,618,219,169 - bin\Debug\System.DirectoryServices-tests-net_2_0 - True - False - - Properties - - - System.DirectoryServices_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {390BE0FB-F60C-4E2C-8C52-A221087F1355} - System.DirectoryServices\System.DirectoryServices-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {30C57C43-3A84-4E9F-A889-53CAE3C634C4} - Novell.Directory.Ldap\Novell.Directory.Ldap-net_2_0 - - - - - - - diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_4_0.csproj b/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_4_0.csproj deleted file mode 100644 index 1d60ed46be8..00000000000 --- a/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_4_0.csproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AD2E2906-EA78-4E0A-B0FA-093C929A0906} - Library - 1699,618,219,169 - bin\Debug\System.DirectoryServices-tests-net_4_0 - True - False - - Properties - - - System.DirectoryServices_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {83BB158B-955E-443A-A0D7-9E8DDC5B8075} - System.DirectoryServices\System.DirectoryServices-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {D6DA2E60-D81F-42EC-991E-ED2FFBD5094D} - Novell.Directory.Ldap\Novell.Directory.Ldap-net_4_0 - - - - - - - diff --git a/mcs/class/System.Drawing.Design/System.Drawing.Design-net_2_0.csproj b/mcs/class/System.Drawing.Design/System.Drawing.Design-net_2_0.csproj deleted file mode 100644 index 9405ca727d3..00000000000 --- a/mcs/class/System.Drawing.Design/System.Drawing.Design-net_2_0.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1A2E7A4A-050C-4F3E-9776-79E7E44B48BE} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Drawing.Design - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.Drawing.Design/System.Drawing.Design-net_4_0.csproj b/mcs/class/System.Drawing.Design/System.Drawing.Design-net_4_0.csproj deleted file mode 100644 index eff1356c3ce..00000000000 --- a/mcs/class/System.Drawing.Design/System.Drawing.Design-net_4_0.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {81FDD05B-E6D8-4667-B637-99DA7C1D7284} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Drawing.Design - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Managed.Windows.Forms\System.Windows.Forms-net_4_0 - - - - - - - diff --git a/mcs/class/System.Drawing/System.Drawing-net_2_0.csproj b/mcs/class/System.Drawing/System.Drawing-net_2_0.csproj deleted file mode 100644 index c8950313682..00000000000 --- a/mcs/class/System.Drawing/System.Drawing-net_2_0.csproj +++ /dev/null @@ -1,291 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Drawing - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - - Mono.ico - - - Information.ico - - - Error.ico - - - Warning.ico - - - Question.ico - - - Shield.ico - - - - diff --git a/mcs/class/System.Drawing/System.Drawing-net_4_0.csproj b/mcs/class/System.Drawing/System.Drawing-net_4_0.csproj deleted file mode 100644 index f3771196067..00000000000 --- a/mcs/class/System.Drawing/System.Drawing-net_4_0.csproj +++ /dev/null @@ -1,291 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - System.Drawing - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - - Mono.ico - - - Information.ico - - - Error.ico - - - Warning.ico - - - Question.ico - - - Shield.ico - - - - diff --git a/mcs/class/System.Drawing/System.Drawing-tests-net_2_0.csproj b/mcs/class/System.Drawing/System.Drawing-tests-net_2_0.csproj deleted file mode 100644 index 27c97746fac..00000000000 --- a/mcs/class/System.Drawing/System.Drawing-tests-net_2_0.csproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {34B64C48-9A07-4A68-8EE4-14471777CD34} - Library - 1699,618,219,169,1595 - bin\Debug\System.Drawing-tests-net_2_0 - True - False - true - Properties - - - System.Drawing_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169,1595 - false - DEBUG;TRACE;NET_1_1;NET_2_0;TEST - prompt - 4 - - - pdbonly - 1699,618,219,169,1595 - true - NET_1_1;NET_2_0;TEST - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - False - System.Runtime.Serialization.Formatters.Soap.dll - False - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - Mono.ico - - - Information.ico - - - Error.ico - - - Warning.ico - - - Question.ico - - - Shield.ico - - - indexed.png - - - - diff --git a/mcs/class/System.Drawing/System.Drawing-tests-net_4_0.csproj b/mcs/class/System.Drawing/System.Drawing-tests-net_4_0.csproj deleted file mode 100644 index 08630f8d4fe..00000000000 --- a/mcs/class/System.Drawing/System.Drawing-tests-net_4_0.csproj +++ /dev/null @@ -1,208 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6538F1EE-1176-406B-91D5-4482846B3C81} - Library - 1699,618,219,169,1595 - bin\Debug\System.Drawing-tests-net_4_0 - True - False - true - Properties - - - System.Drawing_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618,219,169,1595 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;TEST - prompt - 4 - - - pdbonly - 1699,618,219,169,1595 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;TEST - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - - Mono.ico - - - Information.ico - - - Error.ico - - - Warning.ico - - - Question.ico - - - Shield.ico - - - indexed.png - - - - diff --git a/mcs/class/System.Drawing/System.Drawing/RectangleConverter.cs b/mcs/class/System.Drawing/System.Drawing/RectangleConverter.cs index f2ee8afa20a..92b3c9f07ef 100644 --- a/mcs/class/System.Drawing/System.Drawing/RectangleConverter.cs +++ b/mcs/class/System.Drawing/System.Drawing/RectangleConverter.cs @@ -73,6 +73,8 @@ namespace System.Drawing { if (s == null) return base.ConvertFrom (context, culture, value); + if (culture == null) + culture = CultureInfo.CurrentCulture; string [] subs = s.Split (culture.TextInfo.ListSeparator.ToCharArray ()); Int32Converter converter = new Int32Converter (); diff --git a/mcs/class/System.Drawing/System.Drawing/SizeFConverter.cs b/mcs/class/System.Drawing/System.Drawing/SizeFConverter.cs index 5dcb8f6d774..2eda3ddbb6f 100644 --- a/mcs/class/System.Drawing/System.Drawing/SizeFConverter.cs +++ b/mcs/class/System.Drawing/System.Drawing/SizeFConverter.cs @@ -72,6 +72,8 @@ namespace System.Drawing if (s == null) return base.ConvertFrom (context, culture, value); + if (culture == null) + culture = CultureInfo.CurrentCulture; string[] subs = s.Split (culture.TextInfo.ListSeparator.ToCharArray ()); SingleConverter converter = new SingleConverter (); diff --git a/mcs/class/System.Dynamic/System.Dynamic-net_4_0.csproj b/mcs/class/System.Dynamic/System.Dynamic-net_4_0.csproj deleted file mode 100644 index 866cdd1fe64..00000000000 --- a/mcs/class/System.Dynamic/System.Dynamic-net_4_0.csproj +++ /dev/null @@ -1,138 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A97C0057-6A9B-4B55-8B78-0E3EF9F7855D} - Library - 1699,414,169 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - System.Dynamic - v4.0 - 512 - - - true - full - 1699,414,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;CODEPLEX_40 - prompt - 4 - - - pdbonly - 1699,414,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;CODEPLEX_40 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_2_0.csproj b/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_2_0.csproj deleted file mode 100644 index 8a2c4a5cd54..00000000000 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_2_0.csproj +++ /dev/null @@ -1,192 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {94E27660-C3DF-43D1-958A-94D68EF3131F} - Library - 1699,168,162 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.EnterpriseServices - v2.0 - 512 - - - true - full - 1699,168,162 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,168,162 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - - - - - diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_4_0.csproj b/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_4_0.csproj deleted file mode 100644 index 9c723e0bf42..00000000000 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_4_0.csproj +++ /dev/null @@ -1,192 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C8124AA3-044F-4027-BD71-4810346B8FB6} - Library - 1699,168,162 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.EnterpriseServices - v4.0 - 512 - - - true - full - 1699,168,162 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,168,162 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {03A0E889-9E62-423F-B65E-40416E021F1B} - System.Transactions\System.Transactions-net_4_0 - - - - - - - diff --git a/mcs/class/System.IO.Compression.FileSystem/ZipFile.cs b/mcs/class/System.IO.Compression.FileSystem/ZipFile.cs index eaa3b75230d..d08439bd87c 100644 --- a/mcs/class/System.IO.Compression.FileSystem/ZipFile.cs +++ b/mcs/class/System.IO.Compression.FileSystem/ZipFile.cs @@ -43,7 +43,7 @@ namespace System.IO.Compression CompressionLevel compressionLevel, bool includeBaseDirectory) { CreateFromDirectory (sourceDirectoryName, destinationArchiveFileName, - CompressionLevel.Fastest, includeBaseDirectory, Encoding.UTF8); + compressionLevel, includeBaseDirectory, Encoding.UTF8); } public static void CreateFromDirectory ( diff --git a/mcs/class/System.IdentityModel.Selectors/Makefile b/mcs/class/System.IdentityModel.Selectors/Makefile index d88fb810c4c..f9243edf7db 100755 --- a/mcs/class/System.IdentityModel.Selectors/Makefile +++ b/mcs/class/System.IdentityModel.Selectors/Makefile @@ -15,7 +15,7 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) EXTRA_DISTFILES = -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-System.IdentityModel.Selectors.dll NO_INSTALL = yes diff --git a/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_2_0.csproj b/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_2_0.csproj deleted file mode 100644 index a6cb6bf6314..00000000000 --- a/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_2_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7203476D-4107-4C91-9930-DEC5CCFE62C8} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.IdentityModel.Selectors - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {737EBB38-BBFD-40D8-99F1-1FBBD49AF1B6} - System.IdentityModel\System.IdentityModel-net_2_0 - - - - - - - diff --git a/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_4_0.csproj b/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_4_0.csproj deleted file mode 100644 index e159bb4faee..00000000000 --- a/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_4_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FCCADAA1-34B7-4F15-933A-1FAA4DAF9871} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.IdentityModel.Selectors - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {E15F571E-B653-4409-AF7C-F478DA81B959} - System.Security\System.Security-net_4_0 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {888E3381-24AB-4FA9-B973-FD683B0461D3} - System.IdentityModel\System.IdentityModel-net_4_0 - - - - - - - diff --git a/mcs/class/System.IdentityModel/Makefile b/mcs/class/System.IdentityModel/Makefile index 320f21c9dae..956c2a72ec3 100644 --- a/mcs/class/System.IdentityModel/Makefile +++ b/mcs/class/System.IdentityModel/Makefile @@ -26,7 +26,7 @@ EXTRA_DISTFILES = \ Test/Resources/test.pfx \ Test/Resources/test2.pfx -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-System.IdentityModel.dll NO_INSTALL = yes diff --git a/mcs/class/System.IdentityModel/System.IdentityModel-net_2_0.csproj b/mcs/class/System.IdentityModel/System.IdentityModel-net_2_0.csproj deleted file mode 100644 index 798580c4688..00000000000 --- a/mcs/class/System.IdentityModel/System.IdentityModel-net_2_0.csproj +++ /dev/null @@ -1,196 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {737EBB38-BBFD-40D8-99F1-1FBBD49AF1B6} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.IdentityModel - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - - - - - diff --git a/mcs/class/System.IdentityModel/System.IdentityModel-net_4_0.csproj b/mcs/class/System.IdentityModel/System.IdentityModel-net_4_0.csproj deleted file mode 100644 index 0f184728ed3..00000000000 --- a/mcs/class/System.IdentityModel/System.IdentityModel-net_4_0.csproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {888E3381-24AB-4FA9-B973-FD683B0461D3} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.IdentityModel - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {E15F571E-B653-4409-AF7C-F478DA81B959} - System.Security\System.Security-net_4_0 - - - {2AB66C1A-6094-4C45-AF9B-FA85F8D5E98A} - System.Web\System.Web-net_4_0-2 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Mono.Security\Mono.Security-net_4_0 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {3B707FB5-0AB3-472A-BB49-7598CF2607B0} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_0 - - - - - - - diff --git a/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_2_0.csproj b/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_2_0.csproj deleted file mode 100644 index 169cbad47c0..00000000000 --- a/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_2_0.csproj +++ /dev/null @@ -1,144 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5E8EA9D3-4EBC-48D6-8B6F-EAF579539518} - Library - 1699 - bin\Debug\System.IdentityModel-tests-net_2_0 - True - False - - Properties - - - System.IdentityModel_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {737EBB38-BBFD-40D8-99F1-1FBBD49AF1B6} - System.IdentityModel\System.IdentityModel-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - - - - - diff --git a/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_4_0.csproj b/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_4_0.csproj deleted file mode 100644 index deb18cdd698..00000000000 --- a/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_4_0.csproj +++ /dev/null @@ -1,148 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2372E56F-BB02-4D04-AE37-BADACCA41FB2} - Library - 1699 - bin\Debug\System.IdentityModel-tests-net_4_0 - True - False - - Properties - - - System.IdentityModel_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {888E3381-24AB-4FA9-B973-FD683B0461D3} - System.IdentityModel\System.IdentityModel-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {E15F571E-B653-4409-AF7C-F478DA81B959} - System.Security\System.Security-net_4_0 - - - {2AB66C1A-6094-4C45-AF9B-FA85F8D5E98A} - System.Web\System.Web-net_4_0-2 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Mono.Security\Mono.Security-net_4_0 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {3B707FB5-0AB3-472A-BB49-7598CF2607B0} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_0 - - - - - - - diff --git a/mcs/class/System.Json.Microsoft/System.Json.Microsoft-net_4_0.csproj b/mcs/class/System.Json.Microsoft/System.Json.Microsoft-net_4_0.csproj deleted file mode 100644 index 2878b9148ea..00000000000 --- a/mcs/class/System.Json.Microsoft/System.Json.Microsoft-net_4_0.csproj +++ /dev/null @@ -1,120 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2BCCABAA-2E46-449D-9F41-0478BBC6CB24} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Json.Microsoft - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;ASPNETMVC;FEATURE_DYNAMIC - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;ASPNETMVC;FEATURE_DYNAMIC - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {9ACDCB1D-5099-4091-A426-DBBA9B0976C2} - Microsoft.CSharp\Microsoft.CSharp-net_4_0 - - - - - - - - System.Json.Properties.Resources.resources - - - - diff --git a/mcs/class/System.Json.Microsoft/System.Json.Microsoft-tests-net_4_0.csproj b/mcs/class/System.Json.Microsoft/System.Json.Microsoft-tests-net_4_0.csproj deleted file mode 100644 index e17e2efadce..00000000000 --- a/mcs/class/System.Json.Microsoft/System.Json.Microsoft-tests-net_4_0.csproj +++ /dev/null @@ -1,106 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8FF31E68-4AF2-4CED-85AD-2F1C0D5F1277} - Library - 1699 - bin\Debug\System.Json.Microsoft-tests-net_4_0 - True - False - - Properties - - - System.Json.Microsoft_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;ASPNETMVC;FEATURE_DYNAMIC - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;ASPNETMVC;FEATURE_DYNAMIC - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {2BCCABAA-2E46-449D-9F41-0478BBC6CB24} - System.Json.Microsoft\System.Json.Microsoft-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {9ACDCB1D-5099-4091-A426-DBBA9B0976C2} - Microsoft.CSharp\Microsoft.CSharp-net_4_0 - - - - - - - - System.Json.Properties.Resources.resources - - - - diff --git a/mcs/class/System.Json/System.Json-net_2_0.csproj b/mcs/class/System.Json/System.Json-net_2_0.csproj deleted file mode 100644 index a822d6b6670..00000000000 --- a/mcs/class/System.Json/System.Json-net_2_0.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DB40BFDD-0EC2-4C14-B5F6-2D958099E8C6} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Json - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/System.Json/System.Json-net_4_0.csproj b/mcs/class/System.Json/System.Json-net_4_0.csproj deleted file mode 100644 index 080d04cfc4b..00000000000 --- a/mcs/class/System.Json/System.Json-net_4_0.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {21BAC36D-68CD-4F2E-9C11-FF439F2D212D} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Json - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/System.Json/System.Json-tests-net_2_0.csproj b/mcs/class/System.Json/System.Json-tests-net_2_0.csproj deleted file mode 100644 index 91a9a67b7d6..00000000000 --- a/mcs/class/System.Json/System.Json-tests-net_2_0.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D6326E54-3E22-4524-B506-4E9852235565} - Library - 1699 - bin\Debug\System.Json-tests-net_2_0 - True - False - - Properties - - - System.Json_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {DB40BFDD-0EC2-4C14-B5F6-2D958099E8C6} - System.Json\System.Json-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/System.Json/System.Json-tests-net_4_0.csproj b/mcs/class/System.Json/System.Json-tests-net_4_0.csproj deleted file mode 100644 index 60da552f2a4..00000000000 --- a/mcs/class/System.Json/System.Json-tests-net_4_0.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8A49FBB5-14E0-42C4-BAA2-4BC47B56AC2B} - Library - 1699 - bin\Debug\System.Json-tests-net_4_0 - True - False - - Properties - - - System.Json_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {21BAC36D-68CD-4F2E-9C11-FF439F2D212D} - System.Json\System.Json-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/System.Management/System.Management-net_2_0.csproj b/mcs/class/System.Management/System.Management-net_2_0.csproj deleted file mode 100644 index 8f1f7271c8a..00000000000 --- a/mcs/class/System.Management/System.Management-net_2_0.csproj +++ /dev/null @@ -1,154 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {47B40391-645F-42E1-AE88-206970D141D2} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Management - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {C8B650EA-042C-4352-8224-03F759A682C6} - System.Configuration.Install\System.Configuration.Install-net_2_0 - - - - - - - diff --git a/mcs/class/System.Management/System.Management-net_4_0.csproj b/mcs/class/System.Management/System.Management-net_4_0.csproj deleted file mode 100644 index 018472627a1..00000000000 --- a/mcs/class/System.Management/System.Management-net_4_0.csproj +++ /dev/null @@ -1,154 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C9E21BEA-8ADA-4736-973E-21DB934FD39B} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Management - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {29529439-51F1-4953-8A5D-7ED8F7EB8FDB} - System.Configuration.Install\System.Configuration.Install-net_4_0 - - - - - - - diff --git a/mcs/class/System.Messaging/System.Messaging-net_2_0.csproj b/mcs/class/System.Messaging/System.Messaging-net_2_0.csproj deleted file mode 100644 index 87b84c85dd3..00000000000 --- a/mcs/class/System.Messaging/System.Messaging-net_2_0.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Messaging - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {C8B650EA-042C-4352-8224-03F759A682C6} - System.Configuration.Install\System.Configuration.Install-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Mono.Messaging\Mono.Messaging-net_2_0 - - - - - - - - MessageQueue.resx - - - - diff --git a/mcs/class/System.Messaging/System.Messaging-net_4_0.csproj b/mcs/class/System.Messaging/System.Messaging-net_4_0.csproj deleted file mode 100644 index f4ee3d99ecb..00000000000 --- a/mcs/class/System.Messaging/System.Messaging-net_4_0.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5854BF27-FC35-44F5-BE59-580900694E32} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Messaging - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {29529439-51F1-4953-8A5D-7ED8F7EB8FDB} - System.Configuration.Install\System.Configuration.Install-net_4_0 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Managed.Windows.Forms\System.Windows.Forms-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {DD379954-9A73-4B1D-B314-D8EF1D4C5EB7} - Mono.Messaging\Mono.Messaging-net_4_0 - - - - - - - - MessageQueue.resx - - - - diff --git a/mcs/class/System.Messaging/System.Messaging-tests-net_2_0.csproj b/mcs/class/System.Messaging/System.Messaging-tests-net_2_0.csproj deleted file mode 100644 index 7b17d942109..00000000000 --- a/mcs/class/System.Messaging/System.Messaging-tests-net_2_0.csproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8D0EE23F-327F-4C6C-9DF3-6517D60F7EBB} - Library - 1699,618,219,169 - bin\Debug\System.Messaging-tests-net_2_0 - True - False - - Properties - - - System.Messaging_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - System.Messaging\System.Messaging-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {C8B650EA-042C-4352-8224-03F759A682C6} - System.Configuration.Install\System.Configuration.Install-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Mono.Messaging\Mono.Messaging-net_2_0 - - - False - nunit.mocks.dll - False - - - - - - - - MessageQueue.resx - - - - diff --git a/mcs/class/System.Messaging/System.Messaging-tests-net_4_0.csproj b/mcs/class/System.Messaging/System.Messaging-tests-net_4_0.csproj deleted file mode 100644 index ba9b7bcaf1b..00000000000 --- a/mcs/class/System.Messaging/System.Messaging-tests-net_4_0.csproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6EB65DB4-E8F3-479A-BF52-5AF80259E9FC} - Library - 1699,618,219,169 - bin\Debug\System.Messaging-tests-net_4_0 - True - False - - Properties - - - System.Messaging_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {5854BF27-FC35-44F5-BE59-580900694E32} - System.Messaging\System.Messaging-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {29529439-51F1-4953-8A5D-7ED8F7EB8FDB} - System.Configuration.Install\System.Configuration.Install-net_4_0 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Managed.Windows.Forms\System.Windows.Forms-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {DD379954-9A73-4B1D-B314-D8EF1D4C5EB7} - Mono.Messaging\Mono.Messaging-net_4_0 - - - False - nunit.mocks.dll - False - - - - - - - - MessageQueue.resx - - - - diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs index 9329ac5796f..f80e50e4143 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs @@ -257,6 +257,11 @@ namespace System.Net.Http.Headers continue; } + if (!Lexer.IsValidCharacter (ch) || ch == '*' || ch == '?' || ch == '%') { + sb.Append (Uri.HexEscape (ch)); + continue; + } + sb.Append (ch); } diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs index 622e36b0ec2..5bf97d0b96f 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs @@ -94,7 +94,7 @@ namespace System.Net.Http.Headers /*90*/ true, false, false, false, true, true, true, true, true, true, /*100*/ true, true, true, true, true, true, true, true, true, true, /*110*/ true, true, true, true, true, true, true, true, true, true, - /*120*/ true, true, true, false, true, false + /*120*/ true, true, true, false, true, false, true }; static readonly int last_token_char = token_chars.Length; @@ -193,13 +193,18 @@ namespace System.Net.Http.Headers // for (; i < input.Length; ++i) { char s = input[i]; - if (s > last_token_char || !token_chars[s]) + if (!IsValidCharacter (s)) return false; } return i > 0; } + public static bool IsValidCharacter (char input) + { + return input < last_token_char && token_chars[input]; + } + public void EatChar () { ++pos; @@ -292,18 +297,11 @@ namespace System.Net.Http.Headers // Quoted string start = pos - 1; while (pos < s.Length) { - ch = s[pos]; + ch = s [pos++]; if (ch == '"') { - ++pos; ttype = Token.Type.QuotedString; break; } - - // any OCTET except CTLs, but including LWS - if (ch < 32 || ch > 126) - break; - - ++pos; } break; @@ -312,13 +310,13 @@ namespace System.Net.Http.Headers ttype = Token.Type.OpenParens; break; default: - if (ch <= last_token_char && token_chars[ch]) { + if (ch < last_token_char && token_chars[ch]) { start = pos - 1; ttype = Token.Type.Token; while (pos < s.Length) { ch = s[pos]; - if (ch > last_token_char || !token_chars[ch]) { + if (ch >= last_token_char || !token_chars[ch]) { break; } diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs index b4de2a029cf..026171a4f7a 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs @@ -314,38 +314,38 @@ namespace System.Net.Http Volatile.Write (ref sentRequest, true); var wrequest = CreateWebRequest (request); + HttpWebResponse wresponse = null; - if (request.Content != null) { - var headers = wrequest.Headers; - foreach (var header in request.Content.Headers) { - foreach (var value in header.Value) { - headers.AddValue (header.Key, value); + try { + using (cancellationToken.Register (l => ((HttpWebRequest)l).Abort (), wrequest)) { + if (request.Content != null) { + var headers = wrequest.Headers; + foreach (var header in request.Content.Headers) { + foreach (var value in header.Value) { + headers.AddValue (header.Key, value); + } + } + + var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false); + await request.Content.CopyToAsync (stream).ConfigureAwait (false); + } else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) { + // Explicitly set this to make sure we're sending a "Content-Length: 0" header. + // This fixes the issue that's been reported on the forums: + // http://forums.xamarin.com/discussion/17770/length-required-error-in-http-post-since-latest-release + wrequest.ContentLength = 0; } - } - - var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false); - await request.Content.CopyToAsync (stream).ConfigureAwait (false); - } else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) { - // Explicitly set this to make sure we're sending a "Content-Length: 0" header. - // This fixes the issue that's been reported on the forums: - // http://forums.xamarin.com/discussion/17770/length-required-error-in-http-post-since-latest-release - wrequest.ContentLength = 0; - } - HttpWebResponse wresponse = null; - using (cancellationToken.Register (l => ((HttpWebRequest) l).Abort (), wrequest)) { - try { - wresponse = (HttpWebResponse) await wrequest.GetResponseAsync ().ConfigureAwait (false); - } catch (WebException we) { - if (we.Status != WebExceptionStatus.RequestCanceled) - throw; + wresponse = (HttpWebResponse)await wrequest.GetResponseAsync ().ConfigureAwait (false); } + } catch (WebException we) { + if (we.Status != WebExceptionStatus.RequestCanceled) + throw; + } - if (cancellationToken.IsCancellationRequested) { - var cancelled = new TaskCompletionSource (); - cancelled.SetCanceled (); - return await cancelled.Task; - } + if (cancellationToken.IsCancellationRequested) { + var cancelled = new TaskCompletionSource (); + cancelled.SetCanceled (); + return await cancelled.Task; } return CreateResponseMessage (wresponse, request, cancellationToken); diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpRequestMessage.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpRequestMessage.cs index 0bf3fba28ab..0823365d744 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpRequestMessage.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpRequestMessage.cs @@ -89,13 +89,25 @@ namespace System.Net.Http return uri; } set { - if (value != null && (value.IsAbsoluteUri && value.Scheme != Uri.UriSchemeHttp && value.Scheme != Uri.UriSchemeHttps)) + if (value != null && value.IsAbsoluteUri && !IsAllowedAbsoluteUri (value)) throw new ArgumentException ("Only http or https scheme is allowed"); uri = value; } } + static bool IsAllowedAbsoluteUri (Uri uri) + { + if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) + return true; + + // Mono URI handling which does not distinguish between file and url absolute paths without scheme + if (uri.Scheme == Uri.UriSchemeFile && uri.OriginalString.StartsWith ("/", StringComparison.Ordinal)) + return true; + + return false; + } + public Version Version { get { return version ?? HttpVersion.Version11; diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs index e9a7ab8de0a..18d582b00b7 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs @@ -223,6 +223,14 @@ namespace MonoTests.System.Net.Http.Headers value.FileName = "\"quoted\""; Assert.AreEqual ("\"quoted\"", value.FileName, "#41"); Assert.AreEqual (new NameValueHeaderValue ("filename", "\"quoted\""), value.Parameters.First (), "#42"); + + value.FileName = "~"; + Assert.AreEqual ("~", value.FileName, "#51"); + Assert.AreEqual (new NameValueHeaderValue ("filename", "~"), value.Parameters.First (), "#52"); + + value.FileName = "\x7f"; + Assert.AreEqual ("\"\x7f\"", value.FileName, "#61"); + Assert.AreEqual (new NameValueHeaderValue ("filename", "\"\x7f\""), value.Parameters.First (), "#62"); } [Test] @@ -237,8 +245,11 @@ namespace MonoTests.System.Net.Http.Headers value.FileNameStar = "č"; Assert.AreEqual ("č", value.FileNameStar, "#11"); Assert.AreEqual (new NameValueHeaderValue ("filename*", "utf-8''%C4%8D"), value.Parameters.First (), "#12"); - } + value.FileNameStar = "@x*\\%?.txt"; + Assert.AreEqual ("@x*\\%?.txt", value.FileNameStar, "#21"); + Assert.AreEqual (new NameValueHeaderValue ("filename*", "utf-8''%40x%2A%5C%25%3F.txt"), value.Parameters.First (), "#22"); + } [Test] public void Properties_Name () diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs index 32cf785a0e9..7de0ccdb2ae 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs @@ -51,6 +51,30 @@ namespace MonoTests.System.Net.Http.Headers Assert.Fail ("#2"); } catch (FormatException) { } + + try { + new NameValueHeaderValue ("\x7f", null); + Assert.Fail ("#3"); + } catch (FormatException) { + } + + try { + new NameValueHeaderValue ("arg", "\x7f"); + Assert.Fail ("#4"); + } catch (FormatException) { + } + } + + [Test] + public void Ctor_ValidArguments () + { + NameValueHeaderValue nvh; + + nvh = new NameValueHeaderValue ("arg", "~"); + Assert.AreEqual ("~", nvh.Value, "#1"); + + nvh = new NameValueHeaderValue ("arg", "\"\x7f\x80\""); + Assert.AreEqual ("\"\x7f\x80\"", nvh.Value, "#2"); } [Test] diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs index 4b07313aafd..eaeb6f6d23b 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs @@ -170,6 +170,35 @@ namespace MonoTests.System.Net.Http client.SendAsync (request).Wait (WaitTimeout); } + + [Test] + public void CancelRequestViaProxy () + { + var handler = new HttpClientHandler { + Proxy = new WebProxy ("192.168.10.25:8888/"), // proxy that doesn't exist + UseProxy = true, + AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate + }; + + var httpClient = new HttpClient (handler) { + BaseAddress = new Uri ("https://google.com"), + Timeout = TimeSpan.FromSeconds (1) + }; + + try { + var restRequest = new HttpRequestMessage { + Method = HttpMethod.Post, + RequestUri = new Uri("foo", UriKind.Relative), + Content = new StringContent("", null, "application/json") + }; + + httpClient.PostAsync (restRequest.RequestUri, restRequest.Content).Wait (WaitTimeout); + Assert.Fail ("#1"); + } catch (AggregateException e) { + Assert.IsTrue (e.InnerException is TaskCanceledException, "#2"); + } + } + [Test] public void Properties () { diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs index 8b4d6bf394e..eabc8a05c5d 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs @@ -99,6 +99,20 @@ namespace MonoTests.System.Net.Http Assert.AreEqual (req.RequestUri, uri); } + [Test] + public void Ctor_RelativeOrAbsoluteUri () + { + var uri = new Uri ("/", UriKind.RelativeOrAbsolute); + new HttpRequestMessage (HttpMethod.Get, uri); + + uri = new Uri ("file://", UriKind.RelativeOrAbsolute); + try { + new HttpRequestMessage (HttpMethod.Get, uri); + Assert.Fail ("#1"); + } catch (ArgumentException) { + } + } + [Test] public void Ctor_RelativeUriString () { @@ -109,6 +123,18 @@ namespace MonoTests.System.Net.Http Assert.IsFalse (req.RequestUri.IsAbsoluteUri); } + [Test] + public void Ctor_RelativeOrAbsoluteUriString () + { + new HttpRequestMessage (HttpMethod.Get, "/"); + + try { + new HttpRequestMessage (HttpMethod.Get, "file://"); + Assert.Fail ("#1"); + } catch (ArgumentException) { + } + } + [Test] public void Headers () { diff --git a/mcs/class/System.Net/System.Net-net_2_0.csproj b/mcs/class/System.Net/System.Net-net_2_0.csproj deleted file mode 100644 index bb2ce928ed8..00000000000 --- a/mcs/class/System.Net/System.Net-net_2_0.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {ED90CD4E-E958-4E14-B0E4-425CFA3BF661} - Library - 1699,1720 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Net - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Net/System.Net-net_4_0.csproj b/mcs/class/System.Net/System.Net-net_4_0.csproj deleted file mode 100644 index 511066fa791..00000000000 --- a/mcs/class/System.Net/System.Net-net_4_0.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {018D907D-AF28-4DB2-8D7D-24AB62ED97BC} - Library - 1699,1720 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - System.Net - v4.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - diff --git a/mcs/class/System.Numerics/System.Numerics-net_4_0.csproj b/mcs/class/System.Numerics/System.Numerics-net_4_0.csproj deleted file mode 100644 index a33e8e26b59..00000000000 --- a/mcs/class/System.Numerics/System.Numerics-net_4_0.csproj +++ /dev/null @@ -1,83 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8602E0AD-B84E-4107-98AD-E62FA8898241} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Numerics - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/System.Numerics/System.Numerics-tests-net_4_0.csproj b/mcs/class/System.Numerics/System.Numerics-tests-net_4_0.csproj deleted file mode 100644 index 2a7ba7411b9..00000000000 --- a/mcs/class/System.Numerics/System.Numerics-tests-net_4_0.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A50F4A28-93AA-42E0-BB98-24F3A48B1AC1} - Library - 1699 - bin\Debug\System.Numerics-tests-net_4_0 - True - False - - Properties - - - System.Numerics_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {8602E0AD-B84E-4107-98AD-E62FA8898241} - System.Numerics\System.Numerics-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - - - - - diff --git a/mcs/class/System.Reactive.Core/System.Reactive.Core-net_4_0.csproj b/mcs/class/System.Reactive.Core/System.Reactive.Core-net_4_0.csproj deleted file mode 100644 index b4d328edc51..00000000000 --- a/mcs/class/System.Reactive.Core/System.Reactive.Core-net_4_0.csproj +++ /dev/null @@ -1,171 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A86E0D79-7283-4D2B-80CE-0E6394F5F0A8} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Reactive.Core - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0B4F919D-8F01-4CDC-86AF-84D085CEDE00} - System.Reactive.Interfaces\System.Reactive.Interfaces-net_4_0 - - - - - - - - System.Reactive.Strings_Core.resources - - - - diff --git a/mcs/class/System.Reactive.Debugger/System.Reactive.Debugger-net_4_0.csproj b/mcs/class/System.Reactive.Debugger/System.Reactive.Debugger-net_4_0.csproj deleted file mode 100644 index 896779e1bb3..00000000000 --- a/mcs/class/System.Reactive.Debugger/System.Reactive.Debugger-net_4_0.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6129EE9A-2C68-48E2-AB4A-221B428F9AF8} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Reactive.Debugger - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0B4F919D-8F01-4CDC-86AF-84D085CEDE00} - System.Reactive.Interfaces\System.Reactive.Interfaces-net_4_0 - - - {A86E0D79-7283-4D2B-80CE-0E6394F5F0A8} - System.Reactive.Core\System.Reactive.Core-net_4_0 - - - {0BE9F44D-B9AD-4D46-B44D-2008E14E364E} - System.Reactive.Linq\System.Reactive.Linq-net_4_0 - - - - - - - diff --git a/mcs/class/System.Reactive.Experimental/System.Reactive.Experimental-net_4_0.csproj b/mcs/class/System.Reactive.Experimental/System.Reactive.Experimental-net_4_0.csproj deleted file mode 100644 index 73a3e220709..00000000000 --- a/mcs/class/System.Reactive.Experimental/System.Reactive.Experimental-net_4_0.csproj +++ /dev/null @@ -1,106 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FFBDFAF9-2ADD-49DE-8DC4-CB3F47B728AB} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Reactive.Experimental - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0B4F919D-8F01-4CDC-86AF-84D085CEDE00} - System.Reactive.Interfaces\System.Reactive.Interfaces-net_4_0 - - - {A86E0D79-7283-4D2B-80CE-0E6394F5F0A8} - System.Reactive.Core\System.Reactive.Core-net_4_0 - - - {0BE9F44D-B9AD-4D46-B44D-2008E14E364E} - System.Reactive.Linq\System.Reactive.Linq-net_4_0 - - - - - - - diff --git a/mcs/class/System.Reactive.Interfaces/System.Reactive.Interfaces-net_4_0.csproj b/mcs/class/System.Reactive.Interfaces/System.Reactive.Interfaces-net_4_0.csproj deleted file mode 100644 index 483b08749d5..00000000000 --- a/mcs/class/System.Reactive.Interfaces/System.Reactive.Interfaces-net_4_0.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0B4F919D-8F01-4CDC-86AF-84D085CEDE00} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Reactive.Interfaces - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/System.Reactive.Linq/System.Reactive.Linq-net_4_0.csproj b/mcs/class/System.Reactive.Linq/System.Reactive.Linq-net_4_0.csproj deleted file mode 100644 index 986dcd56fa8..00000000000 --- a/mcs/class/System.Reactive.Linq/System.Reactive.Linq-net_4_0.csproj +++ /dev/null @@ -1,268 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0BE9F44D-B9AD-4D46-B44D-2008E14E364E} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Reactive.Linq - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0B4F919D-8F01-4CDC-86AF-84D085CEDE00} - System.Reactive.Interfaces\System.Reactive.Interfaces-net_4_0 - - - {A86E0D79-7283-4D2B-80CE-0E6394F5F0A8} - System.Reactive.Core\System.Reactive.Core-net_4_0 - - - - - - - - System.Reactive.Strings_Linq.resources - - - - diff --git a/mcs/class/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases-net_4_0.csproj b/mcs/class/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases-net_4_0.csproj deleted file mode 100644 index 5b1494694a5..00000000000 --- a/mcs/class/System.Reactive.Observable.Aliases/System.Reactive.Observable.Aliases-net_4_0.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {18FF6BCF-7B16-441D-B1BB-9575C9E2F8FF} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Reactive.Observable.Aliases - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0B4F919D-8F01-4CDC-86AF-84D085CEDE00} - System.Reactive.Interfaces\System.Reactive.Interfaces-net_4_0 - - - {A86E0D79-7283-4D2B-80CE-0E6394F5F0A8} - System.Reactive.Core\System.Reactive.Core-net_4_0 - - - {0BE9F44D-B9AD-4D46-B44D-2008E14E364E} - System.Reactive.Linq\System.Reactive.Linq-net_4_0 - - - {71582426-D334-4886-99B0-E947026EFDE3} - System.Reactive.Providers\System.Reactive.Providers-net_4_0 - - - - - - - diff --git a/mcs/class/System.Reactive.PlatformServices/System.Reactive.PlatformServices-net_4_0.csproj b/mcs/class/System.Reactive.PlatformServices/System.Reactive.PlatformServices-net_4_0.csproj deleted file mode 100644 index c06c855eda9..00000000000 --- a/mcs/class/System.Reactive.PlatformServices/System.Reactive.PlatformServices-net_4_0.csproj +++ /dev/null @@ -1,120 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B1F716D6-ED54-4B1C-9B8C-4C046FC7E84F} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Reactive.PlatformServices - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NO_TASK_DELAY;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NO_TASK_DELAY;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0B4F919D-8F01-4CDC-86AF-84D085CEDE00} - System.Reactive.Interfaces\System.Reactive.Interfaces-net_4_0 - - - {A86E0D79-7283-4D2B-80CE-0E6394F5F0A8} - System.Reactive.Core\System.Reactive.Core-net_4_0 - - - {0BE9F44D-B9AD-4D46-B44D-2008E14E364E} - System.Reactive.Linq\System.Reactive.Linq-net_4_0 - - - - - - - - System.Reactive.Strings_PlatformServices.resources - - - - diff --git a/mcs/class/System.Reactive.Providers/System.Reactive.Providers-net_4_0.csproj b/mcs/class/System.Reactive.Providers/System.Reactive.Providers-net_4_0.csproj deleted file mode 100644 index 2c3d8831a6f..00000000000 --- a/mcs/class/System.Reactive.Providers/System.Reactive.Providers-net_4_0.csproj +++ /dev/null @@ -1,113 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {71582426-D334-4886-99B0-E947026EFDE3} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Reactive.Providers - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0B4F919D-8F01-4CDC-86AF-84D085CEDE00} - System.Reactive.Interfaces\System.Reactive.Interfaces-net_4_0 - - - {A86E0D79-7283-4D2B-80CE-0E6394F5F0A8} - System.Reactive.Core\System.Reactive.Core-net_4_0 - - - {0BE9F44D-B9AD-4D46-B44D-2008E14E364E} - System.Reactive.Linq\System.Reactive.Linq-net_4_0 - - - - - - - - System.Reactive.Strings_Providers.resources - - - - diff --git a/mcs/class/System.Reactive.Runtime.Remoting/System.Reactive.Runtime.Remoting-net_4_0.csproj b/mcs/class/System.Reactive.Runtime.Remoting/System.Reactive.Runtime.Remoting-net_4_0.csproj deleted file mode 100644 index e35fad866a7..00000000000 --- a/mcs/class/System.Reactive.Runtime.Remoting/System.Reactive.Runtime.Remoting-net_4_0.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E3E58191-8C65-486C-B93C-0C1F4A16CB29} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Reactive.Runtime.Remoting - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0B4F919D-8F01-4CDC-86AF-84D085CEDE00} - System.Reactive.Interfaces\System.Reactive.Interfaces-net_4_0 - - - {A86E0D79-7283-4D2B-80CE-0E6394F5F0A8} - System.Reactive.Core\System.Reactive.Core-net_4_0 - - - {0BE9F44D-B9AD-4D46-B44D-2008E14E364E} - System.Reactive.Linq\System.Reactive.Linq-net_4_0 - - - - - - - diff --git a/mcs/class/System.Reactive.Windows.Forms/System.Reactive.Windows.Forms-net_4_0.csproj b/mcs/class/System.Reactive.Windows.Forms/System.Reactive.Windows.Forms-net_4_0.csproj deleted file mode 100644 index b40941ab1dd..00000000000 --- a/mcs/class/System.Reactive.Windows.Forms/System.Reactive.Windows.Forms-net_4_0.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A43E708A-8514-40E6-A45F-2E53D82D1FDD} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Reactive.Windows.Forms - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0B4F919D-8F01-4CDC-86AF-84D085CEDE00} - System.Reactive.Interfaces\System.Reactive.Interfaces-net_4_0 - - - {A86E0D79-7283-4D2B-80CE-0E6394F5F0A8} - System.Reactive.Core\System.Reactive.Core-net_4_0 - - - {0BE9F44D-B9AD-4D46-B44D-2008E14E364E} - System.Reactive.Linq\System.Reactive.Linq-net_4_0 - - - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Managed.Windows.Forms\System.Windows.Forms-net_4_0 - - - - - - - diff --git a/mcs/class/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading-net_4_0.csproj b/mcs/class/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading-net_4_0.csproj deleted file mode 100644 index 8e59f0f1742..00000000000 --- a/mcs/class/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading-net_4_0.csproj +++ /dev/null @@ -1,113 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5655F065-7D2A-41DD-9A91-462D5CD09B69} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Reactive.Windows.Threading - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SIGNED - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0B4F919D-8F01-4CDC-86AF-84D085CEDE00} - System.Reactive.Interfaces\System.Reactive.Interfaces-net_4_0 - - - {A86E0D79-7283-4D2B-80CE-0E6394F5F0A8} - System.Reactive.Core\System.Reactive.Core-net_4_0 - - - {0BE9F44D-B9AD-4D46-B44D-2008E14E364E} - System.Reactive.Linq\System.Reactive.Linq-net_4_0 - - - {166B91FA-332C-48D9-9A0E-EF02794507BC} - WindowsBase\WindowsBase-net_4_0 - - - - - - - - System.Reactive.Strings_WindowsThreading.resources - - - - diff --git a/mcs/class/System.Runtime.Caching/System.Runtime.Caching-net_4_0.csproj b/mcs/class/System.Runtime.Caching/System.Runtime.Caching-net_4_0.csproj deleted file mode 100644 index 793a6fb3463..00000000000 --- a/mcs/class/System.Runtime.Caching/System.Runtime.Caching-net_4_0.csproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2AB7F86E-1FE4-49E0-B570-47AB8BD5AF7F} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Runtime.Caching - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/System.Runtime.Caching/System.Runtime.Caching-tests-net_4_0.csproj b/mcs/class/System.Runtime.Caching/System.Runtime.Caching-tests-net_4_0.csproj deleted file mode 100644 index a8f4d29d7c5..00000000000 --- a/mcs/class/System.Runtime.Caching/System.Runtime.Caching-tests-net_4_0.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B55E3A62-3217-40C4-BAE8-2F9FED3BA866} - Library - 1699 - bin\Debug\System.Runtime.Caching-tests-net_4_0 - True - False - - Properties - - - System.Runtime.Caching_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {2AB7F86E-1FE4-49E0-B570-47AB8BD5AF7F} - System.Runtime.Caching\System.Runtime.Caching-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - - - - - diff --git a/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-net_4_0.csproj b/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-net_4_0.csproj deleted file mode 100644 index 37bed591f67..00000000000 --- a/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-net_4_0.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {04A5721F-57CC-4C31-AE47-65A6386A5127} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Runtime.DurableInstancing - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {9D657157-DCA0-45BF-BB67-1FFB3CD8823A} - System.Xml.Linq\System.Xml.Linq-net_4_0 - - - - - - - diff --git a/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-tests-net_4_0.csproj b/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-tests-net_4_0.csproj deleted file mode 100644 index 3888554d0e1..00000000000 --- a/mcs/class/System.Runtime.DurableInstancing/System.Runtime.DurableInstancing-tests-net_4_0.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E01DEF6B-A8DD-49FB-B33D-F570CC99DF51} - Library - 1699 - bin\Debug\System.Runtime.DurableInstancing-tests-net_4_0 - True - False - - Properties - - - System.Runtime.DurableInstancing_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {04A5721F-57CC-4C31-AE47-65A6386A5127} - System.Runtime.DurableInstancing\System.Runtime.DurableInstancing-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {9D657157-DCA0-45BF-BB67-1FFB3CD8823A} - System.Xml.Linq\System.Xml.Linq-net_4_0 - - - - - - - diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_2_0.csproj b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_2_0.csproj deleted file mode 100644 index bcb638c18f7..00000000000 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_2_0.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {14C27158-5E50-403C-96D6-79FFF1F52889} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Runtime.Remoting - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - - - - - diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_4_0.csproj b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_4_0.csproj deleted file mode 100644 index ee43118a6bf..00000000000 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_4_0.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E8EE34D7-A86B-4569-8C5D-4DB8D3E2EF54} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Runtime.Remoting - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {C385F6FA-0893-438F-AA08-32E08FF478AA} - System.Web\System.Web-net_4_0-1 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {2FDBA71E-A6EC-4247-B0BD-BF7A618C0747} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_4_0 - - - - - - - diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_2_0.csproj b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_2_0.csproj deleted file mode 100644 index a7e43f60180..00000000000 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_2_0.csproj +++ /dev/null @@ -1,120 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A84DDEFD-D504-4F33-A353-8BB852CF778E} - Library - 1699,618 - bin\Debug\System.Runtime.Remoting-tests-net_2_0 - True - False - - Properties - - - System.Runtime.Remoting_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {14C27158-5E50-403C-96D6-79FFF1F52889} - System.Runtime.Remoting\System.Runtime.Remoting-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - {14C27158-5E50-403C-96D6-79FFF1F52889} - System.Runtime.Remoting\System.Runtime.Remoting-net_2_0 - - - - - - - diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_4_0.csproj b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_4_0.csproj deleted file mode 100644 index 16eeea172b7..00000000000 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_4_0.csproj +++ /dev/null @@ -1,120 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {63A1C1C9-008F-42CB-8E72-5C92ACC6FAC3} - Library - 1699,618 - bin\Debug\System.Runtime.Remoting-tests-net_4_0 - True - False - - Properties - - - System.Runtime.Remoting_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {E8EE34D7-A86B-4569-8C5D-4DB8D3E2EF54} - System.Runtime.Remoting\System.Runtime.Remoting-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {C385F6FA-0893-438F-AA08-32E08FF478AA} - System.Web\System.Web-net_4_0-1 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {2FDBA71E-A6EC-4247-B0BD-BF7A618C0747} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_4_0 - - - {E8EE34D7-A86B-4569-8C5D-4DB8D3E2EF54} - System.Runtime.Remoting\System.Runtime.Remoting-net_4_0 - - - - - - - diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_2_0.csproj b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_2_0.csproj deleted file mode 100644 index f8a99aac80e..00000000000 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_2_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Runtime.Serialization.Formatters.Soap - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_4_0.csproj b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_4_0.csproj deleted file mode 100644 index c7b7c9f5813..00000000000 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_4_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2FDBA71E-A6EC-4247-B0BD-BF7A618C0747} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Runtime.Serialization.Formatters.Soap - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_2_0.csproj b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_2_0.csproj deleted file mode 100644 index 0aa1b8f79d2..00000000000 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_2_0.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2F358FB0-9083-439D-B246-971F40EF4644} - Library - 1699,618,219,169 - bin\Debug\System.Runtime.Serialization.Formatters.Soap-tests-net_2_0 - True - False - - Properties - - - System.Runtime.Serialization.Formatters.Soap_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_4_0.csproj b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_4_0.csproj deleted file mode 100644 index 2e2196a621c..00000000000 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_4_0.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C7870309-E30C-437F-A496-92FAE16CA198} - Library - 1699,618,219,169 - bin\Debug\System.Runtime.Serialization.Formatters.Soap-tests-net_4_0 - True - False - - Properties - - - System.Runtime.Serialization.Formatters.Soap_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {2FDBA71E-A6EC-4247-B0BD-BF7A618C0747} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - diff --git a/mcs/class/System.Runtime.Serialization/Makefile b/mcs/class/System.Runtime.Serialization/Makefile index 60d0cb40cb1..f902ef98998 100644 --- a/mcs/class/System.Runtime.Serialization/Makefile +++ b/mcs/class/System.Runtime.Serialization/Makefile @@ -7,6 +7,7 @@ RESOURCE_FILES = \ LIBRARY = System.Runtime.Serialization.dll LIB_MCS_FLAGS = \ + -unsafe \ /nowarn:168,169,219,414 \ /r:System.dll \ /r:System.Xml.dll \ diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_2_0.csproj b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_2_0.csproj deleted file mode 100644 index f27edaa1e46..00000000000 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_2_0.csproj +++ /dev/null @@ -1,167 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - Library - 1699,168,169,219,414 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Runtime.Serialization - v2.0 - 512 - - - true - full - 1699,168,169,219,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699,168,169,219,414 - true - NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - - mstypes.schema - - - - diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_4_0.csproj b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_4_0.csproj deleted file mode 100644 index 421f6a275fb..00000000000 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_4_0.csproj +++ /dev/null @@ -1,176 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {28265916-A48E-4A4D-A845-2F1C06027D68} - Library - 1699,168,169,219,414 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Runtime.Serialization - v4.0 - 512 - - - true - full - 1699,168,169,219,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699,168,169,219,414 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - - - - - - mstypes.schema - - - - diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_2_0.csproj b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_2_0.csproj deleted file mode 100644 index 2f95199b068..00000000000 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_2_0.csproj +++ /dev/null @@ -1,152 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2F43A5EC-AB47-4075-831F-D0681E7CA07B} - Library - 1699,168,169,219,414 - bin\Debug\System.Runtime.Serialization-tests-net_2_0 - True - False - - Properties - - - System.Runtime.Serialization_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,168,169,219,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699,168,169,219,414 - true - NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - False - System.ServiceModel.dll - False - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - - - - - - mstypes.schema - - - collections.wsdl - - - custom-collections.wsdl - - - - diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_4_0.csproj b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_4_0.csproj deleted file mode 100644 index f52d670e82f..00000000000 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_4_0.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DA14FBBE-12B0-4CFC-AECC-5DAD4C79F679} - Library - 1699,168,169,219,414 - bin\Debug\System.Runtime.Serialization-tests-net_4_0 - True - False - - Properties - - - System.Runtime.Serialization_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,168,169,219,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699,168,169,219,414 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {75EA05AE-77E9-44DA-9ECC-CC5808134137} - System.Web.Services\System.Web.Services-net_4_0 - - - - - - - - mstypes.schema - - - collections.wsdl - - - custom-collections.wsdl - - - - diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.dll.sources b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.dll.sources index 190b3d9addd..580a0bb9482 100644 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.dll.sources +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization.dll.sources @@ -10,9 +10,9 @@ System.Runtime.Serialization.Configuration/ParameterElementCollection.cs System.Runtime.Serialization.Configuration/SerializationSectionGroup.cs System.Runtime.Serialization.Configuration/TypeElement.cs System.Runtime.Serialization.Configuration/TypeElementCollection.cs -System.Runtime.Serialization/CollectionDataContractAttribute.cs -System.Runtime.Serialization/ContractNamespaceAttribute.cs -System.Runtime.Serialization/DataContractAttribute.cs +../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContractAttribute.cs +../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ContractNamespaceAttribute.cs +../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractAttribute.cs System.Runtime.Serialization/DataContractResolver.cs System.Runtime.Serialization/DataContractSerializer.cs System.Runtime.Serialization/DataMemberAttribute.cs diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/CollectionDataContractAttribute.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/CollectionDataContractAttribute.cs deleted file mode 100644 index a5cd0aae832..00000000000 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/CollectionDataContractAttribute.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// CollectionDataContractAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2005 Novell, Inc. http://www.novell.com -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_2_0 -using System; - -namespace System.Runtime.Serialization -{ - [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct, - Inherited = false, AllowMultiple = false)] - public sealed class CollectionDataContractAttribute : Attribute - { - string name, ns, item_name, key_name, value_name; - bool is_reference; - - public CollectionDataContractAttribute () - { - } - - public string Name { - get { return name; } - set { name = value; } - } - - public string Namespace { - get { return ns; } - set { ns = value; } - } - - public string ItemName { - get { return item_name; } - set { item_name = value; } - } - - public string KeyName { - get { return key_name; } - set { key_name = value; } - } - - public string ValueName { - get { return value_name; } - set { value_name = value; } - } - - public bool IsReference { get; set; } // new in 3.5 SP1 - } -} -#endif diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ContractNamespaceAttribute.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ContractNamespaceAttribute.cs deleted file mode 100644 index 759bbd69983..00000000000 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/ContractNamespaceAttribute.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// ContractNamespaceAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2005 Novell, Inc. http://www.novell.com -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_2_0 -using System; - -namespace System.Runtime.Serialization -{ - [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Module, - Inherited = false, AllowMultiple = true)] - public sealed class ContractNamespaceAttribute : Attribute - { - string clr_ns, contract_ns; - - public ContractNamespaceAttribute (string ns) - { - contract_ns = ns; - } - - public string ClrNamespace { - get { return clr_ns; } - set { clr_ns = value; } - } - - public string ContractNamespace { - get { return contract_ns; } - } - } -} -#endif diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractAttribute.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractAttribute.cs deleted file mode 100644 index efcd48729a9..00000000000 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/DataContractAttribute.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// DataContractAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2005 Novell, Inc. http://www.novell.com -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_2_0 -using System; - -namespace System.Runtime.Serialization -{ - [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum, - Inherited = false, AllowMultiple = false)] - public sealed class DataContractAttribute : Attribute - { - string name, ns; - - public DataContractAttribute () - { - } - - public string Name { - get { return name; } - set { name = value; } - } - - // the default namespace for XmlFormatter (with SharedSchema) is - // http://schemas.datacontract.org/2004/07/ . - public string Namespace { - get { return ns; } - set { ns = value; } - } - - // new in 3.5 SP1 - public bool IsReference { get; set; } - } -} -#endif diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs index 8c0eb2c4d92..4b439f382ce 100644 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs @@ -996,6 +996,10 @@ namespace System.Runtime.Serialization string s = null; foreach (EnumMemberInfo emi in enum_members) { long f = Convert.ToInt64 (emi.Value); + if (f == val) { + s = emi.XmlName; + break; + } if ((f & val) == f) s += (s != null ? " " : String.Empty) + emi.XmlName; } diff --git a/mcs/class/System.Runtime.Serialization/System.Xml/UniqueId.cs b/mcs/class/System.Runtime.Serialization/System.Xml/UniqueId.cs index 38d75d7e781..28cbb00fada 100644 --- a/mcs/class/System.Runtime.Serialization/System.Xml/UniqueId.cs +++ b/mcs/class/System.Runtime.Serialization/System.Xml/UniqueId.cs @@ -26,7 +26,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Collections.Generic; using System.Security; @@ -53,10 +52,6 @@ namespace System.Xml this.guid = id; } -#if !NET_2_1 - [SecurityCritical] - [SecurityTreatAsSafe] -#endif public UniqueId (string value) { if (value == null) @@ -68,10 +63,6 @@ namespace System.Xml this.id = value; } -#if !NET_2_1 - [SecurityCritical] - [SecurityTreatAsSafe] -#endif public UniqueId (byte [] id, int offset) { if (id == null) @@ -93,10 +84,6 @@ namespace System.Xml } } -#if !NET_2_1 - [SecurityCritical] - [SecurityTreatAsSafe] -#endif public UniqueId (char [] id, int offset, int count) { if (id == null) @@ -122,10 +109,6 @@ namespace System.Xml } public int CharArrayLength { -#if !NET_2_1 - [SecurityCritical] - [SecurityTreatAsSafe] -#endif get {return id != null ? id.Length : 45;} } @@ -163,10 +146,6 @@ namespace System.Xml return ! (id1 == id2); } -#if !NET_2_1 - [SecurityCritical] - [SecurityTreatAsSafe] -#endif public int ToCharArray (char [] array, int offset) { if (array == null) @@ -179,10 +158,6 @@ namespace System.Xml return s.Length; } -#if !NET_2_1 - [SecurityCritical] - [SecurityTreatAsSafe] -#endif public override string ToString () { if (id == null) @@ -202,10 +177,6 @@ namespace System.Xml } } -#if !NET_2_1 - [SecurityCritical] - [SecurityTreatAsSafe] -#endif public bool TryGetGuid (byte [] buffer, int offset) { if (!IsGuid) @@ -223,4 +194,3 @@ namespace System.Xml } } } -#endif diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest.cs index 91fe958e0bf..ada461fe2b8 100644 --- a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest.cs +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest.cs @@ -92,6 +92,35 @@ namespace MonoTests.System.Runtime.Serialization var ser = new DataContractSerializer(typeof(MyObject)); ser.ReadObject (XmlReader.Create(new StringReader(s))); } - + + [Flags ()] + [Serializable] + public enum FlagsEnum + { + None = 0, + Flag1 = 0x10, + Flag2 = 0x20, + All = 0xffff, + }; + + [Serializable] + public class ClassWithFlagsEnum + { + public FlagsEnum Flags = FlagsEnum.All; + } + + // Bug #21072 + [Test] + public void FlagsEnumTest () + { + var ser = new DataContractSerializer (typeof (ClassWithFlagsEnum)); + + using (var m = new MemoryStream ()) { + ser.WriteObject (m, new ClassWithFlagsEnum ()); + var data = m.ToArray (); + var s = Encoding.UTF8.GetString (data, 0, (int) data.Length); + Assert.IsTrue (s.Contains ("All")); + } + } } } diff --git a/mcs/class/System.Runtime.Serialization/mobile_System.Runtime.Serialization.dll.sources b/mcs/class/System.Runtime.Serialization/mobile_System.Runtime.Serialization.dll.sources index c78c2995ba5..3946206a0bf 100644 --- a/mcs/class/System.Runtime.Serialization/mobile_System.Runtime.Serialization.dll.sources +++ b/mcs/class/System.Runtime.Serialization/mobile_System.Runtime.Serialization.dll.sources @@ -10,9 +10,9 @@ Assembly/AssemblyInfo.cs ../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonSerializationWriter.cs ../System.ServiceModel.Web/System.Runtime.Serialization.Json/JsonWriter.cs ../System.ServiceModel.Web/System.Runtime.Serialization.Json/TypeMap.cs -System.Runtime.Serialization/CollectionDataContractAttribute.cs -System.Runtime.Serialization/ContractNamespaceAttribute.cs -System.Runtime.Serialization/DataContractAttribute.cs +../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContractAttribute.cs +../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ContractNamespaceAttribute.cs +../../../external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractAttribute.cs System.Runtime.Serialization/DataContractResolver.cs System.Runtime.Serialization/DataContractSerializer.cs System.Runtime.Serialization/DataContractSerializerSettings.cs diff --git a/mcs/class/System.Security/Makefile b/mcs/class/System.Security/Makefile index c57de5341cc..752a5f3f82b 100644 --- a/mcs/class/System.Security/Makefile +++ b/mcs/class/System.Security/Makefile @@ -12,7 +12,7 @@ LOCAL_MCS_FLAGS = -lib:$(secxml_libdir) -lib:$(bare_libdir) TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:168,169,183,219,414,1595 -VALID_PROFILE := $(filter net_1_1 net_2_0 moonlight_raw net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter moonlight_raw net_4_0 net_4_5, $(PROFILE)) EXTRA_DISTFILES = \ Test/System.Security.Cryptography.Xml/sample.pfx \ diff --git a/mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs b/mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs index ae267a93856..8f0ec973539 100644 --- a/mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs +++ b/mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs @@ -637,7 +637,7 @@ namespace Mono.Xml { else if (n2 == null) return 1; else if (n1.Prefix == n2.Prefix) - return string.Compare (n1.LocalName, n2.LocalName); + return string.CompareOrdinal (n1.LocalName, n2.LocalName); // Attributes in the default namespace are first // because the default namespace is not applied to diff --git a/mcs/class/System.Security/System.Security-net_2_0.csproj b/mcs/class/System.Security/System.Security-net_2_0.csproj deleted file mode 100644 index 7e31b44c653..00000000000 --- a/mcs/class/System.Security/System.Security-net_2_0.csproj +++ /dev/null @@ -1,183 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {879EA17D-67A5-44ED-B912-1BE4883356FE} - Library - 1699,618,414 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Security - v2.0 - 512 - - - true - full - 1699,618,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SECURITY_DEP - prompt - 4 - - - pdbonly - 1699,618,414 - true - NET_1_1;NET_2_0;SECURITY_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A1ED72C-ADAB-4396-AB03-D0E26AA91E90} - System\System-net_2_0-1 - - - {E89F34AB-7AE2-41CA-B891-C8D1C9F02EB8} - System.XML\System.Xml-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - diff --git a/mcs/class/System.Security/System.Security-net_4_0.csproj b/mcs/class/System.Security/System.Security-net_4_0.csproj deleted file mode 100644 index 94f7829a34b..00000000000 --- a/mcs/class/System.Security/System.Security-net_4_0.csproj +++ /dev/null @@ -1,183 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E15F571E-B653-4409-AF7C-F478DA81B959} - Library - 1699,618,414 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Security - v4.0 - 512 - - - true - full - 1699,618,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SECURITY_DEP - prompt - 4 - - - pdbonly - 1699,618,414 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SECURITY_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {C8452C42-726B-4C74-A086-00AFBC162B9A} - System\System-net_4_0-1 - - - {86DD6F16-A480-4248-AE96-301B2F973CD7} - System.XML\System.Xml-net_4_0 - - - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Mono.Security\Mono.Security-net_4_0 - - - - - - - diff --git a/mcs/class/System.Security/System.Security-tests-net_2_0.csproj b/mcs/class/System.Security/System.Security-tests-net_2_0.csproj deleted file mode 100644 index e27eff03400..00000000000 --- a/mcs/class/System.Security/System.Security-tests-net_2_0.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9E4A512E-2ABA-477E-892D-FC0B58881339} - Library - 1699,618,414,169,219,1595,168,183,414 - bin\Debug\System.Security-tests-net_2_0 - True - False - - Properties - - - System.Security_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,414,169,219,1595,168,183,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SECURITY_DEP - prompt - 4 - - - pdbonly - 1699,618,414,169,219,1595,168,183,414 - true - NET_1_1;NET_2_0;SECURITY_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {5A1ED72C-ADAB-4396-AB03-D0E26AA91E90} - System\System-net_2_0-1 - - - {E89F34AB-7AE2-41CA-B891-C8D1C9F02EB8} - System.XML\System.Xml-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - diff --git a/mcs/class/System.Security/System.Security-tests-net_4_0.csproj b/mcs/class/System.Security/System.Security-tests-net_4_0.csproj deleted file mode 100644 index 1ad029a552e..00000000000 --- a/mcs/class/System.Security/System.Security-tests-net_4_0.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C3A1EAFF-3F38-4F9C-AE12-DB78331C14C6} - Library - 1699,618,414,169,219,1595,168,183,414 - bin\Debug\System.Security-tests-net_4_0 - True - False - - Properties - - - System.Security_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618,414,169,219,1595,168,183,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SECURITY_DEP - prompt - 4 - - - pdbonly - 1699,618,414,169,219,1595,168,183,414 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SECURITY_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {E15F571E-B653-4409-AF7C-F478DA81B959} - System.Security\System.Security-net_4_0 - - - {C8452C42-726B-4C74-A086-00AFBC162B9A} - System\System-net_4_0-1 - - - {86DD6F16-A480-4248-AE96-301B2F973CD7} - System.XML\System.Xml-net_4_0 - - - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Mono.Security\Mono.Security-net_4_0 - - - - - - - diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs index a20b3bc3a2e..4c7c6131087 100644 --- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs +++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/SignedXmlTest.cs @@ -213,6 +213,87 @@ namespace MonoTests.System.Security.Cryptography.Xml { Assert.IsTrue (vrfy.CheckSignature (), "RSA-Compute/Verify"); } + // The same as MSDNSample(), but adding a few attributes + public SignedXml MSDNSampleMixedCaseAttributes () + { + // Create example data to sign. + XmlDocument document = new XmlDocument (); + XmlNode node = document.CreateNode (XmlNodeType.Element, "", "MyElement", "samples"); + node.InnerText = "This is some text"; + XmlAttribute a1 = document.CreateAttribute ("Aa"); + XmlAttribute a2 = document.CreateAttribute ("Bb"); + XmlAttribute a3 = document.CreateAttribute ("aa"); + XmlAttribute a4 = document.CreateAttribute ("bb"); + a1.Value = "one"; + a2.Value = "two"; + a3.Value = "three"; + a4.Value = "four"; + node.Attributes.Append (a1); + node.Attributes.Append (a2); + node.Attributes.Append (a3); + node.Attributes.Append (a4); + document.AppendChild (node); + + // Create the SignedXml message. + SignedXml signedXml = new SignedXml (); + + // Create a data object to hold the data to sign. + DataObject dataObject = new DataObject (); + dataObject.Data = document.ChildNodes; + dataObject.Id = "MyObjectId"; + + // Add the data object to the signature. + signedXml.AddObject (dataObject); + + // Create a reference to be able to package everything into the + // message. + Reference reference = new Reference (); + reference.Uri = "#MyObjectId"; + + // Add it to the message. + signedXml.AddReference (reference); + + return signedXml; + } + + public string AsymmetricRSAMixedCaseAttributes () + { + SignedXml signedXml = MSDNSampleMixedCaseAttributes (); + + RSA key = RSA.Create (); + signedXml.SigningKey = key; + + // Add a KeyInfo. + KeyInfo keyInfo = new KeyInfo (); + keyInfo.AddClause (new RSAKeyValue (key)); + signedXml.KeyInfo = keyInfo; + + // Compute the signature. + signedXml.ComputeSignature (); + + // Get the XML representation of the signature. + XmlElement xmlSignature = signedXml.GetXml (); + + StringWriter sw = new StringWriter (); + XmlWriter w = new XmlTextWriter (sw); + xmlSignature.WriteTo (w); + return sw.ToString (); + } + + // Example output from Windows for AsymmetricRSAMixedCaseAttributes() + private const string AsymmetricRSAMixedCaseAttributesResult = "0j1xLsePFtuRHfXEnVdTSLWtAm4=hmrEBgns5Xx14aDhzqOyIh0qLNMUldtW8+fNPcvtD/2KtEhNZQGctnhs90CRa1NZ08TqzW2pUaEwmqvMAtF4v8KtWzC/zTuc1jH6nxQvQSQo0ABhuXdu7/hknZkXJ4yKBbdgbKjAsKfULwbWrP/PacLPoYfCO+wXSrt+wLMTTWU=4h/rHDr54r6SZWk2IPCeHX7N+wR1za0VBLshuS6tq3RSWap4PY2BM8VdbKH2T9RzyZoiHufjng+1seUx430iMsXisOLUkPP+yGtMQOSZ3CQHAa+IYA+fplXipixI0rV1J1wJNXQm3HxXQqKWpIv5fkwBtj8o2k6CWMgPNgFCnxc=AQABThis is some text"; + + [Test] + public void AsymmetricRSAMixedCaseAttributesVerifyWindows () + { + XmlDocument doc = new XmlDocument (); + doc.LoadXml (AsymmetricRSAMixedCaseAttributesResult); + + SignedXml v1 = new SignedXml (); + v1.LoadXml (doc.DocumentElement); + Assert.IsTrue (v1.CheckSignature ()); + } + [Test] public void AsymmetricDSASignature () { diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs index 816df3e9809..43cf7df2afc 100644 --- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs +++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs @@ -494,6 +494,19 @@ namespace MonoTests.System.Security.Cryptography.Xml { Assert.AreEqual (new StreamReader (s, Encoding.UTF8).ReadToEnd (), expected); } + [Test] + public void OrdinalSortForAttributes () + { + XmlDocument doc = new XmlDocument (); + string xml = ""; + doc.LoadXml (xml); + + transform.LoadInput (doc); + Stream s = (Stream) transform.GetOutput (); + string output = Stream2String (s); + Assert.AreEqual (xml, output); + } + #if NET_2_0 [Test] public void PrefixlessNamespaceOutput () diff --git a/mcs/class/System.ServiceModel.Activation/System.ServiceModel.Activation-net_4_0.csproj b/mcs/class/System.ServiceModel.Activation/System.ServiceModel.Activation-net_4_0.csproj deleted file mode 100644 index 1ae0ce709dd..00000000000 --- a/mcs/class/System.ServiceModel.Activation/System.ServiceModel.Activation-net_4_0.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1C9B4EFC-57D5-4DEE-9D2F-0B505824623F} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.ServiceModel.Activation - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {49578558-7849-4977-B029-8ECFA79C79E8} - System.ServiceModel\System.ServiceModel-net_4_0 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-net_4_0.csproj b/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-net_4_0.csproj deleted file mode 100644 index 8e5987a7a57..00000000000 --- a/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-net_4_0.csproj +++ /dev/null @@ -1,201 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7D4BD161-BAD2-461D-80F3-D7E6A6CC584A} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.ServiceModel.Discovery - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {CB54BC7B-F3CD-43DC-B983-3FFFF41D01E1} - System.ServiceModel\System.ServiceModel-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {9D657157-DCA0-45BF-BB67-1FFB3CD8823A} - System.Xml.Linq\System.Xml.Linq-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-tests-net_4_0.csproj b/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-tests-net_4_0.csproj deleted file mode 100644 index 9081829d2d9..00000000000 --- a/mcs/class/System.ServiceModel.Discovery/System.ServiceModel.Discovery-tests-net_4_0.csproj +++ /dev/null @@ -1,130 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FA9958CE-E29E-4E82-AE5E-CB299CB9EE26} - Library - 1699 - bin\Debug\System.ServiceModel.Discovery-tests-net_4_0 - True - False - - Properties - - - System.ServiceModel.Discovery_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {7D4BD161-BAD2-461D-80F3-D7E6A6CC584A} - System.ServiceModel.Discovery\System.ServiceModel.Discovery-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {CB54BC7B-F3CD-43DC-B983-3FFFF41D01E1} - System.ServiceModel\System.ServiceModel-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {9D657157-DCA0-45BF-BB67-1FFB3CD8823A} - System.Xml.Linq\System.Xml.Linq-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Routing/System.ServiceModel.Routing-net_4_0.csproj b/mcs/class/System.ServiceModel.Routing/System.ServiceModel.Routing-net_4_0.csproj deleted file mode 100644 index 99ce6637945..00000000000 --- a/mcs/class/System.ServiceModel.Routing/System.ServiceModel.Routing-net_4_0.csproj +++ /dev/null @@ -1,128 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {971936E9-C270-4F35-B43E-06C1404989B8} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.ServiceModel.Routing - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {CB54BC7B-F3CD-43DC-B983-3FFFF41D01E1} - System.ServiceModel\System.ServiceModel-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_2_0.csproj b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_2_0.csproj deleted file mode 100644 index e7314da8380..00000000000 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_2_0.csproj +++ /dev/null @@ -1,202 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3C6EB10D-5929-4CB4-81F2-7984FCECCDAA} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.ServiceModel.Web - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {5B5CA61A-0901-40B5-B56A-D0A6E67DDA66} - System.Web.Extensions_1.0\System.Web.Extensions_1.0-net_2_0 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_4_0.csproj b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_4_0.csproj deleted file mode 100644 index 301b929b50f..00000000000 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_4_0.csproj +++ /dev/null @@ -1,154 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3867C3D0-36C4-4CC1-A8E5-5D15631B35D4} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.ServiceModel.Web - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {CB54BC7B-F3CD-43DC-B983-3FFFF41D01E1} - System.ServiceModel\System.ServiceModel-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {3A327AAD-B09D-47E3-A915-C16BFB3F1682} - System.Web.Extensions\System.Web.Extensions-net_4_0 - - - {1C9B4EFC-57D5-4DEE-9D2F-0B505824623F} - System.ServiceModel.Activation\System.ServiceModel.Activation-net_4_0 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_2_0.csproj b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_2_0.csproj deleted file mode 100644 index 7750796438a..00000000000 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_2_0.csproj +++ /dev/null @@ -1,143 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {98478C8A-B3F8-4D4E-9561-BB75C34BABCA} - Library - 1699 - bin\Debug\System.ServiceModel.Web-tests-net_2_0 - True - False - - Properties - - - System.ServiceModel.Web_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {3C6EB10D-5929-4CB4-81F2-7984FCECCDAA} - System.ServiceModel.Web\System.ServiceModel.Web-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {5B5CA61A-0901-40B5-B56A-D0A6E67DDA66} - System.Web.Extensions_1.0\System.Web.Extensions_1.0-net_2_0 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_4_0.csproj b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_4_0.csproj deleted file mode 100644 index 02aebe1b2ec..00000000000 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_4_0.csproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E2D71809-71AB-4EA0-B285-EA551854BA18} - Library - 1699 - bin\Debug\System.ServiceModel.Web-tests-net_4_0 - True - False - - Properties - - - System.ServiceModel.Web_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3867C3D0-36C4-4CC1-A8E5-5D15631B35D4} - System.ServiceModel.Web\System.ServiceModel.Web-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {CB54BC7B-F3CD-43DC-B983-3FFFF41D01E1} - System.ServiceModel\System.ServiceModel-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {3A327AAD-B09D-47E3-A915-C16BFB3F1682} - System.Web.Extensions\System.Web.Extensions-net_4_0 - - - {1C9B4EFC-57D5-4DEE-9D2F-0B505824623F} - System.ServiceModel.Activation\System.ServiceModel.Activation-net_4_0 - - - - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-net_2_0.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-net_2_0.csproj deleted file mode 100644 index f2cd38c33e0..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-net_2_0.csproj +++ /dev/null @@ -1,1094 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - Library - 1699,414,169,67,3005,436,219,618 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.ServiceModel - v2.0 - 512 - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {737EBB38-BBFD-40D8-99F1-1FBBD49AF1B6} - System.IdentityModel\System.IdentityModel-net_2_0 - - - {7203476D-4107-4C91-9930-DEC5CCFE62C8} - System.IdentityModel.Selectors\System.IdentityModel.Selectors-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - System.Messaging\System.Messaging-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-net_4_0.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-net_4_0.csproj deleted file mode 100644 index e21e1de8c58..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-net_4_0.csproj +++ /dev/null @@ -1,1146 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {49578558-7849-4977-B029-8ECFA79C79E8} - Library - 1699,414,169,67,3005,436,219,618 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - System.ServiceModel - v4.0 - 512 - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;TRACE;NET_3_0;HAS_ACTIVATION - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;TRACE;NET_3_0;HAS_ACTIVATION - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {E15F571E-B653-4409-AF7C-F478DA81B959} - System.Security\System.Security-net_4_0 - - - {888E3381-24AB-4FA9-B973-FD683B0461D3} - System.IdentityModel\System.IdentityModel-net_4_0 - - - {FCCADAA1-34B7-4F15-933A-1FAA4DAF9871} - System.IdentityModel.Selectors\System.IdentityModel.Selectors-net_4_0 - - - {03A0E889-9E62-423F-B65E-40416E021F1B} - System.Transactions\System.Transactions-net_4_0 - - - {5854BF27-FC35-44F5-BE59-580900694E32} - System.Messaging\System.Messaging-net_4_0 - - - {2AB66C1A-6094-4C45-AF9B-FA85F8D5E98A} - System.Web\System.Web-net_4_0-2 - - - {75EA05AE-77E9-44DA-9ECC-CC5808134137} - System.Web.Services\System.Web.Services-net_4_0 - - - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Mono.Security\Mono.Security-net_4_0 - - - False - System.ServiceModel.Activation.dll - False - - - {3B707FB5-0AB3-472A-BB49-7598CF2607B0} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_0 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_2_0.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_2_0.csproj deleted file mode 100644 index b3f9f0c8d02..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_2_0.csproj +++ /dev/null @@ -1,1098 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B7F6F3A3-349F-4F3F-BC96-F491DC9E90BE} - Library - 1699,414,169,67,3005,436,219,618 - ./../../class/lib/net_2_0/plainservice - True - True - true - Properties - - - System.ServiceModel - v2.0 - 512 - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {AAA3F683-244C-40EF-8EF8-A95938862A44} - corlib\corlib-net_2_0 - - - {5459507F-DC25-401C-A2F4-D5ECAC3A34E6} - System\System-bare-net_2_0 - - - {0E9DD462-944B-426E-BC1E-96EF270EF7E2} - System.XML\System.Xml-bare-net_2_0 - - - {F0743710-AB7C-4019-A13A-07AE79F514E4} - System.Core\System.Core-plaincore-net_2_0 - - - {CDFC3554-7C58-4C56-B862-9821EE91E2E2} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {13AAE1FB-48CB-41ED-BF9B-F6F69CDE258F} - System.Configuration\System.Configuration-net_2_0 - - - {3D0435AD-4ACE-45BE-87DE-335BAD6D8EB1} - System.Data\System.Data-net_2_0 - - - {D3703145-8C5A-45B9-99A1-059D50BF3DFF} - System.Security\System.Security-net_2_0 - - - {79E05A44-5A8D-4409-8F84-5FFEF95CD7AD} - System.IdentityModel\System.IdentityModel-net_2_0 - - - {88EFC58B-C753-42BB-AC08-4D9AD59FE3E5} - System.IdentityModel.Selectors\System.IdentityModel.Selectors-net_2_0 - - - {CEB6068D-261E-4546-8013-0A279BE86B5A} - System.Transactions\System.Transactions-net_2_0 - - - {A15967D7-34EF-4D38-B25E-19AE6808A308} - System.Messaging\System.Messaging-net_2_0 - - - {97FD9F81-DC17-4CEC-992A-F2F17B6602D7} - System.Web\System.Web-plainweb-net_2_0 - - - {73D0EC8D-BC1E-4748-979B-68DDFF011AF4} - System.Web.Services\System.Web.Services-net_2_0 - - - {ECDB1158-526C-46EE-896E-9BFB6F85C0A3} - Mono.Security\Mono.Security-net_2_0 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_4_0.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_4_0.csproj deleted file mode 100644 index 299f6dbcb02..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_4_0.csproj +++ /dev/null @@ -1,1145 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {816ADD37-2313-47D0-8F75-1DA6E7B8EB99} - Library - 1699,414,169,67,3005,436,219,618 - ./../../class/lib/net_4_0/plainservice - True - True - true - Properties - - - System.ServiceModel - v4.0 - 512 - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;TRACE;NET_3_0 - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;TRACE;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5889848E-305B-4B11-B3B1-A25761DAFE45} - corlib\corlib-net_4_0 - - - {ED114F49-84B3-4EF9-80EC-90D4EEF7FF8E} - System\System-secxml-net_4_0 - - - {FB3BD508-7228-49CF-ADCA-F5D0C8E8ABCF} - System.XML\System.Xml-bare-net_4_0 - - - {2D5DF73B-C3E5-40E6-94DA-EE49231F1FB4} - System.Core\System.Core-plaincore-net_4_0 - - - {5F7BBDFE-ABEF-4B41-AC38-B4BB6EAE2F5B} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {41A642E0-E14A-4B75-B37B-28549F5536FC} - System.Configuration\System.Configuration-net_4_0 - - - {F9CB6ED4-1F88-4C63-84BA-4A60E8E4CB9B} - System.Data\System.Data-net_4_0 - - - {F6E83619-012D-471F-BEE2-3D2A19F04EB4} - System.Security\System.Security-net_4_0 - - - {03FB840A-3D5A-45D4-9DD5-2EBF946312CB} - System.IdentityModel\System.IdentityModel-net_4_0 - - - {F0994902-D7DB-4B6D-A269-7D865328F3F7} - System.IdentityModel.Selectors\System.IdentityModel.Selectors-net_4_0 - - - {F141397D-ED2D-4522-8603-47E5D89FB9CD} - System.Transactions\System.Transactions-net_4_0 - - - {56EC74E6-7600-475D-84B7-38BD33A90548} - System.Messaging\System.Messaging-net_4_0 - - - {DE03397A-FF16-4665-B1B4-D8E437D1A7DB} - System.Web\System.Web-plainweb-net_4_0 - - - {0D6601DD-3604-48B2-9180-8435B13CD76A} - System.Web.Services\System.Web.Services-net_4_0 - - - {E625DC4E-7922-4453-A5F1-C16D46B3E0BA} - Mono.Security\Mono.Security-net_4_0 - - - {21BBD9A9-836A-4BF0-81EF-CAFE55B11226} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_0 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_2_0.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_2_0.csproj deleted file mode 100644 index 17e7560791b..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_2_0.csproj +++ /dev/null @@ -1,356 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6E7270E1-B6F4-4244-B349-59208C772462} - Library - 1699,414,169,67,3005,436,219,618 - bin\Debug\System.ServiceModel-tests-net_2_0 - True - False - true - Properties - - - System.ServiceModel_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {737EBB38-BBFD-40D8-99F1-1FBBD49AF1B6} - System.IdentityModel\System.IdentityModel-net_2_0 - - - {7203476D-4107-4C91-9930-DEC5CCFE62C8} - System.IdentityModel.Selectors\System.IdentityModel.Selectors-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - System.Messaging\System.Messaging-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_4_0.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_4_0.csproj deleted file mode 100644 index 8359e885b75..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_4_0.csproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9F423060-8B21-400F-835A-2C880C4A90FC} - Library - 1699,414,169,67,3005,436,219,618 - bin\Debug\System.ServiceModel-tests-net_4_0 - True - False - true - Properties - - - System.ServiceModel_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;TRACE;NET_3_0;HAS_ACTIVATION - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;TRACE;NET_3_0;HAS_ACTIVATION - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {CB54BC7B-F3CD-43DC-B983-3FFFF41D01E1} - System.ServiceModel\System.ServiceModel-net_4_0-1 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {28265916-A48E-4A4D-A845-2F1C06027D68} - System.Runtime.Serialization\System.Runtime.Serialization-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {E15F571E-B653-4409-AF7C-F478DA81B959} - System.Security\System.Security-net_4_0 - - - {888E3381-24AB-4FA9-B973-FD683B0461D3} - System.IdentityModel\System.IdentityModel-net_4_0 - - - {FCCADAA1-34B7-4F15-933A-1FAA4DAF9871} - System.IdentityModel.Selectors\System.IdentityModel.Selectors-net_4_0 - - - {03A0E889-9E62-423F-B65E-40416E021F1B} - System.Transactions\System.Transactions-net_4_0 - - - {5854BF27-FC35-44F5-BE59-580900694E32} - System.Messaging\System.Messaging-net_4_0 - - - {2AB66C1A-6094-4C45-AF9B-FA85F8D5E98A} - System.Web\System.Web-net_4_0-2 - - - {75EA05AE-77E9-44DA-9ECC-CC5808134137} - System.Web.Services\System.Web.Services-net_4_0 - - - {73940AF7-7302-4B79-8EAF-DF03BDD9E3F4} - Mono.Security\Mono.Security-net_4_0 - - - {1C9B4EFC-57D5-4DEE-9D2F-0B505824623F} - System.ServiceModel.Activation\System.ServiceModel.Activation-net_4_0 - - - {3B707FB5-0AB3-472A-BB49-7598CF2607B0} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_0 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331Test.cs b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331Test.cs index d0e0ea09ba0..ed5fb8b65c9 100644 --- a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331Test.cs +++ b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/Bug652331Test.cs @@ -70,7 +70,7 @@ namespace MonoTests.System.ServiceModel.Dispatcher }; client.GetDataAsync (); - if (!wait.WaitOne (TimeSpan.FromSeconds (10))) + if (!wait.WaitOne (TimeSpan.FromSeconds (20))) Assert.Fail ("timeout"); } finally { serviceHost.Close (); diff --git a/mcs/class/System.ServiceProcess/System.ServiceProcess-net_2_0.csproj b/mcs/class/System.ServiceProcess/System.ServiceProcess-net_2_0.csproj deleted file mode 100644 index 93d4a7a3567..00000000000 --- a/mcs/class/System.ServiceProcess/System.ServiceProcess-net_2_0.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E278AD54-C1F6-49BC-B788-6E412212D0EA} - Library - 1699,618 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.ServiceProcess - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {C8B650EA-042C-4352-8224-03F759A682C6} - System.Configuration.Install\System.Configuration.Install-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.ServiceProcess/System.ServiceProcess-net_4_0.csproj b/mcs/class/System.ServiceProcess/System.ServiceProcess-net_4_0.csproj deleted file mode 100644 index 99508abb968..00000000000 --- a/mcs/class/System.ServiceProcess/System.ServiceProcess-net_4_0.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9716FC54-C30A-485D-B4D3-D9502F6CD296} - Library - 1699,618 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.ServiceProcess - v4.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {29529439-51F1-4953-8A5D-7ED8F7EB8FDB} - System.Configuration.Install\System.Configuration.Install-net_4_0 - - - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Managed.Windows.Forms\System.Windows.Forms-net_4_0 - - - - - - - diff --git a/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_2_0.csproj b/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_2_0.csproj deleted file mode 100644 index 88c736ac4ae..00000000000 --- a/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_2_0.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8CFBFA75-E0ED-4F16-8251-8B55E960A7C2} - Library - 1699,618 - bin\Debug\System.ServiceProcess-tests-net_2_0 - True - False - - Properties - - - System.ServiceProcess_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {E278AD54-C1F6-49BC-B788-6E412212D0EA} - System.ServiceProcess\System.ServiceProcess-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {C8B650EA-042C-4352-8224-03F759A682C6} - System.Configuration.Install\System.Configuration.Install-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_4_0.csproj b/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_4_0.csproj deleted file mode 100644 index aeeef92834c..00000000000 --- a/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_4_0.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {860CF845-5246-45BE-B803-F8B531F24593} - Library - 1699,618 - bin\Debug\System.ServiceProcess-tests-net_4_0 - True - False - - Properties - - - System.ServiceProcess_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {9716FC54-C30A-485D-B4D3-D9502F6CD296} - System.ServiceProcess\System.ServiceProcess-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {29529439-51F1-4953-8A5D-7ED8F7EB8FDB} - System.Configuration.Install\System.Configuration.Install-net_4_0 - - - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Managed.Windows.Forms\System.Windows.Forms-net_4_0 - - - - - - - diff --git a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/ExecutingMessageBoxBase.cs b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/ExecutingMessageBoxBase.cs index b87e8601f5e..d6015665b28 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/ExecutingMessageBoxBase.cs +++ b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/ExecutingMessageBoxBase.cs @@ -136,7 +136,7 @@ namespace System.Threading.Tasks.Dataflow { protected override void OutgoingQueueComplete () { if (MessageQueue.IsCompleted - && Thread.VolatileRead (ref degreeOfParallelism) == 1) + && Volatile.Read (ref degreeOfParallelism) == 1) outgoingQueueComplete (); } @@ -145,7 +145,7 @@ namespace System.Threading.Tasks.Dataflow { /// protected override void VerifyCompleteness () { - if (Thread.VolatileRead (ref degreeOfParallelism) == 1) + if (Volatile.Read (ref degreeOfParallelism) == 1) base.VerifyCompleteness (); } @@ -160,4 +160,4 @@ namespace System.Threading.Tasks.Dataflow { || iteration < Options.MaxMessagesPerTask); } } -} \ No newline at end of file +} diff --git a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/MessageBox.cs b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/MessageBox.cs index 239a610f727..867f803a9aa 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/MessageBox.cs +++ b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/MessageBox.cs @@ -80,7 +80,7 @@ namespace System.Threading.Tasks.Dataflow { return DataflowMessageStatus.DecliningPermanently; var full = options.BoundedCapacity != -1 - && Thread.VolatileRead (ref itemCount) >= options.BoundedCapacity; + && Volatile.Read (ref itemCount) >= options.BoundedCapacity; if (!greedy || full) { if (source == null) return DataflowMessageStatus.Declined; @@ -252,7 +252,7 @@ namespace System.Threading.Tasks.Dataflow { void RetrievePostponed () { // BoundedCapacity can't be -1 here, because in that case there would be no postponing - while (Thread.VolatileRead (ref itemCount) < options.BoundedCapacity + while (Volatile.Read (ref itemCount) < options.BoundedCapacity && !postponedMessages.IsEmpty && !MessageQueue.IsAddingCompleted) { var block = postponedMessages.First ().Key; DataflowMessageHeader header; @@ -286,7 +286,7 @@ namespace System.Threading.Tasks.Dataflow { postponedProcessing.Value = false; // because of race - if ((Thread.VolatileRead (ref itemCount) < options.BoundedCapacity + if ((Volatile.Read (ref itemCount) < options.BoundedCapacity || MessageQueue.IsAddingCompleted) && !postponedMessages.IsEmpty) EnsurePostponedProcessing (); @@ -329,4 +329,4 @@ namespace System.Threading.Tasks.Dataflow { CompHelper.Complete (); } } -} \ No newline at end of file +} diff --git a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/TargetCollection.cs b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/TargetCollection.cs index 8b49b461d1c..cdd9bcb5839 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/TargetCollection.cs +++ b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow/TargetCollection.cs @@ -167,7 +167,7 @@ namespace System.Threading.Tasks.Dataflow { { firstOffering = true; currentItem = item; - Thread.VolatileWrite (ref currentMessageHeaderId, ++lastMessageHeaderId); + Volatile.Write (ref currentMessageHeaderId, ++lastMessageHeaderId); ClearUnpostponed (); } @@ -184,14 +184,14 @@ namespace System.Threading.Tasks.Dataflow { public void ResetCurrentItem () { currentItem = default(T); - Thread.VolatileWrite (ref currentMessageHeaderId, 0); + Volatile.Write (ref currentMessageHeaderId, 0); } /// /// Is there an item to send right now? /// public bool HasCurrentItem { - get { return Thread.VolatileRead (ref currentMessageHeaderId) != 0; } + get { return Volatile.Read (ref currentMessageHeaderId) != 0; } } /// @@ -352,7 +352,7 @@ namespace System.Threading.Tasks.Dataflow { /// public bool VerifyHeader (DataflowMessageHeader header) { - return header.Id == Thread.VolatileRead (ref currentMessageHeaderId); + return header.Id == Volatile.Read (ref currentMessageHeaderId); } } @@ -520,4 +520,4 @@ namespace System.Threading.Tasks.Dataflow { return false; } } -} \ No newline at end of file +} diff --git a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BoundedCapacityTest.cs b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BoundedCapacityTest.cs index 243bf6a74eb..bd8ccb579e0 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BoundedCapacityTest.cs +++ b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BoundedCapacityTest.cs @@ -133,7 +133,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { Assert.GreaterOrEqual (scheduler.ExecuteAll (), 1); - Assert.AreEqual (2, Thread.VolatileRead (ref n)); + Assert.AreEqual (2, Volatile.Read (ref n)); } [Test] @@ -156,7 +156,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { Assert.GreaterOrEqual (scheduler.ExecuteAll (), 1); - Assert.AreEqual (2, Thread.VolatileRead (ref n)); + Assert.AreEqual (2, Volatile.Read (ref n)); } int n; @@ -181,7 +181,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { Assert.IsFalse (transform.Post (102)); - Assert.AreEqual (10000, Thread.VolatileRead (ref n)); + Assert.AreEqual (10000, Volatile.Read (ref n)); } IEnumerable ComputeResults () @@ -318,4 +318,4 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { throw new NotImplementedException (); } } -} \ No newline at end of file +} diff --git a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/ExecutionBlocksTest.cs b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/ExecutionBlocksTest.cs index e4329e7982f..d523a8faa35 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/ExecutionBlocksTest.cs +++ b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/ExecutionBlocksTest.cs @@ -92,7 +92,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { var blocks = GetExecutionBlocksWithAction (() => { - if (Thread.VolatileRead (ref shouldRun) == 0) { + if (Volatile.Read (ref shouldRun) == 0) { ranAfterFault++; return; } @@ -122,7 +122,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { Thread.Sleep (100); - Assert.AreEqual (0, Thread.VolatileRead (ref ranAfterFault)); + Assert.AreEqual (0, Volatile.Read (ref ranAfterFault)); } } @@ -136,7 +136,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { var blocks = GetExecutionBlocksWithAsyncAction ( i => - tcs.Task.ContinueWith (t => Thread.VolatileWrite (ref result, i + t.Result)), + tcs.Task.ContinueWith (t => Volatile.Write (ref result, i + t.Result)), new ExecutionDataflowBlockOptions { TaskScheduler = scheduler }); foreach (var block in blocks) { @@ -160,7 +160,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { Assert.AreEqual (11, result); tcs = new TaskCompletionSource (); - Thread.VolatileWrite (ref result, 0); + Volatile.Write (ref result, 0); } } @@ -196,4 +196,4 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { } } } -} \ No newline at end of file +} diff --git a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/OptionsTest.cs b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/OptionsTest.cs index d59199e3fa0..27fce238a62 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/OptionsTest.cs +++ b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/OptionsTest.cs @@ -215,10 +215,10 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { Assert.IsTrue (action.Post (1)); - Assert.AreEqual (0, Thread.VolatileRead (ref n)); + Assert.AreEqual (0, Volatile.Read (ref n)); Assert.AreEqual (1, scheduler.ExecuteAll ()); - Assert.AreEqual (1, Thread.VolatileRead (ref n)); + Assert.AreEqual (1, Volatile.Read (ref n)); } [Test] @@ -416,4 +416,4 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { new[] { task1.Result, task2.Result }); } } -} \ No newline at end of file +} diff --git a/mcs/class/System.Transactions/System.Transactions-net_2_0.csproj b/mcs/class/System.Transactions/System.Transactions-net_2_0.csproj deleted file mode 100644 index dc3c0d65cfe..00000000000 --- a/mcs/class/System.Transactions/System.Transactions-net_2_0.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Transactions - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - diff --git a/mcs/class/System.Transactions/System.Transactions-net_4_0.csproj b/mcs/class/System.Transactions/System.Transactions-net_4_0.csproj deleted file mode 100644 index 368ac641c07..00000000000 --- a/mcs/class/System.Transactions/System.Transactions-net_4_0.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {03A0E889-9E62-423F-B65E-40416E021F1B} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Transactions - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - - - - - diff --git a/mcs/class/System.Transactions/System.Transactions-tests-net_2_0.csproj b/mcs/class/System.Transactions/System.Transactions-tests-net_2_0.csproj deleted file mode 100644 index 03d36667a88..00000000000 --- a/mcs/class/System.Transactions/System.Transactions-tests-net_2_0.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D8B6CB08-B1BB-464B-82E1-E3276B92B458} - Library - 1699,1595 - bin\Debug\System.Transactions-tests-net_2_0 - True - False - - Properties - - - System.Transactions_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,1595 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,1595 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - diff --git a/mcs/class/System.Transactions/System.Transactions-tests-net_4_0.csproj b/mcs/class/System.Transactions/System.Transactions-tests-net_4_0.csproj deleted file mode 100644 index f899d8747ab..00000000000 --- a/mcs/class/System.Transactions/System.Transactions-tests-net_4_0.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C171BA5C-B2B3-4BE9-97F1-3EDB31C36A77} - Library - 1699,1595 - bin\Debug\System.Transactions-tests-net_4_0 - True - False - - Properties - - - System.Transactions_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,1595 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699,1595 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {03A0E889-9E62-423F-B65E-40416E021F1B} - System.Transactions\System.Transactions-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - - - - - diff --git a/mcs/class/System.Web.Abstractions/Makefile b/mcs/class/System.Web.Abstractions/Makefile index 10afc10c162..991adbe5b4a 100644 --- a/mcs/class/System.Web.Abstractions/Makefile +++ b/mcs/class/System.Web.Abstractions/Makefile @@ -8,17 +8,12 @@ LIB_MCS_FLAGS = \ /r:System.Core.dll \ /r:System.Web.dll -ifeq (2.0, $(FRAMEWORK_VERSION)) -# This is a .NET 3.5 only assembly, but built during the 2.0 build -LIB_MCS_FLAGS += -d:NET_3_5 -endif - TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) EXTRA_DISTFILES = # This is a .NET 3.5+ assembly -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-System.Web.Abstractions.dll NO_INSTALL = yes diff --git a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_2_0.csproj b/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_2_0.csproj deleted file mode 100644 index 84fa3342867..00000000000 --- a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_2_0.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Web.Abstractions - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - - - - - diff --git a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_4_0.csproj b/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_4_0.csproj deleted file mode 100644 index 1e7ad3ecbd4..00000000000 --- a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_4_0.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4D4682F3-E5E3-4167-AA36-F689331C2509} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Web.Abstractions - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {2AB66C1A-6094-4C45-AF9B-FA85F8D5E98A} - System.Web\System.Web-net_4_0-2 - - - - - - - diff --git a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_2_0.csproj b/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_2_0.csproj deleted file mode 100644 index 2ebb0295ec1..00000000000 --- a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_2_0.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D2B91F5B-D914-4C6E-B41F-7DF9CADEB9A9} - Library - 1699 - bin\Debug\System.Web.Abstractions-tests-net_2_0 - True - False - - Properties - - - System.Web.Abstractions_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - System.Web.Abstractions\System.Web.Abstractions-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - - - - - diff --git a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_4_0.csproj b/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_4_0.csproj deleted file mode 100644 index ae1cd760f62..00000000000 --- a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_4_0.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4D2C6AEF-0A7D-4E4A-A0F6-BBFEE9DA9F34} - Library - 1699 - bin\Debug\System.Web.Abstractions-tests-net_4_0 - True - False - - Properties - - - System.Web.Abstractions_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {4D4682F3-E5E3-4167-AA36-F689331C2509} - System.Web.Abstractions\System.Web.Abstractions-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {2AB66C1A-6094-4C45-AF9B-FA85F8D5E98A} - System.Web\System.Web-net_4_0-2 - - - - - - - diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_2_0.csproj b/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_2_0.csproj deleted file mode 100644 index d6390e32540..00000000000 --- a/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_2_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8E128532-4FB9-4D6D-BD07-63025433586B} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - dummy-System.Web.ApplicationServices - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SYSTEM_WEB_APPLICATIONSERVICES - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;SYSTEM_WEB_APPLICATIONSERVICES - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_4_0.csproj b/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_4_0.csproj deleted file mode 100644 index ba67f7416b4..00000000000 --- a/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_4_0.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3B707FB5-0AB3-472A-BB49-7598CF2607B0} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Web.ApplicationServices - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SYSTEM_WEB_APPLICATIONSERVICES - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;SYSTEM_WEB_APPLICATIONSERVICES - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - - - - - diff --git a/mcs/class/System.Web.DynamicData/Makefile b/mcs/class/System.Web.DynamicData/Makefile index 2bfe34c3b2c..7b50cd5e070 100644 --- a/mcs/class/System.Web.DynamicData/Makefile +++ b/mcs/class/System.Web.DynamicData/Makefile @@ -15,11 +15,6 @@ LIB_MCS_FLAGS = \ /r:System.Web.Abstractions.dll \ /r:System.Web.Routing.dll -ifeq (2.0, $(FRAMEWORK_VERSION)) -# This is a .NET 3.5 only assembly, but built during the 2.0 build -LIB_MCS_FLAGS += -d:NET_3_5 -endif - ifeq (4, $(FRAMEWORK_VERSION_MAJOR)) LIB_MCS_FLAGS += -r:System.Web.ApplicationServices.dll endif @@ -186,7 +181,7 @@ endif EXTRA_DISTFILES = $(foreach resource,$(TEST_RESOURCE_FILES), $(shell echo $(subst \`,\\\`,$(resource)) | cut -d ',' -f 1)) # This is a .NET 3.5+ assembly -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-System.Web.DynamicData.dll NO_INSTALL = yes diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_2_0.csproj b/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_2_0.csproj deleted file mode 100644 index b0e5944bd5e..00000000000 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_2_0.csproj +++ /dev/null @@ -1,155 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {413F9BD7-61AE-4F12-8EDE-A7404B2BEE9C} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Web.DynamicData - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {F3112064-6311-48A9-992B-A68DD3C62133} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - System.Data.Linq\System.Data.Linq-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {42527CAE-C932-4518-9CF7-F4ABB44510A5} - System.Web.Extensions\System.Web.Extensions-net_2_0 - - - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - System.Web.Abstractions\System.Web.Abstractions-net_2_0 - - - {A9B310AD-FF67-49ED-8AC8-AAF1E4B05249} - System.Web.Routing\System.Web.Routing-net_2_0 - - - - - - - diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_4_0.csproj b/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_4_0.csproj deleted file mode 100644 index 50006754319..00000000000 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_4_0.csproj +++ /dev/null @@ -1,159 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B52A5C17-3CD0-4B74-8FF4-D115F0B999E4} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Web.DynamicData - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {82CAAC49-507E-446E-A6FB-2C875E8F2C4E} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {EB50CF5B-D17A-4BEF-96C4-874FB8E61ACE} - System.Data.Linq\System.Data.Linq-net_4_0 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {2AB66C1A-6094-4C45-AF9B-FA85F8D5E98A} - System.Web\System.Web-net_4_0-2 - - - {3A327AAD-B09D-47E3-A915-C16BFB3F1682} - System.Web.Extensions\System.Web.Extensions-net_4_0 - - - {4D4682F3-E5E3-4167-AA36-F689331C2509} - System.Web.Abstractions\System.Web.Abstractions-net_4_0 - - - {3EDC0F88-564F-4B98-A50A-471345348F16} - System.Web.Routing\System.Web.Routing-net_4_0 - - - {3B707FB5-0AB3-472A-BB49-7598CF2607B0} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_0 - - - - - - - diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_2_0.csproj b/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_2_0.csproj deleted file mode 100644 index 51a5691f27c..00000000000 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_2_0.csproj +++ /dev/null @@ -1,697 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AD07E068-F605-4F24-A60B-74514641DDDC} - Library - 1699 - bin\Debug\System.Web.DynamicData-tests-net_2_0 - True - False - - Properties - - - System.Web.DynamicData_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {413F9BD7-61AE-4F12-8EDE-A7404B2BEE9C} - System.Web.DynamicData\System.Web.DynamicData-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {F3112064-6311-48A9-992B-A68DD3C62133} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - System.Data.Linq\System.Data.Linq-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {42527CAE-C932-4518-9CF7-F4ABB44510A5} - System.Web.Extensions\System.Web.Extensions-net_2_0 - - - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - System.Web.Abstractions\System.Web.Abstractions-net_2_0 - - - {A9B310AD-FF67-49ED-8AC8-AAF1E4B05249} - System.Web.Routing\System.Web.Routing-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {328B62A2-55C4-420A-81C1-AEAB15A8F3A6} - SystemWebTestShim\SystemWebTestShim-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - MonoTests.WebPages.DynamicData.Content.FilterUserControl.ascx - - - MonoTests.WebPages.DynamicData.Content.FilterUserControl.ascx.cs - - - MonoTests.WebPages.DynamicData.Content.GridViewPager.ascx - - - MonoTests.WebPages.DynamicData.Content.GridViewPager.ascx.cs - - - MonoTests.WebPages.DynamicData.Content.Images.Back.gif - - - MonoTests.WebPages.DynamicData.Content.Images.header_back.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgFirst.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgLast.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgNext.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgPrev.gif - - - MonoTests.WebPages.DynamicData.Content.Images.plus.gif - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Children.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Children.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomColor.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomColor.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomFieldTemplate.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomFieldTemplate.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Decimal_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Decimal_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Integer_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Integer_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.MultilineText_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.MultilineText_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.MyCustomUIHintTemplate_Text.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.MyCustomUIHintTemplate_Text.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte[].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte[].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Char.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Char.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.FooEmpty.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.FooEmpty.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.ICollection.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.ICollection.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.MonoTests.Common.FooEmpty.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.MonoTests.Common.FooEmpty.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Object.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Object.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.SByte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.SByte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.String.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.String.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte[].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte[].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Char.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Char.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.Generic.List`1[System.String].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.Generic.List`1[System.String].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.ICollection.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.ICollection.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Object.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Object.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.SByte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.SByte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.String.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.String.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.PlainControlTemplate.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.PlainControlTemplate.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Details.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Details.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Edit.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Edit.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Insert.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Insert.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.List.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.List.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.ListDetails.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.ListDetails.aspx.cs - - - MonoTests.WebPages.DynamicData.web.config - - - MonoTests.WebPages.Global.asax - - - MonoTests.WebPages.ListView_DynamicControl_01.aspx - - - MonoTests.WebPages.ListView_DynamicControl_01.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_02.aspx - - - MonoTests.WebPages.ListView_DynamicControl_02.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_03.aspx - - - MonoTests.WebPages.ListView_DynamicControl_03.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_04.aspx - - - MonoTests.WebPages.ListView_DynamicControl_04.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_05.aspx - - - MonoTests.WebPages.ListView_DynamicControl_05.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_06.aspx - - - MonoTests.WebPages.ListView_DynamicControl_06.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_07.aspx - - - MonoTests.WebPages.ListView_DynamicControl_07.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_08.aspx - - - MonoTests.WebPages.ListView_DynamicControl_08.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_09.aspx - - - MonoTests.WebPages.ListView_DynamicControl_09.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_10.aspx - - - MonoTests.WebPages.ListView_DynamicControl_10.aspx.cs - - - MonoTests.WebPages.DynamicValidator_01.aspx - - - MonoTests.WebPages.DynamicValidator_01.aspx.cs - - - MonoTests.WebPages.DynamicValidator_02.aspx - - - MonoTests.WebPages.DynamicValidator_02.aspx.cs - - - MonoTests.WebPages.Site.css - - - MonoTests.WebPages.Site.master - - - MonoTests.WebPages.Site.master.cs - - - MonoTests.WebPages.web.config.2.0 - - - MonoTests.WebPages.web.config.4.0 - - - MonoTests.WebPages.web.config.4.5 - - - - diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_4_0.csproj b/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_4_0.csproj deleted file mode 100644 index 09576a03f5f..00000000000 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_4_0.csproj +++ /dev/null @@ -1,701 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B6DE5FC0-11C1-4A18-B140-FFFB4286AF12} - Library - 1699 - bin\Debug\System.Web.DynamicData-tests-net_4_0 - True - False - - Properties - - - System.Web.DynamicData_test_net_4_0 - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {B52A5C17-3CD0-4B74-8FF4-D115F0B999E4} - System.Web.DynamicData\System.Web.DynamicData-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {82CAAC49-507E-446E-A6FB-2C875E8F2C4E} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {EB50CF5B-D17A-4BEF-96C4-874FB8E61ACE} - System.Data.Linq\System.Data.Linq-net_4_0 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {2AB66C1A-6094-4C45-AF9B-FA85F8D5E98A} - System.Web\System.Web-net_4_0-2 - - - {3A327AAD-B09D-47E3-A915-C16BFB3F1682} - System.Web.Extensions\System.Web.Extensions-net_4_0 - - - {4D4682F3-E5E3-4167-AA36-F689331C2509} - System.Web.Abstractions\System.Web.Abstractions-net_4_0 - - - {3EDC0F88-564F-4B98-A50A-471345348F16} - System.Web.Routing\System.Web.Routing-net_4_0 - - - {3B707FB5-0AB3-472A-BB49-7598CF2607B0} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {D4CC2FBC-04C8-446E-915D-69ABC8FFFFAE} - SystemWebTestShim\SystemWebTestShim-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - - - - - - MonoTests.WebPages.DynamicData.Content.FilterUserControl.ascx - - - MonoTests.WebPages.DynamicData.Content.FilterUserControl.ascx.cs - - - MonoTests.WebPages.DynamicData.Content.GridViewPager.ascx - - - MonoTests.WebPages.DynamicData.Content.GridViewPager.ascx.cs - - - MonoTests.WebPages.DynamicData.Content.Images.Back.gif - - - MonoTests.WebPages.DynamicData.Content.Images.header_back.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgFirst.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgLast.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgNext.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgPrev.gif - - - MonoTests.WebPages.DynamicData.Content.Images.plus.gif - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Children.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Children.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomColor.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomColor.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomFieldTemplate.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomFieldTemplate.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Decimal_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Decimal_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Integer_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Integer_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.MultilineText_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.MultilineText_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.MyCustomUIHintTemplate_Text.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.MyCustomUIHintTemplate_Text.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte[].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte[].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Char.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Char.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.FooEmpty.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.FooEmpty.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.ICollection.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.ICollection.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.MonoTests.Common.FooEmpty.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.MonoTests.Common.FooEmpty.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Object.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Object.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.SByte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.SByte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.String.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.String.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte[].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte[].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Char.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Char.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.Generic.List`1[System.String].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.Generic.List`1[System.String].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.ICollection.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.ICollection.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Object.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Object.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.SByte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.SByte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.String.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.String.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.PlainControlTemplate.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.PlainControlTemplate.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Details.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Details.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Edit.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Edit.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Insert.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Insert.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.List.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.List.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.ListDetails.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.ListDetails.aspx.cs - - - MonoTests.WebPages.DynamicData.web.config - - - MonoTests.WebPages.Global.asax - - - MonoTests.WebPages.ListView_DynamicControl_01.aspx - - - MonoTests.WebPages.ListView_DynamicControl_01.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_02.aspx - - - MonoTests.WebPages.ListView_DynamicControl_02.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_03.aspx - - - MonoTests.WebPages.ListView_DynamicControl_03.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_04.aspx - - - MonoTests.WebPages.ListView_DynamicControl_04.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_05.aspx - - - MonoTests.WebPages.ListView_DynamicControl_05.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_06.aspx - - - MonoTests.WebPages.ListView_DynamicControl_06.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_07.aspx - - - MonoTests.WebPages.ListView_DynamicControl_07.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_08.aspx - - - MonoTests.WebPages.ListView_DynamicControl_08.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_09.aspx - - - MonoTests.WebPages.ListView_DynamicControl_09.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_10.aspx - - - MonoTests.WebPages.ListView_DynamicControl_10.aspx.cs - - - MonoTests.WebPages.DynamicValidator_01.aspx - - - MonoTests.WebPages.DynamicValidator_01.aspx.cs - - - MonoTests.WebPages.DynamicValidator_02.aspx - - - MonoTests.WebPages.DynamicValidator_02.aspx.cs - - - MonoTests.WebPages.Site.css - - - MonoTests.WebPages.Site.master - - - MonoTests.WebPages.Site.master.cs - - - MonoTests.WebPages.web.config.2.0 - - - MonoTests.WebPages.web.config.4.0 - - - MonoTests.WebPages.web.config.4.5 - - - - diff --git a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/FieldTemplateFactoryTest.cs b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/FieldTemplateFactoryTest.cs index 4304e0a7f9e..4398b8bf4f5 100644 --- a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/FieldTemplateFactoryTest.cs +++ b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/FieldTemplateFactoryTest.cs @@ -635,11 +635,11 @@ namespace MonoTests.System.Web.DynamicData // Custom type // It appears that DataTypeAttribute's custom type name is passed to BuildVirtualPath - AssertExtensions.Throws (() => { + AssertExtensions.Throws (() => { string path = ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null); }, "#A1"); - AssertExtensions.Throws (() => { + AssertExtensions.Throws (() => { string path = ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "NoSuchTemplate"); }, "#A1-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Boolean.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean"), "#A1-2"); @@ -650,11 +650,11 @@ namespace MonoTests.System.Web.DynamicData Assert.Greater (mc.UIHint.Length, 0, "#A2-1"); // Proves that UIHint on the column is not used, just the uiHint argument - AssertExtensions.Throws (() => { + AssertExtensions.Throws (() => { string path = ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null); }, "#A2-2"); - AssertExtensions.Throws (() => { + AssertExtensions.Throws (() => { string path = ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "NoSuchTemplate"); }, "#A2-3"); diff --git a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/MetaColumnTest.cs b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/MetaColumnTest.cs index e2e1e24b154..42770dc446e 100644 --- a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/MetaColumnTest.cs +++ b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/MetaColumnTest.cs @@ -110,32 +110,32 @@ namespace MonoTests.System.Web.DynamicData MetaColumn mc = t.GetColumn ("ColumnNoAttributes"); Assert.IsNotNull (mc, "#A1"); Assert.IsNotNull (mc.Attributes, "#A2"); - Assert.AreEqual (6, mc.Attributes.Count, "#A3"); + Assert.AreEqual (5, mc.Attributes.Count, "#A3"); Assert.IsTrue (mc.IsRequired, "#A3-1"); mc = t.GetColumn ("ColumnFormatInEditMode"); Assert.IsNotNull (mc, "#A4"); Assert.IsNotNull (mc.Attributes, "#A4-1"); - Assert.AreEqual (7, mc.Attributes.Count, "#A4-2"); + Assert.AreEqual (6, mc.Attributes.Count, "#A4-2"); Assert.AreEqual (1, mc.Attributes.OfType ().Count (), "#A4-3"); mc = t.GetColumn ("ColumnWithDataType"); Assert.IsNotNull (mc, "#A5"); Assert.IsNotNull (mc.Attributes, "#A5-1"); - Assert.AreEqual (7, mc.Attributes.Count, "#A5-2"); + Assert.AreEqual (6, mc.Attributes.Count, "#A5-2"); Assert.AreEqual (1, mc.Attributes.OfType ().Count (), "#A5-3"); t = m.Tables[TestDataContext.TableFooWithMetadataType]; mc = t.GetColumn ("Column1"); Assert.IsNotNull (mc, "#B1"); Assert.IsNotNull (mc.Attributes, "#B1-1"); - Assert.AreEqual (9, mc.Attributes.Count, "#B1-2"); + Assert.AreEqual (8, mc.Attributes.Count, "#B1-2"); Assert.AreEqual (1, mc.Attributes.OfType ().Count (), "#B1-3"); mc = t.GetColumn ("Column2"); Assert.IsNotNull (mc, "#B2"); Assert.IsNotNull (mc.Attributes, "#B2-1"); - Assert.AreEqual (8, mc.Attributes.Count, "#B2-2"); + Assert.AreEqual (7, mc.Attributes.Count, "#B2-2"); Assert.AreEqual (1, mc.Attributes.OfType ().Count (), "#B2-3"); } diff --git a/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_2_0.csproj b/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_2_0.csproj deleted file mode 100644 index cd618541215..00000000000 --- a/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_2_0.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BC7F5750-D8B4-4D81-B5CE-F7923B3A5AEA} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Web.Extensions.Design - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {31BD6BF1-0C7A-4C0A-AB48-091F2EBB4AAC} - System.Design\System.Design-net_2_0-1 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_4_0.csproj b/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_4_0.csproj deleted file mode 100644 index fe98426afdc..00000000000 --- a/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_4_0.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {98E79AFE-7DC9-46E0-842B-A508D9743559} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - - Properties - - - System.Web.Extensions.Design - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {7D002453-8C26-4B11-8A26-B19877B73BDC} - System.Design\System.Design-net_4_0-1 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {0A54FEB2-B90B-42CA-AB24-744302ABCB3E} - Managed.Windows.Forms\System.Windows.Forms-net_4_0 - - - - - - - diff --git a/mcs/class/System.Web.Extensions.Design_1.0/System.Web.Extensions.Design_1.0-net_2_0.csproj b/mcs/class/System.Web.Extensions.Design_1.0/System.Web.Extensions.Design_1.0-net_2_0.csproj deleted file mode 100644 index 93c968c096c..00000000000 --- a/mcs/class/System.Web.Extensions.Design_1.0/System.Web.Extensions.Design_1.0-net_2_0.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A4D4C8B5-6C55-48C4-8C47-F394D5979079} - Library - 1699 - ./../../class/compat/net_2_0 - True - True - - Properties - - - System.Web.Extensions.Design - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {31BD6BF1-0C7A-4C0A-AB48-091F2EBB4AAC} - System.Design\System.Design-net_2_0-1 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.Web.Extensions/System.Web.Extensions-net_2_0.csproj b/mcs/class/System.Web.Extensions/System.Web.Extensions-net_2_0.csproj deleted file mode 100644 index 0da8da8dde0..00000000000 --- a/mcs/class/System.Web.Extensions/System.Web.Extensions-net_2_0.csproj +++ /dev/null @@ -1,283 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {42527CAE-C932-4518-9CF7-F4ABB44510A5} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Web.Extensions - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - System.Data.Linq\System.Data.Linq-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - - - - - - MicrosoftAjax.debug.js - - - MicrosoftAjax.js - - - MicrosoftAjaxTimer.debug.js - - - MicrosoftAjaxTimer.js - - - MicrosoftAjaxWebForms.debug.js - - - MicrosoftAjaxWebForms.js - - - - diff --git a/mcs/class/System.Web.Extensions/System.Web.Extensions-net_4_0.csproj b/mcs/class/System.Web.Extensions/System.Web.Extensions-net_4_0.csproj deleted file mode 100644 index 3b91bbd6477..00000000000 --- a/mcs/class/System.Web.Extensions/System.Web.Extensions-net_4_0.csproj +++ /dev/null @@ -1,287 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3A327AAD-B09D-47E3-A915-C16BFB3F1682} - Library - 1699 - ./../../class/lib/net_4_0 - True - True - true - Properties - - - System.Web.Extensions - v4.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {EB50CF5B-D17A-4BEF-96C4-874FB8E61ACE} - System.Data.Linq\System.Data.Linq-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {2AB66C1A-6094-4C45-AF9B-FA85F8D5E98A} - System.Web\System.Web-net_4_0-2 - - - {75EA05AE-77E9-44DA-9ECC-CC5808134137} - System.Web.Services\System.Web.Services-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {C8124AA3-044F-4027-BD71-4810346B8FB6} - System.EnterpriseServices\System.EnterpriseServices-net_4_0 - - - {49578558-7849-4977-B029-8ECFA79C79E8} - System.ServiceModel\System.ServiceModel-net_4_0 - - - {3B707FB5-0AB3-472A-BB49-7598CF2607B0} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_0 - - - - - - - - MicrosoftAjax.debug.js - - - MicrosoftAjax.js - - - MicrosoftAjaxTimer.debug.js - - - MicrosoftAjaxTimer.js - - - MicrosoftAjaxWebForms.debug.js - - - MicrosoftAjaxWebForms.js - - - - diff --git a/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_2_0.csproj b/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_2_0.csproj deleted file mode 100644 index e6db9f6af0a..00000000000 --- a/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_2_0.csproj +++ /dev/null @@ -1,253 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1F2F06C1-46F5-4297-B417-61C7648D9C1F} - Library - 1699,219,169,1591 - bin\Debug\System.Web.Extensions-tests-net_2_0 - True - False - true - Properties - - - System.Web.Extensions_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,219,169,1591 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;SYSTEM_WEB_EXTENSIONS;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - pdbonly - 1699,219,169,1591 - true - NET_1_1;NET_2_0;NET_3_5;SYSTEM_WEB_EXTENSIONS;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {42527CAE-C932-4518-9CF7-F4ABB44510A5} - System.Web.Extensions\System.Web.Extensions-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - System.Data.Linq\System.Data.Linq-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {328B62A2-55C4-420A-81C1-AEAB15A8F3A6} - SystemWebTestShim\SystemWebTestShim-net_2_0 - - - - - - - - MicrosoftAjax.debug.js - - - MicrosoftAjax.js - - - MicrosoftAjaxTimer.debug.js - - - MicrosoftAjaxTimer.js - - - MicrosoftAjaxWebForms.debug.js - - - MicrosoftAjaxWebForms.js - - - Web.mono.config - - - profile.config.4.5 - - - profile.config.4.0 - - - profile.config.2.0 - - - ListViewSort.aspx - - - ListViewTest.aspx - - - ListViewTotalRowCount_Bug535701_1.aspx - - - ListViewTotalRowCount_Bug535701_2.aspx - - - ListViewTotalRowCount_Bug604053.aspx - - - MyPage.aspx.cs - - - Global.asax - - - My.ashx - - - MyPage.aspx - - - MyPageWithDerivedMaster.aspx - - - MyPageWithMaster.aspx - - - MyPageWithMasterInvalidPlaceHolder.aspx - - - My.master - - - MyDerived.master - - - - diff --git a/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_4_0.csproj b/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_4_0.csproj deleted file mode 100644 index 890da2784da..00000000000 --- a/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_4_0.csproj +++ /dev/null @@ -1,257 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {195974C6-5A5F-421C-B96D-5C53825BBDDD} - Library - 1699,219,169,1591 - bin\Debug\System.Web.Extensions-tests-net_4_0 - True - False - true - Properties - - - System.Web.Extensions_test_net_4_0 - v4.0 - 512 - - - true - full - 1699,219,169,1591 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;SYSTEM_WEB_EXTENSIONS;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - pdbonly - 1699,219,169,1591 - true - NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_3_5;SYSTEM_WEB_EXTENSIONS;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F42F5509-677F-4C93-A026-047AB6153801} - corlib\corlib-net_4_0 - - - {3A327AAD-B09D-47E3-A915-C16BFB3F1682} - System.Web.Extensions\System.Web.Extensions-net_4_0 - - - {3391D58D-26E9-48D2-9A76-4BC1A2F06BE9} - System\System-net_4_0-2 - - - {8B53B0E9-E0CA-4378-8C57-F85D518871D3} - System.Core\System.Core-net_4_0 - - - {01A426C8-6E24-4DCF-B6BE-177FF4FBD4BC} - System.Drawing\System.Drawing-net_4_0 - - - {0ADBE502-5524-4312-81B0-8456328C367C} - System.Data\System.Data-net_4_0 - - - {EB50CF5B-D17A-4BEF-96C4-874FB8E61ACE} - System.Data.Linq\System.Data.Linq-net_4_0 - - - {3FFA80F7-ACB9-480C-828F-7C9BA7A17EE3} - System.XML\System.Xml-net_4_0-1 - - - {2AB66C1A-6094-4C45-AF9B-FA85F8D5E98A} - System.Web\System.Web-net_4_0-2 - - - {75EA05AE-77E9-44DA-9ECC-CC5808134137} - System.Web.Services\System.Web.Services-net_4_0 - - - {BC3505BA-1086-45B4-92AC-EB589CC1292F} - System.Configuration\System.Configuration-net_4_0 - - - {C8124AA3-044F-4027-BD71-4810346B8FB6} - System.EnterpriseServices\System.EnterpriseServices-net_4_0 - - - {49578558-7849-4977-B029-8ECFA79C79E8} - System.ServiceModel\System.ServiceModel-net_4_0 - - - {3B707FB5-0AB3-472A-BB49-7598CF2607B0} - System.Web.ApplicationServices\System.Web.ApplicationServices-net_4_0 - - - {D4CC2FBC-04C8-446E-915D-69ABC8FFFFAE} - SystemWebTestShim\SystemWebTestShim-net_4_0 - - - - - - - - MicrosoftAjax.debug.js - - - MicrosoftAjax.js - - - MicrosoftAjaxTimer.debug.js - - - MicrosoftAjaxTimer.js - - - MicrosoftAjaxWebForms.debug.js - - - MicrosoftAjaxWebForms.js - - - Web.mono.config - - - profile.config.4.5 - - - profile.config.4.0 - - - profile.config.2.0 - - - ListViewSort.aspx - - - ListViewTest.aspx - - - ListViewTotalRowCount_Bug535701_1.aspx - - - ListViewTotalRowCount_Bug535701_2.aspx - - - ListViewTotalRowCount_Bug604053.aspx - - - MyPage.aspx.cs - - - Global.asax - - - My.ashx - - - MyPage.aspx - - - MyPageWithDerivedMaster.aspx - - - MyPageWithMaster.aspx - - - MyPageWithMasterInvalidPlaceHolder.aspx - - - My.master - - - MyDerived.master - - - - diff --git a/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListViewDataItem.cs b/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListViewDataItem.cs index 5af83ada28b..7944ff08d64 100644 --- a/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListViewDataItem.cs +++ b/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListViewDataItem.cs @@ -1,5 +1,5 @@ // -// System.Web.UI.WebControls.ListView +// System.Web.UI.WebControls.ListViewDataItem // // Authors: // Marek Habersack (mhabersack@novell.com) @@ -52,6 +52,7 @@ namespace System.Web.UI.WebControls return base.OnBubbleEvent (source, e); } +#if !NET_4_0 public virtual object DataItem { get; set; @@ -66,6 +67,7 @@ namespace System.Web.UI.WebControls get; private set; } +#endif } } #endif diff --git a/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListViewItem.cs b/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListViewItem.cs index 73a0c2d5e53..c73332b2613 100644 --- a/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListViewItem.cs +++ b/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListViewItem.cs @@ -1,5 +1,5 @@ // -// System.Web.UI.WebControls.ListView +// System.Web.UI.WebControls.ListViewItem // // Authors: // Marek Habersack (mhabersack@novell.com) @@ -35,6 +35,9 @@ namespace System.Web.UI.WebControls { [ToolboxItemAttribute (false)] public class ListViewItem : Control, INamingContainer +#if NET_4_0 + , IDataItemContainer +#endif { internal ListViewItem () : this (ListViewItemType.DataItem) @@ -61,6 +64,23 @@ namespace System.Web.UI.WebControls get; private set; } + +#if NET_4_0 + public virtual object DataItem { + get; + set; + } + + public virtual int DataItemIndex { + get; + protected set; + } + + public virtual int DisplayIndex { + get; + protected set; + } +#endif } } #endif diff --git a/mcs/class/System.Web.Extensions_1.0/System.Web.Extensions_1.0-net_2_0.csproj b/mcs/class/System.Web.Extensions_1.0/System.Web.Extensions_1.0-net_2_0.csproj deleted file mode 100644 index 84aae7336e9..00000000000 --- a/mcs/class/System.Web.Extensions_1.0/System.Web.Extensions_1.0-net_2_0.csproj +++ /dev/null @@ -1,253 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5B5CA61A-0901-40B5-B56A-D0A6E67DDA66} - Library - 1699 - ./../../class/compat/net_2_0 - True - True - true - Properties - - - System.Web.Extensions - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - - - - - - MicrosoftAjax.debug.js - - - MicrosoftAjax.js - - - MicrosoftAjaxTimer.debug.js - - - MicrosoftAjaxTimer.js - - - MicrosoftAjaxWebForms.debug.js - - - MicrosoftAjaxWebForms.js - - - - diff --git a/mcs/class/System.Web.Mvc/.gitattributes b/mcs/class/System.Web.Mvc/.gitattributes deleted file mode 100644 index 82f4994cac1..00000000000 --- a/mcs/class/System.Web.Mvc/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/GlobalSuppressions.cs -crlf -/license.htm -crlf diff --git a/mcs/class/System.Web.Mvc/ChangeLog b/mcs/class/System.Web.Mvc/ChangeLog deleted file mode 100644 index 3815b79811d..00000000000 --- a/mcs/class/System.Web.Mvc/ChangeLog +++ /dev/null @@ -1,23 +0,0 @@ -2010-03-15 Marek Habersack - - * Makefile (LIBRARY_COMPAT): added - this lib is installed in the - compat dir. - -2010-02-17 Marek Habersack - - * Makefile: RESX_RES is no more, it was replaced with - RESOURCES. Fixes bug #580594 - -2009-08-13 Marek Habersack - - * Makefile: build only in the 2.0 profile, or otherwise we'll end - up with the resulting assembly referencing the 4.0 corlib. - -2009-04-21 Marek Habersack - - * Makefile: fixed resource ID generation. - -2009-04-02 Marek Habersack - - * Initial import of ASP.NET MVC 1.0 - diff --git a/mcs/class/System.Web.Mvc/GlobalSuppressions.cs b/mcs/class/System.Web.Mvc/GlobalSuppressions.cs deleted file mode 100644 index 040d0faadc2..00000000000 --- a/mcs/class/System.Web.Mvc/GlobalSuppressions.cs +++ /dev/null @@ -1,23 +0,0 @@ -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. -// -// To add a suppression to this file, right-click the message in the -// Error List, point to "Suppress Message(s)", and click -// "In Project Suppression File". -// You do not need to add suppressions to this file manually. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Scope = "member", Target = "System.Web.Mvc.TempDataDictionary.#System.Collections.Generic.ICollection`1>.Contains(System.Collections.Generic.KeyValuePair`2)", - Justification = "There are no defined scenarios for wanting to derive from this class, but we don't want to prevent it either.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Scope = "member", Target = "System.Web.Mvc.TempDataDictionary.#System.Collections.Generic.ICollection`1>.CopyTo(System.Collections.Generic.KeyValuePair`2[],System.Int32)", - Justification = "There are no defined scenarios for wanting to derive from this class, but we don't want to prevent it either.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Scope = "member", Target = "System.Web.Mvc.TempDataDictionary.#System.Collections.Generic.ICollection`1>.IsReadOnly", - Justification = "There are no defined scenarios for wanting to derive from this class, but we don't want to prevent it either.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Web.Mvc.Ajax", - Justification = "Helpers reside within a separate namespace to support alternate helper classes.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Portability", "CA1903:UseOnlyApiFromTargetedFramework", MessageId = "System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", - Justification = "The referenced assembly is bin-deployable, so we do not have an SP1 dependency.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Portability", "CA1903:UseOnlyApiFromTargetedFramework", MessageId = "System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", - Justification = "The referenced assembly is bin-deployable, so we do not have an SP1 dependency.")] - diff --git a/mcs/class/System.Web.Mvc/Makefile b/mcs/class/System.Web.Mvc/Makefile deleted file mode 100644 index 4243537b2d6..00000000000 --- a/mcs/class/System.Web.Mvc/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -thisdir = class/System.Web.Mvc -SUBDIRS = -include ../../build/rules.make - -LIBRARY = System.Web.Mvc.dll -LIBRARY_COMPAT = yes - -RESX_DIST = System.Web.Mvc/Resources/MvcResources.resx - -LIB_MCS_FLAGS = \ - /r:System.dll \ - /r:System.Core.dll \ - /r:System.Configuration.dll \ - /r:System.Data.dll \ - /r:System.Xml.dll \ - /r:System.Web.dll \ - /r:System.Web.Abstractions.dll \ - /r:System.Web.Routing.dll \ - /r:System.Web.Extensions.dll \ - $(foreach r, $(RESOURCES), /resource:$(r),System.Web.Mvc.Resources.$(notdir $(r))) - -ifeq (2.0, $(FRAMEWORK_VERSION)) -# This is a .NET 3.5 only assembly, but built during the 2.0 build -LIB_MCS_FLAGS += -d:NET_3_5 -d:MONO -endif - -EXTRA_DISTFILES = $(RESX_DIST) license.htm - -# This is a .NET 3.5+ assembly - it must be built ONLY in the 2.0 profile -VALID_PROFILE := $(filter net_2_0, $(PROFILE)) -ifndef VALID_PROFILE -LIBRARY_NAME = dummy-System.Web.Mvc.dll -NO_INSTALL = yes -NO_SIGN_ASSEMBLY = yes -NO_TEST = yes -else -RESOURCES = $(RESX_DIST:.resx=.resources) -endif - -include ../../build/library.make - -$(build_lib): $(RESOURCES) - -$(RESOURCES): %.resources: %.resx - $(RESGEN) `echo $< | $(PLATFORM_CHANGE_SEPARATOR_CMD)` diff --git a/mcs/class/System.Web.Mvc/Mvc b/mcs/class/System.Web.Mvc/Mvc deleted file mode 100644 index 2a2c951da1e..00000000000 --- a/mcs/class/System.Web.Mvc/Mvc +++ /dev/null @@ -1 +0,0 @@ -System.Web.Mvc \ No newline at end of file diff --git a/mcs/class/System.Web.Mvc/Properties/.gitattributes b/mcs/class/System.Web.Mvc/Properties/.gitattributes deleted file mode 100644 index f7d8287f511..00000000000 --- a/mcs/class/System.Web.Mvc/Properties/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/AssemblyInfo.cs -crlf diff --git a/mcs/class/System.Web.Mvc/Properties/AssemblyInfo.cs b/mcs/class/System.Web.Mvc/Properties/AssemblyInfo.cs deleted file mode 100644 index 1bc4e38e32e..00000000000 --- a/mcs/class/System.Web.Mvc/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -using System; -using System.Diagnostics.CodeAnalysis; -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("System.Web.Mvc.dll")] -[assembly: AssemblyDescription("System.Web.Mvc.dll")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft Corporation")] -[assembly: AssemblyProduct("Microsoft® .NET Framework")] -[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4b5f4208-c6b0-4c37-9a41-63325ffa52ad")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.40310.0")] - -[assembly: AllowPartiallyTrustedCallers] -[assembly: SecurityTransparent] -[assembly: CLSCompliant(true)] -[assembly: NeutralResourcesLanguage("en-US")] - -[assembly: AssemblyDelaySign (true)] -[assembly: AssemblyKeyFile("../winfx.pub")] diff --git a/mcs/class/System.Web.Mvc/Properties/ChangeLog b/mcs/class/System.Web.Mvc/Properties/ChangeLog deleted file mode 100644 index 3407eea989a..00000000000 --- a/mcs/class/System.Web.Mvc/Properties/ChangeLog +++ /dev/null @@ -1,5 +0,0 @@ -2009-04-02 Marek Habersack - - * AssemblyInfo.cs: added Mono specific attributes to delay-sign - the assembly with the winfx.pub key. - diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc-net_2_0.csproj b/mcs/class/System.Web.Mvc/System.Web.Mvc-net_2_0.csproj deleted file mode 100644 index 2517e756412..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc-net_2_0.csproj +++ /dev/null @@ -1,272 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {268C75DA-7F8A-4402-B143-ABAF2A7D97C9} - Library - 1699 - ./../../class/compat/net_2_0 - True - True - - Properties - - - System.Web.Mvc - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;MONO - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5;MONO - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - System.Web.Abstractions\System.Web.Abstractions-net_2_0 - - - {A9B310AD-FF67-49ED-8AC8-AAF1E4B05249} - System.Web.Routing\System.Web.Routing-net_2_0 - - - {5B5CA61A-0901-40B5-B56A-D0A6E67DDA66} - System.Web.Extensions_1.0\System.Web.Extensions_1.0-net_2_0 - - - - - - - - System.Web.Mvc.Resources.MvcResources.resources - - - - diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc.csproj b/mcs/class/System.Web.Mvc/System.Web.Mvc.csproj deleted file mode 100644 index 6d43cebad6f..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc.csproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3D3FFD8A-624D-4E9B-954B-E1C105507975} - Library - Properties - System.Web - System.Web.Mvc - v3.5 - 512 - prompt - 4 - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - - - pdbonly - true - bin\Release\ - TRACE - - - - - - 3.5 - - - - - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ASPXCodeBehind - - - ASPXCodeBehind - - - ASPXCodeBehind - - - ASPXCodeBehind - - - - - ASPXCodeBehind - - - ASPXCodeBehind - - - - - - - True - True - MvcResources.resx - - - - - ResXFileCodeGenerator - MvcResources.Designer.cs - Designer - - - - - \ No newline at end of file diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc.dll.sources b/mcs/class/System.Web.Mvc/System.Web.Mvc.dll.sources deleted file mode 100644 index 1f440dd273f..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc.dll.sources +++ /dev/null @@ -1,156 +0,0 @@ -../../build/common/Consts.cs -../../build/common/MonoTODOAttribute.cs -GlobalSuppressions.cs -Properties/AssemblyInfo.cs -System.Web.Mvc/Resources/MvcResources.Designer.cs -System.Web.Mvc/AcceptVerbsAttribute.cs -System.Web.Mvc/ActionDescriptor.cs -System.Web.Mvc/ActionExecutedContext.cs -System.Web.Mvc/ActionExecutingContext.cs -System.Web.Mvc/ActionFilterAttribute.cs -System.Web.Mvc/ActionMethodDispatcherCache.cs -System.Web.Mvc/ActionMethodDispatcher.cs -System.Web.Mvc/ActionMethodSelectorAttribute.cs -System.Web.Mvc/ActionMethodSelectorCache.cs -System.Web.Mvc/ActionMethodSelector.cs -System.Web.Mvc/ActionNameAttribute.cs -System.Web.Mvc/ActionNameSelectorAttribute.cs -System.Web.Mvc/ActionResult.cs -System.Web.Mvc/ActionSelector.cs -System.Web.Mvc/AntiForgeryData.cs -System.Web.Mvc/AntiForgeryDataSerializer.cs -System.Web.Mvc/Ajax/AjaxExtensions.cs -System.Web.Mvc/Ajax/AjaxOptions.cs -System.Web.Mvc/AjaxHelper`1.cs -System.Web.Mvc/AjaxHelper.cs -System.Web.Mvc/Ajax/InsertionMode.cs -System.Web.Mvc/AjaxRequestExtensions.cs -System.Web.Mvc/AntiForgeryToken.cs -System.Web.Mvc/AntiForgeryTokenSerializer.cs -System.Web.Mvc/AuthorizationContext.cs -System.Web.Mvc/AuthorizeAttribute.cs -System.Web.Mvc/BindAttribute.cs -System.Web.Mvc/BuildManagerWrapper.cs -System.Web.Mvc/ContentResult.cs -System.Web.Mvc/ControllerActionInvoker.cs -System.Web.Mvc/ControllerBase.cs -System.Web.Mvc/ControllerBuilder.cs -System.Web.Mvc/ControllerContext.cs -System.Web.Mvc/Controller.cs -System.Web.Mvc/ControllerDescriptorCache.cs -System.Web.Mvc/ControllerDescriptor.cs -System.Web.Mvc/ControllerTypeCache.cs -System.Web.Mvc/CustomModelBinderAttribute.cs -System.Web.Mvc/DefaultControllerFactory.cs -System.Web.Mvc/DefaultModelBinder.cs -System.Web.Mvc/DefaultViewLocationCache.cs -System.Web.Mvc/DescriptorUtil.cs -System.Web.Mvc/DictionaryHelpers.cs -System.Web.Mvc/EmptyResult.cs -System.Web.Mvc/ExceptionContext.cs -System.Web.Mvc/FileContentResult.cs -System.Web.Mvc/FilePathResult.cs -System.Web.Mvc/FileResult.cs -System.Web.Mvc/FileStreamResult.cs -System.Web.Mvc/FilterAttribute.cs -System.Web.Mvc/FilterInfo.cs -System.Web.Mvc/FormCollection.cs -System.Web.Mvc/FormMethod.cs -System.Web.Mvc/HandleErrorAttribute.cs -System.Web.Mvc/HandleErrorInfo.cs -System.Web.Mvc/Html/FormExtensions.cs -System.Web.Mvc/HtmlHelper`1.cs -System.Web.Mvc/HtmlHelper.cs -System.Web.Mvc/Html/InputExtensions.cs -System.Web.Mvc/Html/LinkExtensions.cs -System.Web.Mvc/Html/MvcForm.cs -System.Web.Mvc/Html/RenderPartialExtensions.cs -System.Web.Mvc/Html/SelectExtensions.cs -System.Web.Mvc/Html/TextAreaExtensions.cs -System.Web.Mvc/Html/ValidationExtensions.cs -System.Web.Mvc/HttpAntiForgeryException.cs -System.Web.Mvc/HttpPostedFileBaseModelBinder.cs -System.Web.Mvc/HttpUnauthorizedResult.cs -System.Web.Mvc/HttpVerbs.cs -System.Web.Mvc/IActionFilter.cs -System.Web.Mvc/IActionInvoker.cs -System.Web.Mvc/IAuthorizationFilter.cs -System.Web.Mvc/IBuildManager.cs -System.Web.Mvc/IController.cs -System.Web.Mvc/IControllerFactory.cs -System.Web.Mvc/IExceptionFilter.cs -System.Web.Mvc/IModelBinder.cs -System.Web.Mvc/InputType.cs -System.Web.Mvc/IResultFilter.cs -System.Web.Mvc/ITempDataProvider.cs -System.Web.Mvc/IView.cs -System.Web.Mvc/IViewDataContainer.cs -System.Web.Mvc/IViewEngine.cs -System.Web.Mvc/IViewLocationCache.cs -System.Web.Mvc/JavaScriptResult.cs -System.Web.Mvc/JsonResult.cs -System.Web.Mvc/ModelBinderAttribute.cs -System.Web.Mvc/ModelBinderDictionary.cs -System.Web.Mvc/ModelBinders.cs -System.Web.Mvc/ModelBindingContext.cs -System.Web.Mvc/ModelErrorCollection.cs -System.Web.Mvc/ModelError.cs -System.Web.Mvc/ModelState.cs -System.Web.Mvc/ModelStateDictionary.cs -System.Web.Mvc/MultiSelectList.cs -System.Web.Mvc/MvcHandler.cs -System.Web.Mvc/MvcHttpHandler.cs -System.Web.Mvc/MvcRouteHandler.cs -System.Web.Mvc/NameValueCollectionExtensions.cs -System.Web.Mvc/NonActionAttribute.cs -System.Web.Mvc/NullViewLocationCache.cs -System.Web.Mvc/OutputCacheAttribute.cs -System.Web.Mvc/ParameterBindingInfo.cs -System.Web.Mvc/ParameterDescriptor.cs -System.Web.Mvc/PartialViewResult.cs -System.Web.Mvc/PathHelpers.cs -System.Web.Mvc/ReaderWriterCache`2.cs -System.Web.Mvc/RedirectResult.cs -System.Web.Mvc/RedirectToRouteResult.cs -System.Web.Mvc/ReflectedActionDescriptor.cs -System.Web.Mvc/ReflectedControllerDescriptor.cs -System.Web.Mvc/ReflectedParameterBindingInfo.cs -System.Web.Mvc/ReflectedParameterDescriptor.cs -System.Web.Mvc/ResultExecutedContext.cs -System.Web.Mvc/ResultExecutingContext.cs -System.Web.Mvc/RouteCollectionExtensions.cs -System.Web.Mvc/RouteValuesHelpers.cs -System.Web.Mvc/SelectList.cs -System.Web.Mvc/SelectListItem.cs -System.Web.Mvc/SessionStateTempDataProvider.cs -System.Web.Mvc/TagBuilder.cs -System.Web.Mvc/TagRenderMode.cs -System.Web.Mvc/TempDataDictionary.cs -System.Web.Mvc/TypeHelpers.cs -System.Web.Mvc/UrlHelper.cs -System.Web.Mvc/ValidateAntiForgeryTokenAttribute.cs -System.Web.Mvc/ValidateInputAttribute.cs -System.Web.Mvc/ValueProviderDictionary.cs -System.Web.Mvc/ValueProviderResult.cs -System.Web.Mvc/ViewContext.cs -System.Web.Mvc/ViewDataDictionary`1.cs -System.Web.Mvc/ViewDataDictionary.cs -System.Web.Mvc/ViewEngineCollection.cs -System.Web.Mvc/ViewEngineResult.cs -System.Web.Mvc/ViewEngines.cs -System.Web.Mvc/ViewMasterPage`1.cs -System.Web.Mvc/ViewMasterPage.cs -System.Web.Mvc/ViewPage`1.cs -System.Web.Mvc/ViewPageControlBuilder.cs -System.Web.Mvc/ViewPage.cs -System.Web.Mvc/ViewResultBase.cs -System.Web.Mvc/ViewResult.cs -System.Web.Mvc/ViewTypeControlBuilder.cs -System.Web.Mvc/ViewType.cs -System.Web.Mvc/ViewTypeParserFilter.cs -System.Web.Mvc/ViewUserControl`1.cs -System.Web.Mvc/ViewUserControlControlBuilder.cs -System.Web.Mvc/ViewUserControl.cs -System.Web.Mvc/VirtualPathProviderViewEngine.cs -System.Web.Mvc/WebFormView.cs -System.Web.Mvc/WebFormViewEngine.cs diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/.gitattributes b/mcs/class/System.Web.Mvc/System.Web.Mvc/.gitattributes deleted file mode 100644 index 7f24bae56c5..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/.gitattributes +++ /dev/null @@ -1,139 +0,0 @@ -/AcceptVerbsAttribute.cs -crlf -/ActionDescriptor.cs -crlf -/ActionExecutedContext.cs -crlf -/ActionExecutingContext.cs -crlf -/ActionFilterAttribute.cs -crlf -/ActionMethodDispatcher.cs -crlf -/ActionMethodDispatcherCache.cs -crlf -/ActionMethodSelector.cs -crlf -/ActionMethodSelectorAttribute.cs -crlf -/ActionMethodSelectorCache.cs -crlf -/ActionNameAttribute.cs -crlf -/ActionNameSelectorAttribute.cs -crlf -/ActionResult.cs -crlf -/ActionSelector.cs -crlf -/AjaxHelper.cs -crlf -/AjaxHelper`1.cs -crlf -/AjaxRequestExtensions.cs -crlf -/AntiForgeryData.cs -crlf -/AntiForgeryDataSerializer.cs -crlf -/AntiForgeryToken.cs -crlf -/AntiForgeryTokenSerializer.cs -crlf -/AuthorizationContext.cs -crlf -/AuthorizeAttribute.cs -crlf -/BindAttribute.cs -crlf -/BuildManagerWrapper.cs -crlf -/ContentResult.cs -crlf -/Controller.cs -crlf -/ControllerActionInvoker.cs -crlf -/ControllerBase.cs -crlf -/ControllerBuilder.cs -crlf -/ControllerContext.cs -crlf -/ControllerDescriptor.cs -crlf -/ControllerDescriptorCache.cs -crlf -/ControllerTypeCache.cs -crlf -/CustomModelBinderAttribute.cs -crlf -/DefaultControllerFactory.cs -crlf -/DefaultViewLocationCache.cs -crlf -/DescriptorUtil.cs -crlf -/DictionaryHelpers.cs -crlf -/EmptyResult.cs -crlf -/ExceptionContext.cs -crlf -/FileContentResult.cs -crlf -/FilePathResult.cs -crlf -/FileResult.cs -crlf -/FileStreamResult.cs -crlf -/FilterAttribute.cs -crlf -/FilterInfo.cs -crlf -/FormCollection.cs -crlf -/FormMethod.cs -crlf -/HandleErrorAttribute.cs -crlf -/HandleErrorInfo.cs -crlf -/HtmlHelper.cs -crlf -/HtmlHelper`1.cs -crlf -/HttpAntiForgeryException.cs -crlf -/HttpPostedFileBaseModelBinder.cs -crlf -/HttpUnauthorizedResult.cs -crlf -/HttpVerbs.cs -crlf -/IActionFilter.cs -crlf -/IActionInvoker.cs -crlf -/IAuthorizationFilter.cs -crlf -/IBuildManager.cs -crlf -/IController.cs -crlf -/IControllerFactory.cs -crlf -/IExceptionFilter.cs -crlf -/IModelBinder.cs -crlf -/IResultFilter.cs -crlf -/ITempDataProvider.cs -crlf -/IView.cs -crlf -/IViewDataContainer.cs -crlf -/IViewEngine.cs -crlf -/IViewLocationCache.cs -crlf -/InputType.cs -crlf -/JavaScriptResult.cs -crlf -/JsonResult.cs -crlf -/ModelBinderAttribute.cs -crlf -/ModelBinderDictionary.cs -crlf -/ModelBinders.cs -crlf -/ModelBindingContext.cs -crlf -/ModelError.cs -crlf -/ModelErrorCollection.cs -crlf -/ModelState.cs -crlf -/ModelStateDictionary.cs -crlf -/MultiSelectList.cs -crlf -/MvcHandler.cs -crlf -/MvcHttpHandler.cs -crlf -/MvcRouteHandler.cs -crlf -/NameValueCollectionExtensions.cs -crlf -/NonActionAttribute.cs -crlf -/NullViewLocationCache.cs -crlf -/OutputCacheAttribute.cs -crlf -/ParameterBindingInfo.cs -crlf -/ParameterDescriptor.cs -crlf -/PartialViewResult.cs -crlf -/PathHelpers.cs -crlf -/ReaderWriterCache`2.cs -crlf -/RedirectResult.cs -crlf -/RedirectToRouteResult.cs -crlf -/ReflectedActionDescriptor.cs -crlf -/ReflectedControllerDescriptor.cs -crlf -/ReflectedParameterBindingInfo.cs -crlf -/ReflectedParameterDescriptor.cs -crlf -/ResultExecutedContext.cs -crlf -/ResultExecutingContext.cs -crlf -/RouteCollectionExtensions.cs -crlf -/RouteValuesHelpers.cs -crlf -/SelectList.cs -crlf -/SelectListItem.cs -crlf -/SessionStateTempDataProvider.cs -crlf -/TagBuilder.cs -crlf -/TagRenderMode.cs -crlf -/TempDataDictionary.cs -crlf -/TypeHelpers.cs -crlf -/UrlHelper.cs -crlf -/ValidateAntiForgeryTokenAttribute.cs -crlf -/ValidateInputAttribute.cs -crlf -/ValueProviderDictionary.cs -crlf -/ValueProviderResult.cs -crlf -/ViewContext.cs -crlf -/ViewDataDictionary.cs -crlf -/ViewDataDictionary`1.cs -crlf -/ViewEngineCollection.cs -crlf -/ViewEngineResult.cs -crlf -/ViewEngines.cs -crlf -/ViewMasterPage.cs -crlf -/ViewMasterPage`1.cs -crlf -/ViewPage.cs -crlf -/ViewPageControlBuilder.cs -crlf -/ViewPage`1.cs -crlf -/ViewResult.cs -crlf -/ViewResultBase.cs -crlf -/ViewType.cs -crlf -/ViewTypeControlBuilder.cs -crlf -/ViewTypeParserFilter.cs -crlf -/ViewUserControl.cs -crlf -/ViewUserControlControlBuilder.cs -crlf -/ViewUserControl`1.cs -crlf -/VirtualPathProviderViewEngine.cs -crlf -/WebFormView.cs -crlf -/WebFormViewEngine.cs -crlf diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/AcceptVerbsAttribute.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/AcceptVerbsAttribute.cs deleted file mode 100644 index 9b66e583668..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/AcceptVerbsAttribute.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Diagnostics.CodeAnalysis; - using System.Linq; - using System.Reflection; - using System.Web.Mvc.Resources; - - [SuppressMessage("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments", - Justification = "The accessor is exposed as an ICollection.")] - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] - public sealed class AcceptVerbsAttribute : ActionMethodSelectorAttribute { - - public AcceptVerbsAttribute(HttpVerbs verbs) - : this(EnumToArray(verbs)) { - } - - public AcceptVerbsAttribute(params string[] verbs) { - if (verbs == null || verbs.Length == 0) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "verbs"); - } - - Verbs = new ReadOnlyCollection(verbs); - } - - public ICollection Verbs { - get; - private set; - } - - private static void AddEntryToList(HttpVerbs verbs, HttpVerbs match, List verbList, string entryText) { - if ((verbs & match) != 0) { - verbList.Add(entryText); - } - } - - internal static string[] EnumToArray(HttpVerbs verbs) { - List verbList = new List(); - - AddEntryToList(verbs, HttpVerbs.Get, verbList, "GET"); - AddEntryToList(verbs, HttpVerbs.Post, verbList, "POST"); - AddEntryToList(verbs, HttpVerbs.Put, verbList, "PUT"); - AddEntryToList(verbs, HttpVerbs.Delete, verbList, "DELETE"); - AddEntryToList(verbs, HttpVerbs.Head, verbList, "HEAD"); - - return verbList.ToArray(); - } - - public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo) { - if (controllerContext == null) { - throw new ArgumentNullException("controllerContext"); - } - - string incomingVerb = controllerContext.HttpContext.Request.HttpMethod; - return Verbs.Contains(incomingVerb, StringComparer.OrdinalIgnoreCase); - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionDescriptor.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionDescriptor.cs deleted file mode 100644 index ae0bded516c..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionDescriptor.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Diagnostics.CodeAnalysis; - using System.Reflection; - - public abstract class ActionDescriptor : ICustomAttributeProvider { - - private static readonly ActionSelector[] _emptySelectors = new ActionSelector[0]; - - public abstract string ActionName { - get; - } - - public abstract ControllerDescriptor ControllerDescriptor { - get; - } - - public abstract object Execute(ControllerContext controllerContext, IDictionary parameters); - - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] - public virtual object[] GetCustomAttributes(bool inherit) { - return GetCustomAttributes(typeof(object), inherit); - } - - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] - public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) { - if (attributeType == null) { - throw new ArgumentNullException("attributeType"); - } - - return (object[])Array.CreateInstance(attributeType, 0); - } - - [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", - Justification = "This method may perform non-trivial work.")] - public virtual FilterInfo GetFilters() { - return new FilterInfo(); - } - - public abstract ParameterDescriptor[] GetParameters(); - - [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", - Justification = "This method may perform non-trivial work.")] - public virtual ICollection GetSelectors() { - return _emptySelectors; - } - - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] - public virtual bool IsDefined(Type attributeType, bool inherit) { - if (attributeType == null) { - throw new ArgumentNullException("attributeType"); - } - - return false; - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionExecutedContext.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionExecutedContext.cs deleted file mode 100644 index 1dfaa174b16..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionExecutedContext.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Diagnostics.CodeAnalysis; - - public class ActionExecutedContext : ControllerContext { - - private ActionResult _result; - - // parameterless constructor used for mocking - public ActionExecutedContext() { - } - - [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", - Justification = "The virtual property setters are only to support mocking frameworks, in which case this constructor shouldn't be called anyway.")] - public ActionExecutedContext(ControllerContext controllerContext, ActionDescriptor actionDescriptor, bool canceled, Exception exception) - : base(controllerContext) { - if (actionDescriptor == null) { - throw new ArgumentNullException("actionDescriptor"); - } - - ActionDescriptor = actionDescriptor; - Canceled = canceled; - Exception = exception; - } - - public virtual ActionDescriptor ActionDescriptor { - get; - set; - } - - public virtual bool Canceled { - get; - set; - } - - public virtual Exception Exception { - get; - set; - } - - public bool ExceptionHandled { - get; - set; - } - - public ActionResult Result { - get { - return _result ?? EmptyResult.Instance; - } - set { - _result = value; - } - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionExecutingContext.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionExecutingContext.cs deleted file mode 100644 index 4cc21e0999b..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionExecutingContext.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Diagnostics.CodeAnalysis; - - public class ActionExecutingContext : ControllerContext { - - // parameterless constructor used for mocking - public ActionExecutingContext() { - } - - [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", - Justification = "The virtual property setters are only to support mocking frameworks, in which case this constructor shouldn't be called anyway.")] - public ActionExecutingContext(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary actionParameters) - : base(controllerContext) { - if (actionDescriptor == null) { - throw new ArgumentNullException("actionDescriptor"); - } - if (actionParameters == null) { - throw new ArgumentNullException("actionParameters"); - } - - ActionDescriptor = actionDescriptor; - ActionParameters = actionParameters; - } - - public virtual ActionDescriptor ActionDescriptor { - get; - set; - } - - [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", - Justification = "The property setter is only here to support mocking this type and should not be called at runtime.")] - public virtual IDictionary ActionParameters { - get; - set; - } - - public ActionResult Result { - get; - set; - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionFilterAttribute.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionFilterAttribute.cs deleted file mode 100644 index 1069ccc7d63..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionFilterAttribute.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = false)] - public abstract class ActionFilterAttribute : FilterAttribute, IActionFilter, IResultFilter { - - // The OnXxx() methods are virtual rather than abstract so that a developer need override - // only the ones that interest him. - - public virtual void OnActionExecuting(ActionExecutingContext filterContext) { - } - - public virtual void OnActionExecuted(ActionExecutedContext filterContext) { - } - - public virtual void OnResultExecuting(ResultExecutingContext filterContext) { - } - - public virtual void OnResultExecuted(ResultExecutedContext filterContext) { - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodDispatcher.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodDispatcher.cs deleted file mode 100644 index 0adafe2b695..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodDispatcher.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Linq.Expressions; - using System.Reflection; - - // The methods in this class don't perform error checking; that is the responsibility of the - // caller. - internal sealed class ActionMethodDispatcher { - - private delegate object ActionExecutor(ControllerBase controller, object[] parameters); - private delegate void VoidActionExecutor(ControllerBase controller, object[] parameters); - - private ActionExecutor _executor; - - public ActionMethodDispatcher(MethodInfo methodInfo) { - _executor = GetExecutor(methodInfo); - MethodInfo = methodInfo; - } - - public MethodInfo MethodInfo { - get; - private set; - } - - public object Execute(ControllerBase controller, object[] parameters) { - return _executor(controller, parameters); - } - - private static ActionExecutor GetExecutor(MethodInfo methodInfo) { - // Parameters to executor - ParameterExpression controllerParameter = Expression.Parameter(typeof(ControllerBase), "controller"); - ParameterExpression parametersParameter = Expression.Parameter(typeof(object[]), "parameters"); - - // Build parameter list - List parameters = new List(); - ParameterInfo[] paramInfos = methodInfo.GetParameters(); - for (int i = 0; i < paramInfos.Length; i++) { - ParameterInfo paramInfo = paramInfos[i]; - BinaryExpression valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); - UnaryExpression valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); - - // valueCast is "(Ti) parameters[i]" - parameters.Add(valueCast); - } - - // Call method - UnaryExpression instanceCast = (!methodInfo.IsStatic) ? Expression.Convert(controllerParameter, methodInfo.ReflectedType) : null; - MethodCallExpression methodCall = methodCall = Expression.Call(instanceCast, methodInfo, parameters); - - // methodCall is "((TController) controller) method((T0) parameters[0], (T1) parameters[1], ...)" - // Create function - if (methodCall.Type == typeof(void)) { - Expression lambda = Expression.Lambda(methodCall, controllerParameter, parametersParameter); - VoidActionExecutor voidExecutor = lambda.Compile(); - return WrapVoidAction(voidExecutor); - } - else { - // must coerce methodCall to match ActionExecutor signature - UnaryExpression castMethodCall = Expression.Convert(methodCall, typeof(object)); - Expression lambda = Expression.Lambda(castMethodCall, controllerParameter, parametersParameter); - return lambda.Compile(); - } - } - - private static ActionExecutor WrapVoidAction(VoidActionExecutor executor) { - return delegate(ControllerBase controller, object[] parameters) { - executor(controller, parameters); - return null; - }; - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodDispatcherCache.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodDispatcherCache.cs deleted file mode 100644 index 61b5333367c..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodDispatcherCache.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Reflection; - - internal sealed class ActionMethodDispatcherCache : ReaderWriterCache { - - public ActionMethodDispatcherCache() { - } - - public ActionMethodDispatcher GetDispatcher(MethodInfo methodInfo) { - return FetchOrCreateItem(methodInfo, () => new ActionMethodDispatcher(methodInfo)); - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodSelector.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodSelector.cs deleted file mode 100644 index 4b765dba1ed..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodSelector.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - using System.Reflection; - using System.Text; - using System.Web.Mvc.Resources; - - internal sealed class ActionMethodSelector { - - public ActionMethodSelector(Type controllerType) { - ControllerType = controllerType; - PopulateLookupTables(); - } - - public Type ControllerType { - get; - private set; - } - - public MethodInfo[] AliasedMethods { - get; - private set; - } - - public ILookup NonAliasedMethods { - get; - private set; - } - - private AmbiguousMatchException CreateAmbiguousMatchException(List ambiguousMethods, string actionName) { - StringBuilder exceptionMessageBuilder = new StringBuilder(); - foreach (MethodInfo methodInfo in ambiguousMethods) { - string controllerAction = Convert.ToString(methodInfo, CultureInfo.CurrentUICulture); - string controllerType = methodInfo.DeclaringType.FullName; - exceptionMessageBuilder.AppendLine(); - exceptionMessageBuilder.AppendFormat(CultureInfo.CurrentUICulture, MvcResources.ActionMethodSelector_AmbiguousMatchType, controllerAction, controllerType); - } - string message = String.Format(CultureInfo.CurrentUICulture, MvcResources.ActionMethodSelector_AmbiguousMatch, - actionName, ControllerType.Name, exceptionMessageBuilder); - return new AmbiguousMatchException(message); - } - - public MethodInfo FindActionMethod(ControllerContext controllerContext, string actionName) { - List methodsMatchingName = GetMatchingAliasedMethods(controllerContext, actionName); - methodsMatchingName.AddRange(NonAliasedMethods[actionName]); - List finalMethods = RunSelectionFilters(controllerContext, methodsMatchingName); - - switch (finalMethods.Count) { - case 0: - return null; - - case 1: - return finalMethods[0]; - - default: - throw CreateAmbiguousMatchException(finalMethods, actionName); - } - } - - internal List GetMatchingAliasedMethods(ControllerContext controllerContext, string actionName) { - // find all aliased methods which are opting in to this request - // to opt in, all attributes defined on the method must return true - - var methods = from methodInfo in AliasedMethods - let attrs = (ActionNameSelectorAttribute[])methodInfo.GetCustomAttributes(typeof(ActionNameSelectorAttribute), true /* inherit */) - where attrs.All(attr => attr.IsValidName(controllerContext, actionName, methodInfo)) - select methodInfo; - return methods.ToList(); - } - - private static bool IsMethodDecoratedWithAliasingAttribute(MethodInfo methodInfo) { - return methodInfo.IsDefined(typeof(ActionNameSelectorAttribute), true /* inherit */); - } - - private static bool IsValidActionMethod(MethodInfo methodInfo) { - return !(methodInfo.IsSpecialName || - methodInfo.GetBaseDefinition().DeclaringType.IsAssignableFrom(typeof(Controller))); - } - - private void PopulateLookupTables() { - MethodInfo[] allMethods = ControllerType.GetMethods(BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.Public); - MethodInfo[] actionMethods = Array.FindAll(allMethods, IsValidActionMethod); - - AliasedMethods = Array.FindAll(actionMethods, IsMethodDecoratedWithAliasingAttribute); - NonAliasedMethods = actionMethods.Except(AliasedMethods).ToLookup(method => method.Name, StringComparer.OrdinalIgnoreCase); - } - - private static List RunSelectionFilters(ControllerContext controllerContext, List methodInfos) { - // remove all methods which are opting out of this request - // to opt out, at least one attribute defined on the method must return false - - List matchesWithSelectionAttributes = new List(); - List matchesWithoutSelectionAttributes = new List(); - - foreach (MethodInfo methodInfo in methodInfos) { - ActionMethodSelectorAttribute[] attrs = (ActionMethodSelectorAttribute[])methodInfo.GetCustomAttributes(typeof(ActionMethodSelectorAttribute), true /* inherit */); - if (attrs.Length == 0) { - matchesWithoutSelectionAttributes.Add(methodInfo); - } - else if (attrs.All(attr => attr.IsValidForRequest(controllerContext, methodInfo))) { - matchesWithSelectionAttributes.Add(methodInfo); - } - } - - // if a matching action method had a selection attribute, consider it more specific than a matching action method - // without a selection attribute - return (matchesWithSelectionAttributes.Count > 0) ? matchesWithSelectionAttributes : matchesWithoutSelectionAttributes; - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodSelectorAttribute.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodSelectorAttribute.cs deleted file mode 100644 index 0a2fd297f99..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodSelectorAttribute.cs +++ /dev/null @@ -1,21 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Reflection; - - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] - public abstract class ActionMethodSelectorAttribute : Attribute { - public abstract bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo); - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodSelectorCache.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodSelectorCache.cs deleted file mode 100644 index abf66b0df90..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionMethodSelectorCache.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Threading; - - internal sealed class ActionMethodSelectorCache { - - private ReaderWriterLock _rwLock = new ReaderWriterLock(); - private Dictionary _selectorDictionary = new Dictionary(); - - // This method could potentially return multiple selectors for the same controllerType due to - // upgrading the lock from reader to writer, but the dictionary won't be corrupted as a result. - public ActionMethodSelector GetSelector(Type controllerType) { - ActionMethodSelector selector; - - _rwLock.AcquireReaderLock(Timeout.Infinite); - try { - if (_selectorDictionary.TryGetValue(controllerType, out selector)) { - return selector; - } - } - finally { - _rwLock.ReleaseReaderLock(); - } - - // if we got this far, the selector was not in the cache - selector = new ActionMethodSelector(controllerType); - _rwLock.AcquireWriterLock(Timeout.Infinite); - try { - _selectorDictionary[controllerType] = selector; - return selector; - } - finally { - _rwLock.ReleaseWriterLock(); - } - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionNameAttribute.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionNameAttribute.cs deleted file mode 100644 index 46ef66a39cd..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionNameAttribute.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Reflection; - using System.Web.Mvc.Resources; - - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] - public sealed class ActionNameAttribute : ActionNameSelectorAttribute { - - public ActionNameAttribute(string name) { - if (String.IsNullOrEmpty(name)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "name"); - } - - Name = name; - } - - public string Name { - get; - private set; - } - - public override bool IsValidName(ControllerContext controllerContext, string actionName, MethodInfo methodInfo) { - return String.Equals(actionName, Name, StringComparison.OrdinalIgnoreCase); - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionNameSelectorAttribute.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionNameSelectorAttribute.cs deleted file mode 100644 index 5ec4134dacc..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionNameSelectorAttribute.cs +++ /dev/null @@ -1,21 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Reflection; - - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] - public abstract class ActionNameSelectorAttribute : Attribute { - public abstract bool IsValidName(ControllerContext controllerContext, string actionName, MethodInfo methodInfo); - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionResult.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionResult.cs deleted file mode 100644 index 11bc79c84c0..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionResult.cs +++ /dev/null @@ -1,21 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - - public abstract class ActionResult { - - public abstract void ExecuteResult(ControllerContext context); - - } - -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionSelector.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionSelector.cs deleted file mode 100644 index 59891d6cf81..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ActionSelector.cs +++ /dev/null @@ -1,17 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - - public delegate bool ActionSelector(ControllerContext controllerContext); - -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/.gitattributes b/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/.gitattributes deleted file mode 100644 index 34c273d111c..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -/AjaxExtensions.cs -crlf -/AjaxOptions.cs -crlf -/InsertionMode.cs -crlf diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/AjaxExtensions.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/AjaxExtensions.cs deleted file mode 100644 index d4772861e37..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/AjaxExtensions.cs +++ /dev/null @@ -1,295 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc.Ajax { - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.Globalization; - using System.Web; - using System.Web.Mvc; - using System.Web.Mvc.Html; - using System.Web.Mvc.Resources; - using System.Web.Routing; - - public static class AjaxExtensions { - private const string LinkOnClickFormat = "Sys.Mvc.AsyncHyperlink.handleClick(this, new Sys.UI.DomEvent(event), {0});"; - private const string FormOnSubmitFormat = "Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), {0});"; - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, AjaxOptions ajaxOptions) { - return ActionLink(ajaxHelper, linkText, actionName, (string)null /* controllerName */, ajaxOptions); - } - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, object routeValues, AjaxOptions ajaxOptions) { - return ActionLink(ajaxHelper, linkText, actionName, (string)null /* controllerName */, routeValues, ajaxOptions); - } - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes) { - return ActionLink(ajaxHelper, linkText, actionName, (string)null /* controllerName */, routeValues, ajaxOptions, htmlAttributes); - } - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions) { - return ActionLink(ajaxHelper, linkText, actionName, (string)null /* controllerName */, routeValues, ajaxOptions); - } - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - return ActionLink(ajaxHelper, linkText, actionName, (string)null /* controllerName */, routeValues, ajaxOptions, htmlAttributes); - } - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, AjaxOptions ajaxOptions) { - return ActionLink(ajaxHelper, linkText, actionName, controllerName, null /* values */, ajaxOptions, null /* htmlAttributes */); - } - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions) { - return ActionLink(ajaxHelper, linkText, actionName, controllerName, routeValues, ajaxOptions, null /* htmlAttributes */); - } - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes) { - RouteValueDictionary newValues = new RouteValueDictionary(routeValues); - Dictionary newAttributes = ObjectToCaseSensitiveDictionary(htmlAttributes); - return ActionLink(ajaxHelper, linkText, actionName, controllerName, newValues, ajaxOptions, newAttributes); - } - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions) { - return ActionLink(ajaxHelper, linkText, actionName, controllerName, routeValues, ajaxOptions, null /* htmlAttributes */); - } - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - if (String.IsNullOrEmpty(linkText)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "linkText"); - } - - string targetUrl = UrlHelper.GenerateUrl(null, actionName, controllerName, routeValues, ajaxHelper.RouteCollection, ajaxHelper.ViewContext.RequestContext, true /* includeImplicitMvcValues */); - - return GenerateLink(linkText, targetUrl, GetAjaxOptions(ajaxOptions), htmlAttributes); - } - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes) { - RouteValueDictionary newValues = new RouteValueDictionary(routeValues); - Dictionary newAttributes = ObjectToCaseSensitiveDictionary(htmlAttributes); - return ActionLink(ajaxHelper, linkText, actionName, controllerName, protocol, hostName, fragment, newValues, ajaxOptions, newAttributes); - } - - public static string ActionLink(this AjaxHelper ajaxHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - if (String.IsNullOrEmpty(linkText)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "linkText"); - } - - string targetUrl = UrlHelper.GenerateUrl(null /* routeName */, actionName, controllerName, protocol, hostName, fragment, routeValues, ajaxHelper.RouteCollection, ajaxHelper.ViewContext.RequestContext, true /* includeImplicitMvcValues */); - - return GenerateLink(linkText, targetUrl, ajaxOptions, htmlAttributes); - } - - public static MvcForm BeginForm(this AjaxHelper ajaxHelper, AjaxOptions ajaxOptions) { - string formAction = ajaxHelper.ViewContext.HttpContext.Request.RawUrl; - - TagBuilder builder = new TagBuilder("form"); - - builder.MergeAttribute("action", formAction); - builder.MergeAttribute("method", "post"); - builder.MergeAttribute("onsubmit", GenerateAjaxScript(GetAjaxOptions(ajaxOptions), FormOnSubmitFormat)); - - HttpResponseBase response = ajaxHelper.ViewContext.HttpContext.Response; - response.Write(builder.ToString(TagRenderMode.StartTag)); - return new MvcForm(response); - } - - public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, AjaxOptions ajaxOptions) { - return BeginForm(ajaxHelper, actionName, (string)null /* controllerName */, ajaxOptions); - } - - public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, object routeValues, AjaxOptions ajaxOptions) { - return BeginForm(ajaxHelper, actionName, (string)null /* controllerName */, routeValues, ajaxOptions); - } - - public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes) { - return BeginForm(ajaxHelper, actionName, (string)null /* controllerName */, routeValues, ajaxOptions, htmlAttributes); - } - - public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions) { - return BeginForm(ajaxHelper, actionName, (string)null /* controllerName */, routeValues, ajaxOptions); - } - - public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - return BeginForm(ajaxHelper, actionName, (string)null /* controllerName */, routeValues, ajaxOptions, htmlAttributes); - } - - public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, string controllerName, AjaxOptions ajaxOptions) { - return BeginForm(ajaxHelper, actionName, controllerName, null /* values */, ajaxOptions, null /* htmlAttributes */); - } - - public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions) { - return BeginForm(ajaxHelper, actionName, controllerName, routeValues, ajaxOptions, null /* htmlAttributes */); - } - - public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes) { - RouteValueDictionary newValues = new RouteValueDictionary(routeValues); - Dictionary newAttributes = ObjectToCaseSensitiveDictionary(htmlAttributes); - return BeginForm(ajaxHelper, actionName, controllerName, newValues, ajaxOptions, newAttributes); - } - - public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, string controllerName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions) { - return BeginForm(ajaxHelper, actionName, controllerName, routeValues, ajaxOptions, null /* htmlAttributes */); - } - - public static MvcForm BeginForm(this AjaxHelper ajaxHelper, string actionName, string controllerName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - // get target URL - string formAction = UrlHelper.GenerateUrl(null, actionName, controllerName, routeValues ?? new RouteValueDictionary(), ajaxHelper.RouteCollection, ajaxHelper.ViewContext.RequestContext, true /* includeImplicitMvcValues */); - return FormHelper(ajaxHelper, formAction, ajaxOptions, htmlAttributes); - } - - public static MvcForm BeginRouteForm(this AjaxHelper ajaxHelper, string routeName, AjaxOptions ajaxOptions) { - return BeginRouteForm(ajaxHelper, routeName, null /* routeValues */, ajaxOptions, null /* htmlAttributes */); - } - - public static MvcForm BeginRouteForm(this AjaxHelper ajaxHelper, string routeName, object routeValues, AjaxOptions ajaxOptions) { - return BeginRouteForm(ajaxHelper, routeName, (object)routeValues, ajaxOptions, null /* htmlAttributes */); - } - - public static MvcForm BeginRouteForm(this AjaxHelper ajaxHelper, string routeName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes) { - Dictionary newAttributes = ObjectToCaseSensitiveDictionary(htmlAttributes); - return BeginRouteForm(ajaxHelper, routeName, new RouteValueDictionary(routeValues), ajaxOptions, newAttributes); - } - - public static MvcForm BeginRouteForm(this AjaxHelper ajaxHelper, string routeName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions) { - return BeginRouteForm(ajaxHelper, routeName, routeValues, ajaxOptions, null /* htmlAttributes */); - } - - public static MvcForm BeginRouteForm(this AjaxHelper ajaxHelper, string routeName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - string formAction = UrlHelper.GenerateUrl(routeName, null /* actionName */, null /* controllerName */, routeValues ?? new RouteValueDictionary(), ajaxHelper.RouteCollection, ajaxHelper.ViewContext.RequestContext, false /* includeImplicitMvcValues */); - return FormHelper(ajaxHelper, formAction, ajaxOptions, htmlAttributes); - } - - private static MvcForm FormHelper(this AjaxHelper ajaxHelper, string formAction, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - TagBuilder builder = new TagBuilder("form"); - builder.MergeAttributes(htmlAttributes); - builder.MergeAttribute("action", formAction); - builder.MergeAttribute("method", "post"); - builder.MergeAttribute("onsubmit", GenerateAjaxScript(GetAjaxOptions(ajaxOptions), FormOnSubmitFormat)); - - HttpResponseBase response = ajaxHelper.ViewContext.HttpContext.Response; - response.Write(builder.ToString(TagRenderMode.StartTag)); - return new MvcForm(response); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, object routeValues, AjaxOptions ajaxOptions) { - return RouteLink(ajaxHelper, linkText, null /* routeName */, new RouteValueDictionary(routeValues), ajaxOptions, - new Dictionary()); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes) { - return RouteLink(ajaxHelper, linkText, null /* routeName */, new RouteValueDictionary(routeValues), ajaxOptions, - ObjectToCaseSensitiveDictionary(htmlAttributes)); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, RouteValueDictionary routeValues, AjaxOptions ajaxOptions) { - return RouteLink(ajaxHelper, linkText, null /* routeName */, routeValues, ajaxOptions, - new Dictionary()); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - return RouteLink(ajaxHelper, linkText, null /* routeName */, routeValues, ajaxOptions, htmlAttributes); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, AjaxOptions ajaxOptions) { - return RouteLink(ajaxHelper, linkText, routeName, new RouteValueDictionary(), ajaxOptions, - new Dictionary()); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, AjaxOptions ajaxOptions, object htmlAttributes) { - return RouteLink(ajaxHelper, linkText, routeName, new RouteValueDictionary(), ajaxOptions, ObjectToCaseSensitiveDictionary(htmlAttributes)); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - return RouteLink(ajaxHelper, linkText, routeName, new RouteValueDictionary(), ajaxOptions, htmlAttributes); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, object routeValues, AjaxOptions ajaxOptions) { - return RouteLink(ajaxHelper, linkText, routeName, new RouteValueDictionary(routeValues), ajaxOptions, - new Dictionary()); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes) { - return RouteLink(ajaxHelper, linkText, routeName, new RouteValueDictionary(routeValues), ajaxOptions, - ObjectToCaseSensitiveDictionary(htmlAttributes)); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions) { - return RouteLink(ajaxHelper, linkText, routeName, routeValues, ajaxOptions, new Dictionary()); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - if (String.IsNullOrEmpty(linkText)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "linkText"); - } - - string targetUrl = UrlHelper.GenerateUrl(routeName, null /* actionName */, null /* controllerName */, routeValues ?? new RouteValueDictionary(), ajaxHelper.RouteCollection, ajaxHelper.ViewContext.RequestContext, false /* includeImplicitMvcValues */); - - return GenerateLink(linkText, targetUrl, GetAjaxOptions(ajaxOptions), htmlAttributes); - } - - public static string RouteLink(this AjaxHelper ajaxHelper, string linkText, string routeName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - if (String.IsNullOrEmpty(linkText)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "linkText"); - } - - string targetUrl = UrlHelper.GenerateUrl(routeName, null /* actionName */, null /* controllerName */, protocol, hostName, fragment, routeValues ?? new RouteValueDictionary(), ajaxHelper.RouteCollection, ajaxHelper.ViewContext.RequestContext, false /* includeImplicitMvcValues */); - - return GenerateLink(linkText, targetUrl, GetAjaxOptions(ajaxOptions), htmlAttributes); - } - - internal static string InsertionModeToString(InsertionMode insertionMode) { - switch (insertionMode) { - case InsertionMode.Replace: - return "Sys.Mvc.InsertionMode.replace"; - case InsertionMode.InsertBefore: - return "Sys.Mvc.InsertionMode.insertBefore"; - case InsertionMode.InsertAfter: - return "Sys.Mvc.InsertionMode.insertAfter"; - default: - return ((int)insertionMode).ToString(CultureInfo.InvariantCulture); - } - } - - private static Dictionary ObjectToCaseSensitiveDictionary(object values) { - Dictionary dict = new Dictionary(StringComparer.Ordinal); - if (values != null) { - foreach (PropertyDescriptor prop in TypeDescriptor.GetProperties(values)) { - object val = prop.GetValue(values); - dict[prop.Name] = val; - } - } - return dict; - } - - private static string GenerateLink(string linkText, string targetUrl, AjaxOptions ajaxOptions, IDictionary htmlAttributes) { - TagBuilder tag = new TagBuilder("a") { - InnerHtml = HttpUtility.HtmlEncode(linkText) - }; - - tag.MergeAttributes(htmlAttributes); - tag.MergeAttribute("href", targetUrl); - tag.MergeAttribute("onclick", GenerateAjaxScript(ajaxOptions, LinkOnClickFormat)); - - return tag.ToString(TagRenderMode.Normal); - } - - private static string GenerateAjaxScript(AjaxOptions ajaxOptions, string scriptFormat) { - string optionsString = ajaxOptions.ToJavascriptString(); - return String.Format(CultureInfo.InvariantCulture, scriptFormat, optionsString); - } - - private static AjaxOptions GetAjaxOptions(AjaxOptions ajaxOptions) { - return (ajaxOptions != null) ? ajaxOptions : new AjaxOptions(); - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/AjaxOptions.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/AjaxOptions.cs deleted file mode 100644 index a8284ed54c7..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/AjaxOptions.cs +++ /dev/null @@ -1,167 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc.Ajax { - using System; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Text; - using System.Web.Mvc.Resources; - - public class AjaxOptions { - private string _confirm; - private string _httpMethod; - private InsertionMode _insertionMode = InsertionMode.Replace; - private string _loadingElementId; - private string _onBegin; - private string _onComplete; - private string _onFailure; - private string _onSuccess; - private string _updateTargetId; - private string _url; - - public string Confirm { - get { - return _confirm ?? String.Empty; - } - set { - _confirm = value; - } - } - - public string HttpMethod { - get { - return _httpMethod ?? String.Empty; - } - set { - _httpMethod = value; - } - } - - public InsertionMode InsertionMode { - get { - return _insertionMode; - } - set { - switch (value) { - case InsertionMode.Replace: - case InsertionMode.InsertAfter: - case InsertionMode.InsertBefore: - _insertionMode = value; - return; - - default: - throw new ArgumentOutOfRangeException("value", String.Format(CultureInfo.InvariantCulture, - MvcResources.Common_InvalidEnumValue, value, typeof(InsertionMode).FullName)); - } - } - } - - public string LoadingElementId { - get { - return _loadingElementId ?? String.Empty; - } - set { - _loadingElementId = value; - } - } - - public string OnBegin { - get { - return _onBegin ?? String.Empty; - } - set { - _onBegin = value; - } - } - - public string OnComplete { - get { - return _onComplete ?? String.Empty; - } - set { - _onComplete = value; - } - } - - public string OnFailure { - get { - return _onFailure ?? String.Empty; - } - set { - _onFailure = value; - } - } - - public string OnSuccess { - get { - return _onSuccess ?? String.Empty; - } - set { - _onSuccess = value; - } - } - - public string UpdateTargetId { - get { - return _updateTargetId ?? String.Empty; - } - set { - _updateTargetId = value; - } - } - - [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", - Justification = "This property is used by the optionsBuilder which always accepts a string.")] - public string Url { - get { - return _url ?? String.Empty; - } - set { - _url = value; - } - } - - internal string ToJavascriptString() { - // creates a string of the form { key1: value1, key2 : value2, ... } - StringBuilder optionsBuilder = new StringBuilder("{"); - optionsBuilder.Append(String.Format(CultureInfo.InvariantCulture, " insertionMode: {0},", AjaxExtensions.InsertionModeToString(InsertionMode))); - optionsBuilder.Append(PropertyStringIfSpecified("confirm", Confirm)); - optionsBuilder.Append(PropertyStringIfSpecified("httpMethod", HttpMethod)); - optionsBuilder.Append(PropertyStringIfSpecified("loadingElementId", LoadingElementId)); - optionsBuilder.Append(PropertyStringIfSpecified("updateTargetId", UpdateTargetId)); - optionsBuilder.Append(PropertyStringIfSpecified("url", Url)); - optionsBuilder.Append(EventStringIfSpecified("onBegin", OnBegin)); - optionsBuilder.Append(EventStringIfSpecified("onComplete", OnComplete)); - optionsBuilder.Append(EventStringIfSpecified("onFailure", OnFailure)); - optionsBuilder.Append(EventStringIfSpecified("onSuccess", OnSuccess)); - optionsBuilder.Length--; - optionsBuilder.Append(" }"); - return optionsBuilder.ToString(); - } - - private static string EventStringIfSpecified(string propertyName, string handler) { - if (!String.IsNullOrEmpty(handler)) { - return String.Format(CultureInfo.InvariantCulture, " {0}: Function.createDelegate(this, {1}),", propertyName, handler.ToString()); - } - return String.Empty; - } - - private static string PropertyStringIfSpecified(string propertyName, string propertyValue) { - if (!String.IsNullOrEmpty(propertyValue)) { - string escapedPropertyValue = propertyValue.Replace("'", @"\'"); - return String.Format(CultureInfo.InvariantCulture, " {0}: '{1}',", propertyName, escapedPropertyValue); - } - return String.Empty; - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/InsertionMode.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/InsertionMode.cs deleted file mode 100644 index de0eb4e24f5..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Ajax/InsertionMode.cs +++ /dev/null @@ -1,19 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc.Ajax { - public enum InsertionMode { - Replace = 0, - InsertBefore = 1, - InsertAfter = 2 - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/AjaxHelper.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/AjaxHelper.cs deleted file mode 100644 index bcce9fde8a2..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/AjaxHelper.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Web.Routing; - - public class AjaxHelper { - - public AjaxHelper(ViewContext viewContext, IViewDataContainer viewDataContainer) - : this(viewContext, viewDataContainer, RouteTable.Routes) { - } - - public AjaxHelper(ViewContext viewContext, IViewDataContainer viewDataContainer, RouteCollection routeCollection) { - if (viewContext == null) { - throw new ArgumentNullException("viewContext"); - } - if (viewDataContainer == null) { - throw new ArgumentNullException("viewDataContainer"); - } - if (routeCollection == null) { - throw new ArgumentNullException("routeCollection"); - } - ViewContext = viewContext; - ViewDataContainer = viewDataContainer; - RouteCollection = routeCollection; - } - - public RouteCollection RouteCollection { - get; - private set; - } - - public ViewContext ViewContext { - get; - private set; - } - - public ViewDataDictionary ViewData { - get { - return ViewDataContainer.ViewData; - } - } - - public IViewDataContainer ViewDataContainer { - get; - private set; - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/AjaxHelper`1.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/AjaxHelper`1.cs deleted file mode 100644 index a407d3a446a..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/AjaxHelper`1.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System.Web.Routing; - - public class AjaxHelper : AjaxHelper where TModel : class { - private ViewDataDictionary _viewData; - - public AjaxHelper(ViewContext viewContext, IViewDataContainer viewDataContainer) - : this(viewContext, viewDataContainer, RouteTable.Routes) { - } - - public AjaxHelper(ViewContext viewContext, IViewDataContainer viewDataContainer, RouteCollection routeCollection) - : base(viewContext, viewDataContainer, routeCollection) { - - _viewData = new ViewDataDictionary(viewDataContainer.ViewData); - } - - public new ViewDataDictionary ViewData { - get { - return _viewData; - } - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/AjaxRequestExtensions.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/AjaxRequestExtensions.cs deleted file mode 100644 index 411c25092c2..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/AjaxRequestExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - - public static class AjaxRequestExtensions { - - public static bool IsAjaxRequest(this HttpRequestBase request) { - if (request == null) { - throw new ArgumentNullException("request"); - } - - return (request["X-Requested-With"] == "XMLHttpRequest") || ((request.Headers != null) && (request.Headers["X-Requested-With"] == "XMLHttpRequest")); - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryData.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryData.cs deleted file mode 100644 index 2d2ee680979..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryData.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Security.Cryptography; - using System.Text; - - internal sealed class AntiForgeryData { - - private const string AntiForgeryTokenFieldName = "__RequestVerificationToken"; - - private const int TokenLength = 128 / 8; - private static RNGCryptoServiceProvider _prng = new RNGCryptoServiceProvider(); - - private string _salt; - private string _value; - - public AntiForgeryData() { - } - - // copy constructor - public AntiForgeryData(AntiForgeryData token) { - if (token == null) { - throw new ArgumentNullException("token"); - } - - CreationDate = token.CreationDate; - Salt = token.Salt; - Value = token.Value; - } - - public DateTime CreationDate { - get; - set; - } - - public string Salt { - get { - return _salt ?? String.Empty; - } - set { - _salt = value; - } - } - - public string Value { - get { - return _value ?? String.Empty; - } - set { - _value = value; - } - } - - private static string Base64EncodeForCookieName(string s) { - byte[] rawBytes = Encoding.UTF8.GetBytes(s); - string base64String = Convert.ToBase64String(rawBytes); - - // replace base64-specific characters with characters that are safe for a cookie name - return base64String.Replace('+', '.').Replace('/', '-').Replace('=', '_'); - } - - private static string GenerateRandomTokenString() { - byte[] tokenBytes = new byte[TokenLength]; - _prng.GetBytes(tokenBytes); - - string token = Convert.ToBase64String(tokenBytes); - return token; - } - - // If the app path is provided, we're generating a cookie name rather than a field name, and the cookie names should - // be unique so that a development server cookie and an IIS cookie - both running on localhost - don't stomp on - // each other. - internal static string GetAntiForgeryTokenName(string appPath) { - if (String.IsNullOrEmpty(appPath)) { - return AntiForgeryTokenFieldName; - } - else { - return AntiForgeryTokenFieldName + "_" + Base64EncodeForCookieName(appPath); - } - } - - public static AntiForgeryData NewToken() { - string tokenString = GenerateRandomTokenString(); - return new AntiForgeryData() { - CreationDate = DateTime.Now, - Value = tokenString - }; - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryDataSerializer.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryDataSerializer.cs deleted file mode 100644 index 54465e1217f..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryDataSerializer.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Diagnostics.CodeAnalysis; - using System.IO; - using System.Web; - using System.Web.Mvc.Resources; - using System.Web.UI; - - internal class AntiForgeryDataSerializer { - - private IStateFormatter _formatter; - - protected internal IStateFormatter Formatter { - get { - if (_formatter == null) { - _formatter = FormatterGenerator.GetFormatter(); - } - return _formatter; - } - set { - _formatter = value; - } - } - - private static HttpAntiForgeryException CreateValidationException(Exception innerException) { - return new HttpAntiForgeryException(MvcResources.AntiForgeryToken_ValidationFailed, innerException); - } - - public virtual AntiForgeryData Deserialize(string serializedToken) { - if (String.IsNullOrEmpty(serializedToken)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "serializedToken"); - } - - // call property getter outside try { } block so that exceptions bubble up for debugging - IStateFormatter formatter = Formatter; - - try { - Triplet deserializedObj = (Triplet)formatter.Deserialize(serializedToken); - return new AntiForgeryData() { - Salt = (string)deserializedObj.First, - Value = (string)deserializedObj.Second, - CreationDate = (DateTime)deserializedObj.Third - }; - } - catch (Exception ex) { - throw CreateValidationException(ex); - } - } - - public virtual string Serialize(AntiForgeryData token) { - if (token == null) { - throw new ArgumentNullException("token"); - } - - Triplet objToSerialize = new Triplet() { - First = token.Salt, - Second = token.Value, - Third = token.CreationDate - }; - - string serializedValue = Formatter.Serialize(objToSerialize); - return serializedValue; - } - - // See http://www.yoda.arachsys.com/csharp/singleton.html (fifth version - fully lazy) for the singleton pattern - // used here. We need to defer the call to TokenPersister.CreateFormatterGenerator() until we're actually - // servicing a request, else HttpContext.Current might be invalid in TokenPersister.CreateFormatterGenerator(). - private static class FormatterGenerator { - - public static readonly Func GetFormatter = TokenPersister.CreateFormatterGenerator(); - - [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline", - Justification = "This type must not be marked 'beforefieldinit'.")] - static FormatterGenerator() { - } - - // This type is very difficult to unit-test because Page.ProcessRequest() requires mocking - // much of the hosting environment. For now, we can perform functional tests of this feature. - private sealed class TokenPersister : PageStatePersister { - private TokenPersister(Page page) - : base(page) { - } - - public static Func CreateFormatterGenerator() { - // This code instantiates a page and tricks it into thinking that it's servicing - // a postback scenario with encrypted ViewState, which is required to make the - // StateFormatter properly decrypt data. Specifically, this code sets the - // internal Page.ContainsEncryptedViewState flag. - TextWriter writer = TextWriter.Null; - HttpResponse response = new HttpResponse(writer); - HttpRequest request = new HttpRequest("DummyFile.aspx", HttpContext.Current.Request.Url.ToString(), "__EVENTTARGET=true&__VIEWSTATEENCRYPTED=true"); - HttpContext context = new HttpContext(request, response); - - Page page = new Page() { - EnableViewStateMac = true, - ViewStateEncryptionMode = ViewStateEncryptionMode.Always - }; - page.ProcessRequest(context); - - return () => new TokenPersister(page).StateFormatter; - } - - public override void Load() { - throw new NotImplementedException(); - } - - public override void Save() { - throw new NotImplementedException(); - } - } - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryToken.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryToken.cs deleted file mode 100644 index ef1b9e6c7f3..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryToken.cs +++ /dev/null @@ -1,67 +0,0 @@ -namespace System.Web.Mvc { - using System; - using System.Security.Cryptography; - - internal sealed class AntiForgeryToken { - - private const int TokenLength = 128 / 8; - private static RNGCryptoServiceProvider _prng = new RNGCryptoServiceProvider(); - - private string _salt; - private string _value; - - public AntiForgeryToken() { - } - - // copy constructor - public AntiForgeryToken(AntiForgeryToken token) { - if (token == null) { - throw new ArgumentNullException("token"); - } - - CreationDate = token.CreationDate; - Salt = token.Salt; - Value = token.Value; - } - - public DateTime CreationDate { - get; - set; - } - - public string Salt { - get { - return _salt ?? String.Empty; - } - set { - _salt = value; - } - } - - public string Value { - get { - return _value ?? String.Empty; - } - set { - _value = value; - } - } - - private static string GenerateRandomTokenString() { - byte[] tokenBytes = new byte[TokenLength]; - _prng.GetBytes(tokenBytes); - - string token = Convert.ToBase64String(tokenBytes); - return token; - } - - public static AntiForgeryToken NewToken() { - string tokenString = GenerateRandomTokenString(); - return new AntiForgeryToken() { - CreationDate = DateTime.Now, - Value = tokenString - }; - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryTokenSerializer.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryTokenSerializer.cs deleted file mode 100644 index 8a6e42b0d78..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/AntiForgeryTokenSerializer.cs +++ /dev/null @@ -1,114 +0,0 @@ -namespace System.Web.Mvc { - using System; - using System.Diagnostics.CodeAnalysis; - using System.IO; - using System.Web; - using System.Web.Mvc.Resources; - using System.Web.UI; - - internal class AntiForgeryTokenSerializer { - - private IStateFormatter _formatter; - - protected internal IStateFormatter Formatter { - get { - if (_formatter == null) { - _formatter = FormatterGenerator.GetFormatter(); - } - return _formatter; - } - set { - _formatter = value; - } - } - - private static HttpAntiForgeryException CreateValidationException(Exception innerException) { - return new HttpAntiForgeryException(MvcResources.AntiForgeryToken_ValidationFailed, innerException); - } - - public virtual AntiForgeryToken Deserialize(string serializedToken) { - if (String.IsNullOrEmpty(serializedToken)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "serializedToken"); - } - - // call property getter outside try { } block so that exceptions bubble up for debugging - IStateFormatter formatter = Formatter; - - try { - Triplet deserializedObj = (Triplet)formatter.Deserialize(serializedToken); - return new AntiForgeryToken() { - Salt = (string)deserializedObj.First, - Value = (string)deserializedObj.Second, - CreationDate = (DateTime)deserializedObj.Third - }; - } - catch (Exception ex) { - throw CreateValidationException(ex); - } - } - - public virtual string Serialize(AntiForgeryToken token) { - if (token == null) { - throw new ArgumentNullException("token"); - } - - Triplet objToSerialize = new Triplet() { - First = token.Salt, - Second = token.Value, - Third = token.CreationDate - }; - - string serializedValue = Formatter.Serialize(objToSerialize); - return serializedValue; - } - - // See http://www.yoda.arachsys.com/csharp/singleton.html (fifth version - fully lazy) for the singleton pattern - // used here. We need to defer the call to TokenPersister.CreateFormatterGenerator() until we're actually - // servicing a request, else HttpContext.Current might be invalid in TokenPersister.CreateFormatterGenerator(). - private static class FormatterGenerator { - - public static readonly Func GetFormatter = TokenPersister.CreateFormatterGenerator(); - - [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline", - Justification = "This type must not be marked 'beforefieldinit'.")] - static FormatterGenerator() { - } - - // This type is very difficult to unit-test because Page.ProcessRequest() requires mocking - // much of the hosting environment. For now, we can perform functional tests of this feature. - private sealed class TokenPersister : PageStatePersister { - private TokenPersister(Page page) - : base(page) { - } - - public static Func CreateFormatterGenerator() { - // This code instantiates a page and tricks it into thinking that it's servicing - // a postback scenario with encrypted ViewState, which is required to make the - // StateFormatter properly decrypt data. Specifically, this code sets the - // internal Page.ContainsEncryptedViewState flag. - TextWriter writer = TextWriter.Null; - HttpResponse response = new HttpResponse(writer); - HttpRequest request = new HttpRequest("DummyFile.aspx", HttpContext.Current.Request.Url.ToString(), "__EVENTTARGET=true&__VIEWSTATEENCRYPTED=true"); - HttpContext context = new HttpContext(request, response); - - Page page = new Page() { - EnableViewStateMac = true, - ViewStateEncryptionMode = ViewStateEncryptionMode.Always - }; - page.ProcessRequest(context); - - return () => new TokenPersister(page).StateFormatter; - } - - public override void Load() { - throw new NotImplementedException(); - } - - public override void Save() { - throw new NotImplementedException(); - } - } - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/AuthorizationContext.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/AuthorizationContext.cs deleted file mode 100644 index 434875b0e8b..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/AuthorizationContext.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - - public class AuthorizationContext : ControllerContext { - - // parameterless constructor used for mocking - public AuthorizationContext() { - } - - public AuthorizationContext(ControllerContext controllerContext) - : base(controllerContext) { - } - - public ActionResult Result { - get; - set; - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/AuthorizeAttribute.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/AuthorizeAttribute.cs deleted file mode 100644 index 18f57493397..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/AuthorizeAttribute.cs +++ /dev/null @@ -1,123 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Diagnostics.CodeAnalysis; - using System.Linq; - using System.Security.Principal; - using System.Web; - - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes", - Justification = "Unsealed so that subclassed types can set properties in the default constructor or override our behavior.")] - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] - public class AuthorizeAttribute : FilterAttribute, IAuthorizationFilter { - - private string _roles; - private string[] _rolesSplit = new string[0]; - private string _users; - private string[] _usersSplit = new string[0]; - - public string Roles { - get { - return _roles ?? String.Empty; - } - set { - _roles = value; - _rolesSplit = SplitString(value); - } - } - - public string Users { - get { - return _users ?? String.Empty; - } - set { - _users = value; - _usersSplit = SplitString(value); - } - } - - // This method must be thread-safe since it is called by the thread-safe OnCacheAuthorization() method. - protected virtual bool AuthorizeCore(HttpContextBase httpContext) { - if (httpContext == null) { - throw new ArgumentNullException("httpContext"); - } - - IPrincipal user = httpContext.User; - if (!user.Identity.IsAuthenticated) { - return false; - } - - if (_usersSplit.Length > 0 && !_usersSplit.Contains(user.Identity.Name, StringComparer.OrdinalIgnoreCase)) { - return false; - } - - if (_rolesSplit.Length > 0 && !_rolesSplit.Any(user.IsInRole)) { - return false; - } - - return true; - } - - private void CacheValidateHandler(HttpContext context, object data, ref HttpValidationStatus validationStatus) { - validationStatus = OnCacheAuthorization(new HttpContextWrapper(context)); - } - - public virtual void OnAuthorization(AuthorizationContext filterContext) { - if (filterContext == null) { - throw new ArgumentNullException("filterContext"); - } - - if (AuthorizeCore(filterContext.HttpContext)) { - // ** IMPORTANT ** - // Since we're performing authorization at the action level, the authorization code runs - // after the output caching module. In the worst case this could allow an authorized user - // to cause the page to be cached, then an unauthorized user would later be served the - // cached page. We work around this by telling proxies not to cache the sensitive page, - // then we hook our custom authorization code into the caching mechanism so that we have - // the final say on whether a page should be served from the cache. - - HttpCachePolicyBase cachePolicy = filterContext.HttpContext.Response.Cache; - cachePolicy.SetProxyMaxAge(new TimeSpan(0)); - cachePolicy.AddValidationCallback(CacheValidateHandler, null /* data */); - } - else { - // auth failed, redirect to login page - filterContext.Result = new HttpUnauthorizedResult(); - } - } - - // This method must be thread-safe since it is called by the caching module. - protected virtual HttpValidationStatus OnCacheAuthorization(HttpContextBase httpContext) { - if (httpContext == null) { - throw new ArgumentNullException("httpContext"); - } - - bool isAuthorized = AuthorizeCore(httpContext); - return (isAuthorized) ? HttpValidationStatus.Valid : HttpValidationStatus.IgnoreThisRequest; - } - - internal static string[] SplitString(string original) { - if (String.IsNullOrEmpty(original)) { - return new string[0]; - } - - var split = from piece in original.Split(',') - let trimmed = piece.Trim() - where !String.IsNullOrEmpty(trimmed) - select trimmed; - return split.ToArray(); - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/BindAttribute.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/BindAttribute.cs deleted file mode 100644 index 5f3b1bee55a..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/BindAttribute.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Linq; - - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] - public sealed class BindAttribute : Attribute { - - private string _exclude; - private string[] _excludeSplit = new string[0]; - private string _include; - private string[] _includeSplit = new string[0]; - - public string Exclude { - get { - return _exclude ?? String.Empty; - } - set { - _exclude = value; - _excludeSplit = AuthorizeAttribute.SplitString(value); - } - } - - public string Include { - get { - return _include ?? String.Empty; - } - set { - _include = value; - _includeSplit = AuthorizeAttribute.SplitString(value); - } - } - - public string Prefix { - get; - set; - } - - internal static bool IsPropertyAllowed(string propertyName, string[] includeProperties, string[] excludeProperties) { - // We allow a property to be bound if its both in the include list AND not in the exclude list. - // An empty include list implies all properties are allowed. - // An empty exclude list implies no properties are disallowed. - bool includeProperty = (includeProperties == null) || (includeProperties.Length == 0) || includeProperties.Contains(propertyName, StringComparer.OrdinalIgnoreCase); - bool excludeProperty = (excludeProperties != null) && excludeProperties.Contains(propertyName, StringComparer.OrdinalIgnoreCase); - return includeProperty && !excludeProperty; - } - - public bool IsPropertyAllowed(string propertyName) { - return IsPropertyAllowed(propertyName, _includeSplit, _excludeSplit); - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/BuildManagerWrapper.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/BuildManagerWrapper.cs deleted file mode 100644 index e6da39dcbb0..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/BuildManagerWrapper.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System.Collections; - using System.Web.Compilation; - - internal sealed class BuildManagerWrapper : IBuildManager { - #region IBuildManager Members - object IBuildManager.CreateInstanceFromVirtualPath(string virtualPath, Type requiredBaseType) { - return BuildManager.CreateInstanceFromVirtualPath(virtualPath, requiredBaseType); - } - - ICollection IBuildManager.GetReferencedAssemblies() { - return BuildManager.GetReferencedAssemblies(); - } - #endregion - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ContentResult.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ContentResult.cs deleted file mode 100644 index 37ecb71a70c..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ContentResult.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Text; - using System.Web; - - public class ContentResult : ActionResult { - - public string Content { - get; - set; - } - - public Encoding ContentEncoding { - get; - set; - } - - public string ContentType { - get; - set; - } - - public override void ExecuteResult(ControllerContext context) { - if (context == null) { - throw new ArgumentNullException("context"); - } - - HttpResponseBase response = context.HttpContext.Response; - - if (!String.IsNullOrEmpty(ContentType)) { - response.ContentType = ContentType; - } - if (ContentEncoding != null) { - response.ContentEncoding = ContentEncoding; - } - if (Content != null) { - response.Write(Content); - } - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Controller.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/Controller.cs deleted file mode 100644 index 40a97a50b43..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Controller.cs +++ /dev/null @@ -1,533 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.IO; - using System.Security.Principal; - using System.Text; - using System.Web; - using System.Web.Mvc.Resources; - using System.Web.Routing; - - public abstract class Controller : ControllerBase, IActionFilter, IAuthorizationFilter, IDisposable, IExceptionFilter, IResultFilter { - - private IActionInvoker _actionInvoker; - private ModelBinderDictionary _binders; - private RouteCollection _routeCollection; - private ITempDataProvider _tempDataProvider; - - public IActionInvoker ActionInvoker { - get { - if (_actionInvoker == null) { - _actionInvoker = new ControllerActionInvoker(); - } - return _actionInvoker; - } - set { - _actionInvoker = value; - } - } - - [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", - Justification = "Property is settable so that the dictionary can be provided for unit testing purposes.")] - protected internal ModelBinderDictionary Binders { - get { - if (_binders == null) { - _binders = ModelBinders.Binders; - } - return _binders; - } - set { - _binders = value; - } - } - - public HttpContextBase HttpContext { - get { - return ControllerContext == null ? null : ControllerContext.HttpContext; - } - } - - public ModelStateDictionary ModelState { - get { - return ViewData.ModelState; - } - } - - public HttpRequestBase Request { - get { - return HttpContext == null ? null : HttpContext.Request; - } - } - - public HttpResponseBase Response { - get { - return HttpContext == null ? null : HttpContext.Response; - } - } - - internal RouteCollection RouteCollection { - get { - if (_routeCollection == null) { - _routeCollection = RouteTable.Routes; - } - return _routeCollection; - } - set { - _routeCollection = value; - } - } - - public RouteData RouteData { - get { - return ControllerContext == null ? null : ControllerContext.RouteData; - } - } - - public HttpServerUtilityBase Server { - get { - return HttpContext == null ? null : HttpContext.Server; - } - } - - public HttpSessionStateBase Session { - get { - return HttpContext == null ? null : HttpContext.Session; - } - } - - public ITempDataProvider TempDataProvider { - get { - if (_tempDataProvider == null) { - _tempDataProvider = new SessionStateTempDataProvider(); - } - return _tempDataProvider; - } - set { - _tempDataProvider = value; - } - } - - public UrlHelper Url { - get; - set; - } - - public IPrincipal User { - get { - return HttpContext == null ? null : HttpContext.User; - } - } - - [SuppressMessage("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames", MessageId = "0#", - Justification = "'Content' refers to ContentResult type; 'content' refers to ContentResult.Content property.")] - protected internal ContentResult Content(string content) { - return Content(content, null /* contentType */); - } - - [SuppressMessage("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames", MessageId = "0#", - Justification = "'Content' refers to ContentResult type; 'content' refers to ContentResult.Content property.")] - protected internal ContentResult Content(string content, string contentType) { - return Content(content, contentType, null /* contentEncoding */); - } - - [SuppressMessage("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames", MessageId = "0#", - Justification = "'Content' refers to ContentResult type; 'content' refers to ContentResult.Content property.")] - protected internal virtual ContentResult Content(string content, string contentType, Encoding contentEncoding) { - return new ContentResult { - Content = content, - ContentType = contentType, - ContentEncoding = contentEncoding - }; - } - - // The default invoker will never match methods defined on the Controller type, so - // the Dispose() method is not web-callable. However, in general, since implicitly- - // implemented interface methods are public, they are web-callable unless decorated with - // [NonAction]. - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] - public void Dispose() { - Dispose(true /* disposing */); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) { - } - - protected override void ExecuteCore() { - TempData.Load(ControllerContext, TempDataProvider); - - try { - string actionName = RouteData.GetRequiredString("action"); - if (!ActionInvoker.InvokeAction(ControllerContext, actionName)) { - HandleUnknownAction(actionName); - } - } - finally { - TempData.Save(ControllerContext, TempDataProvider); - } - } - - protected internal FileContentResult File(byte[] fileContents, string contentType) { - return File(fileContents, contentType, null /* fileDownloadName */); - } - - protected internal virtual FileContentResult File(byte[] fileContents, string contentType, string fileDownloadName) { - return new FileContentResult(fileContents, contentType) { FileDownloadName = fileDownloadName }; - } - - protected internal FileStreamResult File(Stream fileStream, string contentType) { - return File(fileStream, contentType, null /* fileDownloadName */); - } - - protected internal virtual FileStreamResult File(Stream fileStream, string contentType, string fileDownloadName) { - return new FileStreamResult(fileStream, contentType) { FileDownloadName = fileDownloadName }; - } - - protected internal FilePathResult File(string fileName, string contentType) { - return File(fileName, contentType, null /* fileDownloadName */); - } - - protected internal virtual FilePathResult File(string fileName, string contentType, string fileDownloadName) { - return new FilePathResult(fileName, contentType) { FileDownloadName = fileDownloadName }; - } - - protected virtual void HandleUnknownAction(string actionName) { - throw new HttpException(404, String.Format(CultureInfo.CurrentUICulture, - MvcResources.Controller_UnknownAction, actionName, GetType().FullName)); - } - - protected internal virtual JavaScriptResult JavaScript(string script) { - return new JavaScriptResult { Script = script }; - } - - protected internal JsonResult Json(object data) { - return Json(data, null /* contentType */); - } - - protected internal JsonResult Json(object data, string contentType) { - return Json(data, contentType, null /* contentEncoding */); - } - - protected internal virtual JsonResult Json(object data, string contentType, Encoding contentEncoding) { - return new JsonResult { - Data = data, - ContentType = contentType, - ContentEncoding = contentEncoding - }; - } - - protected override void Initialize(RequestContext requestContext) { - base.Initialize(requestContext); - Url = new UrlHelper(requestContext); - } - - protected virtual void OnActionExecuting(ActionExecutingContext filterContext) { - } - - protected virtual void OnActionExecuted(ActionExecutedContext filterContext) { - } - - protected virtual void OnAuthorization(AuthorizationContext filterContext) { - } - - protected virtual void OnException(ExceptionContext filterContext) { - } - - protected virtual void OnResultExecuted(ResultExecutedContext filterContext) { - } - - protected virtual void OnResultExecuting(ResultExecutingContext filterContext) { - } - - protected internal PartialViewResult PartialView() { - return PartialView(null /* viewName */, null /* model */); - } - - protected internal PartialViewResult PartialView(object model) { - return PartialView(null /* viewName */, model); - } - - protected internal PartialViewResult PartialView(string viewName) { - return PartialView(viewName, null /* model */); - } - - protected internal virtual PartialViewResult PartialView(string viewName, object model) { - if (model != null) { - ViewData.Model = model; - } - - return new PartialViewResult { - ViewName = viewName, - ViewData = ViewData, - TempData = TempData - }; - } - - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", - Justification = "Instance method for consistency with other helpers.")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "0#", - Justification = "Response.Redirect() takes its URI as a string parameter.")] - protected internal virtual RedirectResult Redirect(string url) { - if (String.IsNullOrEmpty(url)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "url"); - } - return new RedirectResult(url); - } - - protected internal RedirectToRouteResult RedirectToAction(string actionName) { - return RedirectToAction(actionName, (RouteValueDictionary)null); - } - - protected internal RedirectToRouteResult RedirectToAction(string actionName, object routeValues) { - return RedirectToAction(actionName, new RouteValueDictionary(routeValues)); - } - - protected internal RedirectToRouteResult RedirectToAction(string actionName, RouteValueDictionary routeValues) { - return RedirectToAction(actionName, null /* controllerName */, routeValues); - } - - protected internal RedirectToRouteResult RedirectToAction(string actionName, string controllerName) { - return RedirectToAction(actionName, controllerName, (RouteValueDictionary)null); - } - - protected internal RedirectToRouteResult RedirectToAction(string actionName, string controllerName, object routeValues) { - return RedirectToAction(actionName, controllerName, new RouteValueDictionary(routeValues)); - } - - protected internal virtual RedirectToRouteResult RedirectToAction(string actionName, string controllerName, RouteValueDictionary routeValues) { - RouteValueDictionary mergedRouteValues; - - if (RouteData == null) { - mergedRouteValues = RouteValuesHelpers.MergeRouteValues(actionName, controllerName, null, routeValues, true /* includeImplicitMvcValues */); - } - else { - mergedRouteValues = RouteValuesHelpers.MergeRouteValues(actionName, controllerName, RouteData.Values, routeValues, true /* includeImplicitMvcValues */); - } - - return new RedirectToRouteResult(mergedRouteValues); - } - - protected internal RedirectToRouteResult RedirectToRoute(object routeValues) { - return RedirectToRoute(new RouteValueDictionary(routeValues)); - } - - protected internal RedirectToRouteResult RedirectToRoute(RouteValueDictionary routeValues) { - return RedirectToRoute(null /* routeName */, routeValues); - } - - protected internal RedirectToRouteResult RedirectToRoute(string routeName) { - return RedirectToRoute(routeName, (RouteValueDictionary)null); - } - - protected internal RedirectToRouteResult RedirectToRoute(string routeName, object routeValues) { - return RedirectToRoute(routeName, new RouteValueDictionary(routeValues)); - } - - protected internal virtual RedirectToRouteResult RedirectToRoute(string routeName, RouteValueDictionary routeValues) { - return new RedirectToRouteResult(routeName, RouteValuesHelpers.GetRouteValues(routeValues)); - } - - protected internal bool TryUpdateModel(TModel model) where TModel : class { - return TryUpdateModel(model, null, null, null, ValueProvider); - } - - protected internal bool TryUpdateModel(TModel model, string prefix) where TModel : class { - return TryUpdateModel(model, prefix, null, null, ValueProvider); - } - - protected internal bool TryUpdateModel(TModel model, string[] includeProperties) where TModel : class { - return TryUpdateModel(model, null, includeProperties, null, ValueProvider); - } - - protected internal bool TryUpdateModel(TModel model, string prefix, string[] includeProperties) where TModel : class { - return TryUpdateModel(model, prefix, includeProperties, null, ValueProvider); - } - - protected internal bool TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) where TModel : class { - return TryUpdateModel(model, prefix, includeProperties, excludeProperties, ValueProvider); - } - - protected internal bool TryUpdateModel(TModel model, IDictionary valueProvider) where TModel : class { - return TryUpdateModel(model, null, null, null, valueProvider); - } - - protected internal bool TryUpdateModel(TModel model, string prefix, IDictionary valueProvider) where TModel : class { - return TryUpdateModel(model, prefix, null, null, valueProvider); - } - - protected internal bool TryUpdateModel(TModel model, string[] includeProperties, IDictionary valueProvider) where TModel : class { - return TryUpdateModel(model, null, includeProperties, null, valueProvider); - } - - protected internal bool TryUpdateModel(TModel model, string prefix, string[] includeProperties, IDictionary valueProvider) where TModel : class { - return TryUpdateModel(model, prefix, includeProperties, null, valueProvider); - } - - protected internal bool TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties, IDictionary valueProvider) where TModel : class { - if (model == null) { - throw new ArgumentNullException("model"); - } - if (valueProvider == null) { - throw new ArgumentNullException("valueProvider"); - } - - Predicate propertyFilter = propertyName => BindAttribute.IsPropertyAllowed(propertyName, includeProperties, excludeProperties); - IModelBinder binder = Binders.GetBinder(typeof(TModel)); - - ModelBindingContext bindingContext = new ModelBindingContext() { - Model = model, - ModelName = prefix, - ModelState = ModelState, - ModelType = typeof(TModel), - PropertyFilter = propertyFilter, - ValueProvider = valueProvider - }; - binder.BindModel(ControllerContext, bindingContext); - return ModelState.IsValid; - } - - protected internal void UpdateModel(TModel model) where TModel : class { - UpdateModel(model, null, null, null, ValueProvider); - } - - protected internal void UpdateModel(TModel model, string prefix) where TModel : class { - UpdateModel(model, prefix, null, null, ValueProvider); - } - - protected internal void UpdateModel(TModel model, string[] includeProperties) where TModel : class { - UpdateModel(model, null, includeProperties, null, ValueProvider); - } - - protected internal void UpdateModel(TModel model, string prefix, string[] includeProperties) where TModel : class { - UpdateModel(model, prefix, includeProperties, null, ValueProvider); - } - - protected internal void UpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) where TModel : class { - UpdateModel(model, prefix, includeProperties, excludeProperties, ValueProvider); - } - - protected internal void UpdateModel(TModel model, IDictionary valueProvider) where TModel : class { - UpdateModel(model, null, null, null, valueProvider); - } - - protected internal void UpdateModel(TModel model, string prefix, IDictionary valueProvider) where TModel : class { - UpdateModel(model, prefix, null, null, valueProvider); - } - - protected internal void UpdateModel(TModel model, string[] includeProperties, IDictionary valueProvider) where TModel : class { - UpdateModel(model, null, includeProperties, null, valueProvider); - } - - protected internal void UpdateModel(TModel model, string prefix, string[] includeProperties, IDictionary valueProvider) where TModel : class { - UpdateModel(model, prefix, includeProperties, null, valueProvider); - } - - protected internal void UpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties, IDictionary valueProvider) where TModel : class { - bool success = TryUpdateModel(model, prefix, includeProperties, excludeProperties, valueProvider); - if (!success) { - string message = String.Format(CultureInfo.CurrentUICulture, MvcResources.Controller_UpdateModel_UpdateUnsuccessful, - typeof(TModel).FullName); - throw new InvalidOperationException(message); - } - } - - protected internal ViewResult View() { - return View(null /* viewName */, null /* masterName */, null /* model */); - } - - protected internal ViewResult View(object model) { - return View(null /* viewName */, null /* masterName */, model); - } - - protected internal ViewResult View(string viewName) { - return View(viewName, null /* masterName */, null /* model */); - } - - protected internal ViewResult View(string viewName, string masterName) { - return View(viewName, masterName, null /* model */); - } - - protected internal ViewResult View(string viewName, object model) { - return View(viewName, null /* masterName */, model); - } - - protected internal virtual ViewResult View(string viewName, string masterName, object model) { - if (model != null) { - ViewData.Model = model; - } - - return new ViewResult { - ViewName = viewName, - MasterName = masterName, - ViewData = ViewData, - TempData = TempData - }; - } - - [SuppressMessage("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames", MessageId = "0#", - Justification = "The method name 'View' is a convenient shorthand for 'CreateViewResult'.")] - protected internal ViewResult View(IView view) { - return View(view, null /* model */); - } - - [SuppressMessage("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames", MessageId = "0#", - Justification = "The method name 'View' is a convenient shorthand for 'CreateViewResult'.")] - protected internal virtual ViewResult View(IView view, object model) { - if (model != null) { - ViewData.Model = model; - } - - return new ViewResult { - View = view, - ViewData = ViewData, - TempData = TempData - }; - } - - #region IActionFilter Members - void IActionFilter.OnActionExecuting(ActionExecutingContext filterContext) { - OnActionExecuting(filterContext); - } - - void IActionFilter.OnActionExecuted(ActionExecutedContext filterContext) { - OnActionExecuted(filterContext); - } - #endregion - - #region IAuthorizationFilter Members - void IAuthorizationFilter.OnAuthorization(AuthorizationContext filterContext) { - OnAuthorization(filterContext); - } - #endregion - - #region IExceptionFilter Members - void IExceptionFilter.OnException(ExceptionContext filterContext) { - OnException(filterContext); - } - #endregion - - #region IResultFilter Members - void IResultFilter.OnResultExecuting(ResultExecutingContext filterContext) { - OnResultExecuting(filterContext); - } - - void IResultFilter.OnResultExecuted(ResultExecutedContext filterContext) { - OnResultExecuted(filterContext); - } - #endregion - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerActionInvoker.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerActionInvoker.cs deleted file mode 100644 index da483ffc348..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerActionInvoker.cs +++ /dev/null @@ -1,328 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Linq; - using System.Threading; - using System.Web; - using System.Web.Mvc.Resources; - - public class ControllerActionInvoker : IActionInvoker { - - private readonly static ControllerDescriptorCache _staticDescriptorCache = new ControllerDescriptorCache(); - - private ModelBinderDictionary _binders; - private ControllerDescriptorCache _instanceDescriptorCache; - - [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", - Justification = "Property is settable so that the dictionary can be provided for unit testing purposes.")] - protected internal ModelBinderDictionary Binders { - get { - if (_binders == null) { - _binders = ModelBinders.Binders; - } - return _binders; - } - set { - _binders = value; - } - } - - internal ControllerDescriptorCache DescriptorCache { - get { - if (_instanceDescriptorCache == null) { - _instanceDescriptorCache = _staticDescriptorCache; - } - return _instanceDescriptorCache; - } - set { - _instanceDescriptorCache = value; - } - } - - private static void AddControllerToFilterList(ControllerBase controller, IList filterList) where TFilter : class { - TFilter controllerAsFilter = controller as TFilter; - if (controllerAsFilter != null) { - filterList.Insert(0, controllerAsFilter); - } - } - - protected virtual ActionResult CreateActionResult(ControllerContext controllerContext, ActionDescriptor actionDescriptor, object actionReturnValue) { - if (actionReturnValue == null) { - return new EmptyResult(); - } - - ActionResult actionResult = (actionReturnValue as ActionResult) ?? - new ContentResult { Content = Convert.ToString(actionReturnValue, CultureInfo.InvariantCulture) }; - return actionResult; - } - - protected virtual ControllerDescriptor GetControllerDescriptor(ControllerContext controllerContext) { - Type controllerType = controllerContext.Controller.GetType(); - ControllerDescriptor controllerDescriptor = DescriptorCache.GetDescriptor(controllerType); - return controllerDescriptor; - } - - protected virtual ActionDescriptor FindAction(ControllerContext controllerContext, ControllerDescriptor controllerDescriptor, string actionName) { - ActionDescriptor actionDescriptor = controllerDescriptor.FindAction(controllerContext, actionName); - return actionDescriptor; - } - - protected virtual FilterInfo GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor) { - FilterInfo filters = actionDescriptor.GetFilters(); - - // if the current controller implements one of the filter interfaces, it should be added to the list at position 0 - ControllerBase controller = controllerContext.Controller; - AddControllerToFilterList(controller, filters.ActionFilters); - AddControllerToFilterList(controller, filters.ResultFilters); - AddControllerToFilterList(controller, filters.AuthorizationFilters); - AddControllerToFilterList(controller, filters.ExceptionFilters); - - return filters; - } - - private IModelBinder GetModelBinder(ParameterDescriptor parameterDescriptor) { - // look on the parameter itself, then look in the global table - return parameterDescriptor.BindingInfo.Binder ?? Binders.GetBinder(parameterDescriptor.ParameterType); - } - - protected virtual object GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) { - // collect all of the necessary binding properties - Type parameterType = parameterDescriptor.ParameterType; - IModelBinder binder = GetModelBinder(parameterDescriptor); - IDictionary valueProvider = controllerContext.Controller.ValueProvider; - string parameterName = parameterDescriptor.BindingInfo.Prefix ?? parameterDescriptor.ParameterName; - Predicate propertyFilter = GetPropertyFilter(parameterDescriptor); - - // finally, call into the binder - ModelBindingContext bindingContext = new ModelBindingContext() { - FallbackToEmptyPrefix = (parameterDescriptor.BindingInfo.Prefix == null), // only fall back if prefix not specified - ModelName = parameterName, - ModelState = controllerContext.Controller.ViewData.ModelState, - ModelType = parameterType, - PropertyFilter = propertyFilter, - ValueProvider = valueProvider - }; - object result = binder.BindModel(controllerContext, bindingContext); - return result; - } - - protected virtual IDictionary GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) { - Dictionary parametersDict = new Dictionary(StringComparer.OrdinalIgnoreCase); - ParameterDescriptor[] parameterDescriptors = actionDescriptor.GetParameters(); - - foreach (ParameterDescriptor parameterDescriptor in parameterDescriptors) { - parametersDict[parameterDescriptor.ParameterName] = GetParameterValue(controllerContext, parameterDescriptor); - } - return parametersDict; - } - - private static Predicate GetPropertyFilter(ParameterDescriptor parameterDescriptor) { - ParameterBindingInfo bindingInfo = parameterDescriptor.BindingInfo; - return propertyName => BindAttribute.IsPropertyAllowed(propertyName, bindingInfo.Include.ToArray(), bindingInfo.Exclude.ToArray()); - } - - public virtual bool InvokeAction(ControllerContext controllerContext, string actionName) { - if (controllerContext == null) { - throw new ArgumentNullException("controllerContext"); - } - if (String.IsNullOrEmpty(actionName)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "actionName"); - } - - ControllerDescriptor controllerDescriptor = GetControllerDescriptor(controllerContext); - ActionDescriptor actionDescriptor = FindAction(controllerContext, controllerDescriptor, actionName); - if (actionDescriptor != null) { - FilterInfo filterInfo = GetFilters(controllerContext, actionDescriptor); - - try { - AuthorizationContext authContext = InvokeAuthorizationFilters(controllerContext, filterInfo.AuthorizationFilters, actionDescriptor); - if (authContext.Result != null) { - // the auth filter signaled that we should let it short-circuit the request - InvokeActionResult(controllerContext, authContext.Result); - } - else { - if (controllerContext.Controller.ValidateRequest) { - ValidateRequest(controllerContext.HttpContext.Request); - } - - IDictionary parameters = GetParameterValues(controllerContext, actionDescriptor); - ActionExecutedContext postActionContext = InvokeActionMethodWithFilters(controllerContext, filterInfo.ActionFilters, actionDescriptor, parameters); - InvokeActionResultWithFilters(controllerContext, filterInfo.ResultFilters, postActionContext.Result); - } - } - catch (ThreadAbortException) { - // This type of exception occurs as a result of Response.Redirect(), but we special-case so that - // the filters don't see this as an error. - throw; - } - catch (Exception ex) { - // something blew up, so execute the exception filters - ExceptionContext exceptionContext = InvokeExceptionFilters(controllerContext, filterInfo.ExceptionFilters, ex); - if (!exceptionContext.ExceptionHandled) { - throw; - } - InvokeActionResult(controllerContext, exceptionContext.Result); - } - - return true; - } - - // notify controller that no method matched - return false; - } - - protected virtual ActionResult InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary parameters) { - object returnValue = actionDescriptor.Execute(controllerContext, parameters); - ActionResult result = CreateActionResult(controllerContext, actionDescriptor, returnValue); - return result; - } - - internal static ActionExecutedContext InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func continuation) { - filter.OnActionExecuting(preContext); - if (preContext.Result != null) { - return new ActionExecutedContext(preContext, preContext.ActionDescriptor, true /* canceled */, null /* exception */) { - Result = preContext.Result - }; - } - - bool wasError = false; - ActionExecutedContext postContext = null; - try { - postContext = continuation(); - } - catch (ThreadAbortException) { - // This type of exception occurs as a result of Response.Redirect(), but we special-case so that - // the filters don't see this as an error. - postContext = new ActionExecutedContext(preContext, preContext.ActionDescriptor, false /* canceled */, null /* exception */); - filter.OnActionExecuted(postContext); - throw; - } - catch (Exception ex) { - wasError = true; - postContext = new ActionExecutedContext(preContext, preContext.ActionDescriptor, false /* canceled */, ex); - filter.OnActionExecuted(postContext); - if (!postContext.ExceptionHandled) { - throw; - } - } - if (!wasError) { - filter.OnActionExecuted(postContext); - } - return postContext; - } - - protected virtual ActionExecutedContext InvokeActionMethodWithFilters(ControllerContext controllerContext, IList filters, ActionDescriptor actionDescriptor, IDictionary parameters) { - ActionExecutingContext preContext = new ActionExecutingContext(controllerContext, actionDescriptor, parameters); - Func continuation = () => - new ActionExecutedContext(controllerContext, actionDescriptor, false /* canceled */, null /* exception */) { - Result = InvokeActionMethod(controllerContext, actionDescriptor, parameters) - }; - - // need to reverse the filter list because the continuations are built up backward - Func thunk = filters.Reverse().Aggregate(continuation, - (next, filter) => () => InvokeActionMethodFilter(filter, preContext, next)); - return thunk(); - } - - protected virtual void InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) { - actionResult.ExecuteResult(controllerContext); - } - - internal static ResultExecutedContext InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func continuation) { - filter.OnResultExecuting(preContext); - if (preContext.Cancel) { - return new ResultExecutedContext(preContext, preContext.Result, true /* canceled */, null /* exception */); - } - - bool wasError = false; - ResultExecutedContext postContext = null; - try { - postContext = continuation(); - } - catch (ThreadAbortException) { - // This type of exception occurs as a result of Response.Redirect(), but we special-case so that - // the filters don't see this as an error. - postContext = new ResultExecutedContext(preContext, preContext.Result, false /* canceled */, null /* exception */); - filter.OnResultExecuted(postContext); - throw; - } - catch (Exception ex) { - wasError = true; - postContext = new ResultExecutedContext(preContext, preContext.Result, false /* canceled */, ex); - filter.OnResultExecuted(postContext); - if (!postContext.ExceptionHandled) { - throw; - } - } - if (!wasError) { - filter.OnResultExecuted(postContext); - } - return postContext; - } - - protected virtual ResultExecutedContext InvokeActionResultWithFilters(ControllerContext controllerContext, IList filters, ActionResult actionResult) { - ResultExecutingContext preContext = new ResultExecutingContext(controllerContext, actionResult); - Func continuation = delegate { - InvokeActionResult(controllerContext, actionResult); - return new ResultExecutedContext(controllerContext, actionResult, false /* canceled */, null /* exception */); - }; - - // need to reverse the filter list because the continuations are built up backward - Func thunk = filters.Reverse().Aggregate(continuation, - (next, filter) => () => InvokeActionResultFilter(filter, preContext, next)); - return thunk(); - } - - protected virtual AuthorizationContext InvokeAuthorizationFilters(ControllerContext controllerContext, IList filters, ActionDescriptor actionDescriptor) { - AuthorizationContext context = new AuthorizationContext(controllerContext); - foreach (IAuthorizationFilter filter in filters) { - filter.OnAuthorization(context); - // short-circuit evaluation - if (context.Result != null) { - break; - } - } - - return context; - } - - protected virtual ExceptionContext InvokeExceptionFilters(ControllerContext controllerContext, IList filters, Exception exception) { - ExceptionContext context = new ExceptionContext(controllerContext, exception); - foreach (IExceptionFilter filter in filters) { - filter.OnException(context); - } - - return context; - } - - [SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "rawUrl", - Justification = "We only care about the property getter's side effects, not the returned value.")] - private static void ValidateRequest(HttpRequestBase request) { - // DevDiv 214040: Enable Request Validation by default for all controller requests - // - // Note that we grab the Request's RawUrl to force it to be validated. Calling ValidateInput() - // doesn't actually validate anything. It just sets flags indicating that on the next usage of - // certain inputs that they should be validated. We special case RawUrl because the URL has already - // been consumed by routing and thus might contain dangerous data. By forcing the RawUrl to be - // re-read we're making sure that it gets validated by ASP.NET. - - request.ValidateInput(); - string rawUrl = request.RawUrl; - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerBase.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerBase.cs deleted file mode 100644 index 8d6de638044..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerBase.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Diagnostics.CodeAnalysis; - using System.Web.Routing; - - public abstract class ControllerBase : MarshalByRefObject, IController { - - private TempDataDictionary _tempDataDictionary; - private bool _validateRequest = true; - private IDictionary _valueProvider; - private ViewDataDictionary _viewDataDictionary; - - public ControllerContext ControllerContext { - get; - set; - } - - [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", - Justification = "This property is settable so that unit tests can provide mock implementations.")] - public TempDataDictionary TempData { - get { - if (_tempDataDictionary == null) { - _tempDataDictionary = new TempDataDictionary(); - } - return _tempDataDictionary; - } - set { - _tempDataDictionary = value; - } - } - - public bool ValidateRequest { - get { - return _validateRequest; - } - set { - _validateRequest = value; - } - } - - [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", - Justification = "This property is settable so that unit tests can provide mock implementations.")] - public IDictionary ValueProvider { - get { - if (_valueProvider == null) { - _valueProvider = new ValueProviderDictionary(ControllerContext); - } - return _valueProvider; - } - set { - _valueProvider = value; - } - } - - [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", - Justification = "This property is settable so that unit tests can provide mock implementations.")] - public ViewDataDictionary ViewData { - get { - if (_viewDataDictionary == null) { - _viewDataDictionary = new ViewDataDictionary(); - } - return _viewDataDictionary; - } - set { - _viewDataDictionary = value; - } - } - - protected virtual void Execute(RequestContext requestContext) { - if (requestContext == null) { - throw new ArgumentNullException("requestContext"); - } - - Initialize(requestContext); - ExecuteCore(); - } - - protected abstract void ExecuteCore(); - - protected virtual void Initialize(RequestContext requestContext) { - ControllerContext = new ControllerContext(requestContext, this); - } - - #region IController Members - void IController.Execute(RequestContext requestContext) { - Execute(requestContext); - } - #endregion - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerBuilder.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerBuilder.cs deleted file mode 100644 index c86f740fd42..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerBuilder.cs +++ /dev/null @@ -1,87 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Web.Mvc.Resources; - - public class ControllerBuilder { - - private Func _factoryThunk; - private static ControllerBuilder _instance = new ControllerBuilder(); - private HashSet _namespaces = new HashSet(StringComparer.OrdinalIgnoreCase); - - public ControllerBuilder() { - SetControllerFactory(new DefaultControllerFactory() { - ControllerBuilder = this - }); - } - - public static ControllerBuilder Current { - get { - return _instance; - } - } - - public HashSet DefaultNamespaces { - get { - return _namespaces; - } - } - - [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", - Justification = "Calling method multiple times might return different objects.")] - public IControllerFactory GetControllerFactory() { - IControllerFactory controllerFactoryInstance = _factoryThunk(); - return controllerFactoryInstance; - } - - public void SetControllerFactory(IControllerFactory controllerFactory) { - if (controllerFactory == null) { - throw new ArgumentNullException("controllerFactory"); - } - - _factoryThunk = () => controllerFactory; - } - - public void SetControllerFactory(Type controllerFactoryType) { - if (controllerFactoryType == null) { - throw new ArgumentNullException("controllerFactoryType"); - } - if (!typeof(IControllerFactory).IsAssignableFrom(controllerFactoryType)) { - throw new ArgumentException( - String.Format( - CultureInfo.CurrentUICulture, - MvcResources.ControllerBuilder_MissingIControllerFactory, - controllerFactoryType), - "controllerFactoryType"); - } - - _factoryThunk = delegate() { - try { - return (IControllerFactory)Activator.CreateInstance(controllerFactoryType); - } - catch (Exception ex) { - throw new InvalidOperationException( - String.Format( - CultureInfo.CurrentUICulture, - MvcResources.ControllerBuilder_ErrorCreatingControllerFactory, - controllerFactoryType), - ex); - } - }; - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerContext.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerContext.cs deleted file mode 100644 index 14ffc1adecf..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerContext.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Diagnostics.CodeAnalysis; - using System.Web; - using System.Web.Routing; - - // Though many of the properties on ControllerContext and its subclassed types are virtual, there are still sealed - // properties (like ControllerContext.RequestContext, ActionExecutingContext.Result, etc.). If these properties - // were virtual, a mocking framework might override them with incorrect behavior (property getters would return - // null, property setters would be no-ops). By sealing these properties, we are forcing them to have the default - // "get or store a value" semantics that they were intended to have. - - public class ControllerContext { - - private HttpContextBase _httpContext; - private RequestContext _requestContext; - private RouteData _routeData; - - // parameterless constructor used for mocking - public ControllerContext() { - } - - // copy constructor - allows for subclassed types to take an existing ControllerContext as a parameter - // and we'll automatically set the appropriate properties - [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", - Justification = "The virtual property setters are only to support mocking frameworks, in which case this constructor shouldn't be called anyway.")] - protected ControllerContext(ControllerContext controllerContext) { - if (controllerContext == null) { - throw new ArgumentNullException("controllerContext"); - } - - Controller = controllerContext.Controller; - RequestContext = controllerContext.RequestContext; - } - - public ControllerContext(HttpContextBase httpContext, RouteData routeData, ControllerBase controller) - : this(new RequestContext(httpContext, routeData), controller) { - } - - [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", - Justification = "The virtual property setters are only to support mocking frameworks, in which case this constructor shouldn't be called anyway.")] - public ControllerContext(RequestContext requestContext, ControllerBase controller) { - if (requestContext == null) { - throw new ArgumentNullException("requestContext"); - } - if (controller == null) { - throw new ArgumentNullException("controller"); - } - - RequestContext = requestContext; - Controller = controller; - } - - public virtual ControllerBase Controller { - get; - set; - } - - public virtual HttpContextBase HttpContext { - get { - if (_httpContext == null) { - _httpContext = (_requestContext != null) ? _requestContext.HttpContext : new EmptyHttpContext(); - } - return _httpContext; - } - set { - _httpContext = value; - } - } - - public RequestContext RequestContext { - get { - if (_requestContext == null) { - // still need explicit calls to constructors since the property getters are virtual and might return null - HttpContextBase httpContext = HttpContext ?? new EmptyHttpContext(); - RouteData routeData = RouteData ?? new RouteData(); - - _requestContext = new RequestContext(httpContext, routeData); - } - return _requestContext; - } - set { - _requestContext = value; - } - } - - public virtual RouteData RouteData { - get { - if (_routeData == null) { - _routeData = (_requestContext != null) ? _requestContext.RouteData : new RouteData(); - } - return _routeData; - } - set { - _routeData = value; - } - } - - private sealed class EmptyHttpContext : HttpContextBase { - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerDescriptor.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerDescriptor.cs deleted file mode 100644 index 4e7a986f93a..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerDescriptor.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Diagnostics.CodeAnalysis; - using System.Reflection; - - public abstract class ControllerDescriptor : ICustomAttributeProvider { - - public virtual string ControllerName { - get { - string typeName = ControllerType.Name; - if (typeName.EndsWith("Controller", StringComparison.OrdinalIgnoreCase)) { - return typeName.Substring(0, typeName.Length - "Controller".Length); - } - - return typeName; - } - } - - public abstract Type ControllerType { - get; - } - - public abstract ActionDescriptor FindAction(ControllerContext controllerContext, string actionName); - - public abstract ActionDescriptor[] GetCanonicalActions(); - - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] - public virtual object[] GetCustomAttributes(bool inherit) { - return GetCustomAttributes(typeof(object), inherit); - } - - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] - public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) { - if (attributeType == null) { - throw new ArgumentNullException("attributeType"); - } - - return (object[])Array.CreateInstance(attributeType, 0); - } - - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] - public virtual bool IsDefined(Type attributeType, bool inherit) { - if (attributeType == null) { - throw new ArgumentNullException("attributeType"); - } - - return false; - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerDescriptorCache.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerDescriptorCache.cs deleted file mode 100644 index 4e6ba84ba18..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerDescriptorCache.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - - internal sealed class ControllerDescriptorCache : ReaderWriterCache { - - public ControllerDescriptorCache() { - } - - public ControllerDescriptor GetDescriptor(Type controllerType) { - return FetchOrCreateItem(controllerType, () => new ReflectedControllerDescriptor(controllerType)); - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerTypeCache.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerTypeCache.cs deleted file mode 100644 index c8314761086..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ControllerTypeCache.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Reflection; - - internal sealed class ControllerTypeCache { - - private Dictionary> _cache; - private object _lockObj = new object(); - - internal int Count { - get { - int count = 0; - foreach (var lookup in _cache.Values) { - foreach (var grouping in lookup) { - count += grouping.Count(); - } - } - return count; - } - } - - public void EnsureInitialized(IBuildManager buildManager) { - if (_cache == null) { - lock (_lockObj) { - if (_cache == null) { - List controllerTypes = GetAllControllerTypes(buildManager); - var groupedByName = controllerTypes.GroupBy( - t => t.Name.Substring(0, t.Name.Length - "Controller".Length), - StringComparer.OrdinalIgnoreCase); - _cache = groupedByName.ToDictionary( - g => g.Key, - g => g.ToLookup(t => t.Namespace ?? String.Empty, StringComparer.OrdinalIgnoreCase), - StringComparer.OrdinalIgnoreCase); - } - } - } - } - - private static List GetAllControllerTypes(IBuildManager buildManager) { - // Go through all assemblies referenced by the application and search for - // controllers and controller factories. - List controllerTypes = new List(); - ICollection assemblies = buildManager.GetReferencedAssemblies(); - foreach (Assembly assembly in assemblies) { - Type[] typesInAsm; - try { - typesInAsm = assembly.GetTypes(); - } - catch (ReflectionTypeLoadException ex) { - typesInAsm = ex.Types; - } - controllerTypes.AddRange(typesInAsm.Where(IsControllerType)); - } - return controllerTypes; - } - - public IList GetControllerTypes(string controllerName, HashSet namespaces) { - List matchingTypes = new List(); - - ILookup nsLookup; - if (_cache.TryGetValue(controllerName, out nsLookup)) { - // this friendly name was located in the cache, now cycle through namespaces - if (namespaces != null) { - foreach (string ns in namespaces) { - matchingTypes.AddRange(nsLookup[ns]); - } - } - else { - // if the namespaces parameter is null, search *every* namespace - foreach (var nsGroup in nsLookup) { - matchingTypes.AddRange(nsGroup); - } - } - } - - return matchingTypes; - } - - internal static bool IsControllerType(Type t) { - return - t != null && - t.IsPublic && - t.Name.EndsWith("Controller", StringComparison.OrdinalIgnoreCase) && - !t.IsAbstract && - typeof(IController).IsAssignableFrom(t); - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/CustomModelBinderAttribute.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/CustomModelBinderAttribute.cs deleted file mode 100644 index c086781f1f3..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/CustomModelBinderAttribute.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Diagnostics.CodeAnalysis; - - [AttributeUsage(ValidTargets, AllowMultiple = false, Inherited = false)] - public abstract class CustomModelBinderAttribute : Attribute { - - internal const AttributeTargets ValidTargets = AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Struct; - - [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", - Justification = "This method can potentially perform a non-trivial amount of work.")] - public abstract IModelBinder GetBinder(); - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/DefaultControllerFactory.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/DefaultControllerFactory.cs deleted file mode 100644 index ee6b1a54c47..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/DefaultControllerFactory.cs +++ /dev/null @@ -1,174 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Globalization; - using System.Text; - using System.Web; - using System.Web.Mvc.Resources; - using System.Web.Routing; - - public class DefaultControllerFactory : IControllerFactory { - - private IBuildManager _buildManager; - private ControllerBuilder _controllerBuilder; - private ControllerTypeCache _instanceControllerTypeCache; - private static ControllerTypeCache _staticControllerTypeCache = new ControllerTypeCache(); - - internal IBuildManager BuildManager { - get { - if (_buildManager == null) { - _buildManager = new BuildManagerWrapper(); - } - return _buildManager; - } - set { - _buildManager = value; - } - } - - internal ControllerBuilder ControllerBuilder { - get { - return _controllerBuilder ?? ControllerBuilder.Current; - } - set { - _controllerBuilder = value; - } - } - - internal ControllerTypeCache ControllerTypeCache { - get { - return _instanceControllerTypeCache ?? _staticControllerTypeCache; - } - set { - _instanceControllerTypeCache = value; - } - } - - public RequestContext RequestContext { - get; - set; - } - - public virtual IController CreateController(RequestContext requestContext, string controllerName) { - if (requestContext == null) { - throw new ArgumentNullException("requestContext"); - } - if (String.IsNullOrEmpty(controllerName)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "controllerName"); - } - RequestContext = requestContext; - Type controllerType = GetControllerType(controllerName); - IController controller = GetControllerInstance(controllerType); - return controller; - } - - protected internal virtual IController GetControllerInstance(Type controllerType) { - if (controllerType == null) { - throw new HttpException(404, - String.Format( - CultureInfo.CurrentUICulture, - MvcResources.DefaultControllerFactory_NoControllerFound, - RequestContext.HttpContext.Request.Path)); - } - if (!typeof(IController).IsAssignableFrom(controllerType)) { - throw new ArgumentException( - String.Format( - CultureInfo.CurrentUICulture, - MvcResources.DefaultControllerFactory_TypeDoesNotSubclassControllerBase, - controllerType), - "controllerType"); - } - try { - return (IController)Activator.CreateInstance(controllerType); - } - catch (Exception ex) { - throw new InvalidOperationException( - String.Format( - CultureInfo.CurrentUICulture, - MvcResources.DefaultControllerFactory_ErrorCreatingController, - controllerType), - ex); - } - } - - protected internal virtual Type GetControllerType(string controllerName) { - if (String.IsNullOrEmpty(controllerName)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "controllerName"); - } - - // first search in the current route's namespace collection - object routeNamespacesObj; - Type match; - if (RequestContext != null && RequestContext.RouteData.DataTokens.TryGetValue("Namespaces", out routeNamespacesObj)) { - IEnumerable routeNamespaces = routeNamespacesObj as IEnumerable; - if (routeNamespaces != null) { - HashSet nsHash = new HashSet(routeNamespaces, StringComparer.OrdinalIgnoreCase); - match = GetControllerTypeWithinNamespaces(controllerName, nsHash); - if (match != null) { - return match; - } - } - } - - // then search in the application's default namespace collection - HashSet nsDefaults = new HashSet(ControllerBuilder.DefaultNamespaces, StringComparer.OrdinalIgnoreCase); - match = GetControllerTypeWithinNamespaces(controllerName, nsDefaults); - if (match != null) { - return match; - } - - // if all else fails, search every namespace - return GetControllerTypeWithinNamespaces(controllerName, null /* namespaces */); - } - - private Type GetControllerTypeWithinNamespaces(string controllerName, HashSet namespaces) { - // Once the master list of controllers has been created we can quickly index into it - ControllerTypeCache.EnsureInitialized(BuildManager); - - IList matchingTypes = ControllerTypeCache.GetControllerTypes(controllerName, namespaces); - switch (matchingTypes.Count) { - case 0: - // no matching types - return null; - - case 1: - // single matching type - return matchingTypes[0]; - - default: - // multiple matching types - // we need to generate an exception containing all the controller types - StringBuilder sb = new StringBuilder(); - foreach (Type matchedType in matchingTypes) { - sb.AppendLine(); - sb.Append(matchedType.FullName); - } - throw new InvalidOperationException( - String.Format( - CultureInfo.CurrentUICulture, - MvcResources.DefaultControllerFactory_ControllerNameAmbiguous, - controllerName, sb)); - } - } - - public virtual void ReleaseController(IController controller) { - IDisposable disposable = controller as IDisposable; - if (disposable != null) { - disposable.Dispose(); - } - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/DefaultModelBinder.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/DefaultModelBinder.cs deleted file mode 100644 index 21f52b2d121..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/DefaultModelBinder.cs +++ /dev/null @@ -1,578 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections; - using System.Collections.Generic; - using System.ComponentModel; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Linq; - using System.Reflection; - using System.Web.Mvc.Resources; - - public class DefaultModelBinder : IModelBinder { - - private ModelBinderDictionary _binders; - private static string _resourceClassKey; - - [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", - Justification = "Property is settable so that the dictionary can be provided for unit testing purposes.")] - protected internal ModelBinderDictionary Binders { - get { - if (_binders == null) { - _binders = ModelBinders.Binders; - } - return _binders; - } - set { - _binders = value; - } - } - - public static string ResourceClassKey { - get { - return _resourceClassKey ?? String.Empty; - } - set { - _resourceClassKey = value; - } - } - - internal void BindComplexElementalModel(ControllerContext controllerContext, ModelBindingContext bindingContext, object model) { - // need to replace the property filter + model object and create an inner binding context - BindAttribute bindAttr = (BindAttribute)TypeDescriptor.GetAttributes(bindingContext.ModelType)[typeof(BindAttribute)]; - Predicate newPropertyFilter = (bindAttr != null) - ? propertyName => bindAttr.IsPropertyAllowed(propertyName) && bindingContext.PropertyFilter(propertyName) - : bindingContext.PropertyFilter; - - ModelBindingContext newBindingContext = new ModelBindingContext() { - Model = model, - ModelName = bindingContext.ModelName, - ModelState = bindingContext.ModelState, - ModelType = bindingContext.ModelType, - PropertyFilter = newPropertyFilter, - ValueProvider = bindingContext.ValueProvider - }; - - // validation - if (OnModelUpdating(controllerContext, newBindingContext)) { - BindProperties(controllerContext, newBindingContext); - OnModelUpdated(controllerContext, newBindingContext); - } - } - - internal object BindComplexModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { - object model = bindingContext.Model; - Type modelType = bindingContext.ModelType; - - // if we're being asked to create an array, create a list instead, then coerce to an array after the list is created - if (model == null && modelType.IsArray) { - Type elementType = modelType.GetElementType(); - Type listType = typeof(List<>).MakeGenericType(elementType); - object collection = CreateModel(controllerContext, bindingContext, listType); - - ModelBindingContext arrayBindingContext = new ModelBindingContext() { - Model = collection, - ModelName = bindingContext.ModelName, - ModelState = bindingContext.ModelState, - ModelType = listType, - PropertyFilter = bindingContext.PropertyFilter, - ValueProvider = bindingContext.ValueProvider - }; - IList list = (IList)UpdateCollection(controllerContext, arrayBindingContext, elementType); - - if (list == null) { - return null; - } - - Array array = Array.CreateInstance(elementType, list.Count); - list.CopyTo(array, 0); - return array; - } - - if (model == null) { - model = CreateModel(controllerContext,bindingContext,modelType); - } - - // special-case IDictionary<,> and ICollection<> - Type dictionaryType = ExtractGenericInterface(modelType, typeof(IDictionary<,>)); - if (dictionaryType != null) { - Type[] genericArguments = dictionaryType.GetGenericArguments(); - Type keyType = genericArguments[0]; - Type valueType = genericArguments[1]; - - ModelBindingContext dictionaryBindingContext = new ModelBindingContext() { - Model = model, - ModelName = bindingContext.ModelName, - ModelState = bindingContext.ModelState, - ModelType = modelType, - PropertyFilter = bindingContext.PropertyFilter, - ValueProvider = bindingContext.ValueProvider - }; - object dictionary = UpdateDictionary(controllerContext, dictionaryBindingContext, keyType, valueType); - return dictionary; - } - - Type enumerableType = ExtractGenericInterface(modelType, typeof(IEnumerable<>)); - if (enumerableType != null) { - Type elementType = enumerableType.GetGenericArguments()[0]; - - Type collectionType = typeof(ICollection<>).MakeGenericType(elementType); - if (collectionType.IsInstanceOfType(model)) { - ModelBindingContext collectionBindingContext = new ModelBindingContext() { - Model = model, - ModelName = bindingContext.ModelName, - ModelState = bindingContext.ModelState, - ModelType = modelType, - PropertyFilter = bindingContext.PropertyFilter, - ValueProvider = bindingContext.ValueProvider - }; - object collection = UpdateCollection(controllerContext, collectionBindingContext, elementType); - return collection; - } - } - - // otherwise, just update the properties on the complex type - BindComplexElementalModel(controllerContext, bindingContext, model); - return model; - } - - public virtual object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { - if (bindingContext == null) { - throw new ArgumentNullException("bindingContext"); - } - - bool performedFallback = false; - - if (!String.IsNullOrEmpty(bindingContext.ModelName) && !DictionaryHelpers.DoesAnyKeyHavePrefix(bindingContext.ValueProvider, bindingContext.ModelName)) { - // We couldn't find any entry that began with the prefix. If this is the top-level element, fall back - // to the empty prefix. - if (bindingContext.FallbackToEmptyPrefix) { - bindingContext = new ModelBindingContext() { - Model = bindingContext.Model, - ModelState = bindingContext.ModelState, - ModelType = bindingContext.ModelType, - PropertyFilter = bindingContext.PropertyFilter, - ValueProvider = bindingContext.ValueProvider - }; - performedFallback = true; - } - else { - return null; - } - } - - // Simple model = int, string, etc.; determined by calling TypeConverter.CanConvertFrom(typeof(string)) - // or by seeing if a value in the request exactly matches the name of the model we're binding. - // Complex type = everything else. - if (!performedFallback) { - ValueProviderResult vpResult; - bindingContext.ValueProvider.TryGetValue(bindingContext.ModelName, out vpResult); - if (vpResult != null) { - return BindSimpleModel(controllerContext, bindingContext, vpResult); - } - } - if (TypeDescriptor.GetConverter(bindingContext.ModelType).CanConvertFrom(typeof(string))) { - return null; - } - - return BindComplexModel(controllerContext, bindingContext); - } - - private void BindProperties(ControllerContext controllerContext, ModelBindingContext bindingContext) { - PropertyDescriptorCollection properties = GetModelProperties(controllerContext, bindingContext); - foreach (PropertyDescriptor property in properties) { - BindProperty(controllerContext, bindingContext, property); - } - } - - protected virtual void BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor) { - // need to skip properties that aren't part of the request, else we might hit a StackOverflowException - string fullPropertyKey = CreateSubPropertyName(bindingContext.ModelName, propertyDescriptor.Name); - if (!DictionaryHelpers.DoesAnyKeyHavePrefix(bindingContext.ValueProvider, fullPropertyKey)) { - return; - } - - // call into the property's model binder - IModelBinder propertyBinder = Binders.GetBinder(propertyDescriptor.PropertyType); - object originalPropertyValue = propertyDescriptor.GetValue(bindingContext.Model); - ModelBindingContext innerBindingContext = new ModelBindingContext() { - Model = originalPropertyValue, - ModelName = fullPropertyKey, - ModelState = bindingContext.ModelState, - ModelType = propertyDescriptor.PropertyType, - ValueProvider = bindingContext.ValueProvider - }; - object newPropertyValue = propertyBinder.BindModel(controllerContext, innerBindingContext); - - // validation - if (OnPropertyValidating(controllerContext, bindingContext, propertyDescriptor, newPropertyValue)) { - SetProperty(controllerContext, bindingContext, propertyDescriptor, newPropertyValue); - OnPropertyValidated(controllerContext, bindingContext, propertyDescriptor, newPropertyValue); - } - } - - internal object BindSimpleModel(ControllerContext controllerContext, ModelBindingContext bindingContext, ValueProviderResult valueProviderResult) { - bindingContext.ModelState.SetModelValue(bindingContext.ModelName, valueProviderResult); - - // if the value provider returns an instance of the requested data type, we can just short-circuit - // the evaluation and return that instance - if (bindingContext.ModelType.IsInstanceOfType(valueProviderResult.RawValue)) { - return valueProviderResult.RawValue; - } - - // since a string is an IEnumerable, we want it to skip the two checks immediately following - if (bindingContext.ModelType != typeof(string)) { - - // conversion results in 3 cases, as below - if (bindingContext.ModelType.IsArray) { - // case 1: user asked for an array - // ValueProviderResult.ConvertTo() understands array types, so pass in the array type directly - object modelArray = ConvertProviderResult(bindingContext.ModelState, bindingContext.ModelName, valueProviderResult, bindingContext.ModelType); - return modelArray; - } - - Type enumerableType = ExtractGenericInterface(bindingContext.ModelType, typeof(IEnumerable<>)); - if (enumerableType != null) { - // case 2: user asked for a collection rather than an array - // need to call ConvertTo() on the array type, then copy the array to the collection - object modelCollection = CreateModel(controllerContext, bindingContext, bindingContext.ModelType); - Type elementType = enumerableType.GetGenericArguments()[0]; - Type arrayType = elementType.MakeArrayType(); - object modelArray = ConvertProviderResult(bindingContext.ModelState, bindingContext.ModelName, valueProviderResult, arrayType); - - Type collectionType = typeof(ICollection<>).MakeGenericType(elementType); - if (collectionType.IsInstanceOfType(modelCollection)) { - CollectionHelpers.ReplaceCollection(elementType, modelCollection, modelArray); - } - return modelCollection; - } - } - - // case 3: user asked for an individual element - object model = ConvertProviderResult(bindingContext.ModelState, bindingContext.ModelName, valueProviderResult, bindingContext.ModelType); - return model; - } - - private static bool CanUpdateReadonlyTypedReference(Type type) { - // value types aren't strictly immutable, but because they have copy-by-value semantics - // we can't update a value type that is marked readonly - if (type.IsValueType) { - return false; - } - - // arrays are mutable, but because we can't change their length we shouldn't try - // to update an array that is referenced readonly - if (type.IsArray) { - return false; - } - - // special-case known common immutable types - if (type == typeof(string)) { - return false; - } - - return true; - } - - [SuppressMessage("Microsoft.Globalization", "CA1304:SpecifyCultureInfo", MessageId = "System.Web.Mvc.ValueProviderResult.ConvertTo(System.Type)", - Justification = "The target object should make the correct culture determination, not this method.")] - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", - Justification = "We're recording this exception so that we can act on it later.")] - private static object ConvertProviderResult(ModelStateDictionary modelState, string modelStateKey, ValueProviderResult valueProviderResult, Type destinationType) { - try { - object convertedValue = valueProviderResult.ConvertTo(destinationType); - return convertedValue; - } - catch (Exception ex) { - modelState.AddModelError(modelStateKey, ex); - return null; - } - } - - protected virtual object CreateModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Type modelType) { - Type typeToCreate = modelType; - - // we can understand some collection interfaces, e.g. IList<>, IDictionary<,> - if (modelType.IsGenericType) { - Type genericTypeDefinition = modelType.GetGenericTypeDefinition(); - if (genericTypeDefinition == typeof(IDictionary<,>)) { - typeToCreate = typeof(Dictionary<,>).MakeGenericType(modelType.GetGenericArguments()); - } - else if (genericTypeDefinition == typeof(IEnumerable<>) || genericTypeDefinition == typeof(ICollection<>) || genericTypeDefinition == typeof(IList<>)) { - typeToCreate = typeof(List<>).MakeGenericType(modelType.GetGenericArguments()); - } - } - - // fallback to the type's default constructor - return Activator.CreateInstance(typeToCreate); - } - - protected static string CreateSubIndexName(string prefix, int index) { - return String.Format(CultureInfo.InvariantCulture, "{0}[{1}]", prefix, index); - } - - protected static string CreateSubPropertyName(string prefix, string propertyName) { - return (!String.IsNullOrEmpty(prefix)) ? prefix + "." + propertyName : propertyName; - } - - private static Type ExtractGenericInterface(Type queryType, Type interfaceType) { - Func matchesInterface = t => t.IsGenericType && t.GetGenericTypeDefinition() == interfaceType; - return (matchesInterface(queryType)) ? queryType : queryType.GetInterfaces().FirstOrDefault(matchesInterface); - } - - protected virtual PropertyDescriptorCollection GetModelProperties(ControllerContext controllerContext, ModelBindingContext bindingContext) { - PropertyDescriptorCollection allProperties = TypeDescriptor.GetProperties(bindingContext.ModelType); - Predicate propertyFilter = bindingContext.PropertyFilter; - - var filteredProperties = from PropertyDescriptor property in allProperties - where ShouldUpdateProperty(property, propertyFilter) - select property; - - return new PropertyDescriptorCollection(filteredProperties.ToArray()); - } - - private static string GetValueRequiredResource(ControllerContext controllerContext) { - string resourceValue = null; - if (!String.IsNullOrEmpty(ResourceClassKey) && (controllerContext != null) && (controllerContext.HttpContext != null)) { - // If the user specified a ResourceClassKey try to load the resource they specified. - // If the class key is invalid, an exception will be thrown. - // If the class key is valid but the resource is not found, it returns null, in which - // case it will fall back to the MVC default error message. - resourceValue = controllerContext.HttpContext.GetGlobalResourceObject(ResourceClassKey, "PropertyValueRequired", CultureInfo.CurrentUICulture) as string; - } - return resourceValue ?? MvcResources.DefaultModelBinder_ValueRequired; - } - - protected virtual void OnModelUpdated(ControllerContext controllerContext, ModelBindingContext bindingContext) { - IDataErrorInfo errorProvider = bindingContext.Model as IDataErrorInfo; - if (errorProvider != null) { - string errorText = errorProvider.Error; - if (!String.IsNullOrEmpty(errorText)) { - bindingContext.ModelState.AddModelError(bindingContext.ModelName, errorText); - } - } - } - - protected virtual bool OnModelUpdating(ControllerContext controllerContext, ModelBindingContext bindingContext) { - // default implementation does nothing - - return true; - } - - protected virtual void OnPropertyValidated(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor, object value) { - IDataErrorInfo errorProvider = bindingContext.Model as IDataErrorInfo; - if (errorProvider != null) { - string errorText = errorProvider[propertyDescriptor.Name]; - if (!String.IsNullOrEmpty(errorText)) { - string modelStateKey = CreateSubPropertyName(bindingContext.ModelName, propertyDescriptor.Name); - bindingContext.ModelState.AddModelError(modelStateKey, errorText); - } - } - } - - protected virtual bool OnPropertyValidating(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor, object value) { - // default implementation just checks to make sure that required text entry fields aren't left blank - - string modelStateKey = CreateSubPropertyName(bindingContext.ModelName, propertyDescriptor.Name); - return VerifyValueUsability(controllerContext, bindingContext.ModelState, modelStateKey, propertyDescriptor.PropertyType, value); - } - - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", - Justification = "We're recording this exception so that we can act on it later.")] - protected virtual void SetProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor, object value) { - if (propertyDescriptor.IsReadOnly) { - return; - } - - try { - propertyDescriptor.SetValue(bindingContext.Model, value); - } - catch (Exception ex) { - string modelStateKey = CreateSubPropertyName(bindingContext.ModelName, propertyDescriptor.Name); - bindingContext.ModelState.AddModelError(modelStateKey, ex); - } - } - - private static bool ShouldUpdateProperty(PropertyDescriptor property, Predicate propertyFilter) { - if (property.IsReadOnly && !CanUpdateReadonlyTypedReference(property.PropertyType)) { - return false; - } - - // if this property is rejected by the filter, move on - if (!propertyFilter(property.Name)) { - return false; - } - - // otherwise, allow - return true; - } - - internal object UpdateCollection(ControllerContext controllerContext, ModelBindingContext bindingContext, Type elementType) { - IModelBinder elementBinder = Binders.GetBinder(elementType); - - // build up a list of items from the request - List modelList = new List(); - for (int currentIndex = 0; ; currentIndex++) { - string subIndexKey = CreateSubIndexName(bindingContext.ModelName, currentIndex); - if (!DictionaryHelpers.DoesAnyKeyHavePrefix(bindingContext.ValueProvider, subIndexKey)) { - // we ran out of elements to pull - break; - } - - ModelBindingContext innerContext = new ModelBindingContext() { - ModelName = subIndexKey, - ModelState = bindingContext.ModelState, - ModelType = elementType, - PropertyFilter = bindingContext.PropertyFilter, - ValueProvider = bindingContext.ValueProvider - }; - object thisElement = elementBinder.BindModel(controllerContext, innerContext); - - // we need to merge model errors up - VerifyValueUsability(controllerContext, bindingContext.ModelState, subIndexKey, elementType, thisElement); - modelList.Add(thisElement); - } - - // if there weren't any elements at all in the request, just return - if (modelList.Count == 0) { - return null; - } - - // replace the original collection - object collection = bindingContext.Model; - CollectionHelpers.ReplaceCollection(elementType, collection, modelList); - return collection; - } - - internal object UpdateDictionary(ControllerContext controllerContext, ModelBindingContext bindingContext, Type keyType, Type valueType) { - IModelBinder keyBinder = Binders.GetBinder(keyType); - IModelBinder valueBinder = Binders.GetBinder(valueType); - - // build up a list of items from the request - List> modelList = new List>(); - for (int currentIndex = 0; ; currentIndex++) { - string subIndexKey = CreateSubIndexName(bindingContext.ModelName, currentIndex); - string keyFieldKey = CreateSubPropertyName(subIndexKey, "key"); - string valueFieldKey = CreateSubPropertyName(subIndexKey, "value"); - - if (!(DictionaryHelpers.DoesAnyKeyHavePrefix(bindingContext.ValueProvider, keyFieldKey) && DictionaryHelpers.DoesAnyKeyHavePrefix(bindingContext.ValueProvider, valueFieldKey))) { - // we ran out of elements to pull - break; - } - - // bind the key - ModelBindingContext keyBindingContext = new ModelBindingContext() { - ModelName = keyFieldKey, - ModelState = bindingContext.ModelState, - ModelType = keyType, - ValueProvider = bindingContext.ValueProvider - }; - object thisKey = keyBinder.BindModel(controllerContext, keyBindingContext); - - // we need to merge model errors up - VerifyValueUsability(controllerContext, bindingContext.ModelState, keyFieldKey, keyType, thisKey); - if (!keyType.IsInstanceOfType(thisKey)) { - // we can't add an invalid key, so just move on - continue; - } - - // bind the value - ModelBindingContext valueBindingContext = new ModelBindingContext() { - ModelName = valueFieldKey, - ModelState = bindingContext.ModelState, - ModelType = valueType, - PropertyFilter = bindingContext.PropertyFilter, - ValueProvider = bindingContext.ValueProvider - }; - object thisValue = valueBinder.BindModel(controllerContext, valueBindingContext); - - // we need to merge model errors up - VerifyValueUsability(controllerContext, bindingContext.ModelState, valueFieldKey, valueType, thisValue); - KeyValuePair kvp = new KeyValuePair(thisKey, thisValue); - modelList.Add(kvp); - } - - // if there weren't any elements at all in the request, just return - if (modelList.Count == 0) { - return null; - } - - // replace the original collection - object dictionary = bindingContext.Model; - CollectionHelpers.ReplaceDictionary(keyType, valueType, dictionary, modelList); - return dictionary; - } - - private static bool VerifyValueUsability(ControllerContext controllerContext, ModelStateDictionary modelState, string modelStateKey, Type elementType, object value) { - if (value == null && !TypeHelpers.TypeAllowsNullValue(elementType)) { - if (modelState.IsValidField(modelStateKey)) { - // a required entry field was left blank - string message = GetValueRequiredResource(controllerContext); - modelState.AddModelError(modelStateKey, message); - } - // we don't care about "you must enter a value" messages if there was an error - return false; - } - - return true; - } - - // This helper type is used because we're working with strongly-typed collections, but we don't know the Ts - // ahead of time. By using the generic methods below, we can consolidate the collection-specific code in a - // single helper type rather than having reflection-based calls spread throughout the DefaultModelBinder type. - // There is a single point of entry to each of the methods below, so they're fairly simple to maintain. - - private static class CollectionHelpers { - - private static readonly MethodInfo _replaceCollectionMethod = typeof(CollectionHelpers).GetMethod("ReplaceCollectionImpl", BindingFlags.Static | BindingFlags.NonPublic); - private static readonly MethodInfo _replaceDictionaryMethod = typeof(CollectionHelpers).GetMethod("ReplaceDictionaryImpl", BindingFlags.Static | BindingFlags.NonPublic); - - public static void ReplaceCollection(Type collectionType, object collection, object newContents) { - MethodInfo targetMethod = _replaceCollectionMethod.MakeGenericMethod(collectionType); - targetMethod.Invoke(null, new object[] { collection, newContents }); - } - - private static void ReplaceCollectionImpl(ICollection collection, IEnumerable newContents) { - collection.Clear(); - if (newContents != null) { - foreach (object item in newContents) { - // if the item was not a T, some conversion failed. the error message will be propagated, - // but in the meanwhile we need to make a placeholder element in the array. - T castItem = (item is T) ? (T)item : default(T); - collection.Add(castItem); - } - } - } - - public static void ReplaceDictionary(Type keyType, Type valueType, object dictionary, object newContents) { - MethodInfo targetMethod = _replaceDictionaryMethod.MakeGenericMethod(keyType, valueType); - targetMethod.Invoke(null, new object[] { dictionary, newContents }); - } - - private static void ReplaceDictionaryImpl(IDictionary dictionary, IEnumerable> newContents) { - dictionary.Clear(); - foreach (var item in newContents) { - // if the item was not a T, some conversion failed. the error message will be propagated, - // but in the meanwhile we need to make a placeholder element in the dictionary. - TKey castKey = (TKey)item.Key; // this cast shouldn't fail - TValue castValue = (item.Value is TValue) ? (TValue)item.Value : default(TValue); - dictionary[castKey] = castValue; - } - } - - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/DefaultViewLocationCache.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/DefaultViewLocationCache.cs deleted file mode 100644 index f0479f42123..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/DefaultViewLocationCache.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Diagnostics.CodeAnalysis; - using System.Web.Caching; - using System.Web.Mvc.Resources; - - [SuppressMessage("Microsoft.Security", "CA2112:SecuredTypesShouldNotExposeFields", - Justification = "The Null field does not have access to secure information")] - public class DefaultViewLocationCache : IViewLocationCache { - private static readonly TimeSpan _defaultTimeSpan = new TimeSpan(0, 15, 0); - - public DefaultViewLocationCache() - : this(_defaultTimeSpan) { - } - - public DefaultViewLocationCache(TimeSpan timeSpan) { - if (timeSpan.Ticks < 0) { - throw new InvalidOperationException(MvcResources.DefaultViewLocationCache_NegativeTimeSpan); - } - TimeSpan = timeSpan; - } - - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", - Justification = "The reference type is immutable. ")] - public static readonly IViewLocationCache Null = new NullViewLocationCache(); - - public TimeSpan TimeSpan { - get; - private set; - } - - #region IViewLocationCache Members - public string GetViewLocation(HttpContextBase httpContext, string key) { - if (httpContext == null) { - throw new ArgumentNullException("httpContext"); - } - return (string)httpContext.Cache[key]; - } - - public void InsertViewLocation(HttpContextBase httpContext, string key, string virtualPath) { - if (httpContext == null) { - throw new ArgumentNullException("httpContext"); - } - httpContext.Cache.Insert(key, virtualPath, null /* dependencies */, Cache.NoAbsoluteExpiration, TimeSpan); - } - #endregion - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/DescriptorUtil.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/DescriptorUtil.cs deleted file mode 100644 index a19c90f89f3..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/DescriptorUtil.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Linq; - using System.Threading; - - internal static class DescriptorUtil { - - public static TDescriptor[] LazilyFetchOrCreateDescriptors(ref TDescriptor[] cacheLocation, Func initializer, Func converter) { - // did we already calculate this once? - TDescriptor[] existingCache = Interlocked.CompareExchange(ref cacheLocation, null, null); - if (existingCache != null) { - return existingCache; - } - - TReflection[] memberInfos = initializer(); - TDescriptor[] descriptors = memberInfos.Select(converter).Where(descriptor => descriptor != null).ToArray(); - TDescriptor[] updatedCache = Interlocked.CompareExchange(ref cacheLocation, descriptors, null); - return updatedCache ?? descriptors; - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/DictionaryHelpers.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/DictionaryHelpers.cs deleted file mode 100644 index 7eb761f55fe..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/DictionaryHelpers.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Linq; - - internal static class DictionaryHelpers { - - public static IEnumerable> FindKeysWithPrefix(IDictionary dictionary, string prefix) { - TValue exactMatchValue; - if (dictionary.TryGetValue(prefix, out exactMatchValue)) { - yield return new KeyValuePair(prefix, exactMatchValue); - } - - foreach (var entry in dictionary) { - string key = entry.Key; - - if (key.Length <= prefix.Length) { - continue; - } - - if (!key.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)) { - continue; - } - - char charAfterPrefix = key[prefix.Length]; - switch (charAfterPrefix) { - case '[': - case '.': - yield return entry; - break; - } - } - } - - public static bool DoesAnyKeyHavePrefix(IDictionary dictionary, string prefix) { - return FindKeysWithPrefix(dictionary, prefix).Any(); - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/EmptyResult.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/EmptyResult.cs deleted file mode 100644 index 3fef8eed4ca..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/EmptyResult.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - - // represents a result that doesn't do anything, like a controller action returning null - public class EmptyResult : ActionResult { - - private static readonly EmptyResult _singleton = new EmptyResult(); - - internal static EmptyResult Instance { - get { - return _singleton; - } - } - - public override void ExecuteResult(ControllerContext context) { - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/ExceptionContext.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/ExceptionContext.cs deleted file mode 100644 index 937dd233c43..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/ExceptionContext.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Diagnostics.CodeAnalysis; - - public class ExceptionContext : ControllerContext { - - private ActionResult _result; - - // parameterless constructor used for mocking - public ExceptionContext() { - } - - [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors", - Justification = "The virtual property setters are only to support mocking frameworks, in which case this constructor shouldn't be called anyway.")] - public ExceptionContext(ControllerContext controllerContext, Exception exception) - : base(controllerContext) { - if (exception == null) { - throw new ArgumentNullException("exception"); - } - - Exception = exception; - } - - public virtual Exception Exception { - get; - set; - } - - public bool ExceptionHandled { - get; - set; - } - - public ActionResult Result { - get { - return _result ?? EmptyResult.Instance; - } - set { - _result = value; - } - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/FileContentResult.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/FileContentResult.cs deleted file mode 100644 index 8a2fdc0f6f5..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/FileContentResult.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Diagnostics.CodeAnalysis; - using System.Web; - - public class FileContentResult : FileResult { - - public FileContentResult(byte[] fileContents, string contentType) - : base(contentType) { - if (fileContents == null) { - throw new ArgumentNullException("fileContents"); - } - - FileContents = fileContents; - } - - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", - Justification = "There's no reason to tamper-proof this array since it's supplied to the type's constructor.")] - public byte[] FileContents { - get; - private set; - } - - protected override void WriteFile(HttpResponseBase response) { - response.OutputStream.Write(FileContents, 0, FileContents.Length); - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/FilePathResult.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/FilePathResult.cs deleted file mode 100644 index 550113f9aba..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/FilePathResult.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Web; - using System.Web.Mvc.Resources; - - public class FilePathResult : FileResult { - - public FilePathResult(string fileName, string contentType) - : base(contentType) { - if (String.IsNullOrEmpty(fileName)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "fileName"); - } - - FileName = fileName; - } - - public string FileName { - get; - private set; - } - - protected override void WriteFile(HttpResponseBase response) { - response.TransmitFile(FileName); - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/FileResult.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/FileResult.cs deleted file mode 100644 index eb205425914..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/FileResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Net.Mime; - using System.Web; - using System.Web.Mvc.Resources; - - public abstract class FileResult : ActionResult { - - protected FileResult(string contentType) { - if (String.IsNullOrEmpty(contentType)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "contentType"); - } - - ContentType = contentType; - } - - private string _fileDownloadName; - - public string ContentType { - get; - private set; - } - - public string FileDownloadName { - get { - return _fileDownloadName ?? String.Empty; - } - set { - _fileDownloadName = value; - } - } - - public override void ExecuteResult(ControllerContext context) { - if (context == null) { - throw new ArgumentNullException("context"); - } - - HttpResponseBase response = context.HttpContext.Response; - response.ContentType = ContentType; - - if (!String.IsNullOrEmpty(FileDownloadName)) { - // From RFC 2183, Sec. 2.3: - // The sender may want to suggest a filename to be used if the entity is - // detached and stored in a separate file. If the receiving MUA writes - // the entity to a file, the suggested filename should be used as a - // basis for the actual filename, where possible. - ContentDisposition disposition = new ContentDisposition() { FileName = FileDownloadName }; - string headerValue = disposition.ToString(); - context.HttpContext.Response.AddHeader("Content-Disposition", headerValue); - } - - WriteFile(response); - } - - protected abstract void WriteFile(HttpResponseBase response); - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/FileStreamResult.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/FileStreamResult.cs deleted file mode 100644 index a6e1a6fb89e..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/FileStreamResult.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.IO; - using System.Web; - - public class FileStreamResult : FileResult { - - // default buffer size as defined in BufferedStream type - private const int _bufferSize = 0x1000; - - public FileStreamResult(Stream fileStream, string contentType) - : base(contentType) { - if (fileStream == null) { - throw new ArgumentNullException("fileStream"); - } - - FileStream = fileStream; - } - - public Stream FileStream { - get; - private set; - } - - protected override void WriteFile(HttpResponseBase response) { - // grab chunks of data and write to the output stream - Stream outputStream = response.OutputStream; - using (FileStream) { - byte[] buffer = new byte[_bufferSize]; - - while (true) { - int bytesRead = FileStream.Read(buffer, 0, _bufferSize); - if (bytesRead == 0) { - // no more data - break; - } - - outputStream.Write(buffer, 0, bytesRead); - } - } - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/FilterAttribute.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/FilterAttribute.cs deleted file mode 100644 index 1cda086a21c..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/FilterAttribute.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Web.Mvc.Resources; - - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = false)] - public abstract class FilterAttribute : Attribute { - - private int _order = -1; - - public int Order { - get { - return _order; - } - set { - if (value < -1) { - throw new ArgumentOutOfRangeException("value", - MvcResources.FilterAttribute_OrderOutOfRange); - } - _order = value; - } - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/FilterInfo.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/FilterInfo.cs deleted file mode 100644 index 031ffe34d97..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/FilterInfo.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System.Collections.Generic; - - public class FilterInfo { - - private List _actionFilters = new List(); - private List _authorizationFilters = new List(); - private List _exceptionFilters = new List(); - private List _resultFilters = new List(); - - public IList ActionFilters { - get { - return _actionFilters; - } - } - - public IList AuthorizationFilters { - get { - return _authorizationFilters; - } - } - - public IList ExceptionFilters { - get { - return _exceptionFilters; - } - } - - public IList ResultFilters { - get { - return _resultFilters; - } - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/FormCollection.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/FormCollection.cs deleted file mode 100644 index fb89c58a7a5..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/FormCollection.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Collections.Generic; - using System.Collections.Specialized; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Web.Mvc.Resources; - - [SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", - Justification = "It is not anticipated that users will need to serialize this type.")] - [SuppressMessage("Microsoft.Design", "CA1035:ICollectionImplementationsHaveStronglyTypedMembers", - Justification = "It is not anticipated that users will call FormCollection.CopyTo().")] - [FormCollectionBinder] - public class FormCollection : NameValueCollection { - - public FormCollection() { - } - - public FormCollection(NameValueCollection collection) { - if (collection == null) { - throw new ArgumentNullException("collection"); - } - - Add(collection); - } - - public IDictionary ToValueProvider() { - CultureInfo currentCulture = CultureInfo.CurrentCulture; - - Dictionary dict = new Dictionary(StringComparer.OrdinalIgnoreCase); - string[] keys = AllKeys; - foreach (string key in keys) { - string[] rawValue = GetValues(key); - string attemptedValue = this[key]; - ValueProviderResult vpResult = new ValueProviderResult(rawValue, attemptedValue, currentCulture); - dict[key] = vpResult; - } - - return dict; - } - - public virtual ValueProviderResult GetValue(string name) { - if (String.IsNullOrEmpty(name)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "name"); - } - - string[] rawValue = GetValues(name); - if (rawValue == null) { - return null; - } - - string attemptedValue = this[name]; - return new ValueProviderResult(rawValue, attemptedValue, CultureInfo.CurrentCulture); - } - - private sealed class FormCollectionBinderAttribute : CustomModelBinderAttribute { - - // since the FormCollectionModelBinder.BindModel() method is thread-safe, we only need to keep - // a single instance of the binder around - private static readonly FormCollectionModelBinder _binder = new FormCollectionModelBinder(); - - public override IModelBinder GetBinder() { - return _binder; - } - - // this class is used for generating a FormCollection object - private sealed class FormCollectionModelBinder : IModelBinder { - public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { - if (controllerContext == null) { - throw new ArgumentNullException("controllerContext"); - } - - return new FormCollection(controllerContext.HttpContext.Request.Form); - } - } - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/FormMethod.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/FormMethod.cs deleted file mode 100644 index 0c9ebc89432..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/FormMethod.cs +++ /dev/null @@ -1,18 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - public enum FormMethod { - Get, - Post - } -} \ No newline at end of file diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/HandleErrorAttribute.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/HandleErrorAttribute.cs deleted file mode 100644 index 0555051e42d..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/HandleErrorAttribute.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Web; - using System.Web.Mvc.Resources; - - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes", - Justification = "This attribute is AllowMultiple = true and users might want to override behavior.")] - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] - public class HandleErrorAttribute : FilterAttribute, IExceptionFilter { - - private const string _defaultView = "Error"; - - private Type _exceptionType = typeof(Exception); - private string _master; - private string _view; - - public Type ExceptionType { - get { - return _exceptionType; - } - set { - if (value == null) { - throw new ArgumentNullException("value"); - } - if (!typeof(Exception).IsAssignableFrom(value)) { - throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, - MvcResources.ExceptionViewAttribute_NonExceptionType, value.FullName)); - } - - _exceptionType = value; - } - } - - public string Master { - get { - return _master ?? String.Empty; - } - set { - _master = value; - } - } - - public string View { - get { - return (!String.IsNullOrEmpty(_view)) ? _view : _defaultView; - } - set { - _view = value; - } - } - - public virtual void OnException(ExceptionContext filterContext) { - if (filterContext == null) { - throw new ArgumentNullException("filterContext"); - } - - // If custom errors are disabled, we need to let the normal ASP.NET exception handler - // execute so that the user can see useful debugging information. - if (filterContext.ExceptionHandled || !filterContext.HttpContext.IsCustomErrorEnabled) { - return; - } - - Exception exception = filterContext.Exception; - - // If this is not an HTTP 500 (for example, if somebody throws an HTTP 404 from an action method), - // ignore it. - if (new HttpException(null, exception).GetHttpCode() != 500) { - return; - } - - if (!ExceptionType.IsInstanceOfType(exception)) { - return; - } - - string controllerName = (string)filterContext.RouteData.Values["controller"]; - string actionName = (string)filterContext.RouteData.Values["action"]; - HandleErrorInfo model = new HandleErrorInfo(filterContext.Exception, controllerName, actionName); - filterContext.Result = new ViewResult { - ViewName = View, - MasterName = Master, - ViewData = new ViewDataDictionary(model), - TempData = filterContext.Controller.TempData - }; - filterContext.ExceptionHandled = true; - filterContext.HttpContext.Response.Clear(); - filterContext.HttpContext.Response.StatusCode = 500; - - // Certain versions of IIS will sometimes use their own error page when - // they detect a server error. Setting this property indicates that we - // want it to try to render ASP.NET MVC's error page instead. - filterContext.HttpContext.Response.TrySkipIisCustomErrors = true; - } - } -} \ No newline at end of file diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/HandleErrorInfo.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/HandleErrorInfo.cs deleted file mode 100644 index d02f911de5e..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/HandleErrorInfo.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc { - using System; - using System.Web.Mvc.Resources; - - public class HandleErrorInfo { - - public HandleErrorInfo(Exception exception, string controllerName, string actionName) { - if (exception == null) { - throw new ArgumentNullException("exception"); - } - if (String.IsNullOrEmpty(controllerName)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "controllerName"); - } - if (string.IsNullOrEmpty(actionName)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "actionName"); - } - - Exception = exception; - ControllerName = controllerName; - ActionName = actionName; - } - - public string ActionName { - get; - private set; - } - - public string ControllerName { - get; - private set; - } - - public Exception Exception { - get; - private set; - } - - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/.gitattributes b/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/.gitattributes deleted file mode 100644 index 9c08a48ab0f..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/.gitattributes +++ /dev/null @@ -1,8 +0,0 @@ -/FormExtensions.cs -crlf -/InputExtensions.cs -crlf -/LinkExtensions.cs -crlf -/MvcForm.cs -crlf -/RenderPartialExtensions.cs -crlf -/SelectExtensions.cs -crlf -/TextAreaExtensions.cs -crlf -/ValidationExtensions.cs -crlf diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/FormExtensions.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/FormExtensions.cs deleted file mode 100644 index 287864db843..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/FormExtensions.cs +++ /dev/null @@ -1,140 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc.Html { - using System.Collections.Generic; - using System.Web.Routing; - - public static class FormExtensions { - public static MvcForm BeginForm(this HtmlHelper htmlHelper) { - // generates
...
- string formAction = htmlHelper.ViewContext.HttpContext.Request.RawUrl; - return FormHelper(htmlHelper, formAction, FormMethod.Post, new RouteValueDictionary()); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, object routeValues) { - return BeginForm(htmlHelper, null, null, new RouteValueDictionary(routeValues), FormMethod.Post, new RouteValueDictionary()); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, RouteValueDictionary routeValues) { - return BeginForm(htmlHelper, null, null, routeValues, FormMethod.Post, new RouteValueDictionary()); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName) { - return BeginForm(htmlHelper, actionName, controllerName, new RouteValueDictionary(), FormMethod.Post, new RouteValueDictionary()); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues) { - return BeginForm(htmlHelper, actionName, controllerName, new RouteValueDictionary(routeValues), FormMethod.Post, new RouteValueDictionary()); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues) { - return BeginForm(htmlHelper, actionName, controllerName, routeValues, FormMethod.Post, new RouteValueDictionary()); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, FormMethod method) { - return BeginForm(htmlHelper, actionName, controllerName, new RouteValueDictionary(), method, new RouteValueDictionary()); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues, FormMethod method) { - return BeginForm(htmlHelper, actionName, controllerName, new RouteValueDictionary(routeValues), method, new RouteValueDictionary()); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues, FormMethod method) { - return BeginForm(htmlHelper, actionName, controllerName, routeValues, method, new RouteValueDictionary()); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, FormMethod method, object htmlAttributes) { - return BeginForm(htmlHelper, actionName, controllerName, new RouteValueDictionary(), method, new RouteValueDictionary(htmlAttributes)); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, FormMethod method, IDictionary htmlAttributes) { - return BeginForm(htmlHelper, actionName, controllerName, new RouteValueDictionary(), method, htmlAttributes); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues, FormMethod method, object htmlAttributes) { - return BeginForm(htmlHelper, actionName, controllerName, new RouteValueDictionary(routeValues), method, new RouteValueDictionary(htmlAttributes)); - } - - public static MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues, FormMethod method, IDictionary htmlAttributes) { - string formAction = UrlHelper.GenerateUrl(null /* routeName */, actionName, controllerName, routeValues, htmlHelper.RouteCollection, htmlHelper.ViewContext.RequestContext, true /* includeImplicitMvcValues */); - return FormHelper(htmlHelper, formAction, method, htmlAttributes); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, object routeValues) { - return BeginRouteForm(htmlHelper, null /* routeName */, new RouteValueDictionary(routeValues), FormMethod.Post, new RouteValueDictionary()); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, RouteValueDictionary routeValues) { - return BeginRouteForm(htmlHelper, null /* routeName */, routeValues, FormMethod.Post, new RouteValueDictionary()); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName) { - return BeginRouteForm(htmlHelper, routeName, new RouteValueDictionary(), FormMethod.Post, new RouteValueDictionary()); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, object routeValues) { - return BeginRouteForm(htmlHelper, routeName, new RouteValueDictionary(routeValues), FormMethod.Post, new RouteValueDictionary()); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, RouteValueDictionary routeValues) { - return BeginRouteForm(htmlHelper, routeName, routeValues, FormMethod.Post, new RouteValueDictionary()); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, FormMethod method) { - return BeginRouteForm(htmlHelper, routeName, new RouteValueDictionary(), method, new RouteValueDictionary()); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, object routeValues, FormMethod method) { - return BeginRouteForm(htmlHelper, routeName, new RouteValueDictionary(routeValues), method, new RouteValueDictionary()); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, RouteValueDictionary routeValues, FormMethod method) { - return BeginRouteForm(htmlHelper, routeName, routeValues, method, new RouteValueDictionary()); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, FormMethod method, object htmlAttributes) { - return BeginRouteForm(htmlHelper, routeName, new RouteValueDictionary(), method, new RouteValueDictionary(htmlAttributes)); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, FormMethod method, IDictionary htmlAttributes) { - return BeginRouteForm(htmlHelper, routeName, new RouteValueDictionary(), method, htmlAttributes); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, object routeValues, FormMethod method, object htmlAttributes) { - return BeginRouteForm(htmlHelper, routeName, new RouteValueDictionary(routeValues), method, new RouteValueDictionary(htmlAttributes)); - } - - public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, RouteValueDictionary routeValues, FormMethod method, IDictionary htmlAttributes) { - string formAction = UrlHelper.GenerateUrl(routeName, null, null, routeValues, htmlHelper.RouteCollection, htmlHelper.ViewContext.RequestContext, false /* includeImplicitMvcValues */); - return FormHelper(htmlHelper, formAction, method, htmlAttributes); - } - - public static void EndForm(this HtmlHelper htmlHelper) { - HttpResponseBase httpResponse = htmlHelper.ViewContext.HttpContext.Response; - httpResponse.Write(""); - } - - private static MvcForm FormHelper(this HtmlHelper htmlHelper, string formAction, FormMethod method, IDictionary htmlAttributes) { - TagBuilder tagBuilder = new TagBuilder("form"); - tagBuilder.MergeAttributes(htmlAttributes); - // action is implicitly generated, so htmlAttributes take precedence. - tagBuilder.MergeAttribute("action", formAction); - // method is an explicit parameter, so it takes precedence over the htmlAttributes. - tagBuilder.MergeAttribute("method", HtmlHelper.GetFormMethodString(method), true); - - HttpResponseBase httpResponse = htmlHelper.ViewContext.HttpContext.Response; - httpResponse.Write(tagBuilder.ToString(TagRenderMode.StartTag)); - return new MvcForm(htmlHelper.ViewContext.HttpContext.Response); - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/InputExtensions.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/InputExtensions.cs deleted file mode 100644 index 1422cf1b365..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/InputExtensions.cs +++ /dev/null @@ -1,219 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc.Html { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Text; - using System.Web.Mvc.Resources; - using System.Web.Routing; - - public static class InputExtensions { - public static string CheckBox(this HtmlHelper htmlHelper, string name) { - return CheckBox(htmlHelper, name, (object)null /* htmlAttributes */); - } - - public static string CheckBox(this HtmlHelper htmlHelper, string name, bool isChecked) { - return CheckBox(htmlHelper, name, isChecked, (object)null /* htmlAttributes */); - } - - public static string CheckBox(this HtmlHelper htmlHelper, string name, bool isChecked, object htmlAttributes) { - return CheckBox(htmlHelper, name, isChecked, new RouteValueDictionary(htmlAttributes)); - } - - public static string CheckBox(this HtmlHelper htmlHelper, string name, object htmlAttributes) { - return CheckBox(htmlHelper, name, new RouteValueDictionary(htmlAttributes)); - } - - public static string CheckBox(this HtmlHelper htmlHelper, string name, IDictionary htmlAttributes) { - return htmlHelper.InputHelper(InputType.CheckBox, name, "true", true /* useViewData */, false /* isChecked */, true /* setId */, false /* isExplicitValue */, htmlAttributes); - } - - public static string CheckBox(this HtmlHelper htmlHelper, string name, bool isChecked, IDictionary htmlAttributes) { - // checked is an explicit parameter, but the value attribute is implicit so the dictionary's must take - // precedence. - RouteValueDictionary attributes = htmlAttributes == null ? new RouteValueDictionary() : new RouteValueDictionary(htmlAttributes); - attributes.Remove("checked"); - return htmlHelper.InputHelper(InputType.CheckBox, name, "true", false /* useViewData */, isChecked, true /* setId */, false /* isExplicitValue */, attributes); - } - - public static string Hidden(this HtmlHelper htmlHelper, string name) { - return Hidden(htmlHelper, name, null /* value */); - } - - public static string Hidden(this HtmlHelper htmlHelper, string name, object value) { - return Hidden(htmlHelper, name, value, (object)null /* hmtlAttributes */); - } - - public static string Hidden(this HtmlHelper htmlHelper, string name, object value, object htmlAttributes) { - return Hidden(htmlHelper, name, value, new RouteValueDictionary(htmlAttributes)); - } - - public static string Hidden(this HtmlHelper htmlHelper, string name, object value, IDictionary htmlAttributes) { - return InputHelper(htmlHelper, InputType.Hidden, name, value, (value == null) /* useViewData */, false /* isChecked */, true /* setId */, true /* isExplicitValue */, htmlAttributes); - } - - public static string Password(this HtmlHelper htmlHelper, string name) { - return Password(htmlHelper, name, null /* value */); - } - - public static string Password(this HtmlHelper htmlHelper, string name, object value) { - return Password(htmlHelper, name, value, (object)null /* htmlAttributes */); - } - - public static string Password(this HtmlHelper htmlHelper, string name, object value, object htmlAttributes) { - return Password(htmlHelper, name, value, new RouteValueDictionary(htmlAttributes)); - } - - public static string Password(this HtmlHelper htmlHelper, string name, object value, IDictionary htmlAttributes) { - return InputHelper(htmlHelper, InputType.Password, name, value, false /* useViewData */, false /* isChecked */, true /* setId */, true /* isExplicitValue */, htmlAttributes); - } - - public static string RadioButton(this HtmlHelper htmlHelper, string name, object value) { - return RadioButton(htmlHelper, name, value, (object)null /* htmlAttributes */); - } - - public static string RadioButton(this HtmlHelper htmlHelper, string name, object value, object htmlAttributes) { - return RadioButton(htmlHelper, name, value, new RouteValueDictionary(htmlAttributes)); - } - - public static string RadioButton(this HtmlHelper htmlHelper, string name, object value, IDictionary htmlAttributes) { - // Determine whether or not to render the checked attribute based on the contents of ViewData. - string valueString = Convert.ToString(value, CultureInfo.CurrentCulture); - bool isChecked = (!String.IsNullOrEmpty(name)) && (String.Equals(htmlHelper.EvalString(name), valueString, StringComparison.OrdinalIgnoreCase)); - // checked attributes is implicit, so we need to ensure that the dictionary takes precedence. - RouteValueDictionary attributes = htmlAttributes == null ? new RouteValueDictionary() : new RouteValueDictionary(htmlAttributes); - if (attributes.ContainsKey("checked")) { - return htmlHelper.InputHelper(InputType.Radio, name, value, false, false, true, true /* isExplicitValue */, attributes); - } - - return RadioButton(htmlHelper, name, value, isChecked, htmlAttributes); - } - - public static string RadioButton(this HtmlHelper htmlHelper, string name, object value, bool isChecked) { - return RadioButton(htmlHelper, name, value, isChecked, (object)null /* htmlAttributes */); - } - - public static string RadioButton(this HtmlHelper htmlHelper, string name, object value, bool isChecked, object htmlAttributes) { - return RadioButton(htmlHelper, name, value, isChecked, new RouteValueDictionary(htmlAttributes)); - } - - public static string RadioButton(this HtmlHelper htmlHelper, string name, object value, bool isChecked, IDictionary htmlAttributes) { - if (String.IsNullOrEmpty(name)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "name"); - } - if (value == null) { - throw new ArgumentNullException("value"); - } - // checked attribute is an explicit parameter so it takes precedence. - RouteValueDictionary attributes = htmlAttributes == null ? new RouteValueDictionary() : new RouteValueDictionary(htmlAttributes); - attributes.Remove("checked"); - return htmlHelper.InputHelper(InputType.Radio, name, value, false, isChecked, true, true /* isExplicitValue */, attributes); - } - - public static string TextBox(this HtmlHelper htmlHelper, string name) { - return TextBox(htmlHelper, name, null /* value */); - } - - public static string TextBox(this HtmlHelper htmlHelper, string name, object value) { - return TextBox(htmlHelper, name, value, (object)null /* htmlAttributes */); - } - - public static string TextBox(this HtmlHelper htmlHelper, string name, object value, object htmlAttributes) { - return TextBox(htmlHelper, name, value, new RouteValueDictionary(htmlAttributes)); - } - - public static string TextBox(this HtmlHelper htmlHelper, string name, object value, IDictionary htmlAttributes) { - return InputHelper(htmlHelper, InputType.Text, name, value, (value == null) /* useViewData */, false /* isChecked */, true /* setId */, true /* isExplicitValue */, htmlAttributes); - } - - private static string InputHelper(this HtmlHelper htmlHelper, InputType inputType, string name, object value, bool useViewData, bool isChecked, bool setId, bool isExplicitValue, IDictionary htmlAttributes) { - if (String.IsNullOrEmpty(name)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "name"); - } - - TagBuilder tagBuilder = new TagBuilder("input"); - tagBuilder.MergeAttributes(htmlAttributes); - tagBuilder.MergeAttribute("type", HtmlHelper.GetInputTypeString(inputType)); - tagBuilder.MergeAttribute("name", name, true); - - string valueParameter = Convert.ToString(value, CultureInfo.CurrentCulture); - bool usedModelState = false; - - switch (inputType) { - case InputType.CheckBox: - bool? modelStateWasChecked = htmlHelper.GetModelStateValue(name, typeof(bool)) as bool?; - if (modelStateWasChecked.HasValue) { - isChecked = modelStateWasChecked.Value; - usedModelState = true; - } - goto case InputType.Radio; - case InputType.Radio: - if (!usedModelState) { - string modelStateValue = htmlHelper.GetModelStateValue(name, typeof(string)) as string; - if (modelStateValue != null) { - isChecked = String.Equals(modelStateValue, valueParameter, StringComparison.Ordinal); - usedModelState = true; - } - } - if (!usedModelState && useViewData) { - isChecked = htmlHelper.EvalBoolean(name); - } - if (isChecked) { - tagBuilder.MergeAttribute("checked", "checked"); - } - tagBuilder.MergeAttribute("value", valueParameter, isExplicitValue); - break; - case InputType.Password: - if (value != null) { - tagBuilder.MergeAttribute("value", valueParameter, isExplicitValue); - } - break; - default: - string attemptedValue = (string)htmlHelper.GetModelStateValue(name, typeof(string)); - tagBuilder.MergeAttribute("value", attemptedValue ?? ((useViewData) ? htmlHelper.EvalString(name) : valueParameter), isExplicitValue); - break; - } - - if (setId) { - tagBuilder.GenerateId(name); - } - - // If there are any errors for a named field, we add the css attribute. - ModelState modelState; - if (htmlHelper.ViewData.ModelState.TryGetValue(name, out modelState)) { - if (modelState.Errors.Count > 0) { - tagBuilder.AddCssClass(HtmlHelper.ValidationInputCssClassName); - } - } - - if (inputType == InputType.CheckBox) { - // Render an additional for checkboxes. This - // addresses scenarios where unchecked checkboxes are not sent in the request. - // Sending a hidden input makes it possible to know that the checkbox was present - // on the page when the request was submitted. - StringBuilder inputItemBuilder = new StringBuilder(); - inputItemBuilder.Append(tagBuilder.ToString(TagRenderMode.SelfClosing)); - - TagBuilder hiddenInput = new TagBuilder("input"); - hiddenInput.MergeAttribute("type", HtmlHelper.GetInputTypeString(InputType.Hidden)); - hiddenInput.MergeAttribute("name", name); - hiddenInput.MergeAttribute("value", "false"); - inputItemBuilder.Append(hiddenInput.ToString(TagRenderMode.SelfClosing)); - return inputItemBuilder.ToString(); - } - - return tagBuilder.ToString(TagRenderMode.SelfClosing); - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/LinkExtensions.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/LinkExtensions.cs deleted file mode 100644 index 9c30810d1a0..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/LinkExtensions.cs +++ /dev/null @@ -1,112 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc.Html { - using System; - using System.Collections.Generic; - using System.Web.Mvc.Resources; - using System.Web.Routing; - - public static class LinkExtensions { - public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName) { - return ActionLink(htmlHelper, linkText, actionName, null /* controllerName */, new RouteValueDictionary(), new RouteValueDictionary()); - } - - public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, object routeValues) { - return ActionLink(htmlHelper, linkText, actionName, null /* controllerName */, new RouteValueDictionary(routeValues), new RouteValueDictionary()); - } - - public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, object routeValues, object htmlAttributes) { - return ActionLink(htmlHelper, linkText, actionName, null /* controllerName */, new RouteValueDictionary(routeValues), new RouteValueDictionary(htmlAttributes)); - } - - public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, RouteValueDictionary routeValues) { - return ActionLink(htmlHelper, linkText, actionName, null /* controllerName */, routeValues, new RouteValueDictionary()); - } - - public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, RouteValueDictionary routeValues, IDictionary htmlAttributes) { - return ActionLink(htmlHelper, linkText, actionName, null /* controllerName */, routeValues, htmlAttributes); - } - - public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName) { - return ActionLink(htmlHelper, linkText, actionName, controllerName, new RouteValueDictionary(), new RouteValueDictionary()); - } - - public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, object routeValues, object htmlAttributes) { - return ActionLink(htmlHelper, linkText, actionName, controllerName, new RouteValueDictionary(routeValues), new RouteValueDictionary(htmlAttributes)); - } - - public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, RouteValueDictionary routeValues, IDictionary htmlAttributes) { - if (String.IsNullOrEmpty(linkText)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "linkText"); - } - return HtmlHelper.GenerateLink(htmlHelper.ViewContext.RequestContext, htmlHelper.RouteCollection, linkText, null/* routeName */, actionName, controllerName, routeValues, htmlAttributes); - } - - public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, object routeValues, object htmlAttributes) { - return ActionLink(htmlHelper, linkText, actionName, controllerName, protocol, hostName, fragment, new RouteValueDictionary(routeValues), new RouteValueDictionary(htmlAttributes)); - } - - public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, IDictionary htmlAttributes) { - if (String.IsNullOrEmpty(linkText)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "linkText"); - } - return HtmlHelper.GenerateLink(htmlHelper.ViewContext.RequestContext, htmlHelper.RouteCollection, linkText, null /* routeName */, actionName, controllerName, protocol, hostName, fragment, routeValues, htmlAttributes); - } - - public static string RouteLink(this HtmlHelper htmlHelper, string linkText, object routeValues) { - return RouteLink(htmlHelper, linkText, new RouteValueDictionary(routeValues)); - } - - public static string RouteLink(this HtmlHelper htmlHelper, string linkText, RouteValueDictionary routeValues) { - return RouteLink(htmlHelper, linkText, routeValues, new RouteValueDictionary()); - } - - public static string RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, object routeValues) { - return RouteLink(htmlHelper, linkText, routeName, new RouteValueDictionary(routeValues)); - } - - public static string RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, RouteValueDictionary routeValues) { - return RouteLink(htmlHelper, linkText, routeName, routeValues, new RouteValueDictionary()); - } - - public static string RouteLink(this HtmlHelper htmlHelper, string linkText, object routeValues, object htmlAttributes) { - return RouteLink(htmlHelper, linkText, new RouteValueDictionary(routeValues), new RouteValueDictionary(htmlAttributes)); - } - - public static string RouteLink(this HtmlHelper htmlHelper, string linkText, RouteValueDictionary routeValues, IDictionary htmlAttributes) { - return RouteLink(htmlHelper, linkText, null /* routeName */, routeValues, htmlAttributes); - } - - public static string RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, object routeValues, object htmlAttributes) { - return RouteLink(htmlHelper, linkText, routeName, new RouteValueDictionary(routeValues), new RouteValueDictionary(htmlAttributes)); - } - - public static string RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, RouteValueDictionary routeValues, IDictionary htmlAttributes) { - if (String.IsNullOrEmpty(linkText)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "linkText"); - } - return HtmlHelper.GenerateRouteLink(htmlHelper.ViewContext.RequestContext, htmlHelper.RouteCollection, linkText, routeName, routeValues, htmlAttributes); - } - - public static string RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, string protocol, string hostName, string fragment, object routeValues, object htmlAttributes) { - return RouteLink(htmlHelper, linkText, routeName, protocol, hostName, fragment, new RouteValueDictionary(routeValues), new RouteValueDictionary(htmlAttributes)); - } - - public static string RouteLink(this HtmlHelper htmlHelper, string linkText, string routeName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, IDictionary htmlAttributes) { - if (String.IsNullOrEmpty(linkText)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "linkText"); - } - return HtmlHelper.GenerateRouteLink(htmlHelper.ViewContext.RequestContext, htmlHelper.RouteCollection, linkText, routeName, protocol, hostName, fragment, routeValues, htmlAttributes); - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/MvcForm.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/MvcForm.cs deleted file mode 100644 index c2e29a94754..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/MvcForm.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc.Html { - using System; - using System.Diagnostics.CodeAnalysis; - - public class MvcForm : IDisposable { - private bool _disposed; - private readonly HttpResponseBase _httpResponse; - - public MvcForm(HttpResponseBase httpResponse) { - if (httpResponse == null) { - throw new ArgumentNullException("httpResponse"); - } - _httpResponse = httpResponse; - } - - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] - public void Dispose() { - Dispose(true /* disposing */); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) { - if (!_disposed) { - _disposed = true; - _httpResponse.Write(""); - } - } - - public void EndForm() { - Dispose(true); - } - } -} diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/RenderPartialExtensions.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/RenderPartialExtensions.cs deleted file mode 100644 index bb483bd2e10..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/RenderPartialExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc.Html { - - public static class RenderPartialExtensions { - // Renders the partial view with the parent's view data - public static void RenderPartial(this HtmlHelper htmlHelper, string partialViewName) { - htmlHelper.RenderPartialInternal(partialViewName, htmlHelper.ViewData, null, ViewEngines.Engines); - } - - // Renders the partial view with the given view data - public static void RenderPartial(this HtmlHelper htmlHelper, string partialViewName, ViewDataDictionary viewData) { - htmlHelper.RenderPartialInternal(partialViewName, viewData, null, ViewEngines.Engines); - } - - // Renders the partial view with an empty view data and the given model - public static void RenderPartial(this HtmlHelper htmlHelper, string partialViewName, object model) { - htmlHelper.RenderPartialInternal(partialViewName, htmlHelper.ViewData, model, ViewEngines.Engines); - } - - // Renders the partial view with a copy of the given view data plus the given model - public static void RenderPartial(this HtmlHelper htmlHelper, string partialViewName, object model, ViewDataDictionary viewData) { - htmlHelper.RenderPartialInternal(partialViewName, viewData, model, ViewEngines.Engines); - } - } -} \ No newline at end of file diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/SelectExtensions.cs b/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/SelectExtensions.cs deleted file mode 100644 index 479bf3854c9..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc/Html/SelectExtensions.cs +++ /dev/null @@ -1,185 +0,0 @@ -/* **************************************************************************** - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * This software is subject to the Microsoft Public License (Ms-PL). - * A copy of the license can be found in the license.htm file included - * in this distribution. - * - * You must not remove this notice, or any other, from this software. - * - * ***************************************************************************/ - -namespace System.Web.Mvc.Html { - using System.Collections; - using System.Collections.Generic; - using System.Diagnostics.CodeAnalysis; - using System.Globalization; - using System.Linq; - using System.Text; - using System.Web; - using System.Web.Mvc.Resources; - using System.Web.Routing; - - public static class SelectExtensions { - public static string DropDownList(this HtmlHelper htmlHelper, string name, string optionLabel) { - return SelectInternal(htmlHelper, optionLabel, name, null/* selectList */, false /* allowMultiple */, (IDictionary)null /* htmlAttributes */); - } - - public static string DropDownList(this HtmlHelper htmlHelper, string name, IEnumerable selectList, string optionLabel) { - return DropDownList(htmlHelper, name, selectList, optionLabel, (IDictionary)null); - } - - public static string DropDownList(this HtmlHelper htmlHelper, string name, IEnumerable selectList, string optionLabel, object htmlAttributes) { - return DropDownList(htmlHelper, name, selectList, optionLabel, new RouteValueDictionary(htmlAttributes)); - } - - public static string DropDownList(this HtmlHelper htmlHelper, string name) { - return SelectInternal(htmlHelper, null /* optionLabel */, name, null /* selectList */, false /* allowMultiple */, (IDictionary)null /* htmlAttributes */); - } - - public static string DropDownList(this HtmlHelper htmlHelper, string name, IEnumerable selectList) { - return DropDownList(htmlHelper, name, selectList, (object)null /* htmlAttributes */); - } - - public static string DropDownList(this HtmlHelper htmlHelper, string name, IEnumerable selectList, object htmlAttributes) { - return DropDownList(htmlHelper, name, selectList, new RouteValueDictionary(htmlAttributes)); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", - Justification = "This type is appropriate for indicating a single selection.")] - public static string DropDownList(this HtmlHelper htmlHelper, string name, IEnumerable selectList, IDictionary htmlAttributes) { - return SelectInternal(htmlHelper, null /* optionLabel */, name, selectList, false /* allowMultiple */, htmlAttributes); - } - - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", - Justification = "This type is appropriate for indicating a single selection.")] - public static string DropDownList(this HtmlHelper htmlHelper, string name, IEnumerable selectList, string optionLabel, IDictionary htmlAttributes) { - return SelectInternal(htmlHelper, optionLabel, name, selectList, false /* allowMultiple */, htmlAttributes); - } - - public static string ListBox(this HtmlHelper htmlHelper, string name) { - return SelectInternal(htmlHelper, null/* optionLabel */, name, null/* selectList */, true/* allowMultiple */, (IDictionary)null /* htmlAttributes */); - } - - public static string ListBox(this HtmlHelper htmlHelper, string name, IEnumerable selectList) { - return ListBox(htmlHelper, name, selectList, (IDictionary)null); - } - - public static string ListBox(this HtmlHelper htmlHelper, string name, IEnumerable selectList, object htmlAttributes) { - return ListBox(htmlHelper, name, selectList, new RouteValueDictionary(htmlAttributes)); - } - - public static string ListBox(this HtmlHelper htmlHelper, string name, IEnumerable selectList, IDictionary htmlAttributes) { - return SelectInternal(htmlHelper, null /* optionLabel */, name, selectList, true /* allowMultiple */, htmlAttributes); - } - - private static IEnumerable GetSelectData(this HtmlHelper htmlHelper, string name) { - object o = null; - if (htmlHelper.ViewData != null) { - o = htmlHelper.ViewData.Eval(name); - } - if (o == null) { - throw new InvalidOperationException( - String.Format( - CultureInfo.CurrentUICulture, - MvcResources.HtmlHelper_MissingSelectData, - name, - "IEnumerable")); - } - IEnumerable selectList = o as IEnumerable; - if (selectList == null) { - throw new InvalidOperationException( - String.Format( - CultureInfo.CurrentUICulture, - MvcResources.HtmlHelper_WrongSelectDataType, - name, - o.GetType().FullName, - "IEnumerable")); - } - return selectList; - } - - private static string ListItemToOption(SelectListItem item) { - TagBuilder builder = new TagBuilder("option") { - InnerHtml = HttpUtility.HtmlEncode(item.Text) - }; - if (item.Value != null) { - builder.Attributes["value"] = item.Value; - } - if (item.Selected) { - builder.Attributes["selected"] = "selected"; - } - return builder.ToString(TagRenderMode.Normal); - } - - private static string SelectInternal(this HtmlHelper htmlHelper, string optionLabel, string name, IEnumerable selectList, bool allowMultiple, IDictionary htmlAttributes) { - if (String.IsNullOrEmpty(name)) { - throw new ArgumentException(MvcResources.Common_NullOrEmpty, "name"); - } - - bool usedViewData = false; - - // If we got a null selectList, try to use ViewData to get the list of items. - if (selectList == null) { - selectList = htmlHelper.GetSelectData(name); - usedViewData = true; - } - - object defaultValue = (allowMultiple) ? htmlHelper.GetModelStateValue(name, typeof(string[])) : htmlHelper.GetModelStateValue(name, typeof(string)); - - // If we haven't already used ViewData to get the entire list of items then we need to - // use the ViewData-supplied value before using the parameter-supplied value. - if (!usedViewData) { - if (defaultValue == null) { - defaultValue = htmlHelper.ViewData.Eval(name); - } - } - - if (defaultValue != null) { - IEnumerable defaultValues = (allowMultiple) ? defaultValue as IEnumerable : new[] { defaultValue }; - IEnumerable values = from object value in defaultValues select Convert.ToString(value, CultureInfo.CurrentCulture); - HashSet selectedValues = new HashSet(values, StringComparer.OrdinalIgnoreCase); - List newSelectList = new List(); - - foreach (SelectListItem item in selectList) { - item.Selected = (item.Value != null) ? selectedValues.Contains(item.Value) : selectedValues.Contains(item.Text); - newSelectList.Add(item); - } - selectList = newSelectList; - } - - // Convert each ListItem to an