diff --git a/Makefile.am b/Makefile.am index 19f0cfbd79..d48ca3110e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,15 +5,15 @@ AM_CFLAGS = $(WERROR_CFLAGS) MONOTOUCH_SUBDIRS = $(libgc_dir) eglib/src mono if CROSS_COMPILING -SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) +SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) acceptance-tests # Keep in sync with SUBDIRS ## 'tools' is not normally built -DIST_SUBDIRS = m4 po $(libgc_dir) 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 acceptance-tests else -SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) +SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) acceptance-tests # Keep in sync with SUBDIRS ## 'tools' is not normally built -DIST_SUBDIRS = m4 po $(libgc_dir) 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 acceptance-tests endif all: update_submodules @@ -25,13 +25,14 @@ update_submodules: .PHONY: update_submodules EXTRA_DIST= \ - README.md \ - LICENSE \ - autogen.sh \ - mkinstalldirs \ - mono-uninstalled.pc.in \ - winconfig.h \ - external + README.md \ + LICENSE \ + autogen.sh \ + mkinstalldirs \ + mono-uninstalled.pc.in \ + winconfig.h \ + code_of_conduct.md \ + external DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false @@ -56,7 +57,7 @@ DISTCLEANFILES= mono-uninstalled.pc mcslib = $(mcs_topdir)/class/lib monolite = $(mcslib)/monolite mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c) -monolite_url = http://storage.bos.xamarin.com/mono-dist-master/latest/monolite-$(mono_corlib_version)-latest.tar.gz +monolite_url = http://download.mono-project.com/monolite/monolite-$(mono_corlib_version)-latest.tar.gz .PHONY: get-monolite-latest get-monolite-latest: -rm -fr $(mcslib)/monolite-* diff --git a/Makefile.in b/Makefile.in index 322c2eb5a6..04c7dd0eb0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -214,8 +214,6 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOEHM_DEFINES = @BOEHM_DEFINES@ BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_GLIB_CFLAGS = @BUILD_GLIB_CFLAGS@ -BUILD_GLIB_LIBS = @BUILD_GLIB_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ @@ -231,9 +229,9 @@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DEFAULT_PROFILE = @DEFAULT_PROFILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DISABLE_SHARED_HANDLES = @DISABLE_SHARED_HANDLES@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ DSYMUTIL = @DSYMUTIL@ @@ -251,8 +249,6 @@ GDKX11 = @GDKX11@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ @@ -413,21 +409,22 @@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AM_CFLAGS = $(WERROR_CFLAGS) MONOTOUCH_SUBDIRS = $(libgc_dir) eglib/src mono -@CROSS_COMPILING_FALSE@SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) -@CROSS_COMPILING_TRUE@SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) +@CROSS_COMPILING_FALSE@SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) acceptance-tests +@CROSS_COMPILING_TRUE@SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir) acceptance-tests # Keep in sync with SUBDIRS -@CROSS_COMPILING_FALSE@DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs +@CROSS_COMPILING_FALSE@DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests # Keep in sync with SUBDIRS -@CROSS_COMPILING_TRUE@DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs +@CROSS_COMPILING_TRUE@DIST_SUBDIRS = m4 po $(libgc_dir) eglib mono ikvm-native support data runtime scripts man samples tools msvc docs acceptance-tests SUBMODULE_ERROR = 'Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date' EXTRA_DIST = \ - README.md \ - LICENSE \ - autogen.sh \ - mkinstalldirs \ - mono-uninstalled.pc.in \ - winconfig.h \ - external + README.md \ + LICENSE \ + autogen.sh \ + mkinstalldirs \ + mono-uninstalled.pc.in \ + winconfig.h \ + code_of_conduct.md \ + external DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false # Disable this for now because it is very slow and causes wrench to timeout: @@ -440,7 +437,7 @@ DISTCLEANFILES = mono-uninstalled.pc mcslib = $(mcs_topdir)/class/lib monolite = $(mcslib)/monolite mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c) -monolite_url = http://storage.bos.xamarin.com/mono-dist-master/latest/monolite-$(mono_corlib_version)-latest.tar.gz +monolite_url = http://download.mono-project.com/monolite/monolite-$(mono_corlib_version)-latest.tar.gz all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/README.md b/README.md index 1d44a52c3d..96559ab5c3 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ Community supported architectures: [8]: http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-armhf/ [9]: https://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true [10]: https://ci.appveyor.com/project/ajlennon/mono-817/branch/master -[11]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=nealef-s390x-1/badge/icon -[12]: http://jenkins.mono-project.com/job/test-mono-mainline-communityarchitectures/label=nealef-s390x-1/ +[11]: https://jenkins.mono-project.com/job/z/label=centos-s390x/badge/icon +[12]: https://jenkins.mono-project.com/job/z/label=centos-s390x Compilation and Installation ============================ @@ -80,8 +80,7 @@ Testing and Installation You can run the mono and mcs test suites with the command: `make check`. 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/). +can compare the failures you got with [https://jenkins.mono-project.com/](https://jenkins.mono-project.com/). You can now install mono with: `make install` @@ -497,4 +496,3 @@ to do at all), first edit `.gitmodules` to point to the new location, then: The desired output diff is a change in `.gitmodules` to reflect the change in the remote URL, and a change in / where you see the desired change in the commit hash. - diff --git a/acceptance-tests/Makefile.am.REMOVED.git-id b/acceptance-tests/Makefile.am.REMOVED.git-id new file mode 100644 index 0000000000..f308fe0742 --- /dev/null +++ b/acceptance-tests/Makefile.am.REMOVED.git-id @@ -0,0 +1 @@ +68b9ff90e7dc4c8e38686a067a75eb9365f9504b \ No newline at end of file diff --git a/acceptance-tests/Makefile.in.REMOVED.git-id b/acceptance-tests/Makefile.in.REMOVED.git-id new file mode 100644 index 0000000000..bae9d852b6 --- /dev/null +++ b/acceptance-tests/Makefile.in.REMOVED.git-id @@ -0,0 +1 @@ +e59629639b73555931e60aa95d850ac5dd3e4a5e \ No newline at end of file diff --git a/acceptance-tests/README.md b/acceptance-tests/README.md new file mode 100644 index 0000000000..3ca8102a22 --- /dev/null +++ b/acceptance-tests/README.md @@ -0,0 +1,14 @@ +This directory contains acceptance tests, handled by optional non git submodule based submodules. Run the tests via "make check-full" (there are also targets for individual test suites). + +The SUBMODULES.json file stores information about the submodules, and make targets are used to check out submodules, check their versions, and update the submodule information. + +By convention, submodules repositories are at the same level as the mono repository. + +Make targets available: + +make check- - Checks whenever is checked out and matches the version in the info file. +make reset- - Clones if neccesary and checks out the revision specified in the info file. +make bump- - Updates the revision stored in the info file for . +make bump-current- - Updates the revision stored in the info file for to the current revision. +make commit-bump- - Same as make bump-, but commits the change. +make commit-bump-current- - Same as make bump-current-, but commits the change. diff --git a/acceptance-tests/SUBMODULES.json b/acceptance-tests/SUBMODULES.json new file mode 100644 index 0000000000..e0335f40f7 --- /dev/null +++ b/acceptance-tests/SUBMODULES.json @@ -0,0 +1,26 @@ +[ + { + "name": "roslyn", + "url": "git://github.com/dotnet/roslyn.git", + "rev": "322bd5b2bbf07df6a67de35cbcb2365484412f70", + "remote-branch": "origin/master", + "branch": "master", + "directory": "roslyn" + }, + { + "name": "coreclr", + "url": "git://github.com/mono/coreclr.git", + "rev": "96cf61f96b42cf9d013e641609cb7787f6e3a71f", + "remote-branch": "origin/mono", + "branch": "mono", + "directory": "coreclr" + }, + { + "name": "ms-test-suite", + "url": "git@github.com:xamarin/ms-test-suite.git", + "rev": "8eb26bd72a38e2c78675db45b13e89237dbdf4f2", + "remote-branch": "origin/master", + "branch": "master", + "directory": "ms-test-suite" + } +] \ No newline at end of file diff --git a/acceptance-tests/versions.mk b/acceptance-tests/versions.mk new file mode 100644 index 0000000000..7864669b9e --- /dev/null +++ b/acceptance-tests/versions.mk @@ -0,0 +1,159 @@ +.PHONY: validate-versions reset-versions + +CONFIG=SUBMODULES.json + +# usage $(call ValidateVersionTemplate (name,MAKEFILE VAR,repo name)) +# usage $(call ValidateVersionTemplate (mono,MONO,mono)) + +define ValidateVersionTemplate +#$(eval REPOSITORY_$(2):=$(shell test -z $(3) && echo $(1) || echo "$(3)")) +#$(eval DIRECTORY_$(2):=$(shell python versions.py get-dir $(1))) +#$(eval DIRECTORY_$(2):=$(shell test -z $(DIRECTORY_$(2)) && echo $(1) || echo $(DIRECTORY_$(2)))) +#$(eval MODULE_$(2):=$(shell python versions.py get-url $(1))) +#$(eval NEEDED_$(2)_VERSION:=$(shell python versions.py get-rev $(1))) +#$(eval $(2)_BRANCH_AND_REMOTE:=$(shell python versions.py get-remote-branch $(1))) + +#$(eval $(2)_VERSION:=$$$$(shell cd $($(2)_PATH) 2>/dev/null && git rev-parse HEAD )) + +#$(eval NEEDED_$(2)_BRANCH:=$(word 2, $(subst /, ,$($(2)_BRANCH_AND_REMOTE)))) +#$(eval NEEDED_$(2)_REMOTE:=$(word 1, $(subst /, ,$($(2)_BRANCH_AND_REMOTE)))) +#$(eval $(2)_BRANCH:=$$$$(shell cd $($(2)_PATH) 2>/dev/null && git symbolic-ref --short HEAD 2>/dev/null)) + +validate-$(1):: + @if test x$$(IGNORE_$(2)_VERSION) = "x"; then \ + if test ! -d $($(2)_PATH); then \ + if test x$$(RESET_VERSIONS) != "x"; then \ + $(MAKE) reset-$(1) || exit 1; \ + else \ + echo "Your $(1) checkout is missing, please run 'make reset-$(1)'"; \ + touch .validate-versions-failure; \ + fi; \ + else \ + if test "x$($(2)_VERSION)" != "x$(NEEDED_$(2)_VERSION)" ; then \ + if test x$$(RESET_VERSIONS) != "x"; then \ + $(MAKE) reset-$(1) || exit 1; \ + else \ + echo "Your $(1) version is out of date, please run 'make reset-$(1)' (found $($(2)_VERSION), expected $(NEEDED_$(2)_VERSION))"; \ + test -z "$(BUILD_REVISION)" || $(MAKE) test-$(1); \ + touch .validate-versions-failure; \ + fi; \ + elif test "x$($(2)_BRANCH)" != "x$(NEEDED_$(2)_BRANCH)" ; then \ + if test x$$(RESET_VERSIONS) != "x"; then \ + test -z "$(BUILD_REVISION)" || $(MAKE) test-$(1); \ + $(MAKE) reset-$(1) || exit 1; \ + else \ + echo "Your $(1) branch is out of date, please run 'make reset-$(1)' (found $($(2)_BRANCH), expected $(NEEDED_$(2)_BRANCH))"; \ + touch .validate-versions-failure; \ + fi; \ + fi; \ + fi; \ + fi + +test-$(1):: + @echo $(1) + @echo " REPOSITORY_$(2)=$(REPOSITORY_$(2))" + @echo " DIRECTORY_$(2)=$(DIRECTORY_$(2))" + @echo " MODULE_$(2)=$(MODULE_$(2))" + @echo " NEEDED_$(2)_VERSION=$(NEEDED_$(2)_VERSION)" + @echo " $(2)_VERSION=$($(2)_VERSION)" + @echo " $(2)_BRANCH_AND_REMOTE=$($(2)_BRANCH_AND_REMOTE)" + @echo " NEEDED_$(2)_BRANCH=$(NEEDED_$(2)_BRANCH)" + @echo " NEEDED_$(2)_REMOTE=$(NEEDED_$(2)_REMOTE)" + @echo " $(2)_BRANCH=$($(2)_BRANCH)" + @echo " $(2)_PATH=$($(2)_PATH) => $(abspath $($(2)_PATH))" + +reset-$(1):: + @if test -d $($(2)_PATH); then \ + if ! (cd $($(2)_PATH) && git show $(NEEDED_$(2)_VERSION) >/dev/null 2>&1 && git log -1 $(NEEDED_$(2)_REMOTE) >/dev/null 2>&1) ; then \ + echo "*** git fetch `basename $$($(2)_PATH)`" && (cd $($(2)_PATH) && git fetch); \ + fi; \ + else \ + echo "*** git clone $(MODULE_$(2)) --recursive $(DIRECTORY_$(2))" && (cd `dirname $($(2)_PATH)` && git clone $(MODULE_$(2)) --recursive $(DIRECTORY_$(2)) || exit 1 ); \ + fi + @if test x$$(IGNORE_$(2)_VERSION) = "x"; then \ + echo "*** [$(1)] git checkout -f" $(NEEDED_$(2)_BRANCH) && (cd $($(2)_PATH) ; git checkout -f $(NEEDED_$(2)_BRANCH) || git checkout -f -b $($(2)_BRANCH_AND_REMOTE)); \ + echo "*** [$(1)] git reset --hard $(NEEDED_$(2)_VERSION)" && (cd $($(2)_PATH) && git reset --hard $(NEEDED_$(2)_VERSION)); \ + fi + @echo "*** [$(1)] git submodule update --init --recursive" && (cd $($(2)_PATH) && git submodule update --init --recursive) + +print-$(1):: + @printf "*** %-16s %-45s %s (%s)\n" "$(DIRECTORY_$(2))" "$(MODULE_$(2))" "$(NEEDED_$(2)_VERSION)" "$(NEEDED_$(2)_BRANCH)" + +.PHONY: validate-$(1) reset-$(1) print-$(1) + +reset-versions:: reset-$(1) +validate-versions:: Validate-$(1) +print-versions:: print-$(1) + +endef + +$(eval $(call ValidateVersionTemplate,roslyn,ROSLYN)) +$(eval $(call ValidateVersionTemplate,coreclr,CORECLR)) +$(eval $(call ValidateVersionTemplate,ms-test-suite,MSTESTSUITE)) + +reset-versions:: + +validate-versions:: + @if test -e .validate-versions-failure; then \ + rm .validate-versions-failure; \ + echo One or more modules needs update; \ + exit 1; \ + else \ + echo All dependent modules up to date; \ + fi + +reset: + @$(MAKE) validate-versions RESET_VERSIONS=1 + +__bump-version-%: + @if [ "$(REV)" = "" ]; then echo "Usage: make bump-version-$* REV="; exit 1; fi + python versions.py set-rev $* $(REV) + @if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to pick up $(REV)." | git commit -F - $(CONFIG); fi + +__bump-branch-%: + @if [ "$(BRANCH)" = "" ]; then echo "Usage: make bump-branch-$* BRANCH= REMOTE_BRANCH="; exit 1; fi + @if [ "$(REMOTE_BRANCH)" == "" ]; then echo "Usage: make bump-branch-$* BRANCH= REMOTE_BRANCH="; exit 1; fi + python versions.py set-branch $* $(BRANCH) + python versions.py set-remote-branch $* $(REMOTE_BRANCH) + @if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to switch to $(BRANCH) $(REMOTE BRANCH)." | git commit -F - $(CONFIG); fi + +__bump-current-version-%: + REV=$(shell cd $(TOP)/../$* && git log -1 --pretty=format:%H); \ + python versions.py set-rev $* $$REV; \ + if [ "$(COMMIT)" = "1" ]; then echo "[acceptance-tests] Bump $* to pick up $$REV:" | git commit -F - $(CONFIG); fi + +# Bump the given submodule to the revision given by the REV make variable +# If COMMIT is 1, commit the change +bump-roslyn: __bump-version-roslyn +bump-coreclr: __bump-version-coreclr +bump-ms-test-suite: __bump-version-ms-test-suite + +# Bump the given submodule to the branch given by the BRANCH/REMOTE_BRANCH make variables +# If COMMIT is 1, commit the change +bump-branch-roslyn: __bump-branch-roslyn +bump-branch-coreclr: __bump-branch-coreclr +bump-branch-ms-test-suite: __bump-branch-ms-test-suite + +# Bump the given submodule to its current GIT version +# If COMMIT is 1, commit the change +bump-current-roslyn: __bump-current-version-roslyn +bump-current-coreclr: __bump-current-version-coreclr +bump-current-ms-test-suite: __bump-current-version-ms-test-suite + +commit-bump-roslyn: + $(MAKE) bump-roslyn COMMIT=1 + +commit-bump-coreclr: + $(MAKE) bump-coreclr COMMIT=1 + +commit-bump-ms-test-suite: + $(MAKE) bump-ms-test-suite COMMIT=1 + +commit-bump-current-roslyn: + $(MAKE) bump-current-roslyn COMMIT=1 + +commit-bump-current-coreclr: + $(MAKE) bump-current-coreclr COMMIT=1 + +commit-bump-current-ms-test-suite: + $(MAKE) bump-current-ms-test-suite COMMIT=1 diff --git a/acceptance-tests/versions.py b/acceptance-tests/versions.py new file mode 100755 index 0000000000..5fff4f18f3 --- /dev/null +++ b/acceptance-tests/versions.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python + +import sys +import json + +def find_module(submodules, name): + for item in submodules: + if item["name"] == name: + return item + + print "Not found" + sys.exit(1) + + +if len(sys.argv) < 2: + print "Usage: versions.py " + sys.exit(1) + +CONFIG_FILE = "SUBMODULES.json" +command = sys.argv[1] + +submodules = json.load(open(CONFIG_FILE)) + +if command == "get-rev": + mod = find_module(submodules, sys.argv[2]) + print mod["rev"] +elif command == "get-url": + mod = find_module(submodules, sys.argv[2]) + print mod["url"] +elif command == "get-dir": + mod = find_module(submodules, sys.argv[2]) + print mod["directory"] +elif command == "get-remote-branch": + mod = find_module(submodules, sys.argv[2]) + print mod["remote-branch"] +elif command == "set-rev": + mod = find_module(submodules, sys.argv[2]) + mod["rev"] = sys.argv[3] + json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2) +elif command == "set-branch": + mod = find_module(submodules, sys.argv[2]) + mod["branch"] = sys.argv[3] + json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2) +elif command == "set-remote-branch": + mod = find_module(submodules, sys.argv[2]) + mod["remote-branch"] = sys.argv[3] + json.dump(submodules, open(CONFIG_FILE, "w"), indent = 2) +elif command == "cat": + print json.dumps(submodules, indent = 2) +else: + print "Unknown command "" + command + ""." + sys.exit(1) diff --git a/code_of_conduct.md b/code_of_conduct.md new file mode 100644 index 0000000000..84bad191c3 --- /dev/null +++ b/code_of_conduct.md @@ -0,0 +1,50 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of +fostering an open and welcoming community, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating +documentation, submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free +experience for everyone, regardless of level of experience, gender, gender +identity and expression, sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, such as physical or electronic + addresses, without explicit permission +* Other unethical or unprofessional conduct + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +By adopting this Code of Conduct, project maintainers commit themselves to +fairly and consistently applying these principles to every aspect of managing +this project. Project maintainers who do not follow or enforce the Code of +Conduct may be permanently removed from the project team. + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting a project maintainer at miguel@xamarin.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. Maintainers are +obligated to maintain confidentiality with regard to the reporter of an +incident. + + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.3.0, available at +[http://contributor-covenant.org/version/1/3/0/][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/3/0/ diff --git a/config.h.in b/config.h.in index d5a7d684d1..4706dedd1a 100644 --- a/config.h.in +++ b/config.h.in @@ -1,7 +1,7 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* The architecture this is running on */ -#undef ARCHITECTURE +/* Enable checked build. */ +#undef CHECKED_BUILD /* GC description */ #undef DEFAULT_GC_NAME @@ -10,7 +10,7 @@ #undef DISABLED_FEATURES /* Disable AOT Compiler */ -#undef DISABLE_AOT_COMPILER +#undef DISABLE_AOT /* Disable support for multiple appdomains. */ #undef DISABLE_APPDOMAINS @@ -94,9 +94,6 @@ /* Disable Shadow Copy for AppDomains */ #undef DISABLE_SHADOW_COPY -/* Disable inter-process shared handles */ -#undef DISABLE_SHARED_HANDLES - /* Disable shared perfcounters. */ #undef DISABLE_SHARED_PERFCOUNTERS @@ -133,6 +130,9 @@ /* Enable the LLVM back end */ #undef ENABLE_LLVM +/* Runtime support code for llvm enabled */ +#undef ENABLE_LLVM_RUNTIME + /* Enable using `perf` for profiling on Linux */ #undef ENABLE_PERF_EVENTS @@ -260,6 +260,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_EXECINFO_H +/* Define to 1 if you have the `execv' function. */ +#undef HAVE_EXECV + +/* Define to 1 if you have the `execve' function. */ +#undef HAVE_EXECVE + /* Define to 1 if you have the `execvp' function. */ #undef HAVE_EXECVP @@ -272,6 +278,9 @@ /* Define to 1 if you have the `finite' function. */ #undef HAVE_FINITE +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK + /* Define to 1 if you have the header file. */ #undef HAVE_FSTAB_H @@ -332,9 +341,6 @@ /* Define to 1 if you have the `getpriority' function. */ #undef HAVE_GETPRIORITY -/* Define if GetProcessId is available */ -#undef HAVE_GETPROCESSID - /* Have getprotobyname */ #undef HAVE_GETPROTOBYNAME @@ -413,6 +419,9 @@ /* isinf available */ #undef HAVE_ISINF +/* Define to 1 if you have the `kill' function. */ +#undef HAVE_KILL + /* Define to 1 if you have the `kqueue' function. */ #undef HAVE_KQUEUE @@ -470,6 +479,9 @@ /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP +/* Moving collector */ +#undef HAVE_MOVING_COLLECTOR + /* Define to 1 if you have the `mremap' function. */ #undef HAVE_MREMAP @@ -575,12 +587,6 @@ /* Define to 1 if you have the `remap_file_pages' function. */ #undef HAVE_REMAP_FILE_PAGES -/* Define to 1 if you have the `rint' function. */ -#undef HAVE_RINT - -/* Define to 1 if you have the `round' function. */ -#undef HAVE_ROUND - /* Define to 1 if you have the `sched_getcpu' function. */ #undef HAVE_SCHED_GETCPU @@ -632,6 +638,9 @@ /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION +/* Define to 1 if you have the `signal' function. */ +#undef HAVE_SIGNAL + /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H @@ -707,6 +716,9 @@ /* Define to 1 if `kp_proc' is a member of `struct kinfo_proc'. */ #undef HAVE_STRUCT_KINFO_PROC_KP_PROC +/* Define to 1 if the system has the type `struct linger'. */ +#undef HAVE_STRUCT_LINGER + /* Define to 1 if `pw_gecos' is a member of `struct passwd'. */ #undef HAVE_STRUCT_PASSWD_PW_GECOS @@ -806,9 +818,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SEM_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SENDFILE_H @@ -896,6 +905,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_UNWIND_H + /* Define to 1 if you have /usr/include/malloc.h. */ #undef HAVE_USR_INCLUDE_MALLOC_H @@ -945,6 +957,9 @@ */ #undef LT_OBJDIR +/* The architecture this is running on */ +#undef MONO_ARCHITECTURE + /* Enable the allocation and indexing of arrays greater than Int32.MaxValue */ #undef MONO_BIG_ARRAYS @@ -957,6 +972,9 @@ /* native types */ #undef MONO_NATIVE_TYPES +/* AOT cross offsets file */ +#undef MONO_OFFSETS_FILE + /* Reduce runtime requirements (and capabilities) */ #undef MONO_SMALL_CONFIG @@ -1071,6 +1089,9 @@ /* ... */ #undef TARGET_SPARC64 +/* The JIT/AOT targets WatchOS */ +#undef TARGET_WATCHOS + /* Target Platform is Win32 */ #undef TARGET_WIN32 diff --git a/configure.REMOVED.git-id b/configure.REMOVED.git-id index d7ae48f794..816b42a40b 100644 --- a/configure.REMOVED.git-id +++ b/configure.REMOVED.git-id @@ -1 +1 @@ -08afe9df2791baac02e8201b01cce1aca3beb124 \ No newline at end of file +79ba3854a41b122e90badfb88a8aba24b6abc54c \ No newline at end of file diff --git a/configure.ac.REMOVED.git-id b/configure.ac.REMOVED.git-id index 509df77bc6..19a455bed7 100644 --- a/configure.ac.REMOVED.git-id +++ b/configure.ac.REMOVED.git-id @@ -1 +1 @@ -4fa615ca8fe030cfede44041b86cf5bfc38aceaf \ No newline at end of file +568cb227ed520bd10d312bf4a66ccba0f772b016 \ No newline at end of file diff --git a/data/Makefile.am b/data/Makefile.am index 2cfd5202b6..b5b83fa69f 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -14,7 +14,8 @@ EXTRA_DIST = \ net_1_1/machine.config \ gdb/mono-gdb.py \ gdb/gdb-python.diff \ - lldb/mono.py + lldb/mono.py \ + lldb/monobt.py pkgconfigdir = $(libdir)/pkgconfig diff --git a/data/Makefile.in b/data/Makefile.in index a2916d81b5..53b44a0070 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -237,8 +237,6 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOEHM_DEFINES = @BOEHM_DEFINES@ BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_GLIB_CFLAGS = @BUILD_GLIB_CFLAGS@ -BUILD_GLIB_LIBS = @BUILD_GLIB_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ @@ -254,9 +252,9 @@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DEFAULT_PROFILE = @DEFAULT_PROFILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DISABLE_SHARED_HANDLES = @DISABLE_SHARED_HANDLES@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ DSYMUTIL = @DSYMUTIL@ @@ -274,8 +272,6 @@ GDKX11 = @GDKX11@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ @@ -447,7 +443,8 @@ EXTRA_DIST = \ net_1_1/machine.config \ gdb/mono-gdb.py \ gdb/gdb-python.diff \ - lldb/mono.py + lldb/mono.py \ + lldb/monobt.py pkgconfigdir = $(libdir)/pkgconfig @SUPPORT_SGEN_FALSE@SGENPCFILE = diff --git a/data/config.in b/data/config.in index b7601766e9..b4b7243ecf 100644 --- a/data/config.in +++ b/data/config.in @@ -10,7 +10,7 @@ - + diff --git a/data/gdb/mono-gdb.py b/data/gdb/mono-gdb.py index f4dcfe72c0..7d9eab5cb7 100644 --- a/data/gdb/mono-gdb.py +++ b/data/gdb/mono-gdb.py @@ -48,7 +48,7 @@ def stringify_class_name(ns, name): if ns == "": return name else: - return "%s.%s".format (ns, name) + return "{}.{}".format (ns, name) class ArrayPrinter: "Print a C# array" @@ -61,7 +61,7 @@ class ArrayPrinter: def to_string(self): obj = self.val.cast (gdb.lookup_type ("MonoArray").pointer ()).dereference () length = obj ['max_length'] - return "%s [%d]".format (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length)) + return "{} [{}]".format (stringify_class_name (self.class_ns, self.class_name [0:len(self.class_name) - 2]), int(length)) class ObjectPrinter: "Print a C# object" @@ -91,7 +91,7 @@ class ObjectPrinter: return (field.name, self.obj [field.name]) except: # Superclass - return (field.name, self.obj.cast (gdb.lookup_type ("%s".format (field.name)))) + return (field.name, self.obj.cast (gdb.lookup_type ("{}".format (field.name)))) def children(self): # FIXME: It would be easier if gdb.Value would support iteration itself @@ -105,7 +105,7 @@ class ObjectPrinter: if class_name [-2:len(class_name)] == "[]": return {}.__iter__ () try: - gdb_type = gdb.lookup_type ("struct %s_%s".format (class_ns.replace (".", "_"), class_name)) + gdb_type = gdb.lookup_type ("struct {}_{}".format (class_ns.replace (".", "_"), class_name)) return self._iterator(obj.cast (gdb_type)) except: return {}.__iter__ () @@ -127,12 +127,12 @@ class ObjectPrinter: return ArrayPrinter (self.val,class_ns,class_name).to_string () if class_ns != "": try: - gdb_type = gdb.lookup_type ("struct %s.%s".format (class_ns, class_name)) + gdb_type = gdb.lookup_type ("struct {}.{}".format (class_ns, class_name)) except: # Maybe there is no debug info for that type - return "%s.%s".format (class_ns, class_name) + return "{}.{}".format (class_ns, class_name) #return obj.cast (gdb_type) - return "%s.%s".format (class_ns, class_name) + return "{}.{}".format (class_ns, class_name) return class_name except: print (sys.exc_info ()[0]) @@ -152,9 +152,9 @@ class MonoMethodPrinter: val = self.val.dereference () klass = val ["klass"].dereference () class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ()) - return "\"%s:%s ()\"".format (class_name, val ["name"].string ()) + return "\"{}:{} ()\"".format (class_name, val ["name"].string ()) # This returns more info but requires calling into the inferior - #return "\"%s\"".format (gdb.parse_and_eval ("mono_method_full_name (%s, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ()) + #return "\"{}\"".format (gdb.parse_and_eval ("mono_method_full_name ({}, 1)".format (str (int (self.val.cast (gdb.lookup_type ("guint64")))))).string ()) class MonoClassPrinter: "Print a MonoClass structure" @@ -168,13 +168,13 @@ class MonoClassPrinter: klass = self.val.dereference () class_name = stringify_class_name (klass ["name_space"].string (), klass ["name"].string ()) if klass ["generic_class"].cast (gdb.lookup_type ("guint64")) != 0: - class_name = "%s<%s>".format (class_name, str (klass ["generic_class"]["context"]["class_inst"])) + class_name = "{}<{}>".format (class_name, str (klass ["generic_class"]["context"]["class_inst"])) if add_quotes: - return "\"%s\"".format (class_name) + return "\"{}\"".format (class_name) else: return class_name # This returns more info but requires calling into the inferior - #return "\"%s\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*)%s)->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64"))))))) + #return "\"{}\"".format (gdb.parse_and_eval ("mono_type_full_name (&((MonoClass*){})->byval_arg)".format (str (int ((self.val).cast (gdb.lookup_type ("guint64"))))))) def to_string(self): try: @@ -222,7 +222,7 @@ class MonoGenericClassPrinter: method_inst_str = "" if int(method_inst.cast (gdb.lookup_type ("guint64"))) != 0: method_inst_str = str(method_inst) - return "%s, [%s], [%s]>".format (container_str, class_inst_str, method_inst_str) + return "{}, [{}], [{}]>".format (container_str, class_inst_str, method_inst_str) def to_string(self): try: @@ -252,9 +252,9 @@ class MonoTypePrinter: info = str(t ["data"]["generic_class"]) if info != "": - return "{%s, %s}".format (kind, info) + return "{{}, {}}".format (kind, info) else: - return "{%s}".format (kind) + return "{{}}".format (kind) except: #print (sys.exc_info ()[0]) #print (sys.exc_info ()[1]) @@ -283,7 +283,7 @@ class MonoMethodRgctxPrinter: if i > 0: inst_str = inst_str + ", " inst_str = inst_str + type_printer.to_string () - return "MRGCTX[%s, [%s]]".format (klass_printer.to_string(), inst_str) + return "MRGCTX[{}, [{}]]".format (klass_printer.to_string(), inst_str) class MonoVTablePrinter: "Print a MonoVTable structure" @@ -298,7 +298,7 @@ class MonoVTablePrinter: klass = vtable ["klass"] klass_printer = MonoClassPrinter (klass) - return "vtable(%s)".format (klass_printer.to_string ()) + return "vtable({})".format (klass_printer.to_string ()) def lookup_pretty_printer(val): t = str (val.type) diff --git a/data/lldb/monobt.py b/data/lldb/monobt.py new file mode 100644 index 0000000000..0e4713816d --- /dev/null +++ b/data/lldb/monobt.py @@ -0,0 +1,56 @@ +import lldb + +def print_frames(thread, num_frames, current_thread): + # TODO: Make output header similar to bt. + print '%c thread #%i' % ('*' if current_thread else ' ', thread.idx) + + if current_thread: + selected_frame = thread.GetSelectedFrame() + + for frame in thread.frames[:+num_frames]: + pc = str(frame.addr) + fmt = ' %c %s' + var = frame + if pc[0] == '0': + try: + framestr = frame.EvaluateExpression('(char*)mono_pmip((void*)%s)' % pc).summary[1:-1] + var = 'frame #%i: %s%s' % (frame.idx, pc, framestr) + except: + pass + + print fmt % ('*' if current_thread and frame.idx == selected_frame.idx else ' ', var) + +def monobt(debugger, command, result, dict): + opts = {'all_bt': False, 'num_frames': None} + + if command == 'all': + opts['all_bt'] = True + elif command.isdigit(): + opts['num_frames'] = int(command) + elif command != '': + print 'error: monobt [|all]' + return + + target = debugger.GetSelectedTarget() + process = target.process + + if not process.IsValid(): + print 'error: invalid process' + return + + if opts['all_bt']: + for thread in process.threads: + print_frames(thread, len(thread), process.selected_thread == thread) + print '' + else: + thread = process.selected_thread + num_frames = len(thread) if opts['num_frames'] is None else opts['num_frames'] + print_frames(thread, num_frames, True) + + return None + +def __lldb_init_module (debugger, dict): + # This initializer is being run from LLDB in the embedded command interpreter + # Add any commands contained in this module to LLDB + debugger.HandleCommand('command script add -f monobt.monobt monobt') + print '"monobt" command installed' \ No newline at end of file diff --git a/data/mono-nunit.pc.in b/data/mono-nunit.pc.in index 5f4e116ab2..64268cd8d9 100644 --- a/data/mono-nunit.pc.in +++ b/data/mono-nunit.pc.in @@ -6,4 +6,4 @@ libdir=${exec_prefix}/lib Name: Mono NUnit Description: Mono's version of NUnit Version: @VERSION@ -Libs: -r:${libdir}/mono/2.0/nunit.core.dll -r:${libdir}/mono/2.0/nunit.core.interfaces.dll -r:${libdir}/mono/2.0/nunit.core.extensions.dll -r:${libdir}/mono/2.0/nunit.framework.dll -r:${libdir}/mono/2.0/nunit.framework.extensions.dll -r:${libdir}/mono/2.0/nunit.mocks.dll -r:${libdir}/mono/2.0/nunit.util.dll -r:${libdir}/mono/2.0/nunit-console-runner.dll +Libs: -r:${libdir}/mono/4.5/nunit.core.dll -r:${libdir}/mono/4.5/nunit.core.interfaces.dll -r:${libdir}/mono/4.5/nunit.core.extensions.dll -r:${libdir}/mono/4.5/nunit.framework.dll -r:${libdir}/mono/4.5/nunit.framework.extensions.dll -r:${libdir}/mono/4.5/nunit.mocks.dll -r:${libdir}/mono/4.5/nunit.util.dll -r:${libdir}/mono/4.5/nunit-console-runner.dll diff --git a/data/net_2_0/Browsers/Makefile.in b/data/net_2_0/Browsers/Makefile.in index ece1326d2a..d95d1f34d7 100644 --- a/data/net_2_0/Browsers/Makefile.in +++ b/data/net_2_0/Browsers/Makefile.in @@ -159,8 +159,6 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOEHM_DEFINES = @BOEHM_DEFINES@ BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_GLIB_CFLAGS = @BUILD_GLIB_CFLAGS@ -BUILD_GLIB_LIBS = @BUILD_GLIB_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ @@ -176,9 +174,9 @@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DEFAULT_PROFILE = @DEFAULT_PROFILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DISABLE_SHARED_HANDLES = @DISABLE_SHARED_HANDLES@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ DSYMUTIL = @DSYMUTIL@ @@ -196,8 +194,6 @@ GDKX11 = @GDKX11@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ diff --git a/data/net_2_0/Makefile.in b/data/net_2_0/Makefile.in index bb9eb9dd2c..5bb8800fe7 100644 --- a/data/net_2_0/Makefile.in +++ b/data/net_2_0/Makefile.in @@ -219,8 +219,6 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOEHM_DEFINES = @BOEHM_DEFINES@ BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_GLIB_CFLAGS = @BUILD_GLIB_CFLAGS@ -BUILD_GLIB_LIBS = @BUILD_GLIB_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ @@ -236,9 +234,9 @@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DEFAULT_PROFILE = @DEFAULT_PROFILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DISABLE_SHARED_HANDLES = @DISABLE_SHARED_HANDLES@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ DSYMUTIL = @DSYMUTIL@ @@ -256,8 +254,6 @@ GDKX11 = @GDKX11@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ diff --git a/data/net_4_0/Browsers/Makefile.in b/data/net_4_0/Browsers/Makefile.in index 13a918abd0..67e1966c20 100644 --- a/data/net_4_0/Browsers/Makefile.in +++ b/data/net_4_0/Browsers/Makefile.in @@ -159,8 +159,6 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOEHM_DEFINES = @BOEHM_DEFINES@ BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_GLIB_CFLAGS = @BUILD_GLIB_CFLAGS@ -BUILD_GLIB_LIBS = @BUILD_GLIB_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ @@ -176,9 +174,9 @@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DEFAULT_PROFILE = @DEFAULT_PROFILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DISABLE_SHARED_HANDLES = @DISABLE_SHARED_HANDLES@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ DSYMUTIL = @DSYMUTIL@ @@ -196,8 +194,6 @@ GDKX11 = @GDKX11@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ diff --git a/data/net_4_0/Makefile.in b/data/net_4_0/Makefile.in index d112f186e0..06861e9b2a 100644 --- a/data/net_4_0/Makefile.in +++ b/data/net_4_0/Makefile.in @@ -219,8 +219,6 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOEHM_DEFINES = @BOEHM_DEFINES@ BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_GLIB_CFLAGS = @BUILD_GLIB_CFLAGS@ -BUILD_GLIB_LIBS = @BUILD_GLIB_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ @@ -236,9 +234,9 @@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DEFAULT_PROFILE = @DEFAULT_PROFILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DISABLE_SHARED_HANDLES = @DISABLE_SHARED_HANDLES@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ DSYMUTIL = @DSYMUTIL@ @@ -256,8 +254,6 @@ GDKX11 = @GDKX11@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ diff --git a/data/net_4_5/Browsers/Makefile.in b/data/net_4_5/Browsers/Makefile.in index 41a9ff0a99..78f56bf16c 100644 --- a/data/net_4_5/Browsers/Makefile.in +++ b/data/net_4_5/Browsers/Makefile.in @@ -159,8 +159,6 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOEHM_DEFINES = @BOEHM_DEFINES@ BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_GLIB_CFLAGS = @BUILD_GLIB_CFLAGS@ -BUILD_GLIB_LIBS = @BUILD_GLIB_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ @@ -176,9 +174,9 @@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DEFAULT_PROFILE = @DEFAULT_PROFILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DISABLE_SHARED_HANDLES = @DISABLE_SHARED_HANDLES@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ DSYMUTIL = @DSYMUTIL@ @@ -196,8 +194,6 @@ GDKX11 = @GDKX11@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ diff --git a/data/net_4_5/Makefile.in b/data/net_4_5/Makefile.in index 9d310ae0e0..979db7c049 100644 --- a/data/net_4_5/Makefile.in +++ b/data/net_4_5/Makefile.in @@ -219,8 +219,6 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOEHM_DEFINES = @BOEHM_DEFINES@ BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_GLIB_CFLAGS = @BUILD_GLIB_CFLAGS@ -BUILD_GLIB_LIBS = @BUILD_GLIB_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ @@ -236,9 +234,9 @@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DEFAULT_PROFILE = @DEFAULT_PROFILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DISABLE_SHARED_HANDLES = @DISABLE_SHARED_HANDLES@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ DSYMUTIL = @DSYMUTIL@ @@ -256,8 +254,6 @@ GDKX11 = @GDKX11@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ diff --git a/docs/Makefile.am b/docs/Makefile.am index 9c51442040..bb90f1f200 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -54,6 +54,10 @@ EXTRA_DIST = \ TODO \ unmanaged-calls +-include $(mcs_topdir)/build/config.make + +CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE) + dist-hook: $(mkdir_p) $(distdir)/sources $(mkdir_p) $(distdir)/svgs @@ -89,14 +93,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_4_5 perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c + MONO_PATH=$(CLASS) perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c touch $@ extract: deploy/.stamp convert.exe: convert.cs AgilityPack.dll - $(TOOL_MAKE) PROFILE=net_4_5 convert.exe + $(TOOL_MAKE) convert.exe AgilityPack.dll: - $(TOOL_MAKE) PROFILE=net_4_5 AgilityPack.dll + $(TOOL_MAKE) AgilityPack.dll diff --git a/docs/Makefile.in b/docs/Makefile.in index c25550175b..b4d74d28e7 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -159,8 +159,6 @@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOEHM_DEFINES = @BOEHM_DEFINES@ BUILD_EXEEXT = @BUILD_EXEEXT@ -BUILD_GLIB_CFLAGS = @BUILD_GLIB_CFLAGS@ -BUILD_GLIB_LIBS = @BUILD_GLIB_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ @@ -176,9 +174,9 @@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ +DEFAULT_PROFILE = @DEFAULT_PROFILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DISABLE_SHARED_HANDLES = @DISABLE_SHARED_HANDLES@ DLLTOOL = @DLLTOOL@ DOLT_BASH = @DOLT_BASH@ DSYMUTIL = @DSYMUTIL@ @@ -196,8 +194,6 @@ GDKX11 = @GDKX11@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ -GMODULE_CFLAGS = @GMODULE_CFLAGS@ -GMODULE_LIBS = @GMODULE_LIBS@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ @@ -410,6 +406,7 @@ EXTRA_DIST = \ TODO \ unmanaged-calls +CLASS = $(mcs_topdir)/class/lib/$(DEFAULT_PROFILE) TOOL_MAKE = $(MAKE) -f $(srcdir)/docs.make topdir=$(srcdir)/../mcs srcdir=$(srcdir) all: all-am @@ -630,6 +627,8 @@ uninstall-am: uninstall-sourcesDATA uninstall-am uninstall-sourcesDATA +-include $(mcs_topdir)/build/config.make + dist-hook: $(mkdir_p) $(distdir)/sources $(mkdir_p) $(distdir)/svgs @@ -663,16 +662,16 @@ 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_4_5 perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c + MONO_PATH=$(CLASS) perl $(srcdir)/exdoc -h $(srcdir) -t . $(srcdir)/../mono/*/*.c touch $@ extract: deploy/.stamp convert.exe: convert.cs AgilityPack.dll - $(TOOL_MAKE) PROFILE=net_4_5 convert.exe + $(TOOL_MAKE) convert.exe AgilityPack.dll: - $(TOOL_MAKE) PROFILE=net_4_5 AgilityPack.dll + $(TOOL_MAKE) AgilityPack.dll # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/docs/deploy/mono-api-class.html b/docs/deploy/mono-api-class.html index 8ae3defebf..c1cf37092d 100644 --- a/docs/deploy/mono-api-class.html +++ b/docs/deploy/mono-api-class.html @@ -105,8 +105,13 @@ mono_class_enum_basetype (MonoClass *klass)
mono_class_from_generic_parameter
-
Prototype: mono_class_from_generic_parameter
+
MonoClass* +mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *arg2 G_GNUC_UNUSED, gboolean arg3 G_GNUC_UNUSED) + +

+Parameters +

param:
Parameter to find/construct a class for.
arg2:
Is ignored.
arg3:
Is ignored.
@@ -245,7 +250,7 @@ mono_class_get_field_from_name (MonoClass *klass, const char *name)
mono_class_get_field
MonoClassField* -mono_class_get_field (MonoClass *class, guint32 field_token) +mono_class_get_field (MonoClass *klass, guint32 field_token)

@@ -579,7 +584,7 @@ mono_class_get_type (MonoClass *klass)

mono_class_init
gboolean -mono_class_init (MonoClass *class) +mono_class_init (MonoClass *klass)

@@ -788,7 +793,7 @@ mono_class_value_size (MonoClass *klass, guint32 *align)

mono_class_vtable
MonoVTable* -mono_class_vtable (MonoDomain *domain, MonoClass *class) +mono_class_vtable (MonoDomain *domain, MonoClass *klass)

diff --git a/docs/deploy/mono-api-domains.html b/docs/deploy/mono-api-domains.html index 3966740020..5c8738e31a 100644 --- a/docs/deploy/mono-api-domains.html +++ b/docs/deploy/mono-api-domains.html @@ -72,8 +72,8 @@ gboolean mono_domain_finalize guint32 timeout) ; - -MonoDomain* mono_domain_get_by_id (gint32 domainid) ; +MonoDomain* mono_domain_get_by_id (gint32 domainid) ; + MonoDomain* mono_domain_get (); gboolean mono_domain_has_type_resolve (MonoDomain *domain); @@ -165,13 +165,6 @@ mono_domain_finalize (MonoDomain *domain, guint32 timeout)

mono_domain_get_by_id
-
Prototype: mono_domain_get_by_id
-

- -

-
-
mono_domain_get_id
-
MonoDomain* mono_domain_get_by_id (gint32 domainid) @@ -180,9 +173,16 @@ mono_domain_get_by_id (gint32 domainid) Parameters
domainid:
the ID
Returns -
the a domain for a specific domain id. +
the domain for a specific domain id.
+
+
+
mono_domain_get_id
+ +
Prototype: mono_domain_get_id
+

+

mono_domain_get
diff --git a/docs/deploy/mono-api-gchandle.html b/docs/deploy/mono-api-gchandle.html index 84b9fc22dd..e7527462fc 100644 --- a/docs/deploy/mono-api-gchandle.html +++ b/docs/deploy/mono-api-gchandle.html @@ -55,12 +55,12 @@

Synopsys

-guint32 mono_gchandle_new (MonoObject *obj, - gboolean pinned); -guint32 mono_gchandle_new_weakref (MonoObject *obj, - gboolean track_resurrection); -MonoObject* mono_gchandle_get_target (guint32 gchandle); -void mono_gchandle_free (guint32 gchandle); +guint32 mono_gchandle_new (GCObject *obj, + gboolean pinned); +guint32 mono_gchandle_new_weakref (GCObject *obj, + gboolean track_resurrection); +GCObject* mono_gchandle_get_target (guint32 gchandle); +void mono_gchandle_free (guint32 gchandle);
@@ -149,7 +149,7 @@ static MonoObject* o = NULL;
mono_gchandle_new
guint32 -mono_gchandle_new (MonoObject *obj, gboolean pinned) +mono_gchandle_new (GCObject *obj, gboolean pinned)

@@ -178,7 +178,7 @@ mono_gchandle_new (MonoObject *obj, gboolean pinned)

mono_gchandle_new_weakref
guint32 -mono_gchandle_new_weakref (MonoObject *obj, gboolean track_resurrection) +mono_gchandle_new_weakref (GCObject *obj, gboolean track_resurrection)

@@ -208,7 +208,7 @@ mono_gchandle_new_weakref (MonoObject *obj, gboolean track_resurrection)

mono_gchandle_get_target
-
MonoObject* +
GCObject* mono_gchandle_get_target (guint32 gchandle)
diff --git a/docs/deploy/mono-api-image.html b/docs/deploy/mono-api-image.html index cbb8f2dfa9..e3c854a18d 100644 --- a/docs/deploy/mono-api-image.html +++ b/docs/deploy/mono-api-image.html @@ -350,13 +350,13 @@ mono_image_loaded (const char *name)

Parameters -

name:
name of the image to load
+
name:
path or assembly name of the image to load
Returns
the loaded MonoImage, or NULL on failure.
Remarks

- This routine ensures that the given image is loaded. + This routine verifies that the given image is loaded. Reflection-only loads do not count.

diff --git a/docs/deploy/mono-api-metadata.html b/docs/deploy/mono-api-metadata.html index 39d59d5d88..b6b243b3b1 100644 --- a/docs/deploy/mono-api-metadata.html +++ b/docs/deploy/mono-api-metadata.html @@ -1198,7 +1198,7 @@ mono_metadata_parse_param (MonoImage *m, const char *ptr, const char **rptr)
mono_metadata_parse_type
static MonoType* -mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container, MonoParseTypeMode mode, +mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container, short opt_attrs, gboolean transient, const char *ptr, const char **rptr)
diff --git a/docs/deploy/mono-api-object.html b/docs/deploy/mono-api-object.html index 42dd693fb8..2eb33909b5 100644 --- a/docs/deploy/mono-api-object.html +++ b/docs/deploy/mono-api-object.html @@ -110,7 +110,7 @@ MonoObject* mono_object_castclass_mb MonoClass *klass); guint mono_object_get_size (MonoObject* o); MonoObject* mono_value_box (MonoDomain *domain, - MonoClass *class, + MonoClass *klass, gpointer value); @@ -177,18 +177,18 @@ const char* mono_event_get_name MonoClass* mono_event_get_parent (MonoEvent *event); MonoMethod* mono_event_get_raise_method (MonoEvent *event); MonoMethod* mono_event_get_remove_method (MonoEvent *event); -gpointer mono_load_remote_field (MonoObject *this, +gpointer mono_load_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer *res); -MonoObject* mono_load_remote_field_new (MonoObject *this, +MonoObject* mono_load_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field); -void mono_store_remote_field (MonoObject *this, +void mono_store_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer val); -void mono_store_remote_field_new (MonoObject *this, +void mono_store_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, MonoObject *arg); @@ -449,7 +449,7 @@ mono_object_get_size (MonoObject* o)
mono_value_box
MonoObject* -mono_value_box (MonoDomain *domain, MonoClass *class, gpointer value) +mono_value_box (MonoDomain *domain, MonoClass *klass, gpointer value)

@@ -1072,7 +1072,7 @@ mono_event_get_remove_method (MonoEvent *event)

mono_load_remote_field
gpointer -mono_load_remote_field (MonoObject *this, MonoClass *klass, MonoClassField *field, gpointer *res) +mono_load_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer *res)

@@ -1094,7 +1094,7 @@ mono_load_remote_field (MonoObject *this, MonoClass *klass, MonoClassField *fiel

mono_load_remote_field_new
MonoObject* -mono_load_remote_field_new (MonoObject *this, MonoClass *klass, MonoClassField *field) +mono_load_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field)

@@ -1109,16 +1109,16 @@ mono_load_remote_field_new (MonoObject *this, MonoClass *klass, MonoClassField *

mono_store_remote_field
void -mono_store_remote_field (MonoObject *this, MonoClass *klass, MonoClassField *field, gpointer val) +mono_store_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer val)

Parameters -

this:
pointer to an object
klass:
klass of the object containing field
field:
the field to load
val:
the value/object to store
+
this_obj:
pointer to an object
klass:
klass of the object containing field
field:
the field to load
val:
the value/object to store
Remarks

This method is called by the runtime on attempts to store fields of - transparent proxy objects. this points to such TP, klass is the class of + transparent proxy objects. this_obj points to such TP, klass is the class of the object containing field. val is the new value to store in field.

diff --git a/docs/deploy/mono-api-utils.html b/docs/deploy/mono-api-utils.html index c0f236e038..c2a7dcddeb 100644 --- a/docs/deploy/mono-api-utils.html +++ b/docs/deploy/mono-api-utils.html @@ -483,7 +483,7 @@ mono_mempool_alloc (MonoMemPool *pool, guint size)

Parameters -

pool:
the momory pool to use
size:
size of the momory block
+
pool:
the memory pool to use
size:
size of the memory block
Returns
the address of a newly allocated memory block.
@@ -540,7 +540,10 @@ mono_mempool_stats (MonoMemPool *pool)
pool:
the momory pool we need stats for
Remarks

- Print a few stats about the mempool + Print a few stats about the mempool: + - Total memory allocated (malloced) by mem pool + - Number of chunks/blocks memory is allocated in + - How much memory is available to dispense before a new malloc must occur?

diff --git a/docs/deploy/mono-api-wapi.html b/docs/deploy/mono-api-wapi.html index 778f9f9731..3053e26557 100644 --- a/docs/deploy/mono-api-wapi.html +++ b/docs/deploy/mono-api-wapi.html @@ -170,7 +170,7 @@
gpointer CreateFile(const gunichar2 *name, guint32 fileaccess, guint32 sharemode, WapiSecurityAttributes *security, guint32 createmode, guint32 attrs, - gpointer template G_GNUC_UNUSED) + gpointer template_ G_GNUC_UNUSED)

@@ -461,20 +461,8 @@

GetCurrentThreadId
-
gsize -GetCurrentThreadId (void) - -
+
Prototype: GetCurrentThreadId

-Remarks -

- Looks up the thread ID of the current thread. This ID can be - passed to OpenThread() to create a new handle on this thread. - - Return value: the thread ID. NB this is defined as DWORD (ie 32 - bit) in the MS API, but we need to cope with 64 bit IDs for s390x - and amd64. This doesn't really break the API, it just embraces and - extends it on 64bit platforms :)

@@ -1245,18 +1233,8 @@ gpointer GetStdHandle(WapiStdHandle stdhandle)
SleepEx
-
guint32 -SleepEx (guint32 ms, gboolean alertable) - -
+
Prototype: SleepEx

-Parameters -

ms:
The time in milliseconds to suspend for
alertable:
if TRUE, the wait can be interrupted by an APC call
-Remarks -

- Suspends execution of the current thread for ms milliseconds. A - value of zero causes the thread to relinquish its time slice. A - value of %INFINITE causes an infinite delay.

@@ -1574,14 +1552,8 @@ SleepEx (guint32 ms, gboolean alertable)
wapi_thread_clear_wait_handle
-
void -wapi_thread_clear_wait_handle (gpointer handle) - -
+
Prototype: wapi_thread_clear_wait_handle

-Remarks -

- Clear the wait handle of the current thread.

diff --git a/docs/public-api b/docs/public-api index c9d90eb25b..31e42c6fe7 100644 --- a/docs/public-api +++ b/docs/public-api @@ -750,6 +750,8 @@ mono_thread_current mono_thread_detach mono_thread_exit mono_thread_get_main +mono_thread_get_managed_id +mono_thread_get_name_utf8 mono_thread_get_undeniable_exception mono_thread_hazardous_free_or_queue mono_thread_hazardous_try_free_all diff --git a/eglib/config.h.in b/eglib/config.h.in index bfaf5ef218..6e94a5e16a 100644 --- a/eglib/config.h.in +++ b/eglib/config.h.in @@ -6,6 +6,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the `execv' function. */ +#undef HAVE_EXECV + +/* Define to 1 if you have the `execve' function. */ +#undef HAVE_EXECVE + +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK + /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H @@ -27,6 +36,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H +/* Define to 1 if you have the `iconv' library (-liconv). */ +#undef HAVE_LIBICONV + /* Define to 1 if you have the header file. */ #undef HAVE_LOCALCHARSET_H diff --git a/eglib/configure.REMOVED.git-id b/eglib/configure.REMOVED.git-id index 5a09124279..c2c18cbd60 100644 --- a/eglib/configure.REMOVED.git-id +++ b/eglib/configure.REMOVED.git-id @@ -1 +1 @@ -aed8bc038cc124da52dba4e1ed93a11f9fca3f47 \ No newline at end of file +10621617ddcde3326cdc7989cbfaee18ae75d381 \ No newline at end of file diff --git a/eglib/configure.ac b/eglib/configure.ac index 5281419c00..2197c6f9c9 100644 --- a/eglib/configure.ac +++ b/eglib/configure.ac @@ -136,6 +136,7 @@ AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf) AC_CHECK_FUNCS(getrlimit) +AC_CHECK_FUNCS(fork execv execve) # # Mono currently supports 10.6, but strndup is not available prior to 10.7; avoiding @@ -150,7 +151,7 @@ elif test x$target_ios = xno; then AC_CHECK_FUNCS(strndup getpwuid_r) fi -AM_CONDITIONAL(NEED_VASPRINTF, test x$have_vasprintf = x ) +AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno ) AM_ICONV() AC_SEARCH_LIBS(sqrtf, m) @@ -181,6 +182,7 @@ 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 sys/resource.h) +AC_CHECK_LIB([iconv], [locale_charset],[],[AC_CHECK_LIB([charset], [locale_charset],[LIBS+="-liconv -lcharset"])]) AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0]) AC_SUBST(HAVE_ALLOCA_H) diff --git a/eglib/src/Makefile.am b/eglib/src/Makefile.am index 70d519ea22..31771dfd9a 100644 --- a/eglib/src/Makefile.am +++ b/eglib/src/Makefile.am @@ -1,4 +1,4 @@ -noinst_LTLIBRARIES = libeglib.la libeglib-static.la +noinst_LTLIBRARIES = libeglib.la AM_CFLAGS = $(WERROR_CFLAGS) @@ -59,8 +59,6 @@ libeglib_la_SOURCES = \ $(vasprintf_files) libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2 -libeglib_static_la_SOURCES=$(libeglib_la_SOURCES) -libeglib_static_la_CFLAGS = $(libeglib_la_CFLAGS) AM_CPPFLAGS = -I$(srcdir) @@ -72,9 +70,6 @@ libeglib_la_LIBADD = -llog endif endif -libeglib_static_la_LIBADD = $(libeglib_la_LIBADD) $(LIBICONV) -libeglib_static_la_LDFLAGS = -static - MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files) diff --git a/eglib/src/Makefile.in b/eglib/src/Makefile.in new file mode 100644 index 0000000000..484b706ca4 --- /dev/null +++ b/eglib/src/Makefile.in @@ -0,0 +1,982 @@ +# Makefile.in generated by automake 1.13.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = src +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/../mkinstalldirs $(srcdir)/eglib-config.h.in \ + $(top_srcdir)/../depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = eglib-config.h +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +@HOST_WIN32_TRUE@libeglib_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am__libeglib_la_SOURCES_DIST = eglib-remap.h sort.frag.h glib.h \ + garray.c gbytearray.c gerror.c vasprintf.h ghashtable.c \ + giconv.c gmem.c gmodule.h goutput.c gqsort.c gstr.c gslist.c \ + gstring.c gptrarray.c glist.c gqueue.c gpath.c gshell.c \ + gspawn.c gfile.c gfile-posix.c gpattern.c gmarkup.c gutf8.c \ + gunicode.c unicode-data.h gdate-unix.c gdir-unix.c \ + gfile-unix.c gmisc-unix.c gmodule-unix.c gtimer-unix.c \ + eglib-config.hw gdate-win32.c gdir-win32.c gfile-win32.c \ + gmisc-win32.c gmodule-win32.c gtimer-win32.c vasprintf.c +am__objects_1 = libeglib_la-gdate-unix.lo libeglib_la-gdir-unix.lo \ + libeglib_la-gfile-unix.lo libeglib_la-gmisc-unix.lo \ + libeglib_la-gmodule-unix.lo libeglib_la-gtimer-unix.lo +am__objects_2 = libeglib_la-gdate-win32.lo libeglib_la-gdir-win32.lo \ + libeglib_la-gfile-win32.lo libeglib_la-gmisc-win32.lo \ + libeglib_la-gmodule-win32.lo libeglib_la-gtimer-win32.lo +@HOST_WIN32_FALSE@am__objects_3 = $(am__objects_1) +@HOST_WIN32_TRUE@am__objects_3 = $(am__objects_2) +@NEED_VASPRINTF_TRUE@am__objects_4 = libeglib_la-vasprintf.lo +am_libeglib_la_OBJECTS = libeglib_la-garray.lo \ + libeglib_la-gbytearray.lo libeglib_la-gerror.lo \ + libeglib_la-ghashtable.lo libeglib_la-giconv.lo \ + libeglib_la-gmem.lo libeglib_la-goutput.lo \ + libeglib_la-gqsort.lo libeglib_la-gstr.lo \ + libeglib_la-gslist.lo libeglib_la-gstring.lo \ + libeglib_la-gptrarray.lo libeglib_la-glist.lo \ + libeglib_la-gqueue.lo libeglib_la-gpath.lo \ + libeglib_la-gshell.lo libeglib_la-gspawn.lo \ + libeglib_la-gfile.lo libeglib_la-gfile-posix.lo \ + libeglib_la-gpattern.lo libeglib_la-gmarkup.lo \ + libeglib_la-gutf8.lo libeglib_la-gunicode.lo $(am__objects_3) \ + $(am__objects_4) +libeglib_la_OBJECTS = $(am_libeglib_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libeglib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libeglib_la_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/../depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libeglib_la_SOURCES) +DIST_SOURCES = $(am__libeglib_la_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BREAKPOINT = @BREAKPOINT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOLT_BASH = @DOLT_BASH@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GINT_TO_POINTER = @GINT_TO_POINTER@ +GNUC_NORETURN = @GNUC_NORETURN@ +GNUC_PRETTY = @GNUC_PRETTY@ +GNUC_UNUSED = @GNUC_UNUSED@ +GPOINTER_TO_INT = @GPOINTER_TO_INT@ +GPOINTER_TO_UINT = @GPOINTER_TO_UINT@ +GREP = @GREP@ +GSIZE = @GSIZE@ +GSIZE_FORMAT = @GSIZE_FORMAT@ +GUINT_TO_POINTER = @GUINT_TO_POINTER@ +G_GINT32_FORMAT = @G_GINT32_FORMAT@ +G_GINT64_FORMAT = @G_GINT64_FORMAT@ +G_GUINT32_FORMAT = @G_GUINT32_FORMAT@ +G_GUINT64_FORMAT = @G_GUINT64_FORMAT@ +G_HAVE_ISO_VARARGS = @G_HAVE_ISO_VARARGS@ +HAVE_ALLOCA_H = @HAVE_ALLOCA_H@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +ORDER = @ORDER@ +OS = @OS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATHSEP = @PATHSEP@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PIDTYPE = @PIDTYPE@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SEARCHSEP = @SEARCHSEP@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WERROR_CFLAGS = @WERROR_CFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libeglib.la +AM_CFLAGS = $(WERROR_CFLAGS) +win_files = \ + eglib-config.hw \ + gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c \ + gmodule-win32.c gtimer-win32.c + +unix_files = \ + gdate-unix.c gdir-unix.c gfile-unix.c gmisc-unix.c \ + gmodule-unix.c gtimer-unix.c + + +# some unices and windows do not have an implementation of vasprintf +# used by eglib, use provided implementation instead +@NEED_VASPRINTF_TRUE@vasprintf_files = vasprintf.c +@NEED_VASPRINTF_FALSE@vaprinttf_files = foo.c +@HOST_WIN32_FALSE@os_files = $(unix_files) +@HOST_WIN32_TRUE@os_files = $(win_files) +libeglib_la_SOURCES = \ + eglib-remap.h \ + sort.frag.h \ + glib.h \ + garray.c \ + gbytearray.c \ + gerror.c \ + vasprintf.h \ + ghashtable.c \ + giconv.c \ + gmem.c \ + gmodule.h \ + goutput.c \ + gqsort.c \ + gstr.c \ + gslist.c \ + gstring.c \ + gptrarray.c \ + glist.c \ + gqueue.c \ + gpath.c \ + gshell.c \ + gspawn.c \ + gfile.c \ + gfile-posix.c \ + gpattern.c \ + gmarkup.c \ + gutf8.c \ + gunicode.c \ + unicode-data.h \ + $(os_files) \ + $(vasprintf_files) + +libeglib_la_CFLAGS = -g -Wall -D_FORTIFY_SOURCE=2 +AM_CPPFLAGS = -I$(srcdir) +@HOST_WIN32_FALSE@@PLATFORM_ANDROID_TRUE@libeglib_la_LIBADD = -llog +@HOST_WIN32_TRUE@libeglib_la_LIBADD = -lm $(LIBICONV) -lpsapi +MAINTAINERCLEANFILES = Makefile.in +EXTRA_DIST = eglib-config.h.in $(win_files) $(unix_files) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +eglib-config.h: $(top_builddir)/config.status $(srcdir)/eglib-config.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libeglib.la: $(libeglib_la_OBJECTS) $(libeglib_la_DEPENDENCIES) $(EXTRA_libeglib_la_DEPENDENCIES) + $(AM_V_CCLD)$(libeglib_la_LINK) $(libeglib_la_OBJECTS) $(libeglib_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-garray.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gbytearray.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gdate-unix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gdate-win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gdir-unix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gdir-win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gerror.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gfile-posix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gfile-unix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gfile-win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gfile.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-ghashtable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-giconv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-glist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gmarkup.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gmem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gmisc-unix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gmisc-win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gmodule-unix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gmodule-win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-goutput.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gpath.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gpattern.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gptrarray.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gqsort.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gqueue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gshell.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gslist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gspawn.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gstr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gstring.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gtimer-unix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gtimer-win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gunicode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-gutf8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeglib_la-vasprintf.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libeglib_la-garray.lo: garray.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-garray.lo -MD -MP -MF $(DEPDIR)/libeglib_la-garray.Tpo -c -o libeglib_la-garray.lo `test -f 'garray.c' || echo '$(srcdir)/'`garray.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-garray.Tpo $(DEPDIR)/libeglib_la-garray.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='garray.c' object='libeglib_la-garray.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-garray.lo `test -f 'garray.c' || echo '$(srcdir)/'`garray.c + +libeglib_la-gbytearray.lo: gbytearray.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gbytearray.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gbytearray.Tpo -c -o libeglib_la-gbytearray.lo `test -f 'gbytearray.c' || echo '$(srcdir)/'`gbytearray.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gbytearray.Tpo $(DEPDIR)/libeglib_la-gbytearray.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gbytearray.c' object='libeglib_la-gbytearray.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gbytearray.lo `test -f 'gbytearray.c' || echo '$(srcdir)/'`gbytearray.c + +libeglib_la-gerror.lo: gerror.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gerror.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gerror.Tpo -c -o libeglib_la-gerror.lo `test -f 'gerror.c' || echo '$(srcdir)/'`gerror.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gerror.Tpo $(DEPDIR)/libeglib_la-gerror.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gerror.c' object='libeglib_la-gerror.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gerror.lo `test -f 'gerror.c' || echo '$(srcdir)/'`gerror.c + +libeglib_la-ghashtable.lo: ghashtable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-ghashtable.lo -MD -MP -MF $(DEPDIR)/libeglib_la-ghashtable.Tpo -c -o libeglib_la-ghashtable.lo `test -f 'ghashtable.c' || echo '$(srcdir)/'`ghashtable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-ghashtable.Tpo $(DEPDIR)/libeglib_la-ghashtable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ghashtable.c' object='libeglib_la-ghashtable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-ghashtable.lo `test -f 'ghashtable.c' || echo '$(srcdir)/'`ghashtable.c + +libeglib_la-giconv.lo: giconv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-giconv.lo -MD -MP -MF $(DEPDIR)/libeglib_la-giconv.Tpo -c -o libeglib_la-giconv.lo `test -f 'giconv.c' || echo '$(srcdir)/'`giconv.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-giconv.Tpo $(DEPDIR)/libeglib_la-giconv.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='giconv.c' object='libeglib_la-giconv.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-giconv.lo `test -f 'giconv.c' || echo '$(srcdir)/'`giconv.c + +libeglib_la-gmem.lo: gmem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gmem.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gmem.Tpo -c -o libeglib_la-gmem.lo `test -f 'gmem.c' || echo '$(srcdir)/'`gmem.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gmem.Tpo $(DEPDIR)/libeglib_la-gmem.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gmem.c' object='libeglib_la-gmem.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gmem.lo `test -f 'gmem.c' || echo '$(srcdir)/'`gmem.c + +libeglib_la-goutput.lo: goutput.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-goutput.lo -MD -MP -MF $(DEPDIR)/libeglib_la-goutput.Tpo -c -o libeglib_la-goutput.lo `test -f 'goutput.c' || echo '$(srcdir)/'`goutput.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-goutput.Tpo $(DEPDIR)/libeglib_la-goutput.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='goutput.c' object='libeglib_la-goutput.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-goutput.lo `test -f 'goutput.c' || echo '$(srcdir)/'`goutput.c + +libeglib_la-gqsort.lo: gqsort.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gqsort.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gqsort.Tpo -c -o libeglib_la-gqsort.lo `test -f 'gqsort.c' || echo '$(srcdir)/'`gqsort.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gqsort.Tpo $(DEPDIR)/libeglib_la-gqsort.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gqsort.c' object='libeglib_la-gqsort.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gqsort.lo `test -f 'gqsort.c' || echo '$(srcdir)/'`gqsort.c + +libeglib_la-gstr.lo: gstr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gstr.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gstr.Tpo -c -o libeglib_la-gstr.lo `test -f 'gstr.c' || echo '$(srcdir)/'`gstr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gstr.Tpo $(DEPDIR)/libeglib_la-gstr.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstr.c' object='libeglib_la-gstr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gstr.lo `test -f 'gstr.c' || echo '$(srcdir)/'`gstr.c + +libeglib_la-gslist.lo: gslist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gslist.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gslist.Tpo -c -o libeglib_la-gslist.lo `test -f 'gslist.c' || echo '$(srcdir)/'`gslist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gslist.Tpo $(DEPDIR)/libeglib_la-gslist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gslist.c' object='libeglib_la-gslist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gslist.lo `test -f 'gslist.c' || echo '$(srcdir)/'`gslist.c + +libeglib_la-gstring.lo: gstring.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gstring.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gstring.Tpo -c -o libeglib_la-gstring.lo `test -f 'gstring.c' || echo '$(srcdir)/'`gstring.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gstring.Tpo $(DEPDIR)/libeglib_la-gstring.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gstring.c' object='libeglib_la-gstring.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gstring.lo `test -f 'gstring.c' || echo '$(srcdir)/'`gstring.c + +libeglib_la-gptrarray.lo: gptrarray.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gptrarray.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gptrarray.Tpo -c -o libeglib_la-gptrarray.lo `test -f 'gptrarray.c' || echo '$(srcdir)/'`gptrarray.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gptrarray.Tpo $(DEPDIR)/libeglib_la-gptrarray.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gptrarray.c' object='libeglib_la-gptrarray.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gptrarray.lo `test -f 'gptrarray.c' || echo '$(srcdir)/'`gptrarray.c + +libeglib_la-glist.lo: glist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-glist.lo -MD -MP -MF $(DEPDIR)/libeglib_la-glist.Tpo -c -o libeglib_la-glist.lo `test -f 'glist.c' || echo '$(srcdir)/'`glist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-glist.Tpo $(DEPDIR)/libeglib_la-glist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='glist.c' object='libeglib_la-glist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-glist.lo `test -f 'glist.c' || echo '$(srcdir)/'`glist.c + +libeglib_la-gqueue.lo: gqueue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gqueue.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gqueue.Tpo -c -o libeglib_la-gqueue.lo `test -f 'gqueue.c' || echo '$(srcdir)/'`gqueue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gqueue.Tpo $(DEPDIR)/libeglib_la-gqueue.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gqueue.c' object='libeglib_la-gqueue.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gqueue.lo `test -f 'gqueue.c' || echo '$(srcdir)/'`gqueue.c + +libeglib_la-gpath.lo: gpath.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gpath.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gpath.Tpo -c -o libeglib_la-gpath.lo `test -f 'gpath.c' || echo '$(srcdir)/'`gpath.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gpath.Tpo $(DEPDIR)/libeglib_la-gpath.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gpath.c' object='libeglib_la-gpath.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gpath.lo `test -f 'gpath.c' || echo '$(srcdir)/'`gpath.c + +libeglib_la-gshell.lo: gshell.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gshell.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gshell.Tpo -c -o libeglib_la-gshell.lo `test -f 'gshell.c' || echo '$(srcdir)/'`gshell.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gshell.Tpo $(DEPDIR)/libeglib_la-gshell.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gshell.c' object='libeglib_la-gshell.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gshell.lo `test -f 'gshell.c' || echo '$(srcdir)/'`gshell.c + +libeglib_la-gspawn.lo: gspawn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gspawn.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gspawn.Tpo -c -o libeglib_la-gspawn.lo `test -f 'gspawn.c' || echo '$(srcdir)/'`gspawn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gspawn.Tpo $(DEPDIR)/libeglib_la-gspawn.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gspawn.c' object='libeglib_la-gspawn.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gspawn.lo `test -f 'gspawn.c' || echo '$(srcdir)/'`gspawn.c + +libeglib_la-gfile.lo: gfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gfile.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gfile.Tpo -c -o libeglib_la-gfile.lo `test -f 'gfile.c' || echo '$(srcdir)/'`gfile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gfile.Tpo $(DEPDIR)/libeglib_la-gfile.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gfile.c' object='libeglib_la-gfile.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gfile.lo `test -f 'gfile.c' || echo '$(srcdir)/'`gfile.c + +libeglib_la-gfile-posix.lo: gfile-posix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gfile-posix.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gfile-posix.Tpo -c -o libeglib_la-gfile-posix.lo `test -f 'gfile-posix.c' || echo '$(srcdir)/'`gfile-posix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gfile-posix.Tpo $(DEPDIR)/libeglib_la-gfile-posix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gfile-posix.c' object='libeglib_la-gfile-posix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gfile-posix.lo `test -f 'gfile-posix.c' || echo '$(srcdir)/'`gfile-posix.c + +libeglib_la-gpattern.lo: gpattern.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gpattern.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gpattern.Tpo -c -o libeglib_la-gpattern.lo `test -f 'gpattern.c' || echo '$(srcdir)/'`gpattern.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gpattern.Tpo $(DEPDIR)/libeglib_la-gpattern.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gpattern.c' object='libeglib_la-gpattern.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gpattern.lo `test -f 'gpattern.c' || echo '$(srcdir)/'`gpattern.c + +libeglib_la-gmarkup.lo: gmarkup.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gmarkup.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gmarkup.Tpo -c -o libeglib_la-gmarkup.lo `test -f 'gmarkup.c' || echo '$(srcdir)/'`gmarkup.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gmarkup.Tpo $(DEPDIR)/libeglib_la-gmarkup.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gmarkup.c' object='libeglib_la-gmarkup.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gmarkup.lo `test -f 'gmarkup.c' || echo '$(srcdir)/'`gmarkup.c + +libeglib_la-gutf8.lo: gutf8.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gutf8.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gutf8.Tpo -c -o libeglib_la-gutf8.lo `test -f 'gutf8.c' || echo '$(srcdir)/'`gutf8.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gutf8.Tpo $(DEPDIR)/libeglib_la-gutf8.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gutf8.c' object='libeglib_la-gutf8.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gutf8.lo `test -f 'gutf8.c' || echo '$(srcdir)/'`gutf8.c + +libeglib_la-gunicode.lo: gunicode.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gunicode.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gunicode.Tpo -c -o libeglib_la-gunicode.lo `test -f 'gunicode.c' || echo '$(srcdir)/'`gunicode.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gunicode.Tpo $(DEPDIR)/libeglib_la-gunicode.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gunicode.c' object='libeglib_la-gunicode.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gunicode.lo `test -f 'gunicode.c' || echo '$(srcdir)/'`gunicode.c + +libeglib_la-gdate-unix.lo: gdate-unix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gdate-unix.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gdate-unix.Tpo -c -o libeglib_la-gdate-unix.lo `test -f 'gdate-unix.c' || echo '$(srcdir)/'`gdate-unix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gdate-unix.Tpo $(DEPDIR)/libeglib_la-gdate-unix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdate-unix.c' object='libeglib_la-gdate-unix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gdate-unix.lo `test -f 'gdate-unix.c' || echo '$(srcdir)/'`gdate-unix.c + +libeglib_la-gdir-unix.lo: gdir-unix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gdir-unix.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gdir-unix.Tpo -c -o libeglib_la-gdir-unix.lo `test -f 'gdir-unix.c' || echo '$(srcdir)/'`gdir-unix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gdir-unix.Tpo $(DEPDIR)/libeglib_la-gdir-unix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdir-unix.c' object='libeglib_la-gdir-unix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gdir-unix.lo `test -f 'gdir-unix.c' || echo '$(srcdir)/'`gdir-unix.c + +libeglib_la-gfile-unix.lo: gfile-unix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gfile-unix.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gfile-unix.Tpo -c -o libeglib_la-gfile-unix.lo `test -f 'gfile-unix.c' || echo '$(srcdir)/'`gfile-unix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gfile-unix.Tpo $(DEPDIR)/libeglib_la-gfile-unix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gfile-unix.c' object='libeglib_la-gfile-unix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gfile-unix.lo `test -f 'gfile-unix.c' || echo '$(srcdir)/'`gfile-unix.c + +libeglib_la-gmisc-unix.lo: gmisc-unix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gmisc-unix.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gmisc-unix.Tpo -c -o libeglib_la-gmisc-unix.lo `test -f 'gmisc-unix.c' || echo '$(srcdir)/'`gmisc-unix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gmisc-unix.Tpo $(DEPDIR)/libeglib_la-gmisc-unix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gmisc-unix.c' object='libeglib_la-gmisc-unix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gmisc-unix.lo `test -f 'gmisc-unix.c' || echo '$(srcdir)/'`gmisc-unix.c + +libeglib_la-gmodule-unix.lo: gmodule-unix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gmodule-unix.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gmodule-unix.Tpo -c -o libeglib_la-gmodule-unix.lo `test -f 'gmodule-unix.c' || echo '$(srcdir)/'`gmodule-unix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gmodule-unix.Tpo $(DEPDIR)/libeglib_la-gmodule-unix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gmodule-unix.c' object='libeglib_la-gmodule-unix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gmodule-unix.lo `test -f 'gmodule-unix.c' || echo '$(srcdir)/'`gmodule-unix.c + +libeglib_la-gtimer-unix.lo: gtimer-unix.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gtimer-unix.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gtimer-unix.Tpo -c -o libeglib_la-gtimer-unix.lo `test -f 'gtimer-unix.c' || echo '$(srcdir)/'`gtimer-unix.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gtimer-unix.Tpo $(DEPDIR)/libeglib_la-gtimer-unix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gtimer-unix.c' object='libeglib_la-gtimer-unix.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gtimer-unix.lo `test -f 'gtimer-unix.c' || echo '$(srcdir)/'`gtimer-unix.c + +libeglib_la-gdate-win32.lo: gdate-win32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gdate-win32.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gdate-win32.Tpo -c -o libeglib_la-gdate-win32.lo `test -f 'gdate-win32.c' || echo '$(srcdir)/'`gdate-win32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gdate-win32.Tpo $(DEPDIR)/libeglib_la-gdate-win32.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdate-win32.c' object='libeglib_la-gdate-win32.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gdate-win32.lo `test -f 'gdate-win32.c' || echo '$(srcdir)/'`gdate-win32.c + +libeglib_la-gdir-win32.lo: gdir-win32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gdir-win32.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gdir-win32.Tpo -c -o libeglib_la-gdir-win32.lo `test -f 'gdir-win32.c' || echo '$(srcdir)/'`gdir-win32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gdir-win32.Tpo $(DEPDIR)/libeglib_la-gdir-win32.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gdir-win32.c' object='libeglib_la-gdir-win32.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gdir-win32.lo `test -f 'gdir-win32.c' || echo '$(srcdir)/'`gdir-win32.c + +libeglib_la-gfile-win32.lo: gfile-win32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gfile-win32.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gfile-win32.Tpo -c -o libeglib_la-gfile-win32.lo `test -f 'gfile-win32.c' || echo '$(srcdir)/'`gfile-win32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gfile-win32.Tpo $(DEPDIR)/libeglib_la-gfile-win32.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gfile-win32.c' object='libeglib_la-gfile-win32.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gfile-win32.lo `test -f 'gfile-win32.c' || echo '$(srcdir)/'`gfile-win32.c + +libeglib_la-gmisc-win32.lo: gmisc-win32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gmisc-win32.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gmisc-win32.Tpo -c -o libeglib_la-gmisc-win32.lo `test -f 'gmisc-win32.c' || echo '$(srcdir)/'`gmisc-win32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gmisc-win32.Tpo $(DEPDIR)/libeglib_la-gmisc-win32.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gmisc-win32.c' object='libeglib_la-gmisc-win32.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gmisc-win32.lo `test -f 'gmisc-win32.c' || echo '$(srcdir)/'`gmisc-win32.c + +libeglib_la-gmodule-win32.lo: gmodule-win32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gmodule-win32.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gmodule-win32.Tpo -c -o libeglib_la-gmodule-win32.lo `test -f 'gmodule-win32.c' || echo '$(srcdir)/'`gmodule-win32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gmodule-win32.Tpo $(DEPDIR)/libeglib_la-gmodule-win32.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gmodule-win32.c' object='libeglib_la-gmodule-win32.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gmodule-win32.lo `test -f 'gmodule-win32.c' || echo '$(srcdir)/'`gmodule-win32.c + +libeglib_la-gtimer-win32.lo: gtimer-win32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-gtimer-win32.lo -MD -MP -MF $(DEPDIR)/libeglib_la-gtimer-win32.Tpo -c -o libeglib_la-gtimer-win32.lo `test -f 'gtimer-win32.c' || echo '$(srcdir)/'`gtimer-win32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-gtimer-win32.Tpo $(DEPDIR)/libeglib_la-gtimer-win32.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gtimer-win32.c' object='libeglib_la-gtimer-win32.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-gtimer-win32.lo `test -f 'gtimer-win32.c' || echo '$(srcdir)/'`gtimer-win32.c + +libeglib_la-vasprintf.lo: vasprintf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -MT libeglib_la-vasprintf.lo -MD -MP -MF $(DEPDIR)/libeglib_la-vasprintf.Tpo -c -o libeglib_la-vasprintf.lo `test -f 'vasprintf.c' || echo '$(srcdir)/'`vasprintf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeglib_la-vasprintf.Tpo $(DEPDIR)/libeglib_la-vasprintf.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vasprintf.c' object='libeglib_la-vasprintf.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeglib_la_CFLAGS) $(CFLAGS) -c -o libeglib_la-vasprintf.lo `test -f 'vasprintf.c' || echo '$(srcdir)/'`vasprintf.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/eglib/src/Makefile.in.REMOVED.git-id b/eglib/src/Makefile.in.REMOVED.git-id deleted file mode 100644 index c8cec05366..0000000000 --- a/eglib/src/Makefile.in.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -4baf123a09feafdac9ee19e3dae1f9ebe5338ead \ No newline at end of file diff --git a/eglib/src/eglib-config.h.in b/eglib/src/eglib-config.h.in index ba0f93f9be..8f5a245cfe 100644 --- a/eglib/src/eglib-config.h.in +++ b/eglib/src/eglib-config.h.in @@ -36,7 +36,7 @@ typedef signed @GSIZE@ gssize; #define G_HAVE_ISO_VARARGS #endif -#if defined (__native_client__) +#if defined (__native_client__) || defined (HOST_WATCHOS) #undef G_BREAKPOINT #define G_BREAKPOINT() #endif diff --git a/eglib/src/gbytearray.c b/eglib/src/gbytearray.c index 8702a4957a..f8231b4834 100644 --- a/eglib/src/gbytearray.c +++ b/eglib/src/gbytearray.c @@ -49,3 +49,10 @@ g_byte_array_append (GByteArray *array, { return (GByteArray *)g_array_append_vals ((GArray *)array, data, len); } + +void +g_byte_array_set_size (GByteArray *array, gint length) +{ + g_array_set_size ((GArray *)array, length); +} + diff --git a/eglib/src/glib.h b/eglib/src/glib.h index 4b2c6d659d..f5473bd2a5 100644 --- a/eglib/src/glib.h +++ b/eglib/src/glib.h @@ -486,6 +486,7 @@ struct _GByteArray { GByteArray *g_byte_array_new (void); GByteArray* g_byte_array_append (GByteArray *array, const guint8 *data, guint len); guint8* g_byte_array_free (GByteArray *array, gboolean free_segment); +void g_byte_array_set_size (GByteArray *array, gint length); /* * Array diff --git a/eglib/src/gspawn.c b/eglib/src/gspawn.c index a01904e3e3..01639be101 100644 --- a/eglib/src/gspawn.c +++ b/eglib/src/gspawn.c @@ -74,13 +74,18 @@ #define NO_INTR(var,cmd) do { (var) = (cmd); } while ((var) == -1 && errno == EINTR) #define CLOSE_PIPE(p) do { close (p [0]); close (p [1]); } while (0) -#if defined(__APPLE__) && !defined (__arm__) && !defined (__aarch64__) +#if defined(__APPLE__) +#if defined (TARGET_OSX) /* Apple defines this in crt_externs.h but doesn't provide that header for * arm-apple-darwin9. We'll manually define the symbol on Apple as it does * in fact exist on all implementations (so far) */ -gchar ***_NSGetEnviron(); +gchar ***_NSGetEnviron(void); #define environ (*_NSGetEnviron()) +#else +static char *mono_environ[1] = { NULL }; +#define environ mono_environ +#endif /* defined (TARGET_OSX) */ #elif defined(_MSC_VER) /* MS defines this in stdlib.h */ #else @@ -248,6 +253,9 @@ g_spawn_command_line_sync (const gchar *command_line, GError **error) { #ifdef G_OS_WIN32 +#elif !defined (HAVE_FORK) || !defined (HAVE_EXECV) + fprintf (stderr, "g_spawn_command_line_sync not supported on this platform\n"); + return FALSE; #else pid_t pid; gchar **argv; @@ -344,6 +352,9 @@ g_spawn_async_with_pipes (const gchar *working_directory, GError **error) { #ifdef G_OS_WIN32 +#elif !defined (HAVE_FORK) || !defined (HAVE_EXECVE) + fprintf (stderr, "g_spawn_async_with_pipes is not supported on this platform\n"); + return FALSE; #else pid_t pid; int info_pipe [2]; diff --git a/eglib/src/gunicode.c b/eglib/src/gunicode.c index c3a9000f8d..e6f4b925b6 100644 --- a/eglib/src/gunicode.c +++ b/eglib/src/gunicode.c @@ -219,10 +219,10 @@ g_get_charset (G_CONST_RETURN char **charset) is_utf8 = FALSE; #else /* These shouldn't be heap allocated */ -#if HAVE_LOCALCHARSET_H - my_charset = locale_charset (); -#elif defined(HAVE_LANGINFO_H) +#if defined(HAVE_LANGINFO_H) my_charset = nl_langinfo (CODESET); +#elif defined(HAVE_LOCALCHARSET_H) + my_charset = locale_charset (); #else my_charset = "UTF-8"; #endif diff --git a/external/binary-reference-assemblies/v4.5/Accessibility.dll b/external/binary-reference-assemblies/v4.5/Accessibility.dll new file mode 100644 index 0000000000..4eeb96c338 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Accessibility.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Commons.Xml.Relaxng.dll b/external/binary-reference-assemblies/v4.5/Commons.Xml.Relaxng.dll new file mode 100644 index 0000000000..3585f01fc3 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Commons.Xml.Relaxng.dll differ diff --git a/external/binary-reference-assemblies/v4.5/CustomMarshalers.dll b/external/binary-reference-assemblies/v4.5/CustomMarshalers.dll new file mode 100644 index 0000000000..50a72a1d63 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/CustomMarshalers.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Collections.Concurrent.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Collections.Concurrent.dll new file mode 100644 index 0000000000..320627d3f9 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Collections.Concurrent.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Collections.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Collections.dll new file mode 100644 index 0000000000..2a92416efc Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Collections.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.ComponentModel.Annotations.dll b/external/binary-reference-assemblies/v4.5/Facades/System.ComponentModel.Annotations.dll new file mode 100644 index 0000000000..854e060efd Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.ComponentModel.Annotations.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.ComponentModel.EventBasedAsync.dll b/external/binary-reference-assemblies/v4.5/Facades/System.ComponentModel.EventBasedAsync.dll new file mode 100644 index 0000000000..4b1aa389d2 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.ComponentModel.EventBasedAsync.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.ComponentModel.dll b/external/binary-reference-assemblies/v4.5/Facades/System.ComponentModel.dll new file mode 100644 index 0000000000..fdf472e0b5 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.ComponentModel.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Contracts.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Contracts.dll new file mode 100644 index 0000000000..e97cf5e9db Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Contracts.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Debug.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Debug.dll new file mode 100644 index 0000000000..aba265383d Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Debug.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Tools.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Tools.dll new file mode 100644 index 0000000000..0eae9eda4b Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Tools.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Tracing.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Tracing.dll new file mode 100644 index 0000000000..a52692f47e Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Diagnostics.Tracing.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Dynamic.Runtime.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Dynamic.Runtime.dll new file mode 100644 index 0000000000..734e9e6c96 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Dynamic.Runtime.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Globalization.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Globalization.dll new file mode 100644 index 0000000000..b6b1302bee Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Globalization.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.IO.dll b/external/binary-reference-assemblies/v4.5/Facades/System.IO.dll new file mode 100644 index 0000000000..558e027a99 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.IO.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Linq.Expressions.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Linq.Expressions.dll new file mode 100644 index 0000000000..5d14bad99b Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Linq.Expressions.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Linq.Parallel.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Linq.Parallel.dll new file mode 100644 index 0000000000..58e6134f22 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Linq.Parallel.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Linq.Queryable.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Linq.Queryable.dll new file mode 100644 index 0000000000..b40d9d4f5f Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Linq.Queryable.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Linq.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Linq.dll new file mode 100644 index 0000000000..d437be47b2 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Linq.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Net.NetworkInformation.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Net.NetworkInformation.dll new file mode 100644 index 0000000000..ba8760af30 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Net.NetworkInformation.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Net.Primitives.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Net.Primitives.dll new file mode 100644 index 0000000000..26c335dbbf Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Net.Primitives.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Net.Requests.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Net.Requests.dll new file mode 100644 index 0000000000..a3f3c9b0b2 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Net.Requests.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.ObjectModel.dll b/external/binary-reference-assemblies/v4.5/Facades/System.ObjectModel.dll new file mode 100644 index 0000000000..0a4845b28f Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.ObjectModel.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Emit.ILGeneration.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Emit.ILGeneration.dll new file mode 100644 index 0000000000..2fe760850a Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Emit.ILGeneration.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Emit.Lightweight.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Emit.Lightweight.dll new file mode 100644 index 0000000000..04352c37a0 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Emit.Lightweight.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Emit.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Emit.dll new file mode 100644 index 0000000000..69cd8122f3 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Emit.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Extensions.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Extensions.dll new file mode 100644 index 0000000000..d162de0235 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Extensions.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Primitives.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Primitives.dll new file mode 100644 index 0000000000..6e6340abc5 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.Primitives.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.dll new file mode 100644 index 0000000000..2f98a7b5e5 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Reflection.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Resources.ResourceManager.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Resources.ResourceManager.dll new file mode 100644 index 0000000000..f7d966169b Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Resources.ResourceManager.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Extensions.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Extensions.dll new file mode 100644 index 0000000000..7fb59e5b5d Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Extensions.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.InteropServices.WindowsRuntime.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.InteropServices.WindowsRuntime.dll new file mode 100644 index 0000000000..e91d7f1303 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.InteropServices.WindowsRuntime.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.InteropServices.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.InteropServices.dll new file mode 100644 index 0000000000..23fddc1538 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.InteropServices.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Numerics.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Numerics.dll new file mode 100644 index 0000000000..3726081379 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Numerics.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Serialization.Json.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Serialization.Json.dll new file mode 100644 index 0000000000..f7b41921ba Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Serialization.Json.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Serialization.Primitives.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Serialization.Primitives.dll new file mode 100644 index 0000000000..b2778f4411 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Serialization.Primitives.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Serialization.Xml.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Serialization.Xml.dll new file mode 100644 index 0000000000..b5bb464bb4 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.Serialization.Xml.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.dll new file mode 100644 index 0000000000..d74e3232b9 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Runtime.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Security.Principal.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Security.Principal.dll new file mode 100644 index 0000000000..0587d8acd9 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Security.Principal.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Duplex.dll b/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Duplex.dll new file mode 100644 index 0000000000..04eff320ba Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Duplex.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Http.dll b/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Http.dll new file mode 100644 index 0000000000..ca042957d1 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Http.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.NetTcp.dll b/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.NetTcp.dll new file mode 100644 index 0000000000..e5909b8311 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.NetTcp.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Primitives.dll b/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Primitives.dll new file mode 100644 index 0000000000..bcb5b04509 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Primitives.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Security.dll b/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Security.dll new file mode 100644 index 0000000000..02af270d19 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.ServiceModel.Security.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Text.Encoding.Extensions.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Text.Encoding.Extensions.dll new file mode 100644 index 0000000000..964269b1ef Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Text.Encoding.Extensions.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Text.Encoding.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Text.Encoding.dll new file mode 100644 index 0000000000..7ade5f1825 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Text.Encoding.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Text.RegularExpressions.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Text.RegularExpressions.dll new file mode 100644 index 0000000000..d342917dea Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Text.RegularExpressions.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Threading.Tasks.Parallel.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Threading.Tasks.Parallel.dll new file mode 100644 index 0000000000..1d19b8b1ef Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Threading.Tasks.Parallel.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Threading.Tasks.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Threading.Tasks.dll new file mode 100644 index 0000000000..80023959f6 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Threading.Tasks.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Threading.Timer.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Threading.Timer.dll new file mode 100644 index 0000000000..99f3e07adb Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Threading.Timer.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Threading.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Threading.dll new file mode 100644 index 0000000000..7ced8e398a Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Threading.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Xml.ReaderWriter.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Xml.ReaderWriter.dll new file mode 100644 index 0000000000..28a3b62a6a Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Xml.ReaderWriter.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Xml.XDocument.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Xml.XDocument.dll new file mode 100644 index 0000000000..3555b3864f Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Xml.XDocument.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Facades/System.Xml.XmlSerializer.dll b/external/binary-reference-assemblies/v4.5/Facades/System.Xml.XmlSerializer.dll new file mode 100644 index 0000000000..4833994a1f Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Facades/System.Xml.XmlSerializer.dll differ diff --git a/external/binary-reference-assemblies/v4.5/I18N.CJK.dll b/external/binary-reference-assemblies/v4.5/I18N.CJK.dll new file mode 100644 index 0000000000..a6f9251268 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/I18N.CJK.dll differ diff --git a/external/binary-reference-assemblies/v4.5/I18N.MidEast.dll b/external/binary-reference-assemblies/v4.5/I18N.MidEast.dll new file mode 100644 index 0000000000..160e210de4 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/I18N.MidEast.dll differ diff --git a/external/binary-reference-assemblies/v4.5/I18N.Other.dll b/external/binary-reference-assemblies/v4.5/I18N.Other.dll new file mode 100644 index 0000000000..6e93690efe Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/I18N.Other.dll differ diff --git a/external/binary-reference-assemblies/v4.5/I18N.Rare.dll b/external/binary-reference-assemblies/v4.5/I18N.Rare.dll new file mode 100644 index 0000000000..1721bc53c8 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/I18N.Rare.dll differ diff --git a/external/binary-reference-assemblies/v4.5/I18N.West.dll b/external/binary-reference-assemblies/v4.5/I18N.West.dll new file mode 100644 index 0000000000..88c2d3d609 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/I18N.West.dll differ diff --git a/external/binary-reference-assemblies/v4.5/I18N.dll b/external/binary-reference-assemblies/v4.5/I18N.dll new file mode 100644 index 0000000000..369498cf70 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/I18N.dll differ diff --git a/external/binary-reference-assemblies/v4.5/IBM.Data.DB2.dll b/external/binary-reference-assemblies/v4.5/IBM.Data.DB2.dll new file mode 100644 index 0000000000..240a75c5e1 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/IBM.Data.DB2.dll differ diff --git a/external/binary-reference-assemblies/v4.5/ICSharpCode.SharpZipLib.dll b/external/binary-reference-assemblies/v4.5/ICSharpCode.SharpZipLib.dll new file mode 100644 index 0000000000..87be18f523 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/ICSharpCode.SharpZipLib.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Microsoft.Build.Engine.dll b/external/binary-reference-assemblies/v4.5/Microsoft.Build.Engine.dll new file mode 100644 index 0000000000..f8ddccee66 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Microsoft.Build.Engine.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Microsoft.Build.Framework.dll b/external/binary-reference-assemblies/v4.5/Microsoft.Build.Framework.dll new file mode 100644 index 0000000000..64828e7d40 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Microsoft.Build.Framework.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Microsoft.Build.Tasks.v4.0.dll b/external/binary-reference-assemblies/v4.5/Microsoft.Build.Tasks.v4.0.dll new file mode 100644 index 0000000000..84cc2896fd Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Microsoft.Build.Tasks.v4.0.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Microsoft.Build.Utilities.v4.0.dll b/external/binary-reference-assemblies/v4.5/Microsoft.Build.Utilities.v4.0.dll new file mode 100644 index 0000000000..a8728d3788 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Microsoft.Build.Utilities.v4.0.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Microsoft.Build.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/Microsoft.Build.dll.REMOVED.git-id new file mode 100644 index 0000000000..d75a39c116 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/Microsoft.Build.dll.REMOVED.git-id @@ -0,0 +1 @@ +8aab53eadb61b8614b222f4a7c8003e3f3f39f11 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/Microsoft.CSharp.dll b/external/binary-reference-assemblies/v4.5/Microsoft.CSharp.dll new file mode 100644 index 0000000000..187c87b384 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Microsoft.CSharp.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Microsoft.VisualC.dll b/external/binary-reference-assemblies/v4.5/Microsoft.VisualC.dll new file mode 100644 index 0000000000..a499e7efbc Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Microsoft.VisualC.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Microsoft.Web.Infrastructure.dll b/external/binary-reference-assemblies/v4.5/Microsoft.Web.Infrastructure.dll new file mode 100644 index 0000000000..48fb70bab0 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Microsoft.Web.Infrastructure.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.C5.dll b/external/binary-reference-assemblies/v4.5/Mono.C5.dll new file mode 100644 index 0000000000..4c10dd2ab1 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.C5.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.CSharp.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/Mono.CSharp.dll.REMOVED.git-id new file mode 100644 index 0000000000..cb88928c76 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/Mono.CSharp.dll.REMOVED.git-id @@ -0,0 +1 @@ +aa939bc7d394f15a9d8fea6b41b70574ad74ca82 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/Mono.Cairo.dll b/external/binary-reference-assemblies/v4.5/Mono.Cairo.dll new file mode 100644 index 0000000000..edd1fd76b9 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Cairo.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Cecil.Mdb.dll b/external/binary-reference-assemblies/v4.5/Mono.Cecil.Mdb.dll new file mode 100644 index 0000000000..70fcbf6c95 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Cecil.Mdb.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Cecil.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/Mono.Cecil.dll.REMOVED.git-id new file mode 100644 index 0000000000..3bc155a792 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/Mono.Cecil.dll.REMOVED.git-id @@ -0,0 +1 @@ +17bc1033ac1b7989014fc883d6ddceaec77df03c \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/Mono.CodeContracts.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/Mono.CodeContracts.dll.REMOVED.git-id new file mode 100644 index 0000000000..50b2894093 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/Mono.CodeContracts.dll.REMOVED.git-id @@ -0,0 +1 @@ +678ff49d59fedeb7fdcd30ad656993ed2777bf02 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/Mono.CompilerServices.SymbolWriter.dll b/external/binary-reference-assemblies/v4.5/Mono.CompilerServices.SymbolWriter.dll new file mode 100644 index 0000000000..74ea0b404d Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.CompilerServices.SymbolWriter.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Data.Sqlite.dll b/external/binary-reference-assemblies/v4.5/Mono.Data.Sqlite.dll new file mode 100644 index 0000000000..390ee3dc6e Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Data.Sqlite.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Data.Tds.dll b/external/binary-reference-assemblies/v4.5/Mono.Data.Tds.dll new file mode 100644 index 0000000000..9af9cc5120 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Data.Tds.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Debugger.Soft.dll b/external/binary-reference-assemblies/v4.5/Mono.Debugger.Soft.dll new file mode 100644 index 0000000000..21181cf860 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Debugger.Soft.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Http.dll b/external/binary-reference-assemblies/v4.5/Mono.Http.dll new file mode 100644 index 0000000000..847a9fd8bc Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Http.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Management.dll b/external/binary-reference-assemblies/v4.5/Mono.Management.dll new file mode 100644 index 0000000000..b2cddbad7c Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Management.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Messaging.RabbitMQ.dll b/external/binary-reference-assemblies/v4.5/Mono.Messaging.RabbitMQ.dll new file mode 100644 index 0000000000..fb689c7728 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Messaging.RabbitMQ.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Messaging.dll b/external/binary-reference-assemblies/v4.5/Mono.Messaging.dll new file mode 100644 index 0000000000..72723a3716 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Messaging.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Options.dll b/external/binary-reference-assemblies/v4.5/Mono.Options.dll new file mode 100644 index 0000000000..53abe04b97 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Options.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Parallel.dll b/external/binary-reference-assemblies/v4.5/Mono.Parallel.dll new file mode 100644 index 0000000000..2a28d52139 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Parallel.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Posix.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/Mono.Posix.dll.REMOVED.git-id new file mode 100644 index 0000000000..c7231e06ba --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/Mono.Posix.dll.REMOVED.git-id @@ -0,0 +1 @@ +696563161514adb83637b6e2453791b2bac7a4e1 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/Mono.Security.Win32.dll b/external/binary-reference-assemblies/v4.5/Mono.Security.Win32.dll new file mode 100644 index 0000000000..15eb445fc2 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Security.Win32.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Security.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/Mono.Security.dll.REMOVED.git-id new file mode 100644 index 0000000000..df128266fa --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/Mono.Security.dll.REMOVED.git-id @@ -0,0 +1 @@ +751d9bcaa363b072ae4163773e13e8bafcdc05cb \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/Mono.Simd.dll b/external/binary-reference-assemblies/v4.5/Mono.Simd.dll new file mode 100644 index 0000000000..ee336021e5 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Simd.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.Tasklets.dll b/external/binary-reference-assemblies/v4.5/Mono.Tasklets.dll new file mode 100644 index 0000000000..d40fb351ea Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.Tasklets.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Mono.WebBrowser.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/Mono.WebBrowser.dll.REMOVED.git-id new file mode 100644 index 0000000000..3a5210aa92 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/Mono.WebBrowser.dll.REMOVED.git-id @@ -0,0 +1 @@ +05db7a0baa8b8ead1da627f56eabe6784aa5688c \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/Mono.XBuild.Tasks.dll b/external/binary-reference-assemblies/v4.5/Mono.XBuild.Tasks.dll new file mode 100644 index 0000000000..87f7c9c32c Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/Mono.XBuild.Tasks.dll differ diff --git a/external/binary-reference-assemblies/v4.5/Novell.Directory.Ldap.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/Novell.Directory.Ldap.dll.REMOVED.git-id new file mode 100644 index 0000000000..2bbe021d28 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/Novell.Directory.Ldap.dll.REMOVED.git-id @@ -0,0 +1 @@ +d7dac1bf16ff783fa64b91240deee4b0f412ffdc \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/PEAPI.dll b/external/binary-reference-assemblies/v4.5/PEAPI.dll new file mode 100644 index 0000000000..f0e3461595 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/PEAPI.dll differ diff --git a/external/binary-reference-assemblies/v4.5/RabbitMQ.Client.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/RabbitMQ.Client.dll.REMOVED.git-id new file mode 100644 index 0000000000..9c09cae423 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/RabbitMQ.Client.dll.REMOVED.git-id @@ -0,0 +1 @@ +c1e947b00b60cd798085e4d1280a1bc417c6aca8 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/SMDiagnostics.dll b/external/binary-reference-assemblies/v4.5/SMDiagnostics.dll new file mode 100644 index 0000000000..30bd81534d Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/SMDiagnostics.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.ComponentModel.Composition.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.ComponentModel.Composition.dll.REMOVED.git-id new file mode 100644 index 0000000000..d3c060079e --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.ComponentModel.Composition.dll.REMOVED.git-id @@ -0,0 +1 @@ +0c7f43ab72f20b81790326cc6c1a25c7a1d219de \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.ComponentModel.DataAnnotations.dll b/external/binary-reference-assemblies/v4.5/System.ComponentModel.DataAnnotations.dll new file mode 100644 index 0000000000..1e0f3633f2 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.ComponentModel.DataAnnotations.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Configuration.Install.dll b/external/binary-reference-assemblies/v4.5/System.Configuration.Install.dll new file mode 100644 index 0000000000..a8a09a58da Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Configuration.Install.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Configuration.dll b/external/binary-reference-assemblies/v4.5/System.Configuration.dll new file mode 100644 index 0000000000..d6cbac98ac Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Configuration.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Core.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Core.dll.REMOVED.git-id new file mode 100644 index 0000000000..f08cb6ffa0 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Core.dll.REMOVED.git-id @@ -0,0 +1 @@ +d3feb4e276095b21c24ac01252ab9913b6c56dd0 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Data.DataSetExtensions.dll b/external/binary-reference-assemblies/v4.5/System.Data.DataSetExtensions.dll new file mode 100644 index 0000000000..f0bacd3cab Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Data.DataSetExtensions.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Data.Entity.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Data.Entity.dll.REMOVED.git-id new file mode 100644 index 0000000000..678bbe35e9 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Data.Entity.dll.REMOVED.git-id @@ -0,0 +1 @@ +02057de61a23f51c2f3d2de5e9cc2230e6f4ece8 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Data.Linq.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Data.Linq.dll.REMOVED.git-id new file mode 100644 index 0000000000..d1e99cfd97 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Data.Linq.dll.REMOVED.git-id @@ -0,0 +1 @@ +b936fb21c7587e16b728cb6eb48e2eb4c07789b4 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Data.OracleClient.dll b/external/binary-reference-assemblies/v4.5/System.Data.OracleClient.dll new file mode 100644 index 0000000000..d962c7fb21 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Data.OracleClient.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Data.Services.Client.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Data.Services.Client.dll.REMOVED.git-id new file mode 100644 index 0000000000..f4dd0f74c7 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Data.Services.Client.dll.REMOVED.git-id @@ -0,0 +1 @@ +6391c9788c89d4cf08b1c151486bc96f5f693478 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Data.Services.dll b/external/binary-reference-assemblies/v4.5/System.Data.Services.dll new file mode 100644 index 0000000000..71e7d4ac82 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Data.Services.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Data.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Data.dll.REMOVED.git-id new file mode 100644 index 0000000000..e71c822867 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Data.dll.REMOVED.git-id @@ -0,0 +1 @@ +d38371dd12fa542396a1c1e593d0793cb0efb496 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Design.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Design.dll.REMOVED.git-id new file mode 100644 index 0000000000..f339ac244e --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Design.dll.REMOVED.git-id @@ -0,0 +1 @@ +2d6fe818ae5b4960135286c86c063d813e2fe309 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.DirectoryServices.Protocols.dll b/external/binary-reference-assemblies/v4.5/System.DirectoryServices.Protocols.dll new file mode 100644 index 0000000000..986d3f372f Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.DirectoryServices.Protocols.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.DirectoryServices.dll b/external/binary-reference-assemblies/v4.5/System.DirectoryServices.dll new file mode 100644 index 0000000000..6f138a1bed Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.DirectoryServices.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Drawing.Design.dll b/external/binary-reference-assemblies/v4.5/System.Drawing.Design.dll new file mode 100644 index 0000000000..b8c37310ff Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Drawing.Design.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Drawing.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Drawing.dll.REMOVED.git-id new file mode 100644 index 0000000000..eada8a30fb --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Drawing.dll.REMOVED.git-id @@ -0,0 +1 @@ +41b92598bbea38b61a94f49f46813a1aa3fb60bc \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Dynamic.dll b/external/binary-reference-assemblies/v4.5/System.Dynamic.dll new file mode 100644 index 0000000000..605a578431 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Dynamic.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.EnterpriseServices.dll b/external/binary-reference-assemblies/v4.5/System.EnterpriseServices.dll new file mode 100644 index 0000000000..74b2720a2b Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.EnterpriseServices.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.IO.Compression.FileSystem.dll b/external/binary-reference-assemblies/v4.5/System.IO.Compression.FileSystem.dll new file mode 100644 index 0000000000..b22488676b Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.IO.Compression.FileSystem.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.IO.Compression.dll b/external/binary-reference-assemblies/v4.5/System.IO.Compression.dll new file mode 100644 index 0000000000..ce929a4db0 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.IO.Compression.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.IdentityModel.Selectors.dll b/external/binary-reference-assemblies/v4.5/System.IdentityModel.Selectors.dll new file mode 100644 index 0000000000..3a32f1a62d Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.IdentityModel.Selectors.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.IdentityModel.dll b/external/binary-reference-assemblies/v4.5/System.IdentityModel.dll new file mode 100644 index 0000000000..a2cfc4d0cd Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.IdentityModel.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Json.Microsoft.dll b/external/binary-reference-assemblies/v4.5/System.Json.Microsoft.dll new file mode 100644 index 0000000000..c1548ffc0c Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Json.Microsoft.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Json.dll b/external/binary-reference-assemblies/v4.5/System.Json.dll new file mode 100644 index 0000000000..d7d9f6c5ef Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Json.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Management.dll b/external/binary-reference-assemblies/v4.5/System.Management.dll new file mode 100644 index 0000000000..454a7c8d66 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Management.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Messaging.dll b/external/binary-reference-assemblies/v4.5/System.Messaging.dll new file mode 100644 index 0000000000..61fc3b4ec4 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Messaging.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Net.Http.Formatting.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Net.Http.Formatting.dll.REMOVED.git-id new file mode 100644 index 0000000000..9b7b0378bf --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Net.Http.Formatting.dll.REMOVED.git-id @@ -0,0 +1 @@ +4df2debc9cf3ecf4856c3a8da6525005c8dea578 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Net.Http.WebRequest.dll b/external/binary-reference-assemblies/v4.5/System.Net.Http.WebRequest.dll new file mode 100644 index 0000000000..9fc3268e98 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Net.Http.WebRequest.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Net.Http.dll b/external/binary-reference-assemblies/v4.5/System.Net.Http.dll new file mode 100644 index 0000000000..9bc4211d97 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Net.Http.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Net.dll b/external/binary-reference-assemblies/v4.5/System.Net.dll new file mode 100644 index 0000000000..168ba041f3 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Net.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Numerics.dll b/external/binary-reference-assemblies/v4.5/System.Numerics.dll new file mode 100644 index 0000000000..d320afe3df Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Numerics.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Reactive.Core.dll b/external/binary-reference-assemblies/v4.5/System.Reactive.Core.dll new file mode 100644 index 0000000000..3bc7533aab Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Reactive.Core.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Reactive.Debugger.dll b/external/binary-reference-assemblies/v4.5/System.Reactive.Debugger.dll new file mode 100644 index 0000000000..a618667c28 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Reactive.Debugger.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Reactive.Experimental.dll b/external/binary-reference-assemblies/v4.5/System.Reactive.Experimental.dll new file mode 100644 index 0000000000..cc7f7254ed Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Reactive.Experimental.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Reactive.Interfaces.dll b/external/binary-reference-assemblies/v4.5/System.Reactive.Interfaces.dll new file mode 100644 index 0000000000..12d9982de4 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Reactive.Interfaces.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Reactive.Linq.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Reactive.Linq.dll.REMOVED.git-id new file mode 100644 index 0000000000..617f1eded7 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Reactive.Linq.dll.REMOVED.git-id @@ -0,0 +1 @@ +21f711e393cada20acf6b20091303d8ddb598d04 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Reactive.Observable.Aliases.dll b/external/binary-reference-assemblies/v4.5/System.Reactive.Observable.Aliases.dll new file mode 100644 index 0000000000..c1960f189b Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Reactive.Observable.Aliases.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Reactive.PlatformServices.dll b/external/binary-reference-assemblies/v4.5/System.Reactive.PlatformServices.dll new file mode 100644 index 0000000000..0a4268605e Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Reactive.PlatformServices.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Reactive.Providers.dll b/external/binary-reference-assemblies/v4.5/System.Reactive.Providers.dll new file mode 100644 index 0000000000..35ac82429a Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Reactive.Providers.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Reactive.Runtime.Remoting.dll b/external/binary-reference-assemblies/v4.5/System.Reactive.Runtime.Remoting.dll new file mode 100644 index 0000000000..2c762f25de Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Reactive.Runtime.Remoting.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Reactive.Windows.Forms.dll b/external/binary-reference-assemblies/v4.5/System.Reactive.Windows.Forms.dll new file mode 100644 index 0000000000..6e4b911e1c Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Reactive.Windows.Forms.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Reactive.Windows.Threading.dll b/external/binary-reference-assemblies/v4.5/System.Reactive.Windows.Threading.dll new file mode 100644 index 0000000000..41f4c485af Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Reactive.Windows.Threading.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Runtime.Caching.dll b/external/binary-reference-assemblies/v4.5/System.Runtime.Caching.dll new file mode 100644 index 0000000000..bc451b66ae Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Runtime.Caching.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Runtime.DurableInstancing.dll b/external/binary-reference-assemblies/v4.5/System.Runtime.DurableInstancing.dll new file mode 100644 index 0000000000..ba033bb8d4 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Runtime.DurableInstancing.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Runtime.Remoting.dll b/external/binary-reference-assemblies/v4.5/System.Runtime.Remoting.dll new file mode 100644 index 0000000000..c41bfa8a5e Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Runtime.Remoting.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Runtime.Serialization.Formatters.Soap.dll b/external/binary-reference-assemblies/v4.5/System.Runtime.Serialization.Formatters.Soap.dll new file mode 100644 index 0000000000..d764b07383 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Runtime.Serialization.Formatters.Soap.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Runtime.Serialization.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Runtime.Serialization.dll.REMOVED.git-id new file mode 100644 index 0000000000..0a78a66b2a --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Runtime.Serialization.dll.REMOVED.git-id @@ -0,0 +1 @@ +81cb2710d327b83a0db41e042bba5e4ace6ff058 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Security.dll b/external/binary-reference-assemblies/v4.5/System.Security.dll new file mode 100644 index 0000000000..c28fc558ed Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Security.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.ServiceModel.Activation.dll b/external/binary-reference-assemblies/v4.5/System.ServiceModel.Activation.dll new file mode 100644 index 0000000000..82841f6384 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.ServiceModel.Activation.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.ServiceModel.Discovery.dll b/external/binary-reference-assemblies/v4.5/System.ServiceModel.Discovery.dll new file mode 100644 index 0000000000..70dc4c6277 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.ServiceModel.Discovery.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.ServiceModel.Internals.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.ServiceModel.Internals.dll.REMOVED.git-id new file mode 100644 index 0000000000..c4a10a4740 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.ServiceModel.Internals.dll.REMOVED.git-id @@ -0,0 +1 @@ +e4d834f3a9938232df03b8a16d10859acb2b485c \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.ServiceModel.Routing.dll b/external/binary-reference-assemblies/v4.5/System.ServiceModel.Routing.dll new file mode 100644 index 0000000000..5a35f802f7 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.ServiceModel.Routing.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.ServiceModel.Web.dll b/external/binary-reference-assemblies/v4.5/System.ServiceModel.Web.dll new file mode 100644 index 0000000000..b205b30721 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.ServiceModel.Web.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.ServiceModel.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.ServiceModel.dll.REMOVED.git-id new file mode 100644 index 0000000000..5ded2cb46d --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.ServiceModel.dll.REMOVED.git-id @@ -0,0 +1 @@ +663b4c41a0bfd22838616557a887173a414d17e3 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.ServiceProcess.dll b/external/binary-reference-assemblies/v4.5/System.ServiceProcess.dll new file mode 100644 index 0000000000..cbf0e51c58 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.ServiceProcess.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Threading.Tasks.Dataflow.dll b/external/binary-reference-assemblies/v4.5/System.Threading.Tasks.Dataflow.dll new file mode 100644 index 0000000000..3410d7eb70 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Threading.Tasks.Dataflow.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Transactions.dll b/external/binary-reference-assemblies/v4.5/System.Transactions.dll new file mode 100644 index 0000000000..c3b3e96e77 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Transactions.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Web.Abstractions.dll b/external/binary-reference-assemblies/v4.5/System.Web.Abstractions.dll new file mode 100644 index 0000000000..8f00ac3d48 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Web.Abstractions.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Web.ApplicationServices.dll b/external/binary-reference-assemblies/v4.5/System.Web.ApplicationServices.dll new file mode 100644 index 0000000000..e301dec6c5 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Web.ApplicationServices.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Web.DynamicData.dll b/external/binary-reference-assemblies/v4.5/System.Web.DynamicData.dll new file mode 100644 index 0000000000..8780b8979c Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Web.DynamicData.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Web.Extensions.Design.dll b/external/binary-reference-assemblies/v4.5/System.Web.Extensions.Design.dll new file mode 100644 index 0000000000..7622d09f83 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Web.Extensions.Design.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Web.Extensions.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Web.Extensions.dll.REMOVED.git-id new file mode 100644 index 0000000000..275530a9f0 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Web.Extensions.dll.REMOVED.git-id @@ -0,0 +1 @@ +894f317cc2f1bf8c092e7321c9d4c4962d0d54b2 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Web.Http.SelfHost.dll b/external/binary-reference-assemblies/v4.5/System.Web.Http.SelfHost.dll new file mode 100644 index 0000000000..50bde3a029 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Web.Http.SelfHost.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Web.Http.WebHost.dll b/external/binary-reference-assemblies/v4.5/System.Web.Http.WebHost.dll new file mode 100644 index 0000000000..08c94d35fa Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Web.Http.WebHost.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Web.Http.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Web.Http.dll.REMOVED.git-id new file mode 100644 index 0000000000..8b2699d138 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Web.Http.dll.REMOVED.git-id @@ -0,0 +1 @@ +c2bc972d089675b3c37736977270cebbab621cb0 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Web.Mvc.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Web.Mvc.dll.REMOVED.git-id new file mode 100644 index 0000000000..3d8c4b9be5 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Web.Mvc.dll.REMOVED.git-id @@ -0,0 +1 @@ +67c7e7c20cac4ff3d61baedd4f79584675d0813f \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Web.Razor.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Web.Razor.dll.REMOVED.git-id new file mode 100644 index 0000000000..ad6abb094a --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Web.Razor.dll.REMOVED.git-id @@ -0,0 +1 @@ +dae7afce08242600b8a4ee6f7df7a866676f08fc \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Web.Routing.dll b/external/binary-reference-assemblies/v4.5/System.Web.Routing.dll new file mode 100644 index 0000000000..4fe36be4c5 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Web.Routing.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Web.Services.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Web.Services.dll.REMOVED.git-id new file mode 100644 index 0000000000..18977f0642 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Web.Services.dll.REMOVED.git-id @@ -0,0 +1 @@ +583433a9300959ee82799ab7878cd0c64e309607 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Web.WebPages.Deployment.dll b/external/binary-reference-assemblies/v4.5/System.Web.WebPages.Deployment.dll new file mode 100644 index 0000000000..09a43d1d31 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Web.WebPages.Deployment.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Web.WebPages.Razor.dll b/external/binary-reference-assemblies/v4.5/System.Web.WebPages.Razor.dll new file mode 100644 index 0000000000..859902a234 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Web.WebPages.Razor.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Web.WebPages.dll b/external/binary-reference-assemblies/v4.5/System.Web.WebPages.dll new file mode 100644 index 0000000000..dd4328408d Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Web.WebPages.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Web.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Web.dll.REMOVED.git-id new file mode 100644 index 0000000000..4582b28c99 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Web.dll.REMOVED.git-id @@ -0,0 +1 @@ +72f0d92cd3b2d0090d61223427be0b409a930193 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Windows.Forms.DataVisualization.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Windows.Forms.DataVisualization.dll.REMOVED.git-id new file mode 100644 index 0000000000..070984aee3 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Windows.Forms.DataVisualization.dll.REMOVED.git-id @@ -0,0 +1 @@ +a5333d3c6bd238eb56abe324ffeecef5b82ca1a8 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Windows.Forms.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Windows.Forms.dll.REMOVED.git-id new file mode 100644 index 0000000000..d2b9752694 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Windows.Forms.dll.REMOVED.git-id @@ -0,0 +1 @@ +7db30cf308ffe9c82dfce0250507a5630e3bde12 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.Windows.dll b/external/binary-reference-assemblies/v4.5/System.Windows.dll new file mode 100644 index 0000000000..6681b7b9bb Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Windows.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Xaml.dll b/external/binary-reference-assemblies/v4.5/System.Xaml.dll new file mode 100644 index 0000000000..0f509a9389 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Xaml.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Xml.Linq.dll b/external/binary-reference-assemblies/v4.5/System.Xml.Linq.dll new file mode 100644 index 0000000000..ecdb40110a Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Xml.Linq.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Xml.Serialization.dll b/external/binary-reference-assemblies/v4.5/System.Xml.Serialization.dll new file mode 100644 index 0000000000..d0051ac107 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/System.Xml.Serialization.dll differ diff --git a/external/binary-reference-assemblies/v4.5/System.Xml.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.Xml.dll.REMOVED.git-id new file mode 100644 index 0000000000..9cf924990d --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.Xml.dll.REMOVED.git-id @@ -0,0 +1 @@ +d52fe94ca1c001624bdd995dc2ec00bc7362be9d \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/System.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/System.dll.REMOVED.git-id new file mode 100644 index 0000000000..8315034fd6 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/System.dll.REMOVED.git-id @@ -0,0 +1 @@ +2189052cb07e2f93e56710c23fa473df3aff9adc \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/SystemWebTestShim.dll b/external/binary-reference-assemblies/v4.5/SystemWebTestShim.dll new file mode 100644 index 0000000000..b89fcd8508 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/SystemWebTestShim.dll differ diff --git a/external/binary-reference-assemblies/v4.5/WebMatrix.Data.dll b/external/binary-reference-assemblies/v4.5/WebMatrix.Data.dll new file mode 100644 index 0000000000..b0a33d01e4 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/WebMatrix.Data.dll differ diff --git a/external/binary-reference-assemblies/v4.5/WindowsBase.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/WindowsBase.dll.REMOVED.git-id new file mode 100644 index 0000000000..39d2641f42 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/WindowsBase.dll.REMOVED.git-id @@ -0,0 +1 @@ +a6acb690d5b970d78a947ebb569d5f8f9d88f851 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/cscompmgd.dll b/external/binary-reference-assemblies/v4.5/cscompmgd.dll new file mode 100644 index 0000000000..3931c33212 Binary files /dev/null and b/external/binary-reference-assemblies/v4.5/cscompmgd.dll differ diff --git a/external/binary-reference-assemblies/v4.5/monodoc.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/monodoc.dll.REMOVED.git-id new file mode 100644 index 0000000000..3b1a61c10d --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/monodoc.dll.REMOVED.git-id @@ -0,0 +1 @@ +f7321d0dab375e9047a791d629ab0c436d194be2 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v4.5/mscorlib.dll.REMOVED.git-id b/external/binary-reference-assemblies/v4.5/mscorlib.dll.REMOVED.git-id new file mode 100644 index 0000000000..52465e4043 --- /dev/null +++ b/external/binary-reference-assemblies/v4.5/mscorlib.dll.REMOVED.git-id @@ -0,0 +1 @@ +a2e49b7887ced0e2a2e448c52f709207f20cc732 \ No newline at end of file diff --git a/external/ikdasm/Program.cs b/external/ikdasm/Program.cs index da197b2595..f994575bd5 100644 --- a/external/ikdasm/Program.cs +++ b/external/ikdasm/Program.cs @@ -36,6 +36,7 @@ namespace Ildasm { string outputFile = null; string inputFile = null; + MetadataTableIndex? tableToDump = null; var compatLevel = CompatLevel.None; var flags = Flags.None; @@ -44,7 +45,10 @@ namespace Ildasm var p = new OptionSet () { { "help", v => printUsage = true }, - { "out", v => outputFile = v } + { "out", v => outputFile = v }, + { "assembly", v =>tableToDump = MetadataTableIndex.Assembly }, + { "assemblyref", v =>tableToDump = MetadataTableIndex.AssemblyRef }, + { "moduleref", v =>tableToDump = MetadataTableIndex.ModuleRef }, }; args = p.Parse (args).ToArray (); if (printUsage) { @@ -117,6 +121,22 @@ namespace Ildasm PrintUsage(); return 1; } + if (tableToDump.HasValue) + { + var tableDumper = new TableDumper(inputFile); + if (outputFile != null) + { + using (StreamWriter sw = new StreamWriter(outputFile, false)) + { + tableDumper.DumpTable(sw, tableToDump.Value); + } + } + else + { + tableDumper.DumpTable(Console.Out, tableToDump.Value); + } + return 0; + } var disassembler = new Disassembler(inputFile, outputFile, compatLevel, flags); if (outputFile != null) { diff --git a/external/ikdasm/TableDumper.cs b/external/ikdasm/TableDumper.cs new file mode 100644 index 0000000000..0599ed3236 --- /dev/null +++ b/external/ikdasm/TableDumper.cs @@ -0,0 +1,142 @@ +// +// Copyright (C) 2011 Xamarin Inc (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// 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.Linq; +using System.Text; +using System.IO; +using IKVM.Reflection; + +namespace Ildasm +{ + enum MetadataTableIndex { + ModuleRef = 0x1a, + Assembly = 0x20, + AssemblyRef = 0x23, + } + + class TableDumper + { + Universe universe; + Assembly assembly; + Module module; + + public TableDumper (string inputFile) { + universe = new Universe (UniverseOptions.None); + + var raw = universe.OpenRawModule (System.IO.File.OpenRead (inputFile), System.IO.Path.GetTempPath () + "/Dummy"); + if (raw.IsManifestModule) + { + assembly = universe.LoadAssembly (raw); + module = assembly.ManifestModule; + } + else + { + var ab = universe.DefineDynamicAssembly (new AssemblyName (""), IKVM.Reflection.Emit.AssemblyBuilderAccess.ReflectionOnly); + assembly = ab; + module = ab.__AddModule (raw); + } + } + + public void DumpTable (TextWriter w, MetadataTableIndex tableIndex) { + switch (tableIndex) { + case MetadataTableIndex.Assembly: + DumpAssemblyTable (w); + break; + case MetadataTableIndex.AssemblyRef: + DumpAssemblyRefTable (w); + break; + case MetadataTableIndex.ModuleRef: + DumpModuleRefTable (w); + break; + default: + throw new NotImplementedException (); + } + } + + void HexDump (TextWriter w, byte[] bytes, int len) { + for (int i = 0; i < len; ++i) { + if ((i % 16) == 0) + w.Write (String.Format ("\n0x{0:x08}: ", i)); + w.Write (String.Format ("{0:X02} ", bytes [i])); + } + } + + void DumpAssemblyTable (TextWriter w) { + var t = module.AssemblyTable; + w.WriteLine ("Assembly Table"); + foreach (var r in t.records) { + w.WriteLine (String.Format ("Name: {0}", module.GetString (r.Name))); + w.WriteLine (String.Format ("Hash Algoritm: 0x{0:x08}", r.HashAlgId)); + w.WriteLine (String.Format ("Version: {0}.{1}.{2}.{3}", r.MajorVersion, r.MinorVersion, r.BuildNumber, r.RevisionNumber)); + w.WriteLine (String.Format ("Flags: 0x{0:x08}", r.Flags)); + w.WriteLine (String.Format ("PublicKey: BlobPtr (0x{0:x08})", r.PublicKey)); + + var blob = module.GetBlob (r.PublicKey); + if (blob.Length == 0) { + w.WriteLine ("\tZero sized public key"); + } else { + w.Write ("\tDump:"); + byte[] bytes = blob.ReadBytes (blob.Length); + HexDump (w, bytes, bytes.Length); + w.WriteLine (); + } + w.WriteLine (String.Format ("Culture: {0}", module.GetString (r.Culture))); + w.WriteLine (); + } + } + + void DumpAssemblyRefTable (TextWriter w) { + var t = module.AssemblyRef; + w.WriteLine ("AssemblyRef Table"); + int rowIndex = 1; + foreach (var r in t.records) { + w.WriteLine (String.Format ("{0}: Version={1}.{2}.{3}.{4}", rowIndex, r.MajorVersion, r.MinorVersion, r.BuildNumber, r.RevisionNumber)); + w.WriteLine (String.Format ("\tName={0}", module.GetString (r.Name))); + w.WriteLine (String.Format ("\tFlags=0x{0:x08}", r.Flags)); + var blob = module.GetBlob (r.PublicKeyOrToken); + if (blob.Length == 0) { + w.WriteLine ("\tZero sized public key"); + } else { + w.Write ("\tPublic Key:"); + byte[] bytes = blob.ReadBytes (blob.Length); + HexDump (w, bytes, bytes.Length); + w.WriteLine (); + } + w.WriteLine (); + rowIndex ++; + } + } + + void DumpModuleRefTable (TextWriter w) { + var t = module.ModuleRef; + w.WriteLine ("ModuleRef Table (1.." + t.RowCount + ")"); + int rowIndex = 1; + foreach (var r in t.records) { + w.WriteLine (String.Format ("{0}: {1}", rowIndex, module.GetString (r))); + rowIndex ++; + } + } + } +} diff --git a/external/referencesource/README.md b/external/referencesource/README.md index 3b2fccf802..5ca7180514 100644 --- a/external/referencesource/README.md +++ b/external/referencesource/README.md @@ -5,4 +5,6 @@ that represent a subset of the .NET Framework. This subset contains similar fun developed in [.NET Core](https://github.com/dotnet/corefx). We intend to consult the referencesource repository as we develop .NET Core. It is also for the community to leverage to enable more scenarios for .NET developers. -Please note that the referencesource repository is read-only. Questions and pull requests should be done through [.NET Core](https://github.com/dotnet/corefx). +**Please note that the referencesource repository is read-only**. [See this blog post](http://blogs.msdn.com/b/dotnet/archive/2014/11/12/net-core-is-open-source.aspx) for the rationale. + +Questions, bugs, and pull requests should be done through [.NET Core](https://github.com/dotnet/corefx). diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogCategory.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogCategory.cs index 11bca18653..e68da03ac2 100644 --- a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogCategory.cs +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogCategory.cs @@ -4,8 +4,8 @@ namespace System.ServiceModel.Diagnostics { - // - + // FUTURE: This class is kept so that 4.0 Extended SKU runs fine on 4.5 Client. Will remove this in the future. + // Order is important here. The order must match the order of strings in ..\EventLog\EventLog.mc [Obsolete("This has been replaced by System.Runtime.Diagnostics.EventLogCategory")] enum EventLogCategory : ushort { @@ -25,4 +25,4 @@ namespace System.ServiceModel.Diagnostics ListenerAdapter } -} +} \ No newline at end of file diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogEventId.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogEventId.cs index 3fe96971ff..0652dfe0c7 100644 --- a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogEventId.cs +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogEventId.cs @@ -4,8 +4,8 @@ namespace System.ServiceModel.Diagnostics { - // - + // FUTURE: This class is kept so that 4.0 Extended SKU runs fine on 4.5 Client. Will remove this in the future. + // Order is important here. The order must match the order of strings in ..\EventLog\EventLog.mc [Obsolete("This has been replaced by System.Runtime.Diagnostics.EventLogEventId")] enum EventLogEventId : uint { diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/NativeMethods.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/NativeMethods.cs index bbcf4395c8..1da0a2cfd7 100644 --- a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/NativeMethods.cs +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/NativeMethods.cs @@ -19,4 +19,4 @@ namespace System.ServiceModel.Diagnostics [SecurityCritical] internal static extern SafeEventLogWriteHandle RegisterEventSource(string uncServerName, string sourceName); } -} +} \ No newline at end of file diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceSourceKind.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceSourceKind.cs index 97ccaa01f2..8b361b2287 100644 --- a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceSourceKind.cs +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceSourceKind.cs @@ -9,4 +9,4 @@ namespace System.ServiceModel.Diagnostics DiagnosticTraceSource, PiiTraceSource } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/AssemblyInfo.cs b/external/referencesource/System.Activities.Core.Presentation/AssemblyInfo.cs similarity index 90% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/AssemblyInfo.cs rename to external/referencesource/System.Activities.Core.Presentation/AssemblyInfo.cs index 7c865848af..5919b78629 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/AssemblyInfo.cs +++ b/external/referencesource/System.Activities.Core.Presentation/AssemblyInfo.cs @@ -2,4 +2,4 @@ using System.Runtime.CompilerServices; using System.Diagnostics.CodeAnalysis; [assembly: InternalsVisibleTo("CIT.System.Activities.Core.Design, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] -[assembly: SuppressMessage("Microsoft.MSInternal", "CA904:DeclareTypesInMicrosoftOrSystemNamespace", Scope = "namespace", Target = "XamlGeneratedNamespace", Justification = "Xaml Generated")] +[assembly: SuppressMessage("Microsoft.MSInternal", "CA904:DeclareTypesInMicrosoftOrSystemNamespace", Scope = "namespace", Target = "XamlGeneratedNamespace", Justification = "Xaml Generated")] \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/SR.Designer.cs b/external/referencesource/System.Activities.Core.Presentation/SR.Designer.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/SR.Designer.cs rename to external/referencesource/System.Activities.Core.Presentation/SR.Designer.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ArgumentIdentifierTrimConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ArgumentIdentifierTrimConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ArgumentIdentifierTrimConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ArgumentIdentifierTrimConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/AssignDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/AssignDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/AssignDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/AssignDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CancellationScopeDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CancellationScopeDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CancellationScopeDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CancellationScopeDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.ViewInterface.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.ViewInterface.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.ViewInterface.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.ViewInterface.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.ViewModel.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.ViewModel.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.ViewModel.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.ViewModel.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBox.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBoxIsEnabledConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBoxIsEnabledConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBoxIsEnabledConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseKeyBoxIsEnabledConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseLabelVisibilityConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseLabelVisibilityConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseLabelVisibilityConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CaseLabelVisibilityConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CatchDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CatchDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CatchDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CatchDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ComboBoxHelper.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ComboBoxHelper.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ComboBoxHelper.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ComboBoxHelper.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CompensableActivityDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CompensableActivityDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CompensableActivityDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/CompensableActivityDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ConnectionPointType.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ConnectionPointType.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ConnectionPointType.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ConnectionPointType.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DelegateArgumentsValueEditor.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DelegateArgumentsValueEditor.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DelegateArgumentsValueEditor.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DelegateArgumentsValueEditor.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DesignerMetadata.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DesignerMetadata.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DesignerMetadata.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DesignerMetadata.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DisplayNameConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DisplayNameConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DisplayNameConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DisplayNameConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DoWhileDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DoWhileDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DoWhileDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DoWhileDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyChooser.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyChooser.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyChooser.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyChooser.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyChooserViewModel.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyChooserViewModel.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyChooserViewModel.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyChooserViewModel.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyToTooltipConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyToTooltipConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyToTooltipConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/DynamicActivityPropertyToTooltipConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpandableItemShowExpandedMultiValueConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpandableItemShowExpandedMultiValueConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpandableItemShowExpandedMultiValueConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpandableItemShowExpandedMultiValueConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpandableItemWrapper.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpandableItemWrapper.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpandableItemWrapper.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpandableItemWrapper.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpressionToExpressionTextConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpressionToExpressionTextConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpressionToExpressionTextConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ExpressionToExpressionTextConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/GenericForEachWithBodyFactory.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/GenericForEachWithBodyFactory.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/GenericForEachWithBodyFactory.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/GenericForEachWithBodyFactory.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/GenericParallelForEachWithBodyFactory.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/GenericParallelForEachWithBodyFactory.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/GenericParallelForEachWithBodyFactory.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/GenericParallelForEachWithBodyFactory.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/PickWithTwoBranchesFactory.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/PickWithTwoBranchesFactory.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/PickWithTwoBranchesFactory.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/PickWithTwoBranchesFactory.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/StateMachineWithInitialStateFactory.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/StateMachineWithInitialStateFactory.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/StateMachineWithInitialStateFactory.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Factories/StateMachineWithInitialStateFactory.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FakeRoot.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FakeRoot.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FakeRoot.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FakeRoot.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FinalState.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FinalState.cs similarity index 99% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FinalState.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FinalState.cs index 681ede84fb..4cbffae1b4 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FinalState.cs +++ b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FinalState.cs @@ -12,4 +12,4 @@ namespace System.Activities.Core.Presentation public sealed class FinalState { } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowDecisionDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowDecisionDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowDecisionDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowDecisionDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowDecisionLabelFeature.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowDecisionLabelFeature.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowDecisionLabelFeature.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowDecisionLabelFeature.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchCaseEditorDialog.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchCaseEditorDialog.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchCaseEditorDialog.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchCaseEditorDialog.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchDefaultLinkFeature.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchDefaultLinkFeature.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchDefaultLinkFeature.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchDefaultLinkFeature.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLabelFeature.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLabelFeature.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLabelFeature.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLabelFeature.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLink.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLink.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLink.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLink.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLinkCasePropertyEditor.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLinkCasePropertyEditor.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLinkCasePropertyEditor.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLinkCasePropertyEditor.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLinkMultiValueConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLinkMultiValueConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLinkMultiValueConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowSwitchLinkMultiValueConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartConnectionPointsAdorner.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartConnectionPointsAdorner.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartConnectionPointsAdorner.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartConnectionPointsAdorner.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.Container.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.Container.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.Container.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.Container.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.Helpers.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.Helpers.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.Helpers.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.Helpers.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.ModelChangeReactions.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.ModelChangeReactions.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.ModelChangeReactions.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.ModelChangeReactions.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.ModelChanges.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.ModelChanges.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.ModelChanges.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.ModelChanges.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.xaml.cs.REMOVED.git-id b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.xaml.cs.REMOVED.git-id similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.xaml.cs.REMOVED.git-id rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesigner.xaml.cs.REMOVED.git-id diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesignerCommands.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesignerCommands.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesignerCommands.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartDesignerCommands.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartExpressionAdorner.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartExpressionAdorner.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartExpressionAdorner.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartExpressionAdorner.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartExpressionAutomationPeer.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartExpressionAutomationPeer.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartExpressionAutomationPeer.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartExpressionAutomationPeer.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartFreeFormPanel.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartFreeFormPanel.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartFreeFormPanel.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartFreeFormPanel.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartResizeGrip.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartResizeGrip.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartResizeGrip.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartResizeGrip.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartSizeFeature.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartSizeFeature.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartSizeFeature.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FlowchartSizeFeature.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ForEachDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ForEachDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ForEachDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ForEachDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FreeFormPanelUtilities.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FreeFormPanelUtilities.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FreeFormPanelUtilities.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/FreeFormPanelUtilities.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/GenericFlowSwitchHelper.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/GenericFlowSwitchHelper.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/GenericFlowSwitchHelper.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/GenericFlowSwitchHelper.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/GenericTypeArgumentConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/GenericTypeArgumentConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/GenericTypeArgumentConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/GenericTypeArgumentConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/HintTextConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/HintTextConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/HintTextConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/HintTextConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/HintTextMaxWidthConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/HintTextMaxWidthConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/HintTextMaxWidthConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/HintTextMaxWidthConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IFlowSwitch.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IFlowSwitch.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IFlowSwitch.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IFlowSwitch.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IfElseDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IfElseDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IfElseDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IfElseDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InteropDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InteropDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InteropDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InteropDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeDelegateDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeDelegateDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeDelegateDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeDelegateDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeDelegateValidationFeature.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeDelegateValidationFeature.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeDelegateValidationFeature.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeDelegateValidationFeature.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeMethodDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeMethodDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeMethodDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/InvokeMethodDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IsLastSelectedItemConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IsLastSelectedItemConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IsLastSelectedItemConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IsLastSelectedItemConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IsStateRootDesignerConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IsStateRootDesignerConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IsStateRootDesignerConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/IsStateRootDesignerConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/LocationChangedEventArgs.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/LocationChangedEventArgs.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/LocationChangedEventArgs.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/LocationChangedEventArgs.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MaxValueConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MaxValueConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MaxValueConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MaxValueConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MorphHelpers.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MorphHelpers.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MorphHelpers.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/MorphHelpers.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/NoPersistScopeDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/NoPersistScopeDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/NoPersistScopeDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/NoPersistScopeDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/NotConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/NotConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/NotConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/NotConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ParallelDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ParallelDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ParallelDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ParallelDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ParallelSeparator.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ParallelSeparator.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ParallelSeparator.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ParallelSeparator.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickBranchDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickBranchDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickBranchDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickBranchDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickValidationErrorSourceLocator.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickValidationErrorSourceLocator.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickValidationErrorSourceLocator.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickValidationErrorSourceLocator.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickValidationErrorSourceLocatorFeature.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickValidationErrorSourceLocatorFeature.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickValidationErrorSourceLocatorFeature.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PickValidationErrorSourceLocatorFeature.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PropertyNames.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PropertyNames.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PropertyNames.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/PropertyNames.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/RegisterMetadataDelayedWorker.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/RegisterMetadataDelayedWorker.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/RegisterMetadataDelayedWorker.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/RegisterMetadataDelayedWorker.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ReorderableListEditor.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ReorderableListEditor.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ReorderableListEditor.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/ReorderableListEditor.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SelectedPropertyNameChangedEventArgs.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SelectedPropertyNameChangedEventArgs.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SelectedPropertyNameChangedEventArgs.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SelectedPropertyNameChangedEventArgs.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SequenceDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SequenceDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SequenceDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SequenceDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StartNode.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StartNode.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StartNode.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StartNode.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StartSymbol.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StartSymbol.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StartSymbol.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StartSymbol.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateConnectionPointToolTip.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateConnectionPointToolTip.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateConnectionPointToolTip.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateConnectionPointToolTip.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.CompositeView.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.CompositeView.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.CompositeView.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.CompositeView.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.ModelChangeReactions.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.ModelChangeReactions.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.ModelChangeReactions.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.ModelChangeReactions.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.ModelChanges.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.ModelChanges.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.ModelChanges.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.ModelChanges.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.Utilities.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.Utilities.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.Utilities.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.Utilities.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.xaml.cs.REMOVED.git-id b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.xaml.cs.REMOVED.git-id similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.xaml.cs.REMOVED.git-id rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerEditor.xaml.cs.REMOVED.git-id diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerResizeGrip.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerResizeGrip.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerResizeGrip.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateContainerResizeGrip.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateLinkButtonToolTipConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateLinkButtonToolTipConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateLinkButtonToolTipConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateLinkButtonToolTipConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineConnetionPointsAdorner.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineConnetionPointsAdorner.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineConnetionPointsAdorner.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineConnetionPointsAdorner.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineFreeFormPanel.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineFreeFormPanel.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineFreeFormPanel.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineFreeFormPanel.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineValidationErrorSourceLocator.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineValidationErrorSourceLocator.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineValidationErrorSourceLocator.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineValidationErrorSourceLocator.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineValidationErrorSourceLocatorFeature.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineValidationErrorSourceLocatorFeature.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineValidationErrorSourceLocatorFeature.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/StateMachineValidationErrorSourceLocatorFeature.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SwitchDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SwitchDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SwitchDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SwitchDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SwitchTryCatchDesignerHelper.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SwitchTryCatchDesignerHelper.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SwitchTryCatchDesignerHelper.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/SwitchTryCatchDesignerHelper.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/DesignerStyleDictionary.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/DesignerStyleDictionary.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/DesignerStyleDictionary.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/DesignerStyleDictionary.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/EditorCategoryTemplateDictionary.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/EditorCategoryTemplateDictionary.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/EditorCategoryTemplateDictionary.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/EditorCategoryTemplateDictionary.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/StringResourceDictionary.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/StringResourceDictionary.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/StringResourceDictionary.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/Themes/StringResourceDictionary.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransactionScopeDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransactionScopeDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransactionScopeDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransactionScopeDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransitionDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransitionDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransitionDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransitionDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransitionReorderChange.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransitionReorderChange.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransitionReorderChange.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TransitionReorderChange.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TryCatchDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TryCatchDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TryCatchDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/TryCatchDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/VerticalConnector.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/VerticalConnector.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/VerticalConnector.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/VerticalConnector.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/WhileDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/WhileDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/WhileDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/WhileDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/WriteLineDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/WriteLineDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Core/Presentation/WriteLineDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Core/Presentation/WriteLineDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/ActivityDesignerHelper.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/ActivityDesignerHelper.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/ActivityDesignerHelper.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/ActivityDesignerHelper.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/ActivityXRefPropertyEditor.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/ActivityXRefPropertyEditor.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/ActivityXRefPropertyEditor.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/ActivityXRefPropertyEditor.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/ArgumentCollectionPropertyEditor.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/ArgumentCollectionPropertyEditor.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/ArgumentCollectionPropertyEditor.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/ArgumentCollectionPropertyEditor.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesignerOptions.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesignerOptions.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesignerOptions.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDesignerOptions.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDialog.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDialog.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDialog.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/DynamicArgumentDialog.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/TypeCollectionDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/TypeCollectionDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/TypeCollectionDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/TypeCollectionDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/TypeCollectionPropertyEditor.cs b/external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/TypeCollectionPropertyEditor.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/Activities/Presentation/TypeCollectionPropertyEditor.cs rename to external/referencesource/System.Activities.Core.Presentation/System/Activities/Presentation/TypeCollectionPropertyEditor.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ActivityXRefConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ActivityXRefConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ActivityXRefConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ActivityXRefConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/BindingEditor.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/BindingEditor.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/BindingEditor.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/BindingEditor.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/BindingPropertyValueEditor.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/BindingPropertyValueEditor.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/BindingPropertyValueEditor.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/BindingPropertyValueEditor.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentButtonTitleConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentButtonTitleConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentButtonTitleConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentButtonTitleConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentCorrelationTypeExpander.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentCorrelationTypeExpander.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentCorrelationTypeExpander.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentCorrelationTypeExpander.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentDialogViewModel.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentDialogViewModel.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentDialogViewModel.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ContentDialogViewModel.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/ReceiveMessageContentSearchableStringConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/ReceiveMessageContentSearchableStringConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/ReceiveMessageContentSearchableStringConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/ReceiveMessageContentSearchableStringConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/ReceiveParametersContentSearchableStringConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/ReceiveParametersContentSearchableStringConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/ReceiveParametersContentSearchableStringConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/ReceiveParametersContentSearchableStringConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/SendMessageContentSearchableStringConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/SendMessageContentSearchableStringConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/SendMessageContentSearchableStringConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/SendMessageContentSearchableStringConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/SendParametersContentSearchableStringConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/SendParametersContentSearchableStringConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/SendParametersContentSearchableStringConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/SendParametersContentSearchableStringConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/XPathMessageQuerySearchableStringConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/XPathMessageQuerySearchableStringConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/XPathMessageQuerySearchableStringConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Converters/XPathMessageQuerySearchableStringConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelatesOnValueEditor.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelatesOnValueEditor.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelatesOnValueEditor.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelatesOnValueEditor.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationDataDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationDataDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationDataDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationDataDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationInitializerDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationInitializerDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationInitializerDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationInitializerDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationInitializerValueEditor.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationInitializerValueEditor.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationInitializerValueEditor.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationInitializerValueEditor.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationScopeDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationScopeDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationScopeDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/CorrelationScopeDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/EndpointDesigner.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/EndpointDesigner.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/EndpointDesigner.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/EndpointDesigner.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Factories/ReceiveAndSendReplyFactory.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Factories/ReceiveAndSendReplyFactory.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Factories/ReceiveAndSendReplyFactory.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Factories/ReceiveAndSendReplyFactory.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Factories/SendAndReceiveReplyFactory.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Factories/SendAndReceiveReplyFactory.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Factories/SendAndReceiveReplyFactory.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/Factories/SendAndReceiveReplyFactory.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/InitializeCorrelationDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/InitializeCorrelationDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/InitializeCorrelationDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/InitializeCorrelationDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessageQueryEditor.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessageQueryEditor.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessageQueryEditor.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessageQueryEditor.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessageQuerySetDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessageQuerySetDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessageQuerySetDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessageQuerySetDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessagingContentPropertyEditorResources.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessagingContentPropertyEditorResources.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessagingContentPropertyEditorResources.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/MessagingContentPropertyEditorResources.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveContentDialog.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveContentDialog.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveContentDialog.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveContentDialog.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveContentPropertyEditor.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveContentPropertyEditor.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveContentPropertyEditor.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveContentPropertyEditor.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveReplyDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveReplyDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveReplyDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveReplyDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveReplyValidationFeature.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveReplyValidationFeature.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveReplyValidationFeature.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ReceiveReplyValidationFeature.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendContentDialog.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendContentDialog.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendContentDialog.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendContentDialog.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendContentPropertyEditor.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendContentPropertyEditor.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendContentPropertyEditor.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendContentPropertyEditor.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendReplyDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendReplyDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendReplyDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendReplyDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendReplyValidationFeature.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendReplyValidationFeature.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendReplyValidationFeature.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/SendReplyValidationFeature.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ServiceContractImporter.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ServiceContractImporter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ServiceContractImporter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/ServiceContractImporter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/TransactedReceiveScope.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/TransactedReceiveScope.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/TransactedReceiveScope.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/TransactedReceiveScope.xaml.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/TypeToTreeConverter.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/TypeToTreeConverter.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/TypeToTreeConverter.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Activities/Presentation/TypeToTreeConverter.cs diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Presentation/ServiceDesigner.xaml.cs b/external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Presentation/ServiceDesigner.xaml.cs similarity index 100% rename from external/referencesource/System.Activities.Presentation/System.Activities.Core.Presentation/System/ServiceModel/Presentation/ServiceDesigner.xaml.cs rename to external/referencesource/System.Activities.Core.Presentation/System/ServiceModel/Presentation/ServiceDesigner.xaml.cs diff --git a/external/referencesource/System.Activities.DurableInstancing/AssemblyInfo.cs b/external/referencesource/System.Activities.DurableInstancing/AssemblyInfo.cs index b8d9e68ff0..bbaeab37ba 100644 --- a/external/referencesource/System.Activities.DurableInstancing/AssemblyInfo.cs +++ b/external/referencesource/System.Activities.DurableInstancing/AssemblyInfo.cs @@ -27,4 +27,4 @@ using System.Security.Permissions; // by using the '*' as shown below: // Friend assemblies -// Partial Trust : +// Partial Trust : \ No newline at end of file diff --git a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/InstanceCompletionAction.cs b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/InstanceCompletionAction.cs index caf08656b2..c8b21a74a7 100644 --- a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/InstanceCompletionAction.cs +++ b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/InstanceCompletionAction.cs @@ -9,4 +9,4 @@ namespace System.Activities.DurableInstancing DeleteNothing = 0, DeleteAll }; -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/InstanceEncodingOption.cs b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/InstanceEncodingOption.cs index e313b7eeea..62ab9512eb 100644 --- a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/InstanceEncodingOption.cs +++ b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/InstanceEncodingOption.cs @@ -9,4 +9,4 @@ namespace System.Activities.DurableInstancing None = 0, GZip }; -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/LoadType.cs b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/LoadType.cs index ebc665f5dd..6507d03da2 100644 --- a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/LoadType.cs +++ b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/LoadType.cs @@ -11,4 +11,4 @@ namespace System.Activities.DurableInstancing LoadByKey = 2, LoadByInstance = 3 } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/PrimitiveType.cs b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/PrimitiveType.cs index f1a6a749e7..d919f07772 100644 --- a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/PrimitiveType.cs +++ b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/PrimitiveType.cs @@ -30,4 +30,4 @@ namespace System.Activities.DurableInstancing XmlQualifiedName, Unavailable = 99 } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SqlCommandAsyncResult.cs b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SqlCommandAsyncResult.cs index 1c9cd4b90f..8335154acf 100644 --- a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SqlCommandAsyncResult.cs +++ b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SqlCommandAsyncResult.cs @@ -35,6 +35,8 @@ namespace System.Activities.DurableInstancing new RetryErrorCode(10054, RetryErrorOptions.RetryBeginOrEnd | RetryErrorOptions.RetryWhenTransaction), // Severed tcp connection drawn from the pool new RetryErrorCode(10060, RetryErrorOptions.RetryBeginOrEnd | RetryErrorOptions.RetryWhenTransaction), // The server was not found or was not accessible. new RetryErrorCode(10061, RetryErrorOptions.RetryBeginOrEnd | RetryErrorOptions.RetryWhenTransaction), // SQL Server not started + new RetryErrorCode(10928, RetryErrorOptions.RetryBeginOrEnd | RetryErrorOptions.RetryWhenTransaction), // SQL Azure error - The limit for the database resource has been reached. + new RetryErrorCode(10929, RetryErrorOptions.RetryBeginOrEnd | RetryErrorOptions.RetryWhenTransaction), // SQL Azure error - The server is currently too busy to support requests up to the maximum limit. new RetryErrorCode(40143, RetryErrorOptions.RetryBeginOrEnd | RetryErrorOptions.RetryWhenTransaction), // SQL Azure error - server encountered error processing the request. new RetryErrorCode(40197, RetryErrorOptions.RetryBeginOrEnd | RetryErrorOptions.RetryWhenTransaction), // SQL Azure error - server encountered error processing the request. new RetryErrorCode(40501, RetryErrorOptions.RetryBeginOrEnd | RetryErrorOptions.RetryWhenTransaction), // SQL Azure error - server is currently busy. diff --git a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SuspensionStateChange.cs b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SuspensionStateChange.cs index 52cbdd6a0e..0999941ca2 100644 --- a/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SuspensionStateChange.cs +++ b/external/referencesource/System.Activities.DurableInstancing/System/Activities/DurableInstancing/SuspensionStateChange.cs @@ -10,4 +10,4 @@ namespace System.Activities.DurableInstancing SuspendInstance = 1, UnsuspendInstance = 2 }; -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeKind.cs b/external/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeKind.cs index 2aaae52f26..bf1bf11343 100644 --- a/external/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeKind.cs +++ b/external/referencesource/System.Activities.Presentation/Microsoft.Tools.Common/Microsoft/Activities/Presentation/Xaml/XamlTypeKind.cs @@ -12,4 +12,4 @@ namespace Microsoft.Activities.Presentation.Xaml PartialSupported, // I understand this type if you would like to remove some new properties FullySupported, // I understand this type } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AdornerLocation.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AdornerLocation.cs index 86f482beb1..34d3d24b7e 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AdornerLocation.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/AdornerLocation.cs @@ -14,4 +14,4 @@ namespace System.Activities.Presentation.Annotations TopLeft, BottomLeft } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IDockedAnnotation.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IDockedAnnotation.cs index 80054290f6..658c833204 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IDockedAnnotation.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Annotations/IDockedAnnotation.cs @@ -24,4 +24,4 @@ namespace System.Activities.Presentation.Annotations void FocusOnContent(); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryContainerCommands.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryContainerCommands.cs new file mode 100644 index 0000000000..3897fd57c7 --- /dev/null +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/CategoryContainerCommands.cs @@ -0,0 +1,40 @@ + + +// ------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All Rights Reserved. +// ------------------------------------------------------------------- +//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties +namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector +{ + using System; + using System.Windows; + using System.Windows.Input; + + + // + // Standard commands and command implementations used by PropertyContainer templates + // and implemented by property editing hosts + // + internal static class CategoryContainerCommands + { + private static readonly RoutedCommand togglePinAdvancedProperties = new RoutedCommand("TogglePinAdvancedProperties", typeof(CategoryContainerCommands)); + private static readonly RoutedCommand updateCategoryExpansionState = new RoutedCommand("UpdateCategoryExpansionState", typeof(CategoryContainerCommands)); + + // + // standard command to category edit host to togglePinAdvancedProperties + // + public static RoutedCommand TogglePinAdvancedProperties + { + get { return CategoryContainerCommands.togglePinAdvancedProperties; } + } + + // + // standard command to property edit host to updateCategoryExpansionState + // + public static RoutedCommand UpdateCategoryExpansionState + { + get { return CategoryContainerCommands.updateCategoryExpansionState; } + } + + } +} diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/ExtensibilityMetadataHelper.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/ExtensibilityMetadataHelper.cs new file mode 100644 index 0000000000..5b106a83a2 --- /dev/null +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/ExtensibilityMetadataHelper.cs @@ -0,0 +1,113 @@ + +// ------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All Rights Reserved. +// ------------------------------------------------------------------- +//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties +namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector +{ + using System.ComponentModel; + using System.Diagnostics; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System; + using System.Activities.Presentation.PropertyEditing; + using System.Collections; + using System.Globalization; + using System.Runtime; + using System.Diagnostics.CodeAnalysis; + + internal static class ExtensibilityMetadataHelper + { + // + // Returns an instance of the PropertyValueEditor specified in the provided attribute list. + // + // A list of attributes. If an EditorAttribute is not specified in this collection, will return null. + // Interface for exception logging. If null, exceptions will be silently ignored. + // + [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")] + [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")] + public static PropertyValueEditor GetValueEditor(IEnumerable attributes, IMessageLogger exceptionLogger) + { + PropertyValueEditor propertyValueEditor = null; + if (attributes != null) + { + foreach (Attribute attribute in attributes) + { + EditorAttribute editorAttribute = attribute as EditorAttribute; + if (editorAttribute != null) + { + try + { + Type editorType = Type.GetType(editorAttribute.EditorTypeName); + if (editorType != null && typeof(PropertyValueEditor).IsAssignableFrom(editorType)) + { + propertyValueEditor = (PropertyValueEditor)Activator.CreateInstance(editorType); + break; + } + } + catch (Exception e) + { + if (exceptionLogger != null) + { + exceptionLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.ValueEditorLoadFailed, ExtensibilityMetadataHelper.GetExceptionMessage(e))); + } + } + } + } + } + return propertyValueEditor; + } + + // + // Returns the type of the editor specified by the provided EditorAttribute. + // + // EditorAttribute that specifies a CategoryEditor type. If the type specified is not derived from CategoryEditor, or cannot be loaded, will return null. + // Interface for exception logging. If null, exceptions will be silently ignored. + // + [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Propagating the error might cause VS to crash")] + [SuppressMessage("Reliability", "Reliability108", Justification = "Propagating the error might cause VS to crash")] + public static Type GetCategoryEditorType(EditorAttribute attribute, IMessageLogger exceptionLogger) + { + try + { + Type editorType = Type.GetType(attribute.EditorTypeName); + if (editorType != null && typeof(CategoryEditor).IsAssignableFrom(editorType)) + { + return editorType; + } + } + catch (Exception e) + { + if (exceptionLogger != null) + { + exceptionLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, ExceptionStringTable.CategoryEditorTypeLoadFailed, ExtensibilityMetadataHelper.GetExceptionMessage(e))); + } + } + return null; + } + + public static string GetExceptionMessage(Exception e) + { + return (e.InnerException != null) ? e.InnerException.ToString() : e.Message; + } + + public static bool IsEditorReusable(IEnumerable attributes) + { + bool isEditorReusable = true; + if (attributes != null) + { + foreach (Attribute attribute in attributes) + { + EditorReuseAttribute editorReuseAttribute = attribute as EditorReuseAttribute; + if (editorReuseAttribute != null) + { + isEditorReusable = editorReuseAttribute.ReuseEditor; + break; + } + } + } + return isEditorReusable; + } + } +} + diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/PropertyContainerPopupHelper.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/PropertyContainerPopupHelper.cs new file mode 100644 index 0000000000..f4591eff47 --- /dev/null +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/Internal/PropertyEditing/FromExpression/Framework/PropertyInspector/PropertyContainerPopupHelper.cs @@ -0,0 +1,74 @@ +// ------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All Rights Reserved. +// ------------------------------------------------------------------- +//From \\authoring\Sparkle\Source\1.0.1083.0\Common\Source\Framework\Properties +namespace System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.PropertyInspector +{ + using System; + using System.Collections.Generic; + using System.Text; + using System.Windows; + using System.Windows.Controls.Primitives; + using System.Windows.Input; + using System.Windows.Media; + using System.Activities.Presentation.PropertyEditing; + using System.Activities.Presentation.Internal.PropertyEditing.FromExpression.Framework.Controls; + + // + // Acrylic needs a way of knowing when we begin and end extended edit mode, + // so this class fires commands when those two events take place. + // + internal class PropertyContainerPopup : WorkaroundPopup + { + // these events allow Acrylic to implement its workaround for Avalon/MFC interop + // focus issues (WinOS bug # 1713206) + public static readonly RoutedCommand OnBeginExtendedEdit = new RoutedCommand("OnBeginExtendedEdit", typeof(PropertyContainerPopup)); + public static readonly RoutedCommand OnEndExtendedEdit = new RoutedCommand("OnEndExtendedEdit", typeof(PropertyContainerPopup)); + + public static CustomPopupPlacementCallback RightAlignedPopupPlacement + { + get { return new CustomPopupPlacementCallback(PropertyContainerPopup.RightAlignedPopupPlacementCallback); } + } + + protected override void OnOpened(EventArgs e) + { + // Fire OnBeginExtendedEdit command (for Acrylic) + PropertyContainer owningPropertyContainer = (PropertyContainer)this.GetValue(PropertyContainer.OwningPropertyContainerProperty); + PropertyContainerPopup.OnBeginExtendedEdit.Execute(this, owningPropertyContainer); + + base.OnOpened(e); + } + + protected override void OnClosed(EventArgs e) + { + base.OnClosed(e); + + PropertyContainer owningPropertyContainer = (PropertyContainer)this.GetValue(PropertyContainer.OwningPropertyContainerProperty); + + // Revert back to Inline when the popup is dismissed and we haven't already switched + // to the pinned mode + if (owningPropertyContainer != null && owningPropertyContainer.ActiveEditMode == PropertyContainerEditMode.ExtendedPopup) + { + DependencyObject potentialDescendant = Mouse.Captured as DependencyObject; + if (potentialDescendant != null && owningPropertyContainer.IsAncestorOf(potentialDescendant)) + { + // v1 38479: This is a mitigation for Windows OS Bug 1965872. + // Here we force any control which has capture to lose it, though + // this situation can occur in other cases (e.g. via extensibility) but this covers the most + // common cases and is a safe fix. + Mouse.Capture(null); + } + + owningPropertyContainer.ActiveEditMode = PropertyContainerEditMode.Inline; + } + + // Fire OnEndExtendedEdit command (for Acrylic) + OnEndExtendedEdit.Execute(this, owningPropertyContainer); + } + + public static CustomPopupPlacement[] RightAlignedPopupPlacementCallback(Size popupSize, Size targetSize, Point offset) + { + return new CustomPopupPlacement[] { new CustomPopupPlacement(new Point(targetSize.Width - popupSize.Width, targetSize.Height), PopupPrimaryAxis.Horizontal) }; + } + } +} diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyMarker.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyMarker.cs index 5155e5f3c0..13d1cb6737 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyMarker.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Base/Core/PropertyEditing/PropertyMarker.cs @@ -11,4 +11,4 @@ namespace System.Activities.Presentation.PropertyEditing { /// class PropertyMarker : Control { } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectDirections.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectDirections.cs index bbb763183a..c1e980ce6a 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectDirections.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoConnectDirections.cs @@ -37,4 +37,4 @@ namespace System.Activities.Presentation.FreeFormEditing /// Bottom = 8 } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitAlignment.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitAlignment.cs index 4246d77845..ff4a253684 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitAlignment.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/AutoSplitAlignment.cs @@ -26,4 +26,4 @@ namespace System.Activities.Presentation.FreeFormEditing /// Horizontal } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/INestedFreeFormPanelContainer.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/INestedFreeFormPanelContainer.cs index 4b1b9c54c4..1900d4ec23 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/INestedFreeFormPanelContainer.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/INestedFreeFormPanelContainer.cs @@ -9,4 +9,4 @@ namespace System.Activities.Presentation.FreeFormEditing FreeFormPanel GetChildFreeFormPanel(); FreeFormPanel GetOutmostFreeFormPanel(); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/RequiredSizeChangedEventHandler.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/RequiredSizeChangedEventHandler.cs index 1acab96b1b..97283b0920 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/RequiredSizeChangedEventHandler.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/FreeFormEditing/RequiredSizeChangedEventHandler.cs @@ -5,4 +5,4 @@ namespace System.Activities.Presentation.FreeFormEditing { internal delegate void RequiredSizeChangedEventHandler(object sender, RequiredSizeChangedEventArgs e); -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/IActivityTemplateFactory.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/IActivityTemplateFactory.cs index 86ecd7ee0b..dca449e198 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/IActivityTemplateFactory.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Toolbox/IActivityTemplateFactory.cs @@ -15,4 +15,4 @@ namespace System.Activities.Presentation { T Create(DependencyObject target, IDataObject dataObject); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationReason.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationReason.cs index be04091bc3..81e4593e86 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationReason.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationReason.cs @@ -11,4 +11,4 @@ namespace System.Activities.Presentation.Validation Save, ModelChange, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationState.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationState.cs index c6766aa386..62f42b9a69 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationState.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/Validation/ValidationState.cs @@ -37,4 +37,4 @@ namespace System.Activities.Presentation.Validation /// Valid = 0 } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IVersionEditor.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IVersionEditor.cs index 49051223a9..aaa7622211 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IVersionEditor.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/IVersionEditor.cs @@ -10,4 +10,4 @@ namespace System.Activities.Presentation.View { void ShowErrorMessage(string message); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateService.cs b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateService.cs index bdf1b73ba5..de09908116 100644 --- a/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateService.cs +++ b/external/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/ViewStateService.cs @@ -17,4 +17,4 @@ namespace System.Activities.Presentation.View public abstract Dictionary RetrieveAllViewState(ModelItem modelItem); public abstract bool RemoveViewState(ModelItem modelItem, string key); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities/System/Activities/ActivityInstance.cs b/external/referencesource/System.Activities/System/Activities/ActivityInstance.cs index df8eb6ea82..1393d9b34e 100644 --- a/external/referencesource/System.Activities/System/Activities/ActivityInstance.cs +++ b/external/referencesource/System.Activities/System/Activities/ActivityInstance.cs @@ -1292,7 +1292,7 @@ namespace System.Activities if (TD.ActivityCompletedIsEnabled()) { - TD.ActivityCompleted(this.Activity.GetType().ToString(), this.Activity.DisplayName, this.Id, this.State.ToString()); + TD.ActivityCompleted(this.Activity.GetType().ToString(), this.Activity.DisplayName, this.Id, this.State.GetStateName()); } } diff --git a/external/referencesource/System.Activities/System/Activities/ActivityInstanceState.cs b/external/referencesource/System.Activities/System/Activities/ActivityInstanceState.cs index 0148272a1e..1c9943e05a 100644 --- a/external/referencesource/System.Activities/System/Activities/ActivityInstanceState.cs +++ b/external/referencesource/System.Activities/System/Activities/ActivityInstanceState.cs @@ -5,6 +5,7 @@ namespace System.Activities { using System.Runtime.Serialization; + using System.Runtime; [DataContract] public enum ActivityInstanceState @@ -20,5 +21,28 @@ namespace System.Activities [EnumMember] Faulted, + + // If any more states are added, ensure they are also added to ActivityInstanceStateExtension.GetStateName + } + + internal static class ActivityInstanceStateExtension + { + internal static string GetStateName(this ActivityInstanceState state) + { + switch (state) + { + case ActivityInstanceState.Executing: + return "Executing"; + case ActivityInstanceState.Closed: + return "Closed"; + case ActivityInstanceState.Canceled: + return "Canceled"; + case ActivityInstanceState.Faulted: + return "Faulted"; + default: + Fx.Assert("Don't understand ActivityInstanceState named " + state.ToString()); + return state.ToString(); + } + } } } diff --git a/external/referencesource/System.Activities/System/Activities/AssemblyInfo.cs b/external/referencesource/System.Activities/System/Activities/AssemblyInfo.cs index ab3fa5c387..9523e62204 100644 --- a/external/referencesource/System.Activities/System/Activities/AssemblyInfo.cs +++ b/external/referencesource/System.Activities/System/Activities/AssemblyInfo.cs @@ -24,7 +24,7 @@ using System.Windows.Markup; [assembly: XmlnsPrefix("http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger", "sads")] // Friends Assembly -// +// TODO, 33059, Make common shim to access System.Activities's internal classes. [assembly: InternalsVisibleTo("CDF.CIT.Scenarios.WorkflowModel.Debugger, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("CDF.CIT.Scenarios.WorkflowModel.Compensation, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("CDF.CIT.Scenarios.WorkflowModel.DataModel, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/external/referencesource/System.Activities/System/Activities/Debugger/ICharacterSpottingTextReaderForUnitTest.cs b/external/referencesource/System.Activities/System/Activities/Debugger/ICharacterSpottingTextReaderForUnitTest.cs index 7d6881d39a..7e179b65a3 100644 --- a/external/referencesource/System.Activities/System/Activities/Debugger/ICharacterSpottingTextReaderForUnitTest.cs +++ b/external/referencesource/System.Activities/System/Activities/Debugger/ICharacterSpottingTextReaderForUnitTest.cs @@ -20,4 +20,4 @@ namespace System.Activities.Debugger List DoubleQuotes { get; } } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities/System/Activities/Debugger/StateManager.cs b/external/referencesource/System.Activities/System/Activities/Debugger/StateManager.cs index 662116b4d4..3671724485 100644 --- a/external/referencesource/System.Activities/System/Activities/Debugger/StateManager.cs +++ b/external/referencesource/System.Activities/System/Activities/Debugger/StateManager.cs @@ -738,26 +738,36 @@ namespace System.Activities.Debugger if (isPriming) { - if (!islandsWithPriming.TryGetValue(state, out island)) + lock (islandsWithPriming) { - island = state.GetMethodInfo(true); - islandsWithPriming[state] = island; + if (!islandsWithPriming.TryGetValue(state, out island)) + { + island = state.GetMethodInfo(true); + islandsWithPriming[state] = island; + } } } else { - if (!islands.TryGetValue(state, out island)) + lock (islands) { - island = state.GetMethodInfo(false); - islands[state] = island; + if (!islands.TryGetValue(state, out island)) + { + island = state.GetMethodInfo(false); + islands[state] = island; + } } } return island; } + // This method is only called from CreateIsland, which is only called from Bake. + // Bake does a "lock(this)" before calling CreateIsland, so access to the sourceDocuments + // dictionary is protected by that lock. If this changes, locking will need to be added + // to this method to protect the sourceDocuments dictionary. [Fx.Tag.SecurityNote(Critical = "Used in generating the dynamic module.")] [SecurityCritical] - internal ISymbolDocumentWriter GetSourceDocument(string fileName, byte[] checksum, Dictionary checksumCache) + private ISymbolDocumentWriter GetSourceDocument(string fileName, byte[] checksum, Dictionary checksumCache) { ISymbolDocumentWriter documentWriter; string sourceDocKey = fileName + SymbolHelper.GetHexStringFromChecksum(checksum); diff --git a/external/referencesource/System.Activities/System/Activities/Expressions/ILocationReferenceExpression.cs b/external/referencesource/System.Activities/System/Activities/Expressions/ILocationReferenceExpression.cs index 3df5b7ca46..0eb19dffc1 100644 --- a/external/referencesource/System.Activities/System/Activities/Expressions/ILocationReferenceExpression.cs +++ b/external/referencesource/System.Activities/System/Activities/Expressions/ILocationReferenceExpression.cs @@ -10,4 +10,4 @@ namespace System.Activities.Expressions { ActivityWithResult CreateNewInstance(LocationReference locationReference); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities/System/Activities/Hosting/IWorkflowInstanceExtension.cs b/external/referencesource/System.Activities/System/Activities/Hosting/IWorkflowInstanceExtension.cs index ffd3796a53..56eacc8e45 100644 --- a/external/referencesource/System.Activities/System/Activities/Hosting/IWorkflowInstanceExtension.cs +++ b/external/referencesource/System.Activities/System/Activities/Hosting/IWorkflowInstanceExtension.cs @@ -15,4 +15,4 @@ namespace System.Activities.Hosting // called with the targe instance under WorkflowInstance.Initialize void SetInstance(WorkflowInstanceProxy instance); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities/System/Activities/Runtime/ActivityExecutor.cs.REMOVED.git-id b/external/referencesource/System.Activities/System/Activities/Runtime/ActivityExecutor.cs.REMOVED.git-id index 0e92a1ce78..d7a9162fa7 100644 --- a/external/referencesource/System.Activities/System/Activities/Runtime/ActivityExecutor.cs.REMOVED.git-id +++ b/external/referencesource/System.Activities/System/Activities/Runtime/ActivityExecutor.cs.REMOVED.git-id @@ -1 +1 @@ -1141038dd1e4ef79669d14307d12d08ad0d8d00e \ No newline at end of file +b9cf8fe7e52450ceff6d1c34154cba802c4c505e \ No newline at end of file diff --git a/external/referencesource/System.Activities/System/Activities/Tracking/ActivityStates.cs b/external/referencesource/System.Activities/System/Activities/Tracking/ActivityStates.cs index 8ff24141ac..5ec4100006 100644 --- a/external/referencesource/System.Activities/System/Activities/Tracking/ActivityStates.cs +++ b/external/referencesource/System.Activities/System/Activities/Tracking/ActivityStates.cs @@ -11,4 +11,4 @@ namespace System.Activities.Tracking public const string Executing = "Executing"; public const string Faulted = "Faulted"; } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Activities/System/Activities/Tracking/ImplementationVisibility.cs b/external/referencesource/System.Activities/System/Activities/Tracking/ImplementationVisibility.cs index df3678b39a..30b1068926 100644 --- a/external/referencesource/System.Activities/System/Activities/Tracking/ImplementationVisibility.cs +++ b/external/referencesource/System.Activities/System/Activities/Tracking/ImplementationVisibility.cs @@ -9,4 +9,4 @@ namespace System.Activities.Tracking RootScope, All } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AppContextDefaultValues.Default.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AppContextDefaultValues.Default.cs new file mode 100644 index 0000000000..118df8bde9 --- /dev/null +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AppContextDefaultValues.Default.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +namespace System +{ + using System; + using System.ComponentModel.DataAnnotations; + + internal static partial class AppContextDefaultValues + { + static partial void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version) + { + // When defining a new switch you should add it to the last known version. + // For instance, if you are adding a switch in .NET 4.6 (the release after 4.5.2) you should defined your switch + // like this: + // if (version <= 40502) ... + // This ensures that all previous versions of that platform (up-to 4.5.2) will get the old behavior by default + // NOTE: When adding a default value for a switch please make sure that the default value is added to ALL of the existing platforms! + // NOTE: When adding a new if statement for the version please ensure that ALL previous switches are enabled (ie. don't use else if) + switch (platformIdentifier) + { + case ".NETCore": + case ".NETFramework": + { + if (version <= 40600) + { + LocalAppContextSwitches.SetDefaultsLessOrEqual_46(); + } + + break; + } + } + } + } +} diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AppSettings.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AppSettings.cs new file mode 100644 index 0000000000..6ffe4ca67d --- /dev/null +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AppSettings.cs @@ -0,0 +1,52 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//------------------------------------------------------------------------------ + +// AppSettings.cs +// + +using System; +using System.Collections.Specialized; +using System.Configuration; +using System.Diagnostics.CodeAnalysis; + +namespace System.ComponentModel.DataAnnotations { + internal static class AppSettings { +#if MONO + internal static readonly bool DisableRegEx = false; +#else + private static volatile bool _settingsInitialized = false; + private static object _appSettingsLock = new object(); + private static void EnsureSettingsLoaded() { + if (!_settingsInitialized) { + lock (_appSettingsLock) { + if (!_settingsInitialized) { + NameValueCollection settings = null; + + try { + settings = ConfigurationManager.AppSettings; + } + catch (ConfigurationErrorsException) { } + finally { + if (settings == null || !Boolean.TryParse(settings["dataAnnotations:dataTypeAttribute:disableRegEx"], out _disableRegEx)) + _disableRegEx = false; + + _settingsInitialized = true; + } + } + } + } + } + + private static bool _disableRegEx; + internal static bool DisableRegEx { + get { + EnsureSettingsLoaded(); + return _disableRegEx; + } + } +#endif + } +} diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/CreditCardAttribute.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/CreditCardAttribute.cs index a67feda81d..b071cf9acd 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/CreditCardAttribute.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/CreditCardAttribute.cs @@ -9,7 +9,10 @@ public sealed class CreditCardAttribute : DataTypeAttribute { public CreditCardAttribute() : base(DataType.CreditCard) { - ErrorMessage = DataAnnotationsResources.CreditCardAttribute_Invalid; + + // DevDiv 468241: set DefaultErrorMessage not ErrorMessage, allowing user to set + // ErrorMessageResourceType and ErrorMessageResourceName to use localized messages. + DefaultErrorMessage = DataAnnotationsResources.CreditCardAttribute_Invalid; } public override bool IsValid(object value) { diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/EmailAddressAttribute.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/EmailAddressAttribute.cs index 4d667658ae..1e809619dc 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/EmailAddressAttribute.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/EmailAddressAttribute.cs @@ -8,11 +8,14 @@ // This attribute provides server-side email validation equivalent to jquery validate, // and therefore shares the same regular expression. See unit tests for examples. - private static Regex _regex = new Regex(@"^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture); + private static Regex _regex = CreateRegEx(); public EmailAddressAttribute() : base(DataType.EmailAddress) { - ErrorMessage = DataAnnotationsResources.EmailAddressAttribute_Invalid; + + // DevDiv 468241: set DefaultErrorMessage not ErrorMessage, allowing user to set + // ErrorMessageResourceType and ErrorMessageResourceName to use localized messages. + DefaultErrorMessage = DataAnnotationsResources.EmailAddressAttribute_Invalid; } public override bool IsValid(object value) { @@ -21,7 +24,51 @@ } string valueAsString = value as string; - return valueAsString != null && _regex.Match(valueAsString).Length > 0; + + // Use RegEx implementation if it has been created, otherwise use a non RegEx version. + if (_regex != null) { + return valueAsString != null && _regex.Match(valueAsString).Length > 0; + } + else { + int atCount = 0; + + foreach (char c in valueAsString) { + if (c == '@') { + atCount++; + } + } + + return (valueAsString != null + && atCount == 1 + && valueAsString[0] != '@' + && valueAsString[valueAsString.Length - 1] != '@'); + } + } + + private static Regex CreateRegEx() { + // We only need to create the RegEx if this switch is enabled. + if (AppSettings.DisableRegEx) { + return null; + } + + const string pattern = @"^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$"; + const RegexOptions options = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture; + + // Set explicit regex match timeout, sufficient enough for email parsing + // Unless the global REGEX_DEFAULT_MATCH_TIMEOUT is already set + TimeSpan matchTimeout = TimeSpan.FromSeconds(2); + + try { + if (AppDomain.CurrentDomain.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") == null) { + return new Regex(pattern, options, matchTimeout); + } + } + catch { + // Fallback on error + } + + // Legacy fallback (without explicit match timeout) + return new Regex(pattern, options); } } } diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/FileExtensionsAttribute.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/FileExtensionsAttribute.cs index 5644864486..93d9e2e151 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/FileExtensionsAttribute.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/FileExtensionsAttribute.cs @@ -14,7 +14,10 @@ namespace System.ComponentModel.DataAnnotations { public FileExtensionsAttribute() : base(DataType.Upload) { - ErrorMessage = DataAnnotationsResources.FileExtensionsAttribute_Invalid; + + // DevDiv 468241: set DefaultErrorMessage not ErrorMessage, allowing user to set + // ErrorMessageResourceType and ErrorMessageResourceName to use localized messages. + DefaultErrorMessage = DataAnnotationsResources.FileExtensionsAttribute_Invalid; } public string Extensions { diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/IValidatableObject.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/IValidatableObject.cs index 7bdca5cfa3..cbf5fe05d9 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/IValidatableObject.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/IValidatableObject.cs @@ -8,4 +8,4 @@ namespace System.ComponentModel.DataAnnotations { IEnumerable Validate(ValidationContext validationContext); } } -#endif +#endif \ No newline at end of file diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/LocalAppContextSwitches.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/LocalAppContextSwitches.cs new file mode 100644 index 0000000000..20b80cfdef --- /dev/null +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/LocalAppContextSwitches.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +namespace System.ComponentModel.DataAnnotations { + using System; + using System.Runtime.CompilerServices; + + // When adding a quirk, name it such that false is new behavior and true is old behavior. + // You are opting IN to old behavior. The new behavior is default. + // For example, we don't want to use legacy regex timeout for RegularExpressionAttribute in 4.6.1+. + // So we set UseLegacyRegExTimeout to true if running 4.6 or less. + internal static class LocalAppContextSwitches { + private const string UseLegacyRegExTimeoutString = "Switch.System.ComponentModel.DataAnnotations.RegularExpressionAttribute.UseLegacyRegExTimeout"; + private static int useLegacyRegExTimeout; + + public static bool UseLegacyRegExTimeout { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { + return LocalAppContext.GetCachedSwitchValue(UseLegacyRegExTimeoutString, ref useLegacyRegExTimeout); + } + } + + public static void SetDefaultsLessOrEqual_46() { + // Define the switches that should be true for 4.6 or less, false for 4.6.1+. + LocalAppContext.DefineSwitchDefault(UseLegacyRegExTimeoutString, true); + } + } +} diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/PhoneAttribute.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/PhoneAttribute.cs index 926a1f58ea..597862d7b2 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/PhoneAttribute.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/PhoneAttribute.cs @@ -6,11 +6,15 @@ [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] public sealed class PhoneAttribute : DataTypeAttribute { // see unit tests for examples - private static Regex _regex = new Regex(@"^(\+\s?)?((? 0; + + // Use RegEx implementation if it has been created, otherwise use a non RegEx version. + if (_regex != null) { + return valueAsString != null && _regex.Match(valueAsString).Length > 0; + } + else { + if (valueAsString == null) { + return false; + } + + valueAsString = valueAsString.Replace("+", string.Empty).TrimEnd(); + valueAsString = RemoveExtension(valueAsString); + + bool digitFound = false; + foreach (char c in valueAsString) { + if (Char.IsDigit(c)) { + digitFound = true; + break; + } + } + + if (!digitFound) { + return false; + } + + foreach (char c in valueAsString) + { + if (!(Char.IsDigit(c) + || Char.IsWhiteSpace(c) + || _additionalPhoneNumberCharacters.IndexOf(c) != -1)) { + return false; + } + } + return true; + } + } + + private static Regex CreateRegEx() { + // We only need to create the RegEx if this switch is enabled. + if (AppSettings.DisableRegEx) { + return null; + } + + const string pattern = @"^(\+\s?)?((?= 0) { + string extension = potentialPhoneNumber.Substring(lastIndexOfExtension + 4); + if (MatchesExtension(extension)) { + return potentialPhoneNumber.Substring(0, lastIndexOfExtension); + } + } + + lastIndexOfExtension = potentialPhoneNumber + .LastIndexOf("ext", StringComparison.InvariantCultureIgnoreCase); + if (lastIndexOfExtension >= 0) { + string extension = potentialPhoneNumber.Substring(lastIndexOfExtension + 3); + if (MatchesExtension(extension)) { + return potentialPhoneNumber.Substring(0, lastIndexOfExtension); + } + } + + + lastIndexOfExtension = potentialPhoneNumber + .LastIndexOf("x", StringComparison.InvariantCultureIgnoreCase); + if (lastIndexOfExtension >= 0) { + string extension = potentialPhoneNumber.Substring(lastIndexOfExtension + 1); + if (MatchesExtension(extension)) { + return potentialPhoneNumber.Substring(0, lastIndexOfExtension); + } + } + + return potentialPhoneNumber; + } + + private static bool MatchesExtension(string potentialExtension) { + potentialExtension = potentialExtension.TrimStart(); + if (potentialExtension.Length == 0) { + return false; + } + + foreach (char c in potentialExtension) { + if (!Char.IsDigit(c)) { + return false; + } + } + + return true; } } } diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/RegularExpressionAttribute.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/RegularExpressionAttribute.cs index 482df85520..cd4ac2683e 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/RegularExpressionAttribute.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/RegularExpressionAttribute.cs @@ -1,4 +1,4 @@ -using System.ComponentModel.DataAnnotations.Resources; +using System.ComponentModel.DataAnnotations.Resources; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Text.RegularExpressions; @@ -15,6 +15,12 @@ namespace System.ComponentModel.DataAnnotations { /// public string Pattern { get; private set; } + /// + /// Gets or sets the timeout to use when matching the regular expression pattern (in milliseconds) + /// (-1 means never timeout). + /// + public int MatchTimeoutInMilliseconds { get; set; } = GetDefaultTimeout(); + private Regex Regex { get; set; } /// @@ -77,13 +83,33 @@ namespace System.ComponentModel.DataAnnotations { /// /// is thrown if the current cannot be parsed /// is thrown if the current attribute is ill-formed. + /// thrown if is negative (except -1), + /// zero or greater than approximately 24 days private void SetupRegex() { if (this.Regex == null) { if (string.IsNullOrEmpty(this.Pattern)) { throw new InvalidOperationException(DataAnnotationsResources.RegularExpressionAttribute_Empty_Pattern); } - this.Regex = new Regex(this.Pattern); + Regex = MatchTimeoutInMilliseconds == -1 + ? new Regex(Pattern) + : Regex = new Regex(Pattern, default(RegexOptions), TimeSpan.FromMilliseconds((double)MatchTimeoutInMilliseconds)); } } + + /// + /// Returns the default MatchTimeout based on UseLegacyRegExTimeout switch. + /// + private static int GetDefaultTimeout() { +#if !MONO + if (LocalAppContextSwitches.UseLegacyRegExTimeout) { + return -1; + } + else +#endif + { + return 2000; + } + + } } } diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/ComplexTypeAttribute.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/ComplexTypeAttribute.cs index e2063b1c75..a1ab21924d 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/ComplexTypeAttribute.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/ComplexTypeAttribute.cs @@ -10,4 +10,4 @@ namespace System.ComponentModel.DataAnnotations.Schema { [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes", Justification = "We want users to be able to extend this class")] public class ComplexTypeAttribute : Attribute { } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/DatabaseGeneratedOption.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/DatabaseGeneratedOption.cs index ec47f9afbb..7e6df60e33 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/DatabaseGeneratedOption.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/DatabaseGeneratedOption.cs @@ -18,4 +18,4 @@ namespace System.ComponentModel.DataAnnotations.Schema { /// Computed } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/NotMappedAttribute.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/NotMappedAttribute.cs index 1463ed7371..2127d5eeb9 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/NotMappedAttribute.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/NotMappedAttribute.cs @@ -8,4 +8,4 @@ namespace System.ComponentModel.DataAnnotations.Schema { [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes", Justification = "We want users to be able to extend this class")] public class NotMappedAttribute : Attribute { } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/UrlAttribute.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/UrlAttribute.cs index e8f5376ddf..a6e0610428 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/UrlAttribute.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/UrlAttribute.cs @@ -8,11 +8,14 @@ // This attribute provides server-side url validation equivalent to jquery validate, // and therefore shares the same regular expression. See unit tests for examples. - private static Regex _regex = new Regex(@"^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture); + private static Regex _regex = CreateRegEx(); public UrlAttribute() : base(DataType.Url) { - ErrorMessage = DataAnnotationsResources.UrlAttribute_Invalid; + + // DevDiv 468241: set DefaultErrorMessage not ErrorMessage, allowing user to set + // ErrorMessageResourceType and ErrorMessageResourceName to use localized messages. + DefaultErrorMessage = DataAnnotationsResources.UrlAttribute_Invalid; } public override bool IsValid(object value) { @@ -21,7 +24,44 @@ } string valueAsString = value as string; - return valueAsString != null && _regex.Match(valueAsString).Length > 0; + + // Use RegEx implementation if it has been created, otherwise use a non RegEx version. + if (_regex != null) { + return valueAsString != null && _regex.Match(valueAsString).Length > 0; + } + else { + return valueAsString != null && + (valueAsString.StartsWith("http://", StringComparison.InvariantCultureIgnoreCase) + || valueAsString.StartsWith("https://", StringComparison.InvariantCultureIgnoreCase) + || valueAsString.StartsWith("ftp://", StringComparison.InvariantCultureIgnoreCase)); + } + } + + private static Regex CreateRegEx() { + // We only need to create the RegEx if this switch is enabled. + if (AppSettings.DisableRegEx) { + return null; + } + + const string pattern = @"^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$"; + + const RegexOptions options = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture; + + // Set explicit regex match timeout, sufficient enough for url parsing + // Unless the global REGEX_DEFAULT_MATCH_TIMEOUT is already set + TimeSpan matchTimeout = TimeSpan.FromSeconds(2); + + try { + if (AppDomain.CurrentDomain.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") == null) { + return new Regex(pattern, options, matchTimeout); + } + } + catch { + // Fallback on error + } + + // Legacy fallback (without explicit match timeout) + return new Regex(pattern, options); } } } diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationAttribute.cs b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationAttribute.cs index 8e3727e399..a8d7d4d05f 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationAttribute.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationAttribute.cs @@ -21,8 +21,9 @@ namespace System.ComponentModel.DataAnnotations { private Func _errorMessageResourceAccessor; private string _errorMessageResourceName; private Type _errorMessageResourceType; - private bool _isCallingOverload; - private object _syncLock = new object(); + private string _defaultErrorMessage; + + private volatile bool _hasBaseIsValid; #endregion @@ -60,6 +61,31 @@ namespace System.ComponentModel.DataAnnotations { #endregion + #region Internal Properties + /// + /// Gets or sets and the default error message string. + /// This message will be used if the user has not set + /// or the and pair. + /// This property was added after the public contract for DataAnnotations was created. + /// It was added to fix DevDiv issue 468241. + /// It is internal to avoid changing the DataAnnotations contract. + /// + internal string DefaultErrorMessage + { + get + { + return this._defaultErrorMessage; + } + set + { + this._defaultErrorMessage = value; + this._errorMessageResourceAccessor = null; + this.CustomErrorMessageSet = true; + } + } + + #endregion + #region Protected Properties /// @@ -75,7 +101,7 @@ namespace System.ComponentModel.DataAnnotations { /// /// A flag indicating whether a developer has customized the attribute's error message by setting any one of - /// ErrorMessage, ErrorMessageResourceName, or ErrorMessageResourceType. + /// ErrorMessage, ErrorMessageResourceName, ErrorMessageResourceType or DefaultErrorMessage. /// internal bool CustomErrorMessageSet { get; @@ -105,12 +131,23 @@ namespace System.ComponentModel.DataAnnotations { /// public string ErrorMessage { get { - return this._errorMessage; + // DevDiv: 468241 + // If _errorMessage is not set, return the default. This is done to preserve + // behavior prior to the fix where ErrorMessage showed the non-null message to use. + return this._errorMessage ?? this._defaultErrorMessage; } set { this._errorMessage = value; this._errorMessageResourceAccessor = null; this.CustomErrorMessageSet = true; + + // DevDiv: 468241 + // Explicitly setting ErrorMessage also sets DefaultErrorMessage if null. + // This prevents subsequent read of ErrorMessage from returning default. + if (value == null) + { + this._defaultErrorMessage = null; + } } } @@ -163,14 +200,16 @@ namespace System.ComponentModel.DataAnnotations { /// is thrown if the current attribute is malformed. private void SetupResourceAccessor() { if (this._errorMessageResourceAccessor == null) { - string localErrorMessage = this._errorMessage; + string localErrorMessage = this.ErrorMessage; bool resourceNameSet = !string.IsNullOrEmpty(this._errorMessageResourceName); - bool errorMessageSet = !string.IsNullOrEmpty(localErrorMessage); + bool errorMessageSet = !string.IsNullOrEmpty(this._errorMessage); bool resourceTypeSet = this._errorMessageResourceType != null; + bool defaultMessageSet = !string.IsNullOrEmpty(this._defaultErrorMessage); - // Either ErrorMessageResourceName or ErrorMessage may be set, but not both. - // The following test checks both being set as well as both being not set. - if (resourceNameSet == errorMessageSet) { + // The following combinations are illegal and throw InvalidOperationException: + // 1) Both ErrorMessage and ErrorMessageResourceName are set, or + // 2) None of ErrorMessage, ErrorMessageReourceName, and DefaultErrorMessage are set. + if ((resourceNameSet && errorMessageSet) || !(resourceNameSet || errorMessageSet || defaultMessageSet)) { throw new InvalidOperationException(DataAnnotationsResources.ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource); } @@ -281,20 +320,14 @@ namespace System.ComponentModel.DataAnnotations { #else internal #endif - virtual bool IsValid(object value) { - lock (this._syncLock) { - if (this._isCallingOverload) { - throw new NotImplementedException(DataAnnotationsResources.ValidationAttribute_IsValid_NotImplemented); - } else { - this._isCallingOverload = true; - - try { - return this.IsValid(value, null) == null; - } finally { - this._isCallingOverload = false; - } - } + virtual bool IsValid(object value) { + if(!this._hasBaseIsValid) { + // track that this method overload has not been overridden. + this._hasBaseIsValid = true; } + + // call overridden method. + return this.IsValid(value, null) == null; } #if !SILVERLIGHT @@ -336,25 +369,20 @@ namespace System.ComponentModel.DataAnnotations { /// #endif protected virtual ValidationResult IsValid(object value, ValidationContext validationContext) { - lock (this._syncLock) { - if (this._isCallingOverload) { - throw new NotImplementedException(DataAnnotationsResources.ValidationAttribute_IsValid_NotImplemented); - } else { - this._isCallingOverload = true; + if (this._hasBaseIsValid) { + // this means neither of the IsValid methods has been overriden, throw. + throw new NotImplementedException(DataAnnotationsResources.ValidationAttribute_IsValid_NotImplemented); + } + + ValidationResult result = ValidationResult.Success; - try { - ValidationResult result = ValidationResult.Success; - - if (!this.IsValid(value)) { - string[] memberNames = validationContext.MemberName != null ? new string[] { validationContext.MemberName } : null; - result = new ValidationResult(this.FormatErrorMessage(validationContext.DisplayName), memberNames); - } - return result; - } finally { - this._isCallingOverload = false; - } - } + // call overridden method. + if (!this.IsValid(value)) { + string[] memberNames = validationContext.MemberName != null ? new string[] { validationContext.MemberName } : null; + result = new ValidationResult(this.FormatErrorMessage(validationContext.DisplayName), memberNames); } + + return result; } /// diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/InternalApis/Clr/inc/AppContextDefaultValues.cs b/external/referencesource/System.ComponentModel.DataAnnotations/InternalApis/Clr/inc/AppContextDefaultValues.cs new file mode 100644 index 0000000000..8a130a0f34 --- /dev/null +++ b/external/referencesource/System.ComponentModel.DataAnnotations/InternalApis/Clr/inc/AppContextDefaultValues.cs @@ -0,0 +1,169 @@ +// ==++== +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// ==--== +using System; +using System.Collections.Generic; + +namespace System +{ + internal static partial class AppContextDefaultValues + { + public static void PopulateDefaultValues() + { + string platformIdentifier, profile; + int version; + + ParseTargetFrameworkName(out platformIdentifier, out profile, out version); + + // Call into each library to populate their default switches + PopulateDefaultValuesPartial(platformIdentifier, profile, version); + } + + /// + /// We have this separate method for getting the parsed elements out of the TargetFrameworkName so we can + /// more easily support this on other platforms. + /// + private static void ParseTargetFrameworkName(out string identifier, out string profile, out int version) + { + string targetFrameworkMoniker = AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName; + + // If we don't have a TFM then we should default to the 4.0 behavior where all quirks are turned on. + if (!TryParseFrameworkName(targetFrameworkMoniker, out identifier, out version, out profile)) + { +#if FEATURE_CORECLR + if (CompatibilitySwitches.UseLatestBehaviorWhenTFMNotSpecified) + { + // If we want to use the latest behavior it is enough to set the value of the switch to string.Empty. + // When the get to the caller of this method (PopulateDefaultValuesPartial) we are going to use the + // identifier we just set to decide which switches to turn on. By having an empty string as the + // identifier we are simply saying -- don't turn on any switches, and we are going to get the latest + // behavior for all the switches + identifier = string.Empty; + } + else +#endif + { + identifier = ".NETFramework"; + version = 40000; + profile = string.Empty; + } + } + } + + // This code was a constructor copied from the FrameworkName class, which is located in System.dll. + // Parses strings in the following format: ", Version=[v|V], Profile=" + // - The identifier and version is required, profile is optional + // - Only three components are allowed. + // - The version string must be in the System.Version format; an optional "v" or "V" prefix is allowed + private static bool TryParseFrameworkName(String frameworkName, out String identifier, out int version, out String profile) + { + // For parsing a target Framework moniker, from the FrameworkName class + const char c_componentSeparator = ','; + const char c_keyValueSeparator = '='; + const char c_versionValuePrefix = 'v'; + const String c_versionKey = "Version"; + const String c_profileKey = "Profile"; + + identifier = profile = string.Empty; + version = 0; + + if (frameworkName == null || frameworkName.Length == 0) + { + return false; + } + + String[] components = frameworkName.Split(c_componentSeparator); + version = 0; + + // Identifer and Version are required, Profile is optional. + if (components.Length < 2 || components.Length > 3) + { + return false; + } + + // + // 1) Parse the "Identifier", which must come first. Trim any whitespace + // + identifier = components[0].Trim(); + + if (identifier.Length == 0) + { + return false; + } + + bool versionFound = false; + profile = null; + + // + // The required "Version" and optional "Profile" component can be in any order + // + for (int i = 1; i < components.Length; i++) + { + // Get the key/value pair separated by '=' + string[] keyValuePair = components[i].Split(c_keyValueSeparator); + + if (keyValuePair.Length != 2) + { + return false; + } + + // Get the key and value, trimming any whitespace + string key = keyValuePair[0].Trim(); + string value = keyValuePair[1].Trim(); + + // + // 2) Parse the required "Version" key value + // + if (key.Equals(c_versionKey, StringComparison.OrdinalIgnoreCase)) + { + versionFound = true; + + // Allow the version to include a 'v' or 'V' prefix... + if (value.Length > 0 && (value[0] == c_versionValuePrefix || value[0] == 'V')) + { + value = value.Substring(1); + } + Version realVersion = new Version(value); + // The version class will represent some unset values as -1 internally (instead of 0). + version = realVersion.Major * 10000; + if (realVersion.Minor > 0) + version += realVersion.Minor * 100; + if (realVersion.Build > 0) + version += realVersion.Build; + } + // + // 3) Parse the optional "Profile" key value + // + else if (key.Equals(c_profileKey, StringComparison.OrdinalIgnoreCase)) + { + if (!String.IsNullOrEmpty(value)) + { + profile = value; + } + } + else + { + return false; + } + } + + if (!versionFound) + { + return false; + } + + return true; + } + + // This is a partial method. Platforms (such as Desktop) can provide an implementation of it that will read override value + // from whatever mechanism is available on that platform. If no implementation is provided, the compiler is going to remove the calls + // to it from the code + static partial void TryGetSwitchOverridePartial(string switchName, ref bool overrideFound, ref bool overrideValue); + + /// This is a partial method. This method is responsible for populating the default values based on a TFM. + /// It is partial because each library should define this method in their code to contain their defaults. + static partial void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version); + } +} diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/InternalApis/Clr/inc/LocalAppContext.cs b/external/referencesource/System.ComponentModel.DataAnnotations/InternalApis/Clr/inc/LocalAppContext.cs new file mode 100644 index 0000000000..f05b599ed3 --- /dev/null +++ b/external/referencesource/System.ComponentModel.DataAnnotations/InternalApis/Clr/inc/LocalAppContext.cs @@ -0,0 +1,128 @@ +// ==++== +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// ==--== + +// NOTE: This file should not be included in mscorlib. This should only be included in FX libraries that need to provide switches +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Threading; + +namespace System +{ + internal static partial class LocalAppContext + { + private delegate bool TryGetSwitchDelegate(string switchName, out bool value); + + private static TryGetSwitchDelegate TryGetSwitchFromCentralAppContext; + private static bool s_canForwardCalls; + + private static Dictionary s_switchMap = new Dictionary(); + private static readonly object s_syncLock = new object(); + + private static bool DisableCaching { get; set; } + + static LocalAppContext() + { + // Try to setup the callback into the central AppContext + s_canForwardCalls = SetupDelegate(); + + // Populate the default values of the local app context + AppContextDefaultValues.PopulateDefaultValues(); + + // Cache the value of the switch that help with testing + DisableCaching = IsSwitchEnabled(@"TestSwitch.LocalAppContext.DisableCaching"); + } + + public static bool IsSwitchEnabled(string switchName) + { + if (s_canForwardCalls) + { + bool isEnabledCentrally; + if (TryGetSwitchFromCentralAppContext(switchName, out isEnabledCentrally)) + { + // we found the switch, so return whatever value it has + return isEnabledCentrally; + } + // if we could not get the value from the central authority, try the local storage. + } + + return IsSwitchEnabledLocal(switchName); + } + + private static bool IsSwitchEnabledLocal(string switchName) + { + // read the value from the set of local defaults + bool isEnabled, isPresent; + lock (s_switchMap) + { + isPresent = s_switchMap.TryGetValue(switchName, out isEnabled); + } + + // If the value is in the set of local switches, reutrn the value + if (isPresent) + { + return isEnabled; + } + + // if we could not find the switch name, we should return 'false' + // This will preserve the concept of switches been 'off' unless explicitly set to 'on' + return false; + } + + private static bool SetupDelegate() + { + Type appContextType = typeof(object).Assembly.GetType("System.AppContext"); + if (appContextType == null) + return false; + + MethodInfo method = appContextType.GetMethod( + "TryGetSwitch", // the method name + BindingFlags.Static | BindingFlags.Public, // binding flags + null, // use the default binder + new Type[] { typeof(string), typeof(bool).MakeByRefType() }, + null); // parameterModifiers - this is ignored by the default binder + if (method == null) + return false; + + // Create delegate if we found the method. + TryGetSwitchFromCentralAppContext = (TryGetSwitchDelegate)Delegate.CreateDelegate(typeof(TryGetSwitchDelegate), method); + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static bool GetCachedSwitchValue(string switchName, ref int switchValue) + { + if (switchValue < 0) return false; + if (switchValue > 0) return true; + + return GetCachedSwitchValueInternal(switchName, ref switchValue); + } + + private static bool GetCachedSwitchValueInternal(string switchName, ref int switchValue) + { + if (LocalAppContext.DisableCaching) + { + return LocalAppContext.IsSwitchEnabled(switchName); + } + + bool isEnabled = LocalAppContext.IsSwitchEnabled(switchName); + switchValue = isEnabled ? 1 /*true*/ : -1 /*false*/; + return isEnabled; + } + + /// + /// This method is going to be called from the AppContextDefaultValues class when setting up the + /// default values for the switches. !!!! This method is called during the static constructor so it does not + /// take a lock !!!! If you are planning to use this outside of that, please ensure proper locking. + /// + internal static void DefineSwitchDefault(string switchName, bool initialValue) + { + s_switchMap[switchName] = initialValue; + } + } +} diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/Properties/AssemblyInfo.cs b/external/referencesource/System.ComponentModel.DataAnnotations/Properties/AssemblyInfo.cs index fcd6198cd5..ecf6158fe5 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/Properties/AssemblyInfo.cs +++ b/external/referencesource/System.ComponentModel.DataAnnotations/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ using System.Security; [assembly: CLSCompliant(true)] [assembly: AssemblyVersion("99.0.0.0")] [assembly: NeutralResourcesLanguage("en-US")] -#endif +#endif \ No newline at end of file diff --git a/external/referencesource/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.txt b/external/referencesource/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.txt index 48b500d603..eabcd33cce 100644 --- a/external/referencesource/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.txt +++ b/external/referencesource/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.txt @@ -18,3 +18,6 @@ ArgumentIsNullOrWhitespace=The argument '{0}' cannot be null, empty or contain o RequiredAttribute_ValidationError=The {0} field is required. CompareAttribute_MustMatch='{0}' and '{1}' do not match. + +RegexAttribute_ValidationError=The field {0} must match the regular expression '{1}'. + diff --git a/external/referencesource/System.Configuration/System/Configuration/DateTimeConfigurationCollection.cs b/external/referencesource/System.Configuration/System/Configuration/DateTimeConfigurationCollection.cs index 14a4f5253f..1fd7e32bbf 100644 --- a/external/referencesource/System.Configuration/System/Configuration/DateTimeConfigurationCollection.cs +++ b/external/referencesource/System.Configuration/System/Configuration/DateTimeConfigurationCollection.cs @@ -89,4 +89,4 @@ namespace System.Configuration { } } } -#endif +#endif \ No newline at end of file diff --git a/external/referencesource/System.Configuration/System/Configuration/DateTimeConfigurationElement.cs b/external/referencesource/System.Configuration/System/Configuration/DateTimeConfigurationElement.cs index 666cb52e96..3e4b0d5142 100644 --- a/external/referencesource/System.Configuration/System/Configuration/DateTimeConfigurationElement.cs +++ b/external/referencesource/System.Configuration/System/Configuration/DateTimeConfigurationElement.cs @@ -82,4 +82,4 @@ namespace System.Configuration { } } } -#endif +#endif \ No newline at end of file diff --git a/external/referencesource/System.Configuration/System/Configuration/FipsAwareEncryptedXml.cs b/external/referencesource/System.Configuration/System/Configuration/FipsAwareEncryptedXml.cs new file mode 100644 index 0000000000..ce7a3a24c3 --- /dev/null +++ b/external/referencesource/System.Configuration/System/Configuration/FipsAwareEncryptedXml.cs @@ -0,0 +1,75 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//------------------------------------------------------------------------------ + +namespace System.Configuration { + using System.Collections; + using System.Security.Cryptography; + using System.Security.Cryptography.Xml; + using System.Xml; + + // + // Extends EncryptedXml to use FIPS-certified symmetric algorithm + // + class FipsAwareEncryptedXml : EncryptedXml { + + public FipsAwareEncryptedXml(XmlDocument doc) + : base(doc) { + } + + // Override EncryptedXml.GetDecryptionKey to avoid calling into CryptoConfig.CreateFromName + // When detect AES, we need to return AesCryptoServiceProvider (FIPS certified) instead of AesManaged (FIPS obsolated) + public override SymmetricAlgorithm GetDecryptionKey(EncryptedData encryptedData, string symmetricAlgorithmUri) { + + // If AES is used then assume FIPS is required + bool fipsRequired = IsAesDetected(encryptedData, symmetricAlgorithmUri); + + if (fipsRequired) { + // Obtain the EncryptedKey + EncryptedKey ek = null; + + foreach (var ki in encryptedData.KeyInfo) { + KeyInfoEncryptedKey kiEncKey = ki as KeyInfoEncryptedKey; + if (kiEncKey != null) { + ek = kiEncKey.EncryptedKey; + break; + } + } + + // Got an EncryptedKey, decrypt it to get the AES key + if (ek != null) { + byte[] key = DecryptEncryptedKey(ek); + + // Construct FIPS-certified AES provider + if (key != null) { + AesCryptoServiceProvider aes = new AesCryptoServiceProvider(); + aes.Key = key; + + return aes; + } + } + } + + // Fallback to the base implementation + return base.GetDecryptionKey(encryptedData, symmetricAlgorithmUri); + } + + private static bool IsAesDetected(EncryptedData encryptedData, string symmetricAlgorithmUri) { + if (encryptedData != null && + encryptedData.KeyInfo != null && + (symmetricAlgorithmUri != null || encryptedData.EncryptionMethod != null)) { + + if (symmetricAlgorithmUri == null) { + symmetricAlgorithmUri = encryptedData.EncryptionMethod.KeyAlgorithm; + } + + // Check if the Uri matches AES256 + return string.Equals(symmetricAlgorithmUri, EncryptedXml.XmlEncAES256Url, StringComparison.InvariantCultureIgnoreCase); + } + + return false; + } + } +} diff --git a/external/referencesource/System.Configuration/System/Configuration/RSAProtectedConfigurationProvider.cs b/external/referencesource/System.Configuration/System/Configuration/RSAProtectedConfigurationProvider.cs index 5f3d6a67cf..33fd93ca89 100644 --- a/external/referencesource/System.Configuration/System/Configuration/RSAProtectedConfigurationProvider.cs +++ b/external/referencesource/System.Configuration/System/Configuration/RSAProtectedConfigurationProvider.cs @@ -32,7 +32,7 @@ namespace System.Configuration xmlDocument.PreserveWhitespace = true; xmlDocument.LoadXml(encryptedNode.OuterXml); - exml = new EncryptedXml(xmlDocument); + exml = new FipsAwareEncryptedXml(xmlDocument); exml.AddKeyNameMapping(_KeyName, rsa); exml.DecryptDocument(); rsa.Clear(); @@ -46,13 +46,11 @@ namespace System.Configuration byte[] rgbOutput; EncryptedData ed; KeyInfoName kin; - SymmetricAlgorithm symAlg; EncryptedKey ek; KeyInfoEncryptedKey kek; XmlElement inputElement; RSACryptoServiceProvider rsa = GetCryptoServiceProvider(false, false); - // Encrypt the node with the new key xmlDocument = new XmlDocument(); xmlDocument.PreserveWhitespace = true; @@ -60,23 +58,20 @@ namespace System.Configuration exml = new EncryptedXml(xmlDocument); inputElement = xmlDocument.DocumentElement; - // Create a new 3DES key - symAlg = new TripleDESCryptoServiceProvider(); - byte[] rgbKey1 = GetRandomKey(); - symAlg.Key = rgbKey1; - symAlg.Mode = CipherMode.ECB; - symAlg.Padding = PaddingMode.PKCS7; - rgbOutput = exml.EncryptData(inputElement, symAlg, true); - ed = new EncryptedData(); - ed.Type = EncryptedXml.XmlEncElementUrl; - ed.EncryptionMethod = new EncryptionMethod(EncryptedXml.XmlEncTripleDESUrl); - ed.KeyInfo = new KeyInfo(); + using (SymmetricAlgorithm symAlg = GetSymAlgorithmProvider()) { + rgbOutput = exml.EncryptData(inputElement, symAlg, true); + ed = new EncryptedData(); + ed.Type = EncryptedXml.XmlEncElementUrl; + ed.EncryptionMethod = GetSymEncryptionMethod(); + ed.KeyInfo = new KeyInfo(); + + ek = new EncryptedKey(); + ek.EncryptionMethod = new EncryptionMethod(EncryptedXml.XmlEncRSA15Url); + ek.KeyInfo = new KeyInfo(); + ek.CipherData = new CipherData(); + ek.CipherData.CipherValue = EncryptedXml.EncryptKey(symAlg.Key, rsa, UseOAEP); + } - ek = new EncryptedKey(); - ek.EncryptionMethod = new EncryptionMethod(EncryptedXml.XmlEncRSA15Url); - ek.KeyInfo = new KeyInfo(); - ek.CipherData = new CipherData(); - ek.CipherData.CipherValue = EncryptedXml.EncryptKey(symAlg.Key, rsa, UseOAEP); kin = new KeyInfoName(); kin.Value = _KeyName; ek.KeyInfo.AddClause(kin); @@ -85,6 +80,9 @@ namespace System.Configuration ed.CipherData = new CipherData(); ed.CipherData.CipherValue = rgbOutput; EncryptedXml.ReplaceElement(inputElement, ed, true); + + rsa.Clear(); + // Get node from the document foreach (XmlNode node2 in xmlDocument.ChildNodes) if (node2.NodeType == XmlNodeType.Element) @@ -129,6 +127,8 @@ namespace System.Configuration public string CspProviderName { get { return _CspProviderName; } } public bool UseMachineContainer { get { return _UseMachineContainer; } } public bool UseOAEP { get { return _UseOAEP; } } + public bool UseFIPS { get { return _UseFIPS; } } + public override void Initialize(string name, NameValueCollection configurationValues) { base.Initialize(name, configurationValues); @@ -143,6 +143,7 @@ namespace System.Configuration configurationValues.Remove("cspProviderName"); _UseMachineContainer = GetBooleanValue(configurationValues, "useMachineContainer", true); _UseOAEP = GetBooleanValue(configurationValues, "useOAEP", false); + _UseFIPS = GetBooleanValue(configurationValues, "useFIPS", false); if (configurationValues.Count > 0) throw new ConfigurationErrorsException(SR.GetString(SR.Unrecognized_initialization_value, configurationValues.GetKey(0))); } @@ -153,6 +154,7 @@ namespace System.Configuration private string _CspProviderName; private bool _UseMachineContainer; private bool _UseOAEP; + private bool _UseFIPS; public RSAParameters RsaPublicKey { get { return GetCryptoServiceProvider(false, false).ExportParameters(false); } } @@ -234,5 +236,30 @@ namespace System.Configuration return false; throw new ConfigurationErrorsException(SR.GetString(SR.Config_invalid_boolean_attribute, valueName)); } + + private SymmetricAlgorithm GetSymAlgorithmProvider() { + SymmetricAlgorithm symAlg; + + if (UseFIPS) { + // AesCryptoServiceProvider implementation is FIPS certified + symAlg = new AesCryptoServiceProvider(); + } + else { + // Use the 3DES. FIPS obsolated 3DES + symAlg = new TripleDESCryptoServiceProvider(); + + byte[] rgbKey1 = GetRandomKey(); + symAlg.Key = rgbKey1; + symAlg.Mode = CipherMode.ECB; + symAlg.Padding = PaddingMode.PKCS7; + } + + return symAlg; + } + + private EncryptionMethod GetSymEncryptionMethod() { + return UseFIPS ? new EncryptionMethod(EncryptedXml.XmlEncAES256Url) : + new EncryptionMethod(EncryptedXml.XmlEncTripleDESUrl); + } } } diff --git a/external/referencesource/System.Configuration/System/Configuration/TypeUtil.cs b/external/referencesource/System.Configuration/System/Configuration/TypeUtil.cs index ce654da390..14af70f017 100644 --- a/external/referencesource/System.Configuration/System/Configuration/TypeUtil.cs +++ b/external/referencesource/System.Configuration/System/Configuration/TypeUtil.cs @@ -135,6 +135,7 @@ namespace System.Configuration { ilGen.Emit(OpCodes.Ldarg_0); // stack = { type } ilGen.Emit(OpCodes.Ldc_I4_1); // stack = { type, TRUE } ilGen.Emit(OpCodes.Call, typeof(Activator).GetMethod("CreateInstance", new Type[] { typeof(Type), typeof(bool) })); // stack = { retVal } + PreventTailCall(ilGen); // stack = { retVal } ilGen.Emit(OpCodes.Ret); var createInstanceDel = (Func)dm.CreateDelegate(typeof(Func)); return createInstanceDel(targetType); @@ -163,6 +164,7 @@ namespace System.Configuration { ilGen.Emit(OpCodes.Ldarg_0); // stack = { type } ilGen.Emit(OpCodes.Ldarg_1); // stack = { type, method } ilGen.Emit(OpCodes.Call, typeof(Delegate).GetMethod("CreateDelegate", new Type[] { typeof(Type), typeof(MethodInfo) })); // stack = { retVal } + PreventTailCall(ilGen); // stack = { retVal } ilGen.Emit(OpCodes.Ret); var createDelegateDel = (Func)dm.CreateDelegate(typeof(Func)); return createDelegateDel(delegateType, targetMethod); @@ -188,6 +190,17 @@ namespace System.Configuration { return new DynamicMethod("temp-dynamic-method", returnType, parameterTypes, owner); } + // DevDiv #736562: If a dynamic method tail-calls into Activator.CreateInstance or Delegate.CreateDelegate, it could + // modify stack frames in such a way that a stack walk fails when it should have succeeded. A volatile field read + // prevents reordering so ensures that the dynamic method cannot tail-call into these methods. + // + // Stack transitional behavior: unchanged. + private static void PreventTailCall(ILGenerator ilGen) { + ilGen.Emit(OpCodes.Volatile); + ilGen.Emit(OpCodes.Ldsfld, typeof(String).GetField("Empty")); + ilGen.Emit(OpCodes.Pop); + } + static internal ConstructorInfo GetConstructorWithReflectionPermission(Type type, Type baseType, bool throwOnError) { type = VerifyAssignableType(baseType, type, throwOnError); if (type == null) { diff --git a/external/referencesource/System.Core/BaselineExcludes.lst.cs.REMOVED.git-id b/external/referencesource/System.Core/BaselineExcludes.lst.cs.REMOVED.git-id index b1da805788..da96e24f63 100644 --- a/external/referencesource/System.Core/BaselineExcludes.lst.cs.REMOVED.git-id +++ b/external/referencesource/System.Core/BaselineExcludes.lst.cs.REMOVED.git-id @@ -1 +1 @@ -9b6cda1ef2f0ec69ddb4c682a32759face091e09 \ No newline at end of file +7e654aca3fad1551411b85be6048831bb7603646 \ No newline at end of file diff --git a/external/referencesource/System.Core/Microsoft/Scripting/Ast/DynamicExpression.cs b/external/referencesource/System.Core/Microsoft/Scripting/Ast/DynamicExpression.cs index c7bf9036a3..361d7eeda7 100644 --- a/external/referencesource/System.Core/Microsoft/Scripting/Ast/DynamicExpression.cs +++ b/external/referencesource/System.Core/Microsoft/Scripting/Ast/DynamicExpression.cs @@ -38,7 +38,8 @@ namespace System.Linq.Expressions { #if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.DynamicExpressionProxy))] #endif - public class DynamicExpression : Expression, IArgumentProvider { + public class DynamicExpression : Expression, IDynamicExpression + { private readonly CallSiteBinder _binder; private readonly Type _delegateType; @@ -413,6 +414,16 @@ namespace System.Linq.Expressions { } #endif // !SILVERLIGHT || FEATURE_NETCORE #endregion + + Expression IDynamicExpression.Rewrite(Expression[] args) + { + return this.Rewrite(args); + } + + object IDynamicExpression.CreateCallSite() + { + return CallSite.Create(this.DelegateType, this.Binder); + } } #region Specialized Subclasses diff --git a/external/referencesource/System.Core/Microsoft/Scripting/Ast/IArgumentProvider.cs b/external/referencesource/System.Core/Microsoft/Scripting/Ast/IArgumentProvider.cs index c7d40c24c0..b023c23d38 100644 --- a/external/referencesource/System.Core/Microsoft/Scripting/Ast/IArgumentProvider.cs +++ b/external/referencesource/System.Core/Microsoft/Scripting/Ast/IArgumentProvider.cs @@ -55,7 +55,7 @@ namespace System.Linq.Expressions { /// an overloaded field enables us to both reduce memory usage as well as maintain compatibility and an /// easy to use external API. /// - internal interface IArgumentProvider { + public interface IArgumentProvider { Expression GetArgument(int index); int ArgumentCount { get; diff --git a/external/referencesource/System.Core/Microsoft/Scripting/Ast/IDynamicExpression.cs b/external/referencesource/System.Core/Microsoft/Scripting/Ast/IDynamicExpression.cs new file mode 100644 index 0000000000..70e2be4496 --- /dev/null +++ b/external/referencesource/System.Core/Microsoft/Scripting/Ast/IDynamicExpression.cs @@ -0,0 +1,49 @@ +/* **************************************************************************** + * + * Copyright (c) Microsoft Corporation. + * + * This source code is subject to terms and conditions of the Apache License, Version 2.0. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Apache License, Version 2.0, please send an email to + * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * by the terms of the Apache License, Version 2.0. + * + * You must not remove this notice, or any other, from this software. + * + * + * ***************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Text; + +#if CLR2 +namespace Microsoft.Scripting.Ast { + using Microsoft.Scripting.Utils; +#else +namespace System.Linq.Expressions +{ +#endif + + public interface IDynamicExpression : IArgumentProvider + { + /// + /// Gets the type of the delegate used by the CallSite />. + /// + Type DelegateType { get; } + + /// + /// Rewrite this node replacing the args with the provided values. The + /// number of the args needs to match the number of the current block. + /// + /// This helper is provided to allow re-writing of nodes to not depend on the specific + /// class of DynamicExpression which is being used. + /// + Expression Rewrite(Expression[] args); + + /// + /// Creates a CallSite for the node. + /// + object CreateCallSite(); + } +} \ No newline at end of file diff --git a/external/referencesource/System.Core/Microsoft/Scripting/Stubs.cs b/external/referencesource/System.Core/Microsoft/Scripting/Stubs.cs index b8e796f54f..08104e9fb2 100644 --- a/external/referencesource/System.Core/Microsoft/Scripting/Stubs.cs +++ b/external/referencesource/System.Core/Microsoft/Scripting/Stubs.cs @@ -209,4 +209,4 @@ namespace System { } -#endif +#endif \ No newline at end of file diff --git a/external/referencesource/System.Core/Microsoft/Win32/SafeHandles/BCryptSafeHandles.cs b/external/referencesource/System.Core/Microsoft/Win32/SafeHandles/BCryptSafeHandles.cs index 638e9ca813..adcfe75a06 100644 --- a/external/referencesource/System.Core/Microsoft/Win32/SafeHandles/BCryptSafeHandles.cs +++ b/external/referencesource/System.Core/Microsoft/Win32/SafeHandles/BCryptSafeHandles.cs @@ -73,4 +73,22 @@ namespace Microsoft.Win32.SafeHandles { return success; } } + + /// + /// SafeHandle for a native BCRYPT_KEY_HANDLE. + /// + [SecuritySafeCritical] + internal sealed class SafeBCryptKeyHandle : SafeHandleZeroOrMinusOneIsInvalid { + internal SafeBCryptKeyHandle(): base(true){ } + + [DllImport("bcrypt.dll")] + [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] + [SuppressUnmanagedCodeSecurity] + internal static extern BCryptNative.ErrorCode BCryptDestroyKey(IntPtr hKey); + + [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] + protected override bool ReleaseHandle() { + return BCryptDestroyKey(handle) == BCryptNative.ErrorCode.Success; + } + } } diff --git a/external/referencesource/System.Core/Microsoft/Win32/SafeHandles/CapiSafeHandles.cs b/external/referencesource/System.Core/Microsoft/Win32/SafeHandles/CapiSafeHandles.cs index 7b577d04f2..16669900dc 100644 --- a/external/referencesource/System.Core/Microsoft/Win32/SafeHandles/CapiSafeHandles.cs +++ b/external/referencesource/System.Core/Microsoft/Win32/SafeHandles/CapiSafeHandles.cs @@ -18,21 +18,27 @@ namespace Microsoft.Win32.SafeHandles { /// /// SafeHandle for buffers returned by the Axl APIs /// +#if !FEATURE_CORESYSTEM #pragma warning disable 618 // Have not migrated to v4 transparency yet [System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)] #pragma warning restore 618 +#endif internal sealed class SafeAxlBufferHandle : SafeHandleZeroOrMinusOneIsInvalid { private SafeAxlBufferHandle() : base(true) { return; } [DllImport("kernel32")] +#if !FEATURE_CORESYSTEM [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif [SuppressUnmanagedCodeSecurity] private static extern IntPtr GetProcessHeap(); [DllImport("kernel32")] +#if !FEATURE_CORESYSTEM [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool HeapFree(IntPtr hHeap, int dwFlags, IntPtr lpMem); @@ -53,26 +59,43 @@ namespace Microsoft.Win32.SafeHandles { /// maintains a native refcount on its parent HCRYPTPROV to ensure that if the corresponding /// SafeCspKeyHandle is finalized first CAPI still keeps the provider alive. /// +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#else #pragma warning disable 618 // Have not migrated to v4 transparency yet [SecurityCritical(SecurityCriticalScope.Everything)] #pragma warning restore 618 +#endif internal abstract class SafeCapiHandleBase : SafeHandleZeroOrMinusOneIsInvalid { private IntPtr m_csp; +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] internal SafeCapiHandleBase() : base(true) { } +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif [DllImport("advapi32", SetLastError = true)] +#if !FEATURE_CORESYSTEM [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool CryptContextAddRef(IntPtr hProv, IntPtr pdwReserved, int dwFlags); +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif [DllImport("advapi32")] +#if !FEATURE_CORESYSTEM [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool CryptReleaseContext(IntPtr hProv, int dwFlags); @@ -81,7 +104,9 @@ namespace Microsoft.Win32.SafeHandles { protected IntPtr ParentCsp { get { return m_csp; } +#if !FEATURE_CORESYSTEM [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] +#endif set { // We should not be resetting the parent CSP if it's already been set once - that will // lead to leaking the original handle. @@ -108,7 +133,12 @@ namespace Microsoft.Win32.SafeHandles { } } +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif +#if !FEATURE_CORESYSTEM [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] +#endif internal void SetParentCsp(SafeCspHandle parentCsp) { bool addedRef = false; RuntimeHelpers.PrepareConstrainedRegions(); @@ -124,8 +154,14 @@ namespace Microsoft.Win32.SafeHandles { } } +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif protected abstract bool ReleaseCapiChildHandle(); +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif protected override sealed bool ReleaseHandle() { // Order is important here - we must destroy the child handle before the parent CSP bool destroyedChild = ReleaseCapiChildHandle(); @@ -142,10 +178,17 @@ namespace Microsoft.Win32.SafeHandles { /// /// SafeHandle for CAPI hash algorithms (HCRYPTHASH) /// +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#else #pragma warning disable 618 // Have not migrated to v4 transparency yet [System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)] #pragma warning restore 618 +#endif internal sealed class SafeCapiHashHandle : SafeCapiHandleBase { +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif private SafeCapiHashHandle() { } @@ -160,12 +203,20 @@ namespace Microsoft.Win32.SafeHandles { } } +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif [DllImport("advapi32")] +#if !FEATURE_CORESYSTEM [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool CryptDestroyHash(IntPtr hHash); +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif protected override bool ReleaseCapiChildHandle() { return CryptDestroyHash(handle); } @@ -174,10 +225,17 @@ namespace Microsoft.Win32.SafeHandles { /// /// SafeHandle for CAPI keys (HCRYPTKEY) /// +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#else #pragma warning disable 618 // Have not migrated to v4 transparency yet [System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)] #pragma warning restore 618 +#endif internal sealed class SafeCapiKeyHandle : SafeCapiHandleBase { +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif private SafeCapiKeyHandle() { } @@ -194,7 +252,11 @@ namespace Microsoft.Win32.SafeHandles { } [DllImport("advapi32")] +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#else [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool CryptDestroyKey(IntPtr hKey); @@ -203,6 +265,9 @@ namespace Microsoft.Win32.SafeHandles { /// Make a copy of this key handle /// [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif internal SafeCapiKeyHandle Duplicate() { Contract.Requires(!IsInvalid && !IsClosed); Contract.Ensures(Contract.Result() != null && !Contract.Result().IsInvalid && !Contract.Result().IsClosed); @@ -224,6 +289,9 @@ namespace Microsoft.Win32.SafeHandles { return duplicate; } +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif protected override bool ReleaseCapiChildHandle() { return CryptDestroyKey(handle); } @@ -232,26 +300,43 @@ namespace Microsoft.Win32.SafeHandles { /// /// SafeHandle for crypto service providers (HCRYPTPROV) /// +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#else #pragma warning disable 618 // Have not migrated to v4 transparency yet [System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)] #pragma warning restore 618 +#endif internal sealed class SafeCspHandle : SafeHandleZeroOrMinusOneIsInvalid { [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif private SafeCspHandle() : base(true) { return; } [DllImport("advapi32", SetLastError = true)] +#if !FEATURE_CORESYSTEM [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif [SuppressUnmanagedCodeSecurity] +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif [return: MarshalAs(UnmanagedType.Bool)] private static extern bool CryptContextAddRef(SafeCspHandle hProv, IntPtr pdwReserved, int dwFlags); [DllImport("advapi32")] +#if !FEATURE_CORESYSTEM [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif [SuppressUnmanagedCodeSecurity] +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif [return: MarshalAs(UnmanagedType.Bool)] private static extern bool CryptReleaseContext(IntPtr hProv, int dwFlags); @@ -259,6 +344,9 @@ namespace Microsoft.Win32.SafeHandles { /// Create a second SafeCspHandle which refers to the same HCRYPTPROV /// [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif public SafeCspHandle Duplicate() { Contract.Requires(!IsInvalid && !IsClosed); @@ -308,6 +396,9 @@ namespace Microsoft.Win32.SafeHandles { } } +#if FEATURE_CORESYSTEM + [System.Security.SecurityCritical] +#endif protected override bool ReleaseHandle() { return CryptReleaseContext(handle, 0); } diff --git a/external/referencesource/System.Core/Microsoft/Win32/UnsafeNativeMethods.cs b/external/referencesource/System.Core/Microsoft/Win32/UnsafeNativeMethods.cs index fa5faaf065..5fba558def 100644 --- a/external/referencesource/System.Core/Microsoft/Win32/UnsafeNativeMethods.cs +++ b/external/referencesource/System.Core/Microsoft/Win32/UnsafeNativeMethods.cs @@ -438,7 +438,7 @@ namespace Microsoft.Win32 { // simultaneously: overlapped IO, free the memory for the overlapped // struct in a callback (or an EndRead method called by that callback), // and pass in an address for the numBytesRead parameter. - // See Windows Bug 105512 for details. -- + // < [DllImport(KERNEL32, SetLastError = true)] [SecurityCritical] @@ -456,7 +456,7 @@ namespace Microsoft.Win32 { // simultaneously: overlapped IO, free the memory for the overlapped // struct in a callback (or an EndWrite method called by that callback), // and pass in an address for the numBytesRead parameter. - // See Windows Bug 105512 for details. -- + // < [DllImport(KERNEL32, SetLastError = true)] [SecurityCritical] @@ -1474,19 +1474,24 @@ namespace Microsoft.Win32 { int pageProtectionMode ); - [DllImport(KERNEL32, CharSet = CharSet.Auto, SetLastError = true)] + [SecurityCritical] + internal static bool GlobalMemoryStatusEx(ref MEMORYSTATUSEX lpBuffer) + { + lpBuffer.dwLength = (uint)Marshal.SizeOf(typeof(MEMORYSTATUSEX)); + return GlobalMemoryStatusExNative(ref lpBuffer); + } + + [DllImport(KERNEL32, CharSet = CharSet.Auto, SetLastError = true, EntryPoint = "GlobalMemoryStatusEx")] [SecurityCritical] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool GlobalMemoryStatusEx([In, Out] MEMORYSTATUSEX lpBuffer); + private static extern bool GlobalMemoryStatusExNative([In, Out] ref MEMORYSTATUSEX lpBuffer); + + [DllImport(KERNEL32, SetLastError = true)] + [SecurityCritical] + internal static unsafe extern bool CancelIoEx(SafeHandle handle, NativeOverlapped* lpOverlapped); [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - internal class MEMORYSTATUSEX { - - [System.Security.SecurityCritical] - internal MEMORYSTATUSEX() { - this.dwLength = (uint)Marshal.SizeOf(typeof(MEMORYSTATUSEX)); - } - + internal struct MEMORYSTATUSEX { internal uint dwLength; internal uint dwMemoryLoad; internal ulong ullTotalPhys; diff --git a/external/referencesource/System.Core/System.Core.CLR.lst.cs.REMOVED.git-id b/external/referencesource/System.Core/System.Core.CLR.lst.cs.REMOVED.git-id index d2c2fc575a..ed77860919 100644 --- a/external/referencesource/System.Core/System.Core.CLR.lst.cs.REMOVED.git-id +++ b/external/referencesource/System.Core/System.Core.CLR.lst.cs.REMOVED.git-id @@ -1 +1 @@ -ded27b8e8b9c15fc9b7b4e1ece085f886cb28c11 \ No newline at end of file +07150ad804b6737d48b55bb7d2e3a8920819d508 \ No newline at end of file diff --git a/external/referencesource/System.Core/System.Core.dll.Triaged.lst.cs b/external/referencesource/System.Core/System.Core.dll.Triaged.lst.cs index 7569c7423e..ad3ebb3a67 100644 --- a/external/referencesource/System.Core/System.Core.dll.Triaged.lst.cs +++ b/external/referencesource/System.Core/System.Core.dll.Triaged.lst.cs @@ -1,53 +1,53 @@ [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "Member", Target = "System.SR.Resources.get_Resources():System.Resources.ResourceManager", Justification = "[....]:The assembly uses the ResourceManager. Fixing this error is more trouble than it is worth.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "Member", Target = "System.SR.GetObject(System.String):System.Object", Justification = "[....]:The assembly uses the ResourceManager. Fixing this error is more trouble than it is worth.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.TryGetLocalizedNameByMuiNativeResource(System.String):System.String", Justification = "[....]:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.GetSystemTimeZones():System.Collections.ObjectModel.ReadOnlyCollection`1", Justification = "[....]:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "Member", Target = "System.TimeZoneInfo.TryGetLocalizedNameByMuiNativeResource(System.String):System.String", Justification = "[....]:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.TryGetTimeZoneByRegistryKey(System.String,System.TimeZoneInfo&,System.Exception&):System.TimeZoneInfo+TimeZoneInfoResult", Justification = "[....]:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.CheckDaylightSavingTimeDisabled():System.Boolean", Justification = "[....]:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.FindIdFromTimeZoneInformation(Microsoft.Win32.NativeMethods+TimeZoneInformation,System.Boolean&):System.String", Justification = "[....]:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.TryCompareTimeZoneInformationToRegistry(Microsoft.Win32.NativeMethods+TimeZoneInformation,System.String,System.Boolean&):System.Boolean", Justification = "[....]:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "Member", Target = "System.Management.Instrumentation.ManagementReferenceAttribute..ctor()", Justification = "[....]:FI cl 2523628 @ 2007/04/18 ")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "Namespace", Target = "System.Management", Justification = "[....]:FI cl 2523628 @ 2007/04/18")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateNumericConversion(System.Reflection.Emit.ILGenerator,System.Type,System.Type,System.Boolean):System.Void", Justification = "[....]:FI 20521")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateUnliftedBinaryOp(System.Reflection.Emit.ILGenerator,System.Linq.Expressions.ExpressionType,System.Type,System.Type,System.Linq.Expressions.ExpressionCompiler+StackType):System.Linq.Expressions.ExpressionCompiler+StackType", Justification = "[....]:FI 20521")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateLiftedBinaryOp(System.Reflection.Emit.ILGenerator,System.Linq.Expressions.ExpressionType,System.Type,System.Type,System.Type,System.Boolean,System.Linq.Expressions.ExpressionCompiler+StackType):System.Linq.Expressions.ExpressionCompiler+StackType", Justification = "[....]:FI 20521")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Linq.Expressions.Expression.MakeBinary(System.Linq.Expressions.ExpressionType,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression,System.Boolean,System.Reflection.MethodInfo,System.Linq.Expressions.LambdaExpression):System.Linq.Expressions.BinaryExpression", Justification = "[....]:FI 20521")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateNullableToReferenceConversion(System.Reflection.Emit.ILGenerator,System.Type):System.Void", Justification = "[....]:FI 20521")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateUnliftedBinaryOp(System.Reflection.Emit.ILGenerator,System.Linq.Expressions.ExpressionType,System.Type,System.Type,System.Linq.Expressions.ExpressionCompiler+StackType):System.Linq.Expressions.ExpressionCompiler+StackType", MessageId = "ask", Justification = "[....]:FI 20521")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateNumericConversion(System.Reflection.Emit.ILGenerator,System.Type,System.Type,System.Boolean):System.Void", Justification = "[....]:FI 20521")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "Namespace", Target = "System.Diagnostics", Justification = "[....]:This is a old namespace and is an extension of system.dll. We will most certainly have more types here going forward")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke", Scope = "Member", Target = "System.IO.LogStream._Init(System.String,System.Int32,System.IO.FileShare,Microsoft.Win32.UnsafeNativeMethods+SECURITY_ATTRIBUTES,System.Security.Permissions.FileIOPermissionAccess,System.IO.FileMode,System.Int32,System.Boolean):System.Void", Justification = "[....]:This rule is noisy, we already check it inside handle.IsInvalid case immediately after the P/Invoke to create file")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.Init():System.Void", Justification = "[....]:This is intentional, such that we don't escape exception from tracing calls. App should never crash for benign tracing failures!")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener+TraceWriter.Write(System.String):System.Void", Justification = "[....]:This is intentional, such that we don't escape exception from tracing calls. App should never crash for benign tracing failures!")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.EnsureWriter():System.Boolean", Justification = "[....]:This is intentional, such that we don't escape exception from tracing calls. App should never crash for benign tracing failures!")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "Member", Target = "System.IO.LogStream.EnforceRetentionPolicy(Microsoft.Win32.SafeHandles.SafeFileHandle,System.Int64):System.Void", Justification = "[....]:This is intentional, such that we don't escape exception from tracing calls. App should never crash for benign tracing failures!")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildHeader(System.Text.StringBuilder,System.String,System.Diagnostics.TraceEventType,System.Int32,System.Diagnostics.TraceEventCache,System.String,System.Boolean,System.Diagnostics.TraceOptions):System.Void", Justification = "[....]:We are just handing out ActivityId which shouldn't require extra permission. ")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "Member", Target = "System.IO.LogStream.GetSecAttrs(System.IO.FileShare):Microsoft.Win32.UnsafeNativeMethods+SECURITY_ATTRIBUTES", Justification = "[....]:This is well contained")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "Member", Target = "System.IO.LogStream.EnforceRetentionPolicy(Microsoft.Win32.SafeHandles.SafeFileHandle,System.Int64):System.Void", Justification = "[....]:This is fine here")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.Init():System.Void", Justification = "[....]:This is fine here")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildHeader(System.Text.StringBuilder,System.String,System.Diagnostics.TraceEventType,System.Int32,System.Diagnostics.TraceEventCache,System.String,System.Boolean,System.Diagnostics.TraceOptions):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "[....]:The event schema XML tags can't be localized ")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.TraceData(System.Diagnostics.TraceEventCache,System.String,System.Diagnostics.TraceEventType,System.Int32,System.Object[]):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "[....]:The event schema XML tags can't be localized")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.TraceData(System.Diagnostics.TraceEventCache,System.String,System.Diagnostics.TraceEventType,System.Int32,System.Object):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "[....]:The event schema XML tags can't be localized")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildMessage(System.Text.StringBuilder,System.String):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "[....]:The event schema XML tags can't be localized")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildFooter(System.Text.StringBuilder,System.Diagnostics.TraceEventType,System.Diagnostics.TraceEventCache,System.Boolean,System.Diagnostics.TraceOptions):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "[....]:The event schema XML tags can't be localized")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildEscaped(System.Text.StringBuilder,System.String):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "[....]:The event schema XML tags can't be localized")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2201:DoNotRaiseReservedExceptionTypes", Scope = "Member", Target = "System.IO.LogStream.WriteFileNative(System.Byte[],System.Int32,System.Int32,System.Threading.NativeOverlapped*,System.Int32&):System.Int32", Justification = "[....]:This is intentional and indicative of ---- in our code")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.UnescapedXmlDiagnosticData.UnescapedXml", MessageId = "Unescaped", Justification = "[....]:This is fine and widely referred so")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.UnescapedXmlDiagnosticData", MessageId = "Unescaped", Justification = "[....]:This is fine and widely referred so")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2204:LiteralsShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildEscaped(System.Text.StringBuilder,System.String):System.Void", MessageId = "apos", Justification = "[....]:This is an industry standard literal")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2204:LiteralsShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildEscaped(System.Text.StringBuilder,System.String):System.Void", MessageId = "quot", Justification = "[....]:This is an industry standard literal")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "Member", Target = "System.IO.BufferedStream2.FlushRead():System.Void", Justification = "[....]:This functionality is no-op at present, pending stream re-factoring work")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildHeader(System.Text.StringBuilder,System.String,System.Diagnostics.TraceEventType,System.Int32,System.Diagnostics.TraceEventCache,System.String,System.Boolean,System.Diagnostics.TraceOptions):System.Void", MessageId = "source", Justification = "[....]:This is provided for consistency")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA2101:SpecifyMarshalingForPInvokeStringArguments", Scope = "Member", Target = "Microsoft.Win32.UnsafeNativeMethods.CreateFile(System.String,System.Int32,System.IO.FileShare,Microsoft.Win32.UnsafeNativeMethods+SECURITY_ATTRIBUTES,System.IO.FileMode,System.Int32,System.IntPtr):Microsoft.Win32.SafeHandles.SafeFileHandle", Justification = "[....]:")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.Writer.set_Writer(System.IO.TextWriter):System.Void", Justification = "[....]:This is for hiding base class method, bounded by contract")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.Writer.set_Writer(System.IO.TextWriter):System.Void", MessageId = "value", Justification = "[....]:This is for hiding base class method, bounded by contract")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1802:UseLiteralsWhereAppropriate", Scope = "Member", Target = "Microsoft.Win32.UnsafeNativeMethods.NULL", Justification = "[....]:IntPtr' cannot be declared as const")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "Namespace", Target = "System.AddIn.Pipeline", Justification = "[....]:Approval was granted")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "Namespace", Target = "System.AddIn.Hosting", Justification = "[....]:Approval was granted")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "Namespace", Target = "System.AddIn", Justification = "[....]:Approval was granted")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "Namespace", Target = "System.Security", Justification = "[....]:System.Security is also defined in other assemblies")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "Member", Target = "System.SR.Resources.get_Resources():System.Resources.ResourceManager", Justification = "jfree:The assembly uses the ResourceManager. Fixing this error is more trouble than it is worth.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "Member", Target = "System.SR.GetObject(System.String):System.Object", Justification = "jfree:The assembly uses the ResourceManager. Fixing this error is more trouble than it is worth.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.TryGetLocalizedNameByMuiNativeResource(System.String):System.String", Justification = "jfree:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.GetSystemTimeZones():System.Collections.ObjectModel.ReadOnlyCollection`1", Justification = "jfree:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "Member", Target = "System.TimeZoneInfo.TryGetLocalizedNameByMuiNativeResource(System.String):System.String", Justification = "jfree:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.TryGetTimeZoneByRegistryKey(System.String,System.TimeZoneInfo&,System.Exception&):System.TimeZoneInfo+TimeZoneInfoResult", Justification = "jfree:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.CheckDaylightSavingTimeDisabled():System.Boolean", Justification = "jfree:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.FindIdFromTimeZoneInformation(Microsoft.Win32.NativeMethods+TimeZoneInformation,System.Boolean&):System.String", Justification = "jfree:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "Member", Target = "System.TimeZoneInfo.TryCompareTimeZoneInformationToRegistry(Microsoft.Win32.NativeMethods+TimeZoneInformation,System.String,System.Boolean&):System.Boolean", Justification = "jfree:Asserting permissions reviewed in threat model. see DevDiv Bugs number 24274")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1805:DoNotInitializeUnnecessarily", Scope = "Member", Target = "System.Management.Instrumentation.ManagementReferenceAttribute..ctor()", Justification = "clrgnt:FI cl 2523628 @ 2007/04/18 ")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "Namespace", Target = "System.Management", Justification = "clrgnt:FI cl 2523628 @ 2007/04/18")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateNumericConversion(System.Reflection.Emit.ILGenerator,System.Type,System.Type,System.Boolean):System.Void", Justification = "clrgnt:FI 20521")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateUnliftedBinaryOp(System.Reflection.Emit.ILGenerator,System.Linq.Expressions.ExpressionType,System.Type,System.Type,System.Linq.Expressions.ExpressionCompiler+StackType):System.Linq.Expressions.ExpressionCompiler+StackType", Justification = "clrgnt:FI 20521")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateLiftedBinaryOp(System.Reflection.Emit.ILGenerator,System.Linq.Expressions.ExpressionType,System.Type,System.Type,System.Type,System.Boolean,System.Linq.Expressions.ExpressionCompiler+StackType):System.Linq.Expressions.ExpressionCompiler+StackType", Justification = "clrgnt:FI 20521")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Linq.Expressions.Expression.MakeBinary(System.Linq.Expressions.ExpressionType,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression,System.Boolean,System.Reflection.MethodInfo,System.Linq.Expressions.LambdaExpression):System.Linq.Expressions.BinaryExpression", Justification = "clrgnt:FI 20521")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateNullableToReferenceConversion(System.Reflection.Emit.ILGenerator,System.Type):System.Void", Justification = "clrgnt:FI 20521")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateUnliftedBinaryOp(System.Reflection.Emit.ILGenerator,System.Linq.Expressions.ExpressionType,System.Type,System.Type,System.Linq.Expressions.ExpressionCompiler+StackType):System.Linq.Expressions.ExpressionCompiler+StackType", MessageId = "ask", Justification = "clrgnt:FI 20521")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "Member", Target = "System.Linq.Expressions.ExpressionCompiler.GenerateNumericConversion(System.Reflection.Emit.ILGenerator,System.Type,System.Type,System.Boolean):System.Void", Justification = "clrgnt:FI 20521")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "Namespace", Target = "System.Diagnostics", Justification = "rkrish:This is a old namespace and is an extension of system.dll. We will most certainly have more types here going forward")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke", Scope = "Member", Target = "System.IO.LogStream._Init(System.String,System.Int32,System.IO.FileShare,Microsoft.Win32.UnsafeNativeMethods+SECURITY_ATTRIBUTES,System.Security.Permissions.FileIOPermissionAccess,System.IO.FileMode,System.Int32,System.Boolean):System.Void", Justification = "rkrish:This rule is noisy, we already check it inside handle.IsInvalid case immediately after the P/Invoke to create file")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.Init():System.Void", Justification = "rkrish:This is intentional, such that we don't escape exception from tracing calls. App should never crash for benign tracing failures!")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener+TraceWriter.Write(System.String):System.Void", Justification = "rkrish:This is intentional, such that we don't escape exception from tracing calls. App should never crash for benign tracing failures!")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.EnsureWriter():System.Boolean", Justification = "rkrish:This is intentional, such that we don't escape exception from tracing calls. App should never crash for benign tracing failures!")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "Member", Target = "System.IO.LogStream.EnforceRetentionPolicy(Microsoft.Win32.SafeHandles.SafeFileHandle,System.Int64):System.Void", Justification = "rkrish:This is intentional, such that we don't escape exception from tracing calls. App should never crash for benign tracing failures!")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildHeader(System.Text.StringBuilder,System.String,System.Diagnostics.TraceEventType,System.Int32,System.Diagnostics.TraceEventCache,System.String,System.Boolean,System.Diagnostics.TraceOptions):System.Void", Justification = "rkrish:We are just handing out ActivityId which shouldn't require extra permission. ")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "Member", Target = "System.IO.LogStream.GetSecAttrs(System.IO.FileShare):Microsoft.Win32.UnsafeNativeMethods+SECURITY_ATTRIBUTES", Justification = "rkrish:This is well contained")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "Member", Target = "System.IO.LogStream.EnforceRetentionPolicy(Microsoft.Win32.SafeHandles.SafeFileHandle,System.Int64):System.Void", Justification = "rkrish:This is fine here")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.Init():System.Void", Justification = "rkrish:This is fine here")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildHeader(System.Text.StringBuilder,System.String,System.Diagnostics.TraceEventType,System.Int32,System.Diagnostics.TraceEventCache,System.String,System.Boolean,System.Diagnostics.TraceOptions):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "rkrish:The event schema XML tags can't be localized ")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.TraceData(System.Diagnostics.TraceEventCache,System.String,System.Diagnostics.TraceEventType,System.Int32,System.Object[]):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "rkrish:The event schema XML tags can't be localized")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.TraceData(System.Diagnostics.TraceEventCache,System.String,System.Diagnostics.TraceEventType,System.Int32,System.Object):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "rkrish:The event schema XML tags can't be localized")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildMessage(System.Text.StringBuilder,System.String):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "rkrish:The event schema XML tags can't be localized")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildFooter(System.Text.StringBuilder,System.Diagnostics.TraceEventType,System.Diagnostics.TraceEventCache,System.Boolean,System.Diagnostics.TraceOptions):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "rkrish:The event schema XML tags can't be localized")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildEscaped(System.Text.StringBuilder,System.String):System.Void", MessageId = "System.Diagnostics.EventSchemaTraceListener._InternalBuildRaw(System.Text.StringBuilder,System.String)", Justification = "rkrish:The event schema XML tags can't be localized")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2201:DoNotRaiseReservedExceptionTypes", Scope = "Member", Target = "System.IO.LogStream.WriteFileNative(System.Byte[],System.Int32,System.Int32,System.Threading.NativeOverlapped*,System.Int32&):System.Int32", Justification = "rkrish:This is intentional and indicative of race in our code")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.UnescapedXmlDiagnosticData.UnescapedXml", MessageId = "Unescaped", Justification = "rkrish:This is fine and widely referred so")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.UnescapedXmlDiagnosticData", MessageId = "Unescaped", Justification = "rkrish:This is fine and widely referred so")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2204:LiteralsShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildEscaped(System.Text.StringBuilder,System.String):System.Void", MessageId = "apos", Justification = "rkrish:This is an industry standard literal")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2204:LiteralsShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildEscaped(System.Text.StringBuilder,System.String):System.Void", MessageId = "quot", Justification = "rkrish:This is an industry standard literal")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "Member", Target = "System.IO.BufferedStream2.FlushRead():System.Void", Justification = "rkrish:This functionality is no-op at present, pending stream re-factoring work")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.BuildHeader(System.Text.StringBuilder,System.String,System.Diagnostics.TraceEventType,System.Int32,System.Diagnostics.TraceEventCache,System.String,System.Boolean,System.Diagnostics.TraceOptions):System.Void", MessageId = "source", Justification = "rkrish:This is provided for consistency")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA2101:SpecifyMarshalingForPInvokeStringArguments", Scope = "Member", Target = "Microsoft.Win32.UnsafeNativeMethods.CreateFile(System.String,System.Int32,System.IO.FileShare,Microsoft.Win32.UnsafeNativeMethods+SECURITY_ATTRIBUTES,System.IO.FileMode,System.Int32,System.IntPtr):Microsoft.Win32.SafeHandles.SafeFileHandle", Justification = "rkrish:")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.Writer.set_Writer(System.IO.TextWriter):System.Void", Justification = "rkrish:This is for hiding base class method, bounded by contract")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Scope = "Member", Target = "System.Diagnostics.EventSchemaTraceListener.Writer.set_Writer(System.IO.TextWriter):System.Void", MessageId = "value", Justification = "rkrish:This is for hiding base class method, bounded by contract")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1802:UseLiteralsWhereAppropriate", Scope = "Member", Target = "Microsoft.Win32.UnsafeNativeMethods.NULL", Justification = "rkrish:IntPtr' cannot be declared as const")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "Namespace", Target = "System.AddIn.Pipeline", Justification = "petes:Approval was granted")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "Namespace", Target = "System.AddIn.Hosting", Justification = "petes:Approval was granted")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "Namespace", Target = "System.AddIn", Justification = "petes:Approval was granted")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "Namespace", Target = "System.Security", Justification = "ShawnFa:System.Security is also defined in other assemblies")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "Namespace", Target = "System.Diagnostics.Eventing", Justification = "josesua:more classes will come into this name space")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "Member", Target = "System.Diagnostics.Eventing.EventProvider.GetActivityId():System.Guid", Justification = "josesua:handing out ActivityId which shouldn't require extra permission.")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", Scope = "Member", Target = "System.Diagnostics.Eventing.EventProvider.SetActivityId(System.Guid&):System.Void", MessageId = "0#", Justification = "josesua:need to for performance")] @@ -109,52 +109,52 @@ [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "Member", Target = "System.Diagnostics.PerformanceData.PerfProviderCollection.RemoveProvider(System.Guid):System.Void", Justification = "jenlc:Force PerfStopProvider() being called.")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "Member", Target = "System.Diagnostics.PerformanceData.CounterSetInstanceCounterDataSet.Dispose(System.Boolean):System.Void", Justification = "jenlc:Explicitly free allocated heap memory.")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Scope = "Member", Target = "System.Diagnostics.PerformanceData.CounterSetInstanceCounterDataSet.Dispose(System.Boolean):System.Void", MessageId = "disposing", Justification = "jenlc:Dispose() pattern.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper.EvtSetChannelConfigProperty(System.Diagnostics.Eventing.Reader.EventLogHandle,Microsoft.Win32.UnsafeNativeMethods+EvtChannelConfigPropertyId,System.Object):System.Void", Justification = "[....]:contains large switch statement for conversion, cannot reduce anymore.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper.ConvertToObject(Microsoft.Win32.UnsafeNativeMethods+EvtVariant):System.Object", Justification = "[....]:contains large switch statement for conversion, cannot reduce anymore.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper.EvtRenderBufferWithContextSystem(System.Diagnostics.Eventing.Reader.EventLogHandle,System.Diagnostics.Eventing.Reader.EventLogHandle,Microsoft.Win32.UnsafeNativeMethods+EvtRenderFlags,System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties,System.Int32):System.Void", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper.EvtRenderBufferWithContextSystem(System.Diagnostics.Eventing.Reader.EventLogHandle,System.Diagnostics.Eventing.Reader.EventLogHandle,Microsoft.Win32.UnsafeNativeMethods+EvtRenderFlags,System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties,System.Int32):System.Void", Justification = "[....]:contains large switch statement for conversion, cannot reduce anymore.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper.EvtSetChannelConfigProperty(System.Diagnostics.Eventing.Reader.EventLogHandle,Microsoft.Win32.UnsafeNativeMethods+EvtChannelConfigPropertyId,System.Object):System.Void", Justification = "[....]:cast occurs only once per case of switch statement.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", Scope = "Type", Target = "System.Diagnostics.Eventing.Reader.PathType", Justification = "[....]:Need to match this enum up against a native API enum.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.ProviderMetadata.Opcodes", MessageId = "Opcodes", Justification = "[....]:OpCode is an existing name in eventlog world and would be more confusing to use different name.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogSession.GetProviderNames():System.Collections.Generic.IEnumerable`1", Justification = "[....]:The method performs a time-consuming operation. ")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogSession.GetLogNames():System.Collections.Generic.IEnumerable`1", Justification = "[....]:The method performs a time-consuming operation. ")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EvtVariant.StringVal", Justification = "[....]:reviewed usage - in one instance unmanaged memory is owned/referenced by this member, but is appropriately freed in this case. It is not appropriate for this member to be SafeHandle for this one case.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderKeywords.get_ProviderKeywords():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderLatency.get_ProviderLatency():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderBufferSize.get_ProviderBufferSize():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderMinimumNumberOfBuffers.get_ProviderMinimumNumberOfBuffers():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderMaximumNumberOfBuffers.get_ProviderMaximumNumberOfBuffers():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogInformation..ctor(System.Diagnostics.Eventing.Reader.EventLogSession,System.String,System.Diagnostics.Eventing.Reader.PathType)", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderLevel.get_ProviderLevel():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.StandardEventKeywords.Sqm", MessageId = "Sqm", Justification = "[....]:This is an acronym.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.StandardEventKeywords.WdiContext", MessageId = "Wdi", Justification = "[....]:This is an acronym.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.StandardEventKeywords.WdiDiagnostic", MessageId = "Wdi", Justification = "[....]:This is an acronym.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader", MessageId = "Eventing", Justification = "[....]:'Eventing' is already used in an approved namespace : System.Diagnostics.Eventing")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "Namespace", Target = "System.Diagnostics.Eventing.Reader", Justification = "[....]:Namespace approved by BCL team.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.Keywords", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.ProcessId", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties..ctor()", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.Id", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.Task", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.ThreadId", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.Qualifiers", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.RecordId", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.Opcode.get_Opcode():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.ProcessId.get_ProcessId():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.RecordId.get_RecordId():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.Task.get_Task():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.ThreadId.get_ThreadId():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.Id.get_Id():System.Int32", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.Keywords.get_Keywords():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.Qualifiers.get_Qualifiers():System.Nullable`1", Justification = "[....]:use of nullable generics approved by BCL team in spec review.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.Exists(System.Int32,System.Int32,System.Predicate`1):System.Boolean", Justification = "[....]:Delegates do not need our PZM hack. Confirmed with Jan Kotas, 10/2006")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.ForAll(System.Int32,System.Int32,System.Predicate`1):System.Boolean", Justification = "[....]:Delegates do not need our PZM hack. Confirmed with Jan Kotas, 10/2006")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.AssertOnReturn(System.Boolean):System.Void", MessageId = "System.String.Concat(System.String,System.String)", Justification = "[....]:")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.AssertOnException(System.Boolean):System.Void", MessageId = "System.String.Concat(System.String,System.String)", Justification = "[....]:")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.Ensures(System.Boolean):System.Void", MessageId = "System.String.Concat(System.String,System.String)", Justification = "[....]:")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.Invariant(System.Boolean):System.Void", MessageId = "System.String.Concat(System.String,System.String)", Justification = "[....]:")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.ThrowsEnsures(System.Boolean):System.Void", MessageId = "System.String.Concat(System.String,System.String)", Justification = "[....]:")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Threading.ReaderWriterLockSlim.TryEnterWriteLock(System.Int32):System.Boolean", Justification = "[....]:")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper.EvtSetChannelConfigProperty(System.Diagnostics.Eventing.Reader.EventLogHandle,Microsoft.Win32.UnsafeNativeMethods+EvtChannelConfigPropertyId,System.Object):System.Void", Justification = "pkenny:contains large switch statement for conversion, cannot reduce anymore.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper.ConvertToObject(Microsoft.Win32.UnsafeNativeMethods+EvtVariant):System.Object", Justification = "pkenny:contains large switch statement for conversion, cannot reduce anymore.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper.EvtRenderBufferWithContextSystem(System.Diagnostics.Eventing.Reader.EventLogHandle,System.Diagnostics.Eventing.Reader.EventLogHandle,Microsoft.Win32.UnsafeNativeMethods+EvtRenderFlags,System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties,System.Int32):System.Void", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper.EvtRenderBufferWithContextSystem(System.Diagnostics.Eventing.Reader.EventLogHandle,System.Diagnostics.Eventing.Reader.EventLogHandle,Microsoft.Win32.UnsafeNativeMethods+EvtRenderFlags,System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties,System.Int32):System.Void", Justification = "pkenny:contains large switch statement for conversion, cannot reduce anymore.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper.EvtSetChannelConfigProperty(System.Diagnostics.Eventing.Reader.EventLogHandle,Microsoft.Win32.UnsafeNativeMethods+EvtChannelConfigPropertyId,System.Object):System.Void", Justification = "pkenny:cast occurs only once per case of switch statement.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", Scope = "Type", Target = "System.Diagnostics.Eventing.Reader.PathType", Justification = "pkenny:Need to match this enum up against a native API enum.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.ProviderMetadata.Opcodes", MessageId = "Opcodes", Justification = "pkenny:OpCode is an existing name in eventlog world and would be more confusing to use different name.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogSession.GetProviderNames():System.Collections.Generic.IEnumerable`1", Justification = "pkenny:The method performs a time-consuming operation. ")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogSession.GetLogNames():System.Collections.Generic.IEnumerable`1", Justification = "pkenny:The method performs a time-consuming operation. ")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EvtVariant.StringVal", Justification = "pkenny:reviewed usage - in one instance unmanaged memory is owned/referenced by this member, but is appropriately freed in this case. It is not appropriate for this member to be SafeHandle for this one case.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderKeywords.get_ProviderKeywords():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderLatency.get_ProviderLatency():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderBufferSize.get_ProviderBufferSize():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderMinimumNumberOfBuffers.get_ProviderMinimumNumberOfBuffers():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderMaximumNumberOfBuffers.get_ProviderMaximumNumberOfBuffers():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogInformation..ctor(System.Diagnostics.Eventing.Reader.EventLogSession,System.String,System.Diagnostics.Eventing.Reader.PathType)", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogConfiguration.ProviderLevel.get_ProviderLevel():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.StandardEventKeywords.Sqm", MessageId = "Sqm", Justification = "pkenny:This is an acronym.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.StandardEventKeywords.WdiContext", MessageId = "Wdi", Justification = "pkenny:This is an acronym.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.StandardEventKeywords.WdiDiagnostic", MessageId = "Wdi", Justification = "pkenny:This is an acronym.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader", MessageId = "Eventing", Justification = "pkenny:'Eventing' is already used in an approved namespace : System.Diagnostics.Eventing")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA905:SystemAndMicrosoftNamespacesRequireApproval", Scope = "Namespace", Target = "System.Diagnostics.Eventing.Reader", Justification = "pkenny:Namespace approved by BCL team.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.Keywords", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.ProcessId", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties..ctor()", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.Id", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.Task", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.ThreadId", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.Qualifiers", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.NativeWrapper+SystemProperties.RecordId", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.Opcode.get_Opcode():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.ProcessId.get_ProcessId():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.RecordId.get_RecordId():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.Task.get_Task():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.ThreadId.get_ThreadId():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.Id.get_Id():System.Int32", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.Keywords.get_Keywords():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Eventing.Reader.EventLogRecord.Qualifiers.get_Qualifiers():System.Nullable`1", Justification = "pkenny:use of nullable generics approved by BCL team in spec review.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.Exists(System.Int32,System.Int32,System.Predicate`1):System.Boolean", Justification = "briangru:Delegates do not need our PZM hack. Confirmed with Jan Kotas, 10/2006")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.MSInternal", "CA908:AvoidTypesThatRequireJitCompilationInPrecompiledAssemblies", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.ForAll(System.Int32,System.Int32,System.Predicate`1):System.Boolean", Justification = "briangru:Delegates do not need our PZM hack. Confirmed with Jan Kotas, 10/2006")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.AssertOnReturn(System.Boolean):System.Void", MessageId = "System.String.Concat(System.String,System.String)", Justification = "briangru:")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.AssertOnException(System.Boolean):System.Void", MessageId = "System.String.Concat(System.String,System.String)", Justification = "briangru:")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.Ensures(System.Boolean):System.Void", MessageId = "System.String.Concat(System.String,System.String)", Justification = "briangru:")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.Invariant(System.Boolean):System.Void", MessageId = "System.String.Concat(System.String,System.String)", Justification = "briangru:")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", Scope = "Member", Target = "System.Diagnostics.Contracts.Contract.ThrowsEnsures(System.Boolean):System.Void", MessageId = "System.String.Concat(System.String,System.String)", Justification = "briangru:")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "Member", Target = "System.Threading.ReaderWriterLockSlim.TryEnterWriteLock(System.Int32):System.Boolean", Justification = "sidharth:")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming","CA1710:IdentifiersShouldHaveCorrectSuffix", Scope="type", Target="System.Linq.OrderedParallelQuery`1", Justification="The name OrderedParallelQuery is more acceptable than the FXCop suggestion.")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming","CA1720:IdentifiersShouldNotContainTypeNames", MessageId="long", Scope="member", Target="System.Linq.ParallelEnumerable.#LongCount`1(System.Linq.ParallelQuery`1)", Justification="This is for System.Linq.Enumerable.LongCount")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming","CA1720:IdentifiersShouldNotContainTypeNames", MessageId="long", Scope="member", Target="System.Linq.ParallelEnumerable.#LongCount`1(System.Linq.ParallelQuery`1,System.Func`2)", Justification="This is for System.Linq.Enumerable.LongCount")] diff --git a/external/referencesource/System.Core/System/Collections/Generic/HashSet.cs b/external/referencesource/System.Core/System/Collections/Generic/HashSet.cs index 889b638df3..95d4834c07 100644 --- a/external/referencesource/System.Core/System/Collections/Generic/HashSet.cs +++ b/external/referencesource/System.Core/System/Collections/Generic/HashSet.cs @@ -56,11 +56,11 @@ namespace System.Collections.Generic { [DebuggerDisplay("Count = {Count}")] [SuppressMessage("Microsoft.Naming","CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="By design")] #if SILVERLIGHT - public class HashSet : ICollection, ISet + public class HashSet : ICollection, ISet, IReadOnlyCollection #else [Serializable()] [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] - public class HashSet : ICollection, ISerializable, IDeserializationCallback, ISet + public class HashSet : ICollection, ISerializable, IDeserializationCallback, ISet, IReadOnlyCollection #endif { @@ -303,7 +303,7 @@ namespace System.Collections.Generic { // need to serialize version to avoid problems with serializing while enumerating info.AddValue(VersionName, m_version); -#if FEATURE_RANDOMIZED_STRING_HASHING +#if FEATURE_RANDOMIZED_STRING_HASHING && !FEATURE_NETCORE info.AddValue(ComparerName, HashHelpers.GetEqualityComparerForSerialization(m_comparer), typeof(IEqualityComparer)); #else info.AddValue(ComparerName, m_comparer, typeof(IEqualityComparer)); @@ -962,14 +962,14 @@ namespace System.Collections.Generic { int hashCode = InternalGetHashCode(value); int bucket = hashCode % m_buckets.Length; -#if FEATURE_RANDOMIZED_STRING_HASHING +#if FEATURE_RANDOMIZED_STRING_HASHING && !FEATURE_NETCORE int collisionCount = 0; #endif for (int i = m_buckets[hashCode % m_buckets.Length] - 1; i >= 0; i = m_slots[i].next) { if (m_slots[i].hashCode == hashCode && m_comparer.Equals(m_slots[i].value, value)) { return false; } -#if FEATURE_RANDOMIZED_STRING_HASHING +#if FEATURE_RANDOMIZED_STRING_HASHING && !FEATURE_NETCORE collisionCount++; #endif } @@ -995,7 +995,7 @@ namespace System.Collections.Generic { m_count++; m_version++; -#if FEATURE_RANDOMIZED_STRING_HASHING +#if FEATURE_RANDOMIZED_STRING_HASHING && !FEATURE_NETCORE if(collisionCount > HashHelpers.HashCollisionThreshold && HashHelpers.IsWellKnownEqualityComparer(m_comparer)) { m_comparer = (IEqualityComparer) HashHelpers.GetRandomizedEqualityComparer(m_comparer); SetCapacity(m_buckets.Length, true); diff --git a/external/referencesource/System.Core/System/Diagnostics/Eventing/Reader/Winmeta.cs b/external/referencesource/System.Core/System/Diagnostics/Eventing/Reader/Winmeta.cs index 883eea188e..e8d96dcb3b 100644 --- a/external/referencesource/System.Core/System/Diagnostics/Eventing/Reader/Winmeta.cs +++ b/external/referencesource/System.Core/System/Diagnostics/Eventing/Reader/Winmeta.cs @@ -57,7 +57,7 @@ namespace System.Diagnostics.Eventing.Reader { /// /// EventOpcode /// - [SuppressMessage("Microsoft.Naming","CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId="Opcode", Justification="[....]: Shipped public in 3.5, breaking change to fix now.")] + [SuppressMessage("Microsoft.Naming","CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId="Opcode", Justification="matell: Shipped public in 3.5, breaking change to fix now.")] public enum StandardEventOpcode { /// /// An informational event @@ -152,4 +152,4 @@ namespace System.Diagnostics.Eventing.Reader { /// EventLogClassic = 0x80000000000000 } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Core/System/FuncAndAction.cs b/external/referencesource/System.Core/System/FuncAndAction.cs index ab43cd2d68..eaeca8fc9c 100644 --- a/external/referencesource/System.Core/System/FuncAndAction.cs +++ b/external/referencesource/System.Core/System/FuncAndAction.cs @@ -17,4 +17,4 @@ // Action and Func types exist in mscorlib (up to 8 generic argument paremeters) // and in System.Core.dll (See Microsoft\Scripting\Utils\[Action.cs | Function.cs]) -// for 9-16 generic argument parameter versions. +// for 9-16 generic argument parameter versions. \ No newline at end of file diff --git a/external/referencesource/System.Core/System/IO/Enums.cs b/external/referencesource/System.Core/System/IO/Enums.cs index c53835134c..bed84594e7 100644 --- a/external/referencesource/System.Core/System/IO/Enums.cs +++ b/external/referencesource/System.Core/System/IO/Enums.cs @@ -18,7 +18,9 @@ using System.Text; namespace System.IO { +#if !FEATURE_CORESYSTEM [Serializable] +#endif public enum HandleInheritability { None = 0, Inheritable = 1, diff --git a/external/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedFile.cs b/external/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedFile.cs index e1e2d1d2d7..274d98ad10 100644 --- a/external/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedFile.cs +++ b/external/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedFile.cs @@ -181,6 +181,12 @@ namespace System.IO.MemoryMappedFiles { return new MemoryMappedFile(handle, fileStream, false); } + public static MemoryMappedFile CreateFromFile(FileStream fileStream, String mapName, Int64 capacity, + MemoryMappedFileAccess access, + HandleInheritability inheritability, bool leaveOpen) { + return CreateFromFile(fileStream, mapName, capacity, access, null, inheritability, leaveOpen); + } + [System.Security.SecurityCritical] [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] public static MemoryMappedFile CreateFromFile(FileStream fileStream, String mapName, Int64 capacity, @@ -250,6 +256,12 @@ namespace System.IO.MemoryMappedFiles { HandleInheritability.None); } + public static MemoryMappedFile CreateNew(String mapName, Int64 capacity, MemoryMappedFileAccess access, + MemoryMappedFileOptions options, + HandleInheritability inheritability) { + return CreateNew(mapName, capacity, access, options, null, inheritability); + } + [System.Security.SecurityCritical] [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] public static MemoryMappedFile CreateNew(String mapName, Int64 capacity, MemoryMappedFileAccess access, @@ -305,6 +317,12 @@ namespace System.IO.MemoryMappedFiles { return CreateOrOpen(mapName, capacity, access, MemoryMappedFileOptions.None, null, HandleInheritability.None); } + public static MemoryMappedFile CreateOrOpen(String mapName, Int64 capacity, + MemoryMappedFileAccess access, MemoryMappedFileOptions options, + HandleInheritability inheritability) { + return CreateOrOpen(mapName, capacity, access, options, null, inheritability); + } + [System.Security.SecurityCritical] [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] public static MemoryMappedFile CreateOrOpen(String mapName, Int64 capacity, diff --git a/external/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs b/external/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs index 19bfac4949..98e30f009f 100644 --- a/external/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs +++ b/external/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs @@ -102,7 +102,7 @@ namespace System.IO.MemoryMappedFiles { // if request is >= than total virtual, then MapViewOfFile will fail with meaningless error message // "the parameter is incorrect"; this provides better error message in advance UnsafeNativeMethods.MEMORYSTATUSEX memStatus = new UnsafeNativeMethods.MEMORYSTATUSEX(); - bool result = UnsafeNativeMethods.GlobalMemoryStatusEx(memStatus); + bool result = UnsafeNativeMethods.GlobalMemoryStatusEx(ref memStatus); ulong totalVirtual = memStatus.ullTotalVirtual; if (nativeSize >= totalVirtual) { throw new IOException(SR.GetString(SR.IO_NotEnoughMemory)); @@ -125,14 +125,32 @@ namespace System.IO.MemoryMappedFiles { ulong viewSize = (ulong)viewInfo.RegionSize; - // allocate the pages if we were using the MemoryMappedFileOptions.DelayAllocatePages option - if ((viewInfo.State & UnsafeNativeMethods.MEM_RESERVE) != 0) { - IntPtr tempHandle = UnsafeNativeMethods.VirtualAlloc(viewHandle, (UIntPtr)viewSize, UnsafeNativeMethods.MEM_COMMIT, + // Allocate the pages if we were using the MemoryMappedFileOptions.DelayAllocatePages option + // OR check if the allocated view size is smaller than the expected native size + // If multiple overlapping views are created over the file mapping object, the pages in a given region + // could have different attributes(MEM_RESERVE OR MEM_COMMIT) as MapViewOfFile preserves coherence between + // views created on a mapping object backed by same file. + // In which case, the viewSize will be smaller than nativeSize required and viewState could be MEM_COMMIT + // but more pages may need to be committed in the region. + // This is because, VirtualQuery function(that internally invokes VirtualQueryEx function) returns the attributes + // and size of the region of pages with matching attributes starting from base address. + // VirtualQueryEx: http://msdn.microsoft.com/en-us/library/windows/desktop/aa366907(v=vs.85).aspx + if (((viewInfo.State & UnsafeNativeMethods.MEM_RESERVE) != 0) || (viewSize < nativeSize)) { + ulong allocSize = (nativeSize == 0) ? viewSize : nativeSize; + IntPtr tempHandle = UnsafeNativeMethods.VirtualAlloc(viewHandle, (UIntPtr)allocSize, UnsafeNativeMethods.MEM_COMMIT, MemoryMappedFile.GetPageAccess(access)); int lastError = Marshal.GetLastWin32Error(); - if (viewHandle.IsInvalid) { - __Error.WinIOError(lastError, String.Empty); - } + // The following is commented out for backward compatibility. + // Previously releases failed to check for this error so introducing this check + // could cause new/different exceptions in existing code paths. + // if (tempHandle == IntPtr.Zero) { + // __Error.WinIOError(lastError, String.Empty); + // } + + // again query the view for its new size + viewInfo = new UnsafeNativeMethods.MEMORY_BASIC_INFORMATION(); + UnsafeNativeMethods.VirtualQuery(viewHandle, ref viewInfo, (IntPtr)Marshal.SizeOf(viewInfo)); + viewSize = (ulong)viewInfo.RegionSize; } // if the user specified DefaultSize as the size, we need to get the actual size diff --git a/external/referencesource/System.Core/System/IO/Pipes/IOCancellationHelper.cs b/external/referencesource/System.Core/System/IO/Pipes/IOCancellationHelper.cs new file mode 100644 index 0000000000..3c6d42bdc2 --- /dev/null +++ b/external/referencesource/System.Core/System/IO/Pipes/IOCancellationHelper.cs @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//------------------------------------------------------------------------------ +using System.Diagnostics; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; +using System.Security; +using System.Threading; +using UnsafeNativeMethods = Microsoft.Win32.UnsafeNativeMethods; + +namespace System.IO.Pipes { + internal unsafe class IOCancellationHelper { + private CancellationToken _cancellationToken; + private CancellationTokenRegistration _cancellationRegistration; + [SecurityCritical] + private SafeHandle _handle; + [SecurityCritical] + private NativeOverlapped* _overlapped; + + public IOCancellationHelper(CancellationToken cancellationToken) { + this._cancellationToken = cancellationToken; + } + + /// + /// Marking that from this moment on + /// user can cancel operation using cancellationToken + /// + [SecurityCritical] + public void AllowCancellation(SafeHandle handle, NativeOverlapped* overlapped) { + Contract.Assert(handle != null, "Handle cannot be null"); + Contract.Assert(!handle.IsInvalid, "Handle cannot be invalid"); + Contract.Assert(overlapped != null, "Overlapped cannot be null"); + Contract.Assert(this._handle == null && this._overlapped == null, "Cancellation is already allowed."); + + if (!_cancellationToken.CanBeCanceled) { + return; + } + + this._handle = handle; + this._overlapped = overlapped; + if (this._cancellationToken.IsCancellationRequested) { + this.Cancel(); + } + else { + this._cancellationRegistration = this._cancellationToken.Register(Cancel); + } + } + + /// + /// Marking that operation is completed and + /// from this moment cancellation is no longer possible. + /// This MUST happen before Overlapped is freed and Handle is disposed. + /// + [SecurityCritical] + public void SetOperationCompleted() { + if (this._overlapped != null) { + this._cancellationRegistration.Dispose(); + this._handle = null; + this._overlapped = null; + } + } + + public void ThrowIOOperationAborted() { + this._cancellationToken.ThrowIfCancellationRequested(); + + // If we didn't throw that means that this is unexpected abortion + __Error.OperationAborted(); + } + + /// + /// Cancellation is not guaranteed to succeed. + /// We ignore all errors here because operation could + /// succeed just before it was called or someone already + /// cancelled this operation without using token which should + /// be manually detected - when operation finishes we should + /// compare error code to ERROR_OPERATION_ABORTED and if cancellation + /// token was not used to cancel we will throw. + /// + [SecurityCritical] + private void Cancel() { + // Storing to locals to avoid data ----s + SafeHandle handle = this._handle; + NativeOverlapped* overlapped = this._overlapped; + if (handle != null && !handle.IsInvalid && overlapped != null) { + if (!UnsafeNativeMethods.CancelIoEx(handle, overlapped)) + { + // This case should not have any consequences although + // it will be easier to debug if there exists any special case + // we are not aware of. + int errorCode = Marshal.GetLastWin32Error(); + Debug.WriteLine("CancelIoEx finished with error code {0}.", errorCode); + } + SetOperationCompleted(); + } + } + } +} diff --git a/external/referencesource/System.Core/System/IO/Pipes/Pipe.cs b/external/referencesource/System.Core/System/IO/Pipes/Pipe.cs index 7e7df0033e..7880ffd20f 100644 --- a/external/referencesource/System.Core/System/IO/Pipes/Pipe.cs +++ b/external/referencesource/System.Core/System/IO/Pipes/Pipe.cs @@ -28,6 +28,7 @@ using System.Security.Permissions; using System.Security.Principal; using System.Text; using System.Threading; +using System.Threading.Tasks; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; @@ -623,6 +624,24 @@ namespace System.IO.Pipes { } } + public Task WaitForConnectionAsync(CancellationToken cancellationToken) { + if (cancellationToken.IsCancellationRequested) { + return Task.FromCancellation(cancellationToken); + } + + if (!IsAsync) { + return Task.Factory.StartNew(WaitForConnection, cancellationToken); + } + + // Avoiding allocation if the task cannot be cancelled + IOCancellationHelper cancellationHelper = cancellationToken.CanBeCanceled ? new IOCancellationHelper(cancellationToken) : null; + return Task.Factory.FromAsync(BeginWaitForConnection, EndWaitForConnection, cancellationHelper); + } + + public Task WaitForConnectionAsync() { + return WaitForConnectionAsync(CancellationToken.None); + } + // Async version of WaitForConnection. See the comments above for more info. [System.Security.SecurityCritical] [HostProtection(ExternalThreading = true)] @@ -640,6 +659,8 @@ namespace System.IO.Pipes { asyncResult._userCallback = callback; asyncResult._userStateObject = state; + IOCancellationHelper cancellationHelper = state as IOCancellationHelper; + // Create wait handle and store in async result ManualResetEvent waitHandle = new ManualResetEvent(false); asyncResult._waitHandle = waitHandle; @@ -655,8 +676,12 @@ namespace System.IO.Pipes { if (!UnsafeNativeMethods.ConnectNamedPipe(InternalHandle, intOverlapped)) { int errorCode = Marshal.GetLastWin32Error(); - if (errorCode == UnsafeNativeMethods.ERROR_IO_PENDING) + if (errorCode == UnsafeNativeMethods.ERROR_IO_PENDING) { + if (cancellationHelper != null) { + cancellationHelper.AllowCancellation(InternalHandle, intOverlapped); + } return asyncResult; + } // WaitForConnectionCallback will not be called becasue we completed synchronously. // Either the pipe is already connected, or there was an error. Unpin and free the overlapped again. @@ -676,6 +701,9 @@ namespace System.IO.Pipes { __Error.WinIOError(errorCode, String.Empty); } // will set state to Connected when EndWait is called + if (cancellationHelper != null) { + cancellationHelper.AllowCancellation(InternalHandle, intOverlapped); + } return asyncResult; } @@ -704,6 +732,11 @@ namespace System.IO.Pipes { __Error.EndWaitForConnectionCalledTwice(); } + IOCancellationHelper cancellationHelper = afsar.AsyncState as IOCancellationHelper; + if (cancellationHelper != null) { + cancellationHelper.SetOperationCompleted(); + } + // Obtain the WaitHandle, but don't use public property in case we // delay initialize the manual reset event in the future. WaitHandle wh = afsar._waitHandle; @@ -728,6 +761,11 @@ namespace System.IO.Pipes { // Now check for any error during the read. if (afsar._errorCode != 0) { + if (afsar._errorCode == UnsafeNativeMethods.ERROR_OPERATION_ABORTED) { + if (cancellationHelper != null) { + cancellationHelper.ThrowIOOperationAborted(); + } + } __Error.WinIOError(afsar._errorCode, String.Empty); } @@ -939,6 +977,9 @@ namespace System.IO.Pipes { [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class NamedPipeClientStream : PipeStream { + // Maximum interval in miliseconds between which cancellation is checked. + // Used by ConnectInternal. 50ms is fairly responsive time but really long time for processor. + private const int CancellationCheckIntervalInMilliseconds = 50; private string m_normalizedPipePath; private TokenImpersonationLevel m_impersonationLevel; private PipeOptions m_pipeOptions; @@ -1193,6 +1234,127 @@ namespace System.IO.Pipes { throw new TimeoutException(); } + public Task ConnectAsync() { + // We cannot avoid creating lambda here by using Connect method + // unless we don't care about start time to be measured before the thread is started + return ConnectAsync(Timeout.Infinite, CancellationToken.None); + } + + public Task ConnectAsync(int timeout) { + return ConnectAsync(timeout, CancellationToken.None); + } + + public Task ConnectAsync(CancellationToken cancellationToken) { + return ConnectAsync(Timeout.Infinite, cancellationToken); + } + + public Task ConnectAsync(int timeout, CancellationToken cancellationToken) { + CheckConnectOperationsClient(); + + if (timeout < 0 && timeout != Timeout.Infinite) { + throw new ArgumentOutOfRangeException("timeout", SR.GetString(SR.ArgumentOutOfRange_InvalidTimeout)); + } + + if (cancellationToken.IsCancellationRequested) { + return Task.FromCancellation(cancellationToken); + } + + // We need to measure time here, not in the lambda + int startTime = Environment.TickCount; + return Task.Factory.StartNew(() => ConnectInternal(timeout, cancellationToken, startTime), cancellationToken); + } + + // Waits for a pipe instance to become available. This method may return before WaitForConnection is called + // on the server end, but WaitForConnection will not return until we have returned. Any data writen to the + // pipe by us after we have connected but before the server has called WaitForConnection will be available + // to the server after it calls WaitForConnection. + [System.Security.SecuritySafeCritical] + private void ConnectInternal(int timeout, CancellationToken cancellationToken, int startTime) { + UnsafeNativeMethods.SECURITY_ATTRIBUTES secAttrs = PipeStream.GetSecAttrs(m_inheritability); + + int _pipeFlags = (int)m_pipeOptions; + if (m_impersonationLevel != TokenImpersonationLevel.None) { + _pipeFlags |= UnsafeNativeMethods.SECURITY_SQOS_PRESENT; + _pipeFlags |= (((int)m_impersonationLevel - 1) << 16); + } + + // This is the main connection loop. It will loop until the timeout expires. Most of the + // time, we will be waiting in the WaitNamedPipe win32 blocking function; however, there are + // cases when we will need to loop: 1) The server is not created (WaitNamedPipe returns + // straight away in such cases), and 2) when another client connects to our server in between + // our WaitNamedPipe and CreateFile calls. + int elapsed = 0; + do { + // We want any other exception and and success to have priority over cancellation. + cancellationToken.ThrowIfCancellationRequested(); + + // Wait for pipe to become free (this will block unless the pipe does not exist). + int timeLeft = timeout - elapsed; + int waitTime; + if (cancellationToken.CanBeCanceled) { + waitTime = Math.Min(CancellationCheckIntervalInMilliseconds, timeLeft); + } + else { + waitTime = timeLeft; + } + + if (!UnsafeNativeMethods.WaitNamedPipe(m_normalizedPipePath, waitTime)) { + int errorCode = Marshal.GetLastWin32Error(); + + // Server is not yet created so let's keep looping. + if (errorCode == UnsafeNativeMethods.ERROR_FILE_NOT_FOUND) { + continue; + } + + // The timeout has expired. + if (errorCode == UnsafeNativeMethods.ERROR_SUCCESS) { + if (cancellationToken.CanBeCanceled) { + // It may not be real timeout and only checking for cancellation + // let the while condition check it and decide + continue; + } + else { + break; + } + } + + __Error.WinIOError(errorCode, String.Empty); + } + + // Pipe server should be free. Let's try to connect to it. + SafePipeHandle handle = UnsafeNativeMethods.CreateNamedPipeClient(m_normalizedPipePath, + m_access, // read and write access + 0, // sharing: none + secAttrs, // security attributes + FileMode.Open, // open existing + _pipeFlags, // impersonation flags + UnsafeNativeMethods.NULL); // template file: null + + if (handle.IsInvalid) { + int errorCode = Marshal.GetLastWin32Error(); + + // Handle the possible race condition of someone else connecting to the server + // between our calls to WaitNamedPipe & CreateFile. + if (errorCode == UnsafeNativeMethods.ERROR_PIPE_BUSY) { + continue; + } + + __Error.WinIOError(errorCode, String.Empty); + } + + // Success! + InitializeHandle(handle, false, (m_pipeOptions & PipeOptions.Asynchronous) != 0); + State = PipeState.Connected; + + return; + } + while (timeout == Timeout.Infinite || (elapsed = unchecked(Environment.TickCount - startTime)) < timeout); + // BUGBUG: SerialPort does not use unchecked arithmetic when calculating elapsed times. This is needed + // because Environment.TickCount can overflow (though only every 49.7 days). + + throw new TimeoutException(); + } + public int NumberOfServerInstances { [System.Security.SecurityCritical] [SuppressMessage("Microsoft.Security","CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification="Security model of pipes: demand at creation but no subsequent demands")] diff --git a/external/referencesource/System.Core/System/IO/__Error.cs b/external/referencesource/System.Core/System/IO/__Error.cs index 02960e8466..596a0e973d 100644 --- a/external/referencesource/System.Core/System/IO/__Error.cs +++ b/external/referencesource/System.Core/System/IO/__Error.cs @@ -217,5 +217,8 @@ namespace System.IO { throw new NotSupportedException(SR.GetString(SR.NotSupported_UnwritableStream)); } + internal static void OperationAborted() { + throw new IOException(SR.GetString(SR.IO_OperationAborted)); + } } } diff --git a/external/referencesource/System.Core/System/Linq/Enumerable.cs.REMOVED.git-id b/external/referencesource/System.Core/System/Linq/Enumerable.cs.REMOVED.git-id index 08b6bcf71f..1d89f21c13 100644 --- a/external/referencesource/System.Core/System/Linq/Enumerable.cs.REMOVED.git-id +++ b/external/referencesource/System.Core/System/Linq/Enumerable.cs.REMOVED.git-id @@ -1 +1 @@ -d718d487e993e0ad7c2fa7a559117a327d48a95e \ No newline at end of file +f062ca5e6394c3e981aa5bf8417cf029954e40a0 \ No newline at end of file diff --git a/external/referencesource/System.Core/System/Linq/IQueryable.cs b/external/referencesource/System.Core/System/Linq/IQueryable.cs index 6b05902237..fa32bb39d7 100644 --- a/external/referencesource/System.Core/System/Linq/IQueryable.cs +++ b/external/referencesource/System.Core/System/Linq/IQueryable.cs @@ -40,6 +40,34 @@ namespace System.Linq { public static class Queryable { +#region Helper methods to obtain MethodInfo in a safe way + + private static MethodInfo GetMethodInfo(Func f, T1 unused1) { + return f.Method; + } + + private static MethodInfo GetMethodInfo(Func f, T1 unused1, T2 unused2) { + return f.Method; + } + + private static MethodInfo GetMethodInfo(Func f, T1 unused1, T2 unused2, T3 unused3) { + return f.Method; + } + + private static MethodInfo GetMethodInfo(Func f, T1 unused1, T2 unused2, T3 unused3, T4 unused4) { + return f.Method; + } + + private static MethodInfo GetMethodInfo(Func f, T1 unused1, T2 unused2, T3 unused3, T4 unused4, T5 unused5) { + return f.Method; + } + + private static MethodInfo GetMethodInfo(Func f, T1 unused1, T2 unused2, T3 unused3, T4 unused4, T5 unused5, T6 unused6) { + return f.Method; + } + +#endregion + public static IQueryable AsQueryable(this IEnumerable source) { if (source == null) throw Error.ArgumentNull("source"); @@ -67,7 +95,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Where, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -79,8 +107,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.CreateQuery( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Where, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -91,7 +119,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), + GetMethodInfo(Queryable.OfType, source), new Expression[] { source.Expression } )); } @@ -101,8 +129,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.CreateQuery( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), + null, + GetMethodInfo(Queryable.Cast, source), new Expression[] { source.Expression } )); } @@ -115,7 +143,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + GetMethodInfo(Queryable.Select, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -128,7 +156,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + GetMethodInfo(Queryable.Select, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -141,7 +169,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + GetMethodInfo(Queryable.SelectMany, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -154,7 +182,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + GetMethodInfo(Queryable.SelectMany, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -169,7 +197,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), + GetMethodInfo(Queryable.SelectMany, source, collectionSelector, resultSelector), new Expression[] { source.Expression, Expression.Quote(collectionSelector), Expression.Quote(resultSelector) } )); } @@ -184,7 +212,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), + GetMethodInfo(Queryable.SelectMany, source, collectionSelector, resultSelector), new Expression[] { source.Expression, Expression.Quote(collectionSelector), Expression.Quote(resultSelector) } )); } @@ -209,7 +237,7 @@ namespace System.Linq { return outer.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.Join, outer, inner, outerKeySelector, innerKeySelector, resultSelector), new Expression[] { outer.Expression, GetSourceExpression(inner), @@ -234,7 +262,7 @@ namespace System.Linq { return outer.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.Join, outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer), new Expression[] { outer.Expression, GetSourceExpression(inner), @@ -260,7 +288,7 @@ namespace System.Linq { return outer.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.GroupJoin, outer, inner, outerKeySelector, innerKeySelector, resultSelector), new Expression[] { outer.Expression, GetSourceExpression(inner), @@ -284,7 +312,7 @@ namespace System.Linq { return outer.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.GroupJoin, outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer), new Expression[] { outer.Expression, GetSourceExpression(inner), @@ -304,7 +332,7 @@ namespace System.Linq { return (IOrderedQueryable) source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.OrderBy, source, keySelector), new Expression[] { source.Expression, Expression.Quote(keySelector) } )); } @@ -317,7 +345,7 @@ namespace System.Linq { return (IOrderedQueryable) source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.OrderBy, source, keySelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer)) } )); } @@ -327,10 +355,10 @@ namespace System.Linq { throw Error.ArgumentNull("source"); if (keySelector == null) throw Error.ArgumentNull("keySelector"); - return (IOrderedQueryable) source.Provider.CreateQuery( + return (IOrderedQueryable)source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.OrderByDescending, source, keySelector), new Expression[] { source.Expression, Expression.Quote(keySelector) } )); } @@ -343,7 +371,7 @@ namespace System.Linq { return (IOrderedQueryable) source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.OrderByDescending, source, keySelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer)) } )); } @@ -356,7 +384,7 @@ namespace System.Linq { return (IOrderedQueryable) source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.ThenBy, source, keySelector), new Expression[] { source.Expression, Expression.Quote(keySelector) } )); } @@ -369,7 +397,7 @@ namespace System.Linq { return (IOrderedQueryable) source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.ThenBy, source, keySelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer)) } )); } @@ -382,7 +410,7 @@ namespace System.Linq { return (IOrderedQueryable) source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.ThenByDescending, source, keySelector), new Expression[] { source.Expression, Expression.Quote(keySelector) } )); } @@ -395,7 +423,7 @@ namespace System.Linq { return (IOrderedQueryable) source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.ThenByDescending, source, keySelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer)) } )); } @@ -406,7 +434,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Take, source, count), new Expression[] { source.Expression, Expression.Constant(count) } )); } @@ -419,7 +447,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.TakeWhile, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -432,7 +460,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.TakeWhile, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -443,7 +471,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Skip, source, count), new Expression[] { source.Expression, Expression.Constant(count) } )); } @@ -456,7 +484,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.SkipWhile, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -469,7 +497,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.SkipWhile, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -482,7 +510,7 @@ namespace System.Linq { return source.Provider.CreateQuery>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.GroupBy, source, keySelector), new Expression[] { source.Expression, Expression.Quote(keySelector) } )); } @@ -497,7 +525,7 @@ namespace System.Linq { return source.Provider.CreateQuery>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, elementSelector), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector) } )); } @@ -510,7 +538,7 @@ namespace System.Linq { return source.Provider.CreateQuery>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IEqualityComparer)) } )); } @@ -525,7 +553,7 @@ namespace System.Linq { return source.Provider.CreateQuery>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, elementSelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Constant(comparer, typeof(IEqualityComparer)) } )); } @@ -543,7 +571,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, elementSelector, resultSelector), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Quote(resultSelector) } )); } @@ -559,7 +587,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, resultSelector), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(resultSelector) } )); } @@ -575,7 +603,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, resultSelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer)) } )); } @@ -593,7 +621,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, elementSelector, resultSelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer)) } )); } @@ -604,7 +632,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Distinct, source), new Expression[] { source.Expression } )); } @@ -615,7 +643,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Distinct, source, comparer), new Expression[] { source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer)) } )); } @@ -627,8 +655,8 @@ namespace System.Linq { throw Error.ArgumentNull("source2"); return source1.Provider.CreateQuery( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Concat, source1, source2), new Expression[] { source1.Expression, GetSourceExpression(source2) } )); } @@ -643,7 +671,7 @@ namespace System.Linq { return source1.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TFirst), typeof(TSecond), typeof(TResult)), + GetMethodInfo(Queryable.Zip, source1, source2, resultSelector), new Expression[] { source1.Expression, GetSourceExpression(source2), Expression.Quote(resultSelector) } )); } @@ -655,8 +683,8 @@ namespace System.Linq { throw Error.ArgumentNull("source2"); return source1.Provider.CreateQuery( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Union, source1, source2), new Expression[] { source1.Expression, GetSourceExpression(source2) } )); } @@ -669,7 +697,7 @@ namespace System.Linq { return source1.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Union, source1, source2, comparer), new Expression[] { source1.Expression, GetSourceExpression(source2), @@ -686,7 +714,7 @@ namespace System.Linq { return source1.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Intersect, source1, source2), new Expression[] { source1.Expression, GetSourceExpression(source2) } )); } @@ -699,7 +727,7 @@ namespace System.Linq { return source1.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Intersect, source1, source2, comparer), new Expression[] { source1.Expression, GetSourceExpression(source2), @@ -716,7 +744,7 @@ namespace System.Linq { return source1.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Except, source1, source2), new Expression[] { source1.Expression, GetSourceExpression(source2) } )); } @@ -729,7 +757,7 @@ namespace System.Linq { return source1.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Except, source1, source2, comparer), new Expression[] { source1.Expression, GetSourceExpression(source2), @@ -743,8 +771,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.First, source), new Expression[] { source.Expression } )); } @@ -756,8 +784,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.First, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -768,7 +796,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.FirstOrDefault, source), new Expression[] { source.Expression } )); } @@ -780,8 +808,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.FirstOrDefault, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -791,8 +819,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Last, source), new Expression[] { source.Expression } )); } @@ -804,8 +832,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Last, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -816,7 +844,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.LastOrDefault, source), new Expression[] { source.Expression } )); } @@ -828,8 +856,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.LastOrDefault, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -840,7 +868,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Single, source), new Expression[] { source.Expression } )); } @@ -852,8 +880,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Single, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -864,7 +892,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.SingleOrDefault, source), new Expression[] { source.Expression } )); } @@ -876,8 +904,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.SingleOrDefault, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -889,8 +917,8 @@ namespace System.Linq { throw Error.ArgumentOutOfRange("index"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.ElementAt, source, index), new Expression[] { source.Expression, Expression.Constant(index) } )); } @@ -900,8 +928,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.ElementAtOrDefault, source, index), new Expression[] { source.Expression, Expression.Constant(index) } )); } @@ -912,7 +940,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.DefaultIfEmpty, source), new Expression[] { source.Expression } )); } @@ -922,8 +950,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.CreateQuery( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.DefaultIfEmpty, source, defaultValue), new Expression[] { source.Expression, Expression.Constant(defaultValue, typeof(TSource)) } )); } @@ -933,8 +961,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Contains, source, item), new Expression[] { source.Expression, Expression.Constant(item, typeof(TSource)) } )); } @@ -945,7 +973,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Contains, source, item, comparer), new Expression[] { source.Expression, Expression.Constant(item, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer)) } )); } @@ -956,7 +984,7 @@ namespace System.Linq { return source.Provider.CreateQuery( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Reverse, source), new Expression[] { source.Expression } )); } @@ -969,7 +997,7 @@ namespace System.Linq { return source1.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.SequenceEqual, source1, source2), new Expression[] { source1.Expression, GetSourceExpression(source2) } )); } @@ -982,7 +1010,7 @@ namespace System.Linq { return source1.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.SequenceEqual, source1, source2, comparer), new Expression[] { source1.Expression, GetSourceExpression(source2), @@ -997,7 +1025,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Any, source), new Expression[] { source.Expression } )); } @@ -1009,8 +1037,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Any, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -1022,8 +1050,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.All, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -1034,7 +1062,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Count, source), new Expression[] { source.Expression } )); } @@ -1047,7 +1075,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Count, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -1058,7 +1086,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.LongCount, source), new Expression[] { source.Expression } )); } @@ -1071,7 +1099,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.LongCount, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -1082,7 +1110,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Min, source), new Expression[] { source.Expression } )); } @@ -1094,8 +1122,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + null, + GetMethodInfo(Queryable.Min, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1106,7 +1134,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Max, source), new Expression[] { source.Expression } )); } @@ -1118,8 +1146,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + null, + GetMethodInfo(Queryable.Max, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1130,7 +1158,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1140,8 +1168,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1151,8 +1179,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1162,8 +1190,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1173,8 +1201,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1184,8 +1212,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1195,8 +1223,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1206,8 +1234,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1217,8 +1245,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1228,8 +1256,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1241,8 +1269,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1254,8 +1282,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1267,8 +1295,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1280,8 +1308,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1293,8 +1321,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1306,8 +1334,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1319,8 +1347,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1332,8 +1360,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1345,8 +1373,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1358,8 +1386,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1370,7 +1398,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1381,7 +1409,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1392,7 +1420,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1403,7 +1431,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1415,7 +1443,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1427,7 +1455,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1438,7 +1466,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1449,7 +1477,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1460,7 +1488,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1471,7 +1499,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1483,8 +1511,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1496,8 +1524,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1511,7 +1539,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1525,7 +1553,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1537,8 +1565,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1550,8 +1578,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1563,8 +1591,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1576,8 +1604,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1589,8 +1617,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1602,8 +1630,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1616,7 +1644,7 @@ namespace System.Linq { return source.Provider.Execute( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Aggregate, source, func), new Expression[] { source.Expression, Expression.Quote(func) } )); } @@ -1628,8 +1656,8 @@ namespace System.Linq { throw Error.ArgumentNull("func"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), + null, + GetMethodInfo(Queryable.Aggregate, source, seed, func), new Expression[] { source.Expression, Expression.Constant(seed), Expression.Quote(func) } )); } @@ -1643,8 +1671,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate), typeof(TResult)), + null, + GetMethodInfo(Queryable.Aggregate, source, seed, func, selector), new Expression[] { source.Expression, Expression.Constant(seed), Expression.Quote(func), Expression.Quote(selector) } )); } diff --git a/external/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs b/external/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs index 1aa7a43653..abf57edfe9 100644 --- a/external/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs +++ b/external/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs @@ -7,7 +7,7 @@ // // IParallelPartitionable.cs // -// [....] +// igoro // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -23,4 +23,4 @@ namespace System.Linq.Parallel { QueryOperatorEnumerator[] GetPartitions(int partitionCount); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs b/external/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs index 2a73072bdf..7775a87ab4 100644 --- a/external/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs +++ b/external/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs @@ -7,7 +7,7 @@ // // QueryAggregationOptions.cs // -// [....] +// igoro // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -27,4 +27,4 @@ namespace System.Linq.Parallel Commutative = 2, AssociativeCommutative = (Associative | Commutative) // For convenience. } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs b/external/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs index 862b053f9f..fc9b564241 100644 --- a/external/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs +++ b/external/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs @@ -7,7 +7,7 @@ // // ImergeHelper.cs // -// [....] +// igoro // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -32,4 +32,4 @@ namespace System.Linq.Parallel // Returns the merged output as an array. TInputOutput[] GetResultsAsArray(); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs b/external/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs index 748d853a73..d2f6a35cd4 100644 --- a/external/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs +++ b/external/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs @@ -7,7 +7,7 @@ // // IPartitionedStreamRecipient.cs // -// [....] +// igoro // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -22,4 +22,4 @@ namespace System.Linq.Parallel { void Receive(PartitionedStream partitionedStream); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs b/external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs index 62660a567c..c928a13d31 100644 --- a/external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs +++ b/external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs @@ -7,7 +7,7 @@ // // OrdinalIndexState.cs // -// [....] +// igoro // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -23,4 +23,4 @@ namespace System.Linq.Parallel Increasing = 2, // Indices of elements are increasing. Within each partition, elements are in the correct order. Shuffled = 3, // Indices are of arbitrary type. Elements appear in an arbitrary order in each partition. } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs b/external/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs index 1447b87013..fe09a4a7e9 100644 --- a/external/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs +++ b/external/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs @@ -7,7 +7,7 @@ // // ParallelQueryExecutionMode.cs // -// [....] +// igoro // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/external/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs b/external/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs index ea6b174f75..5eeb15854c 100644 --- a/external/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs +++ b/external/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs @@ -7,7 +7,7 @@ // // ParallelMergeOptions.cs // -// [....] +// igoro // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -60,4 +60,4 @@ namespace System.Linq /// FullyBuffered = 3 } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Core/System/Runtime/InteropServices/ComAwareEventInfo.cs b/external/referencesource/System.Core/System/Runtime/InteropServices/ComAwareEventInfo.cs index 6b61bbdd4d..86ac682095 100644 --- a/external/referencesource/System.Core/System/Runtime/InteropServices/ComAwareEventInfo.cs +++ b/external/referencesource/System.Core/System/Runtime/InteropServices/ComAwareEventInfo.cs @@ -18,6 +18,9 @@ namespace System.Runtime.InteropServices { #endregion #region protected overrides +#if FEATURE_NETCORE + [System.Security.SecuritySafeCritical] +#endif//FEATURE_NETCORE public override void AddEventHandler(object target, Delegate handler) { if (Marshal.IsComObject(target)) { // retrieve sourceIid and dispid @@ -25,9 +28,11 @@ namespace System.Runtime.InteropServices { int dispid; GetDataForComInvocation(_innerEventInfo, out sourceIid, out dispid); +#if FEATURE_CAS_POLICY // now validate the caller can call into native and redirect to ComEventHelpers.Combine SecurityPermission perm = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode); perm.Demand(); +#endif//FEATURE_CAS_POLICY System.Runtime.InteropServices.ComEventsHelper.Combine(target, sourceIid, dispid, handler); } else { // we are dealing with a managed object - just add the delegate through reflection @@ -35,6 +40,9 @@ namespace System.Runtime.InteropServices { } } +#if FEATURE_NETCORE + [System.Security.SecuritySafeCritical] +#endif//FEATURE_NETCORE public override void RemoveEventHandler(object target, Delegate handler) { if (Marshal.IsComObject(target)) { // retrieve sourceIid and dispid @@ -42,9 +50,11 @@ namespace System.Runtime.InteropServices { int dispid; GetDataForComInvocation(_innerEventInfo, out sourceIid, out dispid); +#if FEATURE_CAS_POLICY // now validate the caller can call into native and redirect to ComEventHelpers.Combine SecurityPermission perm = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode); perm.Demand(); +#endif//FEATURE_CAS_POLICY System.Runtime.InteropServices.ComEventsHelper.Remove(target, sourceIid, dispid, handler); } else { // we are dealing with a managed object - just add the delegate through relection diff --git a/external/referencesource/System.Core/System/Security/Cryptography/Aes.cs b/external/referencesource/System.Core/System/Security/Cryptography/Aes.cs index 981e08887c..913e423fd3 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/Aes.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/Aes.cs @@ -5,4 +5,4 @@ // ==--== // moved to mscorlib.dll -[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.Aes))] +[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.Aes))] \ No newline at end of file diff --git a/external/referencesource/System.Core/System/Security/Cryptography/AesCryptoServiceProvider.cs b/external/referencesource/System.Core/System/Security/Cryptography/AesCryptoServiceProvider.cs index 284990875a..bea786468a 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/AesCryptoServiceProvider.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/AesCryptoServiceProvider.cs @@ -6,6 +6,9 @@ using System; using System.Collections.Generic; +#if FEATURE_CORESYSTEM +using System.Core; +#endif using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; @@ -67,7 +70,7 @@ namespace System.Security.Cryptography { /// Value of the symmetric key used for encryption / decryption /// public override byte[] Key { - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] get { Contract.Ensures(m_key != null && !m_key.IsInvalid && !m_key.IsClosed); @@ -84,7 +87,7 @@ namespace System.Security.Cryptography { return keyValue; } - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] set { Contract.Ensures(m_key != null && !m_key.IsInvalid && !m_key.IsClosed); @@ -120,7 +123,7 @@ namespace System.Security.Cryptography { public override int KeySize { get { return base.KeySize; } - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] set { base.KeySize = value; @@ -136,7 +139,7 @@ namespace System.Security.Cryptography { /// Create an object to perform AES decryption with the current key and IV /// /// - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] public override ICryptoTransform CreateDecryptor() { Contract.Ensures(Contract.Result() != null); @@ -151,7 +154,7 @@ namespace System.Security.Cryptography { /// /// Create an object to perform AES decryption with the given key and IV /// - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] public override ICryptoTransform CreateDecryptor(byte[] key, byte[] iv) { Contract.Ensures(Contract.Result() != null); @@ -197,7 +200,7 @@ namespace System.Security.Cryptography { /// /// Create an object to do AES encryption with the current key and IV /// - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] public override ICryptoTransform CreateEncryptor() { Contract.Ensures(Contract.Result() != null); @@ -217,7 +220,7 @@ namespace System.Security.Cryptography { /// /// Create an object to do AES encryption with the given key and IV /// - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] public override ICryptoTransform CreateEncryptor(byte[] key, byte[] iv) { Contract.Ensures(Contract.Result() != null); @@ -263,7 +266,7 @@ namespace System.Security.Cryptography { /// /// Release any CAPI handles we're holding onto /// - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] protected override void Dispose(bool disposing) { Contract.Ensures(!disposing || m_key == null || m_key.IsClosed); Contract.Ensures(!disposing || m_cspHandle == null || m_cspHandle.IsClosed); @@ -360,7 +363,7 @@ namespace System.Security.Cryptography { /// /// Generate a new random key /// - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] public override void GenerateKey() { Contract.Ensures(m_key != null && !m_key.IsInvalid & !m_key.IsClosed); @@ -393,7 +396,7 @@ namespace System.Security.Cryptography { /// /// Generate a random initialization vector /// - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] public override void GenerateIV() { Contract.Ensures(IVValue != null && IVValue.Length == BlockSizeValue / 8); diff --git a/external/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs b/external/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs index 7272e139ab..48a8467961 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs @@ -13,8 +13,31 @@ using System.Runtime.InteropServices; using System.Diagnostics.Contracts; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; +using System.Security.Cryptography.X509Certificates; namespace System.Security.Cryptography { + + internal enum AsymmetricPaddingMode { + /// + /// No padding + /// + None = 1, // BCRYPT_PAD_NONE + + /// + /// PKCS #1 padding + /// + Pkcs1 = 2, // BCRYPT_PAD_PKCS1 + + /// + /// Optimal Asymmetric Encryption Padding + /// + Oaep = 4, // BCRYPT_PAD_OAEP + + /// + /// Probabilistic Signature Scheme padding + /// + Pss = 8 // BCRYPT_PAD_PSS + } /// /// Native interop with CNG's BCrypt layer. Native definitions can be found in bcrypt.h /// @@ -34,6 +57,29 @@ namespace System.Security.Cryptography { public const string Sha256 = "SHA256"; // BCRYPT_SHA256_ALGORITHM public const string Sha384 = "SHA384"; // BCRYPT_SHA384_ALGORITHM public const string Sha512 = "SHA512"; // BCRYPT_SHA512_ALGORITHM + internal const string Rsa = "RSA"; // BCRYPT_RSA_ALGORITHM + } + + /// + /// Well known key blob tyes + /// + internal static class KeyBlobType { + //During Win8 Windows introduced BCRYPT_PUBLIC_KEY_BLOB L"PUBLICBLOB" + //and #define BCRYPT_PRIVATE_KEY_BLOB L"PRIVATEBLOB". We should use the + //same on ProjectN and ProjectK + internal const string RsaFullPrivateBlob = "RSAFULLPRIVATEBLOB"; // BCRYPT_RSAFULLPRIVATE_BLOB + internal const string RsaPrivateBlob = "RSAPRIVATEBLOB"; // BCRYPT_RSAPRIVATE_BLOB + internal const string RsaPublicBlob = "RSAPUBLICBLOB"; // BCRYPT_PUBLIC_KEY_BLOB + } + + [StructLayout(LayoutKind.Sequential)] + internal struct BCRYPT_RSAKEY_BLOB { + internal KeyBlobMagicNumber Magic; + internal int BitLength; + internal int cbPublicExp; + internal int cbModulus; + internal int cbPrime1; + internal int cbPrime2; } /// @@ -61,7 +107,35 @@ namespace System.Security.Cryptography { ECDHPublicP521 = 0x354B4345, // BCRYPT_ECDH_PUBLIC_P521_MAGIC ECDsaPublicP256 = 0x31534345, // BCRYPT_ECDSA_PUBLIC_P256_MAGIC ECDsaPublicP384 = 0x33534345, // BCRYPT_ECDSA_PUBLIC_P384_MAGIC - ECDsaPublicP521 = 0x35534345 // BCRYPT_ECDSA_PUBLIC_P521_MAGIC + ECDsaPublicP521 = 0x35534345, // BCRYPT_ECDSA_PUBLIC_P521_MAGIC + RsaPublic = 0x31415352, // BCRYPT_RSAPUBLIC_MAGIC + RsaPrivate = 0x32415352, // BCRYPT_RSAPRIVATE_MAGIC + RsaFullPrivateMagic = 0x33415352, //BCRYPT_RSAFULLPRIVATE_MAGIC + KeyDataBlob = 0x4d42444b // BCRYPT_KEY_DATA_BLOB_MAGIC + } + + [StructLayout(LayoutKind.Sequential)] + internal struct BCRYPT_OAEP_PADDING_INFO { + [MarshalAs(UnmanagedType.LPWStr)] + internal string pszAlgId; + + internal IntPtr pbLabel; + + internal int cbLabel; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct BCRYPT_PKCS1_PADDING_INFO { + [MarshalAs(UnmanagedType.LPWStr)] + internal string pszAlgId; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct BCRYPT_PSS_PADDING_INFO { + [MarshalAs(UnmanagedType.LPWStr)] + internal string pszAlgId; + + internal int cbSalt; } /// @@ -73,6 +147,9 @@ namespace System.Security.Cryptography { public const string Tls = "TLS_PRF"; // BCRYPT_KDF_TLS_PRF } + internal const string BCRYPT_ECCPUBLIC_BLOB = "ECCPUBLICBLOB"; + internal const string BCRYPT_ECCPRIVATE_BLOB = "ECCPRIVATEBLOB"; + /// /// Well known BCrypt provider names /// @@ -163,6 +240,22 @@ namespace System.Security.Cryptography { string pszAlgId, // BCryptAlgorithm string pszImplementation, // ProviderNames int dwFlags); + + [DllImport("bcrypt.dll", SetLastError = true)] + internal static extern ErrorCode BCryptExportKey([In]SafeBCryptKeyHandle hKey, + [In]IntPtr hExportKey, + [In][MarshalAs(UnmanagedType.LPWStr)] string pszBlobType, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbOutput, + [In]int cbOutput, + [In]ref int pcbResult, + [In] int dwFlags); + + [DllImport("Crypt32.dll", SetLastError = true)] + internal static extern int CryptImportPublicKeyInfoEx2([In] uint dwCertEncodingType, + [In] ref X509Native.CERT_PUBLIC_KEY_INFO pInfo, + [In] int dwFlags, + [In] IntPtr pvAuxInfo, + [Out] out SafeBCryptKeyHandle phKey); } // @@ -326,5 +419,40 @@ namespace System.Security.Cryptography { return algorithmHandle; } + + [SecuritySafeCritical] + internal static SafeBCryptKeyHandle ImportAsymmetricPublicKey(X509Native.CERT_PUBLIC_KEY_INFO certPublicKeyInfo, int dwFlag) { + SafeBCryptKeyHandle keyHandle = null; + int error = UnsafeNativeMethods.CryptImportPublicKeyInfoEx2( + X509Native.X509_ASN_ENCODING, + ref certPublicKeyInfo, + dwFlag, + IntPtr.Zero, + out keyHandle); + if (error == 0) { + throw new CryptographicException(Marshal.GetLastWin32Error()); + } + return keyHandle; + } + + [SecuritySafeCritical] + internal static byte[] ExportBCryptKey(SafeBCryptKeyHandle hKey, string blobType) { + byte[] keyBlob = null; + int length = 0; + + ErrorCode error = UnsafeNativeMethods.BCryptExportKey(hKey, IntPtr.Zero, blobType, null, 0, ref length, 0); + + if (error != ErrorCode.BufferToSmall && error != ErrorCode.Success) + { + throw new CryptographicException(Marshal.GetLastWin32Error()); + } + + keyBlob = new byte[length]; + error = UnsafeNativeMethods.BCryptExportKey(hKey, IntPtr.Zero, blobType, keyBlob, length, ref length, 0); + if (error != ErrorCode.Success) { + throw new CryptographicException(Marshal.GetLastWin32Error()); + } + return keyBlob; + } } } diff --git a/external/referencesource/System.Core/System/Security/Cryptography/CapiNative.cs b/external/referencesource/System.Core/System/Security/Cryptography/CapiNative.cs index eaf838ec1e..b9f7080aff 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/CapiNative.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/CapiNative.cs @@ -5,14 +5,19 @@ // ==--== using System; +#if FEATURE_CORESYSTEM +using System.Core; +#endif using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.Contracts; using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using System.Security; -using System.Diagnostics.Contracts; +using System.Text; using Microsoft.Win32.SafeHandles; namespace System.Security.Cryptography { @@ -171,15 +176,62 @@ namespace System.Security.Cryptography { public fixed byte szName[20]; } + internal const uint ALG_CLASS_SIGNATURE = (1 << 13); + internal const uint ALG_TYPE_RSA = (2 << 9); + internal const uint ALG_SID_RSA_ANY = 0; + internal const uint ALG_SID_DSS_ANY = 0; + internal const uint ALG_TYPE_DSS = (1 << 9); + internal const uint ALG_CLASS_KEY_EXCHANGE = (5 << 13); + + internal const uint CALG_RSA_SIGN = (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY); + internal const uint CALG_DSS_SIGN = (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY); + internal const uint CALG_RSA_KEYX = (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY); + internal const uint CNG_RSA_PUBLIC_KEY_BLOB = 72; + + internal const uint X509_ASN_ENCODING = 0x00000001; + internal const uint PKCS_7_ASN_ENCODING = 0x00010000; + + internal const uint CRYPT_OID_INFO_OID_KEY = 1; + + internal const uint LMEM_FIXED = 0x0000; + internal const uint LMEM_ZEROINIT = 0x0040; + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct CRYPT_OID_INFO { + internal CRYPT_OID_INFO(int size) { + cbSize = (uint)size; + pszOID = null; + pwszName = null; + dwGroupId = 0; + Algid = 0; + ExtraInfo = new CRYPTOAPI_BLOB(); + } + internal uint cbSize; + [MarshalAs(UnmanagedType.LPStr)] + internal string pszOID; + internal string pwszName; + internal uint dwGroupId; + internal uint Algid; + internal CRYPTOAPI_BLOB ExtraInfo; + } + + +#if FEATURE_CORESYSTEM + [SecurityCritical] +#else #pragma warning disable 618 // Have not migrated to v4 transparency yet [SecurityCritical(SecurityCriticalScope.Everything)] #pragma warning restore 618 +#endif [SuppressUnmanagedCodeSecurity] internal static class UnsafeNativeMethods { /// /// Calculate the public key token for a given public key /// [DllImport("clr")] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern int _AxlPublicKeyBlobToPublicKeyToken(ref CRYPTOAPI_BLOB pCspPublicKeyBlob, [Out] out SafeAxlBufferHandle ppwszPublicKeyToken); @@ -189,6 +241,9 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true, CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptAcquireContext([Out] out SafeCspHandle phProv, string pszContainer, string pszProvider, @@ -200,6 +255,9 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptCreateHash(SafeCspHandle hProv, AlgorithmId Algid, SafeCapiKeyHandle hKey, @@ -211,6 +269,9 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptDecrypt(SafeCapiKeyHandle hKey, SafeCapiHashHandle hHash, [MarshalAs(UnmanagedType.Bool)] bool Final, @@ -222,9 +283,14 @@ namespace System.Security.Cryptography { /// Duplicate a key handle /// [DllImport("advapi32")] +#if !FEATURE_CORESYSTEM [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptDuplicateKey(SafeCapiKeyHandle hKey, IntPtr pdwReserved, int dwFlags, @@ -235,6 +301,9 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptEncrypt(SafeCapiKeyHandle hKey, SafeCapiHashHandle hHash, [MarshalAs(UnmanagedType.Bool)] bool Final, @@ -248,6 +317,9 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptExportKey(SafeCapiKeyHandle hKey, SafeCapiKeyHandle hExpKey, int dwBlobType, // (int)KeyBlobType @@ -259,6 +331,9 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptGenKey(SafeCspHandle hProv, AlgorithmId Algid, KeyFlags dwFlags, @@ -269,6 +344,9 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptGenRandom(SafeCspHandle hProv, int dwLen, [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbBuffer); @@ -278,6 +356,9 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptGetHashParam(SafeCapiHashHandle hHash, HashParameter dwParam, [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbData, @@ -289,6 +370,9 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptGetProvParam(SafeCspHandle hProv, ProviderParameter dwParam, IntPtr pbData, @@ -300,6 +384,9 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptHashData(SafeCapiHashHandle hHash, [MarshalAs(UnmanagedType.LPArray)] byte[] pbData, int dwDataLen, @@ -310,6 +397,9 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptImportKey(SafeCspHandle hProv, [MarshalAs(UnmanagedType.LPArray)] byte[] pbData, int dwDataLen, @@ -322,10 +412,76 @@ namespace System.Security.Cryptography { /// [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptSetKeyParam(SafeCapiKeyHandle hKey, KeyParameter dwParam, [MarshalAs(UnmanagedType.LPArray)] byte[] pbData, int dwFlags); + + //Added for X509Certificate extension support +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [DllImport("CRYPT32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + internal extern static + IntPtr CryptFindOIDInfo( + [In] uint dwKeyType, + [In] IntPtr pvKey, + [In] OidGroup dwGroupId); + +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [DllImport("CRYPT32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + internal extern static + IntPtr CryptFindOIDInfo( + [In] uint dwKeyType, + [In] SafeLocalAllocHandle pvKey, + [In] OidGroup dwGroupId); + + +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [DllImport("Crypt32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + internal static extern + bool CryptDecodeObject( + [In] uint dwCertEncodingType, + [In] IntPtr lpszStructType, + [In] IntPtr pbEncoded, + [In] uint cbEncoded, + [In] uint dwFlags, + [In, Out] SafeLocalAllocHandle pvStructInfo, + [In, Out] IntPtr pcbStructInfo); + +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [DllImport("Crypt32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + internal static extern + bool CryptDecodeObject( + [In] uint dwCertEncodingType, + [In] IntPtr lpszStructType, + [In] byte[] pbEncoded, + [In] uint cbEncoded, + [In] uint dwFlags, + [In, Out] SafeLocalAllocHandle pvStructInfo, + [In, Out] IntPtr pcbStructInfo); +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [DllImport("KERNEL32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + internal static extern + SafeLocalAllocHandle LocalAlloc( + [In] uint uFlags, + [In] IntPtr sizetdwBytes); } // @@ -627,5 +783,239 @@ namespace System.Security.Cryptography { throw new CryptographicException(Marshal.GetLastWin32Error()); } } + + //Wrapper methods for certificate extensions + + /// + /// Local alloc wrapper. + /// + /// + /// + /// + [SecuritySafeCritical] + internal static SafeLocalAllocHandle LocalAlloc(uint uFlags, IntPtr sizetdwBytes) { + SafeLocalAllocHandle safeLocalAllocHandle = UnsafeNativeMethods.LocalAlloc(uFlags, sizetdwBytes); + if (safeLocalAllocHandle == null || safeLocalAllocHandle.IsInvalid) { + throw new OutOfMemoryException(); + } + return safeLocalAllocHandle; + } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + [SecuritySafeCritical] + internal static unsafe bool DecodeObject(IntPtr pszStructType, + IntPtr pbEncoded, + uint cbEncoded, + out SafeLocalAllocHandle decodedValue, + out uint cbDecodedValue) + { + // Initialize out parameters + decodedValue = SafeLocalAllocHandle.InvalidHandle; + cbDecodedValue = 0; + + // Decode + uint cbDecoded = 0; + SafeLocalAllocHandle ptr = SafeLocalAllocHandle.InvalidHandle; + if (!UnsafeNativeMethods.CryptDecodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + pszStructType, + pbEncoded, + cbEncoded, + 0, + ptr, + new IntPtr(&cbDecoded))) { + return false; + } + ptr = LocalAlloc(LMEM_FIXED, new IntPtr(cbDecoded)); + + if (!UnsafeNativeMethods.CryptDecodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + pszStructType, + pbEncoded, + cbEncoded, + 0, + ptr, + new IntPtr(&cbDecoded))) { + return false; + } + // Return decoded values + decodedValue = ptr; + cbDecodedValue = cbDecoded; + + return true; + } + + /// + /// + /// + /// + /// + /// + /// + /// + [SecuritySafeCritical] + internal static unsafe bool DecodeObject(IntPtr pszStructType, + byte[] pbEncoded, + out SafeLocalAllocHandle decodedValue, + out uint cbDecodedValue) + { + // Initialize out parameters + decodedValue = SafeLocalAllocHandle.InvalidHandle; + cbDecodedValue = 0; + + // Decode + uint cbDecoded = 0; + SafeLocalAllocHandle pbDecoded = SafeLocalAllocHandle.InvalidHandle; + + if (!UnsafeNativeMethods.CryptDecodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + pszStructType, + pbEncoded, + (uint)pbEncoded.Length, + 0, + pbDecoded, + new IntPtr(&cbDecoded))) { + return false; + } + pbDecoded = LocalAlloc(LMEM_FIXED, new IntPtr(cbDecoded)); + if (!UnsafeNativeMethods.CryptDecodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + pszStructType, + pbEncoded, + (uint)pbEncoded.Length, + 0, + pbDecoded, + new IntPtr(&cbDecoded))) { + return false; + } + // Return decoded values + decodedValue = pbDecoded; + cbDecodedValue = cbDecoded; + + return true; + } + + /// + /// + /// + /// + /// + /// + /// + [SecuritySafeCritical] + internal static CRYPT_OID_INFO CryptFindOIDInfo( + [In] uint dwKeyType, + [In] IntPtr pvKey, + [In] OidGroup dwGroupId) { + + if (pvKey == IntPtr.Zero) { + throw new ArgumentNullException("pvKey"); + } + CRYPT_OID_INFO pOIDInfo = new CRYPT_OID_INFO(Marshal.SizeOf(typeof(CRYPT_OID_INFO))); + IntPtr pv = UnsafeNativeMethods.CryptFindOIDInfo(dwKeyType, + pvKey, + dwGroupId); + + if (pv != IntPtr.Zero) { + pOIDInfo = (CRYPT_OID_INFO)Marshal.PtrToStructure(pv, typeof(CRYPT_OID_INFO)); + } + return pOIDInfo; + } + + /// + /// + /// + /// + /// + /// + /// + [SecuritySafeCritical] + internal static CRYPT_OID_INFO CryptFindOIDInfo( + [In] uint dwKeyType, + [In] SafeLocalAllocHandle pvKey, + [In] OidGroup dwGroupId) { + + if (pvKey == null) { + throw new ArgumentNullException("pvKey"); + } + if (pvKey.IsInvalid) { + throw new CryptographicException("SR.GetString(SR.Cryptography_InvalidHandle)", "pvKey"); + } + CRYPT_OID_INFO pOIDInfo = new CRYPT_OID_INFO(Marshal.SizeOf(typeof(CRYPT_OID_INFO))); + IntPtr pv = UnsafeNativeMethods.CryptFindOIDInfo(dwKeyType, + pvKey, + dwGroupId); + + if (pv != IntPtr.Zero) { + pOIDInfo = (CRYPT_OID_INFO)Marshal.PtrToStructure(pv, typeof(CRYPT_OID_INFO)); + } + return pOIDInfo; + } + } + + /// + /// Safe local handle class + /// + internal sealed class SafeLocalAllocHandle : SafeHandleZeroOrMinusOneIsInvalid { + [SecuritySafeCritical] + private SafeLocalAllocHandle() + : base(true) { + } + + [DllImport("kernel32.dll")] + private static extern IntPtr LocalFree(IntPtr hMem); + + [SecuritySafeCritical] + internal T Read(int offset) where T : struct { + bool addedRef = false; + RuntimeHelpers.PrepareConstrainedRegions(); + try { + DangerousAddRef(ref addedRef); + unsafe { + IntPtr pBase = new IntPtr((byte*)handle.ToPointer() + offset); + return (T)Marshal.PtrToStructure(pBase, typeof(T)); + } + } + finally { + if (addedRef) { + DangerousRelease(); + } + } + } + + [SecuritySafeCritical] + protected override bool ReleaseHandle() { + return LocalFree(handle) == IntPtr.Zero; + } + + [SecuritySafeCritical] + internal SafeLocalAllocHandle(IntPtr handle) + : base(true) { + SetHandle(handle); + } + + internal static SafeLocalAllocHandle InvalidHandle { + [SecuritySafeCritical] + get { return new SafeLocalAllocHandle(IntPtr.Zero); } + } + } + + /// + /// + /// + internal class X509Utils { + + [SecuritySafeCritical] + internal static SafeLocalAllocHandle StringToAnsiPtr(string s) { + byte[] arr = new byte[s.Length + 1]; + Encoding.ASCII.GetBytes(s, 0, s.Length, arr, 0); + SafeLocalAllocHandle pb = CapiNative.LocalAlloc(CapiNative.LMEM_FIXED, new IntPtr(arr.Length)); + Marshal.Copy(arr, 0, pb.DangerousGetHandle(), arr.Length); + return pb; + } } } diff --git a/external/referencesource/System.Core/System/Security/Cryptography/CapiSymmetricAlgorithm.cs b/external/referencesource/System.Core/System/Security/Cryptography/CapiSymmetricAlgorithm.cs index 7f15316701..490e61651f 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/CapiSymmetricAlgorithm.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/CapiSymmetricAlgorithm.cs @@ -5,6 +5,9 @@ // ==--== using System; +#if FEATURE_CORESYSTEM +using System.Core; +#endif using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; diff --git a/external/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs b/external/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs index 45c8bcd349..bb161cb53f 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs @@ -28,7 +28,8 @@ namespace System.Security.Cryptography { private static volatile CngAlgorithm s_sha256; private static volatile CngAlgorithm s_sha384; private static volatile CngAlgorithm s_sha512; - + private static volatile CngAlgorithm s_rsa; + private string m_algorithm; public CngAlgorithm(string algorithm) { @@ -99,6 +100,16 @@ namespace System.Security.Cryptography { // Well known algorithms // + public static CngAlgorithm Rsa { + get { + Contract.Ensures(Contract.Result() != null); + if (s_rsa == null) { + s_rsa = new CngAlgorithm(BCryptNative.AlgorithmName.Rsa); + } + return s_rsa; + } + } + public static CngAlgorithm ECDiffieHellmanP256 { get { Contract.Ensures(Contract.Result() != null); diff --git a/external/referencesource/System.Core/System/Security/Cryptography/CngKey.cs b/external/referencesource/System.Core/System/Security/Cryptography/CngKey.cs index 5c850ed0b8..13ea41c2fb 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/CngKey.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/CngKey.cs @@ -126,10 +126,19 @@ namespace System.Security.Cryptography { Contract.Assert(m_keyHandle != null); bool foundProperty; - byte[] ephemeralProperty = NCryptNative.GetProperty(m_keyHandle, - NCryptNative.KeyPropertyName.ClrIsEphemeral, - CngPropertyOptions.CustomProperty, - out foundProperty); + byte[] ephemeralProperty = null; + try { + ephemeralProperty = NCryptNative.GetProperty(m_keyHandle, + NCryptNative.KeyPropertyName.ClrIsEphemeral, + CngPropertyOptions.CustomProperty, + out foundProperty); + } + catch (CryptographicException) { + // Third party Key providers, and Windows PCP KSP won't recognize this property; + // and Win32 layer does not enforce error return contract. + // Therefore, they can return whatever error code they think appropriate. + return false; + } return foundProperty && ephemeralProperty != null && diff --git a/external/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs b/external/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs index 8108af7458..efb002c581 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/ECDiffieHellman.cs @@ -26,7 +26,11 @@ namespace System.Security.Cryptography { // public static new ECDiffieHellman Create() { +#if MONO + throw new NotImplementedException (); +#else return Create(typeof(ECDiffieHellmanCng).FullName); +#endif } public static new ECDiffieHellman Create(string algorithm) { diff --git a/external/referencesource/System.Core/System/Security/Cryptography/ECDsa.cs b/external/referencesource/System.Core/System/Security/Cryptography/ECDsa.cs index 6bd7201ced..22fb8b5052 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/ECDsa.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/ECDsa.cs @@ -5,6 +5,7 @@ // ==--== using System; +using System.IO; namespace System.Security.Cryptography { /// @@ -25,7 +26,11 @@ namespace System.Security.Cryptography { // public static new ECDsa Create() { +#if MONO + throw new NotImplementedException (); +#else return Create(typeof(ECDsaCng).FullName); +#endif } public static new ECDsa Create(string algorithm) { @@ -40,7 +45,97 @@ namespace System.Security.Cryptography { // Signature operations // + // ECDsa does not encode the algorithm identifier into the signature blob, therefore SignHash and VerifyHash + // do not need the HashAlgorithmName value, only SignData and VerifyData do. public abstract byte[] SignHash(byte[] hash); public abstract bool VerifyHash(byte[] hash, byte[] signature); + + protected virtual byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) { + throw DerivedClassMustOverride(); + } + + protected virtual byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) { + throw DerivedClassMustOverride(); + } + + public virtual byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm) { + if (data == null) { + throw new ArgumentNullException("data"); + } + return SignData(data, 0, data.Length, hashAlgorithm); + } + + public virtual byte[] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) { + if (data == null) { throw new ArgumentNullException("data"); } + if (offset < 0 || offset > data.Length) { throw new ArgumentOutOfRangeException("offset"); } + if (count < 0 || count > data.Length - offset) { throw new ArgumentOutOfRangeException("count"); } + if (String.IsNullOrEmpty(hashAlgorithm.Name)) { throw HashAlgorithmNameNullOrEmpty(); } + + byte[] hash = HashData(data, offset, count, hashAlgorithm); + return SignHash(hash); + } + + public virtual byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm) { + if (data == null) { + throw new ArgumentNullException("data"); + } + if (String.IsNullOrEmpty(hashAlgorithm.Name)) { + throw HashAlgorithmNameNullOrEmpty(); + } + + byte[] hash = HashData(data, hashAlgorithm); + return SignHash(hash); + } + + public bool VerifyData(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm) { + if (data == null) { + throw new ArgumentNullException("data"); + } + return VerifyData(data, 0, data.Length, signature, hashAlgorithm); + } + + public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm) { + if (data == null) { + throw new ArgumentNullException("data"); + } + if (offset < 0 || offset > data.Length) { + throw new ArgumentOutOfRangeException("offset"); + } + if (count < 0 || count > data.Length - offset) { + throw new ArgumentOutOfRangeException("count"); + } + if (signature == null) { + throw new ArgumentNullException("signature"); + } + if (String.IsNullOrEmpty(hashAlgorithm.Name)) { + throw HashAlgorithmNameNullOrEmpty(); + } + + byte[] hash = HashData(data, offset, count, hashAlgorithm); + return VerifyHash(hash, signature); + } + + public bool VerifyData(Stream data, byte[] signature, HashAlgorithmName hashAlgorithm) { + if (data == null) { + throw new ArgumentNullException("data"); + } + if (signature == null) { + throw new ArgumentNullException("signature"); + } + if (String.IsNullOrEmpty(hashAlgorithm.Name)) { + throw HashAlgorithmNameNullOrEmpty(); + } + + byte[] hash = HashData(data, hashAlgorithm); + return VerifyHash(hash, signature); + } + + private static Exception DerivedClassMustOverride() { + return new NotImplementedException(SR.GetString(SR.NotSupported_SubclassOverride)); + } + + internal static Exception HashAlgorithmNameNullOrEmpty() { + return new ArgumentException(SR.GetString(SR.Cryptography_HashAlgorithmNameNullOrEmpty), "hashAlgorithm"); + } } } diff --git a/external/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs b/external/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs index e152be8dba..40505e30dd 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/ECDsaCng.cs @@ -375,5 +375,37 @@ namespace System.Security.Cryptography { return NCryptNative.VerifySignature(keyHandle, hash, signature); } } + + /// + /// Helper property to get the NCrypt key handle + /// + private SafeNCryptKeyHandle KeyHandle { + [SecuritySafeCritical] + get { return Key.Handle; } + } + + protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) { + // we're sealed and the base should have checked this before calling us + Debug.Assert(data != null); + Debug.Assert(offset >= 0 && offset <= data.Length); + Debug.Assert(count >= 0 && count <= data.Length - offset); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name)); + + using (BCryptHashAlgorithm hasher = new BCryptHashAlgorithm(new CngAlgorithm(hashAlgorithm.Name), BCryptNative.ProviderName.MicrosoftPrimitiveProvider)) { + hasher.HashCore(data, offset, count); + return hasher.HashFinal(); + } + } + + protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) { + // we're sealed and the base should have checked this before calling us + Debug.Assert(data != null); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name)); + + using (BCryptHashAlgorithm hasher = new BCryptHashAlgorithm(new CngAlgorithm(hashAlgorithm.Name), BCryptNative.ProviderName.MicrosoftPrimitiveProvider)) { + hasher.HashStream(data); + return hasher.HashFinal(); + } + } } } diff --git a/external/referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs b/external/referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs index ce1c174059..d8cfcb4b52 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs @@ -16,4 +16,4 @@ namespace System.Security.Cryptography { /// Rfc4050 } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs b/external/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs index 47586cf5ec..cf56209111 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs @@ -129,7 +129,8 @@ namespace System.Security.Cryptography { BadSignature = unchecked((int)0x80090006), // NTE_BAD_SIGNATURE NotFound = unchecked((int)0x80090011), // NTE_NOT_FOUND KeyDoesNotExist = unchecked((int)0x80090016), // NTE_BAD_KEYSET - BufferTooSmall = unchecked((int)0x80090028) // NTE_BUFFER_TOO_SMALL + BufferTooSmall = unchecked((int)0x80090028), // NTE_BUFFER_TOO_SMALL + NoMoreItems = unchecked((int)0x8009002a) // NTE_NO_MORE_ITEMS } /// @@ -380,8 +381,137 @@ namespace System.Security.Cryptography { [MarshalAs(UnmanagedType.LPArray)] byte[] pbSignature, int cbSignature, int dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, + [In] ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pPaddingInfo, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbHashValue, + int cbHashValue, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbSignature, + int cbSignature, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, + [In] ref BCryptNative.BCRYPT_PSS_PADDING_INFO pPaddingInfo, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbHashValue, + int cbHashValue, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbSignature, + int cbSignature, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, + [In] ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pPaddingInfo, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbHashValue, + int cbHashValue, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbSignature, + int cbSignature, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, + [In] ref BCryptNative.BCRYPT_PSS_PADDING_INFO pPaddingInfo, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbHashValue, + int cbHashValue, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbSignature, + int cbSignature, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbInput, + int cbInput, + [In] ref BCryptNative.BCRYPT_OAEP_PADDING_INFO pvPadding, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbOutput, + int cbOutput, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbInput, + int cbInput, + [In] ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pvPadding, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbOutput, + int cbOutput, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbInput, + int cbInput, + [In] ref BCryptNative.BCRYPT_OAEP_PADDING_INFO pvPadding, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbOutput, + int cbOutput, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbInput, + int cbInput, + [In] ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pvPadding, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbOutput, + int cbOutput, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); } + + /// + /// Adapter to wrap specific NCryptDecrypt P/Invokes with specific padding info + /// + [SecuritySafeCritical] + private delegate ErrorCode NCryptDecryptor(SafeNCryptKeyHandle hKey, + byte[] pbInput, + int cbInput, + ref T pvPadding, + byte[] pbOutput, + int cbOutput, + out int pcbResult, + AsymmetricPaddingMode dwFlags); + + /// + /// Adapter to wrap specific NCryptEncrypt P/Invokes with specific padding info + /// + [SecuritySafeCritical] + private delegate ErrorCode NCryptEncryptor(SafeNCryptKeyHandle hKey, + byte[] pbInput, + int cbInput, + ref T pvPadding, + byte[] pbOutput, + int cbOutput, + out int pcbResult, + AsymmetricPaddingMode dwFlags); + + /// + /// Adapter to wrap specific NCryptSignHash P/Invokes with a specific padding info + /// + [SecuritySafeCritical] + private delegate ErrorCode NCryptHashSigner(SafeNCryptKeyHandle hKey, + ref T pvPaddingInfo, + byte[] pbHashValue, + int cbHashValue, + byte[] pbSignature, + int cbSignature, + out int pcbResult, + AsymmetricPaddingMode dwFlags); + + /// + /// Adapter to wrap specific NCryptVerifySignature P/Invokes with a specific padding info + /// + [SecuritySafeCritical] + private delegate ErrorCode NCryptSignatureVerifier(SafeNCryptKeyHandle hKey, + ref T pvPaddingInfo, + byte[] pbHashValue, + int cbHashValue, + byte[] pbSignature, + int cbSignature, + AsymmetricPaddingMode dwFlags) where T : struct; + // // Utility and wrapper functions // @@ -389,6 +519,340 @@ namespace System.Security.Cryptography { private static volatile bool s_haveNcryptSupported; private static volatile bool s_ncryptSupported; + + /// + /// Generic decryption method, wrapped by decryption calls for specific padding modes + /// + [SecuritySafeCritical] + private static byte[] DecryptData(SafeNCryptKeyHandle key, + byte[] data, + ref T paddingInfo, + AsymmetricPaddingMode paddingMode, + NCryptDecryptor decryptor) where T : struct { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(data != null, "data != null"); + Debug.Assert(decryptor != null, "decryptor != null"); + + // Figure out how big of a buffer is needed to store the decrypted data + int decryptedSize = 0; + ErrorCode error = decryptor(key, + data, + data.Length, + ref paddingInfo, + null, + 0, + out decryptedSize, + paddingMode); + if (error != ErrorCode.Success && error != ErrorCode.BufferTooSmall) { + throw new CryptographicException((int)error); + } + + // Do the decryption + byte[] decrypted = new byte[decryptedSize]; + error = decryptor(key, + data, + data.Length, + ref paddingInfo, + decrypted, + decrypted.Length, + out decryptedSize, + paddingMode); + if (error != ErrorCode.Success) { + throw new CryptographicException((int)error); + } + + // Sometimes decryptedSize can be less than the allocated buffer size + // So resize the array to the actual returned plaintext + Array.Resize(ref decrypted, decryptedSize); + + return decrypted; + } + + /// + /// Decrypt data using PKCS1 padding + /// + [SecuritySafeCritical] + internal static byte[] DecryptDataPkcs1(SafeNCryptKeyHandle key, byte[] data) { + BCryptNative.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new BCryptNative.BCRYPT_PKCS1_PADDING_INFO(); + + return DecryptData(key, + data, + ref pkcs1Info, + AsymmetricPaddingMode.Pkcs1, + UnsafeNativeMethods.NCryptDecrypt); + } + + /// + /// Decrypt data using OAEP padding + /// + [SecuritySafeCritical] + internal static byte[] DecryptDataOaep(SafeNCryptKeyHandle key, + byte[] data, + string hashAlgorithm) { + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + + BCryptNative.BCRYPT_OAEP_PADDING_INFO oaepInfo = new BCryptNative.BCRYPT_OAEP_PADDING_INFO(); + oaepInfo.pszAlgId = hashAlgorithm; + + return DecryptData(key, + data, + ref oaepInfo, + AsymmetricPaddingMode.Oaep, + UnsafeNativeMethods.NCryptDecrypt); + } + + /// + /// Generic encryption method, wrapped by decryption calls for specific padding modes + /// + [SecuritySafeCritical] + private static byte[] EncryptData(SafeNCryptKeyHandle key, + byte[] data, + ref T paddingInfo, + AsymmetricPaddingMode paddingMode, + NCryptEncryptor encryptor) where T : struct { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(data != null, "data != null"); + Debug.Assert(encryptor != null, "encryptor != null"); + + // Figure out how big of a buffer is to encrypt the data + int encryptedSize = 0; + ErrorCode error = encryptor(key, + data, + data.Length, + ref paddingInfo, + null, + 0, + out encryptedSize, + paddingMode); + if (error != ErrorCode.Success && error != ErrorCode.BufferTooSmall) { + throw new CryptographicException((int)error); + } + + // Do the encryption + byte[] encrypted = new byte[encryptedSize]; + error = encryptor(key, + data, + data.Length, + ref paddingInfo, + encrypted, + encrypted.Length, + out encryptedSize, + paddingMode); + if (error != ErrorCode.Success) { + throw new CryptographicException((int)error); + } + + return encrypted; + } + + /// + /// Encrypt data using OAEP padding + /// + [SecuritySafeCritical] + internal static byte[] EncryptDataOaep(SafeNCryptKeyHandle key, + byte[] data, + string hashAlgorithm) { + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + + BCryptNative.BCRYPT_OAEP_PADDING_INFO oaepInfo = new BCryptNative.BCRYPT_OAEP_PADDING_INFO(); + oaepInfo.pszAlgId = hashAlgorithm; + + return EncryptData(key, + data, + ref oaepInfo, + AsymmetricPaddingMode.Oaep, + UnsafeNativeMethods.NCryptEncrypt); + } + + /// + /// Encrypt data using PKCS1 padding + /// + [SecuritySafeCritical] + internal static byte[] EncryptDataPkcs1(SafeNCryptKeyHandle key, byte[] data) { + BCryptNative.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new BCryptNative.BCRYPT_PKCS1_PADDING_INFO(); + + return EncryptData(key, + data, + ref pkcs1Info, + AsymmetricPaddingMode.Pkcs1, + UnsafeNativeMethods.NCryptEncrypt); + } + + /// + /// Generic signature method, wrapped by signature calls for specific padding modes + /// + [SecuritySafeCritical] + private static byte[] SignHash(SafeNCryptKeyHandle key, + byte[] hash, + ref T paddingInfo, + AsymmetricPaddingMode paddingMode, + NCryptHashSigner signer) where T : struct { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsInvalid && !key.IsClosed, "!key.IsInvalid && !key.IsClosed"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(signer != null, "signer != null"); + + // Figure out how big the signature is + int signatureSize = 0; + ErrorCode error = signer(key, + ref paddingInfo, + hash, + hash.Length, + null, + 0, + out signatureSize, + paddingMode); + if (error != ErrorCode.Success && error != ErrorCode.BufferTooSmall) { + throw new CryptographicException((int)error); + } + + // Sign the hash + byte[] signature = new byte[signatureSize]; + error = signer(key, + ref paddingInfo, + hash, + hash.Length, + signature, + signature.Length, + out signatureSize, + paddingMode); + if (error != ErrorCode.Success) { + throw new CryptographicException((int)error); + } + return signature; + } + + /// + /// Sign a hash, using PKCS1 padding + /// + [SecuritySafeCritical] + internal static byte[] SignHashPkcs1(SafeNCryptKeyHandle key, + byte[] hash, + string hashAlgorithm) { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + + BCryptNative.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new BCryptNative.BCRYPT_PKCS1_PADDING_INFO(); + pkcs1Info.pszAlgId = hashAlgorithm; + + return SignHash(key, + hash, + ref pkcs1Info, + AsymmetricPaddingMode.Pkcs1, + UnsafeNativeMethods.NCryptSignHash); + } + + /// + /// Sign a hash, using PSS padding + /// + [SecuritySafeCritical] + internal static byte[] SignHashPss(SafeNCryptKeyHandle key, + byte[] hash, + string hashAlgorithm, + int saltBytes) { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + Debug.Assert(saltBytes >= 0, "saltBytes >= 0"); + + BCryptNative.BCRYPT_PSS_PADDING_INFO pssInfo = new BCryptNative.BCRYPT_PSS_PADDING_INFO(); + pssInfo.pszAlgId = hashAlgorithm; + pssInfo.cbSalt = saltBytes; + + return SignHash(key, + hash, + ref pssInfo, + AsymmetricPaddingMode.Pss, + UnsafeNativeMethods.NCryptSignHash); + } + + /// + /// Generic signature verification method, wrapped by verification calls for specific padding modes + /// + [SecuritySafeCritical] + private static bool VerifySignature(SafeNCryptKeyHandle key, + byte[] hash, + byte[] signature, + ref T paddingInfo, + AsymmetricPaddingMode paddingMode, + NCryptSignatureVerifier verifier) where T : struct { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(signature != null, "signature != null"); + Debug.Assert(verifier != null, "verifier != null"); + + ErrorCode error = verifier(key, + ref paddingInfo, + hash, + hash.Length, + signature, + signature.Length, + paddingMode); + if (error != ErrorCode.Success && error != ErrorCode.BadSignature) { + throw new CryptographicException((int)error); + } + + return error == ErrorCode.Success; + } + + /// + /// Verify the signature of a hash using PKCS #1 padding + /// + [SecuritySafeCritical] + internal static bool VerifySignaturePkcs1(SafeNCryptKeyHandle key, + byte[] hash, + string hashAlgorithm, + byte[] signature) { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + Debug.Assert(signature != null, "signature != null"); + + BCryptNative.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new BCryptNative.BCRYPT_PKCS1_PADDING_INFO(); + pkcs1Info.pszAlgId = hashAlgorithm; + + return VerifySignature(key, + hash, + signature, + ref pkcs1Info, + AsymmetricPaddingMode.Pkcs1, + UnsafeNativeMethods.NCryptVerifySignature); + } + + /// + /// Verify the signature of a hash using PSS padding + /// + [SecuritySafeCritical] + internal static bool VerifySignaturePss(SafeNCryptKeyHandle key, + byte[] hash, + string hashAlgorithm, + int saltBytes, + byte[] signature) { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + Debug.Assert(signature != null, "signature != null"); + + BCryptNative.BCRYPT_PSS_PADDING_INFO pssInfo = new BCryptNative.BCRYPT_PSS_PADDING_INFO(); + pssInfo.pszAlgId = hashAlgorithm; + pssInfo.cbSalt = saltBytes; + + return VerifySignature(key, + hash, + signature, + ref pssInfo, + AsymmetricPaddingMode.Pss, + UnsafeNativeMethods.NCryptVerifySignature); + } + /// /// Determine if NCrypt is supported on the current machine /// @@ -484,9 +948,7 @@ namespace System.Security.Cryptography { if (error != ErrorCode.Success) { throw new CryptographicException((int)error); } - - // Key handles are no longer valid after deleting - key.Dispose(); + key.SetHandleAsInvalid(); } /// diff --git a/external/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs b/external/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs new file mode 100644 index 0000000000..3085b90e24 --- /dev/null +++ b/external/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs @@ -0,0 +1,508 @@ +using System; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Runtime.InteropServices; +using System.Security.Permissions; +using Microsoft.Win32.SafeHandles; + +namespace System.Security.Cryptography +{ + public sealed class RSACng : RSA + { + // See https://msdn.microsoft.com/en-us/library/windows/desktop/bb931354(v=vs.85).aspx + private static KeySizes[] s_legalKeySizes = new KeySizes[] { new KeySizes(512, 16384, 64) }; + + // CngKeyBlob formats for RSA key blobs + private static CngKeyBlobFormat s_rsaFullPrivateBlob = new CngKeyBlobFormat(BCryptNative.KeyBlobType.RsaFullPrivateBlob); + private static CngKeyBlobFormat s_rsaPrivateBlob = new CngKeyBlobFormat(BCryptNative.KeyBlobType.RsaPrivateBlob); + private static CngKeyBlobFormat s_rsaPublicBlob = new CngKeyBlobFormat(BCryptNative.KeyBlobType.RsaPublicBlob); + + // Key handle + private CngKey _key; + + /// + /// Create an RSACng algorithm with a random 2048 bit key pair. + /// + public RSACng() : this(2048) { } + + /// + /// Creates a new RSACng object that will use a randomly generated key of the specified size. + /// Valid key sizes range from 384 to 16384 bits, in increments of 8. It's suggested that a + /// minimum size of 2048 bits be used for all keys. + /// + /// Size of the key to generate, in bits. + /// if is not valid + public RSACng(int keySize) + { + LegalKeySizesValue = s_legalKeySizes; + KeySize = keySize; + } + + /// + /// Creates a new RSACng object that will use the specified key. The key's + /// must be Rsa. + /// CngKey.Open creates a copy of the key. Even if someone disposes the key passed + /// copy of this key object in RSA stays alive. + /// + /// Key to use for RSA operations + /// if is not an RSA key + /// if is null. + [SecuritySafeCritical] + public RSACng(CngKey key) + { + if (key == null) + { + throw new ArgumentNullException("key"); + } + if (key.AlgorithmGroup != CngAlgorithmGroup.Rsa) + { + throw new ArgumentException(SR.GetString(SR.Cryptography_ArgRSAaRequiresRSAKey), "key"); + } + LegalKeySizesValue = s_legalKeySizes; + Key = CngKey.Open(key.Handle, key.IsEphemeral ? CngKeyHandleOpenOptions.EphemeralKey : CngKeyHandleOpenOptions.None); + } + + /// + /// Gets the key that will be used by the RSA object for any cryptographic operation that it uses. + /// This key object will be disposed if the key is reset, for instance by changing the KeySize + /// property, using ImportParamers to create a new key, or by Disposing of the parent RSA object. + /// Therefore, you should make sure that the key object is no longer used in these scenarios. This + /// object will not be the same object as the CngKey passed to the RSACng constructor if that + /// constructor was used, however it will point at the same CNG key. + /// + /// + /// SecurityPermission/UnmanagedCode is required to read this property. + /// + public CngKey Key + { + [SecuritySafeCritical] + get + { + // If our key size was changed from the key we're using, we need to generate a new key + if (_key != null && _key.KeySize != KeySize) + { + _key.Dispose(); + _key = null; + } + + // If we don't have a key yet, we need to generate a random one now + if (_key == null) + { + CngKeyCreationParameters creationParameters = new CngKeyCreationParameters(); + CngProperty keySizeProperty = new CngProperty(NCryptNative.KeyPropertyName.Length, + BitConverter.GetBytes(KeySize), + CngPropertyOptions.None); + creationParameters.Parameters.Add(keySizeProperty); + _key = CngKey.Create(CngAlgorithm.Rsa, null, creationParameters); + } + + return _key; + } + + private set + { + Debug.Assert(value != null, "value != null"); + if (value.AlgorithmGroup != CngAlgorithmGroup.Rsa) + { + throw new ArgumentException(SR.GetString(SR.Cryptography_ArgRSAaRequiresRSAKey), "value"); + } + // If we already have a key, clear it out + if (_key != null) + { + _key.Dispose(); + } + + _key = value; + KeySize = _key.KeySize; + } + } + + /// + /// Helper property to get the NCrypt key handle + /// + private SafeNCryptKeyHandle KeyHandle + { + [SecuritySafeCritical] + get { return Key.Handle; } + } + + protected override void Dispose(bool disposing) + { + if (disposing && _key != null) + { + _key.Dispose(); + } + } + + protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) + { + // we're sealed and the base should have checked this already + Debug.Assert(data != null); + Debug.Assert(offset >= 0 && offset <= data.Length); + Debug.Assert(count >= 0 && count <= data.Length); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name)); + + using (BCryptHashAlgorithm hasher = new BCryptHashAlgorithm(new CngAlgorithm(hashAlgorithm.Name), BCryptNative.ProviderName.MicrosoftPrimitiveProvider)) + { + hasher.HashCore(data, offset, count); + return hasher.HashFinal(); + } + } + + protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) + { + // We're sealed and the base should have checked these alread. + Debug.Assert(data != null); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name)); + + using (BCryptHashAlgorithm hasher = new BCryptHashAlgorithm(new CngAlgorithm(hashAlgorithm.Name), BCryptNative.ProviderName.MicrosoftPrimitiveProvider)) + { + hasher.HashStream(data); + return hasher.HashFinal(); + } + } + + + /// + /// This function checks the magic value in the key blob header + /// + /// Private blob if true else public key blob + private void CheckMagicValueOfKey(int magic, bool includePrivateParameters) + { + if (false == includePrivateParameters) + { + if (magic != (int)BCryptNative.KeyBlobMagicNumber.RsaPublic) + { + //Check for Private key magic as public key can be derived from private key blob + if (magic != (int)BCryptNative.KeyBlobMagicNumber.RsaPrivate && magic != (int)BCryptNative.KeyBlobMagicNumber.RsaFullPrivateMagic) + { + throw new CryptographicException(SR.GetString(SR.Cryptography_NotValidPublicOrPrivateKey)); + } + } + } + //If includePrivateParameters is true then certainly check for the private key magic + else + { + if (magic != (int)BCryptNative.KeyBlobMagicNumber.RsaPrivate && magic != (int)BCryptNative.KeyBlobMagicNumber.RsaFullPrivateMagic) + { + throw new CryptographicException(SR.GetString(SR.Cryptography_NotValidPrivateKey)); + } + } + } + + // + // Key import and export + // + + /// + /// Exports the key used by the RSA object into an RSAParameters object. + /// + [SecuritySafeCritical] + public override RSAParameters ExportParameters(bool includePrivateParameters) + { + byte[] rsaBlob = Key.Export(includePrivateParameters ? s_rsaFullPrivateBlob : s_rsaPublicBlob); + RSAParameters rsaParams = new RSAParameters(); + + // + // We now have a buffer laid out as follows: + // BCRYPT_RSAKEY_BLOB header + // byte[cbPublicExp] publicExponent - Exponent + // byte[cbModulus] modulus - Modulus + // -- Private only -- + // byte[cbPrime1] prime1 - P + // byte[cbPrime2] prime2 - Q + // byte[cbPrime1] exponent1 - DP + // byte[cbPrime2] exponent2 - DQ + // byte[cbPrime1] coefficient - InverseQ + // byte[cbModulus] privateExponent - D + // + byte[] tempMagic = new byte[4]; + tempMagic[0] = rsaBlob[0]; tempMagic[1] = rsaBlob[1]; tempMagic[2] = rsaBlob[2]; tempMagic[3] = rsaBlob[3]; + int magic = BitConverter.ToInt32(tempMagic, 0); + //Check the magic value in key blob header. If blob does not have required magic + // then it trhows Cryptographic exception + CheckMagicValueOfKey(magic, includePrivateParameters); + + unsafe + { + fixed (byte* pRsaBlob = rsaBlob) + { + BCryptNative.BCRYPT_RSAKEY_BLOB* pBcryptBlob = (BCryptNative.BCRYPT_RSAKEY_BLOB*)pRsaBlob; + + int offset = Marshal.SizeOf(typeof(BCryptNative.BCRYPT_RSAKEY_BLOB)); + + // Read out the exponent + rsaParams.Exponent = new byte[pBcryptBlob->cbPublicExp]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.Exponent, 0, rsaParams.Exponent.Length); + offset += pBcryptBlob->cbPublicExp; + + // Read out the modulus + rsaParams.Modulus = new byte[pBcryptBlob->cbModulus]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.Modulus, 0, rsaParams.Modulus.Length); + offset += pBcryptBlob->cbModulus; + + if (includePrivateParameters) + { + // Read out P + rsaParams.P = new byte[pBcryptBlob->cbPrime1]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.P, 0, rsaParams.P.Length); + offset += pBcryptBlob->cbPrime1; + + // Read out Q + rsaParams.Q = new byte[pBcryptBlob->cbPrime2]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.Q, 0, rsaParams.Q.Length); + offset += pBcryptBlob->cbPrime2; + + // Read out DP + rsaParams.DP = new byte[pBcryptBlob->cbPrime1]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.DP, 0, rsaParams.DP.Length); + offset += pBcryptBlob->cbPrime1; + + // Read out DQ + rsaParams.DQ = new byte[pBcryptBlob->cbPrime2]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.DQ, 0, rsaParams.DQ.Length); + offset += pBcryptBlob->cbPrime2; + + // Read out InverseQ + rsaParams.InverseQ = new byte[pBcryptBlob->cbPrime1]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.InverseQ, 0, rsaParams.InverseQ.Length); + offset += pBcryptBlob->cbPrime1; + + // Read out D + rsaParams.D = new byte[pBcryptBlob->cbModulus]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.D, 0, rsaParams.D.Length); + offset += pBcryptBlob->cbModulus; + } + } + } + + return rsaParams; + } + + /// + /// + /// ImportParameters will replace the existing key that RSACng is working with by creating a + /// new CngKey for the parameters structure. If the parameters structure contains only an + /// exponent and modulus, then only a public key will be imported. If the parameters also + /// contain P and Q values, then a full key pair will be imported. + /// + /// + /// + /// if contains neither an exponent nor a modulus. + /// + /// + /// if is not a valid RSA key or if is a full key pair and the default KSP is used. + /// + [SecuritySafeCritical] + public override void ImportParameters(RSAParameters parameters) + { + if (parameters.Exponent == null || parameters.Modulus == null) + { + throw new ArgumentException(SR.GetString(SR.Cryptography_InvalidRsaParameters)); + } + bool publicOnly = parameters.P == null || parameters.Q == null; + + // + // We need to build a key blob structured as follows: + // BCRYPT_RSAKEY_BLOB header + // byte[cbPublicExp] publicExponent - Exponent + // byte[cbModulus] modulus - Modulus + // -- Private only -- + // byte[cbPrime1] prime1 - P + // byte[cbPrime2] prime2 - Q + // + + int blobSize = Marshal.SizeOf(typeof(BCryptNative.BCRYPT_RSAKEY_BLOB)) + + parameters.Exponent.Length + + parameters.Modulus.Length; + if (!publicOnly) + { + blobSize += parameters.P.Length + + parameters.Q.Length; + } + + byte[] rsaBlob = new byte[blobSize]; + unsafe + { + fixed (byte* pRsaBlob = rsaBlob) + { + // Build the header + BCryptNative.BCRYPT_RSAKEY_BLOB* pBcryptBlob = (BCryptNative.BCRYPT_RSAKEY_BLOB*)pRsaBlob; + pBcryptBlob->Magic = publicOnly ? BCryptNative.KeyBlobMagicNumber.RsaPublic : + BCryptNative.KeyBlobMagicNumber.RsaPrivate; + + pBcryptBlob->BitLength = parameters.Modulus.Length * 8; + + pBcryptBlob->cbPublicExp = parameters.Exponent.Length; + pBcryptBlob->cbModulus = parameters.Modulus.Length; + + if (!publicOnly) + { + pBcryptBlob->cbPrime1 = parameters.P.Length; + pBcryptBlob->cbPrime2 = parameters.Q.Length; + } + + int offset = Marshal.SizeOf(typeof(BCryptNative.BCRYPT_RSAKEY_BLOB)); + + // Copy the exponent + Buffer.BlockCopy(parameters.Exponent, 0, rsaBlob, offset, parameters.Exponent.Length); + offset += parameters.Exponent.Length; + + // Copy the modulus + Buffer.BlockCopy(parameters.Modulus, 0, rsaBlob, offset, parameters.Modulus.Length); + offset += parameters.Modulus.Length; + + if (!publicOnly) + { + // Copy P + Buffer.BlockCopy(parameters.P, 0, rsaBlob, offset, parameters.P.Length); + offset += parameters.P.Length; + + // Copy Q + Buffer.BlockCopy(parameters.Q, 0, rsaBlob, offset, parameters.Q.Length); + offset += parameters.Q.Length; + } + } + } + Key = CngKey.Import(rsaBlob, publicOnly ? s_rsaPublicBlob : s_rsaPrivateBlob); + } + + // + // Encryption and decryption + // + [SecuritySafeCritical] + public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) + { + if (data == null) + { + throw new ArgumentNullException("data"); + } + + if (padding == null) + { + throw new ArgumentNullException("padding"); + } + + SafeNCryptKeyHandle keyHandle = Key.Handle; + + if (padding == RSAEncryptionPadding.Pkcs1) + { + return NCryptNative.DecryptDataPkcs1(keyHandle, data); + } + else if (padding.Mode == RSAEncryptionPaddingMode.Oaep) + { + return NCryptNative.DecryptDataOaep(keyHandle, data, padding.OaepHashAlgorithm.Name); + } + else + { + // no other padding possibilities at present, but we might version independently from more being added. + throw new CryptographicException(SR.GetString(SR.Cryptography_UnsupportedPaddingMode)); + } + } + + [SecuritySafeCritical] + public override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding) + { + if (data == null) + { + throw new ArgumentNullException("data"); + } + if (padding == null) + { + throw new ArgumentNullException("padding"); + } + + if (padding == RSAEncryptionPadding.Pkcs1) + { + return NCryptNative.EncryptDataPkcs1(KeyHandle, data); + } + else if (padding.Mode == RSAEncryptionPaddingMode.Oaep) + { + return NCryptNative.EncryptDataOaep(KeyHandle, data, padding.OaepHashAlgorithm.Name); + } + else + { + // no other padding possibilities at present, but we might version independently from more being added. + throw new CryptographicException(SR.GetString(SR.Cryptography_UnsupportedPaddingMode)); + }; + } + + + // + // Signature APIs + // + + [SecuritySafeCritical] + public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) + { + if (hash == null) + { + throw new ArgumentNullException("hash"); + } + if (String.IsNullOrEmpty(hashAlgorithm.Name)) + { + throw new ArgumentException(SR.GetString(SR.Cryptography_HashAlgorithmNameNullOrEmpty), "hashAlgorithm"); + } + if (padding == null) + { + throw new ArgumentNullException("padding"); + } + + // Keep a local copy of the key. + CngKey key = Key; + SafeNCryptKeyHandle keyHandle = key.Handle; + + if (padding == RSASignaturePadding.Pkcs1) + { + return NCryptNative.SignHashPkcs1(keyHandle, hash, hashAlgorithm.Name); + } + else if (padding == RSASignaturePadding.Pss) + { + return NCryptNative.SignHashPss(keyHandle, hash, hashAlgorithm.Name, hash.Length); + } + else + { + // no other padding possibilities at present, but we might version independently from more being added. + throw new CryptographicException(SR.GetString(SR.Cryptography_UnsupportedPaddingMode)); + + } + } + + [SecuritySafeCritical] + public override bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) + { + if (hash == null) + { + throw new ArgumentNullException("hash"); + } + if (signature == null) + { + throw new ArgumentNullException("signature"); + } + if (String.IsNullOrEmpty(hashAlgorithm.Name)) + { + throw new ArgumentException(SR.GetString(SR.Cryptography_HashAlgorithmNameNullOrEmpty), "hashAlgorithm"); + } + if (padding == null) + { + throw new ArgumentNullException("padding"); + } + + if (padding == RSASignaturePadding.Pkcs1) + { + return NCryptNative.VerifySignaturePkcs1(KeyHandle, hash, hashAlgorithm.Name, signature); + } + else if (padding == RSASignaturePadding.Pss) + { + return NCryptNative.VerifySignaturePss(KeyHandle, hash, hashAlgorithm.Name, hash.Length, signature); + } + else + { + // no other padding possibilities at present, but we might version independently from more being added. + throw new CryptographicException(SR.GetString(SR.Cryptography_UnsupportedPaddingMode)); + } + } + } +} diff --git a/external/referencesource/System.Core/System/Security/Cryptography/SignatureVerificationResult.cs b/external/referencesource/System.Core/System/Security/Cryptography/SignatureVerificationResult.cs index e9314e9086..82482e9237 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/SignatureVerificationResult.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/SignatureVerificationResult.cs @@ -31,7 +31,7 @@ namespace System.Security.Cryptography { InvalidTimePeriodNesting = unchecked((int)0x800b0102), // CERT_E_VALIDITYPERIODNESTING InvalidCertificateRole = unchecked((int)0x800b0103), // CERT_E_ROLE PathLengthConstraintViolated = unchecked((int)0x800b0104), // CERT_E_PATHLENCONST - UnknownCriticalExtension = unchecked((int)0x800b0105), // CERT_E_ + UnknownCriticalExtension = unchecked((int)0x800b0105), // CERT_E_CRITICAL CertificateUsageNotAllowed = unchecked((int)0x800b0106), // CERT_E_PURPOSE IssuerChainingError = unchecked((int)0x800b0107), // CERT_E_ISSUERCHAINING CertificateMalformed = unchecked((int)0x800b0108), // CERT_E_MALFORMED @@ -47,4 +47,4 @@ namespace System.Security.Cryptography { InvalidCertificatePolicy = unchecked((int)0x800b0113), // CERT_E_INVALID_POLICY InvalidCertificateName = unchecked((int)0x800b0114) // CERT_E_INVALID_NAME } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Core/System/Security/Cryptography/X509Certificates/ECDsaCertificateExtensions.cs b/external/referencesource/System.Core/System/Security/Cryptography/X509Certificates/ECDsaCertificateExtensions.cs new file mode 100644 index 0000000000..7ef63647f6 --- /dev/null +++ b/external/referencesource/System.Core/System/Security/Cryptography/X509Certificates/ECDsaCertificateExtensions.cs @@ -0,0 +1,129 @@ +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace System.Security.Cryptography.X509Certificates +{ + /// + /// Provides extension methods for retrieving implementations for the + /// public and private keys of a . + /// + public static class ECDsaCertificateExtensions + { + + /// + /// Gets the private key from the certificate or null if + /// the certificate does not have an ECDsa private key. + /// + [SecuritySafeCritical] + public static ECDsa GetECDsaPrivateKey(this X509Certificate2 certificate) + { + if (certificate == null) { throw new ArgumentNullException("certificate"); } + //Check cert for private key and confirm it is ECDSA cert + if (!certificate.HasPrivateKey || !IsECDsa(certificate)) { return null; } + + using (SafeCertContextHandle certificateContext = X509Native.GetCertificateContext(certificate)) + using (SafeNCryptKeyHandle privateKeyHandle = X509Native.TryAcquireCngPrivateKey(certificateContext)) + { + CngKey key = CngKey.Open(privateKeyHandle, CngKeyHandleOpenOptions.None); + return new ECDsaCng(key); + } + } + + /// + /// Gets the public key from the certificate or null if the certificate does not have an ECDsa public key. + /// + [SecuritySafeCritical] + public static ECDsa GetECDsaPublicKey(this X509Certificate2 certificate) + { + if (certificate == null) { throw new ArgumentNullException("certificate"); } + if (!IsECDsa(certificate)) { return null; } + + SafeCertContextHandle safeCertContext = X509Native.GetCertificateContext(certificate); + IntPtr certHandle = safeCertContext.DangerousGetHandle(); + //Read the public key blob from the certificate + X509Native.CERT_CONTEXT pCertContext = (X509Native.CERT_CONTEXT)Marshal.PtrToStructure(certHandle, typeof(X509Native.CERT_CONTEXT)); + + IntPtr pSubjectPublicKeyInfo = new IntPtr((long)pCertContext.pCertInfo + + (long)Marshal.OffsetOf(typeof(X509Native.CERT_INFO), "SubjectPublicKeyInfo")); + + X509Native.CERT_PUBLIC_KEY_INFO certPublicKeyInfo = (X509Native.CERT_PUBLIC_KEY_INFO)Marshal.PtrToStructure(pSubjectPublicKeyInfo, + typeof(X509Native.CERT_PUBLIC_KEY_INFO)); + CngKey key; + //Import the public key blob to BCRYPT_KEY_HANDLE + using (SafeBCryptKeyHandle bcryptKeyHandle = BCryptNative.ImportAsymmetricPublicKey(certPublicKeyInfo, 0)) + { + if (bcryptKeyHandle.IsInvalid) + { + throw new CryptographicException("SR.GetString(SR.Cryptography_OpenInvalidHandle)"); + } + key = BCryptHandleToNCryptHandle(bcryptKeyHandle); + } + GC.KeepAlive(safeCertContext); + return new ECDsaCng(key); + } + + /// + /// Method take BCrypt handle as input and returns the CNGKey + /// + /// Accepts BCrypt Handle + /// Returns CNG key with NCrypt Handle + private static CngKey BCryptHandleToNCryptHandle(SafeBCryptKeyHandle bcryptKeyHandle) + { + byte[] keyBlob = BCryptNative.ExportBCryptKey(bcryptKeyHandle, BCryptNative.BCRYPT_ECCPUBLIC_BLOB); + //Now Import the key blob as NCRYPT_KEY_HANDLE + CngKey Key = CngKey.Import(keyBlob, CngKeyBlobFormat.EccPublicBlob); + return Key; + } + + /// + /// Check if the certificate contains ECDsa key or ECDH / ECMQV key. + /// + /// Certificate object + /// true if ECDsa key. False otherwise + private static bool IsECDsa(X509Certificate2 certificate) + { + string algName = certificate.PublicKey.Oid.FriendlyName; + string value = certificate.PublicKey.Oid.Value; + //At this point check OID. If it matches for ECC certs + //then go to extensions and find out difference between ECDSA and ECDH certs + if (value != X509Native.szOID_ECC_PUBLIC_KEY) { return false; } + else + { + //Following section is built based on RFC + //http://www.ietf.org/rfc/rfc5280.txt and + //http://www.rfc-archive.org/getrfc.php?rfc=5480. This RFC, section 3 describes when + // key can be ECDSA or ECDH or ECMQV. + foreach (X509Extension extension in certificate.Extensions) + { + //Check Key Usage OID value + if (extension.Oid.Value == "2.5.29.15") + { + X509KeyUsageExtension ext = (X509KeyUsageExtension)extension; + + if (!(ext.KeyUsages.HasFlag(X509KeyUsageFlags.KeyAgreement))) + { + //If this does not have KeyAgreement flag present, it cannot be ECDH or ECMQV key as KeyAgreement + // is mandatory flag for ECDH or ECMQV. In that case, at this point, it is safe to assume it is ECDSA + return true; + } + //If key has any of the following flag then it cannot be ECDH or ECMQV. Assume + //it is ECDSA. + if (ext.KeyUsages.HasFlag(X509KeyUsageFlags.DigitalSignature) || + ext.KeyUsages.HasFlag(X509KeyUsageFlags.NonRepudiation) || + ext.KeyUsages.HasFlag(X509KeyUsageFlags.KeyCertSign) || + ext.KeyUsages.HasFlag(X509KeyUsageFlags.CrlSign)) + { + return true; + } + else + { + return false; + } + } + } + } + //If key usage extension is not present in the certificate assume ECDSA + return true; + } + } +} diff --git a/external/referencesource/System.Core/System/Security/Cryptography/X509Certificates/RSACertificateExtensions.cs b/external/referencesource/System.Core/System/Security/Cryptography/X509Certificates/RSACertificateExtensions.cs new file mode 100644 index 0000000000..e4ef01d3e6 --- /dev/null +++ b/external/referencesource/System.Core/System/Security/Cryptography/X509Certificates/RSACertificateExtensions.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace System.Security.Cryptography.X509Certificates +{ + /// + /// Provides extension methods for retrieving implementations for the + /// public and private keys of a . + /// + public static class RSACertificateExtensions + { + /// + /// Gets the public key from the certificate or null if the certificate does not have an RSA public key. + /// + [SecuritySafeCritical] + public static RSA GetRSAPublicKey(this X509Certificate2 certificate) + { + if (certificate == null) + { + throw new ArgumentNullException("certificate"); + } + + if (!IsRSA(certificate)) + { + return null; + } + + PublicKey publicKey = certificate.PublicKey; + AsnEncodedData asn = publicKey.EncodedKeyValue; + IntPtr structType = new IntPtr(CapiNative.CNG_RSA_PUBLIC_KEY_BLOB); + + SafeLocalAllocHandle cngBlobHandle; + uint cngBlobLength; + bool result = CapiNative.DecodeObject(structType, asn.RawData, out cngBlobHandle, out cngBlobLength); + + if (!result) + { + throw new CryptographicException(Marshal.GetLastWin32Error()); + } + + byte[] cngBlob = new byte[cngBlobLength]; + using (cngBlobHandle) + { + Marshal.Copy(cngBlobHandle.DangerousGetHandle(), cngBlob, 0, cngBlob.Length); + } + + CngKey key = CngKey.Import(cngBlob, CngKeyBlobFormat.GenericPublicBlob); + return new RSACng(key); + } + + /// + /// Gets the private key from the certificate or null if the certificate does not have an RSA private key. + /// + [SecuritySafeCritical] + public static RSA GetRSAPrivateKey(this X509Certificate2 certificate) + { + if (certificate == null) + { + throw new ArgumentNullException("certificate"); + } + + if (!certificate.HasPrivateKey || !IsRSA(certificate)) + { + return null; + } + + using (SafeCertContextHandle certificateContext = X509Native.GetCertificateContext(certificate)) + using (SafeNCryptKeyHandle privateKeyHandle = X509Native.TryAcquireCngPrivateKey(certificateContext)) + { + if (privateKeyHandle == null) + { + // fall back to CAPI if we cannot acquire the key using CNG. + return (RSA)certificate.PrivateKey; + } + + CngKey key = CngKey.Open(privateKeyHandle, CngKeyHandleOpenOptions.None); + return new RSACng(key); + } + } + + private static bool IsRSA(X509Certificate2 certificate) + { + uint algorithmId = OidToAlgorithmId(certificate.PublicKey.Oid); + + switch (algorithmId) + { + case CapiNative.CALG_RSA_SIGN: + case CapiNative.CALG_RSA_KEYX: + return true; + default: + return false; + } + } + + private static uint OidToAlgorithmId(Oid oid) + { + using (SafeLocalAllocHandle oidHandle = X509Utils.StringToAnsiPtr(oid.Value)) + { + CapiNative.CRYPT_OID_INFO oidInfo = CapiNative.CryptFindOIDInfo(CapiNative.CRYPT_OID_INFO_OID_KEY, oidHandle, 0); + return oidInfo.Algid; + } + } + } +} diff --git a/external/referencesource/System.Core/System/Security/Cryptography/X509Certificates/X509Native.cs b/external/referencesource/System.Core/System/Security/Cryptography/X509Certificates/X509Native.cs index 3ff5fb4662..94aacfd6ea 100644 --- a/external/referencesource/System.Core/System/Security/Cryptography/X509Certificates/X509Native.cs +++ b/external/referencesource/System.Core/System/Security/Cryptography/X509Certificates/X509Native.cs @@ -5,18 +5,161 @@ // ==--== using System; +using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using Microsoft.Win32.SafeHandles; +using System.Diagnostics; using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME; namespace System.Security.Cryptography.X509Certificates { + + internal static partial class X509Native { + + /// + /// Determine if a certificate has a specific property + /// + [SecuritySafeCritical] + internal static bool HasCertificateProperty(SafeCertContextHandle certificateContext, + CertificateProperty property) { + Debug.Assert(certificateContext != null, "certificateContext != null"); + Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, + "!certificateContext.IsClosed && !certificateContext.IsInvalid"); + + byte[] buffer = null; + int bufferSize = 0; + bool gotProperty = UnsafeNativeMethods.CertGetCertificateContextProperty(certificateContext, + property, + buffer, + ref bufferSize); + return gotProperty || + (ErrorCode)Marshal.GetLastWin32Error() == ErrorCode.MoreData; + } + + /// + /// Get the NCrypt handle to the private key of a certificate + /// or null if the private key cannot be acquired by NCrypt. + /// + [SecuritySafeCritical] + internal static SafeNCryptKeyHandle TryAcquireCngPrivateKey(SafeCertContextHandle certificateContext) { + Debug.Assert(certificateContext != null, "certificateContext != null"); + Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, + "!certificateContext.IsClosed && !certificateContext.IsInvalid"); + + bool freeKey = true; + SafeNCryptKeyHandle privateKey = null; + RuntimeHelpers.PrepareConstrainedRegions(); + try { + int keySpec = 0; + if (!UnsafeNativeMethods.CryptAcquireCertificatePrivateKey(certificateContext, + AcquireCertificateKeyOptions.AcquireOnlyNCryptKeys, + IntPtr.Zero, + out privateKey, + out keySpec, + out freeKey)) { + return null; + } + + return privateKey; + } + finally { + // If we're not supposed to release they key handle, then we need to bump the reference count + // on the safe handle to correspond to the reference that Windows is holding on to. This will + // prevent the CLR from freeing the object handle. + // + // This is certainly not the ideal way to solve this problem - it would be better for + // SafeNCryptKeyHandle to maintain an internal bool field that we could toggle here and + // have that suppress the release when the CLR calls the ReleaseHandle override. However, that + // field does not currently exist, so we'll use this hack instead. + if (privateKey != null && !freeKey) { + bool addedRef = false; + privateKey.DangerousAddRef(ref addedRef); + } + } + } + + /// + /// Get an arbitrary property of a certificate + /// + [SecuritySafeCritical] + internal static byte[] GetCertificateProperty(SafeCertContextHandle certificateContext, + CertificateProperty property) { + Debug.Assert(certificateContext != null, "certificateContext != null"); + Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, + "!certificateContext.IsClosed && !certificateContext.IsInvalid"); + + byte[] buffer = null; + int bufferSize = 0; + if (!UnsafeNativeMethods.CertGetCertificateContextProperty(certificateContext, + property, + buffer, + ref bufferSize)) { + ErrorCode errorCode = (ErrorCode)Marshal.GetLastWin32Error(); + if (errorCode != ErrorCode.MoreData) { + throw new CryptographicException((int)errorCode); + } + } + + buffer = new byte[bufferSize]; + if (!UnsafeNativeMethods.CertGetCertificateContextProperty(certificateContext, + property, + buffer, + ref bufferSize)) { + throw new CryptographicException(Marshal.GetLastWin32Error()); + } + + return buffer; + } + + /// + /// Get a property of a certificate formatted as a structure + /// + [SecurityCritical] + internal static T GetCertificateProperty(SafeCertContextHandle certificateContext, + CertificateProperty property) where T : struct { + Debug.Assert(certificateContext != null, "certificateContext != null"); + Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, + "!certificateContext.IsClosed && !certificateContext.IsInvalid"); + + byte[] rawProperty = GetCertificateProperty(certificateContext, property); + Debug.Assert(rawProperty.Length >= Marshal.SizeOf(typeof(T)), "Property did not return expected structure"); + + unsafe { + fixed (byte* pRawProperty = &rawProperty[0]) { + return (T)Marshal.PtrToStructure(new IntPtr(pRawProperty), typeof(T)); + } + } + } + + /// + /// Duplicate the certificate context into a safe handle + /// + [SecuritySafeCritical] + internal static SafeCertContextHandle DuplicateCertContext(IntPtr context) { + Debug.Assert(context != IntPtr.Zero); + + return UnsafeNativeMethods.CertDuplicateCertificateContext(context); + } + + // Gets a SafeHandle for the X509 certificate. The caller owns the returned handle and should dispose of it. It + // can be used independently of the lifetime of the original X509Certificate. + [SecuritySafeCritical] + internal static SafeCertContextHandle GetCertificateContext(X509Certificate certificate) { + SafeCertContextHandle certificateContext = DuplicateCertContext(certificate.Handle); + // Make sure to keep the X509Certificate object alive until after its certificate context is + // duplicated, otherwise it could end up being closed out from underneath us before we get a + // chance to duplicate the handle. + GC.KeepAlive(certificate); + return certificateContext; + } + } /// /// Native interop layer for X509 certificate and Authenticode functions. Native definitions can be /// found in wincrypt.h or msaxlapi.h /// - internal static class X509Native { + internal static partial class X509Native { /// /// Flags for CertVerifyAuthenticodeLicense /// @@ -31,6 +174,103 @@ namespace System.Security.Cryptography.X509Certificates { TrustMicrosoftRootOnly = 0x00000020 // AXL_TRUST_MICROSOFT_ROOT_ONLY } + internal const uint X509_ASN_ENCODING = 0x00000001; + internal const string szOID_ECC_PUBLIC_KEY = "1.2.840.10045.2.1"; //Copied from Windows header file + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct CERT_CONTEXT { + internal uint dwCertEncodingType; + internal IntPtr pbCertEncoded; + internal uint cbCertEncoded; + internal IntPtr pCertInfo; + internal IntPtr hCertStore; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct CERT_PUBLIC_KEY_INFO { + internal CRYPT_ALGORITHM_IDENTIFIER Algorithm; + internal CRYPT_BIT_BLOB PublicKey; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct CERT_INFO { + internal uint dwVersion; + internal CRYPTOAPI_BLOB SerialNumber; + internal CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm; + internal CRYPTOAPI_BLOB Issuer; + internal FILETIME NotBefore; + internal FILETIME NotAfter; + internal CRYPTOAPI_BLOB Subject; + internal CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo; + internal CRYPT_BIT_BLOB IssuerUniqueId; + internal CRYPT_BIT_BLOB SubjectUniqueId; + internal uint cExtension; + internal IntPtr rgExtension; // PCERT_EXTENSION + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct CRYPT_ALGORITHM_IDENTIFIER { + [MarshalAs(UnmanagedType.LPStr)] + internal string pszObjId; + internal CRYPTOAPI_BLOB Parameters; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct CRYPT_BIT_BLOB { + internal uint cbData; + internal IntPtr pbData; + internal uint cUnusedBits; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct CRYPTOAPI_BLOB { + internal uint cbData; + internal IntPtr pbData; + } + + /// + /// Flags for the CryptAcquireCertificatePrivateKey API + /// + internal enum AcquireCertificateKeyOptions { + None = 0x00000000, + AcquireOnlyNCryptKeys = 0x00040000, // CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG + } + + /// + /// Well known certificate property IDs + /// + internal enum CertificateProperty { + KeyProviderInfo = 2, // CERT_KEY_PROV_INFO_PROP_ID + KeyContext = 5, // CERT_KEY_CONTEXT_PROP_ID + } + + /// + /// Error codes returned from X509 APIs + /// + internal enum ErrorCode { + Success = 0x00000000, // ERROR_SUCCESS + MoreData = 0x000000ea, // ERROR_MORE_DATA + } + + [StructLayout(LayoutKind.Sequential)] + internal struct CRYPT_KEY_PROV_INFO { + [MarshalAs(UnmanagedType.LPWStr)] + internal string pwszContainerName; + + [MarshalAs(UnmanagedType.LPWStr)] + internal string pwszProvName; + + internal int dwProvType; + + internal int dwFlags; + + internal int cProvParam; + + internal IntPtr rgProvParam; // PCRYPT_KEY_PROV_PARAM + + internal int dwKeySpec; + } + [StructLayout(LayoutKind.Sequential)] [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public struct AXL_AUTHENTICODE_SIGNER_INFO { @@ -96,6 +336,60 @@ namespace System.Security.Cryptography.X509Certificates { AxlVerificationFlags dwFlags, [In, Out] ref AXL_AUTHENTICODE_SIGNER_INFO pSignerInfo, [In, Out] ref AXL_AUTHENTICODE_TIMESTAMPER_INFO pTimestamperInfo); + + [DllImport("crypt32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool CertGetCertificateContextProperty(SafeCertContextHandle pCertContext, + CertificateProperty dwPropId, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pvData, + [In, Out] ref int pcbData); + [DllImport("crypt32.dll")] + internal static extern SafeCertContextHandle CertDuplicateCertificateContext(IntPtr certContext); // CERT_CONTEXT * + + [DllImport("crypt32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool CryptAcquireCertificatePrivateKey(SafeCertContextHandle pCert, + AcquireCertificateKeyOptions dwFlags, + IntPtr pvReserved, // void * + [Out] out SafeNCryptKeyHandle phCryptProvOrNCryptKey, + [Out] out int dwKeySpec, + [Out, MarshalAs(UnmanagedType.Bool)] out bool pfCallerFreeProvOrNCryptKey); + } + } + + internal sealed class SafeCertContextHandle : SafeHandleZeroOrMinusOneIsInvalid + { + [SecuritySafeCritical] + private SafeCertContextHandle() : base(true) { } + + // 0 is an Invalid Handle + [SecuritySafeCritical] + internal SafeCertContextHandle(IntPtr handle) + : base(true) + { + SetHandle(handle); + } + + internal static SafeCertContextHandle InvalidHandle + { + [SecuritySafeCritical] + get { return new SafeCertContextHandle(IntPtr.Zero); } + } + + [DllImport("Crypt32.dll", SetLastError = true), + ResourceExposure(ResourceScope.None)] + //#if !FEATURE_CORESYSTEM + // [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] + //#endif + private static extern bool CertFreeCertificateContext(IntPtr pCertContext); + +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [SecuritySafeCritical] + override protected bool ReleaseHandle() + { + return CertFreeCertificateContext(handle); } } } diff --git a/external/referencesource/System.Core/System/Security/ManifestKinds.cs b/external/referencesource/System.Core/System/Security/ManifestKinds.cs index 704367afa4..6dbd4ef65e 100644 --- a/external/referencesource/System.Core/System/Security/ManifestKinds.cs +++ b/external/referencesource/System.Core/System/Security/ManifestKinds.cs @@ -14,4 +14,4 @@ namespace System.Security { Application = 0x00000002, ApplicationAndDeployment = Deployment | Application } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Core/System/threading/ReaderWriterLockSlim/LockRecursionException.cs b/external/referencesource/System.Core/System/threading/ReaderWriterLockSlim/LockRecursionException.cs index fdca26ddea..2e84506961 100644 --- a/external/referencesource/System.Core/System/threading/ReaderWriterLockSlim/LockRecursionException.cs +++ b/external/referencesource/System.Core/System/threading/ReaderWriterLockSlim/LockRecursionException.cs @@ -13,7 +13,7 @@ // acquire a lock, because the particular lock kind doesn't // support it in its current state. // -// [....] +// emadali // ============================================================*/ diff --git a/external/referencesource/System.Data.DataSetExtensions/System/Data/ShippingAssemblyAttribute.cs b/external/referencesource/System.Data.DataSetExtensions/System/Data/ShippingAssemblyAttribute.cs index ec4cc147e0..1fd9bbc73b 100644 --- a/external/referencesource/System.Data.DataSetExtensions/System/Data/ShippingAssemblyAttribute.cs +++ b/external/referencesource/System.Data.DataSetExtensions/System/Data/ShippingAssemblyAttribute.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// stevesta //------------------------------------------------------------------------------ -[assembly: System.Security.SecurityCritical] +[assembly: System.Security.SecurityCritical] \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/DesignXmlConstants.cs b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/DesignXmlConstants.cs index 764c6c7ae3..a1c5af0dd9 100644 --- a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/DesignXmlConstants.cs +++ b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/DesignXmlConstants.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner srimand //--------------------------------------------------------------------- namespace System.Data.Entity.Design { diff --git a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterEffect.cs b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterEffect.cs index 6924a3bd13..aafbb7b7de 100644 --- a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterEffect.cs +++ b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterEffect.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner srimand //--------------------------------------------------------------------- using System; using System.Collections.Generic; diff --git a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterObjectTypes.cs b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterObjectTypes.cs index 8996c2f66a..23b5a3e275 100644 --- a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterObjectTypes.cs +++ b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaFilterObjectTypes.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner srimand //--------------------------------------------------------------------- using System; using System.Collections.Generic; diff --git a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.EntityCreationStatus.cs b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.EntityCreationStatus.cs index 241da8db9b..3a6e78ae7c 100644 --- a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.EntityCreationStatus.cs +++ b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/EntityStoreSchemaGenerator/EntityStoreSchemaGenerator.EntityCreationStatus.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner srimand //--------------------------------------------------------------------- namespace System.Data.Entity.Design { diff --git a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/ICustomPluralizationMapping.cs b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/ICustomPluralizationMapping.cs index 86dfd0b760..9ec306433a 100644 --- a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/ICustomPluralizationMapping.cs +++ b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/PluralizationService/ICustomPluralizationMapping.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner leil +// @backupOwner jeffreed //--------------------------------------------------------------------- using System; using System.Collections.Generic; diff --git a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/ModelBuilderErrorCodes.cs b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/ModelBuilderErrorCodes.cs index c7b87a7ad5..6ab9511a70 100644 --- a/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/ModelBuilderErrorCodes.cs +++ b/external/referencesource/System.Data.Entity.Design/System/Data/Entity/Design/SSDLGenerator/ModelBuilderErrorCodes.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner srimand //--------------------------------------------------------------------- namespace System.Data.Entity.Design.SsdlGenerator { diff --git a/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUpType.cs b/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUpType.cs index fa0c50efba..a4168c9a12 100644 --- a/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUpType.cs +++ b/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/FixUpType.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner srimand //--------------------------------------------------------------------- namespace System.Data.EntityModel.Emitters diff --git a/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PrivateMemberPrefixId.cs b/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PrivateMemberPrefixId.cs index 35573d1ae2..fdbaab8de4 100644 --- a/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PrivateMemberPrefixId.cs +++ b/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/Emitters/PrivateMemberPrefixId.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner srimand //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/LanguageOption.cs b/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/LanguageOption.cs index 94714f3da2..914b7f86f1 100644 --- a/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/LanguageOption.cs +++ b/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/LanguageOption.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner srimand //--------------------------------------------------------------------- namespace System.Data.Entity.Design diff --git a/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/TerminalErrorException.cs b/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/TerminalErrorException.cs index a01ee3c262..e6070187bc 100644 --- a/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/TerminalErrorException.cs +++ b/external/referencesource/System.Data.Entity.Design/System/Data/EntityModel/TerminalErrorException.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner srimand //--------------------------------------------------------------------- using System; using System.Data; diff --git a/external/referencesource/System.Data.Entity/System/Data/Common/ShippingAssemblyAttributes.cs b/external/referencesource/System.Data.Entity/System/Data/Common/ShippingAssemblyAttributes.cs index ea84eb1372..b48c254be6 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Common/ShippingAssemblyAttributes.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Common/ShippingAssemblyAttributes.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupowner [....] +// @owner srimand +// @backupowner adoshi //--------------------------------------------------------------------- // comment this line out to see dead code: diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Action.cs b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Action.cs index 230ece9575..5c7f8f4215 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Action.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Action.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner anpete //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/CollectionKind.cs b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/CollectionKind.cs index 3030d0ee31..6270d90374 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/CollectionKind.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/CollectionKind.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner anpete //--------------------------------------------------------------------- using System; @@ -32,4 +32,4 @@ namespace System.Data.Metadata.Edm /// List, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ConcurrencyMode.cs b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ConcurrencyMode.cs index 7b105d980f..86037f1595 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ConcurrencyMode.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ConcurrencyMode.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner anpete //--------------------------------------------------------------------- using System; @@ -28,4 +28,4 @@ namespace System.Data.Metadata.Edm /// Fixed, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ErrorCode.cs b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ErrorCode.cs index 55ae02646c..fce0845337 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ErrorCode.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ErrorCode.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner anpete //--------------------------------------------------------------------- namespace System.Data.EntityModel.SchemaObjectModel diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IRelationship.cs b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IRelationship.cs index db2095deb0..e14bc8e22d 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IRelationship.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IRelationship.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner anpete //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IRelationshipEnd.cs b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IRelationshipEnd.cs index bc056a1976..0180760cc8 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IRelationshipEnd.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/IRelationshipEnd.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner anpete //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ISchemaElementLookUpTable.cs b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ISchemaElementLookUpTable.cs index e389d862e3..e1e5158373 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ISchemaElementLookUpTable.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/ISchemaElementLookUpTable.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner anpete //--------------------------------------------------------------------- using System; @@ -50,4 +50,4 @@ namespace System.Data.EntityModel.SchemaObjectModel T LookUpEquivalentKey(string key); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Operation.cs b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Operation.cs index b9ad73bb63..9e557b97d3 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Operation.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/Operation.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner anpete //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaDataModelOption.cs b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaDataModelOption.cs index c11dab17e8..16065ee9e3 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaDataModelOption.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/SchemaDataModelOption.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner anpete //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StoreGeneratedPattern.cs b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StoreGeneratedPattern.cs index 9638cf4f8a..76b9584ec6 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StoreGeneratedPattern.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/StoreGeneratedPattern.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner anpete //--------------------------------------------------------------------- using System; @@ -31,4 +31,4 @@ namespace System.Data.Metadata.Edm /// Computed = 2, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeModifier.cs b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeModifier.cs index 65ff5b4b6c..451cef49c8 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeModifier.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityModel/SchemaObjectModel/TypeModifier.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner anpete //--------------------------------------------------------------------- namespace System.Data.EntityModel.SchemaObjectModel diff --git a/external/referencesource/System.Data.Entity/System/Data/EntityState.cs b/external/referencesource/System.Data.Entity/System/Data/EntityState.cs index efd8e08705..19de7695e9 100644 --- a/external/referencesource/System.Data.Entity/System/Data/EntityState.cs +++ b/external/referencesource/System.Data.Entity/System/Data/EntityState.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner fzamore +// @backupOwner dsimmons //--------------------------------------------------------------------- namespace System.Data { diff --git a/external/referencesource/System.Data.Entity/System/Data/IEntityAdapter.cs b/external/referencesource/System.Data.Entity/System/Data/IEntityAdapter.cs index a70a65c82d..5986e7f3c3 100644 --- a/external/referencesource/System.Data.Entity/System/Data/IEntityAdapter.cs +++ b/external/referencesource/System.Data.Entity/System/Data/IEntityAdapter.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// bfung // spather //------------------------------------------------------------------------------ diff --git a/external/referencesource/System.Data.Entity/System/Data/IEntityStateEntry.cs b/external/referencesource/System.Data.Entity/System/Data/IEntityStateEntry.cs index eb8fc00c23..3c5f65b98d 100644 --- a/external/referencesource/System.Data.Entity/System/Data/IEntityStateEntry.cs +++ b/external/referencesource/System.Data.Entity/System/Data/IEntityStateEntry.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner dsimmons +// @backupOwner amirhmy //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/IEntityStateManager.cs b/external/referencesource/System.Data.Entity/System/Data/IEntityStateManager.cs index 84a827fc4b..b042a5e9a7 100644 --- a/external/referencesource/System.Data.Entity/System/Data/IEntityStateManager.cs +++ b/external/referencesource/System.Data.Entity/System/Data/IEntityStateManager.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner dsimmons +// @backupOwner amirhmy //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/IExtendedDataRecord.cs b/external/referencesource/System.Data.Entity/System/Data/IExtendedDataRecord.cs index 4740870683..448c8e1a6d 100644 --- a/external/referencesource/System.Data.Entity/System/Data/IExtendedDataRecord.cs +++ b/external/referencesource/System.Data.Entity/System/Data/IExtendedDataRecord.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// sheetgu +// simoncav //------------------------------------------------------------------------------ namespace System.Data { @@ -32,4 +32,4 @@ namespace System.Data { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "i")] DbDataReader GetDataReader(int i); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity/System/Data/Mapping/ObjectMslConstructs.cs b/external/referencesource/System.Data.Entity/System/Data/Mapping/ObjectMslConstructs.cs index a7452f5c72..683d97f94b 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Mapping/ObjectMslConstructs.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Mapping/ObjectMslConstructs.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner leil +// @backupOwner anpete //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingErrorCode.cs b/external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingErrorCode.cs index e4cdc26392..2dead04e0a 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingErrorCode.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMappingErrorCode.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner leil +// @backupOwner anpete //--------------------------------------------------------------------- diff --git a/external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMslConstructs.cs b/external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMslConstructs.cs index 0c0b16806d..3ada1ef7f1 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMslConstructs.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Mapping/StorageMslConstructs.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner leil +// @backupOwner anpete //--------------------------------------------------------------------- diff --git a/external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/PropagatorFlags.cs b/external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/PropagatorFlags.cs index 1716ee42bd..733b116044 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/PropagatorFlags.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Mapping/Update/Internal/PropagatorFlags.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner cmeek +// @backupOwner pratikp //--------------------------------------------------------------------- namespace System.Data.Mapping.Update.Internal @@ -44,4 +44,4 @@ namespace System.Data.Mapping.Update.Internal /// ForeignKey = 32, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeOpType.cs b/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeOpType.cs index a59be2ad95..d30ab4d6b3 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeOpType.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Structures/CellTreeOpType.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner srimand +// @backupOwner cmeek //--------------------------------------------------------------------- diff --git a/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ViewGenErrorCode.cs b/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ViewGenErrorCode.cs index 894108d4c7..556a1f40ce 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ViewGenErrorCode.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Utils/ViewGenErrorCode.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner srimand +// @backupOwner cmeek //--------------------------------------------------------------------- diff --git a/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ConstraintBase.cs b/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ConstraintBase.cs index df7e0e97e4..b4b27eb677 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ConstraintBase.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Mapping/ViewGeneration/Validation/ConstraintBase.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner srimand +// @backupOwner cmeek //--------------------------------------------------------------------- using System.Data.Common.Utils; diff --git a/external/referencesource/System.Data.Entity/System/Data/Metadata/DataSpace.cs b/external/referencesource/System.Data.Entity/System/Data/Metadata/DataSpace.cs index a409eb1b11..3ecbcd20a1 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Metadata/DataSpace.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Metadata/DataSpace.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner leil +// @backupOwner anpete //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AttributeKind.cs b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AttributeKind.cs index 984882086e..bae1992de7 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AttributeKind.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/AttributeKind.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner leil //--------------------------------------------------------------------- using System; using System.Collections.Generic; diff --git a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/BuiltInKind.cs b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/BuiltInKind.cs index 0292051243..baeb9a544f 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/BuiltInKind.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/BuiltInKind.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner leil //--------------------------------------------------------------------- using System; using System.Collections.Generic; diff --git a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/OperationAction.cs b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/OperationAction.cs index daa7993814..5e30d38202 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/OperationAction.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/OperationAction.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner leil //--------------------------------------------------------------------- using System; using System.Collections.Generic; diff --git a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ParameterMode.cs b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ParameterMode.cs index 22be0531bd..17801dea5a 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ParameterMode.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/ParameterMode.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner leil //--------------------------------------------------------------------- namespace System.Data.Metadata.Edm @@ -31,4 +31,4 @@ namespace System.Data.Metadata.Edm /// ReturnValue } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/PrimitiveTypeKind.cs b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/PrimitiveTypeKind.cs index 0b264d9c92..2767594333 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/PrimitiveTypeKind.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/PrimitiveTypeKind.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner leil //--------------------------------------------------------------------- using System; using System.Collections.Generic; diff --git a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipMultiplicity.cs b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipMultiplicity.cs index 271f02bc46..88e5ec18c8 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipMultiplicity.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Metadata/Edm/RelationshipMultiplicity.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner leil //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/Metadata/EdmSchemaErrorSeverity.cs b/external/referencesource/System.Data.Entity/System/Data/Metadata/EdmSchemaErrorSeverity.cs index 207a99fb91..a3e97ffcec 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Metadata/EdmSchemaErrorSeverity.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Metadata/EdmSchemaErrorSeverity.cs @@ -3,14 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner leil +// @backupOwner anpete //--------------------------------------------------------------------- namespace System.Data.Metadata.Edm { // if you edit this file be sure you change GeneratorErrorSeverity - // also, they must stay in [....] + // also, they must stay in sync /// /// diff --git a/external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactAssemblyResolver.cs b/external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactAssemblyResolver.cs index 98a3c386f5..6ef2b2a1fa 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactAssemblyResolver.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Metadata/MetadataArtifactAssemblyResolver.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner leil +// @backupOwner anpete //--------------------------------------------------------------------- namespace System.Data.Metadata.Edm diff --git a/external/referencesource/System.Data.Entity/System/Data/Metadata/ParameterTypeSemantics.cs b/external/referencesource/System.Data.Entity/System/Data/Metadata/ParameterTypeSemantics.cs index f76b7d2408..4c66d34744 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Metadata/ParameterTypeSemantics.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Metadata/ParameterTypeSemantics.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner leil +// @backupOwner anpete //--------------------------------------------------------------------- namespace System.Data.Metadata.Edm @@ -30,4 +30,4 @@ namespace System.Data.Metadata.Edm /// ExactMatchOnly = 2 } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity/System/Data/Metadata/XmlConstants.cs b/external/referencesource/System.Data.Entity/System/Data/Metadata/XmlConstants.cs index 7276c7c07a..e9399896f3 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Metadata/XmlConstants.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Metadata/XmlConstants.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner leil +// @backupOwner anpete //--------------------------------------------------------------------- namespace System.Data.Metadata.Edm @@ -191,4 +191,4 @@ namespace System.Data.Metadata.Edm #endregion // CDM Schema Xml NodeNames } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityChangeTracker.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityChangeTracker.cs index dd6854bfe9..08cf53debb 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityChangeTracker.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityChangeTracker.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner sparra +// @backupOwner barryfr //--------------------------------------------------------------------- using System.Data.Objects; using System.Reflection; diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithChangeTracker.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithChangeTracker.cs index b46038ab7c..daee10b57b 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithChangeTracker.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithChangeTracker.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner barryfr +// @backupOwner sparra //--------------------------------------------------------------------- using System.Data.Objects; using System.Reflection; @@ -22,4 +22,4 @@ namespace System.Data.Objects.DataClasses /// Reference to the change tracker that is managing this entity void SetChangeTracker(IEntityChangeTracker changeTracker); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithKey.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithKey.cs index ff6c95bc3a..a0851617cb 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithKey.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithKey.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner barryfr +// @backupOwner sparra //--------------------------------------------------------------------- using System.Data.Objects; using System.Reflection; diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithRelationships.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithRelationships.cs index 58ec9e3a3a..7ff9f7d0ad 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithRelationships.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IEntityWithRelationships.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner sparra +// @backupOwner barryfr //--------------------------------------------------------------------- using System.Data.Objects; using System.Reflection; diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IRelatedEnd.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IRelatedEnd.cs index 04570e2da2..46d8a1e7d3 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IRelatedEnd.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IRelatedEnd.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner mirszy +// @backupOwner sparra //--------------------------------------------------------------------- using System.Data; using System.Data.Common; diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IRelationshipFixer.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IRelationshipFixer.cs index c6a84094ca..3c0d1e11d0 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IRelationshipFixer.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/IRelationshipFixer.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner mirszy +// @backupOwner sparra //--------------------------------------------------------------------- namespace System.Data.Objects.DataClasses diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipKind.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipKind.cs index 82ec31d7a8..a9425d817d 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipKind.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/DataClasses/RelationshipKind.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffreed +// @backupOwner pratikp //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectSet.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectSet.cs index 381c66c882..999c0eb866 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectSet.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectSet.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jeffders +// @backupOwner avickers //--------------------------------------------------------------------- using System.Collections; diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectView.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectView.cs index 3930b7725b..daba556e0f 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectView.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectView.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner amirhmy +// @backupOwner dsimmons //--------------------------------------------------------------------- using System; using System.ComponentModel; diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectViewData.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectViewData.cs index 9cc99a2613..055e0f92a9 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectViewData.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/IObjectViewData.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner jhutson +// @backupOwner jeffders //--------------------------------------------------------------------- using System; using System.Collections.Generic; diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/Internal/IEntityWrapper.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/Internal/IEntityWrapper.cs index 40eee8529b..4ebf495429 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/Internal/IEntityWrapper.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/Internal/IEntityWrapper.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner avickers +// @backupOwner jeffders //--------------------------------------------------------------------- using System.Collections; using System.Data.Objects.DataClasses; @@ -67,7 +67,7 @@ namespace System.Data.Objects.Internal ObjectContext Context { get; set; } /// - /// The merge option ----oicated with the wrapped entity. + /// The merge option assoicated with the wrapped entity. /// MergeOption MergeOption { get; } diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/MergeOption.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/MergeOption.cs index d522f2a756..9b709e3313 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/MergeOption.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/MergeOption.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner markash +// @backupOwner dsimmons //------------------------------------------------------------------------------ namespace System.Data.Objects { diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/RefreshMode.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/RefreshMode.cs index 4adc082600..a677e0dffd 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/RefreshMode.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/RefreshMode.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner markash +// @backupOwner dsimmons //------------------------------------------------------------------------------ namespace System.Data.Objects diff --git a/external/referencesource/System.Data.Entity/System/Data/Objects/SaveOptions.cs b/external/referencesource/System.Data.Entity/System/Data/Objects/SaveOptions.cs index b79e86b6c2..b53fe1dfbf 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Objects/SaveOptions.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Objects/SaveOptions.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner mirszy +// @backupOwner jeffders //------------------------------------------------------------------------------ namespace System.Data.Objects diff --git a/external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/BasicValidator.cs b/external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/BasicValidator.cs index 5d55c8dcee..dad56e9dde 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/BasicValidator.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Query/InternalTrees/BasicValidator.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner simoncav +// @backupOwner katicad //--------------------------------------------------------------------- using System; @@ -283,7 +283,7 @@ namespace System.Data.Query.InternalTrees public override void Visit(SoftCastOp op, Node n) { VisitScalarOpDefault(op, n); - // [....] 9/21/06 - temporarily removing check here + // Aconrad 9/21/06 - temporarily removing check here // because the assert wrongly fails in some cases where the types are promotable, // but the facets are not. Put this back when that issue is solved. // Assert(TypeSemantics.IsEquivalentOrPromotableTo(n.Child0.Op.Type, op.Type), "Illegal SoftCastOp: Cannot promote input type {0} to target type {1}", n.Child0.Op.Type.Identity, op.Type.Identity); diff --git a/external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Validator.cs b/external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Validator.cs index 9318b05eb0..4df0d97fcb 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Validator.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Query/PlanCompiler/Validator.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner katicad +// @backupOwner simoncav //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Entity/System/Data/Spatial/DbSpatialDataReader.cs b/external/referencesource/System.Data.Entity/System/Data/Spatial/DbSpatialDataReader.cs index ef541dfe97..5b41b42460 100644 --- a/external/referencesource/System.Data.Entity/System/Data/Spatial/DbSpatialDataReader.cs +++ b/external/referencesource/System.Data.Entity/System/Data/Spatial/DbSpatialDataReader.cs @@ -4,7 +4,7 @@ // // // @owner willa -// @backupOwner [....] +// @backupOwner srimand //--------------------------------------------------------------------- namespace System.Data.Spatial @@ -29,4 +29,4 @@ namespace System.Data.Spatial /// The instance of DbGeometry at the specified column value public abstract DbGeometry GetGeometry(int ordinal); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/ISqlFragment.cs b/external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/ISqlFragment.cs index 5d79af84cd..226d33c0c2 100644 --- a/external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/ISqlFragment.cs +++ b/external/referencesource/System.Data.Entity/System/Data/SqlClient/SqlGen/ISqlFragment.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner katicad +// @backupOwner sheetgu //--------------------------------------------------------------------- using System; diff --git a/external/referencesource/System.Data.Linq/FunctionResults.cs b/external/referencesource/System.Data.Linq/FunctionResults.cs index 2a8050fb29..3deee1bf5c 100644 --- a/external/referencesource/System.Data.Linq/FunctionResults.cs +++ b/external/referencesource/System.Data.Linq/FunctionResults.cs @@ -35,7 +35,7 @@ namespace System.Data.Linq { /// /// An interface for representing the result of a mapped function with a single return sequence. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="[....]: Meant to represent a database table which is delayed loaded and doesn't provide collection semantics.")] + [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="tadam: Meant to represent a database table which is delayed loaded and doesn't provide collection semantics.")] public interface ISingleResult : IEnumerable, IFunctionResult, IDisposable { } /// @@ -47,7 +47,7 @@ namespace System.Data.Linq { /// /// /// - [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "[....]: Generic parameters are required for strong-typing of the return type.")] + [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "tadam: Generic parameters are required for strong-typing of the return type.")] IEnumerable GetResult(); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Linq/SqlClient/Reader/ObjectReader.cs b/external/referencesource/System.Data.Linq/SqlClient/Reader/ObjectReader.cs index 2b2b6fd306..af65ca3c36 100644 --- a/external/referencesource/System.Data.Linq/SqlClient/Reader/ObjectReader.cs +++ b/external/referencesource/System.Data.Linq/SqlClient/Reader/ObjectReader.cs @@ -42,4 +42,4 @@ namespace System.Data.Linq.SqlClient { internal interface ICompiledSubQuery { IExecuteResult Execute(IProvider provider, object[] parentArgs, object[] userArgs); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.Linq/misc/SecurityUtils.cs b/external/referencesource/System.Data.Linq/misc/SecurityUtils.cs index 76e02fafba..66211b4ac0 100644 --- a/external/referencesource/System.Data.Linq/misc/SecurityUtils.cs +++ b/external/referencesource/System.Data.Linq/misc/SecurityUtils.cs @@ -37,6 +37,7 @@ namespace System.Windows.Forms /// internal static class SecurityUtils { +#if !DISABLE_CAS_USE private static volatile ReflectionPermission memberAccessPermission = null; private static volatile ReflectionPermission restrictedMemberAccessPermission = null; @@ -58,24 +59,30 @@ namespace System.Windows.Forms return restrictedMemberAccessPermission; } } +#endif private static void DemandReflectionAccess(Type type) { +#if !DISABLE_CAS_USE try { MemberAccessPermission.Demand(); } catch (SecurityException) { DemandGrantSet(type.Assembly); } +#endif } [SecuritySafeCritical] private static void DemandGrantSet(Assembly assembly) { +#if !DISABLE_CAS_USE PermissionSet targetGrantSet = assembly.PermissionSet; targetGrantSet.AddPermission(RestrictedMemberAccessPermission); targetGrantSet.Demand(); +#endif } private static bool HasReflectionPermission(Type type) { +#if !DISABLE_CAS_USE try { DemandReflectionAccess(type); return true; @@ -84,6 +91,9 @@ namespace System.Windows.Forms } return false; +#else + return true; +#endif } diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Assembly.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Assembly.cs index 86ae68722f..2cf2fa90c7 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Assembly.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Assembly.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// sdub //------------------------------------------------------------------------------ using System.Runtime.CompilerServices; diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/ISourceLineInfo.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/ISourceLineInfo.cs index c82cb37aa2..7a282ff5e4 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/ISourceLineInfo.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/ISourceLineInfo.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// sdub //------------------------------------------------------------------------------ namespace System.Xml.Xsl { diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILOptimization.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILOptimization.cs index 2a3c839178..2acef83867 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILOptimization.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlILOptimization.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// akimball //------------------------------------------------------------------------------ namespace System.Xml.Xsl.IlGen { diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlTrace.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlTrace.cs index c728a2d955..9a3142f614 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlTrace.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/IlGen/XmlIlTrace.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// akimball //------------------------------------------------------------------------------ using System; using System.IO; diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilNodeType.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilNodeType.cs index 14e8855e64..6ba982665a 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilNodeType.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/QilNodeType.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// akimball //------------------------------------------------------------------------------ namespace System.Xml.Xsl.Qil { /// An enumeration of all the possible QilExpression node types. diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/SerializationHints.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/SerializationHints.cs index 1483494fda..2e5d1c23b7 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/SerializationHints.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/QIL/SerializationHints.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// akimball //------------------------------------------------------------------------------ using System; @@ -12,4 +12,4 @@ namespace System.Xml.Xsl.Qil { CData, DisableOutputEscaping, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/IXPathEnvironment.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/IXPathEnvironment.cs index e47f52b15a..4e16b35f7c 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/IXPathEnvironment.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/IXPathEnvironment.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// sdub //------------------------------------------------------------------------------ using System.Collections.Generic; using System.Xml.Xsl.Qil; diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/IXpathBuilder.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/IXpathBuilder.cs index 4aa3d4f7ed..2f7099bd22 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/IXpathBuilder.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/IXpathBuilder.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// sdub //------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathAxis.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathAxis.cs index 01d3587ab3..532bdaa136 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathAxis.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathAxis.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// sdub //------------------------------------------------------------------------------ namespace System.Xml.Xsl.XPath { diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathContext.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathContext.cs index 480658bb6e..1a9890c703 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathContext.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathContext.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// sdub //------------------------------------------------------------------------------ #if DontUse @@ -120,4 +120,4 @@ namespace System.Xml.Xsl.XPath { } } } -#endif +#endif \ No newline at end of file diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathOperator.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathOperator.cs index 58998960d4..dee4c6c7be 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathOperator.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XPath/XPathOperator.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// sdub //------------------------------------------------------------------------------ namespace System.Xml.Xsl.XPath { diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlNodeKindFlags.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlNodeKindFlags.cs index 57029b028b..a3877a1aac 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlNodeKindFlags.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XmlNodeKindFlags.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// akimball //------------------------------------------------------------------------------ using System; namespace System.Xml.Xsl { @@ -64,4 +64,4 @@ namespace System.Xml.Xsl { /// Any = 0x7F, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/IErrorHelper.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/IErrorHelper.cs index 8462a1abe6..49cfac06e3 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/IErrorHelper.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/IErrorHelper.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// antonl //------------------------------------------------------------------------------ namespace System.Xml.Xsl { diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslFlags.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslFlags.cs index e50eca0826..a9ba535bbd 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslFlags.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/Xslt/XslFlags.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// sdub //------------------------------------------------------------------------------ namespace System.Xml.Xsl { diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ActionFrame.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ActionFrame.cs index e802f4f5f0..21f5fb062e 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ActionFrame.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ActionFrame.cs @@ -76,7 +76,6 @@ namespace System.Xml.Xsl.XsltOld { return ++ this.counter; } - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] internal void AllocateVariables(int count) { if (0 < count) { this.variables = new object [count]; diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScopeManager.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScopeManager.cs index e5e90afbe5..b1c1afae2b 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScopeManager.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/InputScopeManager.cs @@ -107,7 +107,6 @@ namespace System.Xml.Xsl.XsltOld { return ResolveNonEmptyPrefix(prefix); } - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] public string ResolveXPathNamespace(string prefix) { Debug.Assert(prefix != null); if (prefix.Length == 0) { diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScopeManager.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScopeManager.cs index a173ae0557..dfefae8392 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScopeManager.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/OutputScopeManager.cs @@ -26,7 +26,6 @@ namespace System.Xml.Xsl.XsltOld { } internal OutputScope CurrentElementScope { - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] get { Debug.Assert(this.elementScopesStack.Peek() != null); // We adding rootElementScope to garantee this return (OutputScope) this.elementScopesStack.Peek(); diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Processor.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Processor.cs index 2981dc9b74..740dc7db76 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Processor.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/Processor.cs @@ -185,7 +185,6 @@ namespace System.Xml.Xsl.XsltOld { this.sortArray.Add(sortinfo); } - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] internal void InitSortArray() { if (this.sortArray == null) { this.sortArray = new ArrayList(); @@ -343,7 +342,6 @@ namespace System.Xml.Xsl.XsltOld { this.PushActionFrame(this.rootAction, /*nodeSet:*/null); } - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] public ReaderOutput StartReader() { ReaderOutput output = new ReaderOutput(this); this.builder = new RecordBuilder(output, this.nameTable); diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ReaderOutput.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ReaderOutput.cs index 61403d4360..b8f45d089f 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ReaderOutput.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/ReaderOutput.cs @@ -56,7 +56,6 @@ namespace System.Xml.Xsl.XsltOld { // XmlReader abstract methods implementation public override XmlNodeType NodeType { - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] get { CheckCurrentInfo(); return this.currentInfo.NodeType; @@ -84,7 +83,6 @@ namespace System.Xml.Xsl.XsltOld { } public override string LocalName { - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] get { CheckCurrentInfo(); return this.currentInfo.LocalName; @@ -92,7 +90,6 @@ namespace System.Xml.Xsl.XsltOld { } public override string NamespaceURI { - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] get { CheckCurrentInfo(); return this.currentInfo.NamespaceURI; @@ -100,7 +97,6 @@ namespace System.Xml.Xsl.XsltOld { } public override string Prefix { - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] get { CheckCurrentInfo(); return this.currentInfo.Prefix; @@ -114,7 +110,6 @@ namespace System.Xml.Xsl.XsltOld { } public override string Value { - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] get { CheckCurrentInfo(); return this.currentInfo.Value; @@ -122,7 +117,6 @@ namespace System.Xml.Xsl.XsltOld { } public override int Depth { - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] get { CheckCurrentInfo(); return this.currentInfo.Depth; @@ -136,7 +130,6 @@ namespace System.Xml.Xsl.XsltOld { } public override bool IsEmptyElement { - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] get { CheckCurrentInfo(); return this.currentInfo.IsEmptyTag; @@ -239,7 +232,6 @@ namespace System.Xml.Xsl.XsltOld { SetAttribute(i); } - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] public override bool MoveToFirstAttribute() { if (this.attributeCount <= 0) { Debug.Assert(this.attributeCount == 0); @@ -503,7 +495,6 @@ namespace System.Xml.Xsl.XsltOld { return Processor.OutputResult.Interrupt; } - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] public void TheEnd() { // nothing here, was taken care of by RecordBuilder } @@ -517,7 +508,6 @@ namespace System.Xml.Xsl.XsltOld { this.currentInfo = this.mainNode; } - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] private void SetAttribute(int attrib) { Debug.Assert(0 <= attrib && attrib < this.attributeCount); Debug.Assert(0 <= attrib && attrib < this.attributeList.Count); diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RecordOutput.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RecordOutput.cs index a161afdd56..a17ede7d4a 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RecordOutput.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/RecordOutput.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// sdub //------------------------------------------------------------------------------ namespace System.Xml.Xsl.XsltOld { diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltCompileContext.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltCompileContext.cs index b64c0bca60..a6c74c175d 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltCompileContext.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltCompileContext.cs @@ -53,7 +53,6 @@ namespace System.Xml.Xsl.XsltOld { get { return string.Empty; } } - [System.Runtime.TargetedPatchingOptOutAttribute("Performance critical to inline across NGen image boundaries")] public override string LookupNamespace(string prefix) { return this.manager.ResolveXPathNamespace(prefix); } diff --git a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltDebugger.cs b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltDebugger.cs index 167880fe92..75237b5744 100644 --- a/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltDebugger.cs +++ b/external/referencesource/System.Data.SqlXml/System/Xml/Xsl/XsltOld/XsltDebugger.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// sdub //------------------------------------------------------------------------------ namespace System.Xml.Xsl.XsltOld.Debugger { diff --git a/external/referencesource/System.Data/FxCopSuppressions/Baseline.cs.REMOVED.git-id b/external/referencesource/System.Data/FxCopSuppressions/Baseline.cs.REMOVED.git-id index b3c3c6da69..f01da8f291 100644 --- a/external/referencesource/System.Data/FxCopSuppressions/Baseline.cs.REMOVED.git-id +++ b/external/referencesource/System.Data/FxCopSuppressions/Baseline.cs.REMOVED.git-id @@ -1 +1 @@ -aa2e99bd4640de47ad226c3917f3fe907a4daae5 \ No newline at end of file +7abc21d2ab608a12bf6305911fbc83c6a380a9af \ No newline at end of file diff --git a/external/referencesource/System.Data/FxCopSuppressions/EverettBreaking.cs b/external/referencesource/System.Data/FxCopSuppressions/EverettBreaking.cs index 439cd5fd52..5d081565bf 100644 --- a/external/referencesource/System.Data/FxCopSuppressions/EverettBreaking.cs +++ b/external/referencesource/System.Data/FxCopSuppressions/EverettBreaking.cs @@ -3,9 +3,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// [....] -// [....] -// [....] +// nissimn +// alazela +// sukanyas //------------------------------------------------------------------------------ // // This file has a list of FXCOP messages to suppress, converted from ddsuites\src\FxCop\Excludes\EverettBreaking\System.Data.dll-breaking.xml using FXCOP GUI. diff --git a/external/referencesource/System.Data/FxCopSuppressions/FxCop40Suppressions.cs.REMOVED.git-id b/external/referencesource/System.Data/FxCopSuppressions/FxCop40Suppressions.cs.REMOVED.git-id index b123d64be2..a678fc8898 100644 --- a/external/referencesource/System.Data/FxCopSuppressions/FxCop40Suppressions.cs.REMOVED.git-id +++ b/external/referencesource/System.Data/FxCopSuppressions/FxCop40Suppressions.cs.REMOVED.git-id @@ -1 +1 @@ -eba9ff765e5ea30b673d3369244b8886ed89410a \ No newline at end of file +47c2ab42a12af283349c0a6543f8743e276ffb8c \ No newline at end of file diff --git a/external/referencesource/System.Data/FxCopSuppressions/Triaged.cs.REMOVED.git-id b/external/referencesource/System.Data/FxCopSuppressions/Triaged.cs.REMOVED.git-id index 5e978fd655..32a23cadd3 100644 --- a/external/referencesource/System.Data/FxCopSuppressions/Triaged.cs.REMOVED.git-id +++ b/external/referencesource/System.Data/FxCopSuppressions/Triaged.cs.REMOVED.git-id @@ -1 +1 @@ -34029050de9492ca42f0d64ab4e519374d3e6b78 \ No newline at end of file +755ece1b4aa19590b258ebae8e15c816f9c4e035 \ No newline at end of file diff --git a/external/referencesource/System.Data/Microsoft/SqlServer/Server/ExtendedClrTypeCode.cs b/external/referencesource/System.Data/Microsoft/SqlServer/Server/ExtendedClrTypeCode.cs index 450023f5de..e17cb205f1 100644 --- a/external/referencesource/System.Data/Microsoft/SqlServer/Server/ExtendedClrTypeCode.cs +++ b/external/referencesource/System.Data/Microsoft/SqlServer/Server/ExtendedClrTypeCode.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// alazela +// stevesta //------------------------------------------------------------------------------ namespace Microsoft.SqlServer.Server { diff --git a/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedGetters.cs b/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedGetters.cs index 1530ccf91e..1e8eb3c636 100644 --- a/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedGetters.cs +++ b/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedGetters.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// alazela +// stevesta //------------------------------------------------------------------------------ namespace Microsoft.SqlServer.Server { diff --git a/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedGettersV3.cs b/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedGettersV3.cs index 9d4e0faac6..451b2874b2 100644 --- a/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedGettersV3.cs +++ b/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedGettersV3.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// alazela +// stevesta //------------------------------------------------------------------------------ namespace Microsoft.SqlServer.Server { diff --git a/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedSetters.cs b/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedSetters.cs index e3e7ff8c6d..9386299042 100644 --- a/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedSetters.cs +++ b/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedSetters.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// alazela +// stevesta //------------------------------------------------------------------------------ namespace Microsoft.SqlServer.Server { diff --git a/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedSettersV3.cs b/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedSettersV3.cs index daf677bdf9..4c06696455 100644 --- a/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedSettersV3.cs +++ b/external/referencesource/System.Data/Microsoft/SqlServer/Server/ITypedSettersV3.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// alazela +// stevesta //------------------------------------------------------------------------------ namespace Microsoft.SqlServer.Server { diff --git a/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiExecuteType.cs b/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiExecuteType.cs index 685e354b13..979f737a17 100644 --- a/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiExecuteType.cs +++ b/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiExecuteType.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// alazela +// stevesta //------------------------------------------------------------------------------ namespace Microsoft.SqlServer.Server { diff --git a/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiLink.cs b/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiLink.cs index cae8aa8fef..f6024415ba 100644 --- a/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiLink.cs +++ b/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiLink.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// alazela +// billin //------------------------------------------------------------------------------ [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("SqlAccess, PublicKey=0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")] // SQLBU 437687 diff --git a/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaData.cs b/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaData.cs index 380902e143..ed861e021c 100644 --- a/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaData.cs +++ b/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiMetaData.cs @@ -983,6 +983,8 @@ namespace Microsoft.SqlServer.Server { // // MetaData class to send parameter definitions to server. // Sealed because we don't need to derive from it yet. + // IMPORTANT DEVNOTE: This class is being used for parameter encryption functionality, to get the type_info TDS object from SqlParameter. + // Please consider impact to that when changing this class. Refer to the callers of SqlParameter.GetMetadataForTypeInfo(). internal sealed class SmiParameterMetaData : SmiExtendedMetaData { private ParameterDirection _direction; diff --git a/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiStream.cs b/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiStream.cs index f46c8ee737..e10d0ffb55 100644 --- a/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiStream.cs +++ b/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiStream.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// alazela +// stevesta //------------------------------------------------------------------------------ // Stream-like object that uses SmiEventSink for server-side errors. diff --git a/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiXetterTypeCode.cs b/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiXetterTypeCode.cs index 86fb084223..6f7d40eb7d 100644 --- a/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiXetterTypeCode.cs +++ b/external/referencesource/System.Data/Microsoft/SqlServer/Server/SmiXetterTypeCode.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// alazela +// billin //------------------------------------------------------------------------------ namespace Microsoft.SqlServer.Server { diff --git a/external/referencesource/System.Data/System/Data/AcceptRejectRule.cs b/external/referencesource/System.Data/System/Data/AcceptRejectRule.cs index 195337d1f7..f7eb28b211 100644 --- a/external/referencesource/System.Data/System/Data/AcceptRejectRule.cs +++ b/external/referencesource/System.Data/System/Data/AcceptRejectRule.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/AggregateType.cs b/external/referencesource/System.Data/System/Data/AggregateType.cs index a40cdfe635..c459f43092 100644 --- a/external/referencesource/System.Data/System/Data/AggregateType.cs +++ b/external/referencesource/System.Data/System/Data/AggregateType.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/CatalogLocation.cs b/external/referencesource/System.Data/System/Data/CatalogLocation.cs index de8e614254..9cbc4efde9 100644 --- a/external/referencesource/System.Data/System/Data/CatalogLocation.cs +++ b/external/referencesource/System.Data/System/Data/CatalogLocation.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data.Common { diff --git a/external/referencesource/System.Data/System/Data/CommandBehavior.cs b/external/referencesource/System.Data/System/Data/CommandBehavior.cs index 5eb7accfa8..0546e32135 100644 --- a/external/referencesource/System.Data/System/Data/CommandBehavior.cs +++ b/external/referencesource/System.Data/System/Data/CommandBehavior.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { @@ -14,7 +14,7 @@ namespace System.Data { SingleResult = 1, // with data, force single result, may affect database SchemaOnly = 2, // column info, no data, no effect on database KeyInfo = 4, // column info + primary key information (if available) - // + // UNDONE: SingleRow = 8 | SingleResult, SingleRow = 8, // data, hint single row and single result, may affect database - doesn't apply to child(chapter) results SequentialAccess = 0x10, CloseConnection = 0x20, diff --git a/external/referencesource/System.Data/System/Data/CommandType.cs b/external/referencesource/System.Data/System/Data/CommandType.cs index 2368a321d6..dbb3097520 100644 --- a/external/referencesource/System.Data/System/Data/CommandType.cs +++ b/external/referencesource/System.Data/System/Data/CommandType.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/Common/AdapterSwitches.cs b/external/referencesource/System.Data/System/Data/Common/AdapterSwitches.cs index 67842354ca..be5d8321b9 100644 --- a/external/referencesource/System.Data/System/Data/Common/AdapterSwitches.cs +++ b/external/referencesource/System.Data/System/Data/Common/AdapterSwitches.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ #if DEBUG diff --git a/external/referencesource/System.Data/System/Data/Common/AdapterUtil.cs.REMOVED.git-id b/external/referencesource/System.Data/System/Data/Common/AdapterUtil.cs.REMOVED.git-id index 27eb11e019..a9e3b601fd 100644 --- a/external/referencesource/System.Data/System/Data/Common/AdapterUtil.cs.REMOVED.git-id +++ b/external/referencesource/System.Data/System/Data/Common/AdapterUtil.cs.REMOVED.git-id @@ -1 +1 @@ -f8880b5d09ba0af05986f7f82be2593ae8caf155 \ No newline at end of file +8103f0fce6e26a6c2e6ce8987157ed229da0a861 \ No newline at end of file diff --git a/external/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs b/external/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs index 9f63711fbb..11257cc6de 100644 --- a/external/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs +++ b/external/referencesource/System.Data/System/Data/Common/DbConnectionOptions.cs @@ -109,6 +109,7 @@ namespace System.Data.Common { private readonly Hashtable _parsetable; internal readonly NameValuePair KeyChain; internal readonly bool HasPasswordKeyword; + internal readonly bool HasUserIdKeyword; // differences between OleDb and Odbc // ODBC: @@ -144,12 +145,14 @@ namespace System.Data.Common { if (0 < _usersConnectionString.Length) { KeyChain = ParseInternal(_parsetable, _usersConnectionString, true, synonyms, UseOdbcRules); HasPasswordKeyword = (_parsetable.ContainsKey(KEY.Password) || _parsetable.ContainsKey(SYNONYM.Pwd)); + HasUserIdKeyword = (_parsetable.ContainsKey(KEY.User_ID) || _parsetable.ContainsKey(SYNONYM.UID)); } } protected DbConnectionOptions(DbConnectionOptions connectionOptions) { // Clone used by SqlConnectionString _usersConnectionString = connectionOptions._usersConnectionString; HasPasswordKeyword = connectionOptions.HasPasswordKeyword; + HasUserIdKeyword = connectionOptions.HasUserIdKeyword; UseOdbcRules = connectionOptions.UseOdbcRules; _parsetable = connectionOptions._parsetable; KeyChain = connectionOptions.KeyChain; diff --git a/external/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs b/external/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs index f716a2679c..780bd97c98 100644 --- a/external/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs +++ b/external/referencesource/System.Data/System/Data/Common/DbConnectionStringBuilder.cs @@ -128,7 +128,7 @@ namespace System.Data.Common { foreach(string keyword in Keys) { object value; if (ShouldSerialize(keyword) && TryGetValue(keyword, out value)) { - string keyvalue = (null != value) ? Convert.ToString(value, CultureInfo.InvariantCulture) : (string)null; + string keyvalue = ConvertValueToString(value); AppendKeyValuePair(builder, keyword, keyvalue, UseOdbcRules); } } @@ -213,6 +213,10 @@ namespace System.Data.Common { } } + internal virtual string ConvertValueToString(object value) { + return (value == null) ? (string)null : Convert.ToString(value, CultureInfo.InvariantCulture); + } + void System.Collections.IDictionary.Add(object keyword, object value) { Add(ObjectToString(keyword), value); } diff --git a/external/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs b/external/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs index 307e3f9aa1..e1981b6b9d 100644 --- a/external/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs +++ b/external/referencesource/System.Data/System/Data/Common/DbConnectionStringCommon.cs @@ -236,17 +236,21 @@ namespace System.Data.Common { } } - internal static class DbConnectionStringBuilderUtil { + internal static class DbConnectionStringBuilderUtil + { - internal static bool ConvertToBoolean(object value) { + internal static bool ConvertToBoolean(object value) + { Debug.Assert(null != value, "ConvertToBoolean(null)"); string svalue = (value as string); - if (null != svalue) { + if (null != svalue) + { if (StringComparer.OrdinalIgnoreCase.Equals(svalue, "true") || StringComparer.OrdinalIgnoreCase.Equals(svalue, "yes")) return true; else if (StringComparer.OrdinalIgnoreCase.Equals(svalue, "false") || StringComparer.OrdinalIgnoreCase.Equals(svalue, "no")) return false; - else { + else + { string tmp = svalue.Trim(); // Remove leading & trailing white space. if (StringComparer.OrdinalIgnoreCase.Equals(tmp, "true") || StringComparer.OrdinalIgnoreCase.Equals(tmp, "yes")) return true; @@ -255,23 +259,28 @@ namespace System.Data.Common { } return Boolean.Parse(svalue); } - try { + try + { return ((IConvertible)value).ToBoolean(CultureInfo.InvariantCulture); } - catch(InvalidCastException e) { + catch (InvalidCastException e) + { throw ADP.ConvertFailed(value.GetType(), typeof(Boolean), e); } } - internal static bool ConvertToIntegratedSecurity(object value) { + internal static bool ConvertToIntegratedSecurity(object value) + { Debug.Assert(null != value, "ConvertToIntegratedSecurity(null)"); string svalue = (value as string); - if (null != svalue) { + if (null != svalue) + { if (StringComparer.OrdinalIgnoreCase.Equals(svalue, "sspi") || StringComparer.OrdinalIgnoreCase.Equals(svalue, "true") || StringComparer.OrdinalIgnoreCase.Equals(svalue, "yes")) return true; else if (StringComparer.OrdinalIgnoreCase.Equals(svalue, "false") || StringComparer.OrdinalIgnoreCase.Equals(svalue, "no")) return false; - else { + else + { string tmp = svalue.Trim(); // Remove leading & trailing white space. if (StringComparer.OrdinalIgnoreCase.Equals(tmp, "sspi") || StringComparer.OrdinalIgnoreCase.Equals(tmp, "true") || StringComparer.OrdinalIgnoreCase.Equals(tmp, "yes")) return true; @@ -280,28 +289,36 @@ namespace System.Data.Common { } return Boolean.Parse(svalue); } - try { + try + { return ((IConvertible)value).ToBoolean(CultureInfo.InvariantCulture); } - catch(InvalidCastException e) { + catch (InvalidCastException e) + { throw ADP.ConvertFailed(value.GetType(), typeof(Boolean), e); } } - internal static int ConvertToInt32(object value) { - try { + internal static int ConvertToInt32(object value) + { + try + { return ((IConvertible)value).ToInt32(CultureInfo.InvariantCulture); } - catch(InvalidCastException e) { + catch (InvalidCastException e) + { throw ADP.ConvertFailed(value.GetType(), typeof(Int32), e); } } - internal static string ConvertToString(object value) { - try { + internal static string ConvertToString(object value) + { + try + { return ((IConvertible)value).ToString(CultureInfo.InvariantCulture); } - catch(InvalidCastException e) { + catch (InvalidCastException e) + { throw ADP.ConvertFailed(value.GetType(), typeof(String), e); } } @@ -309,35 +326,43 @@ namespace System.Data.Common { const string ApplicationIntentReadWriteString = "ReadWrite"; const string ApplicationIntentReadOnlyString = "ReadOnly"; - internal static bool TryConvertToApplicationIntent(string value, out ApplicationIntent result) { + internal static bool TryConvertToApplicationIntent(string value, out ApplicationIntent result) + { Debug.Assert(Enum.GetNames(typeof(ApplicationIntent)).Length == 2, "ApplicationIntent enum has changed, update needed"); Debug.Assert(null != value, "TryConvertToApplicationIntent(null,...)"); - if (StringComparer.OrdinalIgnoreCase.Equals(value, ApplicationIntentReadOnlyString)) { + if (StringComparer.OrdinalIgnoreCase.Equals(value, ApplicationIntentReadOnlyString)) + { result = ApplicationIntent.ReadOnly; return true; } - else if (StringComparer.OrdinalIgnoreCase.Equals(value, ApplicationIntentReadWriteString)) { + else if (StringComparer.OrdinalIgnoreCase.Equals(value, ApplicationIntentReadWriteString)) + { result = ApplicationIntent.ReadWrite; return true; } - else { + else + { result = DbConnectionStringDefaults.ApplicationIntent; return false; } } - internal static bool IsValidApplicationIntentValue(ApplicationIntent value) { + internal static bool IsValidApplicationIntentValue(ApplicationIntent value) + { Debug.Assert(Enum.GetNames(typeof(ApplicationIntent)).Length == 2, "ApplicationIntent enum has changed, update needed"); return value == ApplicationIntent.ReadOnly || value == ApplicationIntent.ReadWrite; } - internal static string ApplicationIntentToString(ApplicationIntent value) { + internal static string ApplicationIntentToString(ApplicationIntent value) + { Debug.Assert(IsValidApplicationIntentValue(value)); - if (value == ApplicationIntent.ReadOnly) { + if (value == ApplicationIntent.ReadOnly) + { return ApplicationIntentReadOnlyString; } - else { + else + { return ApplicationIntentReadWriteString; } } @@ -352,22 +377,283 @@ namespace System.Data.Common { /// in any case above, if the conerted value is out of valid range, the method raises ArgumentOutOfRangeException. /// /// applicaiton intent value in the valid range - internal static ApplicationIntent ConvertToApplicationIntent(string keyword, object value) { + internal static ApplicationIntent ConvertToApplicationIntent(string keyword, object value) + { Debug.Assert(null != value, "ConvertToApplicationIntent(null)"); string sValue = (value as string); ApplicationIntent result; - if (null != sValue) { + if (null != sValue) + { // We could use Enum.TryParse here, but it accepts value combinations like // "ReadOnly, ReadWrite" which are unwelcome here // Also, Enum.TryParse is 100x slower than plain StringComparer.OrdinalIgnoreCase.Equals method. - if (TryConvertToApplicationIntent(sValue, out result)) { + if (TryConvertToApplicationIntent(sValue, out result)) + { return result; } // try again after remove leading & trailing whitespaces. sValue = sValue.Trim(); - if (TryConvertToApplicationIntent(sValue, out result)) { + if (TryConvertToApplicationIntent(sValue, out result)) + { + return result; + } + + // string values must be valid + throw ADP.InvalidConnectionOptionValue(keyword); + } + else + { + // the value is not string, try other options + ApplicationIntent eValue; + + if (value is ApplicationIntent) + { + // quick path for the most common case + eValue = (ApplicationIntent)value; + } + else if (value.GetType().IsEnum) + { + // explicitly block scenarios in which user tries to use wrong enum types, like: + // builder["ApplicationIntent"] = EnvironmentVariableTarget.Process; + // workaround: explicitly cast non-ApplicationIntent enums to int + throw ADP.ConvertFailed(value.GetType(), typeof(ApplicationIntent), null); + } + else + { + try + { + // Enum.ToObject allows only integral and enum values (enums are blocked above), rasing ArgumentException for the rest + eValue = (ApplicationIntent)Enum.ToObject(typeof(ApplicationIntent), value); + } + catch (ArgumentException e) + { + // to be consistent with the messages we send in case of wrong type usage, replace + // the error with our exception, and keep the original one as inner one for troubleshooting + throw ADP.ConvertFailed(value.GetType(), typeof(ApplicationIntent), e); + } + } + + // ensure value is in valid range + if (IsValidApplicationIntentValue(eValue)) + { + return eValue; + } + else + { + throw ADP.InvalidEnumerationValue(typeof(ApplicationIntent), (int)eValue); + } + } + } + + const string SqlPasswordString = "Sql Password"; + const string ActiveDirectoryPasswordString = "Active Directory Password"; + const string ActiveDirectoryIntegratedString = "Active Directory Integrated"; + + internal static bool TryConvertToAuthenticationType(string value, out SqlAuthenticationMethod result) + { + Debug.Assert(Enum.GetNames(typeof(SqlAuthenticationMethod)).Length == 4, "SqlAuthenticationMethod enum has changed, update needed"); + + bool isSuccess = false; + + if (StringComparer.InvariantCultureIgnoreCase.Equals(value, SqlPasswordString)) + { + result = SqlAuthenticationMethod.SqlPassword; + isSuccess = true; + } + else if (StringComparer.InvariantCultureIgnoreCase.Equals(value, ActiveDirectoryPasswordString)) + { + result = SqlAuthenticationMethod.ActiveDirectoryPassword; + isSuccess = true; + } + else if (StringComparer.InvariantCultureIgnoreCase.Equals(value, ActiveDirectoryIntegratedString)) + { + result = SqlAuthenticationMethod.ActiveDirectoryIntegrated; + isSuccess = true; + } + else + { + result = DbConnectionStringDefaults.Authentication; + } + return isSuccess; + } + + /// + /// Column Encryption Setting. + /// + const string ColumnEncryptionSettingEnabledString = "Enabled"; + const string ColumnEncryptionSettingDisabledString = "Disabled"; + + /// + /// Convert a string value to the corresponding SqlConnectionColumnEncryptionSetting. + /// + /// + /// + /// + internal static bool TryConvertToColumnEncryptionSetting(string value, out SqlConnectionColumnEncryptionSetting result) { + bool isSuccess = false; + + if (StringComparer.InvariantCultureIgnoreCase.Equals(value, ColumnEncryptionSettingEnabledString)) { + result = SqlConnectionColumnEncryptionSetting.Enabled; + isSuccess = true; + } + else if (StringComparer.InvariantCultureIgnoreCase.Equals(value, ColumnEncryptionSettingDisabledString)) { + result = SqlConnectionColumnEncryptionSetting.Disabled; + isSuccess = true; + } + else { + result = DbConnectionStringDefaults.ColumnEncryptionSetting; + } + + return isSuccess; + } + + /// + /// Is it a valid connection level column encryption setting ? + /// + /// + /// + internal static bool IsValidColumnEncryptionSetting(SqlConnectionColumnEncryptionSetting value) { + Debug.Assert(Enum.GetNames(typeof(SqlConnectionColumnEncryptionSetting)).Length == 2, "SqlConnectionColumnEncryptionSetting enum has changed, update needed"); + return value == SqlConnectionColumnEncryptionSetting.Enabled || value == SqlConnectionColumnEncryptionSetting.Disabled; + } + + /// + /// Convert connection level column encryption setting value to string. + /// + /// + /// + internal static string ColumnEncryptionSettingToString(SqlConnectionColumnEncryptionSetting value) { + Debug.Assert(IsValidColumnEncryptionSetting(value), "value is not a valid connection level column encryption setting."); + + switch (value) { + case SqlConnectionColumnEncryptionSetting.Enabled: + return ColumnEncryptionSettingEnabledString; + case SqlConnectionColumnEncryptionSetting.Disabled: + return ColumnEncryptionSettingDisabledString; + + default: + return null; + } + } + + internal static bool IsValidAuthenticationTypeValue(SqlAuthenticationMethod value) { + Debug.Assert(Enum.GetNames(typeof(SqlAuthenticationMethod)).Length == 4, "SqlAuthenticationMethod enum has changed, update needed"); + return value == SqlAuthenticationMethod.SqlPassword + || value == SqlAuthenticationMethod.ActiveDirectoryPassword + || value == SqlAuthenticationMethod.ActiveDirectoryIntegrated + || value == SqlAuthenticationMethod.NotSpecified; + } + + internal static string AuthenticationTypeToString(SqlAuthenticationMethod value) + { + Debug.Assert(IsValidAuthenticationTypeValue(value)); + + switch (value) + { + case SqlAuthenticationMethod.SqlPassword: + return SqlPasswordString; + case SqlAuthenticationMethod.ActiveDirectoryPassword: + return ActiveDirectoryPasswordString; + case SqlAuthenticationMethod.ActiveDirectoryIntegrated: + return ActiveDirectoryIntegratedString; + default: + return null; + } + } + + internal static SqlAuthenticationMethod ConvertToAuthenticationType(string keyword, object value) + { + if (null == value) + { + return DbConnectionStringDefaults.Authentication; + } + + string sValue = (value as string); + SqlAuthenticationMethod result; + if (null != sValue) + { + if (TryConvertToAuthenticationType(sValue, out result)) + { + return result; + } + + // try again after remove leading & trailing whitespaces. + sValue = sValue.Trim(); + if (TryConvertToAuthenticationType(sValue, out result)) + { + return result; + } + + // string values must be valid + throw ADP.InvalidConnectionOptionValue(keyword); + } + else + { + // the value is not string, try other options + SqlAuthenticationMethod eValue; + + if (value is SqlAuthenticationMethod) + { + // quick path for the most common case + eValue = (SqlAuthenticationMethod)value; + } + else if (value.GetType().IsEnum) + { + // explicitly block scenarios in which user tries to use wrong enum types, like: + // builder["ApplicationIntent"] = EnvironmentVariableTarget.Process; + // workaround: explicitly cast non-ApplicationIntent enums to int + throw ADP.ConvertFailed(value.GetType(), typeof(SqlAuthenticationMethod), null); + } + else + { + try + { + // Enum.ToObject allows only integral and enum values (enums are blocked above), rasing ArgumentException for the rest + eValue = (SqlAuthenticationMethod)Enum.ToObject(typeof(SqlAuthenticationMethod), value); + } + catch (ArgumentException e) + { + // to be consistent with the messages we send in case of wrong type usage, replace + // the error with our exception, and keep the original one as inner one for troubleshooting + throw ADP.ConvertFailed(value.GetType(), typeof(SqlAuthenticationMethod), e); + } + } + + // ensure value is in valid range + if (IsValidAuthenticationTypeValue(eValue)) + { + return eValue; + } + else + { + throw ADP.InvalidEnumerationValue(typeof(SqlAuthenticationMethod), (int)eValue); + } + } + } + + /// + /// Convert the provided value to a SqlConnectionColumnEncryptionSetting. + /// + /// + /// + /// + internal static SqlConnectionColumnEncryptionSetting ConvertToColumnEncryptionSetting(string keyword, object value) { + if (null == value) { + return DbConnectionStringDefaults.ColumnEncryptionSetting; + } + + string sValue = (value as string); + SqlConnectionColumnEncryptionSetting result; + if (null != sValue) { + if (TryConvertToColumnEncryptionSetting(sValue, out result)) { + return result; + } + + // try again after remove leading & trailing whitespaces. + sValue = sValue.Trim(); + if (TryConvertToColumnEncryptionSetting(sValue, out result)) { return result; } @@ -376,36 +662,36 @@ namespace System.Data.Common { } else { // the value is not string, try other options - ApplicationIntent eValue; + SqlConnectionColumnEncryptionSetting eValue; - if (value is ApplicationIntent) { + if (value is SqlConnectionColumnEncryptionSetting) { // quick path for the most common case - eValue = (ApplicationIntent)value; + eValue = (SqlConnectionColumnEncryptionSetting)value; } else if (value.GetType().IsEnum) { // explicitly block scenarios in which user tries to use wrong enum types, like: - // builder["ApplicationIntent"] = EnvironmentVariableTarget.Process; - // workaround: explicitly cast non-ApplicationIntent enums to int - throw ADP.ConvertFailed(value.GetType(), typeof(ApplicationIntent), null); + // builder["SqlConnectionColumnEncryptionSetting"] = EnvironmentVariableTarget.Process; + // workaround: explicitly cast non-SqlConnectionColumnEncryptionSetting enums to int + throw ADP.ConvertFailed(value.GetType(), typeof(SqlConnectionColumnEncryptionSetting), null); } else { try { // Enum.ToObject allows only integral and enum values (enums are blocked above), rasing ArgumentException for the rest - eValue = (ApplicationIntent)Enum.ToObject(typeof(ApplicationIntent), value); + eValue = (SqlConnectionColumnEncryptionSetting)Enum.ToObject(typeof(SqlConnectionColumnEncryptionSetting), value); } catch (ArgumentException e) { // to be consistent with the messages we send in case of wrong type usage, replace // the error with our exception, and keep the original one as inner one for troubleshooting - throw ADP.ConvertFailed(value.GetType(), typeof(ApplicationIntent), e); + throw ADP.ConvertFailed(value.GetType(), typeof(SqlConnectionColumnEncryptionSetting), e); } } // ensure value is in valid range - if (IsValidApplicationIntentValue(eValue)) { + if (IsValidColumnEncryptionSetting(eValue)) { return eValue; } else { - throw ADP.InvalidEnumerationValue(typeof(ApplicationIntent), (int)eValue); + throw ADP.InvalidEnumerationValue(typeof(SqlConnectionColumnEncryptionSetting), (int)eValue); } } } @@ -430,39 +716,42 @@ namespace System.Data.Common { internal const bool OmitOracleConnectionName = false; // SqlClient - internal const ApplicationIntent ApplicationIntent = System.Data.SqlClient.ApplicationIntent.ReadWrite; - internal const string ApplicationName = ".Net SqlClient Data Provider"; - internal const bool AsynchronousProcessing = false; - internal const string AttachDBFilename = ""; - internal const int ConnectTimeout = 15; - internal const bool ConnectionReset = true; - internal const bool ContextConnection = false; - internal const string CurrentLanguage = ""; - internal const string DataSource = ""; - internal const bool Encrypt = false; - internal const bool Enlist = true; - internal const string FailoverPartner = ""; - internal const string InitialCatalog = ""; - internal const bool IntegratedSecurity = false; - internal const int LoadBalanceTimeout = 0; // default of 0 means don't use - internal const bool MultipleActiveResultSets = false; - internal const bool MultiSubnetFailover = false; - internal const int MaxPoolSize = 100; - internal const int MinPoolSize = 0; - internal const string NetworkLibrary = ""; - internal const int PacketSize = 8000; - internal const string Password = ""; - internal const bool PersistSecurityInfo = false; - internal const bool Pooling = true; - internal const bool TrustServerCertificate = false; - internal const string TypeSystemVersion = "Latest"; - internal const string UserID = ""; - internal const bool UserInstance = false; - internal const bool Replication = false; - internal const string WorkstationID = ""; - internal const string TransactionBinding = "Implicit Unbind"; - internal const int ConnectRetryCount = 1; - internal const int ConnectRetryInterval = 10; + internal const ApplicationIntent ApplicationIntent = System.Data.SqlClient.ApplicationIntent.ReadWrite; + internal const string ApplicationName = ".Net SqlClient Data Provider"; + internal const bool AsynchronousProcessing = false; + internal const string AttachDBFilename = ""; + internal const int ConnectTimeout = 15; + internal const bool ConnectionReset = true; + internal const bool ContextConnection = false; + internal const string CurrentLanguage = ""; + internal const string DataSource = ""; + internal const bool Encrypt = false; + internal const bool Enlist = true; + internal const string FailoverPartner = ""; + internal const string InitialCatalog = ""; + internal const bool IntegratedSecurity = false; + internal const int LoadBalanceTimeout = 0; // default of 0 means don't use + internal const bool MultipleActiveResultSets = false; + internal const bool MultiSubnetFailover = false; + internal const bool TransparentNetworkIPResolution = true; + internal const int MaxPoolSize = 100; + internal const int MinPoolSize = 0; + internal const string NetworkLibrary = ""; + internal const int PacketSize = 8000; + internal const string Password = ""; + internal const bool PersistSecurityInfo = false; + internal const bool Pooling = true; + internal const bool TrustServerCertificate = false; + internal const string TypeSystemVersion = "Latest"; + internal const string UserID = ""; + internal const bool UserInstance = false; + internal const bool Replication = false; + internal const string WorkstationID = ""; + internal const string TransactionBinding = "Implicit Unbind"; + internal const int ConnectRetryCount = 1; + internal const int ConnectRetryInterval = 10; + internal static readonly SqlAuthenticationMethod Authentication = SqlAuthenticationMethod.NotSpecified; + internal static readonly SqlConnectionColumnEncryptionSetting ColumnEncryptionSetting = SqlConnectionColumnEncryptionSetting.Disabled; } internal static class DbConnectionOptionKeywords { @@ -503,30 +792,34 @@ namespace System.Data.Common { internal const string OmitOracleConnectionName = "Omit Oracle Connection Name"; // SqlClient - internal const string ApplicationIntent = "ApplicationIntent"; - internal const string ApplicationName = "Application Name"; - internal const string AsynchronousProcessing = "Asynchronous Processing"; - internal const string AttachDBFilename = "AttachDbFilename"; - internal const string ConnectTimeout = "Connect Timeout"; - internal const string ConnectionReset = "Connection Reset"; - internal const string ContextConnection = "Context Connection"; - internal const string CurrentLanguage = "Current Language"; - internal const string Encrypt = "Encrypt"; - internal const string FailoverPartner = "Failover Partner"; - internal const string InitialCatalog = "Initial Catalog"; - internal const string MultipleActiveResultSets = "MultipleActiveResultSets"; - internal const string MultiSubnetFailover = "MultiSubnetFailover"; - internal const string NetworkLibrary = "Network Library"; - internal const string PacketSize = "Packet Size"; - internal const string Replication = "Replication"; - internal const string TransactionBinding = "Transaction Binding"; - internal const string TrustServerCertificate = "TrustServerCertificate"; - internal const string TypeSystemVersion = "Type System Version"; - internal const string UserInstance = "User Instance"; - internal const string WorkstationID = "Workstation ID"; - internal const string ConnectRetryCount = "ConnectRetryCount"; - internal const string ConnectRetryInterval = "ConnectRetryInterval"; - + internal const string ApplicationIntent = "ApplicationIntent"; + internal const string ApplicationName = "Application Name"; + internal const string AsynchronousProcessing = "Asynchronous Processing"; + internal const string AttachDBFilename = "AttachDbFilename"; + internal const string ConnectTimeout = "Connect Timeout"; + internal const string ConnectionReset = "Connection Reset"; + internal const string ContextConnection = "Context Connection"; + internal const string CurrentLanguage = "Current Language"; + internal const string Encrypt = "Encrypt"; + internal const string FailoverPartner = "Failover Partner"; + internal const string InitialCatalog = "Initial Catalog"; + internal const string MultipleActiveResultSets = "MultipleActiveResultSets"; + internal const string MultiSubnetFailover = "MultiSubnetFailover"; + internal const string TransparentNetworkIPResolution = "TransparentNetworkIPResolution"; + internal const string NetworkLibrary = "Network Library"; + internal const string PacketSize = "Packet Size"; + internal const string Replication = "Replication"; + internal const string TransactionBinding = "Transaction Binding"; + internal const string TrustServerCertificate = "TrustServerCertificate"; + internal const string TypeSystemVersion = "Type System Version"; + internal const string UserInstance = "User Instance"; + internal const string WorkstationID = "Workstation ID"; + internal const string ConnectRetryCount = "ConnectRetryCount"; + internal const string ConnectRetryInterval = "ConnectRetryInterval"; + internal const string Authentication = "Authentication"; + internal const string Certificate = "Certificate"; + internal const string ColumnEncryptionSetting = "Column Encryption Setting"; + // common keywords (OleDb, OracleClient, SqlClient) internal const string DataSource = "Data Source"; internal const string IntegratedSecurity = "Integrated Security"; diff --git a/external/referencesource/System.Data/System/Data/Common/Groupbybehavior.cs b/external/referencesource/System.Data/System/Data/Common/Groupbybehavior.cs index 2b324cfb9c..73e9a8145f 100644 --- a/external/referencesource/System.Data/System/Data/Common/Groupbybehavior.cs +++ b/external/referencesource/System.Data/System/Data/Common/Groupbybehavior.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// rickfe +// stevesta //------------------------------------------------------------------------------ namespace System.Data.Common { diff --git a/external/referencesource/System.Data/System/Data/Common/NativeMethods.cs b/external/referencesource/System.Data/System/Data/Common/NativeMethods.cs index ebcf3fc72e..b1321a4222 100644 --- a/external/referencesource/System.Data/System/Data/Common/NativeMethods.cs +++ b/external/referencesource/System.Data/System/Data/Common/NativeMethods.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// markash +// blained +// mithomas //------------------------------------------------------------------------------ using System; diff --git a/external/referencesource/System.Data/System/Data/Common/SqlEventSource.cs b/external/referencesource/System.Data/System/Data/Common/SqlEventSource.cs new file mode 100644 index 0000000000..b67fa15fed --- /dev/null +++ b/external/referencesource/System.Data/System/Data/Common/SqlEventSource.cs @@ -0,0 +1,76 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// mihailsm +//------------------------------------------------------------------------------ + +namespace System.Data +{ + using System; + using System.Diagnostics.Tracing; + + [EventSource(Name = SqlEventSource.EventSourceName)] + internal sealed class SqlEventSource : EventSource + { + internal const string EventSourceName = "Microsoft-AdoNet-SystemData"; + + /// + /// Defines EventId for BeginExecute (Reader, Scalar, NonQuery, XmlReader). + /// + private const int BeginExecuteEventId = 1; + + /// + /// Defines EventId for EndExecute (Reader, Scalar, NonQuery, XmlReader). + /// + private const int EndExecuteEventId = 2; + + // Defines the singleton instance for the Resources ETW provider + internal static readonly SqlEventSource Log = new SqlEventSource(); + + + /// + /// Keyword definitions. These represent logical groups of events that can be turned on and off independently + /// Often each task has a keyword, but where tasks are determined by subsystem, keywords are determined by + /// usefulness to end users to filter. Generally users don't mind extra events if they are not high volume + /// so grouping low volume events together in a single keywords is OK (users can post-filter by task if desired) + /// The visibility of the enum has to be public, otherwise there will be an ArgumentException on calling related WriteEvent method. + /// + public static class Keywords + { + public const EventKeywords SqlClient = (EventKeywords)0x0001; // This is bit 0 + } + + public static class Tasks // this name is important for EventSource + { + /// Task that tracks sql command execute. + public const EventTask ExecuteCommand = (EventTask)1; + } + + private SqlEventSource() + { + } + + // unfortunately these are not marked as Start/Stop opcodes. The reason is that we dont want them to participate in + // the EventSource activity IDs (because they currently don't use tasks and this simply confuses the logic) and + // because of versioning requirements we don't have ActivityOptions capability (because mscorlib and System.Data version + // at different rates) Sigh... + [Event(SqlEventSource.BeginExecuteEventId, Keywords = Keywords.SqlClient)] + public void BeginExecute(int objectId, string dataSource, string database, string commandText) + { + // we do not use unsafe code for better performance optization here because optimized helpers make the code unsafe where that would not be the case otherwise. + // This introduces the question of partial trust, which is complex in the SQL case (there are a lot of scenarios and SQL has special security support). + WriteEvent(SqlEventSource.BeginExecuteEventId, objectId, dataSource, database, commandText); + } + + // unfortunately these are not marked as Start/Stop opcodes. The reason is that we dont want them to participate in + // the EventSource activity IDs (because they currently don't use tasks and this simply confuses the logic) and + // because of versioning requirements we don't have ActivityOptions capability (because mscorlib and System.Data version + // at different rates) Sigh... + [Event(SqlEventSource.EndExecuteEventId, Keywords = Keywords.SqlClient)] + public void EndExecute(int objectId, int compositeState, int sqlExceptionNumber) + { + WriteEvent(SqlEventSource.EndExecuteEventId, objectId, compositeState, sqlExceptionNumber); + } + } +} diff --git a/external/referencesource/System.Data/System/Data/Common/SupportedJoinOperators.cs b/external/referencesource/System.Data/System/Data/Common/SupportedJoinOperators.cs index abb658da1a..b6db9fdce1 100644 --- a/external/referencesource/System.Data/System/Data/Common/SupportedJoinOperators.cs +++ b/external/referencesource/System.Data/System/Data/Common/SupportedJoinOperators.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// rickfe +// stevesta //------------------------------------------------------------------------------ namespace System.Data.Common { diff --git a/external/referencesource/System.Data/System/Data/Common/dbenumerator.cs b/external/referencesource/System.Data/System/Data/Common/dbenumerator.cs index 22f6884b61..758d606295 100644 --- a/external/referencesource/System.Data/System/Data/Common/dbenumerator.cs +++ b/external/referencesource/System.Data/System/Data/Common/dbenumerator.cs @@ -18,7 +18,7 @@ namespace System.Data.Common { public class DbEnumerator : IEnumerator { internal IDataReader _reader; - internal IDataRecord _current; + internal DbDataRecord _current; internal SchemaInfo[] _schemaInfo; // shared schema info among all the data records internal PropertyDescriptorCollection _descriptors; // cached property descriptors private FieldNameLookup _fieldNameLookup; // MDAC 69015 @@ -39,30 +39,21 @@ namespace System.Data.Common { _reader = reader; this.closeReader = closeReader; } + + public DbEnumerator(DbDataReader reader) + : this((IDataReader)reader) { + } + public DbEnumerator(DbDataReader reader, bool closeReader) + : this((IDataReader)reader, closeReader) { + } public object Current { get { return _current; } } - - /*public IDataRecord Current { - get { - return _current; - } - }*/ - -/* - virtual internal IDataRecord NewRecord(SchemaInfo[] si, object[] values, PropertyDescriptorCollection descriptors) { - return new DbDataRecord(si, values, descriptors); - } - - virtual internal void GetValues(object[] values) { - _reader.GetValues(values); - } -*/ - + public bool MoveNext() { if (null == _schemaInfo) { diff --git a/external/referencesource/System.Data/System/Data/Common/identifiercase.cs b/external/referencesource/System.Data/System/Data/Common/identifiercase.cs index bd314fff49..73c8fc1e47 100644 --- a/external/referencesource/System.Data/System/Data/Common/identifiercase.cs +++ b/external/referencesource/System.Data/System/Data/Common/identifiercase.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// rickfe +// stevesta //------------------------------------------------------------------------------ namespace System.Data.Common { diff --git a/external/referencesource/System.Data/System/Data/ConflictOptions.cs b/external/referencesource/System.Data/System/Data/ConflictOptions.cs index 271c3835b2..bba1d2cab1 100644 --- a/external/referencesource/System.Data/System/Data/ConflictOptions.cs +++ b/external/referencesource/System.Data/System/Data/ConflictOptions.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/ConnectionState.cs b/external/referencesource/System.Data/System/Data/ConnectionState.cs index e09d35f974..735a6edfea 100644 --- a/external/referencesource/System.Data/System/Data/ConnectionState.cs +++ b/external/referencesource/System.Data/System/Data/ConnectionState.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/DataColumnChangeEventHandler.cs b/external/referencesource/System.Data/System/Data/DataColumnChangeEventHandler.cs index b3f2ebe5bb..49eac5f6a9 100644 --- a/external/referencesource/System.Data/System/Data/DataColumnChangeEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/DataColumnChangeEventHandler.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/DataRowAction.cs b/external/referencesource/System.Data/System/Data/DataRowAction.cs index 5988cdf354..516ce4fcb1 100644 --- a/external/referencesource/System.Data/System/Data/DataRowAction.cs +++ b/external/referencesource/System.Data/System/Data/DataRowAction.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/DataRowChangeEventHandler.cs b/external/referencesource/System.Data/System/Data/DataRowChangeEventHandler.cs index d08f479418..2d416b1eb1 100644 --- a/external/referencesource/System.Data/System/Data/DataRowChangeEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/DataRowChangeEventHandler.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/DataRowCreatedEventHandler.cs b/external/referencesource/System.Data/System/Data/DataRowCreatedEventHandler.cs index 9e478d7b8c..41f14d0bec 100644 --- a/external/referencesource/System.Data/System/Data/DataRowCreatedEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/DataRowCreatedEventHandler.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/DataRowState.cs b/external/referencesource/System.Data/System/Data/DataRowState.cs index 8f08c20ee7..f52843825a 100644 --- a/external/referencesource/System.Data/System/Data/DataRowState.cs +++ b/external/referencesource/System.Data/System/Data/DataRowState.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/DataRowVersion.cs b/external/referencesource/System.Data/System/Data/DataRowVersion.cs index cba19a4328..39f742372b 100644 --- a/external/referencesource/System.Data/System/Data/DataRowVersion.cs +++ b/external/referencesource/System.Data/System/Data/DataRowVersion.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/DataSerializationFormat.cs b/external/referencesource/System.Data/System/Data/DataSerializationFormat.cs index 1f5331f748..28ae6fa52f 100644 --- a/external/referencesource/System.Data/System/Data/DataSerializationFormat.cs +++ b/external/referencesource/System.Data/System/Data/DataSerializationFormat.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// amirhmy +// markash //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/DataSetDateTime.cs b/external/referencesource/System.Data/System/Data/DataSetDateTime.cs index a33ea9821e..ad4b0c2043 100644 --- a/external/referencesource/System.Data/System/Data/DataSetDateTime.cs +++ b/external/referencesource/System.Data/System/Data/DataSetDateTime.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// amirhmy +// markash //------------------------------------------------------------------------------ namespace System.Data { using System; diff --git a/external/referencesource/System.Data/System/Data/DataTableClearEventHandler.cs b/external/referencesource/System.Data/System/Data/DataTableClearEventHandler.cs index b8d81dfc1a..73a5cc6b6c 100644 --- a/external/referencesource/System.Data/System/Data/DataTableClearEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/DataTableClearEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// amirhmy +// markash //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/DataTableNewRowEventHandler.cs b/external/referencesource/System.Data/System/Data/DataTableNewRowEventHandler.cs index 7b4c1aa2c3..0b9a396b5f 100644 --- a/external/referencesource/System.Data/System/Data/DataTableNewRowEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/DataTableNewRowEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// amirhmy +// markash //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/DataViewRowState.cs b/external/referencesource/System.Data/System/Data/DataViewRowState.cs index b8734a14e9..41415d3c99 100644 --- a/external/referencesource/System.Data/System/Data/DataViewRowState.cs +++ b/external/referencesource/System.Data/System/Data/DataViewRowState.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/FillErrorEventHandler.cs b/external/referencesource/System.Data/System/Data/FillErrorEventHandler.cs index 2765697f5b..5a7e23d714 100644 --- a/external/referencesource/System.Data/System/Data/FillErrorEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/FillErrorEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { // MDAC 59437 diff --git a/external/referencesource/System.Data/System/Data/Filter/IFilter.cs b/external/referencesource/System.Data/System/Data/Filter/IFilter.cs index c950470650..11c52d2dd9 100644 --- a/external/referencesource/System.Data/System/Data/Filter/IFilter.cs +++ b/external/referencesource/System.Data/System/Data/Filter/IFilter.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IColumnMapping.cs b/external/referencesource/System.Data/System/Data/IColumnMapping.cs index a9e2ca996b..af0a6acbe9 100644 --- a/external/referencesource/System.Data/System/Data/IColumnMapping.cs +++ b/external/referencesource/System.Data/System/Data/IColumnMapping.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IColumnMappingCollection.cs b/external/referencesource/System.Data/System/Data/IColumnMappingCollection.cs index faf7b5b9b4..cb15d8b22e 100644 --- a/external/referencesource/System.Data/System/Data/IColumnMappingCollection.cs +++ b/external/referencesource/System.Data/System/Data/IColumnMappingCollection.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IDataAdapter.cs b/external/referencesource/System.Data/System/Data/IDataAdapter.cs index 68066295a5..6007f39e01 100644 --- a/external/referencesource/System.Data/System/Data/IDataAdapter.cs +++ b/external/referencesource/System.Data/System/Data/IDataAdapter.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IDataParameter.cs b/external/referencesource/System.Data/System/Data/IDataParameter.cs index 1e5e04d8b6..66d21c4e50 100644 --- a/external/referencesource/System.Data/System/Data/IDataParameter.cs +++ b/external/referencesource/System.Data/System/Data/IDataParameter.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IDataParameterCollection.cs b/external/referencesource/System.Data/System/Data/IDataParameterCollection.cs index ecb3bf5b74..4afcbb0094 100644 --- a/external/referencesource/System.Data/System/Data/IDataParameterCollection.cs +++ b/external/referencesource/System.Data/System/Data/IDataParameterCollection.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IDataReader.cs b/external/referencesource/System.Data/System/Data/IDataReader.cs index c34df297f5..bd6f054724 100644 --- a/external/referencesource/System.Data/System/Data/IDataReader.cs +++ b/external/referencesource/System.Data/System/Data/IDataReader.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IDataRecord.cs b/external/referencesource/System.Data/System/Data/IDataRecord.cs index abdbe9797c..b3ba7d4a48 100644 --- a/external/referencesource/System.Data/System/Data/IDataRecord.cs +++ b/external/referencesource/System.Data/System/Data/IDataRecord.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IDbCommand.cs b/external/referencesource/System.Data/System/Data/IDbCommand.cs index 2a9ed41deb..43c2dc38fd 100644 --- a/external/referencesource/System.Data/System/Data/IDbCommand.cs +++ b/external/referencesource/System.Data/System/Data/IDbCommand.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data{ diff --git a/external/referencesource/System.Data/System/Data/IDbConnection.cs b/external/referencesource/System.Data/System/Data/IDbConnection.cs index bf630c7426..ad6da26e66 100644 --- a/external/referencesource/System.Data/System/Data/IDbConnection.cs +++ b/external/referencesource/System.Data/System/Data/IDbConnection.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IDbDataAdapter.cs b/external/referencesource/System.Data/System/Data/IDbDataAdapter.cs index b78fdd4dfb..642232121a 100644 --- a/external/referencesource/System.Data/System/Data/IDbDataAdapter.cs +++ b/external/referencesource/System.Data/System/Data/IDbDataAdapter.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IDbDataParameter.cs b/external/referencesource/System.Data/System/Data/IDbDataParameter.cs index d69db17ffa..09eeae7ca7 100644 --- a/external/referencesource/System.Data/System/Data/IDbDataParameter.cs +++ b/external/referencesource/System.Data/System/Data/IDbDataParameter.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IDbTransaction.cs b/external/referencesource/System.Data/System/Data/IDbTransaction.cs index e31633da85..d67b6f7e3f 100644 --- a/external/referencesource/System.Data/System/Data/IDbTransaction.cs +++ b/external/referencesource/System.Data/System/Data/IDbTransaction.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data{ diff --git a/external/referencesource/System.Data/System/Data/ITableMapping.cs b/external/referencesource/System.Data/System/Data/ITableMapping.cs index b8c42cf3d5..b6063015e6 100644 --- a/external/referencesource/System.Data/System/Data/ITableMapping.cs +++ b/external/referencesource/System.Data/System/Data/ITableMapping.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/ITableMappingCollection.cs b/external/referencesource/System.Data/System/Data/ITableMappingCollection.cs index 9455464ec5..42304689ec 100644 --- a/external/referencesource/System.Data/System/Data/ITableMappingCollection.cs +++ b/external/referencesource/System.Data/System/Data/ITableMappingCollection.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/IsolationLevel.cs b/external/referencesource/System.Data/System/Data/IsolationLevel.cs index bea89d5c56..51f9a59e11 100644 --- a/external/referencesource/System.Data/System/Data/IsolationLevel.cs +++ b/external/referencesource/System.Data/System/Data/IsolationLevel.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/LoadOption.cs b/external/referencesource/System.Data/System/Data/LoadOption.cs index 2b1b20ad02..870b26ebbf 100644 --- a/external/referencesource/System.Data/System/Data/LoadOption.cs +++ b/external/referencesource/System.Data/System/Data/LoadOption.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/MappingType.cs b/external/referencesource/System.Data/System/Data/MappingType.cs index 489da4b273..7a17a5cab9 100644 --- a/external/referencesource/System.Data/System/Data/MappingType.cs +++ b/external/referencesource/System.Data/System/Data/MappingType.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/MergeFailedEventHandler.cs b/external/referencesource/System.Data/System/Data/MergeFailedEventHandler.cs index 8c4407a4a6..3e080d7339 100644 --- a/external/referencesource/System.Data/System/Data/MergeFailedEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/MergeFailedEventHandler.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/MissingMappingAction.cs b/external/referencesource/System.Data/System/Data/MissingMappingAction.cs index b0c1a5c365..e31ab649d2 100644 --- a/external/referencesource/System.Data/System/Data/MissingMappingAction.cs +++ b/external/referencesource/System.Data/System/Data/MissingMappingAction.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/MissingSchemaAction.cs b/external/referencesource/System.Data/System/Data/MissingSchemaAction.cs index 2576568b17..99deb05a24 100644 --- a/external/referencesource/System.Data/System/Data/MissingSchemaAction.cs +++ b/external/referencesource/System.Data/System/Data/MissingSchemaAction.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/Odbc/OdbcType.cs b/external/referencesource/System.Data/System/Data/Odbc/OdbcType.cs index 0a4e2b2368..a50795025c 100644 --- a/external/referencesource/System.Data/System/Data/Odbc/OdbcType.cs +++ b/external/referencesource/System.Data/System/Data/Odbc/OdbcType.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// mithomas +// markash //------------------------------------------------------------------------------ using System; diff --git a/external/referencesource/System.Data/System/Data/OleDb/OleDbHResult.cs b/external/referencesource/System.Data/System/Data/OleDb/OleDbHResult.cs index 96f9a0de63..5b4afb959d 100644 --- a/external/referencesource/System.Data/System/Data/OleDb/OleDbHResult.cs +++ b/external/referencesource/System.Data/System/Data/OleDb/OleDbHResult.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data.OleDb { @@ -452,7 +452,7 @@ namespace System.Data.OleDb { // Method is not supported by this provider. DB_E_NOTSUPPORTED = unchecked((int)0x80040E53), - // MessageId: DB_E_MAXPENDCHANGE----CEEDED + // MessageId: DB_E_MAXPENDCHANGESEXCEEDED // MessageText: // Number of rows with pending changes exceeded the limit. DB_E_MAXPENDCHANGESEXCEEDED = unchecked((int)0x80040E54), diff --git a/external/referencesource/System.Data/System/Data/OleDb/OleDbInfoMessageEventHandler.cs b/external/referencesource/System.Data/System/Data/OleDb/OleDbInfoMessageEventHandler.cs index cb5db36a0d..d43968b4c0 100644 --- a/external/referencesource/System.Data/System/Data/OleDb/OleDbInfoMessageEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/OleDb/OleDbInfoMessageEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data.OleDb { diff --git a/external/referencesource/System.Data/System/Data/OleDb/OleDbLiteral.cs b/external/referencesource/System.Data/System/Data/OleDb/OleDbLiteral.cs index 8e38ea7171..1030300cca 100644 --- a/external/referencesource/System.Data/System/Data/OleDb/OleDbLiteral.cs +++ b/external/referencesource/System.Data/System/Data/OleDb/OleDbLiteral.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data.OleDb { diff --git a/external/referencesource/System.Data/System/Data/OleDb/OleDbPropertyStatus.cs b/external/referencesource/System.Data/System/Data/OleDb/OleDbPropertyStatus.cs index fd808fa516..e81df76a2e 100644 --- a/external/referencesource/System.Data/System/Data/OleDb/OleDbPropertyStatus.cs +++ b/external/referencesource/System.Data/System/Data/OleDb/OleDbPropertyStatus.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data.OleDb { diff --git a/external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatedEventHandler.cs b/external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatedEventHandler.cs index 1c4f66c82a..d5986eaacc 100644 --- a/external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatedEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatedEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data.OleDb { diff --git a/external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatingEventHandler.cs b/external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatingEventHandler.cs index bf166df653..5e93e9ab00 100644 --- a/external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatingEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/OleDb/OleDbRowUpdatingEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data.OleDb { diff --git a/external/referencesource/System.Data/System/Data/OleDb/OleDbType.cs b/external/referencesource/System.Data/System/Data/OleDb/OleDbType.cs index a63f5618bf..3af7009345 100644 --- a/external/referencesource/System.Data/System/Data/OleDb/OleDbType.cs +++ b/external/referencesource/System.Data/System/Data/OleDb/OleDbType.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data.OleDb { diff --git a/external/referencesource/System.Data/System/Data/OleDb/PropertyAttributes.cs b/external/referencesource/System.Data/System/Data/OleDb/PropertyAttributes.cs index c2f5cf7702..5eccdd6185 100644 --- a/external/referencesource/System.Data/System/Data/OleDb/PropertyAttributes.cs +++ b/external/referencesource/System.Data/System/Data/OleDb/PropertyAttributes.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/ParameterDirection.cs b/external/referencesource/System.Data/System/Data/ParameterDirection.cs index 9928c84556..447fc59a01 100644 --- a/external/referencesource/System.Data/System/Data/ParameterDirection.cs +++ b/external/referencesource/System.Data/System/Data/ParameterDirection.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs b/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs index a12b68eab3..5b5743725f 100644 --- a/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs +++ b/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPool.cs @@ -428,6 +428,11 @@ namespace System.Data.ProviderBase { private readonly DbConnectionPoolGroupOptions _connectionPoolGroupOptions; private DbConnectionPoolProviderInfo _connectionPoolProviderInfo; + /// + /// The private member which carries the set of authenticationcontexts for this pool (based on the user's identity). + /// + private readonly ConcurrentDictionary _pooledDbAuthenticationContexts; + private State _state; private readonly ConcurrentStack _stackOld = new ConcurrentStack(); @@ -489,6 +494,9 @@ namespace System.Data.ProviderBase { _objectList = new List(MaxPoolSize); + _pooledDbAuthenticationContexts = new ConcurrentDictionary(concurrencyLevel: 4 * Environment.ProcessorCount /* default value in ConcurrentDictionary*/, + capacity: 2); + if(ADP.IsPlatformNT5) { _transactedConnectionPool = new TransactedConnectionPool(this); } @@ -585,6 +593,17 @@ namespace System.Data.ProviderBase { get { return _connectionPoolProviderInfo; } } + /// + /// Return the pooled authentication contexts. + /// + internal ConcurrentDictionary AuthenticationContexts + { + get + { + return _pooledDbAuthenticationContexts; + } + } + internal bool UseLoadBalancing { get { return PoolGroupOptions.UseLoadBalancing; } } diff --git a/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContext.cs b/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContext.cs new file mode 100644 index 0000000000..8c45467147 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContext.cs @@ -0,0 +1,108 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// harsudan +// yuronhe +//------------------------------------------------------------------------------ + +using System; +using System.Diagnostics; +using System.Runtime.ConstrainedExecution; +using System.Threading; + +namespace System.Data.ProviderBase +{ + /// + /// Represents the context of an authentication attempt when using the new active directory based authentication mechanisms. + /// All data members, except_isUpdateInProgressCounter, should be immutable. + /// + sealed internal class DbConnectionPoolAuthenticationContext + { + /// + /// The value expected in _isUpdateInProgress if a thread has taken a lock on this context, + /// to perform the update on the context. + /// + private const int STATUS_LOCKED = 1; + + /// + /// The value expected in _isUpdateInProgress if no thread has taken a lock on this context. + /// + private const int STATUS_UNLOCKED = 0; + + /// + /// Access Token, which is obtained from Active Directory Authentication Library for SQL Server, and needs to be sent to SQL Server + /// as part of TDS Token type Federated Authentication Token. + /// + private readonly byte[] _accessToken; + + /// + /// Expiration time of the above access token. + /// + private readonly DateTime _expirationTime; + + /// + /// A member which is used to achieve a lock to control refresh attempt on this context. + /// + private int _isUpdateInProgress; + + /// + /// Constructor. + /// + /// Access Token that will be used to connect to SQL Server. Carries identity information about a user. + /// The expiration time in UTC for the above accessToken. + internal DbConnectionPoolAuthenticationContext(byte[] accessToken, DateTime expirationTime) { + + Debug.Assert(accessToken != null && accessToken.Length > 0); + Debug.Assert(expirationTime > DateTime.MinValue && expirationTime < DateTime.MaxValue); + + _accessToken = accessToken; + _expirationTime = expirationTime; + _isUpdateInProgress = STATUS_UNLOCKED; + } + + /// + /// Static Method. + /// Given two contexts, choose one to update in the cache. Chooses based on expiration time. + /// + /// Context1 + /// Context2 + internal static DbConnectionPoolAuthenticationContext ChooseAuthenticationContextToUpdate(DbConnectionPoolAuthenticationContext context1, DbConnectionPoolAuthenticationContext context2) { + + Debug.Assert(context1 != null, "context1 should not be null."); + Debug.Assert(context2 != null, "context2 should not be null."); + + return context1.ExpirationTime > context2.ExpirationTime ? context1 : context2; + } + + internal byte[] AccessToken { + get { + return _accessToken; + } + } + + internal DateTime ExpirationTime { + get { + return _expirationTime; + } + } + + /// + /// Try locking the variable _isUpdateInProgressCounter and return if this thread got the lock to update. + /// Whichever thread got the chance to update this variable to 1 wins the lock. + /// + internal bool LockToUpdate() { + int oldValue = Interlocked.CompareExchange(ref _isUpdateInProgress, STATUS_LOCKED, STATUS_UNLOCKED); + return (oldValue == STATUS_UNLOCKED); + } + + /// + /// Release the lock which was obtained through LockToUpdate. + /// + [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] + internal void ReleaseLockToUpdate() { + int oldValue = Interlocked.CompareExchange(ref _isUpdateInProgress, STATUS_UNLOCKED, STATUS_LOCKED); + Debug.Assert(oldValue == STATUS_LOCKED); + } + } +} diff --git a/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContextKey.cs b/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContextKey.cs new file mode 100644 index 0000000000..df54873105 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolAuthenticationContextKey.cs @@ -0,0 +1,106 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// harsudan +// yuronhe +//------------------------------------------------------------------------------ + +using System; +using System.Diagnostics; + +namespace System.Data.ProviderBase +{ + /// + /// Represents the key of dbConnectionPoolAuthenticationContext. + /// All data members should be immutable and so, hashCode is pre-computed. + /// + sealed internal class DbConnectionPoolAuthenticationContextKey + { + /// + /// Security Token Service Authority. + /// + private readonly string _stsAuthority; + + /// + /// Service Principal Name. + /// + private readonly string _servicePrincipalName; + + /// + /// Pre-Computed Hash Code. + /// + private readonly int _hashCode; + + internal string StsAuthority { + get { + return _stsAuthority; + } + } + + internal string ServicePrincipalName { + get { + return _servicePrincipalName; + } + } + + /// + /// Constructor for the type. + /// + /// Token Endpoint URL + /// SPN representing the SQL service in an active directory. + internal DbConnectionPoolAuthenticationContextKey(string stsAuthority, string servicePrincipalName) { + Debug.Assert(!string.IsNullOrWhiteSpace(stsAuthority)); + Debug.Assert(!string.IsNullOrWhiteSpace(servicePrincipalName)); + + _stsAuthority = stsAuthority; + _servicePrincipalName = servicePrincipalName; + + // Pre-compute hash since data members are not going to change. + _hashCode = ComputeHashCode(); + } + + /// + /// Override the default Equals implementation. + /// + /// + /// + public override bool Equals(object obj) { + if (obj == null) { + return false; + } + + DbConnectionPoolAuthenticationContextKey otherKey = obj as DbConnectionPoolAuthenticationContextKey; + if (otherKey == null) { + return false; + } + + return (String.Equals(StsAuthority, otherKey.StsAuthority, StringComparison.InvariantCultureIgnoreCase) + && String.Equals(ServicePrincipalName, otherKey.ServicePrincipalName, StringComparison.InvariantCultureIgnoreCase)); + } + + /// + /// Override the default GetHashCode implementation. + /// + /// + public override int GetHashCode() { + return _hashCode; + } + + /// + /// Compute the hash code for this object. + /// + /// + private int ComputeHashCode() { + int hashCode = 33; + + unchecked + { + hashCode = (hashCode * 17) + StsAuthority.GetHashCode(); + hashCode = (hashCode * 17) + ServicePrincipalName.GetHashCode(); + } + + return hashCode; + } + } +} diff --git a/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs b/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs index 4442daefb1..401f442e76 100644 --- a/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs +++ b/external/referencesource/System.Data/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs @@ -2,7 +2,7 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] +// stevesta //------------------------------------------------------------------------------ namespace System.Data.ProviderBase { diff --git a/external/referencesource/System.Data/System/Data/RecordsAffectedEventHandler.cs b/external/referencesource/System.Data/System/Data/RecordsAffectedEventHandler.cs index 9b85c51f5e..1c4dbd88ac 100644 --- a/external/referencesource/System.Data/System/Data/RecordsAffectedEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/RecordsAffectedEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/Rule.cs b/external/referencesource/System.Data/System/Data/Rule.cs index 80354735c9..c864ccbd4f 100644 --- a/external/referencesource/System.Data/System/Data/Rule.cs +++ b/external/referencesource/System.Data/System/Data/Rule.cs @@ -3,9 +3,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/SQLTypes/INullable.cs b/external/referencesource/System.Data/System/Data/SQLTypes/INullable.cs index 2dd6ed4103..52e1d1f8e5 100644 --- a/external/referencesource/System.Data/System/Data/SQLTypes/INullable.cs +++ b/external/referencesource/System.Data/System/Data/SQLTypes/INullable.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// blained +// laled //------------------------------------------------------------------------------ namespace System.Data.SqlTypes { diff --git a/external/referencesource/System.Data/System/Data/SchemaSerializationMode.cs b/external/referencesource/System.Data/System/Data/SchemaSerializationMode.cs index 75fe72fec3..21721b7882 100644 --- a/external/referencesource/System.Data/System/Data/SchemaSerializationMode.cs +++ b/external/referencesource/System.Data/System/Data/SchemaSerializationMode.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// amirhmy +// markash //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/SchemaType.cs b/external/referencesource/System.Data/System/Data/SchemaType.cs index 9626eb8910..c8885df644 100644 --- a/external/referencesource/System.Data/System/Data/SchemaType.cs +++ b/external/referencesource/System.Data/System/Data/SchemaType.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/Sql/IBinarySerialize.cs b/external/referencesource/System.Data/System/Data/Sql/IBinarySerialize.cs index 5947203b4c..61884484a8 100644 --- a/external/referencesource/System.Data/System/Data/Sql/IBinarySerialize.cs +++ b/external/referencesource/System.Data/System/Data/Sql/IBinarySerialize.cs @@ -3,12 +3,12 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. // Information Contained Herein is Proprietary and Confidential. // -// [....] -// [....] +// alazela +// blained // daltudov -// [....] +// stevesta // beysims -// [....] +// laled // vadimt //------------------------------------------------------------------------------ diff --git a/external/referencesource/System.Data/System/Data/Sql/TriggerAction.cs b/external/referencesource/System.Data/System/Data/Sql/TriggerAction.cs index 0c72b6ea79..7b0ff803b4 100644 --- a/external/referencesource/System.Data/System/Data/Sql/TriggerAction.cs +++ b/external/referencesource/System.Data/System/Data/Sql/TriggerAction.cs @@ -2,12 +2,12 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// alazela +// blained // daltudov -// [....] +// stevesta // beysims -// [....] +// laled // vadimt //------------------------------------------------------------------------------ @@ -111,7 +111,7 @@ namespace Microsoft.SqlServer.Server { // 1000 - 1999 is reserved for SQLTrace. x_eet_Trace_Start = 1000, x_eet_Trace_End = 1999, - // WHEN ADDING, PLEASE + // WHEN ADDING, PLEASE CHECK WITH FILE-OWNER FOR WHICH NUMBERS TO USE. THANKS! }; public enum TriggerAction { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/OnChangedEventHandler.cs b/external/referencesource/System.Data/System/Data/SqlClient/OnChangedEventHandler.cs index f79cecdf90..ffd6bf3395 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/OnChangedEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/OnChangedEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// ramp +// blained //------------------------------------------------------------------------------ namespace System.Data.SqlClient { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/ParameterPeekAheadValue.cs b/external/referencesource/System.Data/System/Data/SqlClient/ParameterPeekAheadValue.cs index 79b4b96778..ea460cf908 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/ParameterPeekAheadValue.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/ParameterPeekAheadValue.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// alazela +// billin //------------------------------------------------------------------------------ diff --git a/external/referencesource/System.Data/System/Data/SqlClient/RowsCopiedEventHandler.cs b/external/referencesource/System.Data/System/Data/SqlClient/RowsCopiedEventHandler.cs index c239d77e61..b6d5adc503 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/RowsCopiedEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/RowsCopiedEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// mithomas +// blained //------------------------------------------------------------------------------ namespace System.Data.SqlClient { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SortOrder.cs b/external/referencesource/System.Data/System/Data/SqlClient/SortOrder.cs index 2eeef11744..6c19e1cac5 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SortOrder.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SortOrder.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// alazela +// laled +// billin //------------------------------------------------------------------------------ namespace System.Data.SqlClient { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlAeadAes256CbcHmac256Algorithm.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlAeadAes256CbcHmac256Algorithm.cs new file mode 100644 index 0000000000..6c6a016c1d --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlAeadAes256CbcHmac256Algorithm.cs @@ -0,0 +1,406 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Data.SqlClient; + using System.Diagnostics; + using System.IO; + using System.Runtime.CompilerServices; + using System.Security.Cryptography; + + /// + /// This class implements authenticated encryption algorithm with associated data as described in + /// http://tools.ietf.org/html/draft-mcgrew-aead-aes-cbc-hmac-sha2-05. More specifically this implements + /// AEAD_AES_256_CBC_HMAC_SHA256 algorithm. + /// + internal class SqlAeadAes256CbcHmac256Algorithm : SqlClientEncryptionAlgorithm + { + /// + /// Algorithm Name + /// + internal const string AlgorithmName = @"AEAD_AES_256_CBC_HMAC_SHA256"; + + /// + /// Key size in bytes + /// + private const int _KeySizeInBytes = SqlAeadAes256CbcHmac256EncryptionKey.KeySize / 8; + + /// + /// Block size in bytes. AES uses 16 byte blocks. + /// + private const int _BlockSizeInBytes = 16; + + /// + /// Minimum Length of cipherText without authentication tag. This value is 1 (version byte) + 16 (IV) + 16 (minimum of 1 block of cipher Text) + /// + private const int _MinimumCipherTextLengthInBytesNoAuthenticationTag = sizeof(byte) + _BlockSizeInBytes + _BlockSizeInBytes; + + /// + /// Minimum Length of cipherText. This value is 1 (version byte) + 32 (authentication tag) + 16 (IV) + 16 (minimum of 1 block of cipher Text) + /// + private const int _MinimumCipherTextLengthInBytesWithAuthenticationTag = _MinimumCipherTextLengthInBytesNoAuthenticationTag + _KeySizeInBytes; + + /// + /// Cipher Mode. For this algorithm, we only use CBC mode. + /// + private const CipherMode _cipherMode = CipherMode.CBC; + + /// + /// Padding mode. This algorithm uses PKCS7. + /// + private const PaddingMode _paddingMode = PaddingMode.PKCS7; + + /// + /// Variable indicating whether this algorithm should work in Deterministic mode or Randomized mode. + /// For deterministic encryption, we derive an IV from the plaintext data. + /// For randomized encryption, we generate a cryptographically random IV. + /// + private readonly bool _isDeterministic; + + /// + /// Algorithm Version. + /// + private readonly byte _algorithmVersion; + + /// + /// Column Encryption Key. This has a root key and three derived keys. + /// + private readonly SqlAeadAes256CbcHmac256EncryptionKey _columnEncryptionKey; + + /// + /// The pool of crypto providers to use for encrypt/decrypt operations. + /// + private readonly ConcurrentQueue _cryptoProviderPool; + + /// + /// Byte array with algorithm version used for authentication tag computation. + /// + private static readonly byte[] _version = new byte[] {0x01}; + + /// + /// Byte array with algorithm version size used for authentication tag computation. + /// + private static readonly byte[] _versionSize = new byte[] {sizeof(byte)}; + + /// + /// Initializes a new instance of SqlAeadAes256CbcHmac256Algorithm algorithm with a given key and encryption type + /// + /// + /// Root encryption key from which three other keys will be derived + /// + /// Encryption Type, accepted values are Deterministic and Randomized. + /// For Deterministic encryption, a synthetic IV will be genenrated during encryption + /// For Randomized encryption, a random IV will be generated during encryption. + /// + /// + /// Algorithm version + /// + internal SqlAeadAes256CbcHmac256Algorithm(SqlAeadAes256CbcHmac256EncryptionKey encryptionKey, SqlClientEncryptionType encryptionType, byte algorithmVersion) { + _columnEncryptionKey = encryptionKey; + _algorithmVersion = algorithmVersion; + _version[0] = algorithmVersion; + + Debug.Assert (null != encryptionKey, "Null encryption key detected in AeadAes256CbcHmac256 algorithm"); + Debug.Assert (0x01 == algorithmVersion, "Unknown algorithm version passed to AeadAes256CbcHmac256"); + + // Validate encryption type for this algorithm + // This algorithm can only provide randomized or deterministic encryption types. + if (encryptionType == SqlClientEncryptionType.Deterministic) { + _isDeterministic = true; + } + else { + Debug.Assert (SqlClientEncryptionType.Randomized == encryptionType, "Invalid Encryption Type detected in SqlAeadAes256CbcHmac256Algorithm, this should've been caught in factory class"); + } + + _cryptoProviderPool = new ConcurrentQueue(); + } + + /// + /// Encryption Algorithm + /// cell_iv = HMAC_SHA-2-256(iv_key, cell_data) truncated to 128 bits + /// cell_ciphertext = AES-CBC-256(enc_key, cell_iv, cell_data) with PKCS7 padding. + /// cell_tag = HMAC_SHA-2-256(mac_key, versionbyte + cell_iv + cell_ciphertext + versionbyte_length) + /// cell_blob = versionbyte + cell_tag + cell_iv + cell_ciphertext + /// + /// Plaintext data to be encrypted + /// Returns the ciphertext corresponding to the plaintext. + internal override byte[] EncryptData(byte[] plainText) { + return EncryptData(plainText, hasAuthenticationTag: true); + } + + /// + /// Encryption Algorithm + /// cell_iv = HMAC_SHA-2-256(iv_key, cell_data) truncated to 128 bits + /// cell_ciphertext = AES-CBC-256(enc_key, cell_iv, cell_data) with PKCS7 padding. + /// (optional) cell_tag = HMAC_SHA-2-256(mac_key, versionbyte + cell_iv + cell_ciphertext + versionbyte_length) + /// cell_blob = versionbyte + [cell_tag] + cell_iv + cell_ciphertext + /// + /// Plaintext data to be encrypted + /// Does the algorithm require authentication tag. + /// Returns the ciphertext corresponding to the plaintext. + protected byte[] EncryptData(byte[] plainText, bool hasAuthenticationTag) { + // Empty values get encrypted and decrypted properly for both Deterministic and Randomized encryptions. + Debug.Assert(plainText != null); + + byte[] iv = new byte[_BlockSizeInBytes]; + + // Prepare IV + // Should be 1 single block (16 bytes) + if (_isDeterministic) { + SqlSecurityUtility.GetHMACWithSHA256(plainText, _columnEncryptionKey.IVKey, iv); + } + else { + SqlSecurityUtility.GenerateRandomBytes(iv); + } + + int numBlocks = plainText.Length / _BlockSizeInBytes + 1; + + // Final blob we return = version + HMAC + iv + cipherText + const int hmacStartIndex = 1; + int authenticationTagLen = hasAuthenticationTag ? _KeySizeInBytes : 0; + int ivStartIndex = hmacStartIndex + authenticationTagLen; + int cipherStartIndex = ivStartIndex + _BlockSizeInBytes; // this is where hmac starts. + + // Output buffer size = size of VersionByte + Authentication Tag + IV + cipher Text blocks. + int outputBufSize = sizeof(byte) + authenticationTagLen + iv.Length + (numBlocks*_BlockSizeInBytes); + byte[] outBuffer = new byte[outputBufSize]; + + // Store the version and IV rightaway + outBuffer[0] = _algorithmVersion; + Buffer.BlockCopy(iv, 0, outBuffer, ivStartIndex, iv.Length); + + AesCryptoServiceProvider aesAlg; + + // Try to get a provider from the pool. + // If no provider is available, create a new one. + if (!_cryptoProviderPool.TryDequeue(out aesAlg)) { + aesAlg = new AesCryptoServiceProvider(); + + try { + // Set various algorithm properties + aesAlg.Key = _columnEncryptionKey.EncryptionKey; + aesAlg.Mode = _cipherMode; + aesAlg.Padding = _paddingMode; + } + catch (Exception) { + if (aesAlg != null) { + aesAlg.Dispose(); + } + + throw; + } + } + + try { + // Always set the IV since it changes from cell to cell. + aesAlg.IV = iv; + + // Compute CipherText and authentication tag in a single pass + using (ICryptoTransform encryptor = aesAlg.CreateEncryptor()) { + Debug.Assert(encryptor.CanTransformMultipleBlocks, "AES Encryptor can transform multiple blocks"); + int count = 0; + int cipherIndex = cipherStartIndex; // this is where cipherText starts + if (numBlocks > 1) { + count = (numBlocks - 1) * _BlockSizeInBytes; + cipherIndex += encryptor.TransformBlock(plainText, 0, count, outBuffer, cipherIndex); + } + + byte[] buffTmp = encryptor.TransformFinalBlock(plainText, count, plainText.Length - count); // done encrypting + Buffer.BlockCopy(buffTmp, 0, outBuffer, cipherIndex, buffTmp.Length); + cipherIndex += buffTmp.Length; + } + + if (hasAuthenticationTag) { + using (HMACSHA256 hmac = new HMACSHA256(_columnEncryptionKey.MACKey)) { + Debug.Assert(hmac.CanTransformMultipleBlocks, "HMAC can't transform multiple blocks"); + hmac.TransformBlock(_version, 0, _version.Length, _version, 0); + hmac.TransformBlock(iv, 0, iv.Length, iv, 0); + + // Compute HMAC on final block + hmac.TransformBlock(outBuffer, cipherStartIndex, numBlocks * _BlockSizeInBytes, outBuffer, cipherStartIndex); + hmac.TransformFinalBlock(_versionSize, 0, _versionSize.Length); + byte[] hash = hmac.Hash; + Debug.Assert(hash.Length >= authenticationTagLen, "Unexpected hash size"); + Buffer.BlockCopy(hash, 0, outBuffer, hmacStartIndex, authenticationTagLen); + } + } + } + finally { + // Return the provider to the pool. + _cryptoProviderPool.Enqueue(aesAlg); + } + + return outBuffer; + } + + /// + /// Decryption steps + /// 1. Validate version byte + /// 2. Validate Authentication tag + /// 3. Decrypt the message + /// + /// + /// + internal override byte[] DecryptData(byte[] cipherText) { + return DecryptData(cipherText, hasAuthenticationTag: true); + } + + /// + /// Decryption steps + /// 1. Validate version byte + /// 2. (optional) Validate Authentication tag + /// 3. Decrypt the message + /// + /// + /// + /// + protected byte[] DecryptData(byte[] cipherText, bool hasAuthenticationTag) { + Debug.Assert(cipherText != null); + + byte[] iv = new byte[_BlockSizeInBytes]; + + int minimumCipherTextLength = hasAuthenticationTag ? _MinimumCipherTextLengthInBytesWithAuthenticationTag : _MinimumCipherTextLengthInBytesNoAuthenticationTag; + if (cipherText.Length < minimumCipherTextLength) { + throw SQL.InvalidCipherTextSize(cipherText.Length, minimumCipherTextLength); + } + + // Validate the version byte + int startIndex = 0; + if (cipherText[startIndex] != _algorithmVersion) { + // Cipher text was computed with a different algorithm version than this. + throw SQL.InvalidAlgorithmVersion(cipherText[startIndex], _algorithmVersion); + } + + startIndex += 1; + int authenticationTagOffset = 0; + + // Read authentication tag + if (hasAuthenticationTag) { + authenticationTagOffset = startIndex; + startIndex += _KeySizeInBytes; // authentication tag size is _KeySizeInBytes + } + + // Read cell IV + Buffer.BlockCopy(cipherText, startIndex, iv, 0, iv.Length); + startIndex += iv.Length; + + // Read encrypted text + int cipherTextOffset = startIndex; + int cipherTextCount = cipherText.Length - startIndex; + + if (hasAuthenticationTag) { + // Compute authentication tag + byte[] authenticationTag = PrepareAuthenticationTag(iv, cipherText, cipherTextOffset, cipherTextCount); + if (!SqlSecurityUtility.CompareBytes(authenticationTag, cipherText, authenticationTagOffset, authenticationTag.Length)) { + // Potentially tampered data, throw an exception + throw SQL.InvalidAuthenticationTag(); + } + } + + // Decrypt the text and return + return DecryptData(iv, cipherText, cipherTextOffset, cipherTextCount); + } + + /// + /// Decrypts plain text data using AES in CBC mode + /// + /// cipher text data to be decrypted + /// IV to be used for decryption + /// Returns decrypted plain text data + private byte[] DecryptData(byte[] iv, byte[] cipherText, int offset, int count) { + Debug.Assert((iv != null) && (cipherText != null)); + Debug.Assert (offset > -1 && count > -1); + Debug.Assert ((count+offset) <= cipherText.Length); + + byte[] plainText; + AesCryptoServiceProvider aesAlg; + + // Try to get a provider from the pool. + // If no provider is available, create a new one. + if (!_cryptoProviderPool.TryDequeue(out aesAlg)) { + aesAlg = new AesCryptoServiceProvider(); + + try { + // Set various algorithm properties + aesAlg.Key = _columnEncryptionKey.EncryptionKey; + aesAlg.Mode = _cipherMode; + aesAlg.Padding = _paddingMode; + } + catch (Exception) { + if (aesAlg != null) { + aesAlg.Dispose(); + } + + throw; + } + } + + try { + // Always set the IV since it changes from cell to cell. + aesAlg.IV = iv; + + // Create the streams used for decryption. + using (MemoryStream msDecrypt = new MemoryStream()) { + // Create an encryptor to perform the stream transform. + using (ICryptoTransform decryptor = aesAlg.CreateDecryptor()) { + using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Write)) { + // Decrypt the secret message and get the plain text data + csDecrypt.Write(cipherText, offset, count); + csDecrypt.FlushFinalBlock(); + plainText = msDecrypt.ToArray(); + } + } + } + } + finally { + // Return the provider to the pool. + _cryptoProviderPool.Enqueue(aesAlg); + } + + return plainText; + } + + /// + /// Prepares an authentication tag. + /// Authentication Tag = HMAC_SHA-2-256(mac_key, versionbyte + cell_iv + cell_ciphertext + versionbyte_length) + /// + /// + /// + private byte[] PrepareAuthenticationTag(byte[] iv, byte[] cipherText, int offset, int length) { + Debug.Assert(cipherText != null); + + byte[] computedHash; + byte[] authenticationTag = new byte[_KeySizeInBytes]; + + // Raw Tag Length: + // 1 for the version byte + // 1 block for IV (16 bytes) + // cipherText.Length + // 1 byte for version byte length + + using (HMACSHA256 hmac = new HMACSHA256(_columnEncryptionKey.MACKey)) { + int retVal = 0; + retVal = hmac.TransformBlock(_version, 0, _version.Length, _version, 0); + Debug.Assert(retVal == _version.Length); + retVal = hmac.TransformBlock(iv, 0, iv.Length, iv, 0); + Debug.Assert(retVal == iv.Length); + retVal = hmac.TransformBlock(cipherText, offset, length, cipherText, offset); + Debug.Assert(retVal == length); + hmac.TransformFinalBlock(_versionSize, 0, _versionSize.Length); + computedHash = hmac.Hash; + } + + Debug.Assert (computedHash.Length >= authenticationTag.Length); + Buffer.BlockCopy (computedHash, 0, authenticationTag, 0, authenticationTag.Length); + return authenticationTag; + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlAeadAes256CbcHmac256EncryptionKey.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlAeadAes256CbcHmac256EncryptionKey.cs new file mode 100644 index 0000000000..acb2734e9b --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlAeadAes256CbcHmac256EncryptionKey.cs @@ -0,0 +1,128 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + using System; + using System.Data.SqlClient; + using System.Text; + + /// + /// Encryption key class containing 4 keys. This class is used by SqlAeadAes256CbcHmac256Algorithm and SqlAes256CbcAlgorithm + /// 1) root key - Main key that is used to derive the keys used in the encryption algorithm + /// 2) encryption key - A derived key that is used to encrypt the plain text and generate cipher text + /// 3) mac_key - A derived key that is used to compute HMAC of the cipher text + /// 4) iv_key - A derived key that is used to generate a synthetic IV from plain text data. + /// + internal class SqlAeadAes256CbcHmac256EncryptionKey : SqlClientSymmetricKey + { + /// + /// Key size in bits + /// + internal const int KeySize = 256; + + /// + /// Encryption Key Salt format. This is used to derive the encryption key from the root key. + /// + private const string _encryptionKeySaltFormat = @"Microsoft SQL Server cell encryption key with encryption algorithm:{0} and key length:{1}"; + + /// + /// MAC Key Salt format. This is used to derive the MAC key from the root key. + /// + private const string _macKeySaltFormat = @"Microsoft SQL Server cell MAC key with encryption algorithm:{0} and key length:{1}"; + + /// + /// IV Key Salt format. This is used to derive the IV key from the root key. This is only used for Deterministic encryption. + /// + private const string _ivKeySaltFormat = @"Microsoft SQL Server cell IV key with encryption algorithm:{0} and key length:{1}"; + + /// + /// Encryption Key + /// + private readonly SqlClientSymmetricKey _encryptionKey; + + /// + /// MAC key + /// + private readonly SqlClientSymmetricKey _macKey; + + /// + /// IV Key + /// + private readonly SqlClientSymmetricKey _ivKey; + + /// + /// The name of the algorithm this key will be used with. + /// + private readonly string _algorithmName; + + /// + /// Derives all the required keys from the given root key + /// + /// Root key used to derive all the required derived keys + internal SqlAeadAes256CbcHmac256EncryptionKey(byte[] rootKey, string algorithmName): base(rootKey) + { + _algorithmName = algorithmName; + + int keySizeInBytes = KeySize / 8; + + // Key validation + if (rootKey.Length != keySizeInBytes) + { + throw SQL.InvalidKeySize(_algorithmName, + rootKey.Length, + keySizeInBytes); + } + + // Derive keys from the root key + // + // Derive encryption key + string encryptionKeySalt = string.Format(_encryptionKeySaltFormat, + _algorithmName, + KeySize); + byte[] buff1 = new byte[keySizeInBytes]; + SqlSecurityUtility.GetHMACWithSHA256(Encoding.Unicode.GetBytes(encryptionKeySalt), RootKey, buff1); + _encryptionKey = new SqlClientSymmetricKey(buff1); + + // Derive mac key + string macKeySalt = string.Format(_macKeySaltFormat, _algorithmName, KeySize); + byte[] buff2 = new byte[keySizeInBytes]; + SqlSecurityUtility.GetHMACWithSHA256(Encoding.Unicode.GetBytes(macKeySalt),RootKey,buff2); + _macKey = new SqlClientSymmetricKey(buff2); + + // Derive iv key + string ivKeySalt = string.Format(_ivKeySaltFormat, _algorithmName, KeySize); + byte[] buff3 = new byte[keySizeInBytes]; + SqlSecurityUtility.GetHMACWithSHA256(Encoding.Unicode.GetBytes(ivKeySalt),RootKey,buff3); + _ivKey = new SqlClientSymmetricKey(buff3); + } + + /// + /// Encryption key should be used for encryption and decryption + /// + internal byte[] EncryptionKey + { + get { return _encryptionKey.RootKey; } + } + + /// + /// MAC key should be used to compute and validate HMAC + /// + internal byte[] MACKey + { + get { return _macKey.RootKey; } + } + + /// + /// IV key should be used to compute synthetic IV from a given plain text + /// + internal byte[] IVKey + { + get { return _ivKey.RootKey; } + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlAeadAes256CbcHmac256Factory.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlAeadAes256CbcHmac256Factory.cs new file mode 100644 index 0000000000..dcbaa8ae34 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlAeadAes256CbcHmac256Factory.cs @@ -0,0 +1,80 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient { + using System; + using System.Collections.Concurrent; + using System.Data.SqlClient; + using System.Diagnostics; + using System.Text; + + /// + /// This is a factory class for AEAD_AES_256_CBC_HMAC_SHA256 + /// + internal class SqlAeadAes256CbcHmac256Factory : SqlClientEncryptionAlgorithmFactory { + /// + /// Factory classes caches the SqlAeadAes256CbcHmac256EncryptionKey objects to avoid computation of the derived keys + /// + private readonly ConcurrentDictionary _encryptionAlgorithms = + new ConcurrentDictionary(concurrencyLevel: 4 * Environment.ProcessorCount /* default value in ConcurrentDictionary*/, capacity: 2); + + /// + /// Creates an instance of AeadAes256CbcHmac256Algorithm class with a given key + /// + /// Root key + /// Encryption Type. Expected values are either Determinitic or Randomized. + /// Encryption Algorithm. + /// + internal override SqlClientEncryptionAlgorithm Create(SqlClientSymmetricKey encryptionKey, SqlClientEncryptionType encryptionType, string encryptionAlgorithm) { + // Callers should have validated the encryption algorithm and the encryption key + Debug.Assert(encryptionKey != null); + Debug.Assert(string.Equals(encryptionAlgorithm, SqlAeadAes256CbcHmac256Algorithm.AlgorithmName, StringComparison.OrdinalIgnoreCase) == true); + + // Validate encryption type + if (!((encryptionType == SqlClientEncryptionType.Deterministic) || (encryptionType == SqlClientEncryptionType.Randomized))) { + throw SQL.InvalidEncryptionType(SqlAeadAes256CbcHmac256Algorithm.AlgorithmName, + encryptionType, + SqlClientEncryptionType.Deterministic, + SqlClientEncryptionType.Randomized); + } + + // Get the cached encryption algorithm if one exists or create a new one, add it to cache and use it + // + // For now, we only have one version. In future, we may need to parse the algorithm names to derive the version byte. + const byte algorithmVersion = 0x1; + + StringBuilder algorithmKeyBuilder = new StringBuilder(Convert.ToBase64String(encryptionKey.RootKey), SqlSecurityUtility.GetBase64LengthFromByteLength(encryptionKey.RootKey.Length) + 4/*separators, type and version*/); + +#if DEBUG + int capacity = algorithmKeyBuilder.Capacity; +#endif //DEBUG + + algorithmKeyBuilder.Append(":"); + algorithmKeyBuilder.Append((int)encryptionType); + algorithmKeyBuilder.Append(":"); + algorithmKeyBuilder.Append(algorithmVersion); + + string algorithmKey = algorithmKeyBuilder.ToString(); + +#if DEBUG + Debug.Assert(algorithmKey.Length <= capacity, "We needed to allocate a larger array"); +#endif //DEBUG + + SqlAeadAes256CbcHmac256Algorithm aesAlgorithm; + if (!_encryptionAlgorithms.TryGetValue(algorithmKey, out aesAlgorithm)) { + SqlAeadAes256CbcHmac256EncryptionKey encryptedKey = new SqlAeadAes256CbcHmac256EncryptionKey(encryptionKey.RootKey, SqlAeadAes256CbcHmac256Algorithm.AlgorithmName); + aesAlgorithm = new SqlAeadAes256CbcHmac256Algorithm(encryptedKey, encryptionType, algorithmVersion); + + // In case multiple threads reach here at the same time, the first one adds the value + // the second one will be a no-op, the allocated memory will be claimed by Garbage Collector. + _encryptionAlgorithms.TryAdd(algorithmKey, aesAlgorithm); + } + + return aesAlgorithm; + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlAes256CbcAlgorithm.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlAes256CbcAlgorithm.cs new file mode 100644 index 0000000000..cd21c4df54 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlAes256CbcAlgorithm.cs @@ -0,0 +1,65 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + using System; + using System.Collections.Generic; + using System.Data.SqlClient; + using System.Diagnostics; + using System.IO; + using System.Runtime.CompilerServices; + using System.Security.Cryptography; + + /// + /// This class implements AES_256_CBC algorithm. + /// + internal class SqlAes256CbcAlgorithm : SqlAeadAes256CbcHmac256Algorithm + { + /// + /// Algorithm Name + /// + internal new const string AlgorithmName = @"AES_256_CBC"; + + /// + /// Initializes a new instance of SqlAes256CbcAlgorithm algorithm with a given key and encryption type + /// + /// + /// Root encryption key from which three other keys will be derived + /// + /// Encryption Type, accepted values are Deterministic and Randomized. + /// For Deterministic encryption, a synthetic IV will be genenrated during encryption + /// For Randomized encryption, a random IV will be generated during encryption. + /// + /// + /// Algorithm version + /// + internal SqlAes256CbcAlgorithm(SqlAeadAes256CbcHmac256EncryptionKey encryptionKey, SqlClientEncryptionType encryptionType, byte algorithmVersion) + :base(encryptionKey, encryptionType, algorithmVersion) + { } + + /// + /// Encryption Algorithm + /// Simply call the base class, indicating we don't need an authentication tag. + /// + /// Plaintext data to be encrypted + /// Returns the ciphertext corresponding to the plaintext. + internal override byte[] EncryptData(byte[] plainText) { + return EncryptData(plainText, hasAuthenticationTag: false); + } + + /// + /// Decryption Algorithm + /// Simply call the base class, indicating we don't have an authentication tag. + /// + /// + /// + internal override byte[] DecryptData(byte[] cipherText) { + return base.DecryptData(cipherText, hasAuthenticationTag: false); + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlAes256CbcFactory.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlAes256CbcFactory.cs new file mode 100644 index 0000000000..09d7468728 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlAes256CbcFactory.cs @@ -0,0 +1,85 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + using System; + using System.Collections.Concurrent; + using System.Data.SqlClient; + using System.Diagnostics; + using System.Text; + + /// + /// This is a factory class for AES_256_CBC. + /// + internal class SqlAes256CbcFactory : SqlAeadAes256CbcHmac256Factory + { + /// + /// Factory classes caches the SqlAeadAes256CbcHmac256EncryptionKey objects to avoid computation of the derived keys + /// + private readonly ConcurrentDictionary _encryptionAlgorithms = + new ConcurrentDictionary(concurrencyLevel: 4 * Environment.ProcessorCount /* default value in ConcurrentDictionary*/, capacity: 2); + + /// + /// Creates an instance of SqlAes256CbcAlgorithm class with a given key + /// + /// Root key + /// Encryption Type. Expected values are either Determinitic or Randomized. + /// Encryption Algorithm. + /// + internal override SqlClientEncryptionAlgorithm Create(SqlClientSymmetricKey encryptionKey, SqlClientEncryptionType encryptionType, string encryptionAlgorithm) + { + // Callers should have validated the encryption algorithm and the encryption key + Debug.Assert(encryptionKey != null); + Debug.Assert(string.Equals(encryptionAlgorithm, SqlAes256CbcAlgorithm.AlgorithmName, StringComparison.OrdinalIgnoreCase) == true); + + // Validate encryption type + if (!((encryptionType == SqlClientEncryptionType.Deterministic) || (encryptionType == SqlClientEncryptionType.Randomized))) + { + throw SQL.InvalidEncryptionType(SqlAes256CbcAlgorithm.AlgorithmName, + encryptionType, + SqlClientEncryptionType.Deterministic, + SqlClientEncryptionType.Randomized); + } + + // Get the cached encryption algorithm if one exists or create a new one, add it to cache and use it + // + // For now, we only have one version. In future, we may need to parse the algorithm names to derive the version byte. + const byte algorithmVersion = 0x1; + + StringBuilder algorithmKeyBuilder = new StringBuilder(Convert.ToBase64String(encryptionKey.RootKey), SqlSecurityUtility.GetBase64LengthFromByteLength(encryptionKey.RootKey.Length) + 4/*separators, type and version*/); + +#if DEBUG + int capacity = algorithmKeyBuilder.Capacity; +#endif //DEBUG + + algorithmKeyBuilder.Append(":"); + algorithmKeyBuilder.Append((int)encryptionType); + algorithmKeyBuilder.Append(":"); + algorithmKeyBuilder.Append(algorithmVersion); + + string algorithmKey = algorithmKeyBuilder.ToString(); + +#if DEBUG + Debug.Assert(algorithmKey.Length <= capacity, "We needed to allocate a larger array"); +#endif //DEBUG + + SqlAes256CbcAlgorithm aesAlgorithm; + if (!_encryptionAlgorithms.TryGetValue(algorithmKey, out aesAlgorithm)) + { + SqlAeadAes256CbcHmac256EncryptionKey encryptedKey = new SqlAeadAes256CbcHmac256EncryptionKey(encryptionKey.RootKey, SqlAes256CbcAlgorithm.AlgorithmName); + aesAlgorithm = new SqlAes256CbcAlgorithm(encryptedKey, encryptionType, algorithmVersion); + + // In case multiple threads reach here at the same time, the first one adds the value + // the second one will be a no-op, the allocated memory will be claimed by Garbage Collector. + _encryptionAlgorithms.TryAdd(algorithmKey, aesAlgorithm); + } + + return aesAlgorithm; + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlBuffer.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlBuffer.cs index aa838b29c5..f4dce919cf 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlBuffer.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlBuffer.cs @@ -868,11 +868,11 @@ namespace System.Data.SqlClient { _isNull = false; } - internal void SetToTime(byte[] bytes, int length, byte scale) { + internal void SetToTime(byte[] bytes, int length, byte scale, byte denormalizedScale) { Debug.Assert(IsEmpty, "setting value a second time?"); _type = StorageType.Time; - FillInTimeInfo(ref _value._timeInfo, bytes, length, scale); + FillInTimeInfo(ref _value._timeInfo, bytes, length, scale, denormalizedScale); _isNull = false; } @@ -885,11 +885,11 @@ namespace System.Data.SqlClient { _isNull = false; } - internal void SetToDateTime2(byte[] bytes, int length, byte scale) { + internal void SetToDateTime2(byte[] bytes, int length, byte scale, byte denormalizedScale) { Debug.Assert(IsEmpty, "setting value a second time?"); _type = StorageType.DateTime2; - FillInTimeInfo(ref _value._dateTime2Info.timeInfo, bytes, length - 3, scale); // remaining 3 bytes is for date + FillInTimeInfo(ref _value._dateTime2Info.timeInfo, bytes, length - 3, scale, denormalizedScale); // remaining 3 bytes is for date _value._dateTime2Info.date = GetDateFromByteArray(bytes, length - 3); // 3 bytes for date _isNull = false; } @@ -904,11 +904,11 @@ namespace System.Data.SqlClient { _isNull = false; } - internal void SetToDateTimeOffset(byte[] bytes, int length, byte scale) { + internal void SetToDateTimeOffset(byte[] bytes, int length, byte scale, byte denormalizedScale) { Debug.Assert(IsEmpty, "setting value a second time?"); _type = StorageType.DateTimeOffset; - FillInTimeInfo(ref _value._dateTimeOffsetInfo.dateTime2Info.timeInfo, bytes, length - 5, scale); // remaining 5 bytes are for date and offset + FillInTimeInfo(ref _value._dateTimeOffsetInfo.dateTime2Info.timeInfo, bytes, length - 5, scale, denormalizedScale); // remaining 5 bytes are for date and offset _value._dateTimeOffsetInfo.dateTime2Info.date = GetDateFromByteArray(bytes, length - 5); // 3 bytes for date _value._dateTimeOffsetInfo.offset = (Int16)(bytes[length - 2] + (bytes[length - 1] << 8)); // 2 bytes for offset (Int16) _isNull = false; @@ -926,9 +926,10 @@ namespace System.Data.SqlClient { _isNull = false; } - private static void FillInTimeInfo(ref TimeInfo timeInfo, byte[] timeBytes, int length, byte scale) { + private static void FillInTimeInfo(ref TimeInfo timeInfo, byte[] timeBytes, int length, byte scale, byte denormalizedScale) { Debug.Assert(3 <= length && length <= 5, "invalid data length for timeInfo: " + length); Debug.Assert(0 <= scale && scale <= 7, "invalid scale: " + scale); + Debug.Assert(0 <= denormalizedScale && denormalizedScale <= 7, "invalid denormalized scale: " + denormalizedScale); Int64 tickUnits = (Int64)timeBytes[0] + ((Int64)timeBytes[1] << 8) + ((Int64)timeBytes[2] << 16); if (length > 3) { @@ -938,7 +939,11 @@ namespace System.Data.SqlClient { tickUnits += ((Int64)timeBytes[4] << 32); } timeInfo.ticks = tickUnits * TdsEnums.TICKS_FROM_SCALE[scale]; - timeInfo.scale = scale; + + // Once the deserialization has been completed using the value scale, we need to set the actual denormalized scale, + // coming from the data type, on the original result, so that it has the proper scale setting. + // This only applies for values that got serialized/deserialized for encryption. Otherwise, both scales should be equal. + timeInfo.scale = denormalizedScale; } private static Int32 GetDateFromByteArray(byte[] buf, int offset) { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopy.cs.REMOVED.git-id b/external/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopy.cs.REMOVED.git-id index 826cf1a1eb..9bf1fc1cfd 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopy.cs.REMOVED.git-id +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopy.cs.REMOVED.git-id @@ -1 +1 @@ -91812a7b96c2d1123b38454b099aa1892ab0a3c5 \ No newline at end of file +2a4b96c02a36a45bbc09c39c729d107f10314af7 \ No newline at end of file diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyOptions.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyOptions.cs index 9c7d1ed171..00d01449c2 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyOptions.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlBulkCopyOptions.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// mithomas +// blained //------------------------------------------------------------------------------ namespace System.Data.SqlClient { @@ -17,6 +17,7 @@ namespace System.Data.SqlClient { KeepNulls = 1 << 3, FireTriggers = 1 << 4, UseInternalTransaction = 1 << 5, + AllowEncryptedValueModifications = 1 << 6, } } diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionAlgorithm.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionAlgorithm.cs new file mode 100644 index 0000000000..d8cc2dde56 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionAlgorithm.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + using System; + + /// + /// Abstract base class for all TCE encryption algorithms. It exposes two functions + /// 1. Encrypt - This function is used by SqlClient under the covers to transparently encrypt TCE enabled column data. + /// 2. Decrypt - This function is used by SqlClient under the covers to transparently decrypt TCE enabled column data. + /// + internal abstract class SqlClientEncryptionAlgorithm + { + /// + /// Encrypts the plainText with a column encryption key + /// + /// Plain text value to be encrypted + /// + internal abstract byte[] EncryptData(byte[] plainText); + + /// + /// Decrypts the cipherText with a column encryption key + /// + /// Ciphertext value to be decrypted + /// + internal abstract byte[] DecryptData(byte[] cipherText); + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionAlgorithmFactory.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionAlgorithmFactory.cs new file mode 100644 index 0000000000..bdd0c78336 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionAlgorithmFactory.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + /// + /// Abstract base class for all TCE encryption algorithm factory classes. Factory classes create instances of an encryption algorithm + /// with a given key. At runtime when we determine a particular column is marked for TCE, based on the encryption algorithm we invoke + /// the corresponding factory class and retrieve an object to an encryption algorithm. + /// + internal abstract class SqlClientEncryptionAlgorithmFactory + { + /// + /// Creates an encrytion algorithm with a given key. + /// + /// encryption key that should be passed to the encryption algorithm to be created + /// Encryption Type, some algorithms will need this + /// Encryption algorithm name. Needed for extracting version bits + /// Return a newly created SqlClientEncryptionAlgorithm instance + internal abstract SqlClientEncryptionAlgorithm Create(SqlClientSymmetricKey encryptionKey, SqlClientEncryptionType encryptionType, string encryptionAlgorithm); + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionAlgorithmFactoryList.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionAlgorithmFactoryList.cs new file mode 100644 index 0000000000..e012c24a03 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionAlgorithmFactoryList.cs @@ -0,0 +1,79 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// krishnib +// balnee +//------------------------------------------------------------------------------ + +namespace System.Data.SqlClient { + using System; + using System.Diagnostics; + using System.Collections.Concurrent; + using System.Text; + + /// + /// Implements a global directory of all the encryption algorithms registered with client. + /// + sealed internal class SqlClientEncryptionAlgorithmFactoryList { + private readonly ConcurrentDictionary _encryptionAlgoFactoryList; + private static readonly SqlClientEncryptionAlgorithmFactoryList _singletonInstance = new SqlClientEncryptionAlgorithmFactoryList(); + + private SqlClientEncryptionAlgorithmFactoryList () { + _encryptionAlgoFactoryList = new ConcurrentDictionary(concurrencyLevel: 4 * Environment.ProcessorCount /* default value in ConcurrentDictionary*/, capacity: 2); + + // Add wellknown algorithms + _encryptionAlgoFactoryList.TryAdd(SqlAeadAes256CbcHmac256Algorithm.AlgorithmName, new SqlAeadAes256CbcHmac256Factory()); + _encryptionAlgoFactoryList.TryAdd(SqlAes256CbcAlgorithm.AlgorithmName, new SqlAes256CbcFactory()); + } + + internal static SqlClientEncryptionAlgorithmFactoryList GetInstance () { + return _singletonInstance; + } + + /// + /// Get the registered list of algorithms as a comma seperated list with algorithm names + /// wrapped in single quotes. + /// + internal string GetRegisteredCipherAlgorithmNames () { + StringBuilder builder = new StringBuilder(); + bool firstElem = true; + foreach (string key in _encryptionAlgoFactoryList.Keys) { + if (firstElem) { + builder.Append("'"); + firstElem = false; + } + else { + builder.Append(", '"); + } + builder.Append (key); + builder.Append ("'"); + } + + return builder.ToString(); + } + + /// + /// Gets the algorithm handle instance for a given algorithm and instantiates it using the provided key and the encryption type. + /// + /// + /// + /// + /// + internal void GetAlgorithm(SqlClientSymmetricKey key, byte type, string algorithmName, out SqlClientEncryptionAlgorithm encryptionAlgorithm) { + encryptionAlgorithm = null; + + SqlClientEncryptionAlgorithmFactory factory = null; + if (!_encryptionAlgoFactoryList.TryGetValue (algorithmName, out factory)) { + throw SQL.UnknownColumnEncryptionAlgorithm(algorithmName, + SqlClientEncryptionAlgorithmFactoryList.GetInstance().GetRegisteredCipherAlgorithmNames()); + } + + Debug.Assert (null != factory, "Null Algorithm Factory class detected"); + + // If the factory exists, following method will Create an algorithm object. If this fails, + // it will raise an exception. + encryptionAlgorithm = factory.Create(key, (SqlClientEncryptionType)type, algorithmName); + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionType.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionType.cs new file mode 100644 index 0000000000..3ba5a31986 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlClientEncryptionType.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + /// + /// Encryption types supported in TCE + /// + internal enum SqlClientEncryptionType + { + PlainText = 0, + Deterministic, + Randomized + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlClientSymmetricKey.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlClientSymmetricKey.cs new file mode 100644 index 0000000000..112108ae14 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlClientSymmetricKey.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + using System; + using System.Data.SqlClient; + using System.Security.Cryptography; + + /// + /// Base class containing raw key bytes for symmetric key algorithms. Some encryption algorithms can use the key directly while others derive sub keys from this. + /// If an algorithm needs to derive more keys, have a derived class from this and use it in the corresponding encryption algorithm. + /// + internal class SqlClientSymmetricKey + { + /// + /// DPAPI protected key + /// + protected readonly byte[] _rootKey; + + /// + /// Constructor that initializes the root key. + /// + /// root key + internal SqlClientSymmetricKey(byte[] rootKey) + { + // Key validation + if (rootKey == null || rootKey.Length == 0) { + throw SQL.NullColumnEncryptionKeySysErr(); + } + + _rootKey = rootKey; + } + + /// + /// Returns a copy of the plain text key + /// This is needed for actual encryption/decryption. + /// + internal virtual byte[] RootKey + { + get + { + return _rootKey; + } + } + + /// + /// Computes SHA256 value of the plain text key bytes + /// + /// A string containing SHA256 hash of the root key + internal virtual string GetKeyHash() + { + return SqlSecurityUtility.GetSHA256Hash(RootKey); + } + + /// + /// Gets the length of the root key + /// + /// + /// Returns the length of the root key + /// + internal virtual int Length() + { + // Note: DPAPI preserves the original byte length + // so for now, this is as same as returning the length of the raw key. + return _rootKey.Length; + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.cs new file mode 100644 index 0000000000..a81efb1996 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCertificateStoreProvider.cs @@ -0,0 +1,556 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + using System; + using System.Text; + using System.Data.Common; + using System.Diagnostics; + using System.Globalization; + using System.Security; + using System.Security.Cryptography; + using System.Security.Cryptography.X509Certificates; + + /// + /// Certificate Key Store Provider class + /// + public class SqlColumnEncryptionCertificateStoreProvider : SqlColumnEncryptionKeyStoreProvider + { + // Constants + // + // Assumption: Certificate Locations (LocalMachine & CurrentUser), Certificate Store name "My" + // Certificate provider name (CertificateStore) dont need to be localized. + + /// + /// Name for the certificate key store provider. + /// + public const string ProviderName = @"MSSQL_CERTIFICATE_STORE"; + + /// + /// RSA_OAEP is the only algorithm supported for encrypting/decrypting column encryption keys. + /// + internal const string RSAEncryptionAlgorithmWithOAEP = @"RSA_OAEP"; + + /// + /// LocalMachine certificate store location. Valid certificate locations are LocalMachine and CurrentUser. + /// + private const string _certLocationLocalMachine = @"LocalMachine"; + + /// + /// CurrentUser certificate store location. Valid certificate locations are LocalMachine and CurrentUser. + /// + private const string _certLocationCurrentUser = @"CurrentUser"; + + /// + /// Valid certificate store + /// + private const string _myCertificateStore = @"My"; + + /// + /// Certificate path format. This is a custom format. + /// + private const string _certificatePathFormat = @"[LocalMachine|CurrentUser]/My/[Thumbprint]"; + + /// + /// Hashig algoirthm used for signing + /// + private const string _hashingAlgorithm = @"SHA256"; + + /// + /// Algorithm version + /// + private readonly byte[] _version = new byte[] { 0x01 }; + + /// + /// This function uses a certificate specified by the key path + /// and decrypts an encrypted CEK with RSA encryption algorithm. + /// + /// Complete path of a certificate + /// Asymmetric Key Encryption Algorithm + /// Encrypted Column Encryption Key + /// Plain text column encryption key + public override byte[] DecryptColumnEncryptionKey(string masterKeyPath, string encryptionAlgorithm, byte[] encryptedColumnEncryptionKey) + { + // Validate the input parameters + ValidateNonEmptyCertificatePath(masterKeyPath, isSystemOp: true); + + if (null == encryptedColumnEncryptionKey) + { + throw SQL.NullEncryptedColumnEncryptionKey(); + } + else if (0 == encryptedColumnEncryptionKey.Length) + { + throw SQL.EmptyEncryptedColumnEncryptionKey(); + } + + // Validate encryptionAlgorithm + ValidateEncryptionAlgorithm(encryptionAlgorithm, isSystemOp: true); + + // Validate key path length + ValidateCertificatePathLength(masterKeyPath, isSystemOp: true); + + // Parse the path and get the X509 cert + X509Certificate2 certificate = GetCertificateByPath(masterKeyPath, isSystemOp: true); + int keySizeInBytes = certificate.PublicKey.Key.KeySize / 8; + + // Validate and decrypt the EncryptedColumnEncryptionKey + // Format is + // version + keyPathLength + ciphertextLength + keyPath + ciphertext + signature + // + // keyPath is present in the encrypted column encryption key for identifying the original source of the asymmetric key pair and + // we will not validate it against the data contained in the CMK metadata (masterKeyPath). + + // Validate the version byte + if (encryptedColumnEncryptionKey[0] != _version[0]) + { + throw SQL.InvalidAlgorithmVersionInEncryptedCEK(encryptedColumnEncryptionKey[0], _version[0]); + } + + // Get key path length + int currentIndex = _version.Length; + Int16 keyPathLength = BitConverter.ToInt16(encryptedColumnEncryptionKey, currentIndex); + currentIndex += sizeof(Int16); + + // Get ciphertext length + int cipherTextLength = BitConverter.ToInt16(encryptedColumnEncryptionKey, currentIndex); + currentIndex += sizeof(Int16); + + // Skip KeyPath + // KeyPath exists only for troubleshooting purposes and doesnt need validation. + currentIndex += keyPathLength; + + // validate the ciphertext length + if (cipherTextLength != keySizeInBytes) + { + throw SQL.InvalidCiphertextLengthInEncryptedCEK(cipherTextLength, keySizeInBytes, masterKeyPath); + } + + // Validate the signature length + // Signature length should be same as the key side for RSA PKCSv1.5 + int signatureLength = encryptedColumnEncryptionKey.Length - currentIndex - cipherTextLength; + if (signatureLength != keySizeInBytes) + { + throw SQL.InvalidSignatureInEncryptedCEK(signatureLength, keySizeInBytes, masterKeyPath); + } + + // Get ciphertext + byte[] cipherText = new byte[cipherTextLength]; + Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, cipherText, 0, cipherText.Length); + currentIndex += cipherTextLength; + + // Get signature + byte[] signature = new byte[signatureLength]; + Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, signature, 0, signature.Length); + + // Compute the hash to validate the signature + byte[] hash; + using (SHA256Cng sha256 = new SHA256Cng()) + { + sha256.TransformFinalBlock(encryptedColumnEncryptionKey, 0, encryptedColumnEncryptionKey.Length - signature.Length); + hash = sha256.Hash; + } + + Debug.Assert(hash != null, @"hash should not be null while decrypting encrypted column encryption key."); + + // Validate the signature + if (!RSAVerifySignature(hash, signature, certificate)) + { + throw SQL.InvalidCertificateSignature(masterKeyPath); + } + + // Decrypt the CEK + return RSADecrypt(cipherText, certificate); + } + + /// + /// This function uses a certificate specified by the key path + /// and encrypts CEK with RSA encryption algorithm. + /// + /// Complete path of a certificate + /// Asymmetric Key Encryption Algorithm + /// Plain text column encryption key + /// Encrypted column encryption key + public override byte[] EncryptColumnEncryptionKey(string masterKeyPath, string encryptionAlgorithm, byte[] columnEncryptionKey) + { + // Validate the input parameters + ValidateNonEmptyCertificatePath(masterKeyPath, isSystemOp: false); + if (null == columnEncryptionKey) + { + throw SQL.NullColumnEncryptionKey(); + } + else if (0 == columnEncryptionKey.Length) + { + throw SQL.EmptyColumnEncryptionKey(); + } + + // Validate encryptionAlgorithm + ValidateEncryptionAlgorithm(encryptionAlgorithm, isSystemOp: false); + + // Validate masterKeyPath Length + ValidateCertificatePathLength(masterKeyPath, isSystemOp: false); + + // Parse the certificate path and get the X509 cert + X509Certificate2 certificate = GetCertificateByPath(masterKeyPath, isSystemOp: false); + int keySizeInBytes = certificate.PublicKey.Key.KeySize / 8; + + // Construct the encryptedColumnEncryptionKey + // Format is + // version + keyPathLength + ciphertextLength + ciphertext + keyPath + signature + // + // We currently only support one version + byte[] version = new byte[] { _version[0] }; + + // Get the Unicode encoded bytes of cultureinvariant lower case masterKeyPath + byte[] masterKeyPathBytes = Encoding.Unicode.GetBytes(masterKeyPath.ToLowerInvariant()); + byte[] keyPathLength = BitConverter.GetBytes((Int16)masterKeyPathBytes.Length); + + // Encrypt the plain text + byte[] cipherText = RSAEncrypt(columnEncryptionKey, certificate); + byte[] cipherTextLength = BitConverter.GetBytes((Int16)cipherText.Length); + Debug.Assert(cipherText.Length == keySizeInBytes, @"cipherText length does not match the RSA key size"); + + // Compute hash + // SHA-2-256(version + keyPathLength + ciphertextLength + keyPath + ciphertext) + byte[] hash; + using (SHA256Cng sha256 = new SHA256Cng()) + { + sha256.TransformBlock(version, 0, version.Length, version, 0); + sha256.TransformBlock(keyPathLength, 0, keyPathLength.Length, keyPathLength, 0); + sha256.TransformBlock(cipherTextLength, 0, cipherTextLength.Length, cipherTextLength, 0); + sha256.TransformBlock(masterKeyPathBytes, 0, masterKeyPathBytes.Length, masterKeyPathBytes, 0); + sha256.TransformFinalBlock(cipherText, 0, cipherText.Length); + hash = sha256.Hash; + } + + // Sign the hash + byte[] signedHash = RSASignHashedData(hash, certificate); + Debug.Assert(signedHash.Length == keySizeInBytes, @"signed hash length does not match the RSA key size"); + Debug.Assert(RSAVerifySignature(hash, signedHash, certificate), @"Invalid signature of the encrypted column encryption key computed."); + + // Construct the encrypted column encryption key + // EncryptedColumnEncryptionKey = version + keyPathLength + ciphertextLength + keyPath + ciphertext + signature + int encryptedColumnEncryptionKeyLength = version.Length + cipherTextLength.Length + keyPathLength.Length + cipherText.Length + masterKeyPathBytes.Length + signedHash.Length; + byte[] encryptedColumnEncryptionKey = new byte[encryptedColumnEncryptionKeyLength]; + + // Copy version byte + int currentIndex = 0; + Buffer.BlockCopy(version, 0, encryptedColumnEncryptionKey, currentIndex, version.Length); + currentIndex += version.Length; + + // Copy key path length + Buffer.BlockCopy(keyPathLength, 0, encryptedColumnEncryptionKey, currentIndex, keyPathLength.Length); + currentIndex += keyPathLength.Length; + + // Copy ciphertext length + Buffer.BlockCopy(cipherTextLength, 0, encryptedColumnEncryptionKey, currentIndex, cipherTextLength.Length); + currentIndex += cipherTextLength.Length; + + // Copy key path + Buffer.BlockCopy(masterKeyPathBytes, 0, encryptedColumnEncryptionKey, currentIndex, masterKeyPathBytes.Length); + currentIndex += masterKeyPathBytes.Length; + + // Copy ciphertext + Buffer.BlockCopy(cipherText, 0, encryptedColumnEncryptionKey, currentIndex, cipherText.Length); + currentIndex += cipherText.Length; + + // copy the signature + Buffer.BlockCopy(signedHash, 0, encryptedColumnEncryptionKey, currentIndex, signedHash.Length); + + return encryptedColumnEncryptionKey; + } + + /// + /// This function validates that the encryption algorithm is RSA_OAEP and if it is not, + /// then throws an exception + /// + /// Asymmetric key encryptio algorithm + private void ValidateEncryptionAlgorithm(string encryptionAlgorithm, bool isSystemOp) + { + // This validates that the encryption algorithm is RSA_OAEP + if (null == encryptionAlgorithm) + { + throw SQL.NullKeyEncryptionAlgorithm(isSystemOp); + } + + if (string.Equals(encryptionAlgorithm, RSAEncryptionAlgorithmWithOAEP, StringComparison.OrdinalIgnoreCase) != true) + { + throw SQL.InvalidKeyEncryptionAlgorithm(encryptionAlgorithm, RSAEncryptionAlgorithmWithOAEP, isSystemOp); + } + } + + /// + /// Certificate path length has to fit in two bytes, so check its value against Int16.MaxValue + /// + /// + /// + private void ValidateCertificatePathLength(string masterKeyPath, bool isSystemOp) + { + if (masterKeyPath.Length >= Int16.MaxValue) + { + throw SQL.LargeCertificatePathLength(masterKeyPath.Length, Int16.MaxValue, isSystemOp); + } + } + + /// + /// Gets a string array containing Valid certificate locations. + /// + private string[] GetValidCertificateLocations() + { + return new string[2] {_certLocationLocalMachine, _certLocationCurrentUser}; + } + + /// + /// Checks if the certificate path is Empty or Null (and raises exception if they are). + /// + private void ValidateNonEmptyCertificatePath(string masterKeyPath, bool isSystemOp) + { + if (string.IsNullOrWhiteSpace(masterKeyPath)) + { + if (null == masterKeyPath) + { + throw SQL.NullCertificatePath(GetValidCertificateLocations(), isSystemOp); + } + else + { + throw SQL.InvalidCertificatePath(masterKeyPath, GetValidCertificateLocations(), isSystemOp); + } + } + } + + /// + /// Parses the given certificate path, searches in certificate store and returns a matching certificate + /// + /// + /// Certificate key path. Format of the path is [LocalMachine|CurrentUser]/[storename]/thumbprint + /// + /// Returns the certificate identified by the certificate path + private X509Certificate2 GetCertificateByPath(string keyPath, bool isSystemOp) + { + Debug.Assert(!string.IsNullOrEmpty(keyPath)); + + // Assign default values for omitted fields + StoreLocation storeLocation = StoreLocation.LocalMachine; // Default to Local Machine + StoreName storeName = StoreName.My; + string[] certParts = keyPath.Split('/'); + + // Validate certificate path + // Certificate path should only contain 3 parts (Certificate Location, Certificate Store Name and Thumbprint) + if (certParts.Length > 3) + { + throw SQL.InvalidCertificatePath(keyPath, GetValidCertificateLocations(), isSystemOp); + } + + // Extract the store location where the cert is stored + if (certParts.Length > 2) + { + if (string.Equals(certParts[0], _certLocationLocalMachine, StringComparison.OrdinalIgnoreCase) == true) + { + storeLocation = StoreLocation.LocalMachine; + } + else if (string.Equals(certParts[0], _certLocationCurrentUser, StringComparison.OrdinalIgnoreCase) == true) + { + storeLocation = StoreLocation.CurrentUser; + } + else + { + // throw an invalid certificate location exception + throw SQL.InvalidCertificateLocation(certParts[0], keyPath, GetValidCertificateLocations(), isSystemOp); + } + } + + // Parse the certificate store name + if (certParts.Length > 1) + { + if (string.Equals(certParts[certParts.Length - 2], _myCertificateStore, StringComparison.OrdinalIgnoreCase) == true) + { + storeName = StoreName.My; + } + else + { + // We only support storing them in My certificate store + throw SQL.InvalidCertificateStore(certParts[certParts.Length - 2], keyPath, _myCertificateStore, isSystemOp); + } + } + + // Get thumpbrint + string thumbprint = certParts[certParts.Length - 1]; + if (string.IsNullOrEmpty(thumbprint)) + { + // An empty thumbprint specified + throw SQL.EmptyCertificateThumbprint(keyPath, isSystemOp); + } + + // Find the certificate and return + return GetCertificate(storeLocation, storeName, keyPath, thumbprint, isSystemOp); + } + + /// + /// Searches for a certificate in certificate store and returns the matching certificate + /// + /// Store Location: This can be one of LocalMachine or UserName + /// Store Location: Currently this can only be My store. + /// Certificate thumbprint + /// Matching certificate + private X509Certificate2 GetCertificate(StoreLocation storeLocation, StoreName storeName, string masterKeyPath, string thumbprint, bool isSystemOp) + { + // Open specified certificate store + X509Store certificateStore = null; + + try + { + certificateStore = new X509Store(storeName, storeLocation); + certificateStore.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly); + + // Search for the specified certificate + X509Certificate2Collection matchingCertificates = + certificateStore.Certificates.Find(X509FindType.FindByThumbprint, + thumbprint, + false); + + // Throw an exception if a cert with the specified thumbprint is not found + if (matchingCertificates == null || matchingCertificates.Count == 0) + { + throw SQL.CertificateNotFound(thumbprint, storeName.ToString(), storeLocation.ToString(), isSystemOp); + } + + X509Certificate2 certificate = matchingCertificates[0]; + if (!certificate.HasPrivateKey) + { + // ensure the certificate has private key + throw SQL.CertificateWithNoPrivateKey(masterKeyPath, isSystemOp); + } + + // return the matching certificate + return certificate; + } + finally + { + // Close the certificate store + if (certificateStore != null) + { + certificateStore.Close(); + } + } + } + + /// + /// Encrypt the text using specified certificate. + /// + /// Text to encrypt. + /// Certificate object. + /// Master key path that was used. + /// Returns an encrypted blob or throws an exception if there are any errors. + private byte[] RSAEncrypt(byte[] plainText, X509Certificate2 certificate) + { + Debug.Assert(plainText != null); + Debug.Assert(certificate != null); + Debug.Assert(certificate.HasPrivateKey, "Attempting to encrypt with cert without privatekey"); + + RSACryptoServiceProvider rscp = (RSACryptoServiceProvider)certificate.PublicKey.Key; + return rscp.Encrypt(plainText, fOAEP: true); + } + + /// + /// Encrypt the text using specified certificate. + /// + /// Text to decrypt. + /// Certificate object. + /// Master key path that was used. + private byte[] RSADecrypt(byte[] cipherText, X509Certificate2 certificate) + { + Debug.Assert((cipherText != null) && (cipherText.Length != 0)); + Debug.Assert(certificate != null); + Debug.Assert(certificate.HasPrivateKey, "Attempting to decrypt with cert without privatekey"); + + RSACryptoServiceProvider rscp = (RSACryptoServiceProvider)certificate.PrivateKey; + return rscp.Decrypt(cipherText, fOAEP: true); + } + + /// + /// Generates signature based on RSA PKCS#v1.5 scheme using a specified certificate. + /// + /// Text to sign. + /// Certificate object. + /// Signature + private byte[] RSASignHashedData(byte[] dataToSign, X509Certificate2 certificate) + { + Debug.Assert((dataToSign != null) && (dataToSign.Length != 0)); + Debug.Assert(certificate != null); + Debug.Assert(certificate.HasPrivateKey, "Attempting to sign with cert without privatekey"); + + // Prepare RSACryptoServiceProvider from certificate's private key + RSACryptoServiceProvider rscp = GetCSPFromCertificatePrivateKey(certificate); + + // Prepare RSAPKCS1SignatureFormatter for signing the passed in hash + RSAPKCS1SignatureFormatter rsaFormatter = new RSAPKCS1SignatureFormatter(rscp); + + //Set the hash algorithm to SHA256. + rsaFormatter.SetHashAlgorithm(_hashingAlgorithm); + + //Create a signature for HashValue and return it. + return rsaFormatter.CreateSignature(dataToSign); + } + + /// + /// Verifies the given RSA PKCSv1.5 signature. + /// + /// + /// + /// + /// true if signature is valid, false if it is not valid + private bool RSAVerifySignature(byte[] dataToVerify, byte[] signature, X509Certificate2 certificate) + { + Debug.Assert((dataToVerify != null) && (dataToVerify.Length != 0)); + Debug.Assert((signature != null) && (signature.Length != 0)); + Debug.Assert(certificate != null); + Debug.Assert(certificate.HasPrivateKey, "Attempting to sign with cert without privatekey"); + + // Prepare RSACryptoServiceProvider from certificate's private key + RSACryptoServiceProvider rscp = GetCSPFromCertificatePrivateKey(certificate); + + // Prepare RSAPKCS1SignatureFormatter for signing the passed in hash + RSAPKCS1SignatureDeformatter rsaDeFormatter = new RSAPKCS1SignatureDeformatter(rscp); + + //Set the hash algorithm to SHA256. + rsaDeFormatter.SetHashAlgorithm(_hashingAlgorithm); + + //Create a signature for HashValue and return it. + return rsaDeFormatter.VerifySignature(dataToVerify, signature); + } + + /// + /// Prepares RSACryptoServiceProvider from a given certificate's private key + /// + /// + /// + private RSACryptoServiceProvider GetCSPFromCertificatePrivateKey(X509Certificate2 certificate) + { + const int rsaAesProviderType = 24; + + CspParameters privateKeyParams = new CspParameters(); + privateKeyParams = new CspParameters(); + privateKeyParams.KeyContainerName = ((RSACryptoServiceProvider)certificate.PrivateKey).CspKeyContainerInfo.KeyContainerName; + privateKeyParams.ProviderType = rsaAesProviderType /*PROV_RSA_AES*/; + privateKeyParams.KeyNumber = (int)((RSACryptoServiceProvider)certificate.PrivateKey).CspKeyContainerInfo.KeyNumber; + + // For CurrentUser store, use UseExistingKey + // For LocalMachine store, use UseMachineKeyStore + // CspKeyContainerInfo.MachineKeyStore already contains the appropriate information so just use it. + if (((RSACryptoServiceProvider)certificate.PrivateKey).CspKeyContainerInfo.MachineKeyStore) + { + privateKeyParams.Flags = CspProviderFlags.UseMachineKeyStore; + } + else + { + privateKeyParams.Flags = CspProviderFlags.UseExistingKey; + } + + return new RSACryptoServiceProvider(privateKeyParams); + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCngProvider.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCngProvider.cs new file mode 100644 index 0000000000..aa4561ab3c --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCngProvider.cs @@ -0,0 +1,414 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + using System; + using System.Text; + using System.Data.Common; + using System.Diagnostics; + using System.Globalization; + using System.Security; + using System.Security.Cryptography; + + /// + /// Provides implementation similar to certificate store provider. + /// A CEK encrypted with certificate provider should be decryptable by this provider and vice versa. + /// + /// Envolope Format for the encrypted column encryption key + /// version + keyPathLength + ciphertextLength + keyPath + ciphertext + signature + /// version: A single byte indicating the format version. + /// keyPathLength: Length of the keyPath. + /// ciphertextLength: ciphertext length + /// keyPath: keyPath used to encrypt the column encryption key. This is only used for troubleshooting purposes and is not verified during decryption. + /// ciphertext: Encrypted column encryption key + /// signature: Signature of the entire byte array. Signature is validated before decrypting the column encryption key. + /// + public class SqlColumnEncryptionCngProvider : SqlColumnEncryptionKeyStoreProvider + { + /// + /// Name for the CNG key store provider. + /// + public const string ProviderName = @"MSSQL_CNG_STORE"; + + /// + /// RSA_OAEP is the only algorithm supported for encrypting/decrypting column encryption keys using this provider. + /// For now, we are keeping all the providers in [....]. + /// + private const string RSAEncryptionAlgorithmWithOAEP = @"RSA_OAEP"; + + /// + /// Algorithm version + /// + private readonly byte[] _version = new byte[] { 0x01 }; + + /// + /// This function uses the asymmetric key specified by the key path + /// and decrypts an encrypted CEK with RSA encryption algorithm. + /// + /// Complete path of an asymmetric key in CNG + /// Asymmetric Key Encryption Algorithm + /// Encrypted Column Encryption Key + /// Plain text column encryption key + public override byte[] DecryptColumnEncryptionKey(string masterKeyPath, string encryptionAlgorithm, byte[] encryptedColumnEncryptionKey) + { + // Validate the input parameters + ValidateNonEmptyKeyPath(masterKeyPath, isSystemOp: true); + + if (null == encryptedColumnEncryptionKey) + { + throw SQL.NullEncryptedColumnEncryptionKey(); + } + + if (0 == encryptedColumnEncryptionKey.Length) + { + throw SQL.EmptyEncryptedColumnEncryptionKey(); + } + + // Validate encryptionAlgorithm + ValidateEncryptionAlgorithm(encryptionAlgorithm, isSystemOp: true); + + // Create RSA Provider with the given CNG name and key name + RSACng rsaCngProvider = CreateRSACngProvider(masterKeyPath, isSystemOp: true); + + // Validate whether the key is RSA one or not and then get the key size + int keySizeInBytes = GetKeySize(rsaCngProvider); + + // Validate and decrypt the EncryptedColumnEncryptionKey + // Format is + // version + keyPathLength + ciphertextLength + keyPath + ciphervtext + signature + // + // keyPath is present in the encrypted column encryption key for identifying the original source of the asymmetric key pair and + // we will not validate it against the data contained in the CMK metadata (masterKeyPath). + + // Validate the version byte + if (encryptedColumnEncryptionKey[0] != _version[0]) + { + throw SQL.InvalidAlgorithmVersionInEncryptedCEK(encryptedColumnEncryptionKey[0], _version[0]); + } + + // Get key path length + int currentIndex = _version.Length; + UInt16 keyPathLength = BitConverter.ToUInt16(encryptedColumnEncryptionKey, currentIndex); + currentIndex += sizeof(UInt16); + + // Get ciphertext length + UInt16 cipherTextLength = BitConverter.ToUInt16(encryptedColumnEncryptionKey, currentIndex); + currentIndex += sizeof(UInt16); + + // Skip KeyPath + // KeyPath exists only for troubleshooting purposes and doesnt need validation. + currentIndex += keyPathLength; + + // validate the ciphertext length + if (cipherTextLength != keySizeInBytes) + { + throw SQL.InvalidCiphertextLengthInEncryptedCEKCng(cipherTextLength, keySizeInBytes, masterKeyPath); + } + + // Validate the signature length + // Signature length should be same as the key side for RSA PKCSv1.5 + int signatureLength = encryptedColumnEncryptionKey.Length - currentIndex - cipherTextLength; + if (signatureLength != keySizeInBytes) + { + throw SQL.InvalidSignatureInEncryptedCEKCng(signatureLength, keySizeInBytes, masterKeyPath); + } + + // Get ciphertext + byte[] cipherText = new byte[cipherTextLength]; + Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, cipherText, 0, cipherText.Length); + currentIndex += cipherTextLength; + + // Get signature + byte[] signature = new byte[signatureLength]; + Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, signature, 0, signature.Length); + + // Compute the hash to validate the signature + byte[] hash; + using (SHA256Cng sha256 = new SHA256Cng()) + { + sha256.TransformFinalBlock(encryptedColumnEncryptionKey, 0, encryptedColumnEncryptionKey.Length - signature.Length); + hash = sha256.Hash; + } + + Debug.Assert(hash != null, @"hash should not be null while decrypting encrypted column encryption key."); + + // Validate the signature + if (!RSAVerifySignature(hash, signature, rsaCngProvider)) + { + throw SQL.InvalidSignature(masterKeyPath); + } + + // Decrypt the CEK + return RSADecrypt(rsaCngProvider, cipherText); + } + + /// + /// This function uses the asymmetric key specified by the key path + /// and encrypts CEK with RSA encryption algorithm. + /// + /// Complete path of an asymmetric key in AKV + /// Asymmetric Key Encryption Algorithm + /// Plain text column encryption key + /// Encrypted column encryption key + public override byte[] EncryptColumnEncryptionKey(string masterKeyPath, string encryptionAlgorithm, byte[] columnEncryptionKey) + { + // Validate the input parameters + ValidateNonEmptyKeyPath(masterKeyPath, isSystemOp: false); + + if (null == columnEncryptionKey) + { + throw SQL.NullColumnEncryptionKey(); + } + else if (0 == columnEncryptionKey.Length) + { + throw SQL.EmptyColumnEncryptionKey(); + } + + // Validate encryptionAlgorithm + ValidateEncryptionAlgorithm(encryptionAlgorithm, isSystemOp: false); + + // CreateCNGProviderWithKey + RSACng rsaCngProvider = CreateRSACngProvider(masterKeyPath, isSystemOp: false); + + // Validate whether the key is RSA one or not and then get the key size + int keySizeInBytes = GetKeySize(rsaCngProvider); + + // Construct the encryptedColumnEncryptionKey + // Format is + // version + keyPathLength + ciphertextLength + ciphertext + keyPath + signature + // + // We currently only support one version + byte[] version = new byte[] { _version[0] }; + + // Get the Unicode encoded bytes of cultureinvariant lower case masterKeyPath + byte[] masterKeyPathBytes = Encoding.Unicode.GetBytes(masterKeyPath.ToLowerInvariant()); + byte[] keyPathLength = BitConverter.GetBytes((Int16)masterKeyPathBytes.Length); + + // Encrypt the plain text + byte[] cipherText = RSAEncrypt(rsaCngProvider, columnEncryptionKey); + byte[] cipherTextLength = BitConverter.GetBytes((Int16)cipherText.Length); + Debug.Assert(cipherText.Length == keySizeInBytes, @"cipherText length does not match the RSA key size"); + + // Compute hash + // SHA-2-256(version + keyPathLength + ciphertextLength + keyPath + ciphertext) + byte[] hash; + using (SHA256Cng sha256 = new SHA256Cng()) + { + sha256.TransformBlock(version, 0, version.Length, version, 0); + sha256.TransformBlock(keyPathLength, 0, keyPathLength.Length, keyPathLength, 0); + sha256.TransformBlock(cipherTextLength, 0, cipherTextLength.Length, cipherTextLength, 0); + sha256.TransformBlock(masterKeyPathBytes, 0, masterKeyPathBytes.Length, masterKeyPathBytes, 0); + sha256.TransformFinalBlock(cipherText, 0, cipherText.Length); + hash = sha256.Hash; + } + + // Sign the hash + byte[] signedHash = RSASignHashedData(hash, rsaCngProvider); + Debug.Assert(signedHash.Length == keySizeInBytes, @"signed hash length does not match the RSA key size"); + Debug.Assert(RSAVerifySignature(hash, signedHash, rsaCngProvider), @"Invalid signature of the encrypted column encryption key computed."); + + // Construct the encrypted column encryption key + // EncryptedColumnEncryptionKey = version + keyPathLength + ciphertextLength + keyPath + ciphertext + signature + int encryptedColumnEncryptionKeyLength = version.Length + cipherTextLength.Length + keyPathLength.Length + cipherText.Length + masterKeyPathBytes.Length + signedHash.Length; + byte[] encryptedColumnEncryptionKey = new byte[encryptedColumnEncryptionKeyLength]; + + // Copy version byte + int currentIndex = 0; + Buffer.BlockCopy(version, 0, encryptedColumnEncryptionKey, currentIndex, version.Length); + currentIndex += version.Length; + + // Copy key path length + Buffer.BlockCopy(keyPathLength, 0, encryptedColumnEncryptionKey, currentIndex, keyPathLength.Length); + currentIndex += keyPathLength.Length; + + // Copy ciphertext length + Buffer.BlockCopy(cipherTextLength, 0, encryptedColumnEncryptionKey, currentIndex, cipherTextLength.Length); + currentIndex += cipherTextLength.Length; + + // Copy key path + Buffer.BlockCopy(masterKeyPathBytes, 0, encryptedColumnEncryptionKey, currentIndex, masterKeyPathBytes.Length); + currentIndex += masterKeyPathBytes.Length; + + // Copy ciphertext + Buffer.BlockCopy(cipherText, 0, encryptedColumnEncryptionKey, currentIndex, cipherText.Length); + currentIndex += cipherText.Length; + + // copy the signature + Buffer.BlockCopy(signedHash, 0, encryptedColumnEncryptionKey, currentIndex, signedHash.Length); + + return encryptedColumnEncryptionKey; + } + + /// + /// This function validates that the encryption algorithm is RSA_OAEP and if it is not, + /// then throws an exception + /// + /// Asymmetric key encryptio algorithm + /// Indicates if ADO.NET calls or the customer calls the API + private void ValidateEncryptionAlgorithm(string encryptionAlgorithm, bool isSystemOp) + { + // This validates that the encryption algorithm is RSA_OAEP + if (null == encryptionAlgorithm) + { + throw SQL.NullKeyEncryptionAlgorithm(isSystemOp); + } + + if (!string.Equals(encryptionAlgorithm, RSAEncryptionAlgorithmWithOAEP, StringComparison.OrdinalIgnoreCase)) + { + throw SQL.InvalidKeyEncryptionAlgorithm(encryptionAlgorithm, RSAEncryptionAlgorithmWithOAEP, isSystemOp); + } + } + + /// + /// Checks if the CNG key path is Empty or Null (and raises exception if they are). + /// + /// keypath containing the CNG provider name and key name + /// Indicates if ADO.NET calls or the customer calls the API + private void ValidateNonEmptyKeyPath(string masterKeyPath, bool isSystemOp) + { + if (string.IsNullOrWhiteSpace(masterKeyPath)) + { + if (null == masterKeyPath) + { + throw SQL.NullCngKeyPath(isSystemOp); + } + else + { + throw SQL.InvalidCngPath(masterKeyPath, isSystemOp); + } + } + } + + /// + /// Encrypt the text using specified CNG key. + /// + /// RSA CNG Provider. + /// Plain text Column Encryption Key. + /// Returns an encrypted blob or throws an exception if there are any errors. + private byte[] RSAEncrypt(RSACng rsaCngProvider, byte[] columnEncryptionKey) + { + Debug.Assert(columnEncryptionKey != null); + Debug.Assert(rsaCngProvider != null); + + return rsaCngProvider.Encrypt(columnEncryptionKey, RSAEncryptionPadding.OaepSHA1); + } + + /// + /// Decrypt the text using the specified CNG key. + /// + /// RSA CNG Provider. + /// Encrypted Column Encryption Key. + /// Returns the decrypted plaintext Column Encryption Key or throws an exception if there are any errors. + private byte[] RSADecrypt(RSACng rsaCngProvider, byte[] encryptedColumnEncryptionKey) + { + Debug.Assert((encryptedColumnEncryptionKey != null) && (encryptedColumnEncryptionKey.Length != 0)); + Debug.Assert(rsaCngProvider != null); + + return rsaCngProvider.Decrypt(encryptedColumnEncryptionKey, RSAEncryptionPadding.OaepSHA1); + } + + /// + /// Generates signature based on RSA PKCS#v1.5 scheme using a specified CNG Key. + /// + /// Text to sign. + /// RSA CNG Provider. + /// Signature + private byte[] RSASignHashedData(byte[] dataToSign, RSACng rsaCngProvider) + { + Debug.Assert((dataToSign != null) && (dataToSign.Length != 0)); + Debug.Assert(rsaCngProvider != null); + + return rsaCngProvider.SignData(dataToSign, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); + } + + /// + /// Verifies the given RSA PKCSv1.5 signature. + /// + /// + /// + /// RSA CNG Provider. + /// true if signature is valid, false if it is not valid + private bool RSAVerifySignature(byte[] dataToVerify, byte[] signature, RSACng rsaCngProvider) + { + Debug.Assert((dataToVerify != null) && (dataToVerify.Length != 0)); + Debug.Assert((signature != null) && (signature.Length != 0)); + Debug.Assert(rsaCngProvider != null); + + return rsaCngProvider.VerifyData(dataToVerify, signature, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); + } + + /// + /// Gets the public Key size in bytes + /// + /// RSA CNG Provider. + /// Key size in bytes + private int GetKeySize(RSACng rsaCngProvider) + { + Debug.Assert(rsaCngProvider != null); + + return rsaCngProvider.KeySize / 8; // Convert from bits to byte + } + + /// + /// Creates a RSACng object from the given keyName + /// + /// + /// Indicates if ADO.NET calls or the customer calls the API + /// + private RSACng CreateRSACngProvider(string keyPath, bool isSystemOp) + { + // Get CNGProvider and the KeyID + string cngProviderName; + string keyIdentifier; + GetCngProviderAndKeyId(keyPath, isSystemOp, out cngProviderName, out keyIdentifier); + + CngProvider cngProvider = new CngProvider(cngProviderName); + CngKey cngKey; + + try + { + cngKey = CngKey.Open(keyIdentifier, cngProvider); + } + catch (CryptographicException) + { + throw SQL.InvalidCngKey(keyPath, cngProviderName, keyIdentifier, isSystemOp); + } + + return new RSACng(cngKey); + } + + /// + /// Extracts the CNG provider and key name from the key path + /// + /// keypath in the format [CNG Provider]\[KeyName] + /// Indicates if ADO.NET calls or the customer calls the API + /// CNG Provider + /// Key identifier inside the CNG provider + private void GetCngProviderAndKeyId(string keyPath, bool isSystemOp, out string cngProvider, out string keyIdentifier) + { + int indexOfSlash = keyPath.IndexOf(@"/"); + if (indexOfSlash == -1) + { + throw SQL.InvalidCngPath(keyPath, isSystemOp); + } + + cngProvider = keyPath.Substring(0, indexOfSlash); + keyIdentifier = keyPath.Substring(indexOfSlash + 1, keyPath.Length - (indexOfSlash + 1)); + + if (cngProvider.Length == 0) + { + throw SQL.EmptyCngName(keyPath, isSystemOp); + } + + if (keyIdentifier.Length == 0) + { + throw SQL.EmptyCngKeyId(keyPath, isSystemOp); + } + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCspProvider.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCspProvider.cs new file mode 100644 index 0000000000..19ac621b38 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionCspProvider.cs @@ -0,0 +1,462 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + using System; + using System.Text; + using System.Data.Common; + using System.Diagnostics; + using System.Globalization; + using System.Security; + using System.Security.Cryptography; + using Microsoft.Win32; + + /// + /// Provides implementation similar to certificate store provider. + /// A CEK encrypted with certificate store provider should be decryptable by this provider and vice versa. + /// + /// Envolope Format for the encrypted column encryption key + /// version + keyPathLength + ciphertextLength + keyPath + ciphertext + signature + /// version: A single byte indicating the format version. + /// keyPathLength: Length of the keyPath. + /// ciphertextLength: ciphertext length + /// keyPath: keyPath used to encrypt the column encryption key. This is only used for troubleshooting purposes and is not verified during decryption. + /// ciphertext: Encrypted column encryption key + /// signature: Signature of the entire byte array. Signature is validated before decrypting the column encryption key. + /// + public class SqlColumnEncryptionCspProvider : SqlColumnEncryptionKeyStoreProvider + { + /// + /// Name for the CSP key store provider. + /// + public const string ProviderName = @"MSSQL_CSP_PROVIDER"; + + /// + /// RSA_OAEP is the only algorithm supported for encrypting/decrypting column encryption keys using this provider. + /// For now, we are keeping all the providers in [....]. + /// + private const string RSAEncryptionAlgorithmWithOAEP = @"RSA_OAEP"; + + /// + /// Hashing algoirthm used for signing + /// + private const string HashingAlgorithm = @"SHA256"; + + /// + /// Algorithm version + /// + private readonly byte[] _version = new byte[] { 0x01 }; + + /// + /// This function uses the asymmetric key specified by the key path + /// and decrypts an encrypted CEK with RSA encryption algorithm. + /// + /// Complete path of an asymmetric key in CSP + /// Asymmetric Key Encryption Algorithm + /// Encrypted Column Encryption Key + /// Plain text column encryption key + public override byte[] DecryptColumnEncryptionKey(string masterKeyPath, string encryptionAlgorithm, byte[] encryptedColumnEncryptionKey) + { + // Validate the input parameters + ValidateNonEmptyCSPKeyPath(masterKeyPath, isSystemOp: true); + + if (null == encryptedColumnEncryptionKey) + { + throw SQL.NullEncryptedColumnEncryptionKey(); + } + + if (0 == encryptedColumnEncryptionKey.Length) + { + throw SQL.EmptyEncryptedColumnEncryptionKey(); + } + + // Validate encryptionAlgorithm + ValidateEncryptionAlgorithm(encryptionAlgorithm, isSystemOp: true); + + // Create RSA Provider with the given CSP name and key name + RSACryptoServiceProvider rsaProvider = CreateRSACryptoProvider(masterKeyPath, isSystemOp: true); + + // Validate whether the key is RSA one or not and then get the key size + int keySizeInBytes = GetKeySize(rsaProvider); + + // Validate and decrypt the EncryptedColumnEncryptionKey + // Format is + // version + keyPathLength + ciphertextLength + keyPath + ciphervtext + signature + // + // keyPath is present in the encrypted column encryption key for identifying the original source of the asymmetric key pair and + // we will not validate it against the data contained in the CMK metadata (masterKeyPath). + + // Validate the version byte + if (encryptedColumnEncryptionKey[0] != _version[0]) + { + throw SQL.InvalidAlgorithmVersionInEncryptedCEK(encryptedColumnEncryptionKey[0], _version[0]); + } + + // Get key path length + int currentIndex = _version.Length; + UInt16 keyPathLength = BitConverter.ToUInt16(encryptedColumnEncryptionKey, currentIndex); + currentIndex += sizeof(UInt16); + + // Get ciphertext length + UInt16 cipherTextLength = BitConverter.ToUInt16(encryptedColumnEncryptionKey, currentIndex); + currentIndex += sizeof(UInt16); + + // Skip KeyPath + // KeyPath exists only for troubleshooting purposes and doesnt need validation. + currentIndex += keyPathLength; + + // validate the ciphertext length + if (cipherTextLength != keySizeInBytes) + { + throw SQL.InvalidCiphertextLengthInEncryptedCEKCsp(cipherTextLength, keySizeInBytes, masterKeyPath); + } + + // Validate the signature length + // Signature length should be same as the key side for RSA PKCSv1.5 + int signatureLength = encryptedColumnEncryptionKey.Length - currentIndex - cipherTextLength; + if (signatureLength != keySizeInBytes) + { + throw SQL.InvalidSignatureInEncryptedCEKCsp(signatureLength, keySizeInBytes, masterKeyPath); + } + + // Get ciphertext + byte[] cipherText = new byte[cipherTextLength]; + Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, cipherText, 0, cipherText.Length); + currentIndex += cipherTextLength; + + // Get signature + byte[] signature = new byte[signatureLength]; + Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, signature, 0, signature.Length); + + // Compute the hash to validate the signature + byte[] hash; + using (SHA256Cng sha256 = new SHA256Cng()) + { + sha256.TransformFinalBlock(encryptedColumnEncryptionKey, 0, encryptedColumnEncryptionKey.Length - signature.Length); + hash = sha256.Hash; + } + + Debug.Assert(hash != null, @"hash should not be null while decrypting encrypted column encryption key."); + + // Validate the signature + if (!RSAVerifySignature(hash, signature, rsaProvider)) + { + throw SQL.InvalidSignature(masterKeyPath); + } + + // Decrypt the CEK + return RSADecrypt(rsaProvider, cipherText); + } + + /// + /// This function uses the asymmetric key specified by the key path + /// and encrypts CEK with RSA encryption algorithm. + /// + /// Complete path of an asymmetric key in AKV + /// Asymmetric Key Encryption Algorithm + /// Plain text column encryption key + /// Encrypted column encryption key + public override byte[] EncryptColumnEncryptionKey(string masterKeyPath, string encryptionAlgorithm, byte[] columnEncryptionKey) + { + // Validate the input parameters + ValidateNonEmptyCSPKeyPath(masterKeyPath, isSystemOp: false); + + if (null == columnEncryptionKey) + { + throw SQL.NullColumnEncryptionKey(); + } + else if (0 == columnEncryptionKey.Length) + { + throw SQL.EmptyColumnEncryptionKey(); + } + + // Validate encryptionAlgorithm + ValidateEncryptionAlgorithm(encryptionAlgorithm, isSystemOp: false); + + // Create RSA Provider with the given CSP name and key name + RSACryptoServiceProvider rsaProvider = CreateRSACryptoProvider(masterKeyPath, isSystemOp: false); + + // Validate whether the key is RSA one or not and then get the key size + int keySizeInBytes = GetKeySize(rsaProvider); + + // Construct the encryptedColumnEncryptionKey + // Format is + // version + keyPathLength + ciphertextLength + ciphertext + keyPath + signature + // + // We currently only support one version + byte[] version = new byte[] { _version[0] }; + + // Get the Unicode encoded bytes of cultureinvariant lower case masterKeyPath + byte[] masterKeyPathBytes = Encoding.Unicode.GetBytes(masterKeyPath.ToLowerInvariant()); + byte[] keyPathLength = BitConverter.GetBytes((Int16)masterKeyPathBytes.Length); + + // Encrypt the plain text + byte[] cipherText = RSAEncrypt(rsaProvider, columnEncryptionKey); + byte[] cipherTextLength = BitConverter.GetBytes((Int16)cipherText.Length); + Debug.Assert(cipherText.Length == keySizeInBytes, @"cipherText length does not match the RSA key size"); + + // Compute hash + // SHA-2-256(version + keyPathLength + ciphertextLength + keyPath + ciphertext) + byte[] hash; + using (SHA256Cng sha256 = new SHA256Cng()) + { + sha256.TransformBlock(version, 0, version.Length, version, 0); + sha256.TransformBlock(keyPathLength, 0, keyPathLength.Length, keyPathLength, 0); + sha256.TransformBlock(cipherTextLength, 0, cipherTextLength.Length, cipherTextLength, 0); + sha256.TransformBlock(masterKeyPathBytes, 0, masterKeyPathBytes.Length, masterKeyPathBytes, 0); + sha256.TransformFinalBlock(cipherText, 0, cipherText.Length); + hash = sha256.Hash; + } + + // Sign the hash + byte[] signedHash = RSASignHashedData(hash, rsaProvider); + Debug.Assert(signedHash.Length == keySizeInBytes, @"signed hash length does not match the RSA key size"); + Debug.Assert(RSAVerifySignature(hash, signedHash, rsaProvider), @"Invalid signature of the encrypted column encryption key computed."); + + // Construct the encrypted column encryption key + // EncryptedColumnEncryptionKey = version + keyPathLength + ciphertextLength + keyPath + ciphertext + signature + int encryptedColumnEncryptionKeyLength = version.Length + cipherTextLength.Length + keyPathLength.Length + cipherText.Length + masterKeyPathBytes.Length + signedHash.Length; + byte[] encryptedColumnEncryptionKey = new byte[encryptedColumnEncryptionKeyLength]; + + // Copy version byte + int currentIndex = 0; + Buffer.BlockCopy(version, 0, encryptedColumnEncryptionKey, currentIndex, version.Length); + currentIndex += version.Length; + + // Copy key path length + Buffer.BlockCopy(keyPathLength, 0, encryptedColumnEncryptionKey, currentIndex, keyPathLength.Length); + currentIndex += keyPathLength.Length; + + // Copy ciphertext length + Buffer.BlockCopy(cipherTextLength, 0, encryptedColumnEncryptionKey, currentIndex, cipherTextLength.Length); + currentIndex += cipherTextLength.Length; + + // Copy key path + Buffer.BlockCopy(masterKeyPathBytes, 0, encryptedColumnEncryptionKey, currentIndex, masterKeyPathBytes.Length); + currentIndex += masterKeyPathBytes.Length; + + // Copy ciphertext + Buffer.BlockCopy(cipherText, 0, encryptedColumnEncryptionKey, currentIndex, cipherText.Length); + currentIndex += cipherText.Length; + + // copy the signature + Buffer.BlockCopy(signedHash, 0, encryptedColumnEncryptionKey, currentIndex, signedHash.Length); + + return encryptedColumnEncryptionKey; + } + + /// + /// This function validates that the encryption algorithm is RSA_OAEP and if it is not, + /// then throws an exception + /// + /// Asymmetric key encryptio algorithm + /// Indicates if ADO.NET calls or the customer calls the API + private void ValidateEncryptionAlgorithm(string encryptionAlgorithm, bool isSystemOp) + { + // This validates that the encryption algorithm is RSA_OAEP + if (null == encryptionAlgorithm) + { + throw SQL.NullKeyEncryptionAlgorithm(isSystemOp); + } + + if (string.Equals(encryptionAlgorithm, RSAEncryptionAlgorithmWithOAEP, StringComparison.OrdinalIgnoreCase) != true) + { + throw SQL.InvalidKeyEncryptionAlgorithm(encryptionAlgorithm, RSAEncryptionAlgorithmWithOAEP, isSystemOp); + } + } + + + /// + /// Checks if the CSP key path is Empty or Null (and raises exception if they are). + /// + /// CSP key path. + /// Indicates if ADO.NET calls or the customer calls the API + private void ValidateNonEmptyCSPKeyPath(string masterKeyPath, bool isSystemOp) + { + if (string.IsNullOrWhiteSpace(masterKeyPath)) + { + if (null == masterKeyPath) + { + throw SQL.NullCspKeyPath(isSystemOp); + } + else + { + throw SQL.InvalidCspPath(masterKeyPath, isSystemOp); + } + } + } + + /// + /// Encrypt the text using specified CSP key. + /// + /// CSP key path. + /// Encryption Algorithm. + /// Plain text Column Encryption Key. + /// Returns an encrypted blob or throws an exception if there are any errors. + private byte[] RSAEncrypt(RSACryptoServiceProvider rscp, byte[] columnEncryptionKey) + { + Debug.Assert(columnEncryptionKey != null); + Debug.Assert(rscp != null); + + return rscp.Encrypt(columnEncryptionKey, fOAEP: true); + } + + /// + /// Decrypt the text using specified CSP key. + /// + /// CSP key url. + /// Encryption Algorithm. + /// Encrypted Column Encryption Key. + /// Returns the decrypted plaintext Column Encryption Key or throws an exception if there are any errors. + private byte[] RSADecrypt(RSACryptoServiceProvider rscp, byte[] encryptedColumnEncryptionKey) + { + Debug.Assert((encryptedColumnEncryptionKey != null) && (encryptedColumnEncryptionKey.Length != 0)); + Debug.Assert(rscp != null); + + return rscp.Decrypt(encryptedColumnEncryptionKey, fOAEP: true); + } + + /// + /// Generates signature based on RSA PKCS#v1.5 scheme using a specified CSP Key URL. + /// + /// Text to sign. + /// RSA Provider with a given key + /// Signature + private byte[] RSASignHashedData(byte[] dataToSign, RSACryptoServiceProvider rscp) + { + Debug.Assert((dataToSign != null) && (dataToSign.Length != 0)); + Debug.Assert(rscp != null); + + return rscp.SignData(dataToSign, HashingAlgorithm); + } + + /// + /// Verifies the given RSA PKCSv1.5 signature. + /// + /// + /// + /// RSA Provider with a given key + /// true if signature is valid, false if it is not valid + private bool RSAVerifySignature(byte[] dataToVerify, byte[] signature, RSACryptoServiceProvider rscp) + { + Debug.Assert((dataToVerify != null) && (dataToVerify.Length != 0)); + Debug.Assert((signature != null) && (signature.Length != 0)); + Debug.Assert(rscp != null); + + return rscp.VerifyData(dataToVerify, HashingAlgorithm, signature); + } + + /// + /// Gets the public Key size in bytes + /// + /// RSA Provider with a given key + /// Key size in bytes + private int GetKeySize(RSACryptoServiceProvider rscp) + { + Debug.Assert(rscp != null); + + return rscp.KeySize / 8; + } + + /// + /// Creates a RSACryptoServiceProvider from the given key path which contains both CSP name and key name + /// + /// key path in the format of [CAPI provider name]\[key name] + /// Indicates if ADO.NET calls or the customer calls the API + /// + private RSACryptoServiceProvider CreateRSACryptoProvider(string keyPath, bool isSystemOp) + { + // Get CNGProvider and the KeyID + string cspProviderName; + string keyName; + GetCspProviderAndKeyName(keyPath, isSystemOp, out cspProviderName, out keyName); + + // Verify the existence of CSP and then get the provider type + int providerType = GetProviderType(cspProviderName, keyPath, isSystemOp); + + // Create a new instance of CspParameters for an RSA container. + CspParameters cspParams = new CspParameters(providerType, cspProviderName, keyName); + cspParams.Flags = CspProviderFlags.UseExistingKey; + + RSACryptoServiceProvider rscp = null; + + try + { + //Create a new instance of RSACryptoServiceProvider + rscp = new RSACryptoServiceProvider(cspParams); + } + catch (CryptographicException e) + { + const int KEYSETDOESNOTEXIST = -2146893802; + if (e.HResult == KEYSETDOESNOTEXIST) + { + // Key does not exist + throw SQL.InvalidCspKeyIdentifier(keyName, keyPath, isSystemOp); + } + else + { + // bubble up the exception + throw; + } + } + + return rscp; + } + + /// + /// Extracts the CSP provider name and key name from the given key path + /// + /// key path in the format of [CSP provider name]\[key name] + /// Indicates if ADO.NET calls or the customer calls the API + /// output containing the CSP provider name + /// output containing the key name + private void GetCspProviderAndKeyName(string keyPath, bool isSystemOp, out string cspProviderName, out string keyIdentifier) + { + int indexOfSlash = keyPath.IndexOf(@"/"); + if (indexOfSlash == -1) + { + throw SQL.InvalidCspPath(keyPath, isSystemOp); + } + + cspProviderName = keyPath.Substring(0, indexOfSlash); + keyIdentifier = keyPath.Substring(indexOfSlash + 1, keyPath.Length - (indexOfSlash + 1)); + + if (cspProviderName.Length == 0) + { + throw SQL.EmptyCspName(keyPath, isSystemOp); + } + + if (keyIdentifier.Length == 0) + { + throw SQL.EmptyCspKeyId(keyPath, isSystemOp); + } + } + + /// + /// Gets the provider type from a given CAPI provider name + /// + /// CAPI provider name + /// key path in the format of [CSP provider name]\[key name] + /// Indicates if ADO.NET calls or the customer calls the API + /// + private int GetProviderType(string providerName, string keyPath, bool isSystemOp) + { + string keyName = String.Format(@"SOFTWARE\Microsoft\Cryptography\Defaults\Provider\{0}", providerName); + RegistryKey key = Registry.LocalMachine.OpenSubKey(keyName); + if (key == null) + { + throw SQL.InvalidCspName(providerName, keyPath, isSystemOp); + } + + int providerType = (int)key.GetValue(@"Type"); + key.Close(); + + return providerType; + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionKeyStoreProvider.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionKeyStoreProvider.cs new file mode 100644 index 0000000000..afcf970bc4 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlColumnEncryptionKeyStoreProvider.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + using System; + + /// + /// Abstract base class for all column encryption Key Store providers. It exposes two functions + /// 1. DecryptColumnEncryptionKey - This is the function used by SqlClient under the covers to decrypt encrypted column encryption key blob. + /// 2. EncryptColumnEncryptionKey - This will be used by client tools that generate DDL for customers + /// + public abstract class SqlColumnEncryptionKeyStoreProvider + { + /// + /// This function must be implemented by the corresponding Key Store providers. This function should use an asymmetric key identified by the key path + /// and decrypt an encrypted column encryption key with a given encryption algorithm. + /// + /// Complete path of an asymmetric key. Path format is specific to a key store provider. + /// Asymmetric Key Encryption Algorithm + /// Encrypted Column Encryption Key + /// Plain text column encryption key + public abstract byte[] DecryptColumnEncryptionKey(string masterKeyPath, string encryptionAlgorithm, byte[] encryptedColumnEncryptionKey); + + /// + /// This function must be implemented by the corresponding Key Store providers. This function should use an asymmetric key identified by a key path + /// and encrypt a plain text column encryption key with a given asymmetric key encryption algorithm. + /// + /// Complete path of an asymmetric key. Path format is specific to a key store provider. + /// Asymmetric Key Encryption Algorithm + /// Plain text column encryption key to be encrypted + /// Encrypted column encryption key + public abstract byte[] EncryptColumnEncryptionKey(string masterKeyPath, string encryptionAlgorithm, byte[] columnEncryptionKey); + } +} \ No newline at end of file diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlCommand.cs.REMOVED.git-id b/external/referencesource/System.Data/System/Data/SqlClient/SqlCommand.cs.REMOVED.git-id index 70f1b89d7b..cb4f707c15 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlCommand.cs.REMOVED.git-id +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlCommand.cs.REMOVED.git-id @@ -1 +1 @@ -3079ff01518b29dae0a29e6e9b2b0d9efaeaa68e \ No newline at end of file +2e560dbf344a2a5ef4577863f3342dc13d2498de \ No newline at end of file diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlCommandSet.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlCommandSet.cs index eaf2f2a88a..b15a5353bb 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlCommandSet.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlCommandSet.cs @@ -35,13 +35,15 @@ namespace System.Data.SqlClient { internal readonly SqlParameterCollection Parameters; internal readonly int ReturnParameterIndex; internal readonly CommandType CmdType; + internal readonly SqlCommandColumnEncryptionSetting ColumnEncryptionSetting; - internal LocalCommand(string commandText, SqlParameterCollection parameters, int returnParameterIndex, CommandType cmdType) { + internal LocalCommand(string commandText, SqlParameterCollection parameters, int returnParameterIndex, CommandType cmdType, SqlCommandColumnEncryptionSetting columnEncryptionSetting) { Debug.Assert(0 <= commandText.Length, "no text"); this.CommandText = commandText; this.Parameters = parameters; this.ReturnParameterIndex = returnParameterIndex; this.CmdType = cmdType; + this.ColumnEncryptionSetting = columnEncryptionSetting; } } @@ -197,7 +199,7 @@ namespace System.Data.SqlClient { } } } - LocalCommand cmd = new LocalCommand(cmdText, parameters, returnParameterIndex, command.CommandType); + LocalCommand cmd = new LocalCommand(cmdText, parameters, returnParameterIndex, command.CommandType, command.ColumnEncryptionSetting); CommandList.Add(cmd); } @@ -260,7 +262,7 @@ namespace System.Data.SqlClient { BatchCommand.Parameters.Clear(); for (int ii = 0 ; ii < _commandList.Count; ii++) { LocalCommand cmd = _commandList[ii]; - BatchCommand.AddBatchCommand(cmd.CommandText, cmd.Parameters, cmd.CmdType); + BatchCommand.AddBatchCommand(cmd.CommandText, cmd.Parameters, cmd.CmdType, cmd.ColumnEncryptionSetting); } return BatchCommand.ExecuteBatchRPCCommand(); } diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlConnection.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlConnection.cs deleted file mode 100644 index ac04c011fb..0000000000 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlConnection.cs +++ /dev/null @@ -1,2248 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// [....] -// [....] -//------------------------------------------------------------------------------ - -[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("System.Data.DataSetExtensions, PublicKey="+AssemblyRef.EcmaPublicKeyFull)] // DevDiv Bugs 92166 - -namespace System.Data.SqlClient -{ - using System; - using System.Collections; - using System.Configuration.Assemblies; - using System.ComponentModel; - using System.Data; - using System.Data.Common; - using System.Data.ProviderBase; - using System.Data.Sql; - using System.Data.SqlTypes; - using System.Diagnostics; - using System.Globalization; - using System.IO; - using System.Runtime.CompilerServices; - using System.Runtime.ConstrainedExecution; - using System.Runtime.InteropServices; - using System.Runtime.Remoting; - using System.Runtime.Serialization.Formatters; - using System.Text; - using System.Threading; - using System.Threading.Tasks; - using System.Security; - using System.Security.Permissions; - using System.Reflection; - using System.Runtime.Versioning; - - using Microsoft.SqlServer.Server; - using System.Security.Principal; - using System.Diagnostics.CodeAnalysis; - - [DefaultEvent("InfoMessage")] - public sealed partial class SqlConnection: DbConnection, ICloneable { - - static private readonly object EventInfoMessage = new object(); - - private SqlDebugContext _sdc; // SQL Debugging support - - private bool _AsyncCommandInProgress; - - // SQLStatistics support - internal SqlStatistics _statistics; - private bool _collectstats; - - private bool _fireInfoMessageEventOnUserErrors; // False by default - - // root task associated with current async invocation - Tuple, Task> _currentCompletion; - - private SqlCredential _credential; // SQL authentication password stored in SecureString - private string _connectionString; - private int _connectRetryCount; - - // connection resiliency - private object _reconnectLock = new object(); - internal Task _currentReconnectionTask; - private Task _asyncWaitingForReconnection; // current async task waiting for reconnection in non-MARS connections - private Guid _originalConnectionId = Guid.Empty; - private CancellationTokenSource _reconnectionCancellationSource; - internal SessionData _recoverySessionData; - internal WindowsIdentity _lastIdentity; - internal WindowsIdentity _impersonateIdentity; - private int _reconnectCount; - - public SqlConnection(string connectionString) : this(connectionString, null) { - } - - public SqlConnection(string connectionString, SqlCredential credential) : this() { - ConnectionString = connectionString; // setting connection string first so that ConnectionOption is available - if (credential != null) - { - // The following checks are necessary as setting Credential property will call CheckAndThrowOnInvalidCombinationOfConnectionStringAndSqlCredential - // CheckAndThrowOnInvalidCombinationOfConnectionStringAndSqlCredential it will throw InvalidOperationException rather than Arguemtn exception - // Need to call setter on Credential property rather than setting _credential directly as pool groups need to be checked - SqlConnectionString connectionOptions = (SqlConnectionString) ConnectionOptions; - if (UsesClearUserIdOrPassword(connectionOptions)) - { - throw ADP.InvalidMixedArgumentOfSecureAndClearCredential(); - } - - if (UsesIntegratedSecurity(connectionOptions)) - { - throw ADP.InvalidMixedArgumentOfSecureCredentialAndIntegratedSecurity(); - } - - if (UsesContextConnection(connectionOptions)) - { - throw ADP.InvalidMixedArgumentOfSecureCredentialAndContextConnection(); - } - - Credential = credential; - } - // else - // credential == null: we should not set "Credential" as this will do additional validation check and - // checking pool groups which is not necessary. All necessary operation is already done by calling "ConnectionString = connectionString" - CacheConnectionStringProperties(); - } - - private SqlConnection(SqlConnection connection) { // Clone - GC.SuppressFinalize(this); - CopyFrom(connection); - _connectionString = connection._connectionString; - if (connection._credential != null) - { - SecureString password = connection._credential.Password.Copy(); - password.MakeReadOnly(); - _credential = new SqlCredential(connection._credential.UserId, password); - } - CacheConnectionStringProperties(); - } - - // This method will be called once connection string is set or changed. - private void CacheConnectionStringProperties() { - SqlConnectionString connString = ConnectionOptions as SqlConnectionString; - if (connString != null) { - _connectRetryCount = connString.ConnectRetryCount; - } - } - - // - // PUBLIC PROPERTIES - // - - // used to start/stop collection of statistics data and do verify the current state - // - // devnote: start/stop should not performed using a property since it requires execution of code - // - // start statistics - // set the internal flag (_statisticsEnabled) to true. - // Create a new SqlStatistics object if not already there. - // connect the parser to the object. - // if there is no parser at this time we need to connect it after creation. - // - - [ - DefaultValue(false), - ResCategoryAttribute(Res.DataCategory_Data), - ResDescriptionAttribute(Res.SqlConnection_StatisticsEnabled), - ] - public bool StatisticsEnabled { - get { - return (_collectstats); - } - set { - if (IsContextConnection) { - if (value) { - throw SQL.NotAvailableOnContextConnection(); - } - } - else { - if (value) { - // start - if (ConnectionState.Open == State) { - if (null == _statistics) { - _statistics = new SqlStatistics(); - ADP.TimerCurrent(out _statistics._openTimestamp); - } - // set statistics on the parser - // update timestamp; - Debug.Assert(Parser != null, "Where's the parser?"); - Parser.Statistics = _statistics; - } - } - else { - // stop - if (null != _statistics) { - if (ConnectionState.Open == State) { - // remove statistics from parser - // update timestamp; - TdsParser parser = Parser; - Debug.Assert(parser != null, "Where's the parser?"); - parser.Statistics = null; - ADP.TimerCurrent(out _statistics._closeTimestamp); - } - } - } - this._collectstats = value; - } - } - } - - internal bool AsyncCommandInProgress { - get { - return (_AsyncCommandInProgress); - } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - set { - _AsyncCommandInProgress = value; - } - } - - internal bool IsContextConnection { - get { - SqlConnectionString opt = (SqlConnectionString)ConnectionOptions; - return UsesContextConnection(opt); - } - } - - // Is this connection is a Context Connection? - private bool UsesContextConnection(SqlConnectionString opt) - { - return opt != null ? opt.ContextConnection : false; - } - - // Does this connection uses Integrated Security? - private bool UsesIntegratedSecurity(SqlConnectionString opt) { - return opt != null ? opt.IntegratedSecurity : false; - } - - // Does this connection uses old style of clear userID or Password in connection string? - private bool UsesClearUserIdOrPassword(SqlConnectionString opt) { - bool result = false; - if (null != opt) { - result = (!ADP.IsEmpty(opt.UserID) || !ADP.IsEmpty(opt.Password)); - } - return result; - } - - internal SqlConnectionString.TransactionBindingEnum TransactionBinding { - get { - return ((SqlConnectionString)ConnectionOptions).TransactionBinding; - } - } - - internal SqlConnectionString.TypeSystem TypeSystem { - get { - return ((SqlConnectionString)ConnectionOptions).TypeSystemVersion; - } - } - - internal Version TypeSystemAssemblyVersion { - get { - return ((SqlConnectionString)ConnectionOptions).TypeSystemAssemblyVersion; - } - } - - internal int ConnectRetryInterval { - get { - return ((SqlConnectionString)ConnectionOptions).ConnectRetryInterval; - } - } - - override protected DbProviderFactory DbProviderFactory { - get { - return SqlClientFactory.Instance; - } - } - - [ - DefaultValue(""), -#pragma warning disable 618 // ignore obsolete warning about RecommendedAsConfigurable to use SettingsBindableAttribute - RecommendedAsConfigurable(true), -#pragma warning restore 618 - SettingsBindableAttribute(true), - RefreshProperties(RefreshProperties.All), - ResCategoryAttribute(Res.DataCategory_Data), - Editor("Microsoft.VSDesigner.Data.SQL.Design.SqlConnectionStringEditor, " + AssemblyRef.MicrosoftVSDesigner, "System.Drawing.Design.UITypeEditor, " + AssemblyRef.SystemDrawing), - ResDescriptionAttribute(Res.SqlConnection_ConnectionString), - ] - override public string ConnectionString { - get { - return ConnectionString_Get(); - } - set { - if (_credential != null) - { - SqlConnectionString connectionOptions = new SqlConnectionString(value); - CheckAndThrowOnInvalidCombinationOfConnectionStringAndSqlCredential(connectionOptions); - } - - ConnectionString_Set(new SqlConnectionPoolKey(value, _credential)); - _connectionString = value; // Change _connectionString value only after value is validated - CacheConnectionStringProperties(); - } - } - - [ - DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), - ResDescriptionAttribute(Res.SqlConnection_ConnectionTimeout), - ] - override public int ConnectionTimeout { - get { - SqlConnectionString constr = (SqlConnectionString)ConnectionOptions; - return ((null != constr) ? constr.ConnectTimeout : SqlConnectionString.DEFAULT.Connect_Timeout); - } - } - - [ - DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), - ResDescriptionAttribute(Res.SqlConnection_Database), - ] - override public string Database { - // if the connection is open, we need to ask the inner connection what it's - // current catalog is because it may have gotten changed, otherwise we can - // just return what the connection string had. - get { - SqlInternalConnection innerConnection = (InnerConnection as SqlInternalConnection); - string result; - - if (null != innerConnection) { - result = innerConnection.CurrentDatabase; - } - else { - SqlConnectionString constr = (SqlConnectionString)ConnectionOptions; - result = ((null != constr) ? constr.InitialCatalog : SqlConnectionString.DEFAULT.Initial_Catalog); - } - return result; - } - } - - [ - Browsable(true), - DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), - ResDescriptionAttribute(Res.SqlConnection_DataSource), - ] - override public string DataSource { - get { - SqlInternalConnection innerConnection = (InnerConnection as SqlInternalConnection); - string result; - - if (null != innerConnection) { - result = innerConnection.CurrentDataSource; - } - else { - SqlConnectionString constr = (SqlConnectionString)ConnectionOptions; - result = ((null != constr) ? constr.DataSource : SqlConnectionString.DEFAULT.Data_Source); - } - return result; - } - } - - [ - DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), - ResCategoryAttribute(Res.DataCategory_Data), - ResDescriptionAttribute(Res.SqlConnection_PacketSize), - ] - public int PacketSize { - // if the connection is open, we need to ask the inner connection what it's - // current packet size is because it may have gotten changed, otherwise we - // can just return what the connection string had. - get { - if (IsContextConnection) { - throw SQL.NotAvailableOnContextConnection(); - } - - SqlInternalConnectionTds innerConnection = (InnerConnection as SqlInternalConnectionTds); - int result; - - if (null != innerConnection) { - result = innerConnection.PacketSize; - } - else { - SqlConnectionString constr = (SqlConnectionString)ConnectionOptions; - result = ((null != constr) ? constr.PacketSize : SqlConnectionString.DEFAULT.Packet_Size); - } - return result; - } - } - - [ - DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), - ResCategoryAttribute(Res.DataCategory_Data), - ResDescriptionAttribute(Res.SqlConnection_ClientConnectionId), - ] - public Guid ClientConnectionId { - get { - - SqlInternalConnectionTds innerConnection = (InnerConnection as SqlInternalConnectionTds); - - if (null != innerConnection) { - return innerConnection.ClientConnectionId; - } - else { - Task reconnectTask = _currentReconnectionTask; - if (reconnectTask != null && !reconnectTask.IsCompleted) { - return _originalConnectionId; - } - return Guid.Empty; - } - } - } - - [ - Browsable(false), - DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), - ResDescriptionAttribute(Res.SqlConnection_ServerVersion), - ] - override public string ServerVersion { - get { - return GetOpenConnection().ServerVersion; - } - } - - [ - Browsable(false), - DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), - ResDescriptionAttribute(Res.DbConnection_State), - ] - override public ConnectionState State { - get { - Task reconnectTask=_currentReconnectionTask; - if (reconnectTask != null && !reconnectTask.IsCompleted) { - return ConnectionState.Open; - } - return InnerConnection.State; - } - } - - - internal SqlStatistics Statistics { - get { - return _statistics; - } - } - - [ - DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), - ResCategoryAttribute(Res.DataCategory_Data), - ResDescriptionAttribute(Res.SqlConnection_WorkstationId), - ] - public string WorkstationId { - get { - if (IsContextConnection) { - throw SQL.NotAvailableOnContextConnection(); - } - - // If not supplied by the user, the default value is the MachineName - // Note: In Longhorn you'll be able to rename a machine without - // rebooting. Therefore, don't cache this machine name. - SqlConnectionString constr = (SqlConnectionString)ConnectionOptions; - string result = ((null != constr) ? constr.WorkstationId : null); - if (null == result) { - // getting machine name requires Environment.Permission - // user must have that permission in order to retrieve this - result = Environment.MachineName; - } - return result; - } - } - - // SqlCredential: Pair User Id and password in SecureString which are to be used for SQL authentication - [ - Browsable(false), - DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), - ResDescriptionAttribute(Res.SqlConnection_Credential), - ] - public SqlCredential Credential - { - get - { - SqlCredential result = _credential; - - // When a connection is connecting or is ever opened, make credential available only if "Persist Security Info" is set to true - // otherwise, return null - SqlConnectionString connectionOptions = (SqlConnectionString) UserConnectionOptions; - if (InnerConnection.ShouldHidePassword && connectionOptions != null && !connectionOptions.PersistSecurityInfo) - { - result = null; - } - - return result; - } - - set - { - // If a connection is connecting or is ever opened, user id/password cannot be set - if (!InnerConnection.AllowSetConnectionString) - { - throw ADP.OpenConnectionPropertySet("Credential", InnerConnection.State); - } - - // check if the usage of credential has any conflict with the keys used in connection string - if (value != null) - { - CheckAndThrowOnInvalidCombinationOfConnectionStringAndSqlCredential((SqlConnectionString) ConnectionOptions); - } - - _credential = value; - - // Need to call ConnectionString_Set to do proper pool group check - ConnectionString_Set(new SqlConnectionPoolKey(_connectionString, _credential)); - } - } - - // CheckAndThrowOnInvalidCombinationOfConnectionStringAndSqlCredential: check if the usage of credential has any conflict - // with the keys used in connection string - // If there is any conflict, it throws InvalidOperationException - // This is to be used setter of ConnectionString and Credential properties - private void CheckAndThrowOnInvalidCombinationOfConnectionStringAndSqlCredential(SqlConnectionString connectionOptions) - { - if (UsesClearUserIdOrPassword(connectionOptions)) - { - throw ADP.InvalidMixedUsageOfSecureAndClearCredential(); - } - - if (UsesIntegratedSecurity(connectionOptions)) - { - throw ADP.InvalidMixedUsageOfSecureCredentialAndIntegratedSecurity(); - } - - if (UsesContextConnection(connectionOptions)) - { - throw ADP.InvalidMixedArgumentOfSecureCredentialAndContextConnection(); - } - } - - // - // PUBLIC EVENTS - // - - [ - ResCategoryAttribute(Res.DataCategory_InfoMessage), - ResDescriptionAttribute(Res.DbConnection_InfoMessage), - ] - public event SqlInfoMessageEventHandler InfoMessage { - add { - Events.AddHandler(EventInfoMessage, value); - } - remove { - Events.RemoveHandler(EventInfoMessage, value); - } - } - - public bool FireInfoMessageEventOnUserErrors { - get { - return _fireInfoMessageEventOnUserErrors; - } - set { - _fireInfoMessageEventOnUserErrors = value; - } - } - - // Approx. number of times that the internal connection has been reconnected - internal int ReconnectCount { - get { - return _reconnectCount; - } - } - - // - // PUBLIC METHODS - // - - new public SqlTransaction BeginTransaction() { - // this is just a delegate. The actual method tracks executiontime - return BeginTransaction(IsolationLevel.Unspecified, null); - } - - new public SqlTransaction BeginTransaction(IsolationLevel iso) { - // this is just a delegate. The actual method tracks executiontime - return BeginTransaction(iso, null); - } - - public SqlTransaction BeginTransaction(string transactionName) { - // Use transaction names only on the outermost pair of nested - // BEGIN...COMMIT or BEGIN...ROLLBACK statements. Transaction names - // are ignored for nested BEGIN's. The only way to rollback a nested - // transaction is to have a save point from a SAVE TRANSACTION call. - return BeginTransaction(IsolationLevel.Unspecified, transactionName); - } - - // suppress this message - we cannot use SafeHandle here. Also, see notes in the code (VSTFDEVDIV# 560355) - [SuppressMessage("Microsoft.Reliability", "CA2004:RemoveCallsToGCKeepAlive")] - override protected DbTransaction BeginDbTransaction(IsolationLevel isolationLevel) { - IntPtr hscp; - - Bid.ScopeEnter(out hscp, " %d#, isolationLevel=%d{ds.IsolationLevel}", ObjectID, (int)isolationLevel); - try { - - DbTransaction transaction = BeginTransaction(isolationLevel); - - // VSTFDEVDIV# 560355 - InnerConnection doesn't maintain a ref on the outer connection (this) and - // subsequently leaves open the possibility that the outer connection could be GC'ed before the SqlTransaction - // is fully hooked up (leaving a DbTransaction with a null connection property). Ensure that this is reachable - // until the completion of BeginTransaction with KeepAlive - GC.KeepAlive(this); - - return transaction; - } - finally { - Bid.ScopeLeave(ref hscp); - } - } - - public SqlTransaction BeginTransaction(IsolationLevel iso, string transactionName) { - WaitForPendingReconnection(); - SqlStatistics statistics = null; - IntPtr hscp; - string xactName = ADP.IsEmpty(transactionName)? "None" : transactionName; - Bid.ScopeEnter(out hscp, " %d#, iso=%d{ds.IsolationLevel}, transactionName='%ls'\n", ObjectID, (int)iso, - xactName); - - try { - statistics = SqlStatistics.StartTimer(Statistics); - - // NOTE: we used to throw an exception if the transaction name was empty - // (see MDAC 50292) but that was incorrect because we have a BeginTransaction - // method that doesn't have a transactionName argument. - SqlTransaction transaction; - bool isFirstAttempt = true; - do { - transaction = GetOpenConnection().BeginSqlTransaction(iso, transactionName, isFirstAttempt); // do not reconnect twice - Debug.Assert(isFirstAttempt || !transaction.InternalTransaction.ConnectionHasBeenRestored, "Restored connection on non-first attempt"); - isFirstAttempt = false; - } while (transaction.InternalTransaction.ConnectionHasBeenRestored); - - - // SQLBU 503873 The GetOpenConnection line above doesn't keep a ref on the outer connection (this), - // and it could be collected before the inner connection can hook it to the transaction, resulting in - // a transaction with a null connection property. Use GC.KeepAlive to ensure this doesn't happen. - GC.KeepAlive(this); - - return transaction; - } - finally { - Bid.ScopeLeave(ref hscp); - SqlStatistics.StopTimer(statistics); - } - } - - override public void ChangeDatabase(string database) { - SqlStatistics statistics = null; - RepairInnerConnection(); - Bid.CorrelationTrace(" ObjectID%d#, ActivityID %ls\n", ObjectID); - TdsParser bestEffortCleanupTarget = null; - RuntimeHelpers.PrepareConstrainedRegions(); - try { -#if DEBUG - TdsParser.ReliabilitySection tdsReliabilitySection = new TdsParser.ReliabilitySection(); - - RuntimeHelpers.PrepareConstrainedRegions(); - try { - tdsReliabilitySection.Start(); -#else - { -#endif //DEBUG - bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(this); - statistics = SqlStatistics.StartTimer(Statistics); - InnerConnection.ChangeDatabase(database); - } -#if DEBUG - finally { - tdsReliabilitySection.Stop(); - } -#endif //DEBUG - } - catch (System.OutOfMemoryException e) { - Abort(e); - throw; - } - catch (System.StackOverflowException e) { - Abort(e); - throw; - } - catch (System.Threading.ThreadAbortException e) { - Abort(e); - SqlInternalConnection.BestEffortCleanup(bestEffortCleanupTarget); - throw; - } - finally { - SqlStatistics.StopTimer(statistics); - } - } - - static public void ClearAllPools() { - (new SqlClientPermission(PermissionState.Unrestricted)).Demand(); - SqlConnectionFactory.SingletonInstance.ClearAllPools(); - } - - static public void ClearPool(SqlConnection connection) { - ADP.CheckArgumentNull(connection, "connection"); - - DbConnectionOptions connectionOptions = connection.UserConnectionOptions; - if (null != connectionOptions) { - connectionOptions.DemandPermission(); - if (connection.IsContextConnection) { - throw SQL.NotAvailableOnContextConnection(); - } - SqlConnectionFactory.SingletonInstance.ClearPool(connection); - } - } - - object ICloneable.Clone() { - SqlConnection clone = new SqlConnection(this); - Bid.Trace(" %d#, clone=%d#\n", ObjectID, clone.ObjectID); - return clone; - } - - void CloseInnerConnection() { - // CloseConnection() now handles the lock - - // The SqlInternalConnectionTds is set to OpenBusy during close, once this happens the cast below will fail and - // the command will no longer be cancelable. It might be desirable to be able to cancel the close opperation, but this is - // outside of the scope of Whidbey RTM. See (SqlCommand::Cancel) for other lock. - InnerConnection.CloseConnection(this, ConnectionFactory); - } - - override public void Close() { - IntPtr hscp; - Bid.ScopeEnter(out hscp, " %d#" , ObjectID); - Bid.CorrelationTrace(" ObjectID%d#, ActivityID %ls\n", ObjectID); - try { - SqlStatistics statistics = null; - - TdsParser bestEffortCleanupTarget = null; - RuntimeHelpers.PrepareConstrainedRegions(); - try { -#if DEBUG - TdsParser.ReliabilitySection tdsReliabilitySection = new TdsParser.ReliabilitySection(); - - RuntimeHelpers.PrepareConstrainedRegions(); - try { - tdsReliabilitySection.Start(); -#else - { -#endif //DEBUG - bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(this); - statistics = SqlStatistics.StartTimer(Statistics); - - Task reconnectTask = _currentReconnectionTask; - if (reconnectTask != null && !reconnectTask.IsCompleted) { - CancellationTokenSource cts = _reconnectionCancellationSource; - if (cts != null) { - cts.Cancel(); - } - AsyncHelper.WaitForCompletion(reconnectTask, 0, null, rethrowExceptions: false); // we do not need to deal with possible exceptions in reconnection - if (State != ConnectionState.Open) {// if we cancelled before the connection was opened - OnStateChange(DbConnectionInternal.StateChangeClosed); - } - } - CancelOpenAndWait(); - CloseInnerConnection(); - GC.SuppressFinalize(this); - - if (null != Statistics) { - ADP.TimerCurrent(out _statistics._closeTimestamp); - } - } - #if DEBUG - finally { - tdsReliabilitySection.Stop(); - } -#endif //DEBUG - } - catch (System.OutOfMemoryException e) { - Abort(e); - throw; - } - catch (System.StackOverflowException e) { - Abort(e); - throw; - } - catch (System.Threading.ThreadAbortException e) { - Abort(e); - SqlInternalConnection.BestEffortCleanup(bestEffortCleanupTarget); - throw; - } - finally { - SqlStatistics.StopTimer(statistics); - } - } - finally { - SqlDebugContext sdc = _sdc; - _sdc = null; - Bid.ScopeLeave(ref hscp); - if (sdc != null) { - sdc.Dispose(); - } - } - } - - new public SqlCommand CreateCommand() { - return new SqlCommand(null, this); - } - - private void DisposeMe(bool disposing) { // MDAC 65459 - _credential = null; // clear credential here rather than in IDisposable.Dispose as this is only specific to SqlConnection only - // IDisposable.Dispose is generated code from a template and used by other providers as well - - if (!disposing) { - // DevDiv2 Bug 457934:SQLConnection leaks when not disposed - // http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/457934 - // For non-pooled connections we need to make sure that if the SqlConnection was not closed, then we release the GCHandle on the stateObject to allow it to be GCed - // For pooled connections, we will rely on the pool reclaiming the connection - var innerConnection = (InnerConnection as SqlInternalConnectionTds); - if ((innerConnection != null) && (!innerConnection.ConnectionOptions.Pooling)) { - var parser = innerConnection.Parser; - if ((parser != null) && (parser._physicalStateObj != null)) { - parser._physicalStateObj.DecrementPendingCallbacks(release: false); - } - } - } - } - -#if !MOBILE - public void EnlistDistributedTransaction(System.EnterpriseServices.ITransaction transaction) { - if (IsContextConnection) { - throw SQL.NotAvailableOnContextConnection(); - } - - EnlistDistributedTransactionHelper(transaction); - } -#endif - - override public void Open() { - IntPtr hscp; - Bid.ScopeEnter(out hscp, " %d#", ObjectID) ; - Bid.CorrelationTrace(" ObjectID%d#, ActivityID %ls\n", ObjectID); - - try { - if (StatisticsEnabled) { - if (null == _statistics) { - _statistics = new SqlStatistics(); - } - else { - _statistics.ContinueOnNewConnection(); - } - } - - SqlStatistics statistics = null; - RuntimeHelpers.PrepareConstrainedRegions(); - try { - statistics = SqlStatistics.StartTimer(Statistics); - - if (!TryOpen(null)) { - throw ADP.InternalError(ADP.InternalErrorCode.SynchronousConnectReturnedPending); - } - } - finally { - SqlStatistics.StopTimer(statistics); - } - } - finally { - Bid.ScopeLeave(ref hscp); - } - } - - internal void RegisterWaitingForReconnect(Task waitingTask) { - if (((SqlConnectionString)ConnectionOptions).MARS) { - return; - } - Interlocked.CompareExchange(ref _asyncWaitingForReconnection, waitingTask, null); - if (_asyncWaitingForReconnection != waitingTask) { // somebody else managed to register - throw SQL.MARSUnspportedOnConnection(); - } - } - - private async Task ReconnectAsync(int timeout) { - try { - long commandTimeoutExpiration = 0; - if (timeout > 0) { - commandTimeoutExpiration = ADP.TimerCurrent() + ADP.TimerFromSeconds(timeout); - } - CancellationTokenSource cts = new CancellationTokenSource(); - _reconnectionCancellationSource = cts; - CancellationToken ctoken = cts.Token; - int retryCount = _connectRetryCount; // take a snapshot: could be changed by modifying the connection string - for (int attempt = 0; attempt < retryCount; attempt++) { - if (ctoken.IsCancellationRequested) { - Bid.Trace(" Orginal ClientConnectionID %ls - reconnection cancelled\n", _originalConnectionId.ToString()); - return; - } - try { - _impersonateIdentity = _lastIdentity; - try { - ForceNewConnection = true; - await OpenAsync(ctoken).ConfigureAwait(false); - // On success, increment the reconnect count - we don't really care if it rolls over since it is approx. - _reconnectCount = unchecked(_reconnectCount + 1); -#if DEBUG - Debug.Assert(_recoverySessionData._debugReconnectDataApplied, "Reconnect data was not applied !"); -#endif - } - finally { - _impersonateIdentity = null; - ForceNewConnection = false; - } - Bid.Trace(" Reconnection suceeded. ClientConnectionID %ls -> %ls \n", _originalConnectionId.ToString(), ClientConnectionId.ToString()); - return; - } - catch (SqlException e) { - Bid.Trace(" Orginal ClientConnectionID %ls - reconnection attempt failed error %ls\n", _originalConnectionId.ToString(), e.Message); - if (attempt == retryCount - 1) { - Bid.Trace(" Orginal ClientConnectionID %ls - give up reconnection\n", _originalConnectionId.ToString()); - throw SQL.CR_AllAttemptsFailed(e, _originalConnectionId); - } - if (timeout > 0 && ADP.TimerRemaining(commandTimeoutExpiration) < ADP.TimerFromSeconds(ConnectRetryInterval)) { - throw SQL.CR_NextAttemptWillExceedQueryTimeout(e, _originalConnectionId); - } - } - await Task.Delay(1000 * ConnectRetryInterval, ctoken).ConfigureAwait(false); - } - } - finally { - _recoverySessionData = null; - _supressStateChangeForReconnection = false; - } - Debug.Assert(false, "Should not reach this point"); - } - - internal Task ValidateAndReconnect(Action beforeDisconnect, int timeout) { - Task runningReconnect = _currentReconnectionTask; - // This loop in the end will return not completed reconnect task or null - while (runningReconnect != null && runningReconnect.IsCompleted) { - // clean current reconnect task (if it is the same one we checked - Interlocked.CompareExchange(ref _currentReconnectionTask, null, runningReconnect); - // make sure nobody started new task (if which case we did not clean it) - runningReconnect = _currentReconnectionTask; - } - if (runningReconnect == null) { - if (_connectRetryCount > 0) { - SqlInternalConnectionTds tdsConn = GetOpenTdsConnection(); - if (tdsConn._sessionRecoveryAcknowledged) { - TdsParserStateObject stateObj = tdsConn.Parser._physicalStateObj; - if (!stateObj.ValidateSNIConnection()) { - if (tdsConn.Parser._sessionPool != null) { - if (tdsConn.Parser._sessionPool.ActiveSessionsCount > 0) { - // >1 MARS session - if (beforeDisconnect != null) { - beforeDisconnect(); - } - OnError(SQL.CR_UnrecoverableClient(ClientConnectionId), true, null); - } - } - SessionData cData = tdsConn.CurrentSessionData; - cData.AssertUnrecoverableStateCountIsCorrect(); - if (cData._unrecoverableStatesCount == 0) { - bool callDisconnect = false; - lock (_reconnectLock) { - tdsConn.CheckEnlistedTransactionBinding(); - runningReconnect = _currentReconnectionTask; // double check after obtaining the lock - if (runningReconnect == null) { - if (cData._unrecoverableStatesCount == 0) { // could change since the first check, but now is stable since connection is know to be broken - _originalConnectionId = ClientConnectionId; - Bid.Trace(" Connection ClientConnectionID %ls is invalid, reconnecting\n", _originalConnectionId.ToString()); - _recoverySessionData = cData; - if (beforeDisconnect != null) { - beforeDisconnect(); - } - try { - _supressStateChangeForReconnection = true; - tdsConn.DoomThisConnection(); - } - catch (SqlException) { - } - runningReconnect = Task.Run(() => ReconnectAsync(timeout)); - // if current reconnect is not null, somebody already started reconnection task - some kind of race condition - Debug.Assert(_currentReconnectionTask == null, "Duplicate reconnection tasks detected"); - _currentReconnectionTask = runningReconnect; - } - } - else { - callDisconnect = true; - } - } - if (callDisconnect && beforeDisconnect != null) { - beforeDisconnect(); - } - } - else { - if (beforeDisconnect != null) { - beforeDisconnect(); - } - OnError(SQL.CR_UnrecoverableServer(ClientConnectionId), true, null); - } - } // ValidateSNIConnection - } // sessionRecoverySupported - } // connectRetryCount>0 - } - else { // runningReconnect = null - if (beforeDisconnect != null) { - beforeDisconnect(); - } - } - return runningReconnect; - } - - // this is straightforward, but expensive method to do connection resiliency - it take locks and all prepartions as for TDS request - partial void RepairInnerConnection() { - WaitForPendingReconnection(); - if (_connectRetryCount == 0) { - return; - } - SqlInternalConnectionTds tdsConn = InnerConnection as SqlInternalConnectionTds; - if (tdsConn != null) { - tdsConn.ValidateConnectionForExecute(null); - tdsConn.GetSessionAndReconnectIfNeeded((SqlConnection)this); - } - } - - private void WaitForPendingReconnection() { - Task reconnectTask = _currentReconnectionTask; - if (reconnectTask != null && !reconnectTask.IsCompleted) { - AsyncHelper.WaitForCompletion(reconnectTask, 0, null, rethrowExceptions: false); - } - } - - void CancelOpenAndWait() - { - // copy from member to avoid changes by background thread - var completion = _currentCompletion; - if (completion != null) - { - completion.Item1.TrySetCanceled(); - ((IAsyncResult)completion.Item2).AsyncWaitHandle.WaitOne(); - } - Debug.Assert(_currentCompletion == null, "After waiting for an async call to complete, there should be no completion source"); - } - - public override Task OpenAsync(CancellationToken cancellationToken) { - IntPtr hscp; - Bid.ScopeEnter(out hscp, " %d#", ObjectID) ; - Bid.CorrelationTrace(" ObjectID%d#, ActivityID %ls\n", ObjectID); - try { - - if (StatisticsEnabled) { - if (null == _statistics) { - _statistics = new SqlStatistics(); - } - else { - _statistics.ContinueOnNewConnection(); - } - } - - SqlStatistics statistics = null; - RuntimeHelpers.PrepareConstrainedRegions(); - try { - statistics = SqlStatistics.StartTimer(Statistics); - - System.Transactions.Transaction transaction = ADP.GetCurrentTransaction(); - TaskCompletionSource completion = new TaskCompletionSource(transaction); - TaskCompletionSource result = new TaskCompletionSource(); - - if (cancellationToken.IsCancellationRequested) { - result.SetCanceled(); - return result.Task; - } - - if (IsContextConnection) { - // Async not supported on Context Connections - result.SetException(ADP.ExceptionWithStackTrace(SQL.NotAvailableOnContextConnection())); - return result.Task; - } - - bool completed; - - try { - completed = TryOpen(completion); - } - catch (Exception e) { - result.SetException(e); - return result.Task; - } - - if (completed) { - result.SetResult(null); - } - else { - CancellationTokenRegistration registration = new CancellationTokenRegistration(); - if (cancellationToken.CanBeCanceled) { - registration = cancellationToken.Register(() => completion.TrySetCanceled()); - } - OpenAsyncRetry retry = new OpenAsyncRetry(this, completion, result, registration); - _currentCompletion = new Tuple, Task>(completion, result.Task); - completion.Task.ContinueWith(retry.Retry, TaskScheduler.Default); - return result.Task; - } - - return result.Task; - } - finally { - SqlStatistics.StopTimer(statistics); - } - } - finally { - Bid.ScopeLeave(ref hscp); - } - } - - private class OpenAsyncRetry { - SqlConnection _parent; - TaskCompletionSource _retry; - TaskCompletionSource _result; - CancellationTokenRegistration _registration; - - public OpenAsyncRetry(SqlConnection parent, TaskCompletionSource retry, TaskCompletionSource result, CancellationTokenRegistration registration) { - _parent = parent; - _retry = retry; - _result = result; - _registration = registration; - } - - internal void Retry(Task retryTask) { - Bid.Trace(" %d#\n", _parent.ObjectID); - _registration.Dispose(); - try { - SqlStatistics statistics = null; - RuntimeHelpers.PrepareConstrainedRegions(); - try { - statistics = SqlStatistics.StartTimer(_parent.Statistics); - - if (retryTask.IsFaulted) { - Exception e = retryTask.Exception.InnerException; - _parent.CloseInnerConnection(); - _parent._currentCompletion = null; - _result.SetException(retryTask.Exception.InnerException); - } - else if (retryTask.IsCanceled) { - _parent.CloseInnerConnection(); - _parent._currentCompletion = null; - _result.SetCanceled(); - } - else { - bool result; - // protect continuation from ----s with close and cancel - lock (_parent.InnerConnection) { - result = _parent.TryOpen(_retry); - } - if (result) - { - _parent._currentCompletion = null; - _result.SetResult(null); - } - else { - _parent.CloseInnerConnection(); - _parent._currentCompletion = null; - _result.SetException(ADP.ExceptionWithStackTrace(ADP.InternalError(ADP.InternalErrorCode.CompletedConnectReturnedPending))); - } - } - } - finally { - SqlStatistics.StopTimer(statistics); - } - } - catch (Exception e) { - _parent.CloseInnerConnection(); - _parent._currentCompletion = null; - _result.SetException(e); - } - } - } - - private bool TryOpen(TaskCompletionSource retry) { - if (_impersonateIdentity != null) { - if (_impersonateIdentity.User == DbConnectionPoolIdentity.GetCurrentWindowsIdentity().User) { - return TryOpenInner(retry); - } - else { - using (WindowsImpersonationContext context = _impersonateIdentity.Impersonate()) { - return TryOpenInner(retry); - } - } - } - else { - if (this.UsesIntegratedSecurity((SqlConnectionString)ConnectionOptions)) { - _lastIdentity = DbConnectionPoolIdentity.GetCurrentWindowsIdentity(); - } - else { - _lastIdentity = null; - } - return TryOpenInner(retry); - } - } - - private bool TryOpenInner(TaskCompletionSource retry) { - TdsParser bestEffortCleanupTarget = null; - RuntimeHelpers.PrepareConstrainedRegions(); - try { -#if DEBUG - TdsParser.ReliabilitySection tdsReliabilitySection = new TdsParser.ReliabilitySection(); - - RuntimeHelpers.PrepareConstrainedRegions(); - try { - tdsReliabilitySection.Start(); -#else - { -#endif //DEBUG - if (ForceNewConnection) { - if (!InnerConnection.TryReplaceConnection(this, ConnectionFactory, retry, UserConnectionOptions)) { - return false; - } - } - else { - if (!InnerConnection.TryOpenConnection(this, ConnectionFactory, retry, UserConnectionOptions)) { - return false; - } - } - // does not require GC.KeepAlive(this) because of OnStateChange - - // GetBestEffortCleanup must happen AFTER OpenConnection to get the correct target. - bestEffortCleanupTarget = SqlInternalConnection.GetBestEffortCleanupTarget(this); - - var tdsInnerConnection = (InnerConnection as SqlInternalConnectionTds); - if (tdsInnerConnection == null) { - SqlInternalConnectionSmi innerConnection = (InnerConnection as SqlInternalConnectionSmi); - innerConnection.AutomaticEnlistment(); - } - else { - Debug.Assert(tdsInnerConnection.Parser != null, "Where's the parser?"); - - if (!tdsInnerConnection.ConnectionOptions.Pooling) { - // For non-pooled connections, we need to make sure that the finalizer does actually run to avoid leaking SNI handles - GC.ReRegisterForFinalize(this); - } - - if (StatisticsEnabled) { - ADP.TimerCurrent(out _statistics._openTimestamp); - tdsInnerConnection.Parser.Statistics = _statistics; - } - else { - tdsInnerConnection.Parser.Statistics = null; - _statistics = null; // in case of previous Open/Close/reset_CollectStats sequence - } - CompleteOpen(); - } - } -#if DEBUG - finally { - tdsReliabilitySection.Stop(); - } -#endif //DEBUG - } - catch (System.OutOfMemoryException e) { - Abort(e); - throw; - } - catch (System.StackOverflowException e) { - Abort(e); - throw; - } - catch (System.Threading.ThreadAbortException e) { - Abort(e); - SqlInternalConnection.BestEffortCleanup(bestEffortCleanupTarget); - throw; - } - - return true; - } - - - // - // INTERNAL PROPERTIES - // - - internal bool HasLocalTransaction { - get { - return GetOpenConnection().HasLocalTransaction; - } - } - - internal bool HasLocalTransactionFromAPI { - get { - Task reconnectTask = _currentReconnectionTask; - if (reconnectTask != null && !reconnectTask.IsCompleted) { - return false; //we will not go into reconnection if we are inside the transaction - } - return GetOpenConnection().HasLocalTransactionFromAPI; - } - } - - internal bool IsShiloh { - get { - if (_currentReconnectionTask != null) { // holds true even if task is completed - return true; // if CR is enabled, connection, if established, will be Katmai+ - } - return GetOpenConnection().IsShiloh; - } - } - - internal bool IsYukonOrNewer { - get { - if (_currentReconnectionTask != null) { // holds true even if task is completed - return true; // if CR is enabled, connection, if established, will be Katmai+ - } - return GetOpenConnection().IsYukonOrNewer; - } - } - - internal bool IsKatmaiOrNewer { - get { - if (_currentReconnectionTask != null) { // holds true even if task is completed - return true; // if CR is enabled, connection, if established, will be Katmai+ - } - return GetOpenConnection().IsKatmaiOrNewer; - } - } - - internal TdsParser Parser { - get { - SqlInternalConnectionTds tdsConnection = (GetOpenConnection() as SqlInternalConnectionTds); - if (null == tdsConnection) { - throw SQL.NotAvailableOnContextConnection(); - } - return tdsConnection.Parser; - } - } - - internal bool Asynchronous { - get { - SqlConnectionString constr = (SqlConnectionString)ConnectionOptions; - return ((null != constr) ? constr.Asynchronous : SqlConnectionString.DEFAULT.Asynchronous); - } - } - - // - // INTERNAL METHODS - // - - internal void ValidateConnectionForExecute(string method, SqlCommand command) { - Task asyncWaitingForReconnection=_asyncWaitingForReconnection; - if (asyncWaitingForReconnection!=null) { - if (!asyncWaitingForReconnection.IsCompleted) { - throw SQL.MARSUnspportedOnConnection(); - } - else { - Interlocked.CompareExchange(ref _asyncWaitingForReconnection, null, asyncWaitingForReconnection); - } - } - if (_currentReconnectionTask != null) { - Task currentReconnectionTask = _currentReconnectionTask; - if (currentReconnectionTask != null && !currentReconnectionTask.IsCompleted) { - return; // execution will wait for this task later - } - } - SqlInternalConnection innerConnection = GetOpenConnection(method); - innerConnection.ValidateConnectionForExecute(command); - } - - // Surround name in brackets and then escape any end bracket to protect against SQL Injection. - // NOTE: if the user escapes it themselves it will not work, but this was the case in V1 as well - // as native OleDb and Odbc. - static internal string FixupDatabaseTransactionName(string name) { - if (!ADP.IsEmpty(name)) { - return SqlServerEscapeHelper.EscapeIdentifier(name); - } - else { - return name; - } - } - - // If wrapCloseInAction is defined, then the action it defines will be run with the connection close action passed in as a parameter - // The close action also supports being run asynchronously - internal void OnError(SqlException exception, bool breakConnection, Action wrapCloseInAction) { - Debug.Assert(exception != null && exception.Errors.Count != 0, "SqlConnection: OnError called with null or empty exception!"); - - // Bug fix - MDAC 49022 - connection open after failure... Problem was parser was passing - // Open as a state - because the parser's connection to the netlib was open. We would - // then set the connection state to the parser's state - which is not correct. The only - // time the connection state should change to what is passed in to this function is if - // the parser is broken, then we should be closed. Changed to passing in - // TdsParserState, not ConnectionState. - // fixed by [....] - - if (breakConnection && (ConnectionState.Open == State)) { - - if (wrapCloseInAction != null) { - int capturedCloseCount = _closeCount; - - Action closeAction = () => { - if (capturedCloseCount == _closeCount) { - Bid.Trace(" %d#, Connection broken.\n", ObjectID); - Close(); - } - }; - - wrapCloseInAction(closeAction); - } - else { - Bid.Trace(" %d#, Connection broken.\n", ObjectID); - Close(); - } - } - - if (exception.Class >= TdsEnums.MIN_ERROR_CLASS) { - // It is an error, and should be thrown. Class of TdsEnums.MIN_ERROR_CLASS or above is an error, - // below TdsEnums.MIN_ERROR_CLASS denotes an info message. - throw exception; - } - else { - // If it is a class < TdsEnums.MIN_ERROR_CLASS, it is a warning collection - so pass to handler - this.OnInfoMessage(new SqlInfoMessageEventArgs(exception)); - } - } - - // - // PRIVATE METHODS - // - - // SxS: using Debugger.IsAttached - // - [ResourceExposure(ResourceScope.None)] - [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] - private void CompleteOpen() { - Debug.Assert(ConnectionState.Open == State, "CompleteOpen not open"); - // be sure to mark as open so SqlDebugCheck can issue Query - - // check to see if we need to hook up sql-debugging if a debugger is attached - // We only need this check for Shiloh and earlier servers. - if (!GetOpenConnection().IsYukonOrNewer && - System.Diagnostics.Debugger.IsAttached) { - bool debugCheck = false; - try { - new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand(); // MDAC 66682, 69017 - debugCheck = true; - } - catch (SecurityException e) { - ADP.TraceExceptionWithoutRethrow(e); - } - - if (debugCheck) { - // if we don't have Unmanaged code permission, don't check for debugging - // but let the connection be opened while under the debugger - CheckSQLDebugOnConnect(); - } - } - } - - internal SqlInternalConnection GetOpenConnection() { - SqlInternalConnection innerConnection = (InnerConnection as SqlInternalConnection); - if (null == innerConnection) { - throw ADP.ClosedConnectionError(); - } - return innerConnection; - } - - internal SqlInternalConnection GetOpenConnection(string method) { - DbConnectionInternal innerConnection = InnerConnection; - SqlInternalConnection innerSqlConnection = (innerConnection as SqlInternalConnection); - if (null == innerSqlConnection) { - throw ADP.OpenConnectionRequired(method, innerConnection.State); - } - return innerSqlConnection; - } - - internal SqlInternalConnectionTds GetOpenTdsConnection() { - SqlInternalConnectionTds innerConnection = (InnerConnection as SqlInternalConnectionTds); - if (null == innerConnection) { - throw ADP.ClosedConnectionError(); - } - return innerConnection; - } - - internal SqlInternalConnectionTds GetOpenTdsConnection(string method) { - SqlInternalConnectionTds innerConnection = (InnerConnection as SqlInternalConnectionTds); - if (null == innerConnection) { - throw ADP.OpenConnectionRequired(method, InnerConnection.State); - } - return innerConnection; - } - - internal void OnInfoMessage(SqlInfoMessageEventArgs imevent) { - bool notified; - OnInfoMessage(imevent, out notified); - } - - internal void OnInfoMessage(SqlInfoMessageEventArgs imevent, out bool notified) { - if (Bid.TraceOn) { - Debug.Assert(null != imevent, "null SqlInfoMessageEventArgs"); - Bid.Trace(" %d#, Message='%ls'\n", ObjectID, ((null != imevent) ? imevent.Message : "")); - } - SqlInfoMessageEventHandler handler = (SqlInfoMessageEventHandler)Events[EventInfoMessage]; - if (null != handler) { - notified = true; - try { - handler(this, imevent); - } - catch (Exception e) { // MDAC 53175 - if (!ADP.IsCatchableOrSecurityExceptionType(e)) { - throw; - } - - ADP.TraceExceptionWithoutRethrow(e); - } - } else { - notified = false; - } - } - - // - // SQL DEBUGGING SUPPORT - // - - // this only happens once per connection - // SxS: using named file mapping APIs - // - [ResourceExposure(ResourceScope.None)] - [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] - private void CheckSQLDebugOnConnect() { - IntPtr hFileMap; - uint pid = (uint)SafeNativeMethods.GetCurrentProcessId(); - - string mapFileName; - - // If Win2k or later, prepend "Global\\" to enable this to work through TerminalServices. - if (ADP.IsPlatformNT5) { - mapFileName = "Global\\" + TdsEnums.SDCI_MAPFILENAME; - } - else { - mapFileName = TdsEnums.SDCI_MAPFILENAME; - } - - mapFileName = mapFileName + pid.ToString(CultureInfo.InvariantCulture); - - hFileMap = NativeMethods.OpenFileMappingA(0x4/*FILE_MAP_READ*/, false, mapFileName); - - if (ADP.PtrZero != hFileMap) { - IntPtr pMemMap = NativeMethods.MapViewOfFile(hFileMap, 0x4/*FILE_MAP_READ*/, 0, 0, IntPtr.Zero); - if (ADP.PtrZero != pMemMap) { - SqlDebugContext sdc = new SqlDebugContext(); - sdc.hMemMap = hFileMap; - sdc.pMemMap = pMemMap; - sdc.pid = pid; - - // optimization: if we only have to refresh memory-mapped data at connection open time - // optimization: then call here instead of in CheckSQLDebug() which gets called - // optimization: at command execution time - // RefreshMemoryMappedData(sdc); - - // delaying setting out global state until after we issue this first SQLDebug command so that - // we don't reentrantly call into CheckSQLDebug - CheckSQLDebug(sdc); - // now set our global state - _sdc = sdc; - } - } - } - - // This overload is called by the Command object when executing stored procedures. Note that - // if SQLDebug has never been called, it is a noop. - internal void CheckSQLDebug() { - if (null != _sdc) - CheckSQLDebug(_sdc); - } - - // SxS: using GetCurrentThreadId - [ResourceExposure(ResourceScope.None)] - [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] - [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] // MDAC 66682, 69017 - private void CheckSQLDebug(SqlDebugContext sdc) { - // check to see if debugging has been activated - Debug.Assert(null != sdc, "SQL Debug: invalid null debugging context!"); - -#pragma warning disable 618 - uint tid = (uint)AppDomain.GetCurrentThreadId(); // Sql Debugging doesn't need fiber support; -#pragma warning restore 618 - RefreshMemoryMappedData(sdc); - - // - - - - // If we get here, the debugger must be hooked up. - if (!sdc.active) { - if (sdc.fOption/*TdsEnums.SQLDEBUG_ON*/) { - // turn on - sdc.active = true; - sdc.tid = tid; - try { - IssueSQLDebug(TdsEnums.SQLDEBUG_ON, sdc.machineName, sdc.pid, sdc.dbgpid, sdc.sdiDllName, sdc.data); - sdc.tid = 0; // reset so that the first successful time through, we notify the server of the context switch - } - catch { - sdc.active = false; - throw; - } - } - } - - // be sure to pick up thread context switch, especially the first time through - if (sdc.active) { - if (!sdc.fOption/*TdsEnums.SQLDEBUG_OFF*/) { - // turn off and free the memory - sdc.Dispose(); - // okay if we throw out here, no state to clean up - IssueSQLDebug(TdsEnums.SQLDEBUG_OFF, null, 0, 0, null, null); - } - else { - // notify server of context change - if (sdc.tid != tid) { - sdc.tid = tid; - try { - IssueSQLDebug(TdsEnums.SQLDEBUG_CONTEXT, null, sdc.pid, sdc.tid, null, null); - } - catch { - sdc.tid = 0; - throw; - } - } - } - } - } - - private void IssueSQLDebug(uint option, string machineName, uint pid, uint id, string sdiDllName, byte[] data) { - - if (GetOpenConnection().IsYukonOrNewer) { - // - return; - } - - // - - SqlCommand c = new SqlCommand(TdsEnums.SP_SDIDEBUG, this); - c.CommandType = CommandType.StoredProcedure; - - // context param - SqlParameter p = new SqlParameter(null, SqlDbType.VarChar, TdsEnums.SQLDEBUG_MODE_NAMES[option].Length); - p.Value = TdsEnums.SQLDEBUG_MODE_NAMES[option]; - c.Parameters.Add(p); - - if (option == TdsEnums.SQLDEBUG_ON) { - // debug dll name - p = new SqlParameter(null, SqlDbType.VarChar, sdiDllName.Length); - p.Value = sdiDllName; - c.Parameters.Add(p); - // debug machine name - p = new SqlParameter(null, SqlDbType.VarChar, machineName.Length); - p.Value = machineName; - c.Parameters.Add(p); - } - - if (option != TdsEnums.SQLDEBUG_OFF) { - // client pid - p = new SqlParameter(null, SqlDbType.Int); - p.Value = pid; - c.Parameters.Add(p); - // dbgpid or tid - p = new SqlParameter(null, SqlDbType.Int); - p.Value = id; - c.Parameters.Add(p); - } - - if (option == TdsEnums.SQLDEBUG_ON) { - // debug data - p = new SqlParameter(null, SqlDbType.VarBinary, (null != data) ? data.Length : 0); - p.Value = data; - c.Parameters.Add(p); - } - - c.ExecuteNonQuery(); - } - - - public static void ChangePassword(string connectionString, string newPassword) { - IntPtr hscp; - Bid.ScopeEnter(out hscp, "") ; - Bid.CorrelationTrace(" ActivityID %ls\n"); - try { - if (ADP.IsEmpty(connectionString)) { - throw SQL.ChangePasswordArgumentMissing("connectionString"); - } - if (ADP.IsEmpty(newPassword)) { - throw SQL.ChangePasswordArgumentMissing("newPassword"); - } - if (TdsEnums.MAXLEN_NEWPASSWORD < newPassword.Length) { - throw ADP.InvalidArgumentLength("newPassword", TdsEnums.MAXLEN_NEWPASSWORD); - } - - SqlConnectionPoolKey key = new SqlConnectionPoolKey(connectionString, null); - - SqlConnectionString connectionOptions = SqlConnectionFactory.FindSqlConnectionOptions(key); - if (connectionOptions.IntegratedSecurity) { - throw SQL.ChangePasswordConflictsWithSSPI(); - } - if (! ADP.IsEmpty(connectionOptions.AttachDBFilename)) { - throw SQL.ChangePasswordUseOfUnallowedKey(SqlConnectionString.KEY.AttachDBFilename); - } - if (connectionOptions.ContextConnection) { - throw SQL.ChangePasswordUseOfUnallowedKey(SqlConnectionString.KEY.Context_Connection); - } - - System.Security.PermissionSet permissionSet = connectionOptions.CreatePermissionSet(); - permissionSet.Demand(); - - ChangePassword(connectionString, connectionOptions, null, newPassword, null); - } - finally { - Bid.ScopeLeave(ref hscp) ; - } - } - - public static void ChangePassword(string connectionString, SqlCredential credential, SecureString newSecurePassword) { - IntPtr hscp; - Bid.ScopeEnter(out hscp, "") ; - Bid.CorrelationTrace(" ActivityID %ls\n"); - try { - if (ADP.IsEmpty(connectionString)) { - throw SQL.ChangePasswordArgumentMissing("connectionString"); - } - - // check credential; not necessary to check the length of password in credential as the check is done by SqlCredential class - if (credential == null) { - throw SQL.ChangePasswordArgumentMissing("credential"); - } - - if (newSecurePassword == null || newSecurePassword.Length == 0) { - throw SQL.ChangePasswordArgumentMissing("newSecurePassword");; - } - - if (!newSecurePassword.IsReadOnly()) { - throw ADP.MustBeReadOnly("newSecurePassword"); - } - - if (TdsEnums.MAXLEN_NEWPASSWORD < newSecurePassword.Length) { - throw ADP.InvalidArgumentLength("newSecurePassword", TdsEnums.MAXLEN_NEWPASSWORD); - } - - SqlConnectionPoolKey key = new SqlConnectionPoolKey(connectionString, credential); - - SqlConnectionString connectionOptions = SqlConnectionFactory.FindSqlConnectionOptions(key); - - // Check for incompatible connection string value with SqlCredential - if (!ADP.IsEmpty(connectionOptions.UserID) || !ADP.IsEmpty(connectionOptions.Password)) { - throw ADP.InvalidMixedArgumentOfSecureAndClearCredential(); - } - - if (connectionOptions.IntegratedSecurity) { - throw SQL.ChangePasswordConflictsWithSSPI(); - } - - if (! ADP.IsEmpty(connectionOptions.AttachDBFilename)) { - throw SQL.ChangePasswordUseOfUnallowedKey(SqlConnectionString.KEY.AttachDBFilename); - } - - if (connectionOptions.ContextConnection) { - throw SQL.ChangePasswordUseOfUnallowedKey(SqlConnectionString.KEY.Context_Connection); - } - - System.Security.PermissionSet permissionSet = connectionOptions.CreatePermissionSet(); - permissionSet.Demand(); - - ChangePassword(connectionString, connectionOptions, credential, null, newSecurePassword); - } - finally { - Bid.ScopeLeave(ref hscp) ; - } - } - - private static void ChangePassword(string connectionString, SqlConnectionString connectionOptions, SqlCredential credential, string newPassword, SecureString newSecurePassword ) { - // note: This is the only case where we directly construt the internal connection, passing in the new password. - // Normally we would simply create a regular connectoin and open it but there is no other way to pass the - // new password down to the constructor. Also it would have an unwanted impact on the connection pool - // - using (SqlInternalConnectionTds con = new SqlInternalConnectionTds(null, connectionOptions, credential, null, newPassword, newSecurePassword, false)) { - if (!con.IsYukonOrNewer) { - throw SQL.ChangePasswordRequiresYukon(); - } - } - SqlConnectionPoolKey key = new SqlConnectionPoolKey(connectionString, credential); - - SqlConnectionFactory.SingletonInstance.ClearPool(key); - } - - internal void RegisterForConnectionCloseNotification(ref Task outterTask, object value, int tag) { - // Connection exists, schedule removal, will be added to ref collection after calling ValidateAndReconnect - outterTask = outterTask.ContinueWith(task => { - RemoveWeakReference(value); - return task; - }, TaskScheduler.Default).Unwrap(); - } - - // updates our context with any changes made to the memory-mapped data by an external process - static private void RefreshMemoryMappedData(SqlDebugContext sdc) { - Debug.Assert(ADP.PtrZero != sdc.pMemMap, "SQL Debug: invalid null value for pMemMap!"); - // copy memory mapped file contents into managed types - MEMMAP memMap = (MEMMAP)Marshal.PtrToStructure(sdc.pMemMap, typeof(MEMMAP)); - sdc.dbgpid = memMap.dbgpid; - sdc.fOption = (memMap.fOption == 1) ? true : false; - // xlate ansi byte[] -> managed strings - Encoding cp = System.Text.Encoding.GetEncoding(TdsEnums.DEFAULT_ENGLISH_CODE_PAGE_VALUE); - sdc.machineName = cp.GetString(memMap.rgbMachineName, 0, memMap.rgbMachineName.Length); - sdc.sdiDllName = cp.GetString(memMap.rgbDllName, 0, memMap.rgbDllName.Length); - // just get data reference - sdc.data = memMap.rgbData; - } - - public void ResetStatistics() { - if (IsContextConnection) { - throw SQL.NotAvailableOnContextConnection(); - } - - if (null != Statistics) { - Statistics.Reset(); - if (ConnectionState.Open == State) { - // update timestamp; - ADP.TimerCurrent(out _statistics._openTimestamp); - } - } - } - - public IDictionary RetrieveStatistics() { - if (IsContextConnection) { - throw SQL.NotAvailableOnContextConnection(); - } - - if (null != Statistics) { - UpdateStatistics(); - return Statistics.GetHashtable(); - } - else { - return new SqlStatistics().GetHashtable(); - } - } - - private void UpdateStatistics() { - if (ConnectionState.Open == State) { - // update timestamp - ADP.TimerCurrent(out _statistics._closeTimestamp); - } - // delegate the rest of the work to the SqlStatistics class - Statistics.UpdateStatistics(); - } - - // - // UDT SUPPORT - // - - private Assembly ResolveTypeAssembly(AssemblyName asmRef, bool throwOnError) { - Debug.Assert(TypeSystemAssemblyVersion != null, "TypeSystemAssembly should be set !"); - if (string.Compare(asmRef.Name, "Microsoft.SqlServer.Types", StringComparison.OrdinalIgnoreCase) == 0) { - if (Bid.TraceOn) { - if (asmRef.Version!=TypeSystemAssemblyVersion) { - Bid.Trace(" SQL CLR type version change: Server sent %ls, client will instantiate %ls", - asmRef.Version.ToString(), TypeSystemAssemblyVersion.ToString()); - } - } - asmRef.Version = TypeSystemAssemblyVersion; - } - try { - return Assembly.Load(asmRef); - } - catch (Exception e) { - if (throwOnError || !ADP.IsCatchableExceptionType(e)) { - throw; - } - else { - return null; - }; - } - } - - // - internal void CheckGetExtendedUDTInfo(SqlMetaDataPriv metaData, bool fThrow) { - if (metaData.udtType == null) { // If null, we have not obtained extended info. - Debug.Assert(!ADP.IsEmpty(metaData.udtAssemblyQualifiedName), "Unexpected state on GetUDTInfo"); - // Parameter throwOnError determines whether exception from Assembly.Load is thrown. - metaData.udtType = - Type.GetType(typeName:metaData.udtAssemblyQualifiedName, assemblyResolver:asmRef => ResolveTypeAssembly(asmRef, fThrow), typeResolver:null, throwOnError: fThrow); - - if (fThrow && metaData.udtType == null) { - // - throw SQL.UDTUnexpectedResult(metaData.udtAssemblyQualifiedName); - } - } - } - - internal object GetUdtValue(object value, SqlMetaDataPriv metaData, bool returnDBNull) { - if (returnDBNull && ADP.IsNull(value)) { - return DBNull.Value; - } - - object o = null; - - // Since the serializer doesn't handle nulls... - if (ADP.IsNull(value)) { - Type t = metaData.udtType; - Debug.Assert(t != null, "Unexpected null of udtType on GetUdtValue!"); - o = t.InvokeMember("Null", BindingFlags.Public | BindingFlags.GetProperty | BindingFlags.Static, null, null, new Object[]{}, CultureInfo.InvariantCulture); - Debug.Assert(o != null); - return o; - } - else { - - MemoryStream stm = new MemoryStream((byte[]) value); - - o = SerializationHelperSql9.Deserialize(stm, metaData.udtType); - - Debug.Assert(o != null, "object could NOT be created"); - return o; - } - } - - internal byte[] GetBytes(object o) { - Microsoft.SqlServer.Server.Format format = Microsoft.SqlServer.Server.Format.Native; - int maxSize = 0; - return GetBytes(o, out format, out maxSize); - } - - internal byte[] GetBytes(object o, out Microsoft.SqlServer.Server.Format format, out int maxSize) { - SqlUdtInfo attr = AssemblyCache.GetInfoFromType(o.GetType()); - maxSize = attr.MaxByteSize; - format = attr.SerializationFormat; - - if (maxSize < -1 || maxSize >= UInt16.MaxValue) { // Do we need this? Is this the right place? - throw new InvalidOperationException(o.GetType() + ": invalid Size"); - } - - byte[] retval; - - using (MemoryStream stm = new MemoryStream(maxSize < 0 ? 0 : maxSize)) { - SerializationHelperSql9.Serialize(stm, o); - retval = stm.ToArray(); - } - return retval; - } - } // SqlConnection - - // - - - - - - [ - ComVisible(true), - ClassInterface(ClassInterfaceType.None), - Guid("afef65ad-4577-447a-a148-83acadd3d4b9"), - ] - [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name = "FullTrust")] - public sealed class SQLDebugging: ISQLDebug { - - // Security stuff - const int STANDARD_RIGHTS_REQUIRED = (0x000F0000); - const int DELETE = (0x00010000); - const int READ_CONTROL = (0x00020000); - const int WRITE_DAC = (0x00040000); - const int WRITE_OWNER = (0x00080000); - const int SYNCHRONIZE = (0x00100000); - const int FILE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x000001FF); - const uint GENERIC_READ = (0x80000000); - const uint GENERIC_WRITE = (0x40000000); - const uint GENERIC_EXECUTE = (0x20000000); - const uint GENERIC_ALL = (0x10000000); - - const int SECURITY_DESCRIPTOR_REVISION = (1); - const int ACL_REVISION = (2); - - const int SECURITY_AUTHENTICATED_USER_RID = (0x0000000B); - const int SECURITY_LOCAL_SYSTEM_RID = (0x00000012); - const int SECURITY_BUILTIN_DOMAIN_RID = (0x00000020); - const int SECURITY_WORLD_RID = (0x00000000); - const byte SECURITY_NT_AUTHORITY = 5; - const int DOMAIN_GROUP_RID_ADMINS = (0x00000200); - const int DOMAIN_ALIAS_RID_ADMINS = (0x00000220); - - const int sizeofSECURITY_ATTRIBUTES = 12; // sizeof(SECURITY_ATTRIBUTES); - const int sizeofSECURITY_DESCRIPTOR = 20; // sizeof(SECURITY_DESCRIPTOR); - const int sizeofACCESS_ALLOWED_ACE = 12; // sizeof(ACCESS_ALLOWED_ACE); - const int sizeofACCESS_DENIED_ACE = 12; // sizeof(ACCESS_DENIED_ACE); - const int sizeofSID_IDENTIFIER_AUTHORITY = 6; // sizeof(SID_IDENTIFIER_AUTHORITY) - const int sizeofACL = 8; // sizeof(ACL); - - private IntPtr CreateSD(ref IntPtr pDacl) { - IntPtr pSecurityDescriptor = IntPtr.Zero; - IntPtr pUserSid = IntPtr.Zero; - IntPtr pAdminSid = IntPtr.Zero; - IntPtr pNtAuthority = IntPtr.Zero; - int cbAcl = 0; - bool status = false; - - pNtAuthority = Marshal.AllocHGlobal(sizeofSID_IDENTIFIER_AUTHORITY); - if (pNtAuthority == IntPtr.Zero) - goto cleanup; - Marshal.WriteInt32(pNtAuthority, 0, 0); - Marshal.WriteByte(pNtAuthority, 4, 0); - Marshal.WriteByte(pNtAuthority, 5, SECURITY_NT_AUTHORITY); - - status = - NativeMethods.AllocateAndInitializeSid( - pNtAuthority, - (byte)1, - SECURITY_AUTHENTICATED_USER_RID, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ref pUserSid); - - if (!status || pUserSid == IntPtr.Zero) { - goto cleanup; - } - status = - NativeMethods.AllocateAndInitializeSid( - pNtAuthority, - (byte)2, - SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - 0, - 0, - 0, - 0, - 0, - 0, - ref pAdminSid); - - if (!status || pAdminSid == IntPtr.Zero) { - goto cleanup; - } - status = false; - pSecurityDescriptor = Marshal.AllocHGlobal(sizeofSECURITY_DESCRIPTOR); - if (pSecurityDescriptor == IntPtr.Zero) { - goto cleanup; - } - for (int i = 0; i < sizeofSECURITY_DESCRIPTOR; i++) - Marshal.WriteByte(pSecurityDescriptor, i, (byte)0); - cbAcl = sizeofACL - + (2 * (sizeofACCESS_ALLOWED_ACE)) - + sizeofACCESS_DENIED_ACE - + NativeMethods.GetLengthSid(pUserSid) - + NativeMethods.GetLengthSid(pAdminSid); - - pDacl = Marshal.AllocHGlobal(cbAcl); - if (pDacl == IntPtr.Zero) { - goto cleanup; - } - // rights must be added in a certain order. Namely, deny access first, then add access - if (NativeMethods.InitializeAcl(pDacl, cbAcl, ACL_REVISION)) - if (NativeMethods.AddAccessDeniedAce(pDacl, ACL_REVISION, WRITE_DAC, pUserSid)) - if (NativeMethods.AddAccessAllowedAce(pDacl, ACL_REVISION, GENERIC_READ, pUserSid)) - if (NativeMethods.AddAccessAllowedAce(pDacl, ACL_REVISION, GENERIC_ALL, pAdminSid)) - if (NativeMethods.InitializeSecurityDescriptor(pSecurityDescriptor, SECURITY_DESCRIPTOR_REVISION)) - if (NativeMethods.SetSecurityDescriptorDacl(pSecurityDescriptor, true, pDacl, false)) { - status = true; - } - - cleanup : - if (pNtAuthority != IntPtr.Zero) { - Marshal.FreeHGlobal(pNtAuthority); - } - if (pAdminSid != IntPtr.Zero) - NativeMethods.FreeSid(pAdminSid); - if (pUserSid != IntPtr.Zero) - NativeMethods.FreeSid(pUserSid); - if (status) - return pSecurityDescriptor; - else { - if (pSecurityDescriptor != IntPtr.Zero) { - Marshal.FreeHGlobal(pSecurityDescriptor); - } - } - return IntPtr.Zero; - } - - // SxS: using file mapping API (CreateFileMapping) - // - [ResourceExposure(ResourceScope.None)] - [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] - bool ISQLDebug.SQLDebug(int dwpidDebugger, int dwpidDebuggee, [MarshalAs(UnmanagedType.LPStr)] string pszMachineName, - [MarshalAs(UnmanagedType.LPStr)] string pszSDIDLLName, int dwOption, int cbData, byte[] rgbData) { - bool result = false; - IntPtr hFileMap = IntPtr.Zero; - IntPtr pMemMap = IntPtr.Zero; - IntPtr pSecurityDescriptor = IntPtr.Zero; - IntPtr pSecurityAttributes = IntPtr.Zero; - IntPtr pDacl = IntPtr.Zero; - - // validate the structure - if (null == pszMachineName || null == pszSDIDLLName) - return false; - - if (pszMachineName.Length > TdsEnums.SDCI_MAX_MACHINENAME || - pszSDIDLLName.Length > TdsEnums.SDCI_MAX_DLLNAME) - return false; - - // note that these are ansi strings - Encoding cp = System.Text.Encoding.GetEncoding(TdsEnums.DEFAULT_ENGLISH_CODE_PAGE_VALUE); - byte[] rgbMachineName = cp.GetBytes(pszMachineName); - byte[] rgbSDIDLLName = cp.GetBytes(pszSDIDLLName); - - if (null != rgbData && cbData > TdsEnums.SDCI_MAX_DATA) - return false; - - string mapFileName; - - // If Win2k or later, prepend "Global\\" to enable this to work through TerminalServices. - if (ADP.IsPlatformNT5) { - mapFileName = "Global\\" + TdsEnums.SDCI_MAPFILENAME; - } - else { - mapFileName = TdsEnums.SDCI_MAPFILENAME; - } - - mapFileName = mapFileName + dwpidDebuggee.ToString(CultureInfo.InvariantCulture); - - // Create Security Descriptor - pSecurityDescriptor = CreateSD(ref pDacl); - pSecurityAttributes = Marshal.AllocHGlobal(sizeofSECURITY_ATTRIBUTES); - if ((pSecurityDescriptor == IntPtr.Zero) || (pSecurityAttributes == IntPtr.Zero)) - return false; - - Marshal.WriteInt32(pSecurityAttributes, 0, sizeofSECURITY_ATTRIBUTES); // nLength = sizeof(SECURITY_ATTRIBUTES) - Marshal.WriteIntPtr(pSecurityAttributes, 4, pSecurityDescriptor); // lpSecurityDescriptor = pSecurityDescriptor - Marshal.WriteInt32(pSecurityAttributes, 8, 0); // bInheritHandle = FALSE - hFileMap = NativeMethods.CreateFileMappingA( - ADP.InvalidPtr/*INVALID_HANDLE_VALUE*/, - pSecurityAttributes, - 0x4/*PAGE_READWRITE*/, - 0, - Marshal.SizeOf(typeof(MEMMAP)), - mapFileName); - - if (IntPtr.Zero == hFileMap) { - goto cleanup; - } - - - pMemMap = NativeMethods.MapViewOfFile(hFileMap, 0x6/*FILE_MAP_READ|FILE_MAP_WRITE*/, 0, 0, IntPtr.Zero); - - if (IntPtr.Zero == pMemMap) { - goto cleanup; - } - - // copy data to memory-mapped file - // layout of MEMMAP structure is: - // uint dbgpid - // uint fOption - // byte[32] machineName - // byte[16] sdiDllName - // uint dbData - // byte[255] vData - int offset = 0; - Marshal.WriteInt32(pMemMap, offset, (int)dwpidDebugger); - offset += 4; - Marshal.WriteInt32(pMemMap, offset, (int)dwOption); - offset += 4; - Marshal.Copy(rgbMachineName, 0, ADP.IntPtrOffset(pMemMap, offset), rgbMachineName.Length); - offset += TdsEnums.SDCI_MAX_MACHINENAME; - Marshal.Copy(rgbSDIDLLName, 0, ADP.IntPtrOffset(pMemMap, offset), rgbSDIDLLName.Length); - offset += TdsEnums.SDCI_MAX_DLLNAME; - Marshal.WriteInt32(pMemMap, offset, (int)cbData); - offset += 4; - if (null != rgbData) { - Marshal.Copy(rgbData, 0, ADP.IntPtrOffset(pMemMap, offset), (int)cbData); - } - NativeMethods.UnmapViewOfFile(pMemMap); - result = true; - cleanup : - if (result == false) { - if (hFileMap != IntPtr.Zero) - NativeMethods.CloseHandle(hFileMap); - } - if (pSecurityAttributes != IntPtr.Zero) - Marshal.FreeHGlobal(pSecurityAttributes); - if (pSecurityDescriptor != IntPtr.Zero) - Marshal.FreeHGlobal(pSecurityDescriptor); - if (pDacl != IntPtr.Zero) - Marshal.FreeHGlobal(pDacl); - return result; - } - } - - // this is a private interface to com+ users - // do not change this guid - [ - ComImport, - ComVisible(true), - Guid("6cb925bf-c3c0-45b3-9f44-5dd67c7b7fe8"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - BestFitMapping(false, ThrowOnUnmappableChar = true), - ] - interface ISQLDebug { - - [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name = "FullTrust")] - bool SQLDebug( - int dwpidDebugger, - int dwpidDebuggee, - [MarshalAs(UnmanagedType.LPStr)] string pszMachineName, - [MarshalAs(UnmanagedType.LPStr)] string pszSDIDLLName, - int dwOption, - int cbData, - byte[] rgbData); - } - - sealed class SqlDebugContext: IDisposable { - // context data - internal uint pid = 0; - internal uint tid = 0; - internal bool active = false; - // memory-mapped data - internal IntPtr pMemMap = ADP.PtrZero; - internal IntPtr hMemMap = ADP.PtrZero; - internal uint dbgpid = 0; - internal bool fOption = false; - internal string machineName = null; - internal string sdiDllName = null; - internal byte[] data = null; - - public void Dispose() { - Dispose(true); - GC.SuppressFinalize(this); - } - - // using CloseHandle and UnmapViewOfFile - no exposure - [ResourceExposure(ResourceScope.None)] - [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] - private void Dispose(bool disposing) { - if (disposing) { - // Nothing to do here - ; - } - if (pMemMap != IntPtr.Zero) { - NativeMethods.UnmapViewOfFile(pMemMap); - pMemMap = IntPtr.Zero; - } - if (hMemMap != IntPtr.Zero) { - NativeMethods.CloseHandle(hMemMap); - hMemMap = IntPtr.Zero; - } - active = false; - } - - ~SqlDebugContext() { - Dispose(false); - } - - } - - // native interop memory mapped structure for sdi debugging - [StructLayoutAttribute(LayoutKind.Sequential, Pack = 1)] - internal struct MEMMAP { - [MarshalAs(UnmanagedType.U4)] - internal uint dbgpid; // id of debugger - [MarshalAs(UnmanagedType.U4)] - internal uint fOption; // 1 - start debugging, 0 - stop debugging - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - internal byte[] rgbMachineName; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - internal byte[] rgbDllName; - [MarshalAs(UnmanagedType.U4)] - internal uint cbData; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 255)] - internal byte[] rgbData; - } -} // System.Data.SqlClient namespace - - diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlConnection.cs.REMOVED.git-id b/external/referencesource/System.Data/System/Data/SqlClient/SqlConnection.cs.REMOVED.git-id new file mode 100644 index 0000000000..a6658837b0 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlConnection.cs.REMOVED.git-id @@ -0,0 +1 @@ +0ce4dbb08763054308721ed6139b428134b0cb54 \ No newline at end of file diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionFactory.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionFactory.cs index 37766e5f46..d1b96a31b5 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionFactory.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionFactory.cs @@ -41,17 +41,19 @@ namespace System.Data.SqlClient SqlConnectionPoolKey key = (SqlConnectionPoolKey) poolKey; SqlInternalConnection result = null; SessionData recoverySessionData = null; + SqlConnection sqlOwningConnection = owningConnection as SqlConnection; + bool applyTransientFaultHandling = sqlOwningConnection != null ? sqlOwningConnection._applyTransientFaultHandling : false; SqlConnectionString userOpt = null; if (userOptions != null) { userOpt = (SqlConnectionString)userOptions; } - else if (owningConnection != null) { - userOpt = (SqlConnectionString)(((SqlConnection)owningConnection).UserConnectionOptions); + else if (sqlOwningConnection != null) { + userOpt = (SqlConnectionString)(sqlOwningConnection.UserConnectionOptions); } - if (owningConnection != null) { - recoverySessionData = ((SqlConnection)owningConnection)._recoverySessionData; + if (sqlOwningConnection != null) { + recoverySessionData = sqlOwningConnection._recoverySessionData; } if (opt.ContextConnection) { @@ -63,7 +65,7 @@ namespace System.Data.SqlClient // Pass DbConnectionPoolIdentity to SqlInternalConnectionTds if using integrated security. // Used by notifications. - if (opt.IntegratedSecurity) { + if (opt.IntegratedSecurity || opt.Authentication == SqlAuthenticationMethod.ActiveDirectoryIntegrated) { if (pool != null) { identity = pool.Identity; } @@ -90,7 +92,7 @@ namespace System.Data.SqlClient SqlConnectionString sseopt = new SqlConnectionString(opt, opt.DataSource, true /* user instance=true */, false /* set Enlist = false */); - sseConnection = new SqlInternalConnectionTds(identity, sseopt, key.Credential, null, "", null, false); + sseConnection = new SqlInternalConnectionTds(identity, sseopt, key.Credential, null, "", null, false, applyTransientFaultHandling: applyTransientFaultHandling); // NOTE: Retrieve here. This user instance name will be used below to connect to the Sql Express User Instance. instanceName = sseConnection.InstanceName; @@ -122,7 +124,7 @@ namespace System.Data.SqlClient opt = new SqlConnectionString(opt, instanceName, false /* user instance=false */, null /* do not modify the Enlist value */); poolGroupProviderInfo = null; // null so we do not pass to constructor below... } - result = new SqlInternalConnectionTds(identity, opt, key.Credential, poolGroupProviderInfo, "", null, redirectedUserInstance, userOpt, recoverySessionData); + result = new SqlInternalConnectionTds(identity, opt, key.Credential, poolGroupProviderInfo, "", null, redirectedUserInstance, userOpt, recoverySessionData, pool, key.AccessToken, applyTransientFaultHandling: applyTransientFaultHandling); } return result; } @@ -157,7 +159,7 @@ namespace System.Data.SqlClient connectionTimeout = Int32.MaxValue; poolingOptions = new DbConnectionPoolGroupOptions( - opt.IntegratedSecurity, + opt.IntegratedSecurity || opt.Authentication == SqlAuthenticationMethod.ActiveDirectoryIntegrated, opt.MinPoolSize, opt.MaxPoolSize, connectionTimeout, diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolKey.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolKey.cs index c589d8965a..e3fb5a7dd7 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolKey.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionPoolKey.cs @@ -12,6 +12,7 @@ namespace System.Data.SqlClient using System; using System.Collections; using System.Data.Common; + using System.Diagnostics; // SqlConnectionPoolKey: Implementation of a key to connection pool groups for specifically to be used for SqlConnection // Connection string and SqlCredential are used as a key @@ -19,16 +20,20 @@ namespace System.Data.SqlClient { private SqlCredential _credential; private int _hashValue; + private readonly string _accessToken; - internal SqlConnectionPoolKey(string connectionString, SqlCredential credential) : base(connectionString) + internal SqlConnectionPoolKey(string connectionString, SqlCredential credential, string accessToken) : base(connectionString) { + Debug.Assert(_credential == null || _accessToken == null, "Credential and AccessToken can't have the value at the same time."); _credential = credential; + _accessToken = accessToken; CalculateHashCode(); } private SqlConnectionPoolKey(SqlConnectionPoolKey key) : base (key) { _credential = key.Credential; + _accessToken = key.AccessToken; CalculateHashCode(); } @@ -59,12 +64,19 @@ namespace System.Data.SqlClient } } + internal string AccessToken + { + get + { + return _accessToken; + } + } public override bool Equals(object obj) { SqlConnectionPoolKey key = obj as SqlConnectionPoolKey; - return (key != null && _credential == key._credential && ConnectionString == key.ConnectionString); + return (key != null && _credential == key._credential && ConnectionString == key.ConnectionString && Object.ReferenceEquals(_accessToken, key._accessToken)); } public override int GetHashCode() @@ -83,6 +95,13 @@ namespace System.Data.SqlClient _hashValue = _hashValue * 17 + _credential.GetHashCode(); } } + else if (_accessToken != null) + { + unchecked + { + _hashValue = _hashValue * 17 + _accessToken.GetHashCode(); + } + } } } } diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs index 934f0f6ab5..85ed1b7bbf 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionString.cs @@ -27,74 +27,81 @@ namespace System.Data.SqlClient { internal static class DEFAULT { internal const ApplicationIntent ApplicationIntent = DbConnectionStringDefaults.ApplicationIntent; - internal const string Application_Name = TdsEnums.SQL_PROVIDER_NAME; - internal const bool Asynchronous = false; - internal const string AttachDBFilename = ""; - internal const int Connect_Timeout = ADP.DefaultConnectionTimeout; - internal const bool Connection_Reset = true; - internal const bool Context_Connection = false; - internal const string Current_Language = ""; - internal const string Data_Source = ""; - internal const bool Encrypt = false; - internal const bool Enlist = true; - internal const string FailoverPartner = ""; - internal const string Initial_Catalog = ""; - internal const bool Integrated_Security = false; - internal const int Load_Balance_Timeout = 0; // default of 0 means don't use - internal const bool MARS = false; - internal const int Max_Pool_Size = 100; - internal const int Min_Pool_Size = 0; - internal const bool MultiSubnetFailover = DbConnectionStringDefaults.MultiSubnetFailover; - internal const string Network_Library = ""; - internal const int Packet_Size = 8000; - internal const string Password = ""; - internal const bool Persist_Security_Info = false; - internal const bool Pooling = true; - internal const bool TrustServerCertificate = false; - internal const string Type_System_Version = ""; - internal const string User_ID = ""; - internal const bool User_Instance = false; - internal const bool Replication = false; - internal const int Connect_Retry_Count = 1; - internal const int Connect_Retry_Interval = 10; + internal const string Application_Name = TdsEnums.SQL_PROVIDER_NAME; + internal const bool Asynchronous = false; + internal const string AttachDBFilename = ""; + internal const int Connect_Timeout = ADP.DefaultConnectionTimeout; + internal const bool Connection_Reset = true; + internal const bool Context_Connection = false; + internal const string Current_Language = ""; + internal const string Data_Source = ""; + internal const bool Encrypt = false; + internal const bool Enlist = true; + internal const string FailoverPartner = ""; + internal const string Initial_Catalog = ""; + internal const bool Integrated_Security = false; + internal const int Load_Balance_Timeout = 0; // default of 0 means don't use + internal const bool MARS = false; + internal const int Max_Pool_Size = 100; + internal const int Min_Pool_Size = 0; + internal const bool MultiSubnetFailover = DbConnectionStringDefaults.MultiSubnetFailover; + internal const bool TransparentNetworkIPResolution = DbConnectionStringDefaults.TransparentNetworkIPResolution; + internal const string Network_Library = ""; + internal const int Packet_Size = 8000; + internal const string Password = ""; + internal const bool Persist_Security_Info = false; + internal const bool Pooling = true; + internal const bool TrustServerCertificate = false; + internal const string Type_System_Version = ""; + internal const string User_ID = ""; + internal const bool User_Instance = false; + internal const bool Replication = false; + internal const int Connect_Retry_Count = 1; + internal const int Connect_Retry_Interval = 10; + internal static readonly SqlAuthenticationMethod Authentication = SqlAuthenticationMethod.NotSpecified; + internal static readonly SqlConnectionColumnEncryptionSetting ColumnEncryptionSetting = SqlConnectionColumnEncryptionSetting.Disabled; } // SqlConnection ConnectionString Options // keys must be lowercase! internal static class KEY { - internal const string ApplicationIntent = "applicationintent"; - internal const string Application_Name = "application name"; - internal const string AsynchronousProcessing = "asynchronous processing"; - internal const string AttachDBFilename = "attachdbfilename"; - internal const string Connect_Timeout = "connect timeout"; - internal const string Connection_Reset = "connection reset"; - internal const string Context_Connection = "context connection"; - internal const string Current_Language = "current language"; - internal const string Data_Source = "data source"; - internal const string Encrypt = "encrypt"; - internal const string Enlist = "enlist"; - internal const string FailoverPartner = "failover partner"; - internal const string Initial_Catalog = "initial catalog"; - internal const string Integrated_Security = "integrated security"; - internal const string Load_Balance_Timeout = "load balance timeout"; - internal const string MARS = "multipleactiveresultsets"; - internal const string Max_Pool_Size = "max pool size"; - internal const string Min_Pool_Size = "min pool size"; - internal const string MultiSubnetFailover = "multisubnetfailover"; - internal const string Network_Library = "network library"; - internal const string Packet_Size = "packet size"; - internal const string Password = "password"; - internal const string Persist_Security_Info = "persist security info"; - internal const string Pooling = "pooling"; - internal const string TransactionBinding = "transaction binding"; - internal const string TrustServerCertificate = "trustservercertificate"; - internal const string Type_System_Version = "type system version"; - internal const string User_ID = "user id"; - internal const string User_Instance = "user instance"; - internal const string Workstation_Id = "workstation id"; - internal const string Replication = "replication"; - internal const string Connect_Retry_Count = "connectretrycount"; - internal const string Connect_Retry_Interval = "connectretryinterval"; + internal const string ApplicationIntent = "applicationintent"; + internal const string Application_Name = "application name"; + internal const string AsynchronousProcessing = "asynchronous processing"; + internal const string AttachDBFilename = "attachdbfilename"; + internal const string ColumnEncryptionSetting = "column encryption setting"; + internal const string Connect_Timeout = "connect timeout"; + internal const string Connection_Reset = "connection reset"; + internal const string Context_Connection = "context connection"; + internal const string Current_Language = "current language"; + internal const string Data_Source = "data source"; + internal const string Encrypt = "encrypt"; + internal const string Enlist = "enlist"; + internal const string FailoverPartner = "failover partner"; + internal const string Initial_Catalog = "initial catalog"; + internal const string Integrated_Security = "integrated security"; + internal const string Load_Balance_Timeout = "load balance timeout"; + internal const string MARS = "multipleactiveresultsets"; + internal const string Max_Pool_Size = "max pool size"; + internal const string Min_Pool_Size = "min pool size"; + internal const string MultiSubnetFailover = "multisubnetfailover"; + internal const string TransparentNetworkIPResolution = "transparentnetworkipresolution"; + internal const string Network_Library = "network library"; + internal const string Packet_Size = "packet size"; + internal const string Password = "password"; + internal const string Persist_Security_Info = "persist security info"; + internal const string Pooling = "pooling"; + internal const string TransactionBinding = "transaction binding"; + internal const string TrustServerCertificate = "trustservercertificate"; + internal const string Type_System_Version = "type system version"; + internal const string User_ID = "user id"; + internal const string User_Instance = "user instance"; + internal const string Workstation_Id = "workstation id"; + internal const string Replication = "replication"; + internal const string Connect_Retry_Count = "connectretrycount"; + internal const string Connect_Retry_Interval = "connectretryinterval"; + internal const string Authentication = "authentication"; + } // Constant for the number of duplicate options in the connnection string @@ -194,6 +201,9 @@ namespace System.Data.SqlClient { private readonly bool _replication; private readonly bool _userInstance; private readonly bool _multiSubnetFailover; + private readonly bool _transparentNetworkIPResolution; + private readonly SqlAuthenticationMethod _authType; + private readonly SqlConnectionColumnEncryptionSetting _columnEncryptionSetting; private readonly int _connectTimeout; private readonly int _loadBalanceTimeout; @@ -213,7 +223,6 @@ namespace System.Data.SqlClient { private readonly string _initialCatalog; private readonly string _password; private readonly string _userID; - private readonly string _networkLibrary; private readonly string _workstationId; @@ -240,7 +249,7 @@ namespace System.Data.SqlClient { // SQLPT 41700: Ignore ResetConnection=False (still validate the keyword/value) _connectionReset = ConvertValueToBoolean(KEY.Connection_Reset, DEFAULT.Connection_Reset); _contextConnection = ConvertValueToBoolean(KEY.Context_Connection, DEFAULT.Context_Connection); - _encrypt = ConvertValueToBoolean(KEY.Encrypt, DEFAULT.Encrypt); + _encrypt = ConvertValueToEncrypt(); _enlist = ConvertValueToBoolean(KEY.Enlist, ADP.IsWindowsNT); _mars = ConvertValueToBoolean(KEY.MARS, DEFAULT.MARS); _persistSecurityInfo = ConvertValueToBoolean(KEY.Persist_Security_Info, DEFAULT.Persist_Security_Info); @@ -248,6 +257,7 @@ namespace System.Data.SqlClient { _replication = ConvertValueToBoolean(KEY.Replication, DEFAULT.Replication); _userInstance = ConvertValueToBoolean(KEY.User_Instance, DEFAULT.User_Instance); _multiSubnetFailover = ConvertValueToBoolean(KEY.MultiSubnetFailover, DEFAULT.MultiSubnetFailover); + _transparentNetworkIPResolution = ConvertValueToBoolean(KEY.TransparentNetworkIPResolution, DEFAULT.TransparentNetworkIPResolution); _connectTimeout = ConvertValueToInt32(KEY.Connect_Timeout, DEFAULT.Connect_Timeout); _loadBalanceTimeout = ConvertValueToInt32(KEY.Load_Balance_Timeout, DEFAULT.Load_Balance_Timeout); @@ -268,6 +278,8 @@ namespace System.Data.SqlClient { _networkLibrary = ConvertValueToString(KEY.Network_Library, null); _password = ConvertValueToString(KEY.Password, DEFAULT.Password); _trustServerCertificate = ConvertValueToBoolean(KEY.TrustServerCertificate, DEFAULT.TrustServerCertificate); + _authType = ConvertValueToAuthenticationType(); + _columnEncryptionSetting = ConvertValueToColumnEncryptionSetting(); // Temporary string - this value is stored internally as an enum. string typeSystemVersionString = ConvertValueToString(KEY.Type_System_Version, null); @@ -446,6 +458,14 @@ namespace System.Data.SqlClient { if ((_connectRetryInterval < 1) || (_connectRetryInterval > 60)) { throw ADP.InvalidConnectRetryIntervalValue(); } + + if (Authentication != SqlAuthenticationMethod.NotSpecified && _integratedSecurity == true) { + throw SQL.AuthenticationAndIntegratedSecurity(); + } + + if (Authentication == SqlClient.SqlAuthenticationMethod.ActiveDirectoryIntegrated && (HasUserIdKeyword || HasPasswordKeyword)) { + throw SQL.IntegratedWithUserIDAndPassword(); + } } // This c-tor is used to create SSE and user instance connection strings when user instance is set to true @@ -463,35 +483,38 @@ namespace System.Data.SqlClient { _enlist = connectionOptions._enlist; } - _mars = connectionOptions._mars; - _persistSecurityInfo = connectionOptions._persistSecurityInfo; - _pooling = connectionOptions._pooling; - _replication = connectionOptions._replication; - _userInstance = userInstance; - _connectTimeout = connectionOptions._connectTimeout; - _loadBalanceTimeout = connectionOptions._loadBalanceTimeout; - _maxPoolSize = connectionOptions._maxPoolSize; - _minPoolSize = connectionOptions._minPoolSize; - _multiSubnetFailover = connectionOptions._multiSubnetFailover; - _packetSize = connectionOptions._packetSize; - _applicationName = connectionOptions._applicationName; - _attachDBFileName = connectionOptions._attachDBFileName; - _currentLanguage = connectionOptions._currentLanguage; - _dataSource = dataSource; - _localDBInstance = LocalDBAPI.GetLocalDbInstanceNameFromServerName(_dataSource); - _failoverPartner = connectionOptions._failoverPartner; - _initialCatalog = connectionOptions._initialCatalog; - _password = connectionOptions._password; - _userID = connectionOptions._userID; - _networkLibrary = connectionOptions._networkLibrary; - _workstationId = connectionOptions._workstationId; - _expandedAttachDBFilename = connectionOptions._expandedAttachDBFilename; - _typeSystemVersion = connectionOptions._typeSystemVersion; - _typeSystemAssemblyVersion =connectionOptions._typeSystemAssemblyVersion; - _transactionBinding = connectionOptions._transactionBinding; - _applicationIntent = connectionOptions._applicationIntent; - _connectRetryCount = connectionOptions._connectRetryCount; - _connectRetryInterval = connectionOptions._connectRetryInterval; + _mars = connectionOptions._mars; + _persistSecurityInfo = connectionOptions._persistSecurityInfo; + _pooling = connectionOptions._pooling; + _replication = connectionOptions._replication; + _userInstance = userInstance; + _connectTimeout = connectionOptions._connectTimeout; + _loadBalanceTimeout = connectionOptions._loadBalanceTimeout; + _maxPoolSize = connectionOptions._maxPoolSize; + _minPoolSize = connectionOptions._minPoolSize; + _multiSubnetFailover = connectionOptions._multiSubnetFailover; + _transparentNetworkIPResolution = connectionOptions._transparentNetworkIPResolution; + _packetSize = connectionOptions._packetSize; + _applicationName = connectionOptions._applicationName; + _attachDBFileName = connectionOptions._attachDBFileName; + _currentLanguage = connectionOptions._currentLanguage; + _dataSource = dataSource; + _localDBInstance = LocalDBAPI.GetLocalDbInstanceNameFromServerName(_dataSource); + _failoverPartner = connectionOptions._failoverPartner; + _initialCatalog = connectionOptions._initialCatalog; + _password = connectionOptions._password; + _userID = connectionOptions._userID; + _networkLibrary = connectionOptions._networkLibrary; + _workstationId = connectionOptions._workstationId; + _expandedAttachDBFilename = connectionOptions._expandedAttachDBFilename; + _typeSystemVersion = connectionOptions._typeSystemVersion; + _typeSystemAssemblyVersion = connectionOptions._typeSystemAssemblyVersion; + _transactionBinding = connectionOptions._transactionBinding; + _applicationIntent = connectionOptions._applicationIntent; + _connectRetryCount = connectionOptions._connectRetryCount; + _connectRetryInterval = connectionOptions._connectRetryInterval; + _authType = connectionOptions._authType; + _columnEncryptionSetting = connectionOptions._columnEncryptionSetting; ValidateValueLength(_dataSource, TdsEnums.MAXLEN_SERVERNAME, KEY.Data_Source); } @@ -511,7 +534,9 @@ namespace System.Data.SqlClient { internal bool Enlist { get { return _enlist; } } internal bool MARS { get { return _mars; } } internal bool MultiSubnetFailover { get { return _multiSubnetFailover; } } - + internal bool TransparentNetworkIPResolution { get { return _transparentNetworkIPResolution; } } + internal SqlAuthenticationMethod Authentication { get { return _authType; } } + internal SqlConnectionColumnEncryptionSetting ColumnEncryptionSetting { get { return _columnEncryptionSetting; } } internal bool PersistSecurityInfo { get { return _persistSecurityInfo; } } internal bool Pooling { get { return _pooling; } } internal bool Replication { get { return _replication; } } @@ -591,61 +616,64 @@ namespace System.Data.SqlClient { Hashtable hash = _sqlClientSynonyms; if (null == hash) { hash = new Hashtable(SqlConnectionStringBuilder.KeywordsCount + SynonymCount); - hash.Add(KEY.ApplicationIntent, KEY.ApplicationIntent); - hash.Add(KEY.Application_Name, KEY.Application_Name); - hash.Add(KEY.AsynchronousProcessing, KEY.AsynchronousProcessing); - hash.Add(KEY.AttachDBFilename, KEY.AttachDBFilename); - hash.Add(KEY.Connect_Timeout, KEY.Connect_Timeout); - hash.Add(KEY.Connection_Reset, KEY.Connection_Reset); - hash.Add(KEY.Context_Connection, KEY.Context_Connection); - hash.Add(KEY.Current_Language, KEY.Current_Language); - hash.Add(KEY.Data_Source, KEY.Data_Source); - hash.Add(KEY.Encrypt, KEY.Encrypt); - hash.Add(KEY.Enlist, KEY.Enlist); - hash.Add(KEY.FailoverPartner, KEY.FailoverPartner); - hash.Add(KEY.Initial_Catalog, KEY.Initial_Catalog); - hash.Add(KEY.Integrated_Security, KEY.Integrated_Security); - hash.Add(KEY.Load_Balance_Timeout, KEY.Load_Balance_Timeout); - hash.Add(KEY.MARS, KEY.MARS); - hash.Add(KEY.Max_Pool_Size, KEY.Max_Pool_Size); - hash.Add(KEY.Min_Pool_Size, KEY.Min_Pool_Size); - hash.Add(KEY.MultiSubnetFailover, KEY.MultiSubnetFailover); - hash.Add(KEY.Network_Library, KEY.Network_Library); - hash.Add(KEY.Packet_Size, KEY.Packet_Size); - hash.Add(KEY.Password, KEY.Password); - hash.Add(KEY.Persist_Security_Info, KEY.Persist_Security_Info); - hash.Add(KEY.Pooling, KEY.Pooling); - hash.Add(KEY.Replication, KEY.Replication); - hash.Add(KEY.TrustServerCertificate, KEY.TrustServerCertificate); - hash.Add(KEY.TransactionBinding, KEY.TransactionBinding); - hash.Add(KEY.Type_System_Version, KEY.Type_System_Version); - hash.Add(KEY.User_ID, KEY.User_ID); - hash.Add(KEY.User_Instance, KEY.User_Instance); - hash.Add(KEY.Workstation_Id, KEY.Workstation_Id); - hash.Add(KEY.Connect_Retry_Count, KEY.Connect_Retry_Count); - hash.Add(KEY.Connect_Retry_Interval, KEY.Connect_Retry_Interval); + hash.Add(KEY.ApplicationIntent, KEY.ApplicationIntent); + hash.Add(KEY.Application_Name, KEY.Application_Name); + hash.Add(KEY.AsynchronousProcessing, KEY.AsynchronousProcessing); + hash.Add(KEY.AttachDBFilename, KEY.AttachDBFilename); + hash.Add(KEY.Connect_Timeout, KEY.Connect_Timeout); + hash.Add(KEY.Connection_Reset, KEY.Connection_Reset); + hash.Add(KEY.Context_Connection, KEY.Context_Connection); + hash.Add(KEY.Current_Language, KEY.Current_Language); + hash.Add(KEY.Data_Source, KEY.Data_Source); + hash.Add(KEY.Encrypt, KEY.Encrypt); + hash.Add(KEY.Enlist, KEY.Enlist); + hash.Add(KEY.FailoverPartner, KEY.FailoverPartner); + hash.Add(KEY.Initial_Catalog, KEY.Initial_Catalog); + hash.Add(KEY.Integrated_Security, KEY.Integrated_Security); + hash.Add(KEY.Load_Balance_Timeout, KEY.Load_Balance_Timeout); + hash.Add(KEY.MARS, KEY.MARS); + hash.Add(KEY.Max_Pool_Size, KEY.Max_Pool_Size); + hash.Add(KEY.Min_Pool_Size, KEY.Min_Pool_Size); + hash.Add(KEY.MultiSubnetFailover, KEY.MultiSubnetFailover); + hash.Add(KEY.TransparentNetworkIPResolution, KEY.TransparentNetworkIPResolution); + hash.Add(KEY.Network_Library, KEY.Network_Library); + hash.Add(KEY.Packet_Size, KEY.Packet_Size); + hash.Add(KEY.Password, KEY.Password); + hash.Add(KEY.Persist_Security_Info, KEY.Persist_Security_Info); + hash.Add(KEY.Pooling, KEY.Pooling); + hash.Add(KEY.Replication, KEY.Replication); + hash.Add(KEY.TrustServerCertificate, KEY.TrustServerCertificate); + hash.Add(KEY.TransactionBinding, KEY.TransactionBinding); + hash.Add(KEY.Type_System_Version, KEY.Type_System_Version); + hash.Add(KEY.ColumnEncryptionSetting, KEY.ColumnEncryptionSetting); + hash.Add(KEY.User_ID, KEY.User_ID); + hash.Add(KEY.User_Instance, KEY.User_Instance); + hash.Add(KEY.Workstation_Id, KEY.Workstation_Id); + hash.Add(KEY.Connect_Retry_Count, KEY.Connect_Retry_Count); + hash.Add(KEY.Connect_Retry_Interval, KEY.Connect_Retry_Interval); + hash.Add(KEY.Authentication, KEY.Authentication); - hash.Add(SYNONYM.APP, KEY.Application_Name); - hash.Add(SYNONYM.Async, KEY.AsynchronousProcessing); - hash.Add(SYNONYM.EXTENDED_PROPERTIES, KEY.AttachDBFilename); - hash.Add(SYNONYM.INITIAL_FILE_NAME, KEY.AttachDBFilename); - hash.Add(SYNONYM.CONNECTION_TIMEOUT, KEY.Connect_Timeout); - hash.Add(SYNONYM.TIMEOUT, KEY.Connect_Timeout); - hash.Add(SYNONYM.LANGUAGE, KEY.Current_Language); - hash.Add(SYNONYM.ADDR, KEY.Data_Source); - hash.Add(SYNONYM.ADDRESS, KEY.Data_Source); - hash.Add(SYNONYM.NETWORK_ADDRESS, KEY.Data_Source); - hash.Add(SYNONYM.SERVER, KEY.Data_Source); - hash.Add(SYNONYM.DATABASE, KEY.Initial_Catalog); - hash.Add(SYNONYM.TRUSTED_CONNECTION, KEY.Integrated_Security); - hash.Add(SYNONYM.Connection_Lifetime, KEY.Load_Balance_Timeout); - hash.Add(SYNONYM.NET, KEY.Network_Library); - hash.Add(SYNONYM.NETWORK, KEY.Network_Library); - hash.Add(SYNONYM.Pwd, KEY.Password); - hash.Add(SYNONYM.PERSISTSECURITYINFO, KEY.Persist_Security_Info); - hash.Add(SYNONYM.UID, KEY.User_ID); - hash.Add(SYNONYM.User, KEY.User_ID); - hash.Add(SYNONYM.WSID, KEY.Workstation_Id); + hash.Add(SYNONYM.APP, KEY.Application_Name); + hash.Add(SYNONYM.Async, KEY.AsynchronousProcessing); + hash.Add(SYNONYM.EXTENDED_PROPERTIES, KEY.AttachDBFilename); + hash.Add(SYNONYM.INITIAL_FILE_NAME, KEY.AttachDBFilename); + hash.Add(SYNONYM.CONNECTION_TIMEOUT, KEY.Connect_Timeout); + hash.Add(SYNONYM.TIMEOUT, KEY.Connect_Timeout); + hash.Add(SYNONYM.LANGUAGE, KEY.Current_Language); + hash.Add(SYNONYM.ADDR, KEY.Data_Source); + hash.Add(SYNONYM.ADDRESS, KEY.Data_Source); + hash.Add(SYNONYM.NETWORK_ADDRESS, KEY.Data_Source); + hash.Add(SYNONYM.SERVER, KEY.Data_Source); + hash.Add(SYNONYM.DATABASE, KEY.Initial_Catalog); + hash.Add(SYNONYM.TRUSTED_CONNECTION, KEY.Integrated_Security); + hash.Add(SYNONYM.Connection_Lifetime, KEY.Load_Balance_Timeout); + hash.Add(SYNONYM.NET, KEY.Network_Library); + hash.Add(SYNONYM.NETWORK, KEY.Network_Library); + hash.Add(SYNONYM.Pwd, KEY.Password); + hash.Add(SYNONYM.PERSISTSECURITYINFO, KEY.Persist_Security_Info); + hash.Add(SYNONYM.UID, KEY.User_ID); + hash.Add(SYNONYM.User, KEY.User_ID); + hash.Add(SYNONYM.WSID, KEY.Workstation_Id); Debug.Assert(SqlConnectionStringBuilder.KeywordsCount + SynonymCount == hash.Count, "incorrect initial ParseSynonyms size"); _sqlClientSynonyms = hash; } @@ -750,6 +778,56 @@ namespace System.Data.SqlClient { } // ArgumentException and other types are raised as is (no wrapping) } + + internal SqlAuthenticationMethod ConvertValueToAuthenticationType() { + object value = base.Parsetable[KEY.Authentication]; + + string valStr = value as string; + if (valStr == null) { + return DEFAULT.Authentication; + } + + try { + return DbConnectionStringBuilderUtil.ConvertToAuthenticationType(KEY.Authentication, valStr); + } + catch (FormatException e) { + throw ADP.InvalidConnectionOptionValue(KEY.Authentication, e); + } + catch (OverflowException e) { + throw ADP.InvalidConnectionOptionValue(KEY.Authentication, e); + } + } + + /// + /// Convert the value to SqlConnectionColumnEncryptionSetting. + /// + /// + internal SqlConnectionColumnEncryptionSetting ConvertValueToColumnEncryptionSetting() { + object value = base.Parsetable[KEY.ColumnEncryptionSetting]; + + string valStr = value as string; + if (valStr == null) { + return DEFAULT.ColumnEncryptionSetting; + } + + try { + return DbConnectionStringBuilderUtil.ConvertToColumnEncryptionSetting(KEY.ColumnEncryptionSetting, valStr); + } + catch (FormatException e) { + throw ADP.InvalidConnectionOptionValue(KEY.ColumnEncryptionSetting, e); + } + catch (OverflowException e) { + throw ADP.InvalidConnectionOptionValue(KEY.ColumnEncryptionSetting, e); + } + } + + internal bool ConvertValueToEncrypt() { + // If the Authentication keyword is provided, default to Encrypt=true; + // otherwise keep old default for backwards compatibility + object authValue = base.Parsetable[KEY.Authentication]; + bool defaultEncryptValue = (authValue == null) ? DEFAULT.Encrypt : true; + return ConvertValueToBoolean(KEY.Encrypt, defaultEncryptValue); + } } } diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs index b5184a87ac..8e7714341c 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlConnectionStringBuilder.cs @@ -55,6 +55,8 @@ namespace System.Data.SqlClient { PacketSize, TypeSystemVersion, + Authentication, + ApplicationName, CurrentLanguage, WorkstationID, @@ -69,10 +71,14 @@ namespace System.Data.SqlClient { MultiSubnetFailover, + TransparentNetworkIPResolution, + ConnectRetryCount, ConnectRetryInterval, + ColumnEncryptionSetting, + // keep the count value last KeywordsCount } @@ -105,116 +111,124 @@ namespace System.Data.SqlClient { private int _connectRetryCount = DbConnectionStringDefaults.ConnectRetryCount; private int _connectRetryInterval = DbConnectionStringDefaults.ConnectRetryInterval; - private bool _asynchronousProcessing = DbConnectionStringDefaults.AsynchronousProcessing; - private bool _connectionReset = DbConnectionStringDefaults.ConnectionReset; - private bool _contextConnection = DbConnectionStringDefaults.ContextConnection; - private bool _encrypt = DbConnectionStringDefaults.Encrypt; - private bool _trustServerCertificate = DbConnectionStringDefaults.TrustServerCertificate; - private bool _enlist = DbConnectionStringDefaults.Enlist; - private bool _integratedSecurity = DbConnectionStringDefaults.IntegratedSecurity; - private bool _multipleActiveResultSets = DbConnectionStringDefaults.MultipleActiveResultSets; - private bool _multiSubnetFailover = DbConnectionStringDefaults.MultiSubnetFailover; - private bool _persistSecurityInfo = DbConnectionStringDefaults.PersistSecurityInfo; - private bool _pooling = DbConnectionStringDefaults.Pooling; - private bool _replication = DbConnectionStringDefaults.Replication; - private bool _userInstance = DbConnectionStringDefaults.UserInstance; - + private bool _asynchronousProcessing = DbConnectionStringDefaults.AsynchronousProcessing; + private bool _connectionReset = DbConnectionStringDefaults.ConnectionReset; + private bool _contextConnection = DbConnectionStringDefaults.ContextConnection; + private bool _encrypt = DbConnectionStringDefaults.Encrypt; + private bool _trustServerCertificate = DbConnectionStringDefaults.TrustServerCertificate; + private bool _enlist = DbConnectionStringDefaults.Enlist; + private bool _integratedSecurity = DbConnectionStringDefaults.IntegratedSecurity; + private bool _multipleActiveResultSets = DbConnectionStringDefaults.MultipleActiveResultSets; + private bool _multiSubnetFailover = DbConnectionStringDefaults.MultiSubnetFailover; + private bool _transparentNetworkIPResolution= DbConnectionStringDefaults.TransparentNetworkIPResolution; + private bool _persistSecurityInfo = DbConnectionStringDefaults.PersistSecurityInfo; + private bool _pooling = DbConnectionStringDefaults.Pooling; + private bool _replication = DbConnectionStringDefaults.Replication; + private bool _userInstance = DbConnectionStringDefaults.UserInstance; + private SqlAuthenticationMethod _authentication = DbConnectionStringDefaults.Authentication; + private SqlConnectionColumnEncryptionSetting _columnEncryptionSetting = DbConnectionStringDefaults.ColumnEncryptionSetting; static SqlConnectionStringBuilder() { string[] validKeywords = new string[KeywordsCount]; - validKeywords[(int)Keywords.ApplicationIntent] = DbConnectionStringKeywords.ApplicationIntent; - validKeywords[(int)Keywords.ApplicationName] = DbConnectionStringKeywords.ApplicationName; - validKeywords[(int)Keywords.AsynchronousProcessing] = DbConnectionStringKeywords.AsynchronousProcessing; - validKeywords[(int)Keywords.AttachDBFilename] = DbConnectionStringKeywords.AttachDBFilename; - validKeywords[(int)Keywords.ConnectionReset] = DbConnectionStringKeywords.ConnectionReset; - validKeywords[(int)Keywords.ContextConnection] = DbConnectionStringKeywords.ContextConnection; - validKeywords[(int)Keywords.ConnectTimeout] = DbConnectionStringKeywords.ConnectTimeout; - validKeywords[(int)Keywords.CurrentLanguage] = DbConnectionStringKeywords.CurrentLanguage; - validKeywords[(int)Keywords.DataSource] = DbConnectionStringKeywords.DataSource; - validKeywords[(int)Keywords.Encrypt] = DbConnectionStringKeywords.Encrypt; - validKeywords[(int)Keywords.Enlist] = DbConnectionStringKeywords.Enlist; - validKeywords[(int)Keywords.FailoverPartner] = DbConnectionStringKeywords.FailoverPartner; - validKeywords[(int)Keywords.InitialCatalog] = DbConnectionStringKeywords.InitialCatalog; - validKeywords[(int)Keywords.IntegratedSecurity] = DbConnectionStringKeywords.IntegratedSecurity; - validKeywords[(int)Keywords.LoadBalanceTimeout] = DbConnectionStringKeywords.LoadBalanceTimeout; - validKeywords[(int)Keywords.MaxPoolSize] = DbConnectionStringKeywords.MaxPoolSize; - validKeywords[(int)Keywords.MinPoolSize] = DbConnectionStringKeywords.MinPoolSize; - validKeywords[(int)Keywords.MultipleActiveResultSets] = DbConnectionStringKeywords.MultipleActiveResultSets; - validKeywords[(int)Keywords.MultiSubnetFailover] = DbConnectionStringKeywords.MultiSubnetFailover; -// validKeywords[(int)Keywords.NamedConnection] = DbConnectionStringKeywords.NamedConnection; - validKeywords[(int)Keywords.NetworkLibrary] = DbConnectionStringKeywords.NetworkLibrary; - validKeywords[(int)Keywords.PacketSize] = DbConnectionStringKeywords.PacketSize; - validKeywords[(int)Keywords.Password] = DbConnectionStringKeywords.Password; - validKeywords[(int)Keywords.PersistSecurityInfo] = DbConnectionStringKeywords.PersistSecurityInfo; - validKeywords[(int)Keywords.Pooling] = DbConnectionStringKeywords.Pooling; - validKeywords[(int)Keywords.Replication] = DbConnectionStringKeywords.Replication; - validKeywords[(int)Keywords.TransactionBinding] = DbConnectionStringKeywords.TransactionBinding; - validKeywords[(int)Keywords.TrustServerCertificate] = DbConnectionStringKeywords.TrustServerCertificate; - validKeywords[(int)Keywords.TypeSystemVersion] = DbConnectionStringKeywords.TypeSystemVersion; - validKeywords[(int)Keywords.UserID] = DbConnectionStringKeywords.UserID; - validKeywords[(int)Keywords.UserInstance] = DbConnectionStringKeywords.UserInstance; - validKeywords[(int)Keywords.WorkstationID] = DbConnectionStringKeywords.WorkstationID; - validKeywords[(int)Keywords.ConnectRetryCount] = DbConnectionStringKeywords.ConnectRetryCount; - validKeywords[(int)Keywords.ConnectRetryInterval] = DbConnectionStringKeywords.ConnectRetryInterval; + validKeywords[(int)Keywords.ApplicationIntent] = DbConnectionStringKeywords.ApplicationIntent; + validKeywords[(int)Keywords.ApplicationName] = DbConnectionStringKeywords.ApplicationName; + validKeywords[(int)Keywords.AsynchronousProcessing] = DbConnectionStringKeywords.AsynchronousProcessing; + validKeywords[(int)Keywords.AttachDBFilename] = DbConnectionStringKeywords.AttachDBFilename; + validKeywords[(int)Keywords.ConnectionReset] = DbConnectionStringKeywords.ConnectionReset; + validKeywords[(int)Keywords.ContextConnection] = DbConnectionStringKeywords.ContextConnection; + validKeywords[(int)Keywords.ConnectTimeout] = DbConnectionStringKeywords.ConnectTimeout; + validKeywords[(int)Keywords.CurrentLanguage] = DbConnectionStringKeywords.CurrentLanguage; + validKeywords[(int)Keywords.DataSource] = DbConnectionStringKeywords.DataSource; + validKeywords[(int)Keywords.Encrypt] = DbConnectionStringKeywords.Encrypt; + validKeywords[(int)Keywords.Enlist] = DbConnectionStringKeywords.Enlist; + validKeywords[(int)Keywords.FailoverPartner] = DbConnectionStringKeywords.FailoverPartner; + validKeywords[(int)Keywords.InitialCatalog] = DbConnectionStringKeywords.InitialCatalog; + validKeywords[(int)Keywords.IntegratedSecurity] = DbConnectionStringKeywords.IntegratedSecurity; + validKeywords[(int)Keywords.LoadBalanceTimeout] = DbConnectionStringKeywords.LoadBalanceTimeout; + validKeywords[(int)Keywords.MaxPoolSize] = DbConnectionStringKeywords.MaxPoolSize; + validKeywords[(int)Keywords.MinPoolSize] = DbConnectionStringKeywords.MinPoolSize; + validKeywords[(int)Keywords.MultipleActiveResultSets] = DbConnectionStringKeywords.MultipleActiveResultSets; + validKeywords[(int)Keywords.MultiSubnetFailover] = DbConnectionStringKeywords.MultiSubnetFailover; + validKeywords[(int)Keywords.TransparentNetworkIPResolution] = DbConnectionStringKeywords.TransparentNetworkIPResolution; +// validKeywords[(int)Keywords.NamedConnection] = DbConnectionStringKeywords.NamedConnection; + validKeywords[(int)Keywords.NetworkLibrary] = DbConnectionStringKeywords.NetworkLibrary; + validKeywords[(int)Keywords.PacketSize] = DbConnectionStringKeywords.PacketSize; + validKeywords[(int)Keywords.Password] = DbConnectionStringKeywords.Password; + validKeywords[(int)Keywords.PersistSecurityInfo] = DbConnectionStringKeywords.PersistSecurityInfo; + validKeywords[(int)Keywords.Pooling] = DbConnectionStringKeywords.Pooling; + validKeywords[(int)Keywords.Replication] = DbConnectionStringKeywords.Replication; + validKeywords[(int)Keywords.TransactionBinding] = DbConnectionStringKeywords.TransactionBinding; + validKeywords[(int)Keywords.TrustServerCertificate] = DbConnectionStringKeywords.TrustServerCertificate; + validKeywords[(int)Keywords.TypeSystemVersion] = DbConnectionStringKeywords.TypeSystemVersion; + validKeywords[(int)Keywords.UserID] = DbConnectionStringKeywords.UserID; + validKeywords[(int)Keywords.UserInstance] = DbConnectionStringKeywords.UserInstance; + validKeywords[(int)Keywords.WorkstationID] = DbConnectionStringKeywords.WorkstationID; + validKeywords[(int)Keywords.ConnectRetryCount] = DbConnectionStringKeywords.ConnectRetryCount; + validKeywords[(int)Keywords.ConnectRetryInterval] = DbConnectionStringKeywords.ConnectRetryInterval; + validKeywords[(int)Keywords.Authentication] = DbConnectionStringKeywords.Authentication; + validKeywords[(int)Keywords.ColumnEncryptionSetting] = DbConnectionStringKeywords.ColumnEncryptionSetting; _validKeywords = validKeywords; Dictionary hash = new Dictionary(KeywordsCount + SqlConnectionString.SynonymCount, StringComparer.OrdinalIgnoreCase); - hash.Add(DbConnectionStringKeywords.ApplicationIntent, Keywords.ApplicationIntent); - hash.Add(DbConnectionStringKeywords.ApplicationName, Keywords.ApplicationName); - hash.Add(DbConnectionStringKeywords.AsynchronousProcessing, Keywords.AsynchronousProcessing); - hash.Add(DbConnectionStringKeywords.AttachDBFilename, Keywords.AttachDBFilename); - hash.Add(DbConnectionStringKeywords.ConnectTimeout, Keywords.ConnectTimeout); - hash.Add(DbConnectionStringKeywords.ConnectionReset, Keywords.ConnectionReset); - hash.Add(DbConnectionStringKeywords.ContextConnection, Keywords.ContextConnection); - hash.Add(DbConnectionStringKeywords.CurrentLanguage, Keywords.CurrentLanguage); - hash.Add(DbConnectionStringKeywords.DataSource, Keywords.DataSource); - hash.Add(DbConnectionStringKeywords.Encrypt, Keywords.Encrypt); - hash.Add(DbConnectionStringKeywords.Enlist, Keywords.Enlist); - hash.Add(DbConnectionStringKeywords.FailoverPartner, Keywords.FailoverPartner); - hash.Add(DbConnectionStringKeywords.InitialCatalog, Keywords.InitialCatalog); - hash.Add(DbConnectionStringKeywords.IntegratedSecurity, Keywords.IntegratedSecurity); - hash.Add(DbConnectionStringKeywords.LoadBalanceTimeout, Keywords.LoadBalanceTimeout); - hash.Add(DbConnectionStringKeywords.MultipleActiveResultSets, Keywords.MultipleActiveResultSets); - hash.Add(DbConnectionStringKeywords.MaxPoolSize, Keywords.MaxPoolSize); - hash.Add(DbConnectionStringKeywords.MinPoolSize, Keywords.MinPoolSize); - hash.Add(DbConnectionStringKeywords.MultiSubnetFailover, Keywords.MultiSubnetFailover); -// hash.Add(DbConnectionStringKeywords.NamedConnection, Keywords.NamedConnection); - hash.Add(DbConnectionStringKeywords.NetworkLibrary, Keywords.NetworkLibrary); - hash.Add(DbConnectionStringKeywords.PacketSize, Keywords.PacketSize); - hash.Add(DbConnectionStringKeywords.Password, Keywords.Password); - hash.Add(DbConnectionStringKeywords.PersistSecurityInfo, Keywords.PersistSecurityInfo); - hash.Add(DbConnectionStringKeywords.Pooling, Keywords.Pooling); - hash.Add(DbConnectionStringKeywords.Replication, Keywords.Replication); - hash.Add(DbConnectionStringKeywords.TransactionBinding, Keywords.TransactionBinding); - hash.Add(DbConnectionStringKeywords.TrustServerCertificate, Keywords.TrustServerCertificate); - hash.Add(DbConnectionStringKeywords.TypeSystemVersion, Keywords.TypeSystemVersion); - hash.Add(DbConnectionStringKeywords.UserID, Keywords.UserID); - hash.Add(DbConnectionStringKeywords.UserInstance, Keywords.UserInstance); - hash.Add(DbConnectionStringKeywords.WorkstationID, Keywords.WorkstationID); - hash.Add(DbConnectionStringKeywords.ConnectRetryCount, Keywords.ConnectRetryCount); - hash.Add(DbConnectionStringKeywords.ConnectRetryInterval, Keywords.ConnectRetryInterval); + hash.Add(DbConnectionStringKeywords.ApplicationIntent, Keywords.ApplicationIntent); + hash.Add(DbConnectionStringKeywords.ApplicationName, Keywords.ApplicationName); + hash.Add(DbConnectionStringKeywords.AsynchronousProcessing, Keywords.AsynchronousProcessing); + hash.Add(DbConnectionStringKeywords.AttachDBFilename, Keywords.AttachDBFilename); + hash.Add(DbConnectionStringKeywords.ConnectTimeout, Keywords.ConnectTimeout); + hash.Add(DbConnectionStringKeywords.ConnectionReset, Keywords.ConnectionReset); + hash.Add(DbConnectionStringKeywords.ContextConnection, Keywords.ContextConnection); + hash.Add(DbConnectionStringKeywords.CurrentLanguage, Keywords.CurrentLanguage); + hash.Add(DbConnectionStringKeywords.DataSource, Keywords.DataSource); + hash.Add(DbConnectionStringKeywords.Encrypt, Keywords.Encrypt); + hash.Add(DbConnectionStringKeywords.Enlist, Keywords.Enlist); + hash.Add(DbConnectionStringKeywords.FailoverPartner, Keywords.FailoverPartner); + hash.Add(DbConnectionStringKeywords.InitialCatalog, Keywords.InitialCatalog); + hash.Add(DbConnectionStringKeywords.IntegratedSecurity, Keywords.IntegratedSecurity); + hash.Add(DbConnectionStringKeywords.LoadBalanceTimeout, Keywords.LoadBalanceTimeout); + hash.Add(DbConnectionStringKeywords.MultipleActiveResultSets, Keywords.MultipleActiveResultSets); + hash.Add(DbConnectionStringKeywords.MaxPoolSize, Keywords.MaxPoolSize); + hash.Add(DbConnectionStringKeywords.MinPoolSize, Keywords.MinPoolSize); + hash.Add(DbConnectionStringKeywords.MultiSubnetFailover, Keywords.MultiSubnetFailover); + hash.Add(DbConnectionStringKeywords.TransparentNetworkIPResolution, Keywords.TransparentNetworkIPResolution); +// hash.Add(DbConnectionStringKeywords.NamedConnection, Keywords.NamedConnection); + hash.Add(DbConnectionStringKeywords.NetworkLibrary, Keywords.NetworkLibrary); + hash.Add(DbConnectionStringKeywords.PacketSize, Keywords.PacketSize); + hash.Add(DbConnectionStringKeywords.Password, Keywords.Password); + hash.Add(DbConnectionStringKeywords.PersistSecurityInfo, Keywords.PersistSecurityInfo); + hash.Add(DbConnectionStringKeywords.Pooling, Keywords.Pooling); + hash.Add(DbConnectionStringKeywords.Replication, Keywords.Replication); + hash.Add(DbConnectionStringKeywords.TransactionBinding, Keywords.TransactionBinding); + hash.Add(DbConnectionStringKeywords.TrustServerCertificate, Keywords.TrustServerCertificate); + hash.Add(DbConnectionStringKeywords.TypeSystemVersion, Keywords.TypeSystemVersion); + hash.Add(DbConnectionStringKeywords.UserID, Keywords.UserID); + hash.Add(DbConnectionStringKeywords.UserInstance, Keywords.UserInstance); + hash.Add(DbConnectionStringKeywords.WorkstationID, Keywords.WorkstationID); + hash.Add(DbConnectionStringKeywords.ConnectRetryCount, Keywords.ConnectRetryCount); + hash.Add(DbConnectionStringKeywords.ConnectRetryInterval, Keywords.ConnectRetryInterval); + hash.Add(DbConnectionStringKeywords.Authentication, Keywords.Authentication); + hash.Add(DbConnectionStringKeywords.ColumnEncryptionSetting, Keywords.ColumnEncryptionSetting); - hash.Add(DbConnectionStringSynonyms.APP, Keywords.ApplicationName); - hash.Add(DbConnectionStringSynonyms.Async, Keywords.AsynchronousProcessing); - hash.Add(DbConnectionStringSynonyms.EXTENDEDPROPERTIES, Keywords.AttachDBFilename); - hash.Add(DbConnectionStringSynonyms.INITIALFILENAME, Keywords.AttachDBFilename); - hash.Add(DbConnectionStringSynonyms.CONNECTIONTIMEOUT, Keywords.ConnectTimeout); - hash.Add(DbConnectionStringSynonyms.TIMEOUT, Keywords.ConnectTimeout); - hash.Add(DbConnectionStringSynonyms.LANGUAGE, Keywords.CurrentLanguage); - hash.Add(DbConnectionStringSynonyms.ADDR, Keywords.DataSource); - hash.Add(DbConnectionStringSynonyms.ADDRESS, Keywords.DataSource); - hash.Add(DbConnectionStringSynonyms.NETWORKADDRESS, Keywords.DataSource); - hash.Add(DbConnectionStringSynonyms.SERVER, Keywords.DataSource); - hash.Add(DbConnectionStringSynonyms.DATABASE, Keywords.InitialCatalog); - hash.Add(DbConnectionStringSynonyms.TRUSTEDCONNECTION, Keywords.IntegratedSecurity); - hash.Add(DbConnectionStringSynonyms.ConnectionLifetime, Keywords.LoadBalanceTimeout); - hash.Add(DbConnectionStringSynonyms.NET, Keywords.NetworkLibrary); - hash.Add(DbConnectionStringSynonyms.NETWORK, Keywords.NetworkLibrary); - hash.Add(DbConnectionStringSynonyms.Pwd, Keywords.Password); - hash.Add(DbConnectionStringSynonyms.PERSISTSECURITYINFO, Keywords.PersistSecurityInfo); - hash.Add(DbConnectionStringSynonyms.UID, Keywords.UserID); - hash.Add(DbConnectionStringSynonyms.User, Keywords.UserID); - hash.Add(DbConnectionStringSynonyms.WSID, Keywords.WorkstationID); + hash.Add(DbConnectionStringSynonyms.APP, Keywords.ApplicationName); + hash.Add(DbConnectionStringSynonyms.Async, Keywords.AsynchronousProcessing); + hash.Add(DbConnectionStringSynonyms.EXTENDEDPROPERTIES, Keywords.AttachDBFilename); + hash.Add(DbConnectionStringSynonyms.INITIALFILENAME, Keywords.AttachDBFilename); + hash.Add(DbConnectionStringSynonyms.CONNECTIONTIMEOUT, Keywords.ConnectTimeout); + hash.Add(DbConnectionStringSynonyms.TIMEOUT, Keywords.ConnectTimeout); + hash.Add(DbConnectionStringSynonyms.LANGUAGE, Keywords.CurrentLanguage); + hash.Add(DbConnectionStringSynonyms.ADDR, Keywords.DataSource); + hash.Add(DbConnectionStringSynonyms.ADDRESS, Keywords.DataSource); + hash.Add(DbConnectionStringSynonyms.NETWORKADDRESS, Keywords.DataSource); + hash.Add(DbConnectionStringSynonyms.SERVER, Keywords.DataSource); + hash.Add(DbConnectionStringSynonyms.DATABASE, Keywords.InitialCatalog); + hash.Add(DbConnectionStringSynonyms.TRUSTEDCONNECTION, Keywords.IntegratedSecurity); + hash.Add(DbConnectionStringSynonyms.ConnectionLifetime, Keywords.LoadBalanceTimeout); + hash.Add(DbConnectionStringSynonyms.NET, Keywords.NetworkLibrary); + hash.Add(DbConnectionStringSynonyms.NETWORK, Keywords.NetworkLibrary); + hash.Add(DbConnectionStringSynonyms.Pwd, Keywords.Password); + hash.Add(DbConnectionStringSynonyms.PERSISTSECURITYINFO, Keywords.PersistSecurityInfo); + hash.Add(DbConnectionStringSynonyms.UID, Keywords.UserID); + hash.Add(DbConnectionStringSynonyms.User, Keywords.UserID); + hash.Add(DbConnectionStringSynonyms.WSID, Keywords.WorkstationID); Debug.Assert((KeywordsCount + SqlConnectionString.SynonymCount) == hash.Count, "initial expected size is incorrect"); _keywords = hash; @@ -238,45 +252,48 @@ namespace System.Data.SqlClient { if (null != value) { Keywords index = GetIndex(keyword); switch(index) { - case Keywords.ApplicationIntent: this.ApplicationIntent = ConvertToApplicationIntent(keyword, value); break; - case Keywords.ApplicationName: ApplicationName = ConvertToString(value); break; - case Keywords.AttachDBFilename: AttachDBFilename = ConvertToString(value); break; - case Keywords.CurrentLanguage: CurrentLanguage = ConvertToString(value); break; - case Keywords.DataSource: DataSource = ConvertToString(value); break; - case Keywords.FailoverPartner: FailoverPartner = ConvertToString(value); break; - case Keywords.InitialCatalog: InitialCatalog = ConvertToString(value); break; -// case Keywords.NamedConnection: NamedConnection = ConvertToString(value); break; - case Keywords.NetworkLibrary: NetworkLibrary = ConvertToString(value); break; - case Keywords.Password: Password = ConvertToString(value); break; - case Keywords.UserID: UserID = ConvertToString(value); break; - case Keywords.TransactionBinding: TransactionBinding = ConvertToString(value); break; - case Keywords.TypeSystemVersion: TypeSystemVersion = ConvertToString(value); break; - case Keywords.WorkstationID: WorkstationID = ConvertToString(value); break; + case Keywords.ApplicationIntent: this.ApplicationIntent = ConvertToApplicationIntent(keyword, value); break; + case Keywords.ApplicationName: ApplicationName = ConvertToString(value); break; + case Keywords.AttachDBFilename: AttachDBFilename = ConvertToString(value); break; + case Keywords.CurrentLanguage: CurrentLanguage = ConvertToString(value); break; + case Keywords.DataSource: DataSource = ConvertToString(value); break; + case Keywords.FailoverPartner: FailoverPartner = ConvertToString(value); break; + case Keywords.InitialCatalog: InitialCatalog = ConvertToString(value); break; +// case Keywords.NamedConnection: NamedConnection = ConvertToString(value); break; + case Keywords.NetworkLibrary: NetworkLibrary = ConvertToString(value); break; + case Keywords.Password: Password = ConvertToString(value); break; + case Keywords.UserID: UserID = ConvertToString(value); break; + case Keywords.TransactionBinding: TransactionBinding = ConvertToString(value); break; + case Keywords.TypeSystemVersion: TypeSystemVersion = ConvertToString(value); break; + case Keywords.WorkstationID: WorkstationID = ConvertToString(value); break; - case Keywords.ConnectTimeout: ConnectTimeout = ConvertToInt32(value); break; - case Keywords.LoadBalanceTimeout: LoadBalanceTimeout = ConvertToInt32(value); break; - case Keywords.MaxPoolSize: MaxPoolSize = ConvertToInt32(value); break; - case Keywords.MinPoolSize: MinPoolSize = ConvertToInt32(value); break; - case Keywords.PacketSize: PacketSize = ConvertToInt32(value); break; + case Keywords.ConnectTimeout: ConnectTimeout = ConvertToInt32(value); break; + case Keywords.LoadBalanceTimeout: LoadBalanceTimeout = ConvertToInt32(value); break; + case Keywords.MaxPoolSize: MaxPoolSize = ConvertToInt32(value); break; + case Keywords.MinPoolSize: MinPoolSize = ConvertToInt32(value); break; + case Keywords.PacketSize: PacketSize = ConvertToInt32(value); break; - case Keywords.IntegratedSecurity: IntegratedSecurity = ConvertToIntegratedSecurity(value); break; + case Keywords.IntegratedSecurity: IntegratedSecurity = ConvertToIntegratedSecurity(value); break; - case Keywords.AsynchronousProcessing: AsynchronousProcessing = ConvertToBoolean(value); break; + case Keywords.Authentication: Authentication = ConvertToAuthenticationType(keyword, value); break; + case Keywords.ColumnEncryptionSetting: ColumnEncryptionSetting = ConvertToColumnEncryptionSetting(keyword, value); break; + case Keywords.AsynchronousProcessing: AsynchronousProcessing = ConvertToBoolean(value); break; #pragma warning disable 618 // Obsolete ConnectionReset - case Keywords.ConnectionReset: ConnectionReset = ConvertToBoolean(value); break; + case Keywords.ConnectionReset: ConnectionReset = ConvertToBoolean(value); break; #pragma warning restore 618 - case Keywords.ContextConnection: ContextConnection = ConvertToBoolean(value); break; - case Keywords.Encrypt: Encrypt = ConvertToBoolean(value); break; - case Keywords.TrustServerCertificate: TrustServerCertificate = ConvertToBoolean(value); break; - case Keywords.Enlist: Enlist = ConvertToBoolean(value); break; - case Keywords.MultipleActiveResultSets: MultipleActiveResultSets = ConvertToBoolean(value); break; - case Keywords.MultiSubnetFailover: MultiSubnetFailover = ConvertToBoolean(value); break; - case Keywords.PersistSecurityInfo: PersistSecurityInfo = ConvertToBoolean(value); break; - case Keywords.Pooling: Pooling = ConvertToBoolean(value); break; - case Keywords.Replication: Replication = ConvertToBoolean(value); break; - case Keywords.UserInstance: UserInstance = ConvertToBoolean(value); break; - case Keywords.ConnectRetryCount: ConnectRetryCount = ConvertToInt32(value); break; - case Keywords.ConnectRetryInterval: ConnectRetryInterval = ConvertToInt32(value); break; + case Keywords.ContextConnection: ContextConnection = ConvertToBoolean(value); break; + case Keywords.Encrypt: Encrypt = ConvertToBoolean(value); break; + case Keywords.TrustServerCertificate: TrustServerCertificate = ConvertToBoolean(value); break; + case Keywords.Enlist: Enlist = ConvertToBoolean(value); break; + case Keywords.MultipleActiveResultSets: MultipleActiveResultSets = ConvertToBoolean(value); break; + case Keywords.MultiSubnetFailover: MultiSubnetFailover = ConvertToBoolean(value); break; + case Keywords.TransparentNetworkIPResolution: TransparentNetworkIPResolution = ConvertToBoolean(value); break; + case Keywords.PersistSecurityInfo: PersistSecurityInfo = ConvertToBoolean(value); break; + case Keywords.Pooling: Pooling = ConvertToBoolean(value); break; + case Keywords.Replication: Replication = ConvertToBoolean(value); break; + case Keywords.UserInstance: UserInstance = ConvertToBoolean(value); break; + case Keywords.ConnectRetryCount: ConnectRetryCount = ConvertToInt32(value); break; + case Keywords.ConnectRetryInterval: ConnectRetryInterval = ConvertToInt32(value); break; default: Debug.Assert(false, "unexpected keyword"); @@ -420,6 +437,22 @@ namespace System.Data.SqlClient { _encrypt = value; } } + + [DisplayName(DbConnectionStringKeywords.ColumnEncryptionSetting)] + [ResCategoryAttribute(Res.DataCategory_Security)] + [ResDescriptionAttribute(Res.TCE_DbConnectionString_ColumnEncryptionSetting)] + [RefreshPropertiesAttribute(RefreshProperties.All)] + public SqlConnectionColumnEncryptionSetting ColumnEncryptionSetting { + get { return _columnEncryptionSetting; } + set { + if (!DbConnectionStringBuilderUtil.IsValidColumnEncryptionSetting(value)) { + throw ADP.InvalidEnumerationValue(typeof(SqlConnectionColumnEncryptionSetting), (int)value); + } + + SetColumnEncryptionSettingValue(value); + _columnEncryptionSetting = value; + } + } [DisplayName(DbConnectionStringKeywords.TrustServerCertificate)] [ResCategoryAttribute(Res.DataCategory_Security)] @@ -483,6 +516,22 @@ namespace System.Data.SqlClient { } } + [DisplayName(DbConnectionStringKeywords.Authentication)] + [ResCategoryAttribute(Res.DataCategory_Security)] + [ResDescriptionAttribute(Res.DbConnectionString_Authentication)] + [RefreshPropertiesAttribute(RefreshProperties.All)] + public SqlAuthenticationMethod Authentication { + get { return _authentication; } + set { + if (!DbConnectionStringBuilderUtil.IsValidAuthenticationTypeValue(value)) { + throw ADP.InvalidEnumerationValue(typeof(SqlAuthenticationMethod), (int)value); + } + + SetAuthenticationValue(value); + _authentication = value; + } + } + [DisplayName(DbConnectionStringKeywords.LoadBalanceTimeout)] [ResCategoryAttribute(Res.DataCategory_Pooling)] [ResDescriptionAttribute(Res.DbConnectionString_LoadBalanceTimeout)] @@ -584,6 +633,19 @@ namespace System.Data.SqlClient { _multiSubnetFailover = value; } } + + [DisplayName(DbConnectionStringKeywords.TransparentNetworkIPResolution)] + [ResCategoryAttribute(Res.DataCategory_Source)] + [ResDescriptionAttribute(Res.DbConnectionString_TransparentNetworkIPResolution)] + [RefreshPropertiesAttribute(RefreshProperties.All)] + public bool TransparentNetworkIPResolution + { + get { return _transparentNetworkIPResolution; } + set { + SetValue(DbConnectionStringKeywords.TransparentNetworkIPResolution, value); + _transparentNetworkIPResolution = value; + } + } /* [DisplayName(DbConnectionStringKeywords.NamedConnection)] [ResCategoryAttribute(Res.DataCategory_NamedConnectionString)] @@ -816,46 +878,69 @@ namespace System.Data.SqlClient { private static ApplicationIntent ConvertToApplicationIntent(string keyword, object value) { return DbConnectionStringBuilderUtil.ConvertToApplicationIntent(keyword, value); } + private static SqlAuthenticationMethod ConvertToAuthenticationType(string keyword, object value) { + return DbConnectionStringBuilderUtil.ConvertToAuthenticationType(keyword, value); + } + + /// + /// Convert to SqlConnectionColumnEncryptionSetting. + /// + /// + /// + private static SqlConnectionColumnEncryptionSetting ConvertToColumnEncryptionSetting(string keyword, object value) { + return DbConnectionStringBuilderUtil.ConvertToColumnEncryptionSetting(keyword, value); + } + + internal override string ConvertValueToString(object value) { + if (value is SqlAuthenticationMethod) { + return DbConnectionStringBuilderUtil.AuthenticationTypeToString((SqlAuthenticationMethod)value); + } + else { + return base.ConvertValueToString(value); + } + } private object GetAt(Keywords index) { switch(index) { - case Keywords.ApplicationIntent: return this.ApplicationIntent; - case Keywords.ApplicationName: return ApplicationName; - case Keywords.AsynchronousProcessing: return AsynchronousProcessing; - case Keywords.AttachDBFilename: return AttachDBFilename; - case Keywords.ConnectTimeout: return ConnectTimeout; + case Keywords.ApplicationIntent: return this.ApplicationIntent; + case Keywords.ApplicationName: return ApplicationName; + case Keywords.AsynchronousProcessing: return AsynchronousProcessing; + case Keywords.AttachDBFilename: return AttachDBFilename; + case Keywords.ConnectTimeout: return ConnectTimeout; #pragma warning disable 618 // Obsolete ConnectionReset - case Keywords.ConnectionReset: return ConnectionReset; + case Keywords.ConnectionReset: return ConnectionReset; #pragma warning restore 618 - case Keywords.ContextConnection: return ContextConnection; - case Keywords.CurrentLanguage: return CurrentLanguage; - case Keywords.DataSource: return DataSource; - case Keywords.Encrypt: return Encrypt; - case Keywords.Enlist: return Enlist; - case Keywords.FailoverPartner: return FailoverPartner; - case Keywords.InitialCatalog: return InitialCatalog; - case Keywords.IntegratedSecurity: return IntegratedSecurity; - case Keywords.LoadBalanceTimeout: return LoadBalanceTimeout; - case Keywords.MultipleActiveResultSets: return MultipleActiveResultSets; - case Keywords.MaxPoolSize: return MaxPoolSize; - case Keywords.MinPoolSize: return MinPoolSize; - case Keywords.MultiSubnetFailover: return MultiSubnetFailover; -// case Keywords.NamedConnection: return NamedConnection; - case Keywords.NetworkLibrary: return NetworkLibrary; - case Keywords.PacketSize: return PacketSize; - case Keywords.Password: return Password; - case Keywords.PersistSecurityInfo: return PersistSecurityInfo; - case Keywords.Pooling: return Pooling; - case Keywords.Replication: return Replication; - case Keywords.TransactionBinding: return TransactionBinding; - case Keywords.TrustServerCertificate: return TrustServerCertificate; - case Keywords.TypeSystemVersion: return TypeSystemVersion; - case Keywords.UserID: return UserID; - case Keywords.UserInstance: return UserInstance; - case Keywords.WorkstationID: return WorkstationID; - case Keywords.ConnectRetryCount: return ConnectRetryCount; - case Keywords.ConnectRetryInterval: return ConnectRetryInterval; - + case Keywords.ContextConnection: return ContextConnection; + case Keywords.CurrentLanguage: return CurrentLanguage; + case Keywords.DataSource: return DataSource; + case Keywords.Encrypt: return Encrypt; + case Keywords.Enlist: return Enlist; + case Keywords.FailoverPartner: return FailoverPartner; + case Keywords.InitialCatalog: return InitialCatalog; + case Keywords.IntegratedSecurity: return IntegratedSecurity; + case Keywords.LoadBalanceTimeout: return LoadBalanceTimeout; + case Keywords.MultipleActiveResultSets: return MultipleActiveResultSets; + case Keywords.MaxPoolSize: return MaxPoolSize; + case Keywords.MinPoolSize: return MinPoolSize; + case Keywords.MultiSubnetFailover: return MultiSubnetFailover; + case Keywords.TransparentNetworkIPResolution: return TransparentNetworkIPResolution; +// case Keywords.NamedConnection: return NamedConnection; + case Keywords.NetworkLibrary: return NetworkLibrary; + case Keywords.PacketSize: return PacketSize; + case Keywords.Password: return Password; + case Keywords.PersistSecurityInfo: return PersistSecurityInfo; + case Keywords.Pooling: return Pooling; + case Keywords.Replication: return Replication; + case Keywords.TransactionBinding: return TransactionBinding; + case Keywords.TrustServerCertificate: return TrustServerCertificate; + case Keywords.TypeSystemVersion: return TypeSystemVersion; + case Keywords.UserID: return UserID; + case Keywords.UserInstance: return UserInstance; + case Keywords.WorkstationID: return WorkstationID; + case Keywords.ConnectRetryCount: return ConnectRetryCount; + case Keywords.ConnectRetryInterval: return ConnectRetryInterval; + case Keywords.Authentication: return Authentication; + case Keywords.ColumnEncryptionSetting: return ColumnEncryptionSetting; default: Debug.Assert(false, "unexpected keyword"); throw ADP.KeywordNotSupported(_validKeywords[(int)index]); @@ -924,6 +1009,9 @@ namespace System.Data.SqlClient { case Keywords.AttachDBFilename: _attachDBFilename = DbConnectionStringDefaults.AttachDBFilename; break; + case Keywords.Authentication: + _authentication = DbConnectionStringDefaults.Authentication; + break; case Keywords.ConnectTimeout: _connectTimeout = DbConnectionStringDefaults.ConnectTimeout; break; @@ -969,6 +1057,9 @@ namespace System.Data.SqlClient { case Keywords.MultiSubnetFailover: _multiSubnetFailover = DbConnectionStringDefaults.MultiSubnetFailover; break; + case Keywords.TransparentNetworkIPResolution: + _transparentNetworkIPResolution = DbConnectionStringDefaults.TransparentNetworkIPResolution; + break; // case Keywords.NamedConnection: // _namedConnection = DbConnectionStringDefaults.NamedConnection; // break; @@ -1014,6 +1105,9 @@ namespace System.Data.SqlClient { case Keywords.WorkstationID: _workstationID = DbConnectionStringDefaults.WorkstationID; break; + case Keywords.ColumnEncryptionSetting: + _columnEncryptionSetting = DbConnectionStringDefaults.ColumnEncryptionSetting; + break; default: Debug.Assert(false, "unexpected keyword"); throw ADP.KeywordNotSupported(_validKeywords[(int)index]); @@ -1031,9 +1125,17 @@ namespace System.Data.SqlClient { base[keyword] = value; } private void SetApplicationIntentValue(ApplicationIntent value) { - Debug.Assert(DbConnectionStringBuilderUtil.IsValidApplicationIntentValue(value), "invalid value"); + Debug.Assert(DbConnectionStringBuilderUtil.IsValidApplicationIntentValue(value), "Invalid value for ApplicationIntent"); base[DbConnectionStringKeywords.ApplicationIntent] = DbConnectionStringBuilderUtil.ApplicationIntentToString(value); } + private void SetAuthenticationValue(SqlAuthenticationMethod value) { + Debug.Assert(DbConnectionStringBuilderUtil.IsValidAuthenticationTypeValue(value), "Invalid value for AuthenticationType"); + base[DbConnectionStringKeywords.Authentication] = DbConnectionStringBuilderUtil.AuthenticationTypeToString(value); + } + private void SetColumnEncryptionSettingValue(SqlConnectionColumnEncryptionSetting value) { + Debug.Assert(DbConnectionStringBuilderUtil.IsValidColumnEncryptionSetting(value), "Invalid value for SqlConnectionColumnEncryptionSetting"); + base[DbConnectionStringKeywords.ColumnEncryptionSetting] = DbConnectionStringBuilderUtil.ColumnEncryptionSettingToString(value); + } public override bool ShouldSerialize(string keyword) { ADP.CheckArgumentNull(keyword, "keyword"); diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlDataReader.cs.REMOVED.git-id b/external/referencesource/System.Data/System/Data/SqlClient/SqlDataReader.cs.REMOVED.git-id index c25d0438b8..7760fb7e8e 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlDataReader.cs.REMOVED.git-id +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlDataReader.cs.REMOVED.git-id @@ -1 +1 @@ -ad91abda6282cb0d9187f875d0e7e995cc25c965 \ No newline at end of file +8e04c42254201997009d8e392d25ddbcad7d4f57 \ No newline at end of file diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlDelegatedTransaction.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlDelegatedTransaction.cs index 44fad3c95d..60edc0e400 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlDelegatedTransaction.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlDelegatedTransaction.cs @@ -11,6 +11,7 @@ namespace System.Data.SqlClient { using System.Data.Common; using System.Data.SqlClient; using System.Diagnostics; + using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Threading; @@ -19,6 +20,7 @@ namespace System.Data.SqlClient { sealed internal class SqlDelegatedTransaction : SysTx.IPromotableSinglePhaseNotification { private static int _objectTypeCount; private readonly int _objectID = Interlocked.Increment(ref _objectTypeCount); + private const int _globalTransactionsTokenVersionSizeInBytes = 4; // the size of the version in the PromotedDTCToken for Global Transactions internal int ObjectID { get { return _objectID; @@ -163,6 +165,20 @@ namespace System.Data.SqlClient { connection.ExecuteTransaction(SqlInternalConnection.TransactionRequest.Promote, null, IsolationLevel.Unspecified, _internalTransaction, true); returnValue = _connection.PromotedDTCToken; + + // For Global Transactions, we need to set the Transaction Id since we use a Non-MSDTC Promoter type. + if(_connection.IsGlobalTransaction) { + if (SysTxForGlobalTransactions.SetDistributedTransactionIdentifier == null) { + throw SQL.UnsupportedSysTxForGlobalTransactions(); + } + + if(!_connection.IsGlobalTransactionsEnabledForServer) { + throw SQL.GlobalTransactionsNotEnabled(); + } + + SysTxForGlobalTransactions.SetDistributedTransactionIdentifier.Invoke(_atomicTransaction, new object[] { this, GetGlobalTxnIdentifierFromToken() }); + } + promoteException = null; } catch (SqlException e) { @@ -453,5 +469,12 @@ namespace System.Data.SqlClient { } } + // Get the server-side Global Transaction Id from the PromotedDTCToken + // Skip first 4 bytes since they contain the version + private Guid GetGlobalTxnIdentifierFromToken() { + byte[] txnGuid = new byte[16]; + Array.Copy(_connection.PromotedDTCToken, _globalTransactionsTokenVersionSizeInBytes /* Skip the version */, txnGuid, 0, txnGuid.Length); + return new Guid(txnGuid); + } } } diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEventHandler.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEventHandler.cs index c299cee510..d6c63875a8 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlInfoMessageEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// blained +// laled //------------------------------------------------------------------------------ namespace System.Data.SqlClient { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnection.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnection.cs index 105f443236..6221416a11 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnection.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnection.cs @@ -30,7 +30,11 @@ namespace System.Data.SqlClient private bool _isEnlistedInTransaction; // is the server-side connection enlisted? true while we're enlisted, reset only after we send a null... private byte[] _promotedDTCToken; // token returned by the server when we promote transaction private byte[] _whereAbouts; // cache the whereabouts (DTC Address) for exporting - + + private bool _isGlobalTransaction = false; // Whether this is a Global Transaction (Non-MSDTC, Azure SQL DB Transaction) + private bool _isGlobalTransactionEnabledForServer = false; // Whether Global Transactions are enabled for this Azure SQL DB Server + private static readonly Guid _globalTransactionTMID = new Guid("1c742caf-6680-40ea-9c26-6b6846079764"); // ID of the Non-MSDTC, Azure SQL DB Transaction Manager + // if connection is not open: null // if connection is open: currently active database internal string CurrentDatabase { get; set; } @@ -147,7 +151,25 @@ namespace System.Data.SqlClient _promotedDTCToken = value; } } - + + internal bool IsGlobalTransaction { + get { + return _isGlobalTransaction; + } + set { + _isGlobalTransaction = value; + } + } + + internal bool IsGlobalTransactionsEnabledForServer { + get { + return _isGlobalTransactionEnabledForServer; + } + set { + _isGlobalTransactionEnabledForServer = value; + } + } + override public DbTransaction BeginTransaction(IsolationLevel iso) { return BeginSqlTransaction(iso, null, false); } @@ -389,8 +411,35 @@ namespace System.Data.SqlClient // our delegated transaction, and proceed to enlist // in the promoted one. - if (tx.EnlistPromotableSinglePhase(delegatedTransaction)) { - hasDelegatedTransaction = true; + // NOTE: Global Transactions is an Azure SQL DB only + // feature where the Transaction Manager (TM) is not + // MS-DTC. Sys.Tx added APIs to support Non MS-DTC + // promoter types/TM in .NET 4.6.1. Following directions + // from .NETFX shiproom, to avoid a "hard-dependency" + // (compile time) on Sys.Tx, we use reflection to invoke + // the new APIs. Further, the _isGlobalTransaction flag + // indicates that this is an Azure SQL DB Transaction + // that could be promoted to a Global Transaction (it's + // always false for on-prem Sql Server). The Promote() + // call in SqlDelegatedTransaction makes sure that the + // right Sys.Tx.dll is loaded and that Global Transactions + // are actually allowed for this Azure SQL DB. + + if (_isGlobalTransaction) { + if (SysTxForGlobalTransactions.EnlistPromotableSinglePhase == null) { + // This could be a local Azure SQL DB transaction. + hasDelegatedTransaction = tx.EnlistPromotableSinglePhase(delegatedTransaction); + } + else { + hasDelegatedTransaction = (bool)SysTxForGlobalTransactions.EnlistPromotableSinglePhase.Invoke(tx, new object[] { delegatedTransaction, _globalTransactionTMID }); + } + } + else { + // This is an MS-DTC distributed transaction + hasDelegatedTransaction = tx.EnlistPromotableSinglePhase(delegatedTransaction); + } + + if (hasDelegatedTransaction) { this.DelegatedTransaction = delegatedTransaction; @@ -438,16 +487,25 @@ namespace System.Data.SqlClient byte[] cookie = null; - if (null == _whereAbouts) { - byte[] dtcAddress = GetDTCAddress(); + if (_isGlobalTransaction) { + if (SysTxForGlobalTransactions.GetPromotedToken == null) { + throw SQL.UnsupportedSysTxForGlobalTransactions(); + } - if (null == dtcAddress) { - throw SQL.CannotGetDTCAddress(); - } - _whereAbouts = dtcAddress; + cookie = (byte[])SysTxForGlobalTransactions.GetPromotedToken.Invoke(tx, null); + } + else { + if (null == _whereAbouts) { + byte[] dtcAddress = GetDTCAddress(); + + if (null == dtcAddress) { + throw SQL.CannotGetDTCAddress(); + } + _whereAbouts = dtcAddress; + } + + cookie = GetTransactionCookie(tx, _whereAbouts); } - - cookie = GetTransactionCookie(tx, _whereAbouts); // send cookie to server to finish enlistment PropagateTransactionCookie(cookie); diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionTds.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionTds.cs deleted file mode 100644 index 82e3138fd7..0000000000 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionTds.cs +++ /dev/null @@ -1,2009 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// [....] -// [....] -//------------------------------------------------------------------------------ - -namespace System.Data.SqlClient -{ - using System; - using System.Collections.Generic; - using System.Data; - using System.Data.Common; - using System.Data.ProviderBase; - using System.Diagnostics; - using System.Globalization; - using System.Reflection; - using System.Runtime.CompilerServices; - using System.Runtime.ConstrainedExecution; - using System.Runtime.InteropServices; - using System.Security; - using System.Security.Permissions; - using System.Text; - using System.Threading; - using SysTx = System.Transactions; - using System.Diagnostics.CodeAnalysis; - using System.Threading.Tasks; - - - internal class SessionStateRecord { - internal bool _recoverable; - internal UInt32 _version; - internal Int32 _dataLength; - internal byte[] _data; - } - - internal class SessionData { - internal const int _maxNumberOfSessionStates = 256; - internal UInt32 _tdsVersion; - internal bool _encrypted; - - internal string _database; - internal SqlCollation _collation; - internal string _language; - - internal string _initialDatabase; - internal SqlCollation _initialCollation; - internal string _initialLanguage; - - internal byte _unrecoverableStatesCount = 0; - internal Dictionary> _resolvedAliases; - -#if DEBUG - internal bool _debugReconnectDataApplied; -#endif - - internal SessionStateRecord[] _delta = new SessionStateRecord[_maxNumberOfSessionStates]; - internal bool _deltaDirty = false; - internal byte[][] _initialState = new byte[_maxNumberOfSessionStates][]; - - public SessionData(SessionData recoveryData) { - _initialDatabase = recoveryData._initialDatabase; - _initialCollation = recoveryData._initialCollation; - _initialLanguage = recoveryData._initialLanguage; - _resolvedAliases = recoveryData._resolvedAliases; - - for (int i = 0; i < _maxNumberOfSessionStates; i++) { - if (recoveryData._initialState[i] != null) { - _initialState[i] = (byte[])recoveryData._initialState[i].Clone(); - } - } - } - - public SessionData() { - _resolvedAliases = new Dictionary>(2); - } - - public void Reset() { - _database = null; - _collation = null; - _language = null; - if (_deltaDirty) { - _delta = new SessionStateRecord[_maxNumberOfSessionStates]; - _deltaDirty = false; - } - _unrecoverableStatesCount = 0; - } - - [Conditional("DEBUG")] - public void AssertUnrecoverableStateCountIsCorrect() { - byte unrecoverableCount = 0; - foreach (var state in _delta) { - if (state != null && !state._recoverable) - unrecoverableCount++; - } - Debug.Assert(unrecoverableCount == _unrecoverableStatesCount, "Unrecoverable count does not match"); - } - } - - sealed internal class SqlInternalConnectionTds : SqlInternalConnection, IDisposable { - // CONNECTION AND STATE VARIABLES - private readonly SqlConnectionPoolGroupProviderInfo _poolGroupProviderInfo; // will only be null when called for ChangePassword, or creating SSE User Instance - private TdsParser _parser; - private SqlLoginAck _loginAck; - private SqlCredential _credential; - - // Connection Resiliency - private bool _sessionRecoveryRequested; - internal bool _sessionRecoveryAcknowledged; - internal SessionData _currentSessionData; // internal for use from TdsParser only, otehr should use CurrentSessionData property that will fix database and language - private SessionData _recoverySessionData; - - internal SessionData CurrentSessionData { - get { - if (_currentSessionData != null) { - _currentSessionData._database = CurrentDatabase; - _currentSessionData._language = _currentLanguage; - } - return _currentSessionData; - } - } - - // FOR POOLING - private bool _fConnectionOpen = false; - - // FOR CONNECTION RESET MANAGEMENT - private bool _fResetConnection; - private string _originalDatabase; - private string _currentFailoverPartner; // only set by ENV change from server - private string _originalLanguage; - private string _currentLanguage; - private int _currentPacketSize; - private int _asyncCommandCount; // number of async Begins minus number of async Ends. - - // FOR SSE - private string _instanceName = String.Empty; - - // FOR NOTIFICATIONS - private DbConnectionPoolIdentity _identity; // Used to lookup info for notification matching Start(). - - // FOR SYNCHRONIZATION IN TdsParser - // How to use these locks: - // 1. Whenever writing to the connection (with the exception of Cancellation) the _parserLock MUST be taken - // 2. _parserLock will also be taken during close (to prevent closing in the middle of a write) - // 3. Whenever you have the _parserLock and are calling a method that would cause the connection to close if it failed (with the exception of any writing method), you MUST set ThreadHasParserLockForClose to true - // * This is to prevent the connection deadlocking with itself (since you already have the _parserLock, and Closing the connection will attempt to re-take that lock) - // * It is safe to set ThreadHasParserLockForClose to true when writing as well, but it is unneccesary - // * If you have a method that takes _parserLock, it is a good idea check ThreadHasParserLockForClose first (if you don't expect _parserLock to be taken by something higher on the stack, then you should at least assert that it is false) - // 4. ThreadHasParserLockForClose is thread-specific - this means that you must set it to false before returning a Task, and set it back to true in the continuation - // 5. ThreadHasParserLockForClose should only be modified if you currently own the _parserLock - // 6. Reading ThreadHasParserLockForClose is thread-safe - internal class SyncAsyncLock - { - SemaphoreSlim semaphore = new SemaphoreSlim(1); - - internal void Wait(bool canReleaseFromAnyThread) - { - Monitor.Enter(semaphore); // semaphore is used as lock object, no relation to SemaphoreSlim.Wait/Release methods - if (canReleaseFromAnyThread || semaphore.CurrentCount==0) { - semaphore.Wait(); - if (canReleaseFromAnyThread) { - Monitor.Exit(semaphore); - } - else { - semaphore.Release(); - } - } - } - - internal void Wait(bool canReleaseFromAnyThread, int timeout, ref bool lockTaken) { - lockTaken = false; - bool hasMonitor = false; - try { - Monitor.TryEnter(semaphore, timeout, ref hasMonitor); // semaphore is used as lock object, no relation to SemaphoreSlim.Wait/Release methods - if (hasMonitor) { - if ((canReleaseFromAnyThread) || (semaphore.CurrentCount == 0)) { - if (semaphore.Wait(timeout)) { - if (canReleaseFromAnyThread) { - Monitor.Exit(semaphore); - hasMonitor = false; - } - else { - semaphore.Release(); - } - lockTaken = true; - } - } - else { - lockTaken = true; - } - } - } - finally - { - if ((!lockTaken) && (hasMonitor)) { - Monitor.Exit(semaphore); - } - } - } - - internal void Release() - { - if (semaphore.CurrentCount==0) { // semaphore methods were used for locking - semaphore.Release(); - } - else { - Monitor.Exit(semaphore); - } - } - - - internal bool CanBeReleasedFromAnyThread { - get { - return semaphore.CurrentCount==0; - } - } - - // Necessary but not sufficient condition for thread to have lock (since sempahore may be obtained by any thread) - internal bool ThreadMayHaveLock() { - return Monitor.IsEntered(semaphore) || semaphore.CurrentCount == 0; - } - } - - - internal SyncAsyncLock _parserLock = new SyncAsyncLock(); - private int _threadIdOwningParserLock = -1; - - private SqlConnectionTimeoutErrorInternal timeoutErrorInternal; - - internal SqlConnectionTimeoutErrorInternal TimeoutErrorInternal - { - get { return timeoutErrorInternal; } - } - - // OTHER STATE VARIABLES AND REFERENCES - - internal Guid _clientConnectionId = Guid.Empty; - - // Routing information (ROR) - RoutingInfo _routingInfo = null; - private Guid _originalClientConnectionId = Guid.Empty; - private string _routingDestination = null; - - // although the new password is generally not used it must be passed to the c'tor - // the new Login7 packet will always write out the new password (or a length of zero and no bytes if not present) - // - internal SqlInternalConnectionTds( - DbConnectionPoolIdentity identity, - SqlConnectionString connectionOptions, - SqlCredential credential, - object providerInfo, - string newPassword, - SecureString newSecurePassword, - bool redirectedUserInstance, - SqlConnectionString userConnectionOptions = null, // NOTE: userConnectionOptions may be different to connectionOptions if the connection string has been expanded (see SqlConnectionString.Expand) - SessionData reconnectSessionData = null) : base(connectionOptions) { - -#if DEBUG - if (reconnectSessionData != null) { - reconnectSessionData._debugReconnectDataApplied = true; - } - try { // use this to help validate this object is only created after the following permission has been previously demanded in the current codepath - if (userConnectionOptions != null) { - // As mentioned above, userConnectionOptions may be different to connectionOptions, so we need to demand on the correct connection string - userConnectionOptions.DemandPermission(); - } - else { - connectionOptions.DemandPermission(); - } - } - catch(System.Security.SecurityException) { - System.Diagnostics.Debug.Assert(false, "unexpected SecurityException for current codepath"); - throw; - } -#endif - Debug.Assert(reconnectSessionData == null || connectionOptions.ConnectRetryCount > 0, "Reconnect data supplied with CR turned off"); - - if (connectionOptions.ConnectRetryCount > 0) { - _recoverySessionData = reconnectSessionData; - if (reconnectSessionData == null) { - _currentSessionData = new SessionData(); - } - else { - _currentSessionData = new SessionData(_recoverySessionData); - _originalDatabase = _recoverySessionData._initialDatabase; - _originalLanguage = _recoverySessionData._initialLanguage; - } - } - - if (connectionOptions.UserInstance && InOutOfProcHelper.InProc) { - throw SQL.UserInstanceNotAvailableInProc(); - } - - _identity = identity; - Debug.Assert(newSecurePassword != null || newPassword != null, "cannot have both new secure change password and string based change password to be null"); - Debug.Assert(credential == null || (String.IsNullOrEmpty(connectionOptions.UserID) && String.IsNullOrEmpty(connectionOptions.Password)), "cannot mix the new secure password system and the connection string based password"); - - Debug.Assert(credential == null || !connectionOptions.IntegratedSecurity, "Cannot use SqlCredential and Integrated Security"); - Debug.Assert(credential == null || !connectionOptions.ContextConnection, "Cannot use SqlCredential with context connection"); - - _poolGroupProviderInfo = (SqlConnectionPoolGroupProviderInfo)providerInfo; - _fResetConnection = connectionOptions.ConnectionReset; - if (_fResetConnection && _recoverySessionData == null) { - _originalDatabase = connectionOptions.InitialCatalog; - _originalLanguage = connectionOptions.CurrentLanguage; - } - - timeoutErrorInternal = new SqlConnectionTimeoutErrorInternal(); - _credential = credential; - - _parserLock.Wait(canReleaseFromAnyThread:false); - ThreadHasParserLockForClose = true; // In case of error, let ourselves know that we already own the parser lock - RuntimeHelpers.PrepareConstrainedRegions(); - try { -#if DEBUG - TdsParser.ReliabilitySection tdsReliabilitySection = new TdsParser.ReliabilitySection(); - - RuntimeHelpers.PrepareConstrainedRegions(); - try { - tdsReliabilitySection.Start(); -#else - { -#endif //DEBUG - var timeout = TimeoutTimer.StartSecondsTimeout(connectionOptions.ConnectTimeout); - OpenLoginEnlist(timeout, connectionOptions, credential, newPassword, newSecurePassword, redirectedUserInstance); - } -#if DEBUG - finally { - tdsReliabilitySection.Stop(); - } -#endif //DEBUG - } - catch (System.OutOfMemoryException) { - DoomThisConnection(); - throw; - } - catch (System.StackOverflowException) { - DoomThisConnection(); - throw; - } - catch (System.Threading.ThreadAbortException) { - DoomThisConnection(); - throw; - } - finally { - ThreadHasParserLockForClose = false; - _parserLock.Release(); - } - if (Bid.AdvancedOn) { - Bid.Trace(" %d#, constructed new TDS internal connection\n", ObjectID); - } - } - - internal Guid ClientConnectionId { - get { - return _clientConnectionId; - } - } - - internal Guid OriginalClientConnectionId { - get { - return _originalClientConnectionId; - } - } - - internal string RoutingDestination { - get { - return _routingDestination; - } - } - - override internal SqlInternalTransaction CurrentTransaction { - get { - return _parser.CurrentTransaction; - } - } - - override internal SqlInternalTransaction AvailableInternalTransaction { - get { - return _parser._fResetConnection ? null : CurrentTransaction; - } - } - - - override internal SqlInternalTransaction PendingTransaction { - get { - return _parser.PendingTransaction; - } - } - - internal DbConnectionPoolIdentity Identity { - get { - return _identity; - } - } - - internal string InstanceName { - get { - return _instanceName; - } - } - - override internal bool IsLockedForBulkCopy { - get { - return (!Parser.MARSOn && Parser._physicalStateObj.BcpLock); - } - } - - override protected internal bool IsNonPoolableTransactionRoot { - get { - return IsTransactionRoot && (!IsKatmaiOrNewer || null == Pool); - } - } - - override internal bool IsShiloh { - get { - return _loginAck.isVersion8; - } - } - - override internal bool IsYukonOrNewer { - get { - return _parser.IsYukonOrNewer; - } - } - - override internal bool IsKatmaiOrNewer { - get { - return _parser.IsKatmaiOrNewer; - } - } - - internal int PacketSize { - get { - return _currentPacketSize; - } - } - - internal TdsParser Parser { - get { - return _parser; - } - } - - internal string ServerProvidedFailOverPartner { - get { - return _currentFailoverPartner; - } - } - - internal SqlConnectionPoolGroupProviderInfo PoolGroupProviderInfo { - get { - return _poolGroupProviderInfo; - } - } - - override protected bool ReadyToPrepareTransaction { - get { - // - bool result = (null == FindLiveReader(null)); // can't prepare with a live data reader... - return result; - } - } - - override public string ServerVersion { - get { - return(String.Format((IFormatProvider)null, "{0:00}.{1:00}.{2:0000}", _loginAck.majorVersion, - (short) _loginAck.minorVersion, _loginAck.buildNum)); - } - } - - /// - /// Get boolean that specifies whether an enlisted transaction can be unbound from - /// the connection when that transaction completes. - /// - /// - /// This override always returns false. - /// - /// - /// The SqlInternalConnectionTds.CheckEnlistedTransactionBinding method handles implicit unbinding for disposed transactions. - /// - protected override bool UnbindOnTransactionCompletion - { - get - { - return false; - } - } - - - //////////////////////////////////////////////////////////////////////////////////////// - // GENERAL METHODS - //////////////////////////////////////////////////////////////////////////////////////// - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")] // copied from Triaged.cs - override protected void ChangeDatabaseInternal(string database) { - // MDAC 73598 - add brackets around database - database = SqlConnection.FixupDatabaseTransactionName(database); - Threading.Tasks.Task executeTask = _parser.TdsExecuteSQLBatch("use " + database, ConnectionOptions.ConnectTimeout, null, _parser._physicalStateObj, sync: true); - Debug.Assert(executeTask == null, "Shouldn't get a task when doing sync writes"); - _parser.Run(RunBehavior.UntilDone, null, null, null, _parser._physicalStateObj); - } - - override public void Dispose() { - if (Bid.AdvancedOn) { - Bid.Trace(" %d# disposing\n", base.ObjectID); - } - try { - TdsParser parser = Interlocked.Exchange(ref _parser, null); // guard against multiple concurrent dispose calls -- Delegated Transactions might cause this. - - Debug.Assert(parser != null && _fConnectionOpen || parser == null && !_fConnectionOpen, "Unexpected state on dispose"); - if (null != parser) { - parser.Disconnect(); - } - } - finally { // UNDONE: MDAC 77928 - // close will always close, even if exception is thrown - // remember to null out any object references - _loginAck = null; - _fConnectionOpen = false; // mark internal connection as closed - } - base.Dispose(); - } - - override internal void ValidateConnectionForExecute(SqlCommand command) { - TdsParser parser = _parser; - if ((parser == null) || (parser.State == TdsParserState.Broken) || (parser.State == TdsParserState.Closed)) { - throw ADP.ClosedConnectionError(); - } - else { - SqlDataReader reader = null; - if (parser.MARSOn) { - if (null != command) { // command can't have datareader already associated with it - reader = FindLiveReader(command); - } - } - else { // single execution/datareader per connection - if (_asyncCommandCount > 0) { - throw SQL.MARSUnspportedOnConnection(); - } - - reader = FindLiveReader(null); - } - if (null != reader) { - // if MARS is on, then a datareader associated with the command exists - // or if MARS is off, then a datareader exists - throw ADP.OpenReaderExists(); // MDAC 66411 - } - else if (!parser.MARSOn && parser._physicalStateObj._pendingData) { - parser.DrainData(parser._physicalStateObj); - } - Debug.Assert(!parser._physicalStateObj._pendingData, "Should not have a busy physicalStateObject at this point!"); - - parser.RollbackOrphanedAPITransactions(); - } - } - - /// - /// Validate the enlisted transaction state, taking into consideration the ambient transaction and transaction unbinding mode. - /// If there is no enlisted transaction, this method is a nop. - /// - /// - /// - /// This method must be called while holding a lock on the SqlInternalConnection instance, - /// to ensure we don't accidentally execute after the transaction has completed on a different thread, - /// causing us to unwittingly execute in auto-commit mode. - /// - /// - /// - /// When using Explicit transaction unbinding, - /// verify that the enlisted transaction is active and equal to the current ambient transaction. - /// - /// - /// - /// When using Implicit transaction unbinding, - /// verify that the enlisted transaction is active. - /// If it is not active, and the transaction object has been diposed, unbind from the transaction. - /// If it is not active and not disposed, throw an exception. - /// - /// - internal void CheckEnlistedTransactionBinding() - { - // If we are enlisted in a transaction, check that transaction is active. - // When using explicit transaction unbinding, also verify that the enlisted transaction is the current transaction. - SysTx.Transaction enlistedTransaction = EnlistedTransaction; - - if (enlistedTransaction != null) - { - bool requireExplicitTransactionUnbind = ConnectionOptions.TransactionBinding == SqlConnectionString.TransactionBindingEnum.ExplicitUnbind; - - if (requireExplicitTransactionUnbind) - { - SysTx.Transaction currentTransaction = SysTx.Transaction.Current; - - if (SysTx.TransactionStatus.Active != enlistedTransaction.TransactionInformation.Status || !enlistedTransaction.Equals(currentTransaction)) - { - throw ADP.TransactionConnectionMismatch(); - } - } - else // implicit transaction unbind - { - if (SysTx.TransactionStatus.Active != enlistedTransaction.TransactionInformation.Status) - { - if (EnlistedTransactionDisposed) - { - DetachTransaction(enlistedTransaction, true); - } - else - { - throw ADP.TransactionCompletedButNotDisposed(); - } - } - } - } - } - - internal override bool IsConnectionAlive(bool throwOnException) - { - bool isAlive = false; -#if DEBUG - TdsParser.ReliabilitySection tdsReliabilitySection = new TdsParser.ReliabilitySection(); - - RuntimeHelpers.PrepareConstrainedRegions(); - try - { - tdsReliabilitySection.Start(); -#endif //DEBUG - - isAlive = _parser._physicalStateObj.IsConnectionAlive(throwOnException); - -#if DEBUG - } - finally - { - tdsReliabilitySection.Stop(); - } -#endif //DEBUG - return isAlive; - } - - //////////////////////////////////////////////////////////////////////////////////////// - // POOLING METHODS - //////////////////////////////////////////////////////////////////////////////////////// - - override protected void Activate(SysTx.Transaction transaction) { - FailoverPermissionDemand(); // Demand for unspecified failover pooled connections - - // When we're required to automatically enlist in transactions and - // there is one we enlist in it. On the other hand, if there isn't a - // transaction and we are currently enlisted in one, then we - // unenlist from it. - // - // Regardless of whether we're required to automatically enlist, - // when there is not a current transaction, we cannot leave the - // connection enlisted in a transaction. - if (null != transaction){ - if (ConnectionOptions.Enlist) { - Enlist(transaction); - } - } - else { - Enlist(null); - } - } - - override protected void InternalDeactivate() { - // When we're deactivated, the user must have called End on all - // the async commands, or we don't know that we're in a state that - // we can recover from. We doom the connection in this case, to - // prevent odd cases when we go to the wire. - if (0 != _asyncCommandCount) { - DoomThisConnection(); - } - - // If we're deactivating with a delegated transaction, we - // should not be cleaning up the parser just yet, that will - // cause our transaction to be rolled back and the connection - // to be reset. We'll get called again once the delegated - // transaction is completed and we can do it all then. - if (!IsNonPoolableTransactionRoot) { - Debug.Assert(null != _parser || IsConnectionDoomed, "Deactivating a disposed connection?"); - if (_parser != null) { - - _parser.Deactivate(IsConnectionDoomed); - - if (!IsConnectionDoomed) { - ResetConnection(); - } - } - } - } - - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")] // copied from Triaged.cs - private void ResetConnection() { - // For implicit pooled connections, if connection reset behavior is specified, - // reset the database and language properties back to default. It is important - // to do this on activate so that the hashtable is correct before SqlConnection - // obtains a clone. - - Debug.Assert(!HasLocalTransactionFromAPI, "Upon ResetConnection SqlInternalConnectionTds has a currently ongoing local transaction."); - Debug.Assert(!_parser._physicalStateObj._pendingData, "Upon ResetConnection SqlInternalConnectionTds has pending data."); - - if (_fResetConnection) { - // Ensure we are either going against shiloh, or we are not enlisted in a - // distributed transaction - otherwise don't reset! - if (IsShiloh) { - // Prepare the parser for the connection reset - the next time a trip - // to the server is made. - _parser.PrepareResetConnection(IsTransactionRoot && !IsNonPoolableTransactionRoot); - } - else if (!IsEnlistedInTransaction) { - // If not Shiloh, we are going against Sphinx. On Sphinx, we - // may only reset if not enlisted in a distributed transaction. - try { - // execute sp - Threading.Tasks.Task executeTask = _parser.TdsExecuteSQLBatch("sp_reset_connection", 30, null, _parser._physicalStateObj, sync: true); - Debug.Assert(executeTask == null, "Shouldn't get a task when doing sync writes"); - _parser.Run(RunBehavior.UntilDone, null, null, null, _parser._physicalStateObj); - } - catch (Exception e) { - // - if (!ADP.IsCatchableExceptionType(e)) { - throw; - } - - DoomThisConnection(); - ADP.TraceExceptionWithoutRethrow(e); - } - } - - // Reset hashtable values, since calling reset will not send us env_changes. - CurrentDatabase = _originalDatabase; - _currentLanguage = _originalLanguage; - } - } - - internal void DecrementAsyncCount() { - Interlocked.Decrement(ref _asyncCommandCount); - } - - internal void IncrementAsyncCount() { - Interlocked.Increment(ref _asyncCommandCount); - } - - - //////////////////////////////////////////////////////////////////////////////////////// - // LOCAL TRANSACTION METHODS - //////////////////////////////////////////////////////////////////////////////////////// - - override internal void DisconnectTransaction(SqlInternalTransaction internalTransaction) { - TdsParser parser = Parser; - - if (null != parser) { - parser.DisconnectTransaction(internalTransaction); - } - } - - internal void ExecuteTransaction(TransactionRequest transactionRequest, string name, IsolationLevel iso) { - ExecuteTransaction(transactionRequest, name, iso, null, false); - } - - override internal void ExecuteTransaction(TransactionRequest transactionRequest, string name, IsolationLevel iso, SqlInternalTransaction internalTransaction, bool isDelegateControlRequest) { - if (IsConnectionDoomed) { // doomed means we can't do anything else... - if (transactionRequest == TransactionRequest.Rollback - || transactionRequest == TransactionRequest.IfRollback) { - return; - } - throw SQL.ConnectionDoomed(); - } - - if (transactionRequest == TransactionRequest.Commit - || transactionRequest == TransactionRequest.Rollback - || transactionRequest == TransactionRequest.IfRollback) { - if (!Parser.MARSOn && Parser._physicalStateObj.BcpLock) { - throw SQL.ConnectionLockedForBcpEvent(); - } - } - - string transactionName = (null == name) ? String.Empty : name; - - if (!_parser.IsYukonOrNewer) { - ExecuteTransactionPreYukon(transactionRequest, transactionName, iso, internalTransaction); - } - else { - ExecuteTransactionYukon(transactionRequest, transactionName, iso, internalTransaction, isDelegateControlRequest); - } - } - - // This function will not handle idle connection resiliency, as older servers will not support it - internal void ExecuteTransactionPreYukon( - TransactionRequest transactionRequest, - string transactionName, - IsolationLevel iso, - SqlInternalTransaction internalTransaction) { - StringBuilder sqlBatch = new StringBuilder(); - - switch (iso) { - case IsolationLevel.Unspecified: - break; - case IsolationLevel.ReadCommitted: - sqlBatch.Append(TdsEnums.TRANS_READ_COMMITTED); - sqlBatch.Append(";"); - break; - case IsolationLevel.ReadUncommitted: - sqlBatch.Append(TdsEnums.TRANS_READ_UNCOMMITTED); - sqlBatch.Append(";"); - break; - case IsolationLevel.RepeatableRead: - sqlBatch.Append(TdsEnums.TRANS_REPEATABLE_READ); - sqlBatch.Append(";"); - break; - case IsolationLevel.Serializable: - sqlBatch.Append(TdsEnums.TRANS_SERIALIZABLE); - sqlBatch.Append(";"); - break; - case IsolationLevel.Snapshot: - throw SQL.SnapshotNotSupported(IsolationLevel.Snapshot); - - case IsolationLevel.Chaos: - throw SQL.NotSupportedIsolationLevel(iso); - - default: - throw ADP.InvalidIsolationLevel(iso); - } - - if (!ADP.IsEmpty(transactionName)) { - transactionName = " " + SqlConnection.FixupDatabaseTransactionName(transactionName); - } - - switch (transactionRequest) { - case TransactionRequest.Begin: - sqlBatch.Append(TdsEnums.TRANS_BEGIN); - sqlBatch.Append(transactionName); - break; - case TransactionRequest.Promote: - Debug.Assert(false, "Promote called with transaction name or on pre-Yukon!"); - break; - case TransactionRequest.Commit: - sqlBatch.Append(TdsEnums.TRANS_COMMIT); - sqlBatch.Append(transactionName); - break; - case TransactionRequest.Rollback: - sqlBatch.Append(TdsEnums.TRANS_ROLLBACK); - sqlBatch.Append(transactionName); - break; - case TransactionRequest.IfRollback: - sqlBatch.Append(TdsEnums.TRANS_IF_ROLLBACK); - sqlBatch.Append(transactionName); - break; - case TransactionRequest.Save: - sqlBatch.Append(TdsEnums.TRANS_SAVE); - sqlBatch.Append(transactionName); - break; - default: - Debug.Assert(false, "Unknown transaction type"); - break; - } - - Threading.Tasks.Task executeTask = _parser.TdsExecuteSQLBatch(sqlBatch.ToString(), ConnectionOptions.ConnectTimeout, null, _parser._physicalStateObj, sync: true); - Debug.Assert(executeTask == null, "Shouldn't get a task when doing sync writes"); - _parser.Run(RunBehavior.UntilDone, null, null, null, _parser._physicalStateObj); - - // Prior to Yukon, we didn't have any transaction tokens to manage, - // or any feedback to know when one was created, so we just presume - // that successful execution of the request caused the transaction - // to be created, and we set that on the parser. - if (TransactionRequest.Begin == transactionRequest) { - Debug.Assert(null != internalTransaction, "Begin Transaction request without internal transaction"); - _parser.CurrentTransaction = internalTransaction; - } - } - - - internal void ExecuteTransactionYukon( - TransactionRequest transactionRequest, - string transactionName, - IsolationLevel iso, - SqlInternalTransaction internalTransaction, - bool isDelegateControlRequest) { - TdsEnums.TransactionManagerRequestType requestType = TdsEnums.TransactionManagerRequestType.Begin; - TdsEnums.TransactionManagerIsolationLevel isoLevel = TdsEnums.TransactionManagerIsolationLevel.ReadCommitted; - - switch (iso) { - case IsolationLevel.Unspecified: - isoLevel = TdsEnums.TransactionManagerIsolationLevel.Unspecified; - break; - case IsolationLevel.ReadCommitted: - isoLevel = TdsEnums.TransactionManagerIsolationLevel.ReadCommitted; - break; - case IsolationLevel.ReadUncommitted: - isoLevel = TdsEnums.TransactionManagerIsolationLevel.ReadUncommitted; - break; - case IsolationLevel.RepeatableRead: - isoLevel = TdsEnums.TransactionManagerIsolationLevel.RepeatableRead; - break; - case IsolationLevel.Serializable: - isoLevel = TdsEnums.TransactionManagerIsolationLevel.Serializable; - break; - case IsolationLevel.Snapshot: - isoLevel = TdsEnums.TransactionManagerIsolationLevel.Snapshot; - break; - case IsolationLevel.Chaos: - throw SQL.NotSupportedIsolationLevel(iso); - default: - throw ADP.InvalidIsolationLevel(iso); - } - - TdsParserStateObject stateObj = _parser._physicalStateObj; - TdsParser parser = _parser; - bool mustPutSession = false; - bool releaseConnectionLock = false; - - Debug.Assert(!ThreadHasParserLockForClose || _parserLock.ThreadMayHaveLock(), "Thread claims to have parser lock, but lock is not taken"); - if (!ThreadHasParserLockForClose) { - _parserLock.Wait(canReleaseFromAnyThread:false); - ThreadHasParserLockForClose = true; // In case of error, let the connection know that we already own the parser lock - releaseConnectionLock = true; - } - try { - switch (transactionRequest) { - case TransactionRequest.Begin: - requestType = TdsEnums.TransactionManagerRequestType.Begin; - break; - case TransactionRequest.Promote: - requestType = TdsEnums.TransactionManagerRequestType.Promote; - break; - case TransactionRequest.Commit: - requestType = TdsEnums.TransactionManagerRequestType.Commit; - break; - case TransactionRequest.IfRollback: - // Map IfRollback to Rollback since with Yukon and beyond we should never need - // the if since the server will inform us when transactions have completed - // as a result of an error on the server. - case TransactionRequest.Rollback: - requestType = TdsEnums.TransactionManagerRequestType.Rollback; - break; - case TransactionRequest.Save: - requestType = TdsEnums.TransactionManagerRequestType.Save; - break; - default: - Debug.Assert(false, "Unknown transaction type"); - break; - } - - // only restore if connection lock has been taken within the function - if (internalTransaction != null && internalTransaction.RestoreBrokenConnection && releaseConnectionLock) { - Task reconnectTask = internalTransaction.Parent.Connection.ValidateAndReconnect(() => { - ThreadHasParserLockForClose = false; - _parserLock.Release(); - releaseConnectionLock = false; - }, 0); - if (reconnectTask != null) { - AsyncHelper.WaitForCompletion(reconnectTask, 0); // there is no specific timeout for BeginTransaction, uses ConnectTimeout - internalTransaction.ConnectionHasBeenRestored = true; - return; - } - } - - - - // SQLBUDT #20010853 - Promote, Commit and Rollback requests for - // delegated transactions often happen while there is an open result - // set, so we need to handle them by using a different MARS session, - // otherwise we'll write on the physical state objects while someone - // else is using it. When we don't have MARS enabled, we need to - // lock the physical state object to syncronize it's use at least - // until we increment the open results count. Once it's been - // incremented the delegated transaction requests will fail, so they - // won't stomp on anything. - // - // We need to keep this lock through the duration of the TM reqeuest - // so that we won't hijack a different request's data stream and a - // different request won't hijack ours, so we have a lock here on - // an object that the ExecTMReq will also lock, but since we're on - // the same thread, the lock is a no-op. - - if (null != internalTransaction && internalTransaction.IsDelegated) { - if (_parser.MARSOn) { - stateObj = _parser.GetSession(this); - mustPutSession = true; - } - else if (internalTransaction.OpenResultsCount != 0) { - throw SQL.CannotCompleteDelegatedTransactionWithOpenResults(this); - } - } - - // SQLBU #406778 - _parser may be nulled out during TdsExecuteTrannsactionManagerRequest. - // Only use local variable after this call. - _parser.TdsExecuteTransactionManagerRequest(null, requestType, transactionName, isoLevel, - ConnectionOptions.ConnectTimeout, internalTransaction, stateObj, isDelegateControlRequest); - } - finally { - if (mustPutSession) { - parser.PutSession(stateObj); - } - - if (releaseConnectionLock) { - ThreadHasParserLockForClose = false; - _parserLock.Release(); - } - } - } - - //////////////////////////////////////////////////////////////////////////////////////// - // DISTRIBUTED TRANSACTION METHODS - //////////////////////////////////////////////////////////////////////////////////////// - - override internal void DelegatedTransactionEnded() { - // - base.DelegatedTransactionEnded(); - } - - override protected byte[] GetDTCAddress() { - byte[] dtcAddress = _parser.GetDTCAddress(ConnectionOptions.ConnectTimeout, _parser.GetSession(this)); - Debug.Assert(null != dtcAddress, "null dtcAddress?"); - return dtcAddress; - } - - override protected void PropagateTransactionCookie(byte[] cookie) { - _parser.PropagateDistributedTransaction(cookie, ConnectionOptions.ConnectTimeout, _parser._physicalStateObj); - } - - //////////////////////////////////////////////////////////////////////////////////////// - // LOGIN-RELATED METHODS - //////////////////////////////////////////////////////////////////////////////////////// - - private void CompleteLogin(bool enlistOK) { - _parser.Run(RunBehavior.UntilDone, null, null, null, _parser._physicalStateObj); - - if (_routingInfo == null) { // ROR should not affect state of connection recovery - if (!_sessionRecoveryAcknowledged) { - _currentSessionData = null; - if (_recoverySessionData != null) { - throw SQL.CR_NoCRAckAtReconnection(this); - } - } - if (_currentSessionData != null && _recoverySessionData==null) { - _currentSessionData._initialDatabase = CurrentDatabase; - _currentSessionData._initialCollation = _currentSessionData._collation; - _currentSessionData._initialLanguage = _currentLanguage; - } - bool isEncrypted = _parser.EncryptionOptions == EncryptionOptions.ON; - if (_recoverySessionData != null) { - if (_recoverySessionData._encrypted != isEncrypted) { - throw SQL.CR_EncryptionChanged(this); - } - } - if (_currentSessionData != null) { - _currentSessionData._encrypted = isEncrypted; - } - _recoverySessionData = null; - } - - Debug.Assert(SniContext.Snix_Login == Parser._physicalStateObj.SniContext, String.Format((IFormatProvider)null, "SniContext should be Snix_Login; actual Value: {0}", Parser._physicalStateObj.SniContext)); - _parser._physicalStateObj.SniContext = SniContext.Snix_EnableMars; - _parser.EnableMars(); - - _fConnectionOpen = true; // mark connection as open - - if (Bid.AdvancedOn) { - Bid.Trace(" Post-Login Phase: Server connection obtained.\n"); - } - - // for non-pooled connections, enlist in a distributed transaction - // if present - and user specified to enlist - if(enlistOK && ConnectionOptions.Enlist) { - _parser._physicalStateObj.SniContext = SniContext.Snix_AutoEnlist; - SysTx.Transaction tx = ADP.GetCurrentTransaction(); - Enlist(tx); - } - _parser._physicalStateObj.SniContext=SniContext.Snix_Login; - } - - private void Login(ServerInfo server, TimeoutTimer timeout, string newPassword, SecureString newSecurePassword) { - // create a new login record - SqlLogin login = new SqlLogin(); - - // gather all the settings the user set in the connection string or - // properties and do the login - CurrentDatabase = server.ResolvedDatabaseName; - _currentPacketSize = ConnectionOptions.PacketSize; - _currentLanguage = ConnectionOptions.CurrentLanguage; - - int timeoutInSeconds = 0; - - // If a timeout tick value is specified, compute the timeout based - // upon the amount of time left in seconds. - if (!timeout.IsInfinite) - { - long t = timeout.MillisecondsRemaining/1000; - if ((long)Int32.MaxValue > t) - { - timeoutInSeconds = (int)t; - } - } - - login.timeout = timeoutInSeconds; - login.userInstance = ConnectionOptions.UserInstance; - login.hostName = ConnectionOptions.ObtainWorkstationId(); - login.userName = ConnectionOptions.UserID; - login.password = ConnectionOptions.Password; - login.applicationName = ConnectionOptions.ApplicationName; - - login.language = _currentLanguage; - if (!login.userInstance) { // Do not send attachdbfilename or database to SSE primary instance - login.database = CurrentDatabase;; - login.attachDBFilename = ConnectionOptions.AttachDBFilename; - } - - // VSTS#795621 - Ensure ServerName is Sent During TdsLogin To Enable Sql Azure Connectivity. - // Using server.UserServerName (versus ConnectionOptions.DataSource) since TdsLogin requires - // serverName to always be non-null. - login.serverName = server.UserServerName; - - login.useReplication = ConnectionOptions.Replication; - login.useSSPI = ConnectionOptions.IntegratedSecurity; - login.packetSize = _currentPacketSize; - login.newPassword = newPassword; - login.readOnlyIntent = ConnectionOptions.ApplicationIntent == ApplicationIntent.ReadOnly; - login.credential = _credential; - if (newSecurePassword != null) { - login.newSecurePassword = newSecurePassword; - } - - TdsEnums.FeatureExtension requestedFeatures = TdsEnums.FeatureExtension.None; - if (ConnectionOptions.ConnectRetryCount>0) { - requestedFeatures |= TdsEnums.FeatureExtension.SessionRecovery; - _sessionRecoveryRequested = true; - } - - _parser.TdsLogin(login, requestedFeatures, _recoverySessionData); - } - - private void LoginFailure() { - Bid.Trace(" %d#\n", ObjectID); - - // If the parser was allocated and we failed, then we must have failed on - // either the Connect or Login, either way we should call Disconnect. - // Disconnect can be called if the connection is already closed - becomes - // no-op, so no issues there. - if (_parser != null) { - - _parser.Disconnect(); - } - // - } - - private void OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, - string newPassword, SecureString newSecurePassword, bool redirectedUserInstance) { - bool useFailoverPartner; // should we use primary or secondary first - ServerInfo dataSource = new ServerInfo(connectionOptions); - string failoverPartner; - - if (null != PoolGroupProviderInfo) { - useFailoverPartner = PoolGroupProviderInfo.UseFailoverPartner; - failoverPartner = PoolGroupProviderInfo.FailoverPartner; - } - else { - // Only ChangePassword or SSE User Instance comes through this code path. - useFailoverPartner = false; - failoverPartner = ConnectionOptions.FailoverPartner; - } - - timeoutErrorInternal.SetInternalSourceType(useFailoverPartner ? SqlConnectionInternalSourceType.Failover : SqlConnectionInternalSourceType.Principle); - - bool hasFailoverPartner = !ADP.IsEmpty(failoverPartner); - - // Open the connection and Login - try { - timeoutErrorInternal.SetAndBeginPhase(SqlConnectionTimeoutErrorPhase.PreLoginBegin); - if (hasFailoverPartner) { - timeoutErrorInternal.SetFailoverScenario(true); // this is a failover scenario - LoginWithFailover( - useFailoverPartner, - dataSource, - failoverPartner, - newPassword, - newSecurePassword, - redirectedUserInstance, - connectionOptions, - credential, - timeout); - } - else { - timeoutErrorInternal.SetFailoverScenario(false); // not a failover scenario - LoginNoFailover(dataSource, newPassword, newSecurePassword, redirectedUserInstance, - connectionOptions, credential, timeout); - } - timeoutErrorInternal.EndPhase(SqlConnectionTimeoutErrorPhase.PostLogin); - } - catch (Exception e) { - // - if (ADP.IsCatchableExceptionType(e)) { - LoginFailure(); - } - throw; - } - timeoutErrorInternal.SetAllCompleteMarker(); - -#if DEBUG - _parser._physicalStateObj.InvalidateDebugOnlyCopyOfSniContext(); -#endif - } - - // Is the given Sql error one that should prevent retrying - // to connect. - private bool IsDoNotRetryConnectError(SqlException exc) { - - return (TdsEnums.LOGON_FAILED == exc.Number) // actual logon failed, i.e. bad password - || (TdsEnums.PASSWORD_EXPIRED == exc.Number) // actual logon failed, i.e. password isExpired - || (TdsEnums.IMPERSONATION_FAILED == exc.Number) // Insuficient privelege for named pipe, among others - || exc._doNotReconnect; // Exception explicitly supressed reconnection attempts - } - - // Attempt to login to a host that does not have a failover partner - // - // Will repeatedly attempt to connect, but back off between each attempt so as not to clog the network. - // Back off period increases for first few failures: 100ms, 200ms, 400ms, 800ms, then 1000ms for subsequent attempts - // - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // DEVNOTE: The logic in this method is paralleled by the logic in LoginWithFailover. - // Changes to either one should be examined to see if they need to be reflected in the other - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - private void LoginNoFailover(ServerInfo serverInfo, string newPassword, SecureString newSecurePassword, bool redirectedUserInstance, - SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) { - - Debug.Assert(object.ReferenceEquals(connectionOptions, this.ConnectionOptions), "ConnectionOptions argument and property must be the same"); // consider removing the argument - int routingAttempts = 0; - ServerInfo originalServerInfo = serverInfo; // serverInfo may end up pointing to new object due to routing, original object is used to set CurrentDatasource - - if (Bid.AdvancedOn) { - Bid.Trace(" %d#, host=%ls\n", ObjectID, serverInfo.UserServerName); - } - int sleepInterval = 100; //milliseconds to sleep (back off) between attempts. - - ResolveExtendedServerName(serverInfo, !redirectedUserInstance, connectionOptions); - - long timeoutUnitInterval = 0; - - if (connectionOptions.MultiSubnetFailover) { - // Determine unit interval - if (timeout.IsInfinite) { - timeoutUnitInterval = checked((long)(ADP.FailoverTimeoutStep * (1000L * ADP.DefaultConnectionTimeout))); - } - else { - timeoutUnitInterval = checked((long)(ADP.FailoverTimeoutStep * timeout.MillisecondsRemaining)); - } - } - // Only three ways out of this loop: - // 1) Successfully connected - // 2) Parser threw exception while main timer was expired - // 3) Parser threw logon failure-related exception - // 4) Parser threw exception in post-initial connect code, - // such as pre-login handshake or during actual logon. (parser state != Closed) - // - // Of these methods, only #1 exits normally. This preserves the call stack on the exception - // back into the parser for the error cases. - int attemptNumber = 0; - TimeoutTimer intervalTimer = null; - while(true) { - - if (connectionOptions.MultiSubnetFailover) { - attemptNumber++; - // Set timeout for this attempt, but don't exceed original timer - long nextTimeoutInterval = checked(timeoutUnitInterval * attemptNumber); - long milliseconds = timeout.MillisecondsRemaining; - if (nextTimeoutInterval > milliseconds) { - nextTimeoutInterval = milliseconds; - } - intervalTimer = TimeoutTimer.StartMillisecondsTimeout(nextTimeoutInterval); - } - - // Re-allocate parser each time to make sure state is known - // RFC 50002652 - if parser was created by previous attempt, dispose it to properly close the socket, if created - if (_parser != null) - _parser.Disconnect(); - - _parser = new TdsParser(ConnectionOptions.MARS, ConnectionOptions.Asynchronous); - Debug.Assert(SniContext.Undefined== Parser._physicalStateObj.SniContext, String.Format((IFormatProvider)null, "SniContext should be Undefined; actual Value: {0}", Parser._physicalStateObj.SniContext)); - - try { - // - - - AttemptOneLogin( serverInfo, - newPassword, - newSecurePassword, - !connectionOptions.MultiSubnetFailover, // ignore timeout for SniOpen call unless MSF - connectionOptions.MultiSubnetFailover ? intervalTimer : timeout); - - if (connectionOptions.MultiSubnetFailover && null != ServerProvidedFailOverPartner) { - // connection succeeded: trigger exception if server sends failover partner and MultiSubnetFailover is used - throw SQL.MultiSubnetFailoverWithFailoverPartner(serverProvidedFailoverPartner: true, internalConnection: this); - } - - if (_routingInfo != null) { - Bid.Trace(" Routed to %ls", serverInfo.ExtendedServerName); - - if (routingAttempts > 0) { - throw SQL.ROR_RecursiveRoutingNotSupported(this); - } - - if (timeout.IsExpired) { - throw SQL.ROR_TimeoutAfterRoutingInfo(this); - } - - serverInfo = new ServerInfo(ConnectionOptions, _routingInfo, serverInfo.ResolvedServerName); - timeoutErrorInternal.SetInternalSourceType(SqlConnectionInternalSourceType.RoutingDestination); - _originalClientConnectionId = _clientConnectionId; - _routingDestination = serverInfo.UserServerName; - - // restore properties that could be changed by the environment tokens - _currentPacketSize = ConnectionOptions.PacketSize; - _currentLanguage = _originalLanguage = ConnectionOptions.CurrentLanguage; - CurrentDatabase = _originalDatabase = ConnectionOptions.InitialCatalog; - _currentFailoverPartner = null; - _instanceName = String.Empty; - - routingAttempts++; - - continue; // repeat the loop, but skip code reserved for failed connections (after the catch) - } - else { - break; // leave the while loop -- we've successfully connected - } - } - catch (SqlException sqlex) { - if (null == _parser - || TdsParserState.Closed != _parser.State - || IsDoNotRetryConnectError(sqlex) - || timeout.IsExpired) { // no more time to try again - throw; // Caller will call LoginFailure() - } - - // Check sleep interval to make sure we won't exceed the timeout - // Do this in the catch block so we can re-throw the current exception - if (timeout.MillisecondsRemaining <= sleepInterval) { - throw; - } - - // - } - - // We only get here when we failed to connect, but are going to re-try - - // Switch to failover logic if the server provided a partner - if (null != ServerProvidedFailOverPartner) { - if (connectionOptions.MultiSubnetFailover) { - // connection failed: do not allow failover to server-provided failover partner if MultiSubnetFailover is set - throw SQL.MultiSubnetFailoverWithFailoverPartner(serverProvidedFailoverPartner: true, internalConnection: this); - } - Debug.Assert(ConnectionOptions.ApplicationIntent != ApplicationIntent.ReadOnly, "FAILOVER+AppIntent=RO: Should already fail (at LOGSHIPNODE in OnEnvChange)"); - - timeoutErrorInternal.ResetAndRestartPhase(); - timeoutErrorInternal.SetAndBeginPhase(SqlConnectionTimeoutErrorPhase.PreLoginBegin); - timeoutErrorInternal.SetInternalSourceType(SqlConnectionInternalSourceType.Failover); - timeoutErrorInternal.SetFailoverScenario(true); // this is a failover scenario - LoginWithFailover( - true, // start by using failover partner, since we already failed to connect to the primary - serverInfo, - ServerProvidedFailOverPartner, - newPassword, - newSecurePassword, - redirectedUserInstance, - connectionOptions, - credential, - timeout); - return; // LoginWithFailover successfully connected and handled entire connection setup - } - - // Sleep for a bit to prevent clogging the network with requests, - // then update sleep interval for next iteration (max 1 second interval) - if (Bid.AdvancedOn) { - Bid.Trace(" %d#, sleeping %d{milisec}\n", ObjectID, sleepInterval); - } - Thread.Sleep(sleepInterval); - sleepInterval = (sleepInterval < 500) ? sleepInterval * 2 : 1000; - } - - if (null != PoolGroupProviderInfo) { - // We must wait for CompleteLogin to finish for to have the - // env change from the server to know its designated failover - // partner; save this information in _currentFailoverPartner. - PoolGroupProviderInfo.FailoverCheck(this, false, connectionOptions, ServerProvidedFailOverPartner); - } - CurrentDataSource = originalServerInfo.UserServerName; - } - - // Attempt to login to a host that has a failover partner - // - // Connection & timeout sequence is - // First target, timeout = interval * 1 - // second target, timeout = interval * 1 - // sleep for 100ms - // First target, timeout = interval * 2 - // Second target, timeout = interval * 2 - // sleep for 200ms - // First Target, timeout = interval * 3 - // etc. - // - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // DEVNOTE: The logic in this method is paralleled by the logic in LoginNoFailover. - // Changes to either one should be examined to see if they need to be reflected in the other - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - private void LoginWithFailover( - bool useFailoverHost, - ServerInfo primaryServerInfo, - string failoverHost, - string newPassword, - SecureString newSecurePassword, - bool redirectedUserInstance, - SqlConnectionString connectionOptions, - SqlCredential credential, - TimeoutTimer timeout - ) { - - Debug.Assert(!connectionOptions.MultiSubnetFailover, "MultiSubnetFailover should not be set if failover partner is used"); - - if (Bid.AdvancedOn) { - Bid.Trace(" %d#, useFailover=%d{bool}, primary=", ObjectID, useFailoverHost); - Bid.PutStr(primaryServerInfo.UserServerName); - Bid.PutStr(", failover="); - Bid.PutStr(failoverHost); - Bid.PutStr("\n"); - } - int sleepInterval = 100; //milliseconds to sleep (back off) between attempts. - long timeoutUnitInterval; - - string protocol = ConnectionOptions.NetworkLibrary; - ServerInfo failoverServerInfo = new ServerInfo(connectionOptions, failoverHost); - - ResolveExtendedServerName(primaryServerInfo, !redirectedUserInstance, connectionOptions); - if (null == ServerProvidedFailOverPartner) {// No point in resolving the failover partner when we're going to override it below - // Don't resolve aliases if failover == primary // - ResolveExtendedServerName(failoverServerInfo, !redirectedUserInstance && failoverHost != primaryServerInfo.UserServerName, connectionOptions); - } - - // Determine unit interval - if (timeout.IsInfinite) { - timeoutUnitInterval = checked((long) ADP.FailoverTimeoutStep * ADP.TimerFromSeconds(ADP.DefaultConnectionTimeout)); - } - else { - timeoutUnitInterval = checked((long) (ADP.FailoverTimeoutStep * timeout.MillisecondsRemaining)); - } - - // Initialize loop variables - bool failoverDemandDone = false; // have we demanded for partner information yet (as necessary)? - int attemptNumber = 0; - - // Only three ways out of this loop: - // 1) Successfully connected - // 2) Parser threw exception while main timer was expired - // 3) Parser threw logon failure-related exception (LOGON_FAILED, PASSWORD_EXPIRED, etc) - // - // Of these methods, only #1 exits normally. This preserves the call stack on the exception - // back into the parser for the error cases. - while (true) { - // Set timeout for this attempt, but don't exceed original timer - long nextTimeoutInterval = checked(timeoutUnitInterval * ((attemptNumber / 2) + 1)); - long milliseconds = timeout.MillisecondsRemaining; - if (nextTimeoutInterval > milliseconds) { - nextTimeoutInterval = milliseconds; - } - - TimeoutTimer intervalTimer = TimeoutTimer.StartMillisecondsTimeout(nextTimeoutInterval); - - // Re-allocate parser each time to make sure state is known - // RFC 50002652 - if parser was created by previous attempt, dispose it to properly close the socket, if created - if (_parser != null) - _parser.Disconnect(); - - _parser = new TdsParser(ConnectionOptions.MARS, ConnectionOptions.Asynchronous); - Debug.Assert(SniContext.Undefined== Parser._physicalStateObj.SniContext, String.Format((IFormatProvider)null, "SniContext should be Undefined; actual Value: {0}", Parser._physicalStateObj.SniContext)); - - ServerInfo currentServerInfo; - if (useFailoverHost) { - if (!failoverDemandDone) { - FailoverPermissionDemand(); - failoverDemandDone = true; - } - - // Primary server may give us a different failover partner than the connection string indicates. Update it - if (null != ServerProvidedFailOverPartner && failoverServerInfo.ResolvedServerName != ServerProvidedFailOverPartner) { - if (Bid.AdvancedOn) { - Bid.Trace(" %d#, new failover partner=%ls\n", ObjectID, ServerProvidedFailOverPartner); - } - failoverServerInfo.SetDerivedNames(protocol, ServerProvidedFailOverPartner); - } - currentServerInfo = failoverServerInfo; - timeoutErrorInternal.SetInternalSourceType(SqlConnectionInternalSourceType.Failover); - } - else { - currentServerInfo = primaryServerInfo; - timeoutErrorInternal.SetInternalSourceType(SqlConnectionInternalSourceType.Principle); - } - - try { - // Attempt login. Use timerInterval for attempt timeout unless infinite timeout was requested. - AttemptOneLogin( - currentServerInfo, - newPassword, - newSecurePassword, - false, // Use timeout in SniOpen - intervalTimer, - withFailover:true - ); - - if (_routingInfo != null) { - // We are in login with failover scenation and server sent routing information - // If it is read-only routing - we did not supply AppIntent=RO (it should be checked before) - // If it is something else, not known yet (future server) - this client is not designed to support this. - // In any case, server should not have sent the routing info. - Bid.Trace(" Routed to %ls", _routingInfo.ServerName); - throw SQL.ROR_UnexpectedRoutingInfo(this); - } - - break; // leave the while loop -- we've successfully connected - } - catch (SqlException sqlex) { - if (IsDoNotRetryConnectError(sqlex) - || timeout.IsExpired) - { // no more time to try again - throw; // Caller will call LoginFailure() - } - - if (IsConnectionDoomed) { - throw; - } - - if (1 == attemptNumber % 2) { - // Check sleep interval to make sure we won't exceed the original timeout - // Do this in the catch block so we can re-throw the current exception - if (timeout.MillisecondsRemaining <= sleepInterval) { - throw; - } - } - - // - } - - // We only get here when we failed to connect, but are going to re-try - - // After trying to connect to both servers fails, sleep for a bit to prevent clogging - // the network with requests, then update sleep interval for next iteration (max 1 second interval) - if (1 == attemptNumber % 2) { - if (Bid.AdvancedOn) { - Bid.Trace(" %d#, sleeping %d{milisec}\n", ObjectID, sleepInterval); - } - Thread.Sleep(sleepInterval); - sleepInterval = (sleepInterval < 500) ? sleepInterval * 2 : 1000; - } - - // Update attempt number and target host - attemptNumber++; - useFailoverHost = !useFailoverHost; - } - - // If we get here, connection/login succeeded! Just a few more checks & record-keeping - - // if connected to failover host, but said host doesn't have DbMirroring set up, throw an error - if (useFailoverHost && null == ServerProvidedFailOverPartner) { - throw SQL.InvalidPartnerConfiguration(failoverHost, CurrentDatabase); - } - - if (null != PoolGroupProviderInfo) { - // We must wait for CompleteLogin to finish for to have the - // env change from the server to know its designated failover - // partner; save this information in _currentFailoverPartner. - PoolGroupProviderInfo.FailoverCheck(this, useFailoverHost, connectionOptions, ServerProvidedFailOverPartner); - } - CurrentDataSource = (useFailoverHost ? failoverHost : primaryServerInfo.UserServerName); - } - - private void ResolveExtendedServerName(ServerInfo serverInfo, bool aliasLookup, SqlConnectionString options) { - if (serverInfo.ExtendedServerName == null) { - string host = serverInfo.UserServerName; - string protocol = serverInfo.UserProtocol; - - if (aliasLookup) { // We skip this for UserInstances... - // Perform registry lookup to see if host is an alias. It will appropriately set host and protocol, if an Alias. - // Check if it was already resolved, during CR reconnection _currentSessionData values will be copied from - // _reconnectSessonData of the previous connection - if (_currentSessionData != null && !string.IsNullOrEmpty(host)) { - Tuple hostPortPair; - if (_currentSessionData._resolvedAliases.TryGetValue(host, out hostPortPair)) { - host = hostPortPair.Item1; - protocol = hostPortPair.Item2; - } - else { - TdsParserStaticMethods.AliasRegistryLookup(ref host, ref protocol); - _currentSessionData._resolvedAliases.Add(serverInfo.UserServerName, new Tuple(host, protocol)); - } - } - else { - TdsParserStaticMethods.AliasRegistryLookup(ref host, ref protocol); - } - - // - if (options.EnforceLocalHost) { - // verify LocalHost for |DataDirectory| usage - SqlConnectionString.VerifyLocalHostAndFixup(ref host, true, true /*fix-up to "."*/); - } - } - - serverInfo.SetDerivedNames(protocol, host); - } - } - - // Common code path for making one attempt to establish a connection and log in to server. - private void AttemptOneLogin(ServerInfo serverInfo, string newPassword, SecureString newSecurePassword, bool ignoreSniOpenTimeout, TimeoutTimer timeout, bool withFailover = false) { - if (Bid.AdvancedOn) { - Bid.Trace(" %d#, timout=%I64d{msec}, server=", ObjectID, timeout.MillisecondsRemaining); - Bid.PutStr(serverInfo.ExtendedServerName); - Bid.Trace("\n"); - } - - _routingInfo = null; // forget routing information - - _parser._physicalStateObj.SniContext = SniContext.Snix_Connect; - - _parser.Connect(serverInfo, - this, - ignoreSniOpenTimeout, - timeout.LegacyTimerExpire, - ConnectionOptions.Encrypt, - ConnectionOptions.TrustServerCertificate, - ConnectionOptions.IntegratedSecurity, - withFailover); - - timeoutErrorInternal.EndPhase(SqlConnectionTimeoutErrorPhase.ConsumePreLoginHandshake); - timeoutErrorInternal.SetAndBeginPhase(SqlConnectionTimeoutErrorPhase.LoginBegin); - - _parser._physicalStateObj.SniContext = SniContext.Snix_Login; - this.Login(serverInfo, timeout, newPassword, newSecurePassword); - - timeoutErrorInternal.EndPhase(SqlConnectionTimeoutErrorPhase.ProcessConnectionAuth); - timeoutErrorInternal.SetAndBeginPhase(SqlConnectionTimeoutErrorPhase.PostLogin); - - CompleteLogin(!ConnectionOptions.Pooling); - - timeoutErrorInternal.EndPhase(SqlConnectionTimeoutErrorPhase.PostLogin); - } - - - internal void FailoverPermissionDemand() { - if (null != PoolGroupProviderInfo) { - PoolGroupProviderInfo.FailoverPermissionDemand(); - } - } - - //////////////////////////////////////////////////////////////////////////////////////// - // PREPARED COMMAND METHODS - //////////////////////////////////////////////////////////////////////////////////////// - - protected override object ObtainAdditionalLocksForClose() { - bool obtainParserLock = !ThreadHasParserLockForClose; - Debug.Assert(obtainParserLock || _parserLock.ThreadMayHaveLock(), "Thread claims to have lock, but lock is not taken"); - if (obtainParserLock) { - _parserLock.Wait(canReleaseFromAnyThread: false); - ThreadHasParserLockForClose = true; - } - return obtainParserLock; - } - - protected override void ReleaseAdditionalLocksForClose(object lockToken) { - Debug.Assert(lockToken is bool, "Lock token should be boolean"); - if ((bool)lockToken) { - ThreadHasParserLockForClose = false; - _parserLock.Release(); - } - } - - // called by SqlConnection.RepairConnection which is a relatevly expensive way of repair inner connection - // prior to execution of request, used from EnlistTransaction, EnlistDistributedTransaction and ChangeDatabase - internal bool GetSessionAndReconnectIfNeeded(SqlConnection parent, int timeout = 0) { - - Debug.Assert(!ThreadHasParserLockForClose, "Cannot call this method if caller has parser lock"); - if (ThreadHasParserLockForClose) { - return false; // we cannot restore if we cannot release lock - } - - _parserLock.Wait(canReleaseFromAnyThread: false); - ThreadHasParserLockForClose = true; // In case of error, let the connection know that we already own the parser lock - bool releaseConnectionLock = true; - - try { - RuntimeHelpers.PrepareConstrainedRegions(); - try { -#if DEBUG - TdsParser.ReliabilitySection tdsReliabilitySection = new TdsParser.ReliabilitySection(); - RuntimeHelpers.PrepareConstrainedRegions(); - try { - tdsReliabilitySection.Start(); -#endif //DEBUG - Task reconnectTask = parent.ValidateAndReconnect(() => { - ThreadHasParserLockForClose = false; - _parserLock.Release(); - releaseConnectionLock = false; - }, timeout); - if (reconnectTask != null) { - AsyncHelper.WaitForCompletion(reconnectTask, timeout); - return true; - } - return false; -#if DEBUG - } - finally { - tdsReliabilitySection.Stop(); - } -#endif //DEBUG - } - catch (System.OutOfMemoryException) { - DoomThisConnection(); - throw; - } - catch (System.StackOverflowException) { - DoomThisConnection(); - throw; - } - catch (System.Threading.ThreadAbortException) { - DoomThisConnection(); - throw; - } - } - finally { - if (releaseConnectionLock) { - ThreadHasParserLockForClose = false; - _parserLock.Release(); - } - } - } - - //////////////////////////////////////////////////////////////////////////////////////// - // PARSER CALLBACKS - //////////////////////////////////////////////////////////////////////////////////////// - - internal void BreakConnection() { - var connection = Connection; - Bid.Trace(" %d#, Breaking connection.\n", ObjectID); - DoomThisConnection(); // Mark connection as unusable, so it will be destroyed - if (null != connection) { - connection.Close(); - } - } - - internal bool IgnoreEnvChange { // true if we are only draining environment change tokens, used by TdsParser - get { - return _routingInfo != null; // connection was routed, ignore rest of env change - } - } - - internal void OnEnvChange(SqlEnvChange rec) { - Debug.Assert(!IgnoreEnvChange,"This function should not be called if IgnoreEnvChange is set!"); - switch (rec.type) { - case TdsEnums.ENV_DATABASE: - // If connection is not open and recovery is not in progresss, store the server value as the original. - if (!_fConnectionOpen && _recoverySessionData == null) { - _originalDatabase = rec.newValue; - } - - CurrentDatabase = rec.newValue; - break; - - case TdsEnums.ENV_LANG: - // If connection is not open and recovery is not in progresss, store the server value as the original. - if (!_fConnectionOpen && _recoverySessionData == null) { - _originalLanguage = rec.newValue; - } - - _currentLanguage = rec.newValue; // TODO: finish this. - break; - - case TdsEnums.ENV_PACKETSIZE: - _currentPacketSize = Int32.Parse(rec.newValue, CultureInfo.InvariantCulture); - break; - - case TdsEnums.ENV_COLLATION: - if (_currentSessionData != null) { - _currentSessionData._collation = rec.newCollation; - } - break; - - case TdsEnums.ENV_CHARSET: - case TdsEnums.ENV_LOCALEID: - case TdsEnums.ENV_COMPFLAGS: - case TdsEnums.ENV_BEGINTRAN: - case TdsEnums.ENV_COMMITTRAN: - case TdsEnums.ENV_ROLLBACKTRAN: - case TdsEnums.ENV_ENLISTDTC: - case TdsEnums.ENV_DEFECTDTC: - // only used on parser - break; - - case TdsEnums.ENV_LOGSHIPNODE: - if (ConnectionOptions.ApplicationIntent == ApplicationIntent.ReadOnly) { - throw SQL.ROR_FailoverNotSupportedServer(this); - } - _currentFailoverPartner = rec.newValue; - break; - - case TdsEnums.ENV_PROMOTETRANSACTION: - PromotedDTCToken = rec.newBinValue; - break; - - case TdsEnums.ENV_TRANSACTIONENDED: - break; - - case TdsEnums.ENV_TRANSACTIONMANAGERADDRESS: - // For now we skip these Yukon only env change notifications - break; - - case TdsEnums.ENV_SPRESETCONNECTIONACK: - // connection is being reset - if (_currentSessionData != null) { - _currentSessionData.Reset(); - } - break; - - case TdsEnums.ENV_USERINSTANCE: - _instanceName = rec.newValue; - break; - - case TdsEnums.ENV_ROUTING: - if (string.IsNullOrEmpty(rec.newRoutingInfo.ServerName) || rec.newRoutingInfo.Protocol != 0 || rec.newRoutingInfo.Port == 0) { - throw SQL.ROR_InvalidRoutingInfo(this); - } - _routingInfo = rec.newRoutingInfo; - break; - - default: - Debug.Assert(false, "Missed token in EnvChange!"); - break; - } - } - - internal void OnLoginAck(SqlLoginAck rec) { - _loginAck = rec; - // - if (_recoverySessionData != null) { - if (_recoverySessionData._tdsVersion != rec.tdsVersion) { - throw SQL.CR_TDSVersionNotPreserved(this); - } - } - if (_currentSessionData != null) { - _currentSessionData._tdsVersion = rec.tdsVersion; - } - } - - internal void OnFeatureExtAck(int featureId, byte[] data) { - if (_routingInfo != null) { - return; - } - switch (featureId) { - case TdsEnums.FEATUREEXT_SRECOVERY: { - // Session recovery not requested - if (!_sessionRecoveryRequested) { - throw SQL.ParsingError(); - } - _sessionRecoveryAcknowledged = true; - -#if DEBUG - foreach (var s in _currentSessionData._delta) { - Debug.Assert(s==null, "Delta should be null at this point"); - } -#endif - Debug.Assert(_currentSessionData._unrecoverableStatesCount == 0, "Unrecoverable states count should be 0"); - - int i = 0; - while (i < data.Length) { - byte stateId = data[i]; i++; - int len; - byte bLen = data[i]; i++; - if (bLen == 0xFF) { - len = BitConverter.ToInt32(data, i); i += 4; - } - else { - len = bLen; - } - byte[] stateData = new byte[len]; - Buffer.BlockCopy(data, i, stateData, 0, len); i += len; - if (_recoverySessionData == null) { - _currentSessionData._initialState[stateId] = stateData; - } - else { - _currentSessionData._delta[stateId] = new SessionStateRecord { _data = stateData, _dataLength = len, _recoverable = true, _version = 0 }; - _currentSessionData._deltaDirty = true; - } - } - break; - } - default: { - // Unknown feature ack - throw SQL.ParsingError(); - } - } - } - - //////////////////////////////////////////////////////////////////////////////////////// - // Helper methods for Locks - //////////////////////////////////////////////////////////////////////////////////////// - - // Indicates if the current thread claims to hold the parser lock - internal bool ThreadHasParserLockForClose { - get { - return _threadIdOwningParserLock == Thread.CurrentThread.ManagedThreadId; - } - set { - Debug.Assert(_parserLock.ThreadMayHaveLock(), "Should not modify ThreadHasParserLockForClose without taking the lock first"); - Debug.Assert(_threadIdOwningParserLock == -1 || _threadIdOwningParserLock == Thread.CurrentThread.ManagedThreadId, "Another thread already claims to own the parser lock"); - - if (value) { - // If setting to true, then the thread owning the lock is the current thread - _threadIdOwningParserLock = Thread.CurrentThread.ManagedThreadId; - } - else if (_threadIdOwningParserLock == Thread.CurrentThread.ManagedThreadId) { - // If setting to false and currently owns the lock, then no-one owns the lock - _threadIdOwningParserLock = -1; - } - // else This thread didn't own the parser lock and doesn't claim to own it, so do nothing - } - } - - internal override bool TryReplaceConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource retry, DbConnectionOptions userOptions) { - return base.TryOpenConnectionInternal(outerConnection, connectionFactory, retry, userOptions); - } - } - - internal sealed class ServerInfo { - internal string ExtendedServerName { get; private set; } // the resolved servername with protocol - internal string ResolvedServerName { get; private set; } // the resolved servername only - internal string ResolvedDatabaseName { get; private set; } // name of target database after resolution - internal string UserProtocol { get; private set; } // the user specified protocol - - // The original user-supplied server name from the connection string. - // If connection string has no Data Source, the value is set to string.Empty. - // In case of routing, will be changed to routing destination - internal string UserServerName - { - get - { - return m_userServerName; - } - private set - { - m_userServerName = value; - } - } private string m_userServerName; - - internal readonly string PreRoutingServerName; - - // Initialize server info from connection options, - internal ServerInfo(SqlConnectionString userOptions) : this(userOptions, userOptions.DataSource) {} - - // Initialize server info from connection options, but override DataSource with given server name - internal ServerInfo (SqlConnectionString userOptions, string serverName) { - //----------------- - // Preconditions - Debug.Assert(null != userOptions); - - //----------------- - //Method body - - Debug.Assert(serverName != null, "server name should never be null"); - UserServerName = (serverName ?? string.Empty); // ensure user server name is not null - - UserProtocol = userOptions.NetworkLibrary; - ResolvedDatabaseName = userOptions.InitialCatalog; - PreRoutingServerName = null; - } - - - // Initialize server info from connection options, but override DataSource with given server name - internal ServerInfo(SqlConnectionString userOptions, RoutingInfo routing, string preRoutingServerName) { - //----------------- - // Preconditions - Debug.Assert(null != userOptions && null!=routing); - - //----------------- - //Method body - Debug.Assert(routing.ServerName != null, "server name should never be null"); - if (routing == null || routing.ServerName == null) { - UserServerName = string.Empty; // ensure user server name is not null - } - else { - UserServerName = string.Format(CultureInfo.InvariantCulture, "{0},{1}", routing.ServerName, routing.Port); - } - PreRoutingServerName = preRoutingServerName; - UserProtocol = TdsEnums.TCP; - SetDerivedNames(UserProtocol, UserServerName); - ResolvedDatabaseName = userOptions.InitialCatalog; - } - - internal void SetDerivedNames(string protocol, string serverName) { - // The following concatenates the specified netlib network protocol to the host string, if netlib is not null - // and the flag is on. This allows the user to specify the network protocol for the connection - but only - // when using the Dbnetlib dll. If the protocol is not specified, the netlib will - // try all protocols in the order listed in the Client Network Utility. Connect will - // then fail if all protocols fail. - if (!ADP.IsEmpty(protocol)) { - ExtendedServerName = protocol + ":" + serverName; - } - else { - ExtendedServerName = serverName; - } - ResolvedServerName = serverName; - } - } -} - diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionTds.cs.REMOVED.git-id b/external/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionTds.cs.REMOVED.git-id new file mode 100644 index 0000000000..760d57829a --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlInternalConnectionTds.cs.REMOVED.git-id @@ -0,0 +1 @@ +c07b195ac1ba68e64a6342f0c03bbc6e4bc32456 \ No newline at end of file diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationInfo.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationInfo.cs index 97826a6c96..bb13ddb37c 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationInfo.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationInfo.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// mithomas +// blained +// ramp //------------------------------------------------------------------------------ namespace System.Data.SqlClient { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationSource.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationSource.cs index 6fa06cf29e..cc787d352f 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationSource.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationSource.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// mithomas +// blained +// ramp //------------------------------------------------------------------------------ namespace System.Data.SqlClient { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationType.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationType.cs index 17f31f43c0..6cf8747e9a 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationType.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlNotificationType.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// mithomas +// blained +// ramp //------------------------------------------------------------------------------ namespace System.Data.SqlClient { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlParameter.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlParameter.cs index 66614199c4..9b238a4706 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlParameter.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlParameter.cs @@ -84,6 +84,48 @@ namespace System.Data.SqlClient { private bool _coercedValueIsDataFeed; private int _actualSize = -1; + /// + /// Column Encryption Cipher Related Metadata. + /// + private SqlCipherMetadata _columnEncryptionCipherMetadata; + + /// + /// Get or set the encryption related metadata of this SqlParameter. + /// Should be set to a non-null value only once. + /// + internal SqlCipherMetadata CipherMetadata { + get { + return _columnEncryptionCipherMetadata; + } + + set { + Debug.Assert(_columnEncryptionCipherMetadata == null || value == null, + "_columnEncryptionCipherMetadata should be set to a non-null value only once."); + + _columnEncryptionCipherMetadata = value; + } + } + + /// + /// Indicates if the parameter encryption metadata received by sp_describe_parameter_encryption. + /// For unencrypted parameters, the encryption metadata should still be sent (and will indicate + /// that no encryption is needed). + /// + internal bool HasReceivedMetadata { get; set; } + + /// + /// Returns the normalization rule version number as a byte + /// + internal byte NormalizationRuleVersion { + get { + if (_columnEncryptionCipherMetadata != null) { + return _columnEncryptionCipherMetadata.NormalizationRuleVersion; + } + + return 0x00; + } + } + public SqlParameter() : base() { } @@ -231,6 +273,16 @@ namespace System.Data.SqlClient { } } + [ + DefaultValue(false), + ResCategoryAttribute(Res.DataCategory_Data), + ResDescriptionAttribute(Res.TCE_SqlParameter_ForceColumnEncryption), + ] + public bool ForceColumnEncryption { + get; + set; + } + override public DbType DbType { get { return GetMetaTypeOnly().DbType; @@ -309,6 +361,22 @@ namespace System.Data.SqlClient { } } + /// + /// Get SMI Metadata to write out type_info stream. + /// + /// + internal MSS.SmiParameterMetaData GetMetadataForTypeInfo() { + ParameterPeekAheadValue peekAhead = null; + + if (_internalMetaType == null) { + _internalMetaType = GetMetaTypeOnly(); + } + + return MetaDataForSmi(out peekAhead); + } + + // IMPORTANT DEVNOTE: This method is being used for parameter encryption functionality, to get the type_info TDS object from SqlParameter. + // Please consider impact to that when changing this method. Refer to the callers of SqlParameter.GetMetadataForTypeInfo(). internal MSS.SmiParameterMetaData MetaDataForSmi(out ParameterPeekAheadValue peekAhead) { peekAhead = null; MetaType mt = ValidateTypeLengths( true /* Yukon or newer */ ); @@ -448,7 +516,7 @@ namespace System.Data.SqlClient { internal bool ParamaterIsSqlType { get { return _isSqlParameterSqlType; - } + } set { _isSqlParameterSqlType = value; } @@ -998,6 +1066,7 @@ namespace System.Data.SqlClient { destination._coercedValueIsDataFeed = _coercedValueIsDataFeed; destination._coercedValueIsSqlType = _coercedValueIsSqlType; destination._actualSize = _actualSize; + destination.ForceColumnEncryption = ForceColumnEncryption; } internal byte GetActualPrecision() { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatedEventHandler.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatedEventHandler.cs index 832883eccb..b047910e73 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatedEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatedEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// blained +// laled //------------------------------------------------------------------------------ namespace System.Data.SqlClient { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatingEventHandler.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatingEventHandler.cs index ad38aaf49a..cffa552e77 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatingEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlRowUpdatingEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// blained +// laled //------------------------------------------------------------------------------ namespace System.Data.SqlClient { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlSecurityUtility.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlSecurityUtility.cs new file mode 100644 index 0000000000..a4b18c5252 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlSecurityUtility.cs @@ -0,0 +1,263 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// balnee +// krishnib +//------------------------------------------------------------------------------ +namespace System.Data.SqlClient +{ + using System; + using System.Diagnostics; + using System.Reflection; + using System.Security; + using System.Security.Cryptography; + using System.Text; + + internal static class SqlSecurityUtility { + + /// + /// Computes a keyed hash of a given text and returns. It fills the buffer "hash" with computed hash value. + /// + /// Plain text bytes whose hash has to be computed. + /// key used for the HMAC + /// Output buffer where the computed hash value is stored. If its less that 64 bytes, the hash is truncated + /// HMAC value + internal static void GetHMACWithSHA256(byte[] plainText, byte[] key, byte[] hash) { + const int MaxSHA256HashBytes = 32; + + Debug.Assert(key != null && plainText != null); + Debug.Assert(hash.Length != 0 && hash.Length <= MaxSHA256HashBytes); + + using (HMACSHA256 hmac = new HMACSHA256(key)) { + byte[] computedHash = hmac.ComputeHash(plainText); + + // Truncate the hash if needed + Buffer.BlockCopy (computedHash, 0, hash, 0, hash.Length); + } + } + + /// + /// Computes SHA256 hash of a given input + /// + /// input byte array which needs to be hashed + /// Returns SHA256 hash in a string form + internal static string GetSHA256Hash(byte[] input) { + Debug.Assert(input != null); + + using (SHA256 sha256 = SHA256Cng.Create()) { + byte[] hashValue = sha256.ComputeHash(input); + return GetHexString(hashValue); + } + } + + /// + /// Generates cryptographicall random bytes + /// + /// No of cryptographically random bytes to be generated + /// A byte array containing cryptographically generated random bytes + internal static void GenerateRandomBytes(byte[] randomBytes) { + // Generate random bytes cryptographically. + RNGCryptoServiceProvider rngCsp = new RNGCryptoServiceProvider(); + rngCsp.GetBytes(randomBytes); + } + + /// + /// Compares two byte arrays and returns true if all bytes are equal + /// + /// input buffer + /// another buffer to be compared against + /// returns true if both the arrays have the same byte values else returns false + internal static bool CompareBytes(byte[] buffer1, byte[] buffer2, int buffer2Index, int lengthToCompare) { + if (null == buffer1 || null == buffer2) { + return false; + } + + Debug.Assert (buffer2Index > -1 && buffer2Index < buffer2.Length, "invalid index");// bounds on buffer2Index + if ((buffer2.Length -buffer2Index) < lengthToCompare) { + return false; + } + + for (int index = 0; index < buffer1.Length && index < lengthToCompare; ++index) { + if (buffer1[index] != buffer2[buffer2Index + index]) { + return false; + } + } + + return true; + } + + /// + /// Gets hex representation of byte array. + /// input byte array + /// + internal static string GetHexString(byte[] input) { + Debug.Assert(input != null); + + StringBuilder str = new StringBuilder(); + foreach (byte b in input) { + str.AppendFormat(b.ToString(@"X2")); + } + + return str.ToString(); + } + + /// + /// Returns the caller's function name in the format of [ClassName].[FunctionName] + /// + internal static string GetCurrentFunctionName() { + StackTrace stackTrace = new StackTrace(); + StackFrame stackFrame = stackTrace.GetFrame(1); + MethodBase methodBase = stackFrame.GetMethod(); + return string.Format(@"{0}.{1}", methodBase.DeclaringType.Name, methodBase.Name); + } + + /// + /// Return the algorithm name mapped to an Id. + /// + /// + /// + private static string ValidateAndGetEncryptionAlgorithmName (byte cipherAlgorithmId, string cipherAlgorithmName) { + if (TdsEnums.CustomCipherAlgorithmId == cipherAlgorithmId) { + if (null == cipherAlgorithmName) { + throw SQL.NullColumnEncryptionAlgorithm(SqlClientEncryptionAlgorithmFactoryList.GetInstance().GetRegisteredCipherAlgorithmNames()); + } + + return cipherAlgorithmName; + } + else if (TdsEnums.AEAD_AES_256_CBC_HMAC_SHA256 == cipherAlgorithmId) { + return SqlAeadAes256CbcHmac256Algorithm.AlgorithmName; + } + else if (TdsEnums.AES_256_CBC == cipherAlgorithmId) { + return SqlAes256CbcAlgorithm.AlgorithmName; + } + else { + throw SQL.UnknownColumnEncryptionAlgorithmId(cipherAlgorithmId, GetRegisteredCipherAlgorithmIds()); + } + } + + /// + /// Retrieves a string with comma separated list of registered algorithm Ids (enclosed in quotes). + /// + private static string GetRegisteredCipherAlgorithmIds () { + return @"'1', '2'"; + } + + /// + /// Encrypts the plaintext. + /// + internal static byte[] EncryptWithKey (byte[] plainText, SqlCipherMetadata md, string serverName) { + Debug.Assert(serverName != null, @"serverName should not be null in EncryptWithKey."); + + // Initialize cipherAlgo if not already done. + if (!md.IsAlgorithmInitialized()) { + SqlSecurityUtility.DecryptSymmetricKey(md, serverName); + } + + Debug.Assert(md.IsAlgorithmInitialized(), "Encryption Algorithm is not initialized"); + byte[] cipherText = md.CipherAlgorithm.EncryptData(plainText); // this call succeeds or throws. + if (null == cipherText || 0 == cipherText.Length) { + SQL.NullCipherText(); + } + + return cipherText; + } + + /// + /// Gets a string with first/last 10 bytes in the buff (useful for exception handling). + /// + internal static string GetBytesAsString(byte[] buff, bool fLast, int countOfBytes) { + int count = (buff.Length > countOfBytes) ? countOfBytes : buff.Length; + int startIndex = 0; + if (fLast) { + startIndex = buff.Length - count; + Debug.Assert(startIndex >= 0); + } + + return BitConverter.ToString(buff, startIndex, count); + } + + /// + /// Decrypts the ciphertext. + /// + internal static byte[] DecryptWithKey(byte[] cipherText, SqlCipherMetadata md, string serverName) { + Debug.Assert(serverName != null, @"serverName should not be null in DecryptWithKey."); + + // Initialize cipherAlgo if not already done. + if (!md.IsAlgorithmInitialized()) { + SqlSecurityUtility.DecryptSymmetricKey(md, serverName); + } + + Debug.Assert(md.IsAlgorithmInitialized(), "Decryption Algorithm is not initialized"); + try { + byte[] plainText = md.CipherAlgorithm.DecryptData(cipherText); // this call succeeds or throws. + if (null == plainText) { + throw SQL.NullPlainText (); + } + + return plainText; + } + catch (Exception e) { + // compute the strings to pass + string keyStr = GetBytesAsString(md.EncryptionKeyInfo.Value.encryptedKey, fLast:true, countOfBytes:10); + string valStr = GetBytesAsString(cipherText, fLast:false, countOfBytes:10); + throw SQL.ThrowDecryptionFailed(keyStr, valStr, e); + } + } + + /// + /// Decrypts the symmetric key and saves it in metadata. In addition, intializes + /// the SqlClientEncryptionAlgorithm for rapid decryption. + /// + internal static void DecryptSymmetricKey(SqlCipherMetadata md, string serverName) { + Debug.Assert(serverName != null, @"serverName should not be null in DecryptSymmetricKey."); + Debug.Assert(md != null, "md should not be null in DecryptSymmetricKey."); + Debug.Assert(md.EncryptionInfo.HasValue, "md.EncryptionInfo should not be null in DecryptSymmetricKey."); + Debug.Assert(md.EncryptionInfo.Value.ColumnEncryptionKeyValues != null, "md.EncryptionInfo.ColumnEncryptionKeyValues should not be null in DecryptSymmetricKey."); + + SqlClientSymmetricKey symKey = null; + SqlEncryptionKeyInfo? encryptionkeyInfoChosen = null; + SqlSymmetricKeyCache cache = SqlSymmetricKeyCache.GetInstance(); + Exception lastException = null; + foreach (SqlEncryptionKeyInfo keyInfo in md.EncryptionInfo.Value.ColumnEncryptionKeyValues) { + try { + if (cache.GetKey(keyInfo, serverName, out symKey)) { + encryptionkeyInfoChosen = keyInfo; + break; + } + } catch (Exception e) { + lastException = e; + } + } + + if (null == symKey) { + Debug.Assert (null != lastException, "CEK decryption failed without raising exceptions"); + throw lastException; + } + + Debug.Assert(encryptionkeyInfoChosen.HasValue, "encryptionkeyInfoChosen must have a value."); + + // Given the symmetric key instantiate a SqlClientEncryptionAlgorithm object and cache it in metadata + md.CipherAlgorithm = null; + SqlClientEncryptionAlgorithm cipherAlgorithm = null; + string algorithmName = ValidateAndGetEncryptionAlgorithmName(md.CipherAlgorithmId, md.CipherAlgorithmName); // may throw + SqlClientEncryptionAlgorithmFactoryList.GetInstance().GetAlgorithm(symKey, md.EncryptionType, algorithmName, out cipherAlgorithm); // will validate algorithm name and type + Debug.Assert(cipherAlgorithm != null); + md.CipherAlgorithm = cipherAlgorithm; + md.EncryptionKeyInfo = encryptionkeyInfoChosen; + return; + } + + /// + /// Calculates the length of the Base64 string used to represent a byte[] with the specified length. + /// + /// + /// + internal static int GetBase64LengthFromByteLength(int byteLength) { + Debug.Assert(byteLength <= UInt16.MaxValue, @"Encrypted column encryption key cannot be larger than 65536 bytes"); + + // Base64 encoding uses 1 character to encode 6 bits which means 4 characters for 3 bytes and pads to 4 byte multiples. + return (int)((double)byteLength * 4 / 3) + 4; + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlSymmetricKeyCache.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlSymmetricKeyCache.cs new file mode 100644 index 0000000000..fa371fb722 --- /dev/null +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlSymmetricKeyCache.cs @@ -0,0 +1,107 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// krishnib +// balnee +//------------------------------------------------------------------------------ + +namespace System.Data.SqlClient { + using System; + using System.Collections.Generic; + using System.Collections.Concurrent; + using System.Diagnostics; + using System.Globalization; + using System.Linq; + using System.Text; + + /// + /// Implements a cache of Symmetric Keys (once they are decrypted).Useful for rapidly decrypting multiple data values. + /// + sealed internal class SqlSymmetricKeyCache { + private readonly ConcurrentDictionary _cache; + private static readonly SqlSymmetricKeyCache _singletonInstance = new SqlSymmetricKeyCache(); + + + private SqlSymmetricKeyCache () { + _cache = new ConcurrentDictionary(concurrencyLevel: 4 * Environment.ProcessorCount /* default value in ConcurrentDictionary*/, capacity: 2); + } + + internal static SqlSymmetricKeyCache GetInstance () { + return _singletonInstance; + } + + /// + /// Retrieves Symmetric Key (in plaintext) given the encryption material. + /// + internal bool GetKey (SqlEncryptionKeyInfo keyInfo, string serverName, out SqlClientSymmetricKey encryptionKey) { + Debug.Assert(serverName != null, @"serverName should not be null."); + + StringBuilder cacheLookupKeyBuilder = new StringBuilder(serverName, capacity: serverName.Length + SqlSecurityUtility.GetBase64LengthFromByteLength(keyInfo.encryptedKey.Length) + keyInfo.keyStoreName.Length + 2/*separators*/); + +#if DEBUG + int capacity = cacheLookupKeyBuilder.Capacity; +#endif //DEBUG + + cacheLookupKeyBuilder.Append(":"); + cacheLookupKeyBuilder.Append(Convert.ToBase64String(keyInfo.encryptedKey)); + cacheLookupKeyBuilder.Append(":"); + cacheLookupKeyBuilder.Append(keyInfo.keyStoreName); + + string cacheLookupKey = cacheLookupKeyBuilder.ToString(); + +#if DEBUG + Debug.Assert(cacheLookupKey.Length <= capacity, "We needed to allocate a larger array"); +#endif //DEBUG + + encryptionKey = null; + + // Lookup the key in cache + if (!_cache.TryGetValue(cacheLookupKey, out encryptionKey)) { + Debug.Assert(SqlConnection.ColumnEncryptionTrustedMasterKeyPaths != null, @"SqlConnection.ColumnEncryptionTrustedMasterKeyPaths should not be null"); + + // Check against the trusted key paths + // + // Get the List corresponding to the connected server + IList trustedKeyPaths; + if (SqlConnection.ColumnEncryptionTrustedMasterKeyPaths.TryGetValue(serverName, out trustedKeyPaths)) { + // If the list is null or is empty or if the keyPath doesn't exist in the trusted key paths, then throw an exception. + if ((trustedKeyPaths == null) || (trustedKeyPaths.Count() == 0) || + // (trustedKeyPaths.Where(s => s.Equals(keyInfo.keyPath, StringComparison.InvariantCultureIgnoreCase)).Count() == 0)) { + (trustedKeyPaths.Any(s => s.Equals(keyInfo.keyPath, StringComparison.InvariantCultureIgnoreCase)) == false)) { + // throw an exception since the key path is not in the trusted key paths list for this server + throw SQL.UntrustedKeyPath(keyInfo.keyPath, serverName); + } + } + + // Key Not found, attempt to look up the provider and decrypt CEK + SqlColumnEncryptionKeyStoreProvider provider; + if (!SqlConnection.TryGetColumnEncryptionKeyStoreProvider(keyInfo.keyStoreName, out provider)) { + throw SQL.UnrecognizedKeyStoreProviderName(keyInfo.keyStoreName, + SqlConnection.GetColumnEncryptionSystemKeyStoreProviders(), + SqlConnection.GetColumnEncryptionCustomKeyStoreProviders()); + } + + // Decrypt the CEK + // We will simply bubble up the exception from the DecryptColumnEncryptionKey function. + byte[] plaintextKey; + try { + plaintextKey = provider.DecryptColumnEncryptionKey(keyInfo.keyPath, keyInfo.algorithmName, keyInfo.encryptedKey); + } + catch (Exception e) { + // Generate a new exception and throw. + string keyHex = SqlSecurityUtility.GetBytesAsString(keyInfo.encryptedKey, fLast:true, countOfBytes:10); + throw SQL.KeyDecryptionFailed (keyInfo.keyStoreName, keyHex, e); + } + + encryptionKey = new SqlClientSymmetricKey (plaintextKey); + + // In case multiple threads reach here at the same time, the first one wins. + // The allocated memory will be reclaimed by Garbage Collector. + _cache.TryAdd(cacheLookupKey, encryptionKey); + } + + return true; + } + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs b/external/referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs index 736fbb9af3..ae7086f0a0 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/SqlUtil.cs @@ -8,11 +8,13 @@ namespace System.Data.SqlClient { using System; + using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.Common; using System.Diagnostics; using System.Globalization; + using System.Linq; using System.Reflection; using System.Runtime.Serialization.Formatters; using System.Security; @@ -259,6 +261,24 @@ namespace System.Data.SqlClient { static internal Exception UserInstanceFailoverNotCompatible() { return ADP.Argument(Res.GetString(Res.SQL_UserInstanceFailoverNotCompatible)); } + static internal Exception CredentialsNotProvided(SqlAuthenticationMethod auth) { + return ADP.InvalidOperation(Res.GetString(Res.SQL_CredentialsNotProvided, DbConnectionStringBuilderUtil.AuthenticationTypeToString(auth))); + } + static internal Exception AuthenticationAndIntegratedSecurity() { + return ADP.Argument(Res.GetString(Res.SQL_AuthenticationAndIntegratedSecurity)); + } + static internal Exception IntegratedWithUserIDAndPassword() { + return ADP.Argument(Res.GetString(Res.SQL_IntegratedWithUserIDAndPassword)); + } + static internal Exception SettingIntegratedWithCredential() { + return ADP.InvalidOperation(Res.GetString(Res.SQL_SettingIntegratedWithCredential)); + } + static internal Exception SettingCredentialWithIntegratedArgument() { + return ADP.Argument(Res.GetString(Res.SQL_SettingCredentialWithIntegrated)); + } + static internal Exception SettingCredentialWithIntegratedInvalid() { + return ADP.InvalidOperation(Res.GetString(Res.SQL_SettingCredentialWithIntegrated)); + } static internal Exception InvalidSQLServerVersionUnknown() { return ADP.DataAdapter(Res.GetString(Res.SQL_InvalidSQLServerVersionUnknown)); } @@ -295,6 +315,9 @@ namespace System.Data.SqlClient { static internal Exception InvalidPartnerConfiguration (string server, string database) { return ADP.InvalidOperation(Res.GetString(Res.SQL_InvalidPartnerConfiguration, server, database)); } + static internal Exception BatchedUpdateColumnEncryptionSettingMismatch () { + return ADP.InvalidOperation(Res.GetString(Res.TCE_BatchedUpdateColumnEncryptionSettingMismatch, "SqlCommandColumnEncryptionSetting", "SelectCommand", "InsertCommand", "UpdateCommand", "DeleteCommand")); + } static internal Exception MARSUnspportedOnConnection() { return ADP.InvalidOperation(Res.GetString(Res.SQL_MarsUnsupportedOnConnection)); } @@ -440,9 +463,34 @@ namespace System.Data.SqlClient { static internal Exception InvalidTDSVersion() { return ADP.InvalidOperation(Res.GetString(Res.SQL_InvalidTDSVersion)); } - static internal Exception ParsingError() { - return ADP.InvalidOperation(Res.GetString(Res.SQL_ParsingError)); + static internal Exception ParsingError(ParsingErrorState state) { + return ADP.InvalidOperation(Res.GetString(Res.SQL_ParsingErrorWithState, ((int)state).ToString(CultureInfo.InvariantCulture))); } + static internal Exception ParsingError(ParsingErrorState state, Exception innerException) { + return ADP.InvalidOperation(Res.GetString(Res.SQL_ParsingErrorWithState, ((int)state).ToString(CultureInfo.InvariantCulture)), innerException); + } + static internal Exception ParsingErrorValue(ParsingErrorState state, int value) { + return ADP.InvalidOperation(Res.GetString(Res.SQL_ParsingErrorValue, ((int)state).ToString(CultureInfo.InvariantCulture), value)); + } + static internal Exception ParsingErrorOffset(ParsingErrorState state, int offset) { + return ADP.InvalidOperation(Res.GetString(Res.SQL_ParsingErrorOffset, ((int)state).ToString(CultureInfo.InvariantCulture), offset)); + } + static internal Exception ParsingErrorFeatureId(ParsingErrorState state, int featureId) { + return ADP.InvalidOperation(Res.GetString(Res.SQL_ParsingErrorFeatureId, ((int)state).ToString(CultureInfo.InvariantCulture), featureId)); + } + static internal Exception ParsingErrorToken(ParsingErrorState state, int token) { + return ADP.InvalidOperation(Res.GetString(Res.SQL_ParsingErrorToken, ((int)state).ToString(CultureInfo.InvariantCulture), token)); + } + static internal Exception ParsingErrorLength(ParsingErrorState state, int length) { + return ADP.InvalidOperation(Res.GetString(Res.SQL_ParsingErrorLength, ((int)state).ToString(CultureInfo.InvariantCulture), length)); + } + static internal Exception ParsingErrorStatus(ParsingErrorState state, int status) { + return ADP.InvalidOperation(Res.GetString(Res.SQL_ParsingErrorStatus, ((int)state).ToString(CultureInfo.InvariantCulture), status)); + } + static internal Exception ParsingErrorLibraryType(ParsingErrorState state, int libraryType) { + return ADP.InvalidOperation(Res.GetString(Res.SQL_ParsingErrorAuthLibraryType, ((int)state).ToString(CultureInfo.InvariantCulture), libraryType)); + } + static internal Exception MoneyOverflow(string moneyValue) { return ADP.Overflow(Res.GetString(Res.SQL_MoneyOverflow, moneyValue)); } @@ -475,6 +523,14 @@ namespace System.Data.SqlClient { return ADP.InvalidCast(Res.GetString(Res.SQL_StreamNotSupportOnColumnType, columnName)); } + static internal Exception StreamNotSupportOnEncryptedColumn(string columnName) { + return ADP.InvalidOperation(Res.GetString(Res.TCE_StreamNotSupportOnEncryptedColumn, columnName, "Stream")); + } + + static internal Exception SequentialAccessNotSupportedOnEncryptedColumn(string columnName) { + return ADP.InvalidOperation(Res.GetString(Res.TCE_SequentialAccessNotSupportedOnEncryptedColumn, columnName, "CommandBehavior=SequentialAccess")); + } + static internal Exception TextReaderNotSupportOnColumnType(string columnName) { return ADP.InvalidCast(Res.GetString(Res.SQL_TextReaderNotSupportOnColumnType, columnName)); } @@ -484,7 +540,7 @@ namespace System.Data.SqlClient { } static internal Exception UDTUnexpectedResult(string exceptionText){ - return ADP.TypeLoad(Res.GetString(Res.SQLUDT_Unexpected,exceptionText)); + return ADP.TypeLoad(Res.GetString(Res.SQLUDT_Unexpected,exceptionText)); } @@ -728,6 +784,444 @@ namespace System.Data.SqlClient { return ADP.InvalidOperation(Res.GetString(Res.SQL_BulkLoadPendingOperation)); } + // + // TCE - Certificate Store Provider Errors. + // + static internal Exception InvalidKeyEncryptionAlgorithm(string encryptionAlgorithm, string validEncryptionAlgorithm, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidKeyEncryptionAlgorithmSysErr, encryptionAlgorithm, validEncryptionAlgorithm), TdsEnums.TCE_PARAM_ENCRYPTION_ALGORITHM); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_InvalidKeyEncryptionAlgorithm, encryptionAlgorithm, validEncryptionAlgorithm), TdsEnums.TCE_PARAM_ENCRYPTION_ALGORITHM); + } + } + + static internal Exception NullKeyEncryptionAlgorithm(bool isSystemOp) { + if (isSystemOp) { + return ADP.ArgumentNull (TdsEnums.TCE_PARAM_ENCRYPTION_ALGORITHM, Res.GetString(Res.TCE_NullKeyEncryptionAlgorithmSysErr)); + } + else { + return ADP.ArgumentNull (TdsEnums.TCE_PARAM_ENCRYPTION_ALGORITHM, Res.GetString(Res.TCE_NullKeyEncryptionAlgorithm)); + } + } + + static internal Exception EmptyColumnEncryptionKey() { + return ADP.Argument(Res.GetString(Res.TCE_EmptyColumnEncryptionKey), TdsEnums.TCE_PARAM_COLUMNENCRYPTION_KEY); + } + + static internal Exception NullColumnEncryptionKey() { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_COLUMNENCRYPTION_KEY, Res.GetString(Res.TCE_NullColumnEncryptionKey)); + } + + static internal Exception EmptyEncryptedColumnEncryptionKey() { + return ADP.Argument(Res.GetString(Res.TCE_EmptyEncryptedColumnEncryptionKey), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + } + + static internal Exception NullEncryptedColumnEncryptionKey() { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_ENCRYPTED_CEK, Res.GetString(Res.TCE_NullEncryptedColumnEncryptionKey)); + } + + static internal Exception LargeCertificatePathLength(int actualLength, int maxLength, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_LargeCertificatePathLengthSysErr, actualLength, maxLength), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_LargeCertificatePathLength, actualLength, maxLength), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception NullCertificatePath(string[] validLocations, bool isSystemOp) { + Debug.Assert(2 == validLocations.Length); + if (isSystemOp) { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCertificatePathSysErr, validLocations[0], validLocations[1], @"/")); + } + else { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCertificatePath, validLocations[0], validLocations[1], @"/")); + } + } + + static internal Exception NullCspKeyPath(bool isSystemOp) { + if (isSystemOp) { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCspPathSysErr, @"/")); + } + else { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCspPath, @"/")); + } + } + + static internal Exception NullCngKeyPath(bool isSystemOp) { + if (isSystemOp) { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCngPathSysErr, @"/")); + } + else { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCngPath, @"/")); + } + } + + static internal Exception InvalidCertificatePath(string actualCertificatePath, string[] validLocations, bool isSystemOp) { + Debug.Assert(2 == validLocations.Length); + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificatePathSysErr, actualCertificatePath, validLocations[0], validLocations[1], @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificatePath, actualCertificatePath, validLocations[0], validLocations[1], @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception InvalidCspPath(string masterKeyPath, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCspPathSysErr, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCspPath, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception InvalidCngPath(string masterKeyPath, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCngPathSysErr, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCngPath, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception EmptyCspName(string masterKeyPath, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_EmptyCspNameSysErr, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_EmptyCspName, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception EmptyCngName(string masterKeyPath, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_EmptyCngNameSysErr, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_EmptyCngName, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception EmptyCspKeyId(string masterKeyPath, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_EmptyCspKeyIdSysErr, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_EmptyCspKeyId, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception EmptyCngKeyId(string masterKeyPath, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_EmptyCngKeyIdSysErr, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_EmptyCngKeyId, masterKeyPath, @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception InvalidCspName(string cspName, string masterKeyPath, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCspNameSysErr, cspName, masterKeyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCspName, cspName, masterKeyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception InvalidCspKeyIdentifier(string keyIdentifier, string masterKeyPath, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCspKeyIdSysErr, keyIdentifier, masterKeyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCspKeyId, keyIdentifier, masterKeyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception InvalidCngKey(string masterKeyPath, string cngProviderName, string keyIdentifier, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCngKeySysErr, masterKeyPath, cngProviderName, keyIdentifier), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCngKey, masterKeyPath, cngProviderName, keyIdentifier), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception InvalidCertificateLocation(string certificateLocation, string certificatePath, string[] validLocations, bool isSystemOp) { + Debug.Assert(2 == validLocations.Length); + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificateLocationSysErr, certificateLocation, certificatePath, validLocations[0], validLocations[1], @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificateLocation, certificateLocation, certificatePath, validLocations[0], validLocations[1], @"/"), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception InvalidCertificateStore(string certificateStore, string certificatePath, string validCertificateStore, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificateStoreSysErr, certificateStore, certificatePath, validCertificateStore), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificateStore, certificateStore, certificatePath, validCertificateStore), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception EmptyCertificateThumbprint(string certificatePath, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_EmptyCertificateThumbprintSysErr, certificatePath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_EmptyCertificateThumbprint, certificatePath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception CertificateNotFound(string thumbprint, string certificateLocation, string certificateStore, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_CertificateNotFoundSysErr, thumbprint, certificateLocation, certificateStore), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_CertificateNotFound, thumbprint, certificateLocation, certificateStore), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + static internal Exception InvalidAlgorithmVersionInEncryptedCEK(byte actual, byte expected) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidAlgorithmVersionInEncryptedCEK, actual.ToString(@"X2"), expected.ToString(@"X2")), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + } + + static internal Exception InvalidCiphertextLengthInEncryptedCEK(int actual, int expected, string certificateName) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCiphertextLengthInEncryptedCEK, actual, expected, certificateName), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + } + + static internal Exception InvalidCiphertextLengthInEncryptedCEKCsp(int actual, int expected, string masterKeyPath) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCiphertextLengthInEncryptedCEKCsp, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + } + + static internal Exception InvalidCiphertextLengthInEncryptedCEKCng(int actual, int expected, string masterKeyPath) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCiphertextLengthInEncryptedCEKCng, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + } + + static internal Exception InvalidSignatureInEncryptedCEK(int actual, int expected, string masterKeyPath) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidSignatureInEncryptedCEK, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + } + + static internal Exception InvalidSignatureInEncryptedCEKCsp(int actual, int expected, string masterKeyPath) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidSignatureInEncryptedCEKCsp, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + } + + static internal Exception InvalidSignatureInEncryptedCEKCng(int actual, int expected, string masterKeyPath) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidSignatureInEncryptedCEKCng, actual, expected, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + } + + static internal Exception InvalidCertificateSignature(string certificatePath) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificateSignature, certificatePath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + } + + static internal Exception InvalidSignature(string masterKeyPath) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidSignature, masterKeyPath), TdsEnums.TCE_PARAM_ENCRYPTED_CEK); + } + + static internal Exception CertificateWithNoPrivateKey(string keyPath, bool isSystemOp) { + if (isSystemOp) { + return ADP.Argument(Res.GetString(Res.TCE_CertificateWithNoPrivateKeySysErr, keyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + else { + return ADP.Argument(Res.GetString(Res.TCE_CertificateWithNoPrivateKey, keyPath), TdsEnums.TCE_PARAM_MASTERKEY_PATH); + } + } + + // + // TCE - Cryptographic Algorithms Error messages + // + static internal Exception NullColumnEncryptionKeySysErr() { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_ENCRYPTIONKEY,Res.GetString(Res.TCE_NullColumnEncryptionKeySysErr)); + } + + static internal Exception InvalidKeySize(string algorithmName, int actualKeylength, int expectedLength) { + return ADP.Argument(Res.GetString( + Res.TCE_InvalidKeySize, + algorithmName, + actualKeylength, + expectedLength), TdsEnums.TCE_PARAM_ENCRYPTIONKEY); + } + + static internal Exception InvalidEncryptionType(string algorithmName, SqlClientEncryptionType encryptionType, params SqlClientEncryptionType[] validEncryptionTypes) { + const string valueSeparator = @", "; + return ADP.Argument(Res.GetString( + Res.TCE_InvalidEncryptionType, + algorithmName, + encryptionType.ToString(), + string.Join(valueSeparator, validEncryptionTypes.Select((validEncryptionType => @"'" + validEncryptionType + @"'")))), TdsEnums.TCE_PARAM_ENCRYPTIONTYPE); + } + + static internal Exception NullPlainText () { + return ADP.ArgumentNull (Res.GetString(Res.TCE_NullPlainText)); + } + + static internal Exception VeryLargeCiphertext(long cipherTextLength, long maxCipherTextSize, long plainTextLength) { + return ADP.Argument(Res.GetString(Res.TCE_VeryLargeCiphertext, cipherTextLength, maxCipherTextSize, plainTextLength)); + } + + static internal Exception NullCipherText () { + return ADP.ArgumentNull (Res.GetString(Res.TCE_NullCipherText)); + } + + static internal Exception InvalidCipherTextSize(int actualSize, int minimumSize) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCipherTextSize, actualSize, minimumSize), TdsEnums.TCE_PARAM_CIPHERTEXT); + } + + static internal Exception InvalidAlgorithmVersion(byte actual, byte expected) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidAlgorithmVersion, actual.ToString(@"X2"), expected.ToString(@"X2")), TdsEnums.TCE_PARAM_CIPHERTEXT); + } + + static internal Exception InvalidAuthenticationTag() { + return ADP.Argument(Res.GetString(Res.TCE_InvalidAuthenticationTag), TdsEnums.TCE_PARAM_CIPHERTEXT); + } + + static internal Exception NullColumnEncryptionAlgorithm (string supportedAlgorithms) { + return ADP.ArgumentNull (TdsEnums.TCE_PARAM_ENCRYPTION_ALGORITHM, Res.GetString(Res.TCE_NullColumnEncryptionAlgorithm, supportedAlgorithms)); + } + + // + // TCE - Errors from sp_describe_parameter_encryption + // + static internal Exception UnexpectedDescribeParamFormat () { + return ADP.Argument (Res.GetString(Res.TCE_UnexpectedDescribeParamFormat, "sp_describe_parameter_encryption")); + } + + static internal Exception InvalidEncryptionKeyOrdinal (int ordinal, int maxOrdinal) { + return ADP.InvalidOperation(Res.GetString(Res.TCE_InvalidEncryptionKeyOrdinal, "sp_describe_parameter_encryption", ordinal, maxOrdinal)); + } + + static internal Exception ParamEncryptionMetadataMissing (string paramName, string procedureName) { + return ADP.Argument (Res.GetString(Res.TCE_ParamEncryptionMetaDataMissing, "sp_describe_parameter_encryption", paramName, procedureName)); + } + + static internal Exception ParamInvalidForceColumnEncryptionSetting (string paramName, string procedureName) { + return ADP.InvalidOperation(Res.GetString(Res.TCE_ParamInvalidForceColumnEncryptionSetting, TdsEnums.TCE_PARAM_FORCE_COLUMN_ENCRYPTION, paramName, procedureName, "SqlParameter")); + } + + static internal Exception ParamUnExpectedEncryptionMetadata (string paramName, string procedureName) { + return ADP.InvalidOperation(Res.GetString(Res.TCE_ParamUnExpectedEncryptionMetadata, paramName, procedureName, TdsEnums.TCE_PARAM_FORCE_COLUMN_ENCRYPTION, "SqlParameter")); + } + + static internal Exception ProcEncryptionMetadataMissing (string procedureName) { + return ADP.Argument (Res.GetString(Res.TCE_ProcEncryptionMetaDataMissing, "sp_describe_parameter_encryption", procedureName)); + } + + // + // TCE- Generic toplevel failures. + // + static internal Exception GetExceptionArray (string serverName, string errorMessage, Exception e) { + // Create and throw an exception array + SqlErrorCollection sqlErs = new SqlErrorCollection(); + Exception exceptionToInclude = (null != e.InnerException) ? e.InnerException : e; + sqlErs.Add (new SqlError(infoNumber:0, errorState:(byte)0x00, errorClass:(byte)TdsEnums.MIN_ERROR_CLASS, server:serverName, errorMessage:errorMessage, procedure:null, lineNumber:0)); + + if (e is SqlException) { + SqlException exThrown = (SqlException)e; + SqlErrorCollection errorList = exThrown.Errors; + for (int i =0; i < exThrown.Errors.Count; i++) { + sqlErs.Add(errorList[i]); + } + } + else { + sqlErs.Add (new SqlError(infoNumber:0, errorState:(byte)0x00, errorClass:(byte)TdsEnums.MIN_ERROR_CLASS, server:serverName, errorMessage:e.Message, procedure:null, lineNumber:0)); + } + + return SqlException.CreateException(sqlErs, "", null, exceptionToInclude); + } + + static internal Exception ParamEncryptionFailed (string paramName, string serverName, Exception e){ + return GetExceptionArray (serverName, Res.GetString(Res.TCE_ParamEncryptionFailed, paramName), e); + } + + static internal Exception ParamDecryptionFailed (string paramName, string serverName, Exception e) { + return GetExceptionArray (serverName, Res.GetString(Res.TCE_ParamDecryptionFailed, paramName), e); + } + + static internal Exception ColumnDecryptionFailed (string columnName, string serverName, Exception e) { + return GetExceptionArray (serverName, Res.GetString(Res.TCE_ColumnDecryptionFailed, columnName), e); + } + + // + // TCE- Client side query processing errors. + // + static internal Exception UnknownColumnEncryptionAlgorithm (string algorithmName, string supportedAlgorithms) { + return ADP.Argument(Res.GetString(Res.TCE_UnknownColumnEncryptionAlgorithm, algorithmName, supportedAlgorithms)); + } + + static internal Exception UnknownColumnEncryptionAlgorithmId (int algoId, string supportAlgorithmIds) { + return ADP.Argument(Res.GetString(Res.TCE_UnknownColumnEncryptionAlgorithmId, algoId, supportAlgorithmIds), TdsEnums.TCE_PARAM_CIPHER_ALGORITHM_ID); + } + + static internal Exception UnsupportedNormalizationVersion (byte version) { + return ADP.Argument(Res.GetString(Res.TCE_UnsupportedNormalizationVersion, version, "'1'", "SQL Server")); + } + + static internal Exception UnrecognizedKeyStoreProviderName(string providerName, List systemProviders, List customProviders) { + const string valueSeparator = @", "; + string systemProviderStr = string.Join (valueSeparator, systemProviders.Select(provider => @"'" + provider + @"'")); + string customProviderStr = string.Join (valueSeparator, customProviders.Select(provider => @"'" + provider + @"'")); + return ADP.Argument(Res.GetString(Res.TCE_UnrecognizedKeyStoreProviderName, providerName, systemProviderStr, customProviderStr)); + } + + static internal Exception InvalidDataTypeForEncryptedParameter(string parameterName, int actualDataType, int expectedDataType) { + return ADP.Argument(Res.GetString(Res.TCE_NullProviderValue, parameterName, actualDataType, expectedDataType)); + } +#if !MONO + static internal Exception KeyDecryptionFailed (string providerName, string keyHex, Exception e) { + if (providerName.Equals(SqlColumnEncryptionCertificateStoreProvider.ProviderName)) { + return GetExceptionArray(null, Res.GetString(Res.TCE_KeyDecryptionFailedCertStore, providerName, keyHex), e); + } + else { + return GetExceptionArray(null, Res.GetString(Res.TCE_KeyDecryptionFailed, providerName, keyHex), e); + } + } +#endif + static internal Exception UntrustedKeyPath(string keyPath, string serverName) { + return ADP.Argument(Res.GetString(Res.TCE_UntrustedKeyPath, keyPath, serverName)); + } + + static internal Exception UnsupportedDatatypeEncryption (string dataType) { + return ADP.Argument(Res.GetString(Res.TCE_UnsupportedDatatype, dataType)); + } + + static internal Exception ThrowDecryptionFailed (string keyStr, string valStr, Exception e) { + return GetExceptionArray (null, Res.GetString(Res.TCE_DecryptionFailed, keyStr, valStr), e); + } + + // + // TCE- SQL connection related error messages + // + static internal Exception TceNotSupported() { + return ADP.InvalidOperation (Res.GetString (Res.TCE_NotSupportedByServer, "SQL Server")); + } + + // + // TCE- Extensibility related error messages + // + static internal Exception CanOnlyCallOnce() { + return ADP.InvalidOperation(Res.GetString(Res.TCE_CanOnlyCallOnce)); + } + + static internal Exception NullCustomKeyStoreProviderDictionary() { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, Res.GetString(Res.TCE_NullCustomKeyStoreProviderDictionary)); + } + + static internal Exception InvalidCustomKeyStoreProviderName(string providerName, string prefix) { + return ADP.Argument(Res.GetString(Res.TCE_InvalidCustomKeyStoreProviderName, providerName, prefix), TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS); + } + + static internal Exception NullProviderValue(string providerName) { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, Res.GetString(Res.TCE_NullProviderValue, providerName)); + } + + static internal Exception EmptyProviderName() { + return ADP.ArgumentNull(TdsEnums.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, Res.GetString(Res.TCE_EmptyProviderName)); + } + // // transactions. // @@ -739,6 +1233,17 @@ namespace System.Data.SqlClient { return ADP.InvalidOperation(Res.GetString(Res.SQL_OpenResultCountExceeded)); } + // + // Global Transactions. + // + static internal Exception GlobalTransactionsNotEnabled() { + return ADP.InvalidOperation(Res.GetString(Res.GT_Disabled)); + } + + static internal Exception UnsupportedSysTxForGlobalTransactions() { + return ADP.InvalidOperation(Res.GetString(Res.GT_UnsupportedSysTxVersion)); + } + static internal readonly byte[] AttentionHeader = new byte[] { TdsEnums.MT_ATTN, // Message Type TdsEnums.ST_EOM, // Status @@ -1153,4 +1658,50 @@ namespace System.Data.SqlClient { } } } + + /// + /// This class holds methods invoked on System.Transactions through reflection for Global Transactions + /// + static internal class SysTxForGlobalTransactions { + + private static readonly Lazy _enlistPromotableSinglePhase = new Lazy(() => + typeof(SysTx.Transaction).GetMethod("EnlistPromotableSinglePhase", new Type[] {typeof(SysTx.IPromotableSinglePhaseNotification), typeof(Guid)})); + + private static readonly Lazy _setDistributedTransactionIdentifier = new Lazy(() => + typeof(SysTx.Transaction).GetMethod("SetDistributedTransactionIdentifier", new Type[] { typeof(SysTx.IPromotableSinglePhaseNotification), typeof(Guid) })); + + private static readonly Lazy _getPromotedToken = new Lazy(() => + typeof(SysTx.Transaction).GetMethod("GetPromotedToken")); + + /// + /// Enlists the given IPromotableSinglePhaseNotification and Non-MSDTC Promoter type into a transaction + /// + /// The MethodInfo instance to be invoked. Null if the method doesn't exist + public static MethodInfo EnlistPromotableSinglePhase { + get { + return _enlistPromotableSinglePhase.Value; + } + } + + /// + /// Sets the given DistributedTransactionIdentifier for a Transaction instance. + /// Needs to be invoked when using a Non-MSDTC Promoter type + /// + /// The MethodInfo instance to be invoked. Null if the method doesn't exist + public static MethodInfo SetDistributedTransactionIdentifier { + get { + return _setDistributedTransactionIdentifier.Value; + } + } + + /// + /// Gets the Promoted Token for a Transaction + /// + /// The MethodInfo instance to be invoked. Null if the method doesn't exist + public static MethodInfo GetPromotedToken { + get { + return _getPromotedToken.Value; + } + } + } }//namespace diff --git a/external/referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs b/external/referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs index 6cdc17706d..319e252b21 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/TdsEnums.cs @@ -57,6 +57,7 @@ namespace System.Data.SqlClient { // network function string contants public const string INIT_SSPI_PACKAGE = "InitSSPIPackage"; + public const string INIT_ADAL_PACKAGE = "InitADALPackage"; public const string INIT_SESSION = "InitSession"; public const string CONNECTION_GET_SVR_USER = "ConnectionGetSvrUser"; public const string GEN_CLIENT_CONTEXT = "GenClientContext"; @@ -104,7 +105,7 @@ namespace System.Data.SqlClient { public const byte MT_BINARY = 5; // Unformatted binary response data (UNUSED) public const byte MT_ATTN = 6; // Attention (break) signal public const byte MT_BULK = 7; // Bulk load data - public const byte MT_OPEN = 8; // Set up subchannel (UNUSED) + public const byte MT_FEDAUTH = 8; // Authentication token for federated authentication public const byte MT_CLOSE = 9; // Close subchannel (UNUSED) public const byte MT_ERROR = 10; // Protocol error detected public const byte MT_ACK = 11; // Protocol acknowledgement (UNUSED) @@ -156,6 +157,7 @@ namespace System.Data.SqlClient { public const byte SQLCOLMETADATA = 0x81; // Column metadata including name public const byte SQLALTMETADATA = 0x88; // Alt column metadata including name public const byte SQLSSPI = 0xed; // SSPI data + public const byte SQLFEDAUTHINFO = 0xee; // Info for client to generate fed auth token // Environment change notification streams // TYPE on TDS ENVCHANGE token stream (from sql\ntdbms\include\odsapi.h) @@ -196,13 +198,41 @@ namespace System.Data.SqlClient { // Feature Extension public const byte FEATUREEXT_TERMINATOR = 0xFF; public const byte FEATUREEXT_SRECOVERY = 0x01; + public const byte FEATUREEXT_FEDAUTH = 0x02; + public const byte FEATUREEXT_TCE = 0x04; + public const byte FEATUREEXT_GLOBALTRANSACTIONS = 0x05; [Flags] public enum FeatureExtension:uint { None=0, SessionRecovery=1, + FedAuth=2, + Tce=4, + GlobalTransactions = 8, } + public const byte FEDAUTHLIB_LIVEID = 0X00; + public const byte FEDAUTHLIB_SECURITYTOKEN = 0x01; + public const byte FEDAUTHLIB_ADAL = 0x02; + public const byte FEDAUTHLIB_RESERVED = 0X7F; + + public enum FedAuthLibrary:byte { + LiveId=FEDAUTHLIB_LIVEID, + SecurityToken=FEDAUTHLIB_SECURITYTOKEN, + ADAL=FEDAUTHLIB_ADAL, + Default=FEDAUTHLIB_RESERVED + } + + public const byte ADALWORKFLOW_ACTIVEDIRECTORYPASSWORD = 0x01; + public const byte ADALWORKFLOW_ACTIVEDIRECTORYINTEGRATED = 0x02; + + public enum ActiveDirectoryWorkflow : byte { + Password=ADALWORKFLOW_ACTIVEDIRECTORYPASSWORD, + Integrated=ADALWORKFLOW_ACTIVEDIRECTORYINTEGRATED, + } + + // The string used for username in the error message when Authentication = Active Directory Integrated with FedAuth is used, if authentication fails. + public const string NTAUTHORITYANONYMOUSLOGON = @"NT Authority\Anonymous Logon"; // Loginrec defines public const byte MAX_LOG_NAME = 30; // TDS 4.2 login rec max name length @@ -313,6 +343,7 @@ namespace System.Data.SqlClient { // second byte public const byte ClrFixedLen = 0x1; // Fixed length CLR type public const byte IsColumnSet = 0x4; // Column is an XML representation of an aggregation of other columns + public const byte IsEncrypted = 0x8; // Column is encrypted using TCE // null values public const uint VARLONGNULL = 0xffffffff; // null value for text and image types @@ -478,7 +509,7 @@ namespace System.Data.SqlClient { // RPC parameter class public const byte RPC_PARAM_BYREF = 0x1; public const byte RPC_PARAM_DEFAULT = 0x2; - public const byte RPC_PARAM_IS_LOB_COOKIE = 0x8; + public const byte RPC_PARAM_ENCRYPTED = 0x8; // SQL parameter list text public const string PARAM_OUTPUT = "output"; @@ -511,7 +542,7 @@ namespace System.Data.SqlClient { public const int LOGON_FAILED = 18456; public const int PASSWORD_EXPIRED = 18488; public const int IMPERSONATION_FAILED = 1346; - public const int P_TOKENTOOLONG = 103; + public const int P_TOKENTOOLONG = 103; // SNI\Win32 error values // NOTE: these are simply windows system error codes, not SNI specific @@ -862,10 +893,66 @@ namespace System.Data.SqlClient { 1, }; + internal const int MAX_TIME_SCALE = 7; // Maximum scale for time-related types + internal const int MAX_TIME_LENGTH = 5; // Maximum length for time + internal const int MAX_DATETIME2_LENGTH = 8; // Maximum length for datetime2 internal const int WHIDBEY_DATE_LENGTH = 10; internal static readonly int[] WHIDBEY_TIME_LENGTH = { 8, 10, 11, 12, 13, 14, 15, 16 }; internal static readonly int[] WHIDBEY_DATETIME2_LENGTH = { 19, 21, 22, 23, 24, 25, 26, 27 }; internal static readonly int[] WHIDBEY_DATETIMEOFFSET_LENGTH = {26, 28, 29, 30, 31, 32, 33, 34 }; + + internal enum FedAuthInfoId:byte { + Stsurl = 0x01, // FedAuthInfoData is token endpoint URL from which to acquire fed auth token + Spn = 0x02, // FedAuthInfoData is the SPN to use for acquiring fed auth token + } + + // TCE Related constants + internal const byte MAX_SUPPORTED_TCE_VERSION = 0x01; // max version + internal const ushort MAX_TCE_CIPHERINFO_SIZE = 2048; // max size of cipherinfo blob + internal const long MAX_TCE_CIPHERTEXT_SIZE = 2147483648; // max size of encrypted blob- currently 2GB. + internal const byte CustomCipherAlgorithmId = 0; // Id used for custom encryption algorithm. + + internal const int AES_256_CBC = 1; + internal const int AEAD_AES_256_CBC_HMAC_SHA256 = 2; + + // TCE Param names for exec handling + internal const string TCE_PARAM_CIPHERTEXT = "cipherText"; + internal const string TCE_PARAM_CIPHER_ALGORITHM_ID="cipherAlgorithmId"; + internal const string TCE_PARAM_COLUMNENCRYPTION_KEY="columnEncryptionKey"; + internal const string TCE_PARAM_ENCRYPTION_ALGORITHM="encryptionAlgorithm"; + internal const string TCE_PARAM_ENCRYPTIONTYPE = "encryptionType"; + internal const string TCE_PARAM_ENCRYPTIONKEY = "encryptionKey"; + internal const string TCE_PARAM_MASTERKEY_PATH = "masterKeyPath"; + internal const string TCE_PARAM_ENCRYPTED_CEK = "encryptedColumnEncryptionKey"; + internal const string TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS="clientKeyStoreProviders"; + internal const string TCE_PARAM_FORCE_COLUMN_ENCRYPTION="ForceColumnEncryption(true)"; + } + + internal enum ParsingErrorState { + Undefined = 0, + FedAuthInfoLengthTooShortForCountOfInfoIds = 1, + FedAuthInfoLengthTooShortForData = 2, + FedAuthInfoFailedToReadCountOfInfoIds = 3, + FedAuthInfoFailedToReadTokenStream = 4, + FedAuthInfoInvalidOffset = 5, + FedAuthInfoFailedToReadData = 6, + FedAuthInfoDataNotUnicode = 7, + FedAuthInfoDoesNotContainStsurlAndSpn = 8, + FedAuthInfoNotReceived = 9, + FedAuthNotAcknowledged = 10, + FedAuthFeatureAckContainsExtraData = 11, + FedAuthFeatureAckUnknownLibraryType = 12, + UnrequestedFeatureAckReceived = 13, + UnknownFeatureAck = 14, + InvalidTdsTokenReceived = 15, + SessionStateLengthTooShort = 16, + SessionStateInvalidStatus = 17, + CorruptedTdsStream = 18, + ProcessSniPacketFailed = 19, + FedAuthRequiredPreLoginResponseInvalidValue = 20, + TceUnknownVersion = 21, + TceInvalidVersion = 22, + TceInvalidOrdinalIntoCipherInfoTable = 23, } internal enum SniContext { @@ -884,5 +971,96 @@ namespace System.Data.SqlClient { Snix_Close, Snix_SendRows, } -} + /// + /// Column Encryption Setting to be used for the SqlConnection. + /// + public enum SqlConnectionColumnEncryptionSetting { + /// + /// Disables column encryption by default on all commands on this connection. + /// + Disabled = 0, + + /// + /// Enables column encryption by default on all commands on this connection. + /// + Enabled, + } + + /// + /// Column Encryption Setting to be used for the SqlCommand. + /// + public enum SqlCommandColumnEncryptionSetting { + /// + /// if “Column Encryption Setting=Enabled” in the connection string, use Enabled. Otherwise, maps to Disabled. + /// + UseConnectionSetting = 0, + + /// + /// Enables TCE for the command. Overrides the connection level setting for this command. + /// + Enabled, + + /// + /// Parameters will not be encrypted, only the ResultSet will be decrypted. This is an optimization for queries that do not pass any encrypted input parameters. + /// Overrides the connection level setting for this command. + /// + ResultSetOnly, + + /// + /// Disables TCE for the command.Overrides the connection level setting for this command. + /// + Disabled, + } + + public enum SqlAuthenticationMethod { + NotSpecified = 0, + SqlPassword, + ActiveDirectoryPassword, + ActiveDirectoryIntegrated, + } + // This enum indicates the state of TransparentNetworkIPResolution + // The first attempt when TNIR is on should be sequential. If the first attempt failes next attempts should be parallel. + internal enum TransparentNetworkResolutionState { + DisabledMode = 0, + SequentialMode, + ParallelMode + }; + + internal class ActiveDirectoryAuthentication + { + internal const string AdoClientId = "4d079b4c-cab7-4b7c-a115-8fd51b6f8239"; + internal const string AdalGetAccessTokenFunctionName = "ADALGetAccessToken"; + internal const int GetAccessTokenSuccess = 0; + internal const int GetAccessTokenInvalidGrant = 1; + internal const int GetAccessTokenTansisentError = 2; + internal const int GetAccessTokenOtherError = 3; + } + + // Fields in the first resultset of "sp_describe_parameter_encryption". + // We expect the server to return the fields in the resultset in the same order as mentioned below. + // If the server changes the below order, then transparent parameter encryption will break. + internal enum DescribeParameterEncryptionResultSet1 { + KeyOrdinal = 0, + DbId, + KeyId, + KeyVersion, + KeyMdVersion, + EncryptedKey, + ProviderName, + KeyPath, + KeyEncryptionAlgorithm, + } + + // Fields in the second resultset of "sp_describe_parameter_encryption" + // We expect the server to return the fields in the resultset in the same order as mentioned below. + // If the server changes the below order, then transparent parameter encryption will break. + internal enum DescribeParameterEncryptionResultSet2 { + ParameterOrdinal = 0, + ParameterName, + ColumnEncryptionAlgorithm, + ColumnEncrytionType, + ColumnEncryptionKeyOrdinal, + NormalizationRuleVersion, + } +} diff --git a/external/referencesource/System.Data/System/Data/SqlClient/TdsParser.cs.REMOVED.git-id b/external/referencesource/System.Data/System/Data/SqlClient/TdsParser.cs.REMOVED.git-id index ef1193f6e4..9ea157aa72 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/TdsParser.cs.REMOVED.git-id +++ b/external/referencesource/System.Data/System/Data/SqlClient/TdsParser.cs.REMOVED.git-id @@ -1 +1 @@ -a0d429ddb1baa51b9e864102b5fc2ca3e3c9f623 \ No newline at end of file +8c2c8cc5d8764a37eb98ae612a4ea8925a6c355f \ No newline at end of file diff --git a/external/referencesource/System.Data/System/Data/SqlClient/TdsParserHelperClasses.cs b/external/referencesource/System.Data/System/Data/SqlClient/TdsParserHelperClasses.cs index fe5d91e1be..01322f3193 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/TdsParserHelperClasses.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/TdsParserHelperClasses.cs @@ -19,8 +19,9 @@ namespace System.Data.SqlClient { using System.Text; using System.Threading; using System.Security; + using System.Globalization; - using Microsoft.SqlServer.Server; // for SMI metadata + using Microsoft.SqlServer.Server; // for SMI metadata internal enum CallbackType { Read = 0, @@ -47,6 +48,7 @@ namespace System.Data.SqlClient { THREADID, MARS, TRACEID, + FEDAUTHREQUIRED, NUMOPT, LASTOPT = 255 } @@ -65,6 +67,210 @@ namespace System.Data.SqlClient { Broken, } + /// + /// Struct encapsulating the data to be sent to the server as part of Federated Authentication Feature Extension. + /// + internal struct FederatedAuthenticationFeatureExtensionData + { + internal TdsEnums.FedAuthLibrary libraryType; + internal bool fedAuthRequiredPreLoginResponse; + internal SqlAuthenticationMethod authentication; + internal byte[] accessToken; + } + + /// + /// Represents a single encrypted value for a CEK. It contains the encrypted CEK, + /// the store type, name,the key path and encryption algorithm. + /// + internal struct SqlEncryptionKeyInfo { + internal byte[] encryptedKey; // the encrypted "column encryption key" + internal int databaseId; + internal int cekId; + internal int cekVersion; + internal byte[] cekMdVersion; + internal string keyPath; + internal string keyStoreName; + internal string algorithmName; + internal byte normalizationRuleVersion; + } + + /// + /// Encapsulates one entry in the CipherInfo table sent as part of Colmetadata. + /// The same CEK is encrypted multiple times with different master keys (for master key + /// rotation scenario) We need to keep all these around until we can resolve the CEK + /// using the correct master key. + /// + internal struct SqlTceCipherInfoEntry { + + /// + /// List of Column Encryption Key Information. + /// + private readonly List _columnEncryptionKeyValues; + + /// + /// Key Ordinal. + /// + private readonly int _ordinal; + + /// + /// Database ID + /// + private int _databaseId; + + /// + /// Cek ID + /// + private int _cekId; + + /// + /// Cek Version + /// + private int _cekVersion; + + /// + /// Cek MD Version + /// + private byte[] _cekMdVersion; + + /// + /// Return the ordinal. + /// + internal int Ordinal { + get { + return _ordinal; + } + } + + /// + /// Return the DatabaseID. + /// + internal int DatabaseId { + get { + return _databaseId; + } + } + + /// + /// Return the CEK ID. + /// + internal int CekId { + get { + return _cekId; + } + } + + /// + /// Return the CEK Version. + /// + internal int CekVersion { + get { + return _cekVersion; + } + } + + /// + /// Return the CEK MD Version. + /// + internal byte[] CekMdVersion { + get { + return _cekMdVersion; + } + } + + /// + /// Return the list of Column Encryption Key Values. + /// + internal List ColumnEncryptionKeyValues { + get { + return _columnEncryptionKeyValues; + } + } + + /// + /// Add an entry to the list of ColumnEncryptionKeyValues. + /// + /// + /// + /// + /// + /// + /// + /// + /// + internal void Add(byte[] encryptedKey, int databaseId, int cekId, int cekVersion, byte[] cekMdVersion, string keyPath, string keyStoreName, string algorithmName) { + + Debug.Assert(_columnEncryptionKeyValues != null, "_columnEncryptionKeyValues should already be initialized."); + + SqlEncryptionKeyInfo encryptionKey = new SqlEncryptionKeyInfo(); + encryptionKey.encryptedKey = encryptedKey; + encryptionKey.databaseId = databaseId; + encryptionKey.cekId = cekId; + encryptionKey.cekVersion = cekVersion; + encryptionKey.cekMdVersion = cekMdVersion; + encryptionKey.keyPath = keyPath; + encryptionKey.keyStoreName = keyStoreName; + encryptionKey.algorithmName = algorithmName; + _columnEncryptionKeyValues.Add(encryptionKey); + + if (0 == _databaseId) { + _databaseId = databaseId; + _cekId = cekId; + _cekVersion = cekVersion; + _cekMdVersion = cekMdVersion; + } + else { + Debug.Assert(_databaseId == databaseId); + Debug.Assert(_cekId == cekId); + Debug.Assert(_cekVersion == cekVersion); + Debug.Assert (_cekMdVersion != null && cekMdVersion != null && _cekMdVersion.Length == _cekMdVersion.Length); + } + } + + /// + /// Constructor. + /// + /// + internal SqlTceCipherInfoEntry(int ordinal = 0) : this() { + _ordinal = ordinal; + _databaseId = 0; + _cekId = 0; + _cekVersion = 0; + _cekMdVersion = null; + _columnEncryptionKeyValues = new List(); + } + } + + /// + /// Represents a table with various CEKs used in a resultset. Each entry corresponds to one (unique) CEK. The CEK + /// may have been encrypted using multiple master keys (giving us multiple CEK values). All these values form one single + /// entry in this table. + /// + internal struct SqlTceCipherInfoTable { + private readonly SqlTceCipherInfoEntry [] keyList; + + internal SqlTceCipherInfoTable (int tabSize) { + Debug.Assert (0 < tabSize, "Invalid Table Size"); + keyList = new SqlTceCipherInfoEntry[tabSize]; + } + + internal SqlTceCipherInfoEntry this [int index] { + get { + Debug.Assert (index < keyList.Length, "Invalid index specified."); + return keyList[index]; + } + set { + Debug.Assert (index < keyList.Length, "Invalid index specified."); + keyList[index] = value; + } + } + + internal int Size { + get { + return keyList.Length; + } + } + } + sealed internal class SqlCollation { // First 20 bits of info field represent the lcid, bits 21-25 are compare options private const uint IgnoreCase = 1 << 20; // bit 21 - IgnoreCase @@ -230,6 +436,7 @@ namespace System.Data.SqlClient { } sealed internal class SqlLogin { + internal SqlAuthenticationMethod authentication = SqlAuthenticationMethod.NotSpecified; // Authentication type internal int timeout; // login timeout internal bool userInstance = false; // user instance internal string hostName = ""; // client machine name @@ -258,6 +465,20 @@ namespace System.Data.SqlClient { internal UInt32 tdsVersion; } + sealed internal class SqlFedAuthInfo { + internal string spn; + internal string stsurl; + public override string ToString() { + return String.Format(CultureInfo.InvariantCulture, "STSURL: {0}, SPN: {1}", stsurl ?? String.Empty, spn ?? String.Empty); + } + } + + sealed internal class SqlFedAuthToken { + internal UInt32 dataLen; + internal byte[] accessToken; + internal long expirationFileTime; + } + sealed internal class _SqlMetaData : SqlMetaDataPriv, ICloneable { internal string column; @@ -337,9 +558,11 @@ namespace System.Data.SqlClient { internal int[] indexMap; internal int visibleColumns; internal DataTable schemaTable; - private readonly _SqlMetaData[] metaDataArray; + internal readonly SqlTceCipherInfoTable? cekTable; // table of "column encryption keys" used for this metadataset + internal readonly _SqlMetaData[] metaDataArray; - internal _SqlMetaDataSet(int count) { + internal _SqlMetaDataSet(int count, SqlTceCipherInfoTable? cipherTable) { + cekTable = cipherTable; metaDataArray = new _SqlMetaData[count]; for(int i = 0; i < metaDataArray.Length; ++i) { metaDataArray[i] = new _SqlMetaData(i); @@ -428,6 +651,170 @@ namespace System.Data.SqlClient { } } + /// + /// Represents Encryption related information of the cipher data. + /// + internal class SqlCipherMetadata { + + /// + /// Cipher Info Entry. + /// + private SqlTceCipherInfoEntry? _sqlTceCipherInfoEntry; + + /// + /// Encryption Algorithm Id. + /// + private readonly byte _cipherAlgorithmId; + + /// + /// Encryption Algorithm Name. + /// + private readonly string _cipherAlgorithmName; + + /// + /// Encryption Type. + /// + private readonly byte _encryptionType; + + /// + /// Normalization Rule Version. + /// + private readonly byte _normalizationRuleVersion; + + /// + /// Encryption Algorithm Handle. + /// + private SqlClientEncryptionAlgorithm _sqlClientEncryptionAlgorithm; + + /// + /// Sql Encryption Key Info. + /// + private SqlEncryptionKeyInfo? _sqlEncryptionKeyInfo; + + /// + /// Ordinal (into the Cek Table). + /// + private readonly ushort _ordinal; + + /// + /// Return the Encryption Info Entry. + /// + internal SqlTceCipherInfoEntry? EncryptionInfo { + get { + return _sqlTceCipherInfoEntry; + } + set { + Debug.Assert(!_sqlTceCipherInfoEntry.HasValue, "We can only set the EncryptionInfo once."); + _sqlTceCipherInfoEntry = value; + } + } + + /// + /// Return the cipher's encryption algorithm id. + /// + internal byte CipherAlgorithmId { + get { + return _cipherAlgorithmId; + } + } + + /// + /// Return the cipher's encryption algorithm name (could be null). + /// + internal string CipherAlgorithmName { + get { + return _cipherAlgorithmName; + } + } + + /// + /// Return EncryptionType (Deterministic, Randomized, etc.) + /// + internal byte EncryptionType { + get { + return _encryptionType; + } + } + + /// + /// Return normalization rule version. + /// + internal byte NormalizationRuleVersion { + get { + return _normalizationRuleVersion; + } + } + + /// + /// Return the cipher encyrption algorithm handle. + /// + internal SqlClientEncryptionAlgorithm CipherAlgorithm { + get { + return _sqlClientEncryptionAlgorithm; + } + set { + Debug.Assert(_sqlClientEncryptionAlgorithm == null, "_sqlClientEncryptionAlgorithm should not be set more than once."); + _sqlClientEncryptionAlgorithm = value; + } + } + + /// + /// Return Encryption Key Info. + /// + internal SqlEncryptionKeyInfo? EncryptionKeyInfo { + get { + return _sqlEncryptionKeyInfo; + } + + set { + Debug.Assert(!_sqlEncryptionKeyInfo.HasValue, "_sqlEncryptionKeyInfo should not be set more than once."); + _sqlEncryptionKeyInfo = value; + } + } + + /// + /// Return Ordinal into Cek Table. + /// + internal ushort CekTableOrdinal { + get { + return _ordinal; + } + } + + /// + /// Constructor. + /// + /// + /// + /// + /// + /// + internal SqlCipherMetadata (SqlTceCipherInfoEntry? sqlTceCipherInfoEntry, + ushort ordinal, + byte cipherAlgorithmId, + string cipherAlgorithmName, + byte encryptionType, + byte normalizationRuleVersion) { + Debug.Assert(!sqlTceCipherInfoEntry.Equals(default(SqlTceCipherInfoEntry)), "sqlTceCipherInfoEntry should not be un-initialized."); + + _sqlTceCipherInfoEntry = sqlTceCipherInfoEntry; + _ordinal = ordinal; + _cipherAlgorithmId = cipherAlgorithmId; + _cipherAlgorithmName = cipherAlgorithmName; + _encryptionType = encryptionType; + _normalizationRuleVersion = normalizationRuleVersion; + _sqlEncryptionKeyInfo = null; + } + + /// + /// Do we have an handle to the cipher encryption algorithm already ? + /// + /// + internal bool IsAlgorithmInitialized() { + return (null != _sqlClientEncryptionAlgorithm) ? true : false; + } + } + internal class SqlMetaDataPriv { internal SqlDbType type; // SqlDbType enum value internal byte tdsType; // underlying tds type @@ -462,6 +849,9 @@ namespace System.Data.SqlClient { internal string structuredTypeName; internal IList structuredFields; + internal bool isEncrypted; // TCE encrypted? + internal SqlMetaDataPriv baseTI; // for encrypted columns, represents the TYPE_INFO for plaintext value + internal SqlCipherMetadata cipherMD; // Cipher related metadata for encrypted columns. internal SqlMetaDataPriv() { } @@ -493,6 +883,157 @@ namespace System.Data.SqlClient { this.structuredTypeName = original.structuredTypeName; this.structuredFields = original.structuredFields; } + + /// + /// Is the algorithm handle for the cipher encryption initialized ? + /// + /// + internal bool IsAlgorithmInitialized() { + if (null != cipherMD) { + return cipherMD.IsAlgorithmInitialized(); + } + + return false; + } + + /// + /// Returns the normalization rule version byte. + /// + /// + internal byte NormalizationRuleVersion { + get { + if (null != cipherMD){ + return cipherMD.NormalizationRuleVersion; + } + + return 0x00; + } + } + } + + /// + /// Class encapsulating additional information when sending encrypted input parameters. + /// + sealed internal class SqlColumnEncryptionInputParameterInfo + { + /// + /// Metadata of the parameter to write the TYPE_INFO of the unencrypted column data type. + /// + private readonly SmiParameterMetaData _smiParameterMetadata; + + /// + /// Column encryption related metadata. + /// + private readonly SqlCipherMetadata _cipherMetadata; + + /// + /// Serialized format for a subset of members. + /// Does not include _smiParameterMetadata's serialization. + /// + private readonly byte[] _serializedWireFormat; + + /// + /// Return the SMI Parameter Metadata. + /// + internal SmiParameterMetaData ParameterMetadata { + get { + return _smiParameterMetadata; + } + } + + /// + /// Return the serialized format for some members. + /// This is pre-calculated and cached since members are immutable. + /// Does not include _smiParameterMetadata's serialization. + /// + internal byte[] SerializedWireFormat + { + get { + return _serializedWireFormat; + } + } + + /// + /// Constructor. + /// + /// + /// + internal SqlColumnEncryptionInputParameterInfo(SmiParameterMetaData smiParameterMetadata, SqlCipherMetadata cipherMetadata) { + Debug.Assert(smiParameterMetadata != null, "smiParameterMetadata should not be null."); + Debug.Assert(cipherMetadata != null, "cipherMetadata should not be null"); + Debug.Assert(cipherMetadata.EncryptionKeyInfo.HasValue, "cipherMetadata.EncryptionKeyInfo.HasValue should be true."); + + _smiParameterMetadata = smiParameterMetadata; + _cipherMetadata = cipherMetadata; + _serializedWireFormat = SerializeToWriteFormat(); + } + + /// + /// Serializes some data members to wire format. + /// + private byte[] SerializeToWriteFormat() { + int totalLength = 0; + + // CipherAlgorithmId. + totalLength += sizeof(byte); + + // Encryption Type. + totalLength += sizeof(byte); + + // Database id of the encryption key. + totalLength += sizeof(int); + + // Id of the encryption key. + totalLength += sizeof(int); + + // Version of the encryption key. + totalLength += sizeof(int); + + // Metadata version of the encryption key. + totalLength += _cipherMetadata.EncryptionKeyInfo.Value.cekMdVersion.Length; + + // Normalization Rule Version. + totalLength += sizeof(byte); + + byte[] serializedWireFormat = new byte[totalLength]; + + // No:of bytes consumed till now. Running variable. + int consumedBytes = 0; + + // 1 - Write Cipher Algorithm Id. + serializedWireFormat[consumedBytes++] = _cipherMetadata.CipherAlgorithmId; + + // 2 - Write Encryption Type. + serializedWireFormat[consumedBytes++] = _cipherMetadata.EncryptionType; + + // 3 - Write the database id of the encryption key. + SerializeIntIntoBuffer(_cipherMetadata.EncryptionKeyInfo.Value.databaseId, serializedWireFormat, ref consumedBytes); + + // 4 - Write the id of the encryption key. + SerializeIntIntoBuffer(_cipherMetadata.EncryptionKeyInfo.Value.cekId, serializedWireFormat, ref consumedBytes); + + // 5 - Write the version of the encryption key. + SerializeIntIntoBuffer(_cipherMetadata.EncryptionKeyInfo.Value.cekVersion, serializedWireFormat, ref consumedBytes); + + // 6 - Write the metadata version of the encryption key. + Buffer.BlockCopy(_cipherMetadata.EncryptionKeyInfo.Value.cekMdVersion, 0, serializedWireFormat, consumedBytes, _cipherMetadata.EncryptionKeyInfo.Value.cekMdVersion.Length); + consumedBytes += _cipherMetadata.EncryptionKeyInfo.Value.cekMdVersion.Length; + + // 7 - Write Normalization Rule Version. + serializedWireFormat[consumedBytes++] = _cipherMetadata.NormalizationRuleVersion; + + return serializedWireFormat; + } + + /// + /// Serializes an int into the provided buffer and offset. + /// + private void SerializeIntIntoBuffer(int value, byte[] buffer, ref int offset) { + buffer[offset++] = (byte)(value & 0xff); + buffer[offset++] = (byte)((value >> 8) & 0xff); + buffer[offset++] = (byte)((value >> 16) & 0xff); + buffer[offset++] = (byte)((value >> 24) & 0xff); + } } sealed internal class _SqlRPC { @@ -513,6 +1054,16 @@ namespace System.Data.SqlClient { internal int warningsIndexStart; internal int warningsIndexEnd; internal SqlErrorCollection warnings; + internal bool needsFetchParameterEncryptionMetadata; + internal string GetCommandTextOrRpcName() { + if (TdsEnums.RPC_PROCID_EXECUTESQL == ProcID) { + // Param 0 is the actual sql executing + return (string)parameters[0].Value; + } + else { + return rpcName; + } + } } sealed internal class SqlReturnValue : SqlMetaDataPriv { diff --git a/external/referencesource/System.Data/System/Data/SqlClient/TdsParserSafeHandles.cs b/external/referencesource/System.Data/System/Data/SqlClient/TdsParserSafeHandles.cs index 1bc1b7398a..73286f199c 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/TdsParserSafeHandles.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/TdsParserSafeHandles.cs @@ -132,7 +132,9 @@ namespace System.Data.SqlClient { out byte[] instanceName, bool flushCache, bool fSync, - bool fParallel) + bool fParallel, + TransparentNetworkResolutionState transparentNetworkResolutionState, + int totalTimeout) : base(IntPtr.Zero, true) { RuntimeHelpers.PrepareConstrainedRegions(); @@ -146,8 +148,9 @@ namespace System.Data.SqlClient { timeout = Timeout.Infinite; // -1 == native SNIOPEN_TIMEOUT_VALUE / INFINITE } + int transparentNetworkResolutionStateNo = (int)transparentNetworkResolutionState; _status = SNINativeMethodWrapper.SNIOpenSyncEx(myInfo, serverName, ref base.handle, - spnBuffer, instanceName, flushCache, fSync, timeout, fParallel); + spnBuffer, instanceName, flushCache, fSync, timeout, fParallel, transparentNetworkResolutionStateNo, totalTimeout); } } diff --git a/external/referencesource/System.Data/System/Data/SqlClient/TdsParserStateObject.cs.REMOVED.git-id b/external/referencesource/System.Data/System/Data/SqlClient/TdsParserStateObject.cs.REMOVED.git-id index 26649f8c71..398bcc020f 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/TdsParserStateObject.cs.REMOVED.git-id +++ b/external/referencesource/System.Data/System/Data/SqlClient/TdsParserStateObject.cs.REMOVED.git-id @@ -1 +1 @@ -81941166389c513b090acce6ba0d46a415057127 \ No newline at end of file +75e2a4b30c85da8f852bfbb12892cd57078088b4 \ No newline at end of file diff --git a/external/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs b/external/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs index 3b85484e02..187a187d0b 100644 --- a/external/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs +++ b/external/referencesource/System.Data/System/Data/SqlClient/TdsParserStaticMethods.cs @@ -113,7 +113,11 @@ namespace System.Data.SqlClient { [ResourceExposure(ResourceScope.None)] // SxS: we use this method for TDS login only [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] static internal int GetCurrentProcessIdForTdsLoginOnly() { +#if MOBILE + return 0; +#else return SafeNativeMethods.GetCurrentProcessId(); +#endif } diff --git a/external/referencesource/System.Data/System/Data/SqlDbType.cs b/external/referencesource/System.Data/System/Data/SqlDbType.cs index fc3149c61a..30322f22ff 100644 --- a/external/referencesource/System.Data/System/Data/SqlDbType.cs +++ b/external/referencesource/System.Data/System/Data/SqlDbType.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// blained +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/StateChangeEventHandler.cs b/external/referencesource/System.Data/System/Data/StateChangeEventHandler.cs index 7ded8507eb..2b415be9ac 100644 --- a/external/referencesource/System.Data/System/Data/StateChangeEventHandler.cs +++ b/external/referencesource/System.Data/System/Data/StateChangeEventHandler.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/StatementType.cs b/external/referencesource/System.Data/System/Data/StatementType.cs index b4cbc814c2..b4bc1ebb98 100644 --- a/external/referencesource/System.Data/System/Data/StatementType.cs +++ b/external/referencesource/System.Data/System/Data/StatementType.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/UpdateRowSource.cs b/external/referencesource/System.Data/System/Data/UpdateRowSource.cs index a063670bb3..639a0408ff 100644 --- a/external/referencesource/System.Data/System/Data/UpdateRowSource.cs +++ b/external/referencesource/System.Data/System/Data/UpdateRowSource.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/XmlContent.cs b/external/referencesource/System.Data/System/Data/XmlContent.cs index 76e4e04cd1..8cd2614b8c 100644 --- a/external/referencesource/System.Data/System/Data/XmlContent.cs +++ b/external/referencesource/System.Data/System/Data/XmlContent.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/XmlReadMode.cs b/external/referencesource/System.Data/System/Data/XmlReadMode.cs index 9b6c96ea7c..c0ad084bea 100644 --- a/external/referencesource/System.Data/System/Data/XmlReadMode.cs +++ b/external/referencesource/System.Data/System/Data/XmlReadMode.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/XmlWriteMode.cs b/external/referencesource/System.Data/System/Data/XmlWriteMode.cs index a14680cc77..c0cb4620fc 100644 --- a/external/referencesource/System.Data/System/Data/XmlWriteMode.cs +++ b/external/referencesource/System.Data/System/Data/XmlWriteMode.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// jasonzhu //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/dbtype.cs b/external/referencesource/System.Data/System/Data/dbtype.cs index 5e336ce251..61d06f0e66 100644 --- a/external/referencesource/System.Data/System/Data/dbtype.cs +++ b/external/referencesource/System.Data/System/Data/dbtype.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/Data/updatestatus.cs b/external/referencesource/System.Data/System/Data/updatestatus.cs index 7bd09483a6..509e14b415 100644 --- a/external/referencesource/System.Data/System/Data/updatestatus.cs +++ b/external/referencesource/System.Data/System/Data/updatestatus.cs @@ -2,8 +2,8 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] +// markash +// laled //------------------------------------------------------------------------------ namespace System.Data { diff --git a/external/referencesource/System.Data/System/NewXml/IXmlDataVirtualNode.cs b/external/referencesource/System.Data/System/NewXml/IXmlDataVirtualNode.cs index 35d05f1bb5..6dbed4e6d7 100644 --- a/external/referencesource/System.Data/System/NewXml/IXmlDataVirtualNode.cs +++ b/external/referencesource/System.Data/System/NewXml/IXmlDataVirtualNode.cs @@ -2,9 +2,9 @@ // // Copyright (c) Microsoft Corporation. All rights reserved. // -// [....] -// [....] -// [....] +// amirhmy +// markash +// danield //------------------------------------------------------------------------------ namespace System.Xml { diff --git a/external/referencesource/System.IdentityModel/InternalApis/Clr/inc/AppContextDefaultValues.cs b/external/referencesource/System.IdentityModel/InternalApis/Clr/inc/AppContextDefaultValues.cs new file mode 100644 index 0000000000..8a130a0f34 --- /dev/null +++ b/external/referencesource/System.IdentityModel/InternalApis/Clr/inc/AppContextDefaultValues.cs @@ -0,0 +1,169 @@ +// ==++== +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// ==--== +using System; +using System.Collections.Generic; + +namespace System +{ + internal static partial class AppContextDefaultValues + { + public static void PopulateDefaultValues() + { + string platformIdentifier, profile; + int version; + + ParseTargetFrameworkName(out platformIdentifier, out profile, out version); + + // Call into each library to populate their default switches + PopulateDefaultValuesPartial(platformIdentifier, profile, version); + } + + /// + /// We have this separate method for getting the parsed elements out of the TargetFrameworkName so we can + /// more easily support this on other platforms. + /// + private static void ParseTargetFrameworkName(out string identifier, out string profile, out int version) + { + string targetFrameworkMoniker = AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName; + + // If we don't have a TFM then we should default to the 4.0 behavior where all quirks are turned on. + if (!TryParseFrameworkName(targetFrameworkMoniker, out identifier, out version, out profile)) + { +#if FEATURE_CORECLR + if (CompatibilitySwitches.UseLatestBehaviorWhenTFMNotSpecified) + { + // If we want to use the latest behavior it is enough to set the value of the switch to string.Empty. + // When the get to the caller of this method (PopulateDefaultValuesPartial) we are going to use the + // identifier we just set to decide which switches to turn on. By having an empty string as the + // identifier we are simply saying -- don't turn on any switches, and we are going to get the latest + // behavior for all the switches + identifier = string.Empty; + } + else +#endif + { + identifier = ".NETFramework"; + version = 40000; + profile = string.Empty; + } + } + } + + // This code was a constructor copied from the FrameworkName class, which is located in System.dll. + // Parses strings in the following format: ", Version=[v|V], Profile=" + // - The identifier and version is required, profile is optional + // - Only three components are allowed. + // - The version string must be in the System.Version format; an optional "v" or "V" prefix is allowed + private static bool TryParseFrameworkName(String frameworkName, out String identifier, out int version, out String profile) + { + // For parsing a target Framework moniker, from the FrameworkName class + const char c_componentSeparator = ','; + const char c_keyValueSeparator = '='; + const char c_versionValuePrefix = 'v'; + const String c_versionKey = "Version"; + const String c_profileKey = "Profile"; + + identifier = profile = string.Empty; + version = 0; + + if (frameworkName == null || frameworkName.Length == 0) + { + return false; + } + + String[] components = frameworkName.Split(c_componentSeparator); + version = 0; + + // Identifer and Version are required, Profile is optional. + if (components.Length < 2 || components.Length > 3) + { + return false; + } + + // + // 1) Parse the "Identifier", which must come first. Trim any whitespace + // + identifier = components[0].Trim(); + + if (identifier.Length == 0) + { + return false; + } + + bool versionFound = false; + profile = null; + + // + // The required "Version" and optional "Profile" component can be in any order + // + for (int i = 1; i < components.Length; i++) + { + // Get the key/value pair separated by '=' + string[] keyValuePair = components[i].Split(c_keyValueSeparator); + + if (keyValuePair.Length != 2) + { + return false; + } + + // Get the key and value, trimming any whitespace + string key = keyValuePair[0].Trim(); + string value = keyValuePair[1].Trim(); + + // + // 2) Parse the required "Version" key value + // + if (key.Equals(c_versionKey, StringComparison.OrdinalIgnoreCase)) + { + versionFound = true; + + // Allow the version to include a 'v' or 'V' prefix... + if (value.Length > 0 && (value[0] == c_versionValuePrefix || value[0] == 'V')) + { + value = value.Substring(1); + } + Version realVersion = new Version(value); + // The version class will represent some unset values as -1 internally (instead of 0). + version = realVersion.Major * 10000; + if (realVersion.Minor > 0) + version += realVersion.Minor * 100; + if (realVersion.Build > 0) + version += realVersion.Build; + } + // + // 3) Parse the optional "Profile" key value + // + else if (key.Equals(c_profileKey, StringComparison.OrdinalIgnoreCase)) + { + if (!String.IsNullOrEmpty(value)) + { + profile = value; + } + } + else + { + return false; + } + } + + if (!versionFound) + { + return false; + } + + return true; + } + + // This is a partial method. Platforms (such as Desktop) can provide an implementation of it that will read override value + // from whatever mechanism is available on that platform. If no implementation is provided, the compiler is going to remove the calls + // to it from the code + static partial void TryGetSwitchOverridePartial(string switchName, ref bool overrideFound, ref bool overrideValue); + + /// This is a partial method. This method is responsible for populating the default values based on a TFM. + /// It is partial because each library should define this method in their code to contain their defaults. + static partial void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version); + } +} diff --git a/external/referencesource/System.IdentityModel/InternalApis/Clr/inc/LocalAppContext.cs b/external/referencesource/System.IdentityModel/InternalApis/Clr/inc/LocalAppContext.cs new file mode 100644 index 0000000000..f05b599ed3 --- /dev/null +++ b/external/referencesource/System.IdentityModel/InternalApis/Clr/inc/LocalAppContext.cs @@ -0,0 +1,128 @@ +// ==++== +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// ==--== + +// NOTE: This file should not be included in mscorlib. This should only be included in FX libraries that need to provide switches +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Threading; + +namespace System +{ + internal static partial class LocalAppContext + { + private delegate bool TryGetSwitchDelegate(string switchName, out bool value); + + private static TryGetSwitchDelegate TryGetSwitchFromCentralAppContext; + private static bool s_canForwardCalls; + + private static Dictionary s_switchMap = new Dictionary(); + private static readonly object s_syncLock = new object(); + + private static bool DisableCaching { get; set; } + + static LocalAppContext() + { + // Try to setup the callback into the central AppContext + s_canForwardCalls = SetupDelegate(); + + // Populate the default values of the local app context + AppContextDefaultValues.PopulateDefaultValues(); + + // Cache the value of the switch that help with testing + DisableCaching = IsSwitchEnabled(@"TestSwitch.LocalAppContext.DisableCaching"); + } + + public static bool IsSwitchEnabled(string switchName) + { + if (s_canForwardCalls) + { + bool isEnabledCentrally; + if (TryGetSwitchFromCentralAppContext(switchName, out isEnabledCentrally)) + { + // we found the switch, so return whatever value it has + return isEnabledCentrally; + } + // if we could not get the value from the central authority, try the local storage. + } + + return IsSwitchEnabledLocal(switchName); + } + + private static bool IsSwitchEnabledLocal(string switchName) + { + // read the value from the set of local defaults + bool isEnabled, isPresent; + lock (s_switchMap) + { + isPresent = s_switchMap.TryGetValue(switchName, out isEnabled); + } + + // If the value is in the set of local switches, reutrn the value + if (isPresent) + { + return isEnabled; + } + + // if we could not find the switch name, we should return 'false' + // This will preserve the concept of switches been 'off' unless explicitly set to 'on' + return false; + } + + private static bool SetupDelegate() + { + Type appContextType = typeof(object).Assembly.GetType("System.AppContext"); + if (appContextType == null) + return false; + + MethodInfo method = appContextType.GetMethod( + "TryGetSwitch", // the method name + BindingFlags.Static | BindingFlags.Public, // binding flags + null, // use the default binder + new Type[] { typeof(string), typeof(bool).MakeByRefType() }, + null); // parameterModifiers - this is ignored by the default binder + if (method == null) + return false; + + // Create delegate if we found the method. + TryGetSwitchFromCentralAppContext = (TryGetSwitchDelegate)Delegate.CreateDelegate(typeof(TryGetSwitchDelegate), method); + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static bool GetCachedSwitchValue(string switchName, ref int switchValue) + { + if (switchValue < 0) return false; + if (switchValue > 0) return true; + + return GetCachedSwitchValueInternal(switchName, ref switchValue); + } + + private static bool GetCachedSwitchValueInternal(string switchName, ref int switchValue) + { + if (LocalAppContext.DisableCaching) + { + return LocalAppContext.IsSwitchEnabled(switchName); + } + + bool isEnabled = LocalAppContext.IsSwitchEnabled(switchName); + switchValue = isEnabled ? 1 /*true*/ : -1 /*false*/; + return isEnabled; + } + + /// + /// This method is going to be called from the AppContextDefaultValues class when setting up the + /// default values for the switches. !!!! This method is called during the static constructor so it does not + /// take a lock !!!! If you are planning to use this outside of that, please ensure proper locking. + /// + internal static void DefineSwitchDefault(string switchName, bool initialValue) + { + s_switchMap[switchName] = initialValue; + } + } +} diff --git a/external/referencesource/System.IdentityModel/System/AppContextDefaultValues.cs b/external/referencesource/System.IdentityModel/System/AppContextDefaultValues.cs new file mode 100644 index 0000000000..e879cb1e24 --- /dev/null +++ b/external/referencesource/System.IdentityModel/System/AppContextDefaultValues.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace System +{ + using System.IdentityModel; + + internal static partial class AppContextDefaultValues + { + static partial void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version) + { + // When defining a new switch you should add it to the last known version. + // For instance, if you are adding a switch in .NET 4.6 (the release after 4.5.2) you should define your switch + // like this: + // if (version <= 40502) ... + // This ensures that all previous versions of that platform (up-to 4.5.2) will get the old behavior by default + // NOTE: When adding a default value for a switch please make sure that the default value is added to ALL of the existing platforms! + // NOTE: When adding a new if statement for the version please ensure that ALL previous switches are enabled (ie. don't use else if) + switch (platformIdentifier) + { + case ".NETCore": + case ".NETFramework": + { + if (version <= 40502) + { + LocalAppContextSwitches.SetDefaultsLessOrEqual_452(); + } + + if (version <= 40600) + { + LocalAppContextSwitches.SetDefaultsLessOrEqual_46(); + } + + break; + } + } + } + } +} diff --git a/external/referencesource/System.IdentityModel/System/IdentityModel/Claims/X509CertificateClaimSet.cs b/external/referencesource/System.IdentityModel/System/IdentityModel/Claims/X509CertificateClaimSet.cs index 69d2304a9d..4113bd328c 100644 --- a/external/referencesource/System.IdentityModel/System/IdentityModel/Claims/X509CertificateClaimSet.cs +++ b/external/referencesource/System.IdentityModel/System/IdentityModel/Claims/X509CertificateClaimSet.cs @@ -172,9 +172,24 @@ namespace System.IdentityModel.Claims if (!string.IsNullOrEmpty(value)) claims.Add(Claim.CreateX500DistinguishedNameClaim(this.certificate.SubjectName)); - value = this.certificate.GetNameInfo(X509NameType.DnsName, false); - if (!string.IsNullOrEmpty(value)) - claims.Add(Claim.CreateDnsClaim(value)); + // App context switch for disabling support for multiple dns entries in a SAN certificate + if (LocalAppContextSwitches.DisableMultipleDNSEntriesInSANCertificate) + { + // old behavior, default for <= 4.6 + value = this.certificate.GetNameInfo(X509NameType.DnsName, false); + if (!string.IsNullOrEmpty(value)) + claims.Add(Claim.CreateDnsClaim(value)); + } + else + { + // new behavior as this is the default long term behavior + // Since a SAN can have multiple DNS entries + string[] entries = GetDnsFromExtensions(this.certificate); + for (int i = 0; i < entries.Length; ++i) + { + claims.Add(Claim.CreateDnsClaim(entries[i])); + } + } value = this.certificate.GetNameInfo(X509NameType.SimpleName, false); if (!string.IsNullOrEmpty(value)) @@ -243,10 +258,24 @@ namespace System.IdentityModel.Claims { if (right == null || Rights.PossessProperty.Equals(right)) { - string value = this.certificate.GetNameInfo(X509NameType.DnsName, false); - if (!string.IsNullOrEmpty(value)) + // App context switch for disabling support for multiple dns entries in a SAN certificate + if (LocalAppContextSwitches.DisableMultipleDNSEntriesInSANCertificate) { - yield return Claim.CreateDnsClaim(value); + // old behavior, default for <= 4.6 + string value = this.certificate.GetNameInfo(X509NameType.DnsName, false); + if (!string.IsNullOrEmpty(value)) + { + yield return Claim.CreateDnsClaim(value); + } + } + else + { + // new behavior since this is the default long term behavior + string[] entries = GetDnsFromExtensions(certificate); + for (int i = 0; i < entries.Length; ++i) + { + yield return Claim.CreateDnsClaim(entries[i]); + } } } } @@ -270,6 +299,33 @@ namespace System.IdentityModel.Claims } } + // Fixing Bug 795660: SAN having multiple DNS entries + private static string[] GetDnsFromExtensions(X509Certificate2 cert) + { + foreach (X509Extension ext in cert.Extensions) + { + // Extension is SAN or SAN2 + if (ext.Oid.Value == "2.5.29.7" || ext.Oid.Value == "2.5.29.17") + { + string asnString = ext.Format(true); + if (string.IsNullOrEmpty(asnString)) + { + return new string[0]; + } + + string[] rawDnsEntries = asnString.Split(new string[1] { "\n" }, StringSplitOptions.RemoveEmptyEntries); + string[] dnsEntries = new string[rawDnsEntries.Length]; + for (int i = 0; i < rawDnsEntries.Length; ++i) + { + int equalSignIndex = rawDnsEntries[i].IndexOf('='); + dnsEntries[i] = rawDnsEntries[i].Substring(equalSignIndex + 1).Trim(); + } + return dnsEntries; + } + } + return new string[0]; + } + public override IEnumerator GetEnumerator() { ThrowIfDisposed(); @@ -347,7 +403,7 @@ namespace System.IdentityModel.Claims { ThrowIfDisposed(); if (this.name == null) - { + { // // DCR 48092: PrincipalPermission authorization using certificates could cause Elevation of Privilege. // because there could be duplicate subject name. In order to be more unique, we use SubjectName + Thumbprint diff --git a/external/referencesource/System.IdentityModel/System/IdentityModel/IdentityModelStrings.cs b/external/referencesource/System.IdentityModel/System/IdentityModel/IdentityModelStrings.cs index 1f1fbd6678..42cd0993c2 100644 --- a/external/referencesource/System.IdentityModel/System/IdentityModel/IdentityModelStrings.cs +++ b/external/referencesource/System.IdentityModel/System/IdentityModel/IdentityModelStrings.cs @@ -9,4 +9,4 @@ namespace System.IdentityModel public abstract int Count { get; } public abstract string this[int index] { get; } } -} +} \ No newline at end of file diff --git a/external/referencesource/System.IdentityModel/System/IdentityModel/LocalAppContextSwitches.cs b/external/referencesource/System.IdentityModel/System/IdentityModel/LocalAppContextSwitches.cs new file mode 100644 index 0000000000..f18ab5dd58 --- /dev/null +++ b/external/referencesource/System.IdentityModel/System/IdentityModel/LocalAppContextSwitches.cs @@ -0,0 +1,52 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.IdentityModel +{ + using System; + using System.Runtime.CompilerServices; + + // When adding a quirk, name it such that false is new behavior and true is old behavior. + // You are opting IN to old behavior. The new behavior is default. + // For example, we want to enable the functionality to explicitly add a connection close header + // in 4.6 and above. So we set DisableExplicitConnectionCloseHeader to true if running 4.5.2 or less. + internal static class LocalAppContextSwitches + { + private const string EnableCachedEmptyDefaultAuthorizationContextString = "Switch.System.IdentityModel.EnableCachedEmptyDefaultAuthorizationContext"; + private const string DisableMultipleDNSEntriesInSANCertificateString = "Switch.System.IdentityModel.DisableMultipleDNSEntriesInSANCertificate"; + + private static int enableCachedEmptyDefaultAuthorizationContext; + private static int disableMultipleDNSEntriesInSANCertificate; + + public static bool EnableCachedEmptyDefaultAuthorizationContext + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return LocalAppContext.GetCachedSwitchValue(EnableCachedEmptyDefaultAuthorizationContextString, ref enableCachedEmptyDefaultAuthorizationContext); + } + } + + public static bool DisableMultipleDNSEntriesInSANCertificate + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return LocalAppContext.GetCachedSwitchValue(DisableMultipleDNSEntriesInSANCertificateString, ref disableMultipleDNSEntriesInSANCertificate); + } + } + + public static void SetDefaultsLessOrEqual_452() + { + // Define the switches that should be true for 4.5.2 or less, false for 4.6+. + LocalAppContext.DefineSwitchDefault(EnableCachedEmptyDefaultAuthorizationContextString, true); + } + + public static void SetDefaultsLessOrEqual_46() + { + // Define the switches that should be true for 4.6 or less, false for 4.6.1+. + LocalAppContext.DefineSwitchDefault(DisableMultipleDNSEntriesInSANCertificateString, true); + } + } +} diff --git a/external/referencesource/System.IdentityModel/System/IdentityModel/Policy/DefaultAuthorizationContext.cs b/external/referencesource/System.IdentityModel/System/IdentityModel/Policy/DefaultAuthorizationContext.cs index 119f2cee42..1226ad3469 100644 --- a/external/referencesource/System.IdentityModel/System/IdentityModel/Policy/DefaultAuthorizationContext.cs +++ b/external/referencesource/System.IdentityModel/System/IdentityModel/Policy/DefaultAuthorizationContext.cs @@ -27,19 +27,26 @@ namespace System.IdentityModel.Policy { get { - if (empty == null) - empty = new DefaultAuthorizationContext(new DefaultEvaluationContext()); - return empty; + if (LocalAppContextSwitches.EnableCachedEmptyDefaultAuthorizationContext) + { + if (empty == null) + empty = new DefaultAuthorizationContext(new DefaultEvaluationContext()); + return empty; + } + else + { + return new DefaultAuthorizationContext(new DefaultEvaluationContext()); + } } } public override string Id { - get + get { if (this.id == null) this.id = SecurityUniqueId.Create(); - return this.id.Value; + return this.id.Value; } } diff --git a/external/referencesource/System.IdentityModel/System/IdentityModel/SignedXml.cs b/external/referencesource/System.IdentityModel/System/IdentityModel/SignedXml.cs index e6e3578126..1836928288 100644 --- a/external/referencesource/System.IdentityModel/System/IdentityModel/SignedXml.cs +++ b/external/referencesource/System.IdentityModel/System/IdentityModel/SignedXml.cs @@ -155,6 +155,11 @@ namespace System.IdentityModel this.Signature.SignedInfo.EnsureDigestValidity(id, resolvedXmlSource); } + public bool EnsureDigestValidityIfIdMatches(string id, object resolvedXmlSource) + { + return this.Signature.SignedInfo.EnsureDigestValidityIfIdMatches(id, resolvedXmlSource); + } + public byte[] GetSignatureValue() { return this.Signature.GetSignatureBytes(); @@ -1226,7 +1231,7 @@ namespace System.IdentityModel { this.transformChain.ReadFrom(reader, transformFactory, dictionaryManager, ShouldPreserveComments(this.Uri)); } - + this.digestMethodElement.ReadFrom(reader, dictionaryManager); this.digestValueElement.ReadFrom(reader, dictionaryManager); diff --git a/external/referencesource/System.Net/net/PeerToPeer/Collaboration/CollaborationEnumTypes.cs b/external/referencesource/System.Net/net/PeerToPeer/Collaboration/CollaborationEnumTypes.cs index 12a3944042..5ddcc547da 100644 --- a/external/referencesource/System.Net/net/PeerToPeer/Collaboration/CollaborationEnumTypes.cs +++ b/external/referencesource/System.Net/net/PeerToPeer/Collaboration/CollaborationEnumTypes.cs @@ -70,4 +70,4 @@ namespace System.Net.PeerToPeer.Collaboration PeopleNearMeChanged = 10, RequestStatusChanged = 11 } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Numerics/BaselineExcludes.lst.cs b/external/referencesource/System.Numerics/BaselineExcludes.lst.cs index 463e5b5ed7..45ca30fde5 100644 --- a/external/referencesource/System.Numerics/BaselineExcludes.lst.cs +++ b/external/referencesource/System.Numerics/BaselineExcludes.lst.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; -[module: SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", Scope="namespace", Target="System.Numerics", Justification="[....] - by design")] -[module: SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", Scope="assembly", Target="System.Numerics", Justification="[....] - by design")] +[module: SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", Scope="namespace", Target="System.Numerics", Justification="jfree - by design")] +[module: SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly", Scope="assembly", Target="System.Numerics", Justification="jfree - by design")] [module: SuppressMessage("Microsoft.Performance","CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "System.SR.GetObject(System.String):System.Object")] [module: SuppressMessage("Microsoft.Performance","CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "System.Numerics.BigInteger.ObjectInvariant():System.Void")] diff --git a/external/referencesource/System.Numerics/System/Numerics/Complex.cs b/external/referencesource/System.Numerics/System/Numerics/Complex.cs index c1c4e1acbd..42c854dcbf 100644 --- a/external/referencesource/System.Numerics/System/Numerics/Complex.cs +++ b/external/referencesource/System.Numerics/System/Numerics/Complex.cs @@ -300,6 +300,10 @@ namespace System.Numerics { } public static Complex Asin(Complex value) /* Arcsin */ { + if ((value.m_imaginary == 0 && value.m_real < 0) || value.m_imaginary > 0) + { + return -Asin(-value); + } return (-ImaginaryOne) * Log(ImaginaryOne * value + Sqrt(One - value * value)); } @@ -318,6 +322,10 @@ namespace System.Numerics { } public static Complex Acos(Complex value) /* Arccos */ { + if ((value.m_imaginary == 0 && value.m_real > 0) || value.m_imaginary < 0) + { + return System.Math.PI - Acos(-value); + } return (-ImaginaryOne) * Log(value + ImaginaryOne*Sqrt(One - (value * value))); } diff --git a/external/referencesource/System.Numerics/System/Numerics/HashCodeHelper.cs b/external/referencesource/System.Numerics/System/Numerics/HashCodeHelper.cs new file mode 100644 index 0000000000..5eeeeca7dc --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/HashCodeHelper.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace System.Numerics +{ + internal static class HashCodeHelper + { + /// + /// Combines two hash codes, useful for combining hash codes of individual vector elements + /// + internal static int CombineHashCodes(int h1, int h2) + { + return (((h1 << 5) + h1) ^ h2); + } + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/JITIntrinsicAttribute.cs b/external/referencesource/System.Numerics/System/Numerics/JITIntrinsicAttribute.cs new file mode 100644 index 0000000000..251789871a --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/JITIntrinsicAttribute.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace System.Numerics +{ + /// + /// An attribute that can be attached to JIT Intrinsic methods/properties + /// + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property)] + internal class JitIntrinsicAttribute : Attribute + { + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/Matrix3x2.cs b/external/referencesource/System.Numerics/System/Numerics/Matrix3x2.cs new file mode 100644 index 0000000000..7ee9b44602 --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/Matrix3x2.cs @@ -0,0 +1,809 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Globalization; + +namespace System.Numerics +{ + /// + /// A structure encapsulating a 3x2 matrix. + /// + public struct Matrix3x2 : IEquatable + { + #region Public Fields + /// + /// The first element of the first row + /// + public float M11; + /// + /// The second element of the first row + /// + public float M12; + /// + /// The first element of the second row + /// + public float M21; + /// + /// The second element of the second row + /// + public float M22; + /// + /// The first element of the third row + /// + public float M31; + /// + /// The second element of the third row + /// + public float M32; + #endregion Public Fields + + private static readonly Matrix3x2 _identity = new Matrix3x2 + ( + 1f, 0f, + 0f, 1f, + 0f, 0f + ); + + /// + /// Returns the multiplicative identity matrix. + /// + public static Matrix3x2 Identity + { + get { return _identity; } + } + + /// + /// Returns whether the matrix is the identity matrix. + /// + public bool IsIdentity + { + get + { + return M11 == 1f && M22 == 1f && // Check diagonal element first for early out. + M12 == 0f && + M21 == 0f && + M31 == 0f && M32 == 0f; + } + } + + /// + /// Gets or sets the translation component of this matrix. + /// + public Vector2 Translation + { + get + { + return new Vector2(M31, M32); + } + + set + { + M31 = value.X; + M32 = value.Y; + } + } + + /// + /// Constructs a Matrix3x2 from the given components. + /// + public Matrix3x2(float m11, float m12, + float m21, float m22, + float m31, float m32) + { + this.M11 = m11; + this.M12 = m12; + this.M21 = m21; + this.M22 = m22; + this.M31 = m31; + this.M32 = m32; + } + + /// + /// Creates a translation matrix from the given vector. + /// + /// The translation position. + /// A translation matrix. + public static Matrix3x2 CreateTranslation(Vector2 position) + { + Matrix3x2 result; + + result.M11 = 1.0f; + result.M12 = 0.0f; + result.M21 = 0.0f; + result.M22 = 1.0f; + + result.M31 = position.X; + result.M32 = position.Y; + + return result; + } + + /// + /// Creates a translation matrix from the given X and Y components. + /// + /// The X position. + /// The Y position. + /// A translation matrix. + public static Matrix3x2 CreateTranslation(float xPosition, float yPosition) + { + Matrix3x2 result; + + result.M11 = 1.0f; + result.M12 = 0.0f; + result.M21 = 0.0f; + result.M22 = 1.0f; + + result.M31 = xPosition; + result.M32 = yPosition; + + return result; + } + + /// + /// Creates a scale matrix from the given X and Y components. + /// + /// Value to scale by on the X-axis. + /// Value to scale by on the Y-axis. + /// A scaling matrix. + public static Matrix3x2 CreateScale(float xScale, float yScale) + { + Matrix3x2 result; + + result.M11 = xScale; + result.M12 = 0.0f; + result.M21 = 0.0f; + result.M22 = yScale; + result.M31 = 0.0f; + result.M32 = 0.0f; + + return result; + } + + /// + /// Creates a scale matrix that is offset by a given center point. + /// + /// Value to scale by on the X-axis. + /// Value to scale by on the Y-axis. + /// The center point. + /// A scaling matrix. + public static Matrix3x2 CreateScale(float xScale, float yScale, Vector2 centerPoint) + { + Matrix3x2 result; + + float tx = centerPoint.X * (1 - xScale); + float ty = centerPoint.Y * (1 - yScale); + + result.M11 = xScale; + result.M12 = 0.0f; + result.M21 = 0.0f; + result.M22 = yScale; + result.M31 = tx; + result.M32 = ty; + + return result; + } + + /// + /// Creates a scale matrix from the given vector scale. + /// + /// The scale to use. + /// A scaling matrix. + public static Matrix3x2 CreateScale(Vector2 scales) + { + Matrix3x2 result; + + result.M11 = scales.X; + result.M12 = 0.0f; + result.M21 = 0.0f; + result.M22 = scales.Y; + result.M31 = 0.0f; + result.M32 = 0.0f; + + return result; + } + + /// + /// Creates a scale matrix from the given vector scale with an offset from the given center point. + /// + /// The scale to use. + /// The center offset. + /// A scaling matrix. + public static Matrix3x2 CreateScale(Vector2 scales, Vector2 centerPoint) + { + Matrix3x2 result; + + float tx = centerPoint.X * (1 - scales.X); + float ty = centerPoint.Y * (1 - scales.Y); + + result.M11 = scales.X; + result.M12 = 0.0f; + result.M21 = 0.0f; + result.M22 = scales.Y; + result.M31 = tx; + result.M32 = ty; + + return result; + } + + /// + /// Creates a scale matrix that scales uniformly with the given scale. + /// + /// The uniform scale to use. + /// A scaling matrix. + public static Matrix3x2 CreateScale(float scale) + { + Matrix3x2 result; + + result.M11 = scale; + result.M12 = 0.0f; + result.M21 = 0.0f; + result.M22 = scale; + result.M31 = 0.0f; + result.M32 = 0.0f; + + return result; + } + + /// + /// Creates a scale matrix that scales uniformly with the given scale with an offset from the given center. + /// + /// The uniform scale to use. + /// The center offset. + /// A scaling matrix. + public static Matrix3x2 CreateScale(float scale, Vector2 centerPoint) + { + Matrix3x2 result; + + float tx = centerPoint.X * (1 - scale); + float ty = centerPoint.Y * (1 - scale); + + result.M11 = scale; + result.M12 = 0.0f; + result.M21 = 0.0f; + result.M22 = scale; + result.M31 = tx; + result.M32 = ty; + + return result; + } + + /// + /// Creates a skew matrix from the given angles in radians. + /// + /// The X angle, in radians. + /// The Y angle, in radians. + /// A skew matrix. + public static Matrix3x2 CreateSkew(float radiansX, float radiansY) + { + Matrix3x2 result; + + float xTan = (float)Math.Tan(radiansX); + float yTan = (float)Math.Tan(radiansY); + + result.M11 = 1.0f; + result.M12 = yTan; + result.M21 = xTan; + result.M22 = 1.0f; + result.M31 = 0.0f; + result.M32 = 0.0f; + + return result; + } + + /// + /// Creates a skew matrix from the given angles in radians and a center point. + /// + /// The X angle, in radians. + /// The Y angle, in radians. + /// The center point. + /// A skew matrix. + public static Matrix3x2 CreateSkew(float radiansX, float radiansY, Vector2 centerPoint) + { + Matrix3x2 result; + + float xTan = (float)Math.Tan(radiansX); + float yTan = (float)Math.Tan(radiansY); + + float tx = -centerPoint.Y * xTan; + float ty = -centerPoint.X * yTan; + + result.M11 = 1.0f; + result.M12 = yTan; + result.M21 = xTan; + result.M22 = 1.0f; + result.M31 = tx; + result.M32 = ty; + + return result; + } + + /// + /// Creates a rotation matrix using the given rotation in radians. + /// + /// The amount of rotation, in radians. + /// A rotation matrix. + public static Matrix3x2 CreateRotation(float radians) + { + Matrix3x2 result; + + radians = (float)Math.IEEERemainder(radians, Math.PI * 2); + + float c, s; + + const float epsilon = 0.001f * (float)Math.PI / 180f; // 0.1% of a degree + + if (radians > -epsilon && radians < epsilon) + { + // Exact case for zero rotation. + c = 1; + s = 0; + } + else if (radians > Math.PI / 2 - epsilon && radians < Math.PI / 2 + epsilon) + { + // Exact case for 90 degree rotation. + c = 0; + s = 1; + } + else if (radians < -Math.PI + epsilon || radians > Math.PI - epsilon) + { + // Exact case for 180 degree rotation. + c = -1; + s = 0; + } + else if (radians > -Math.PI / 2 - epsilon && radians < -Math.PI / 2 + epsilon) + { + // Exact case for 270 degree rotation. + c = 0; + s = -1; + } + else + { + // Arbitrary rotation. + c = (float)Math.Cos(radians); + s = (float)Math.Sin(radians); + } + + // [ c s ] + // [ -s c ] + // [ 0 0 ] + result.M11 = c; + result.M12 = s; + result.M21 = -s; + result.M22 = c; + result.M31 = 0.0f; + result.M32 = 0.0f; + + return result; + } + + /// + /// Creates a rotation matrix using the given rotation in radians and a center point. + /// + /// The amount of rotation, in radians. + /// The center point. + /// A rotation matrix. + public static Matrix3x2 CreateRotation(float radians, Vector2 centerPoint) + { + Matrix3x2 result; + + radians = (float)Math.IEEERemainder(radians, Math.PI * 2); + + float c, s; + + const float epsilon = 0.001f * (float)Math.PI / 180f; // 0.1% of a degree + + if (radians > -epsilon && radians < epsilon) + { + // Exact case for zero rotation. + c = 1; + s = 0; + } + else if (radians > Math.PI / 2 - epsilon && radians < Math.PI / 2 + epsilon) + { + // Exact case for 90 degree rotation. + c = 0; + s = 1; + } + else if (radians < -Math.PI + epsilon || radians > Math.PI - epsilon) + { + // Exact case for 180 degree rotation. + c = -1; + s = 0; + } + else if (radians > -Math.PI / 2 - epsilon && radians < -Math.PI / 2 + epsilon) + { + // Exact case for 270 degree rotation. + c = 0; + s = -1; + } + else + { + // Arbitrary rotation. + c = (float)Math.Cos(radians); + s = (float)Math.Sin(radians); + } + + float x = centerPoint.X * (1 - c) + centerPoint.Y * s; + float y = centerPoint.Y * (1 - c) - centerPoint.X * s; + + // [ c s ] + // [ -s c ] + // [ x y ] + result.M11 = c; + result.M12 = s; + result.M21 = -s; + result.M22 = c; + result.M31 = x; + result.M32 = y; + + return result; + } + + /// + /// Calculates the determinant for this matrix. + /// The determinant is calculated by expanding the matrix with a third column whose values are (0,0,1). + /// + /// The determinant. + public float GetDeterminant() + { + // There isn't actually any such thing as a determinant for a non-square matrix, + // but this 3x2 type is really just an optimization of a 3x3 where we happen to + // know the rightmost column is always (0, 0, 1). So we expand to 3x3 format: + // + // [ M11, M12, 0 ] + // [ M21, M22, 0 ] + // [ M31, M32, 1 ] + // + // Sum the diagonal products: + // (M11 * M22 * 1) + (M12 * 0 * M31) + (0 * M21 * M32) + // + // Subtract the opposite diagonal products: + // (M31 * M22 * 0) + (M32 * 0 * M11) + (1 * M21 * M12) + // + // Collapse out the constants and oh look, this is just a 2x2 determinant! + + return (M11 * M22) - (M21 * M12); + } + + /// + /// Attempts to invert the given matrix. If the operation succeeds, the inverted matrix is stored in the result parameter. + /// + /// The source matrix. + /// The output matrix. + /// True if the operation succeeded, False otherwise. + public static bool Invert(Matrix3x2 matrix, out Matrix3x2 result) + { + float det = (matrix.M11 * matrix.M22) - (matrix.M21 * matrix.M12); + + if (Math.Abs(det) < float.Epsilon) + { + result = new Matrix3x2(float.NaN, float.NaN, float.NaN, float.NaN, float.NaN, float.NaN); + return false; + } + + float invDet = 1.0f / det; + + result.M11 = matrix.M22 * invDet; + result.M12 = -matrix.M12 * invDet; + result.M21 = -matrix.M21 * invDet; + result.M22 = matrix.M11 * invDet; + result.M31 = (matrix.M21 * matrix.M32 - matrix.M31 * matrix.M22) * invDet; + result.M32 = (matrix.M31 * matrix.M12 - matrix.M11 * matrix.M32) * invDet; + + return true; + } + + /// + /// Linearly interpolates from matrix1 to matrix2, based on the third parameter. + /// + /// The first source matrix. + /// The second source matrix. + /// The relative weighting of matrix2. + /// The interpolated matrix. + public static Matrix3x2 Lerp(Matrix3x2 matrix1, Matrix3x2 matrix2, float amount) + { + Matrix3x2 result; + + // First row + result.M11 = matrix1.M11 + (matrix2.M11 - matrix1.M11) * amount; + result.M12 = matrix1.M12 + (matrix2.M12 - matrix1.M12) * amount; + + // Second row + result.M21 = matrix1.M21 + (matrix2.M21 - matrix1.M21) * amount; + result.M22 = matrix1.M22 + (matrix2.M22 - matrix1.M22) * amount; + + // Third row + result.M31 = matrix1.M31 + (matrix2.M31 - matrix1.M31) * amount; + result.M32 = matrix1.M32 + (matrix2.M32 - matrix1.M32) * amount; + + return result; + } + + /// + /// Negates the given matrix by multiplying all values by -1. + /// + /// The source matrix. + /// The negated matrix. + public static Matrix3x2 Negate(Matrix3x2 value) + { + Matrix3x2 result; + + result.M11 = -value.M11; + result.M12 = -value.M12; + result.M21 = -value.M21; + result.M22 = -value.M22; + result.M31 = -value.M31; + result.M32 = -value.M32; + + return result; + } + + /// + /// Adds each matrix element in value1 with its corresponding element in value2. + /// + /// The first source matrix. + /// The second source matrix. + /// The matrix containing the summed values. + public static Matrix3x2 Add(Matrix3x2 value1, Matrix3x2 value2) + { + Matrix3x2 result; + + result.M11 = value1.M11 + value2.M11; + result.M12 = value1.M12 + value2.M12; + result.M21 = value1.M21 + value2.M21; + result.M22 = value1.M22 + value2.M22; + result.M31 = value1.M31 + value2.M31; + result.M32 = value1.M32 + value2.M32; + + return result; + } + + /// + /// Subtracts each matrix element in value2 from its corresponding element in value1. + /// + /// The first source matrix. + /// The second source matrix. + /// The matrix containing the resulting values. + public static Matrix3x2 Subtract(Matrix3x2 value1, Matrix3x2 value2) + { + Matrix3x2 result; + + result.M11 = value1.M11 - value2.M11; + result.M12 = value1.M12 - value2.M12; + result.M21 = value1.M21 - value2.M21; + result.M22 = value1.M22 - value2.M22; + result.M31 = value1.M31 - value2.M31; + result.M32 = value1.M32 - value2.M32; + + return result; + } + + /// + /// Multiplies two matrices together and returns the resulting matrix. + /// + /// The first source matrix. + /// The second source matrix. + /// The product matrix. + public static Matrix3x2 Multiply(Matrix3x2 value1, Matrix3x2 value2) + { + Matrix3x2 result; + + // First row + result.M11 = value1.M11 * value2.M11 + value1.M12 * value2.M21; + result.M12 = value1.M11 * value2.M12 + value1.M12 * value2.M22; + + // Second row + result.M21 = value1.M21 * value2.M11 + value1.M22 * value2.M21; + result.M22 = value1.M21 * value2.M12 + value1.M22 * value2.M22; + + // Third row + result.M31 = value1.M31 * value2.M11 + value1.M32 * value2.M21 + value2.M31; + result.M32 = value1.M31 * value2.M12 + value1.M32 * value2.M22 + value2.M32; + + return result; + } + + /// + /// Scales all elements in a matrix by the given scalar factor. + /// + /// The source matrix. + /// The scaling value to use. + /// The resulting matrix. + public static Matrix3x2 Multiply(Matrix3x2 value1, float value2) + { + Matrix3x2 result; + + result.M11 = value1.M11 * value2; + result.M12 = value1.M12 * value2; + result.M21 = value1.M21 * value2; + result.M22 = value1.M22 * value2; + result.M31 = value1.M31 * value2; + result.M32 = value1.M32 * value2; + + return result; + } + + /// + /// Negates the given matrix by multiplying all values by -1. + /// + /// The source matrix. + /// The negated matrix. + public static Matrix3x2 operator -(Matrix3x2 value) + { + Matrix3x2 m; + + m.M11 = -value.M11; + m.M12 = -value.M12; + m.M21 = -value.M21; + m.M22 = -value.M22; + m.M31 = -value.M31; + m.M32 = -value.M32; + + return m; + } + + /// + /// Adds each matrix element in value1 with its corresponding element in value2. + /// + /// The first source matrix. + /// The second source matrix. + /// The matrix containing the summed values. + public static Matrix3x2 operator +(Matrix3x2 value1, Matrix3x2 value2) + { + Matrix3x2 m; + + m.M11 = value1.M11 + value2.M11; + m.M12 = value1.M12 + value2.M12; + m.M21 = value1.M21 + value2.M21; + m.M22 = value1.M22 + value2.M22; + m.M31 = value1.M31 + value2.M31; + m.M32 = value1.M32 + value2.M32; + + return m; + } + + /// + /// Subtracts each matrix element in value2 from its corresponding element in value1. + /// + /// The first source matrix. + /// The second source matrix. + /// The matrix containing the resulting values. + public static Matrix3x2 operator -(Matrix3x2 value1, Matrix3x2 value2) + { + Matrix3x2 m; + + m.M11 = value1.M11 - value2.M11; + m.M12 = value1.M12 - value2.M12; + m.M21 = value1.M21 - value2.M21; + m.M22 = value1.M22 - value2.M22; + m.M31 = value1.M31 - value2.M31; + m.M32 = value1.M32 - value2.M32; + + return m; + } + + /// + /// Multiplies two matrices together and returns the resulting matrix. + /// + /// The first source matrix. + /// The second source matrix. + /// The product matrix. + public static Matrix3x2 operator *(Matrix3x2 value1, Matrix3x2 value2) + { + Matrix3x2 m; + + // First row + m.M11 = value1.M11 * value2.M11 + value1.M12 * value2.M21; + m.M12 = value1.M11 * value2.M12 + value1.M12 * value2.M22; + + // Second row + m.M21 = value1.M21 * value2.M11 + value1.M22 * value2.M21; + m.M22 = value1.M21 * value2.M12 + value1.M22 * value2.M22; + + // Third row + m.M31 = value1.M31 * value2.M11 + value1.M32 * value2.M21 + value2.M31; + m.M32 = value1.M31 * value2.M12 + value1.M32 * value2.M22 + value2.M32; + + return m; + } + + /// + /// Scales all elements in a matrix by the given scalar factor. + /// + /// The source matrix. + /// The scaling value to use. + /// The resulting matrix. + public static Matrix3x2 operator *(Matrix3x2 value1, float value2) + { + Matrix3x2 m; + + m.M11 = value1.M11 * value2; + m.M12 = value1.M12 * value2; + m.M21 = value1.M21 * value2; + m.M22 = value1.M22 * value2; + m.M31 = value1.M31 * value2; + m.M32 = value1.M32 * value2; + + return m; + } + + /// + /// Returns a boolean indicating whether the given matrices are equal. + /// + /// The first source matrix. + /// The second source matrix. + /// True if the matrices are equal; False otherwise. + public static bool operator ==(Matrix3x2 value1, Matrix3x2 value2) + { + return (value1.M11 == value2.M11 && value1.M22 == value2.M22 && // Check diagonal element first for early out. + value1.M12 == value2.M12 && + value1.M21 == value2.M21 && + value1.M31 == value2.M31 && value1.M32 == value2.M32); + } + + /// + /// Returns a boolean indicating whether the given matrices are not equal. + /// + /// The first source matrix. + /// The second source matrix. + /// True if the matrices are not equal; False if they are equal. + public static bool operator !=(Matrix3x2 value1, Matrix3x2 value2) + { + return (value1.M11 != value2.M11 || value1.M12 != value2.M12 || + value1.M21 != value2.M21 || value1.M22 != value2.M22 || + value1.M31 != value2.M31 || value1.M32 != value2.M32); + } + + /// + /// Returns a boolean indicating whether the matrix is equal to the other given matrix. + /// + /// The other matrix to test equality against. + /// True if this matrix is equal to other; False otherwise. + public bool Equals(Matrix3x2 other) + { + return (M11 == other.M11 && M22 == other.M22 && // Check diagonal element first for early out. + M12 == other.M12 && + M21 == other.M21 && + M31 == other.M31 && M32 == other.M32); + } + + /// + /// Returns a boolean indicating whether the given Object is equal to this matrix instance. + /// + /// The Object to compare against. + /// True if the Object is equal to this matrix; False otherwise. + public override bool Equals(object obj) + { + if (obj is Matrix3x2) + { + return Equals((Matrix3x2)obj); + } + + return false; + } + + /// + /// Returns a String representing this matrix instance. + /// + /// The string representation. + public override string ToString() + { + CultureInfo ci = CultureInfo.CurrentCulture; + return String.Format(ci, "{{ {{M11:{0} M12:{1}}} {{M21:{2} M22:{3}}} {{M31:{4} M32:{5}}} }}", + M11.ToString(ci), M12.ToString(ci), + M21.ToString(ci), M22.ToString(ci), + M31.ToString(ci), M32.ToString(ci)); + } + + /// + /// Returns the hash code for this instance. + /// + /// The hash code. + public override int GetHashCode() + { + return M11.GetHashCode() + M12.GetHashCode() + + M21.GetHashCode() + M22.GetHashCode() + + M31.GetHashCode() + M32.GetHashCode(); + } + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/Matrix4x4.cs b/external/referencesource/System.Numerics/System/Numerics/Matrix4x4.cs new file mode 100644 index 0000000000..473b053b98 --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/Matrix4x4.cs @@ -0,0 +1,2212 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Globalization; + +namespace System.Numerics +{ + /// + /// A structure encapsulating a 4x4 matrix. + /// + public struct Matrix4x4 : IEquatable + { + #region Public Fields + /// + /// Value at row 1, column 1 of the matrix. + /// + public float M11; + /// + /// Value at row 1, column 2 of the matrix. + /// + public float M12; + /// + /// Value at row 1, column 3 of the matrix. + /// + public float M13; + /// + /// Value at row 1, column 4 of the matrix. + /// + public float M14; + + /// + /// Value at row 2, column 1 of the matrix. + /// + public float M21; + /// + /// Value at row 2, column 2 of the matrix. + /// + public float M22; + /// + /// Value at row 2, column 3 of the matrix. + /// + public float M23; + /// + /// Value at row 2, column 4 of the matrix. + /// + public float M24; + + /// + /// Value at row 3, column 1 of the matrix. + /// + public float M31; + /// + /// Value at row 3, column 2 of the matrix. + /// + public float M32; + /// + /// Value at row 3, column 3 of the matrix. + /// + public float M33; + /// + /// Value at row 3, column 4 of the matrix. + /// + public float M34; + + /// + /// Value at row 4, column 1 of the matrix. + /// + public float M41; + /// + /// Value at row 4, column 2 of the matrix. + /// + public float M42; + /// + /// Value at row 4, column 3 of the matrix. + /// + public float M43; + /// + /// Value at row 4, column 4 of the matrix. + /// + public float M44; + #endregion Public Fields + + private static readonly Matrix4x4 _identity = new Matrix4x4 + ( + 1f, 0f, 0f, 0f, + 0f, 1f, 0f, 0f, + 0f, 0f, 1f, 0f, + 0f, 0f, 0f, 1f + ); + + /// + /// Returns the multiplicative identity matrix. + /// + public static Matrix4x4 Identity + { + get { return _identity; } + } + + /// + /// Returns whether the matrix is the identity matrix. + /// + public bool IsIdentity + { + get + { + return M11 == 1f && M22 == 1f && M33 == 1f && M44 == 1f && // Check diagonal element first for early out. + M12 == 0f && M13 == 0f && M14 == 0f && + M21 == 0f && M23 == 0f && M24 == 0f && + M31 == 0f && M32 == 0f && M34 == 0f && + M41 == 0f && M42 == 0f && M43 == 0f; + } + } + + /// + /// Gets or sets the translation component of this matrix. + /// + public Vector3 Translation + { + get + { + return new Vector3(M41, M42, M43); + } + set + { + M41 = value.X; + M42 = value.Y; + M43 = value.Z; + } + } + + /// + /// Constructs a Matrix4x4 from the given components. + /// + public Matrix4x4(float m11, float m12, float m13, float m14, + float m21, float m22, float m23, float m24, + float m31, float m32, float m33, float m34, + float m41, float m42, float m43, float m44) + { + this.M11 = m11; + this.M12 = m12; + this.M13 = m13; + this.M14 = m14; + + this.M21 = m21; + this.M22 = m22; + this.M23 = m23; + this.M24 = m24; + + this.M31 = m31; + this.M32 = m32; + this.M33 = m33; + this.M34 = m34; + + this.M41 = m41; + this.M42 = m42; + this.M43 = m43; + this.M44 = m44; + } + + /// + /// Constructs a Matrix4x4 from the given Matrix3x2. + /// + /// The source Matrix3x2. + public Matrix4x4(Matrix3x2 value) + { + M11 = value.M11; + M12 = value.M12; + M13 = 0f; + M14 = 0f; + M21 = value.M21; + M22 = value.M22; + M23 = 0f; + M24 = 0f; + M31 = 0f; + M32 = 0f; + M33 = 1f; + M34 = 0f; + M41 = value.M31; + M42 = value.M32; + M43 = 0f; + M44 = 1f; + } + + /// + /// Creates a spherical billboard that rotates around a specified object position. + /// + /// Position of the object the billboard will rotate around. + /// Position of the camera. + /// The up vector of the camera. + /// The forward vector of the camera. + /// The created billboard matrix + public static Matrix4x4 CreateBillboard(Vector3 objectPosition, Vector3 cameraPosition, Vector3 cameraUpVector, Vector3 cameraForwardVector) + { + const float epsilon = 1e-4f; + + Vector3 zaxis = new Vector3( + objectPosition.X - cameraPosition.X, + objectPosition.Y - cameraPosition.Y, + objectPosition.Z - cameraPosition.Z); + + float norm = zaxis.LengthSquared(); + + if (norm < epsilon) + { + zaxis = -cameraForwardVector; + } + else + { + zaxis = Vector3.Multiply(zaxis, 1.0f / (float)Math.Sqrt(norm)); + } + + Vector3 xaxis = Vector3.Normalize(Vector3.Cross(cameraUpVector, zaxis)); + + Vector3 yaxis = Vector3.Cross(zaxis, xaxis); + + Matrix4x4 result; + + result.M11 = xaxis.X; + result.M12 = xaxis.Y; + result.M13 = xaxis.Z; + result.M14 = 0.0f; + result.M21 = yaxis.X; + result.M22 = yaxis.Y; + result.M23 = yaxis.Z; + result.M24 = 0.0f; + result.M31 = zaxis.X; + result.M32 = zaxis.Y; + result.M33 = zaxis.Z; + result.M34 = 0.0f; + + result.M41 = objectPosition.X; + result.M42 = objectPosition.Y; + result.M43 = objectPosition.Z; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a cylindrical billboard that rotates around a specified axis. + /// + /// Position of the object the billboard will rotate around. + /// Position of the camera. + /// Axis to rotate the billboard around. + /// Forward vector of the camera. + /// Forward vector of the object. + /// The created billboard matrix. + public static Matrix4x4 CreateConstrainedBillboard(Vector3 objectPosition, Vector3 cameraPosition, Vector3 rotateAxis, Vector3 cameraForwardVector, Vector3 objectForwardVector) + { + const float epsilon = 1e-4f; + const float minAngle = 1.0f - (0.1f * ((float)Math.PI / 180.0f)); // 0.1 degrees + + // Treat the case when object and camera positions are too close. + Vector3 faceDir = new Vector3( + objectPosition.X - cameraPosition.X, + objectPosition.Y - cameraPosition.Y, + objectPosition.Z - cameraPosition.Z); + + float norm = faceDir.LengthSquared(); + + if (norm < epsilon) + { + faceDir = -cameraForwardVector; + } + else + { + faceDir = Vector3.Multiply(faceDir, (1.0f / (float)Math.Sqrt(norm))); + } + + Vector3 yaxis = rotateAxis; + Vector3 xaxis; + Vector3 zaxis; + + // Treat the case when angle between faceDir and rotateAxis is too close to 0. + float dot = Vector3.Dot(rotateAxis, faceDir); + + if (Math.Abs(dot) > minAngle) + { + zaxis = objectForwardVector; + + // Make sure passed values are useful for compute. + dot = Vector3.Dot(rotateAxis, zaxis); + + if (Math.Abs(dot) > minAngle) + { + zaxis = (Math.Abs(rotateAxis.Z) > minAngle) ? new Vector3(1, 0, 0) : new Vector3(0, 0, -1); + } + + xaxis = Vector3.Normalize(Vector3.Cross(rotateAxis, zaxis)); + zaxis = Vector3.Normalize(Vector3.Cross(xaxis, rotateAxis)); + } + else + { + xaxis = Vector3.Normalize(Vector3.Cross(rotateAxis, faceDir)); + zaxis = Vector3.Normalize(Vector3.Cross(xaxis, yaxis)); + } + + Matrix4x4 result; + + result.M11 = xaxis.X; + result.M12 = xaxis.Y; + result.M13 = xaxis.Z; + result.M14 = 0.0f; + result.M21 = yaxis.X; + result.M22 = yaxis.Y; + result.M23 = yaxis.Z; + result.M24 = 0.0f; + result.M31 = zaxis.X; + result.M32 = zaxis.Y; + result.M33 = zaxis.Z; + result.M34 = 0.0f; + + result.M41 = objectPosition.X; + result.M42 = objectPosition.Y; + result.M43 = objectPosition.Z; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a translation matrix. + /// + /// The amount to translate in each axis. + /// The translation matrix. + public static Matrix4x4 CreateTranslation(Vector3 position) + { + Matrix4x4 result; + + result.M11 = 1.0f; + result.M12 = 0.0f; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = 1.0f; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = 0.0f; + result.M33 = 1.0f; + result.M34 = 0.0f; + + result.M41 = position.X; + result.M42 = position.Y; + result.M43 = position.Z; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a translation matrix. + /// + /// The amount to translate on the X-axis. + /// The amount to translate on the Y-axis. + /// The amount to translate on the Z-axis. + /// The translation matrix. + public static Matrix4x4 CreateTranslation(float xPosition, float yPosition, float zPosition) + { + Matrix4x4 result; + + result.M11 = 1.0f; + result.M12 = 0.0f; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = 1.0f; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = 0.0f; + result.M33 = 1.0f; + result.M34 = 0.0f; + + result.M41 = xPosition; + result.M42 = yPosition; + result.M43 = zPosition; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a scaling matrix. + /// + /// Value to scale by on the X-axis. + /// Value to scale by on the Y-axis. + /// Value to scale by on the Z-axis. + /// The scaling matrix. + public static Matrix4x4 CreateScale(float xScale, float yScale, float zScale) + { + Matrix4x4 result; + + result.M11 = xScale; + result.M12 = 0.0f; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = yScale; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = 0.0f; + result.M33 = zScale; + result.M34 = 0.0f; + result.M41 = 0.0f; + result.M42 = 0.0f; + result.M43 = 0.0f; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a scaling matrix with a center point. + /// + /// Value to scale by on the X-axis. + /// Value to scale by on the Y-axis. + /// Value to scale by on the Z-axis. + /// The center point. + /// The scaling matrix. + public static Matrix4x4 CreateScale(float xScale, float yScale, float zScale, Vector3 centerPoint) + { + Matrix4x4 result; + + float tx = centerPoint.X * (1 - xScale); + float ty = centerPoint.Y * (1 - yScale); + float tz = centerPoint.Z * (1 - zScale); + + result.M11 = xScale; + result.M12 = 0.0f; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = yScale; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = 0.0f; + result.M33 = zScale; + result.M34 = 0.0f; + result.M41 = tx; + result.M42 = ty; + result.M43 = tz; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a scaling matrix. + /// + /// The vector containing the amount to scale by on each axis. + /// The scaling matrix. + public static Matrix4x4 CreateScale(Vector3 scales) + { + Matrix4x4 result; + + result.M11 = scales.X; + result.M12 = 0.0f; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = scales.Y; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = 0.0f; + result.M33 = scales.Z; + result.M34 = 0.0f; + result.M41 = 0.0f; + result.M42 = 0.0f; + result.M43 = 0.0f; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a scaling matrix with a center point. + /// + /// The vector containing the amount to scale by on each axis. + /// The center point. + /// The scaling matrix. + public static Matrix4x4 CreateScale(Vector3 scales, Vector3 centerPoint) + { + Matrix4x4 result; + + float tx = centerPoint.X * (1 - scales.X); + float ty = centerPoint.Y * (1 - scales.Y); + float tz = centerPoint.Z * (1 - scales.Z); + + result.M11 = scales.X; + result.M12 = 0.0f; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = scales.Y; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = 0.0f; + result.M33 = scales.Z; + result.M34 = 0.0f; + result.M41 = tx; + result.M42 = ty; + result.M43 = tz; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a uniform scaling matrix that scales equally on each axis. + /// + /// The uniform scaling factor. + /// The scaling matrix. + public static Matrix4x4 CreateScale(float scale) + { + Matrix4x4 result; + + result.M11 = scale; + result.M12 = 0.0f; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = scale; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = 0.0f; + result.M33 = scale; + result.M34 = 0.0f; + result.M41 = 0.0f; + result.M42 = 0.0f; + result.M43 = 0.0f; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a uniform scaling matrix that scales equally on each axis with a center point. + /// + /// The uniform scaling factor. + /// The center point. + /// The scaling matrix. + public static Matrix4x4 CreateScale(float scale, Vector3 centerPoint) + { + Matrix4x4 result; + + float tx = centerPoint.X * (1 - scale); + float ty = centerPoint.Y * (1 - scale); + float tz = centerPoint.Z * (1 - scale); + + result.M11 = scale; + result.M12 = 0.0f; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = scale; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = 0.0f; + result.M33 = scale; + result.M34 = 0.0f; + result.M41 = tx; + result.M42 = ty; + result.M43 = tz; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a matrix for rotating points around the X-axis. + /// + /// The amount, in radians, by which to rotate around the X-axis. + /// The rotation matrix. + public static Matrix4x4 CreateRotationX(float radians) + { + Matrix4x4 result; + + float c = (float)Math.Cos(radians); + float s = (float)Math.Sin(radians); + + // [ 1 0 0 0 ] + // [ 0 c s 0 ] + // [ 0 -s c 0 ] + // [ 0 0 0 1 ] + result.M11 = 1.0f; + result.M12 = 0.0f; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = c; + result.M23 = s; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = -s; + result.M33 = c; + result.M34 = 0.0f; + result.M41 = 0.0f; + result.M42 = 0.0f; + result.M43 = 0.0f; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a matrix for rotating points around the X-axis, from a center point. + /// + /// The amount, in radians, by which to rotate around the X-axis. + /// The center point. + /// The rotation matrix. + public static Matrix4x4 CreateRotationX(float radians, Vector3 centerPoint) + { + Matrix4x4 result; + + float c = (float)Math.Cos(radians); + float s = (float)Math.Sin(radians); + + float y = centerPoint.Y * (1 - c) + centerPoint.Z * s; + float z = centerPoint.Z * (1 - c) - centerPoint.Y * s; + + // [ 1 0 0 0 ] + // [ 0 c s 0 ] + // [ 0 -s c 0 ] + // [ 0 y z 1 ] + result.M11 = 1.0f; + result.M12 = 0.0f; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = c; + result.M23 = s; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = -s; + result.M33 = c; + result.M34 = 0.0f; + result.M41 = 0.0f; + result.M42 = y; + result.M43 = z; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a matrix for rotating points around the Y-axis. + /// + /// The amount, in radians, by which to rotate around the Y-axis. + /// The rotation matrix. + public static Matrix4x4 CreateRotationY(float radians) + { + Matrix4x4 result; + + float c = (float)Math.Cos(radians); + float s = (float)Math.Sin(radians); + + // [ c 0 -s 0 ] + // [ 0 1 0 0 ] + // [ s 0 c 0 ] + // [ 0 0 0 1 ] + result.M11 = c; + result.M12 = 0.0f; + result.M13 = -s; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = 1.0f; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = s; + result.M32 = 0.0f; + result.M33 = c; + result.M34 = 0.0f; + result.M41 = 0.0f; + result.M42 = 0.0f; + result.M43 = 0.0f; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a matrix for rotating points around the Y-axis, from a center point. + /// + /// The amount, in radians, by which to rotate around the Y-axis. + /// The center point. + /// The rotation matrix. + public static Matrix4x4 CreateRotationY(float radians, Vector3 centerPoint) + { + Matrix4x4 result; + + float c = (float)Math.Cos(radians); + float s = (float)Math.Sin(radians); + + float x = centerPoint.X * (1 - c) - centerPoint.Z * s; + float z = centerPoint.Z * (1 - c) + centerPoint.X * s; + + // [ c 0 -s 0 ] + // [ 0 1 0 0 ] + // [ s 0 c 0 ] + // [ x 0 z 1 ] + result.M11 = c; + result.M12 = 0.0f; + result.M13 = -s; + result.M14 = 0.0f; + result.M21 = 0.0f; + result.M22 = 1.0f; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = s; + result.M32 = 0.0f; + result.M33 = c; + result.M34 = 0.0f; + result.M41 = x; + result.M42 = 0.0f; + result.M43 = z; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a matrix for rotating points around the Z-axis. + /// + /// The amount, in radians, by which to rotate around the Z-axis. + /// The rotation matrix. + public static Matrix4x4 CreateRotationZ(float radians) + { + Matrix4x4 result; + + float c = (float)Math.Cos(radians); + float s = (float)Math.Sin(radians); + + // [ c s 0 0 ] + // [ -s c 0 0 ] + // [ 0 0 1 0 ] + // [ 0 0 0 1 ] + result.M11 = c; + result.M12 = s; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = -s; + result.M22 = c; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = 0.0f; + result.M33 = 1.0f; + result.M34 = 0.0f; + result.M41 = 0.0f; + result.M42 = 0.0f; + result.M43 = 0.0f; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a matrix for rotating points around the Z-axis, from a center point. + /// + /// The amount, in radians, by which to rotate around the Z-axis. + /// The center point. + /// The rotation matrix. + public static Matrix4x4 CreateRotationZ(float radians, Vector3 centerPoint) + { + Matrix4x4 result; + + float c = (float)Math.Cos(radians); + float s = (float)Math.Sin(radians); + + float x = centerPoint.X * (1 - c) + centerPoint.Y * s; + float y = centerPoint.Y * (1 - c) - centerPoint.X * s; + + // [ c s 0 0 ] + // [ -s c 0 0 ] + // [ 0 0 1 0 ] + // [ x y 0 1 ] + result.M11 = c; + result.M12 = s; + result.M13 = 0.0f; + result.M14 = 0.0f; + result.M21 = -s; + result.M22 = c; + result.M23 = 0.0f; + result.M24 = 0.0f; + result.M31 = 0.0f; + result.M32 = 0.0f; + result.M33 = 1.0f; + result.M34 = 0.0f; + result.M41 = x; + result.M42 = y; + result.M43 = 0.0f; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a matrix that rotates around an arbitrary vector. + /// + /// The axis to rotate around. + /// The angle to rotate around the given axis, in radians. + /// The rotation matrix. + public static Matrix4x4 CreateFromAxisAngle(Vector3 axis, float angle) + { + // a: angle + // x, y, z: unit vector for axis. + // + // Rotation matrix M can compute by using below equation. + // + // T T + // M = uu + (cos a)( I-uu ) + (sin a)S + // + // Where: + // + // u = ( x, y, z ) + // + // [ 0 -z y ] + // S = [ z 0 -x ] + // [ -y x 0 ] + // + // [ 1 0 0 ] + // I = [ 0 1 0 ] + // [ 0 0 1 ] + // + // + // [ xx+cosa*(1-xx) yx-cosa*yx-sina*z zx-cosa*xz+sina*y ] + // M = [ xy-cosa*yx+sina*z yy+cosa(1-yy) yz-cosa*yz-sina*x ] + // [ zx-cosa*zx-sina*y zy-cosa*zy+sina*x zz+cosa*(1-zz) ] + // + float x = axis.X, y = axis.Y, z = axis.Z; + float sa = (float)Math.Sin(angle), ca = (float)Math.Cos(angle); + float xx = x * x, yy = y * y, zz = z * z; + float xy = x * y, xz = x * z, yz = y * z; + + Matrix4x4 result; + + result.M11 = xx + ca * (1.0f - xx); + result.M12 = xy - ca * xy + sa * z; + result.M13 = xz - ca * xz - sa * y; + result.M14 = 0.0f; + result.M21 = xy - ca * xy - sa * z; + result.M22 = yy + ca * (1.0f - yy); + result.M23 = yz - ca * yz + sa * x; + result.M24 = 0.0f; + result.M31 = xz - ca * xz + sa * y; + result.M32 = yz - ca * yz - sa * x; + result.M33 = zz + ca * (1.0f - zz); + result.M34 = 0.0f; + result.M41 = 0.0f; + result.M42 = 0.0f; + result.M43 = 0.0f; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances. + /// + /// Field of view in the y direction, in radians. + /// Aspect ratio, defined as view space width divided by height. + /// Distance to the near view plane. + /// Distance to the far view plane. + /// The perspective projection matrix. + public static Matrix4x4 CreatePerspectiveFieldOfView(float fieldOfView, float aspectRatio, float nearPlaneDistance, float farPlaneDistance) + { + if (fieldOfView <= 0.0f || fieldOfView >= Math.PI) + throw new ArgumentOutOfRangeException("fieldOfView"); + + if (nearPlaneDistance <= 0.0f) + throw new ArgumentOutOfRangeException("nearPlaneDistance"); + + if (farPlaneDistance <= 0.0f) + throw new ArgumentOutOfRangeException("farPlaneDistance"); + + if (nearPlaneDistance >= farPlaneDistance) + throw new ArgumentOutOfRangeException("nearPlaneDistance"); + + float yScale = 1.0f / (float)Math.Tan(fieldOfView * 0.5f); + float xScale = yScale / aspectRatio; + + Matrix4x4 result; + + result.M11 = xScale; + result.M12 = result.M13 = result.M14 = 0.0f; + + result.M22 = yScale; + result.M21 = result.M23 = result.M24 = 0.0f; + + result.M31 = result.M32 = 0.0f; + result.M33 = farPlaneDistance / (nearPlaneDistance - farPlaneDistance); + result.M34 = -1.0f; + + result.M41 = result.M42 = result.M44 = 0.0f; + result.M43 = nearPlaneDistance * farPlaneDistance / (nearPlaneDistance - farPlaneDistance); + + return result; + } + + /// + /// Creates a perspective projection matrix from the given view volume dimensions. + /// + /// Width of the view volume at the near view plane. + /// Height of the view volume at the near view plane. + /// Distance to the near view plane. + /// Distance to the far view plane. + /// The perspective projection matrix. + public static Matrix4x4 CreatePerspective(float width, float height, float nearPlaneDistance, float farPlaneDistance) + { + if (nearPlaneDistance <= 0.0f) + throw new ArgumentOutOfRangeException("nearPlaneDistance"); + + if (farPlaneDistance <= 0.0f) + throw new ArgumentOutOfRangeException("farPlaneDistance"); + + if (nearPlaneDistance >= farPlaneDistance) + throw new ArgumentOutOfRangeException("nearPlaneDistance"); + + Matrix4x4 result; + + result.M11 = 2.0f * nearPlaneDistance / width; + result.M12 = result.M13 = result.M14 = 0.0f; + + result.M22 = 2.0f * nearPlaneDistance / height; + result.M21 = result.M23 = result.M24 = 0.0f; + + result.M33 = farPlaneDistance / (nearPlaneDistance - farPlaneDistance); + result.M31 = result.M32 = 0.0f; + result.M34 = -1.0f; + + result.M41 = result.M42 = result.M44 = 0.0f; + result.M43 = nearPlaneDistance * farPlaneDistance / (nearPlaneDistance - farPlaneDistance); + + return result; + } + + /// + /// Creates a customized, perspective projection matrix. + /// + /// Minimum x-value of the view volume at the near view plane. + /// Maximum x-value of the view volume at the near view plane. + /// Minimum y-value of the view volume at the near view plane. + /// Maximum y-value of the view volume at the near view plane. + /// Distance to the near view plane. + /// Distance to of the far view plane. + /// The perspective projection matrix. + public static Matrix4x4 CreatePerspectiveOffCenter(float left, float right, float bottom, float top, float nearPlaneDistance, float farPlaneDistance) + { + if (nearPlaneDistance <= 0.0f) + throw new ArgumentOutOfRangeException("nearPlaneDistance"); + + if (farPlaneDistance <= 0.0f) + throw new ArgumentOutOfRangeException("farPlaneDistance"); + + if (nearPlaneDistance >= farPlaneDistance) + throw new ArgumentOutOfRangeException("nearPlaneDistance"); + + Matrix4x4 result; + + result.M11 = 2.0f * nearPlaneDistance / (right - left); + result.M12 = result.M13 = result.M14 = 0.0f; + + result.M22 = 2.0f * nearPlaneDistance / (top - bottom); + result.M21 = result.M23 = result.M24 = 0.0f; + + result.M31 = (left + right) / (right - left); + result.M32 = (top + bottom) / (top - bottom); + result.M33 = farPlaneDistance / (nearPlaneDistance - farPlaneDistance); + result.M34 = -1.0f; + + result.M43 = nearPlaneDistance * farPlaneDistance / (nearPlaneDistance - farPlaneDistance); + result.M41 = result.M42 = result.M44 = 0.0f; + + return result; + } + + /// + /// Creates an orthographic perspective matrix from the given view volume dimensions. + /// + /// Width of the view volume. + /// Height of the view volume. + /// Minimum Z-value of the view volume. + /// Maximum Z-value of the view volume. + /// The orthographic projection matrix. + public static Matrix4x4 CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane) + { + Matrix4x4 result; + + result.M11 = 2.0f / width; + result.M12 = result.M13 = result.M14 = 0.0f; + + result.M22 = 2.0f / height; + result.M21 = result.M23 = result.M24 = 0.0f; + + result.M33 = 1.0f / (zNearPlane - zFarPlane); + result.M31 = result.M32 = result.M34 = 0.0f; + + result.M41 = result.M42 = 0.0f; + result.M43 = zNearPlane / (zNearPlane - zFarPlane); + result.M44 = 1.0f; + + return result; + } + + /// + /// Builds a customized, orthographic projection matrix. + /// + /// Minimum X-value of the view volume. + /// Maximum X-value of the view volume. + /// Minimum Y-value of the view volume. + /// Maximum Y-value of the view volume. + /// Minimum Z-value of the view volume. + /// Maximum Z-value of the view volume. + /// The orthographic projection matrix. + public static Matrix4x4 CreateOrthographicOffCenter(float left, float right, float bottom, float top, float zNearPlane, float zFarPlane) + { + Matrix4x4 result; + + result.M11 = 2.0f / (right - left); + result.M12 = result.M13 = result.M14 = 0.0f; + + result.M22 = 2.0f / (top - bottom); + result.M21 = result.M23 = result.M24 = 0.0f; + + result.M33 = 1.0f / (zNearPlane - zFarPlane); + result.M31 = result.M32 = result.M34 = 0.0f; + + result.M41 = (left + right) / (left - right); + result.M42 = (top + bottom) / (bottom - top); + result.M43 = zNearPlane / (zNearPlane - zFarPlane); + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a view matrix. + /// + /// The position of the camera. + /// The target towards which the camera is pointing. + /// The direction that is "up" from the camera's point of view. + /// The view matrix. + public static Matrix4x4 CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarget, Vector3 cameraUpVector) + { + Vector3 zaxis = Vector3.Normalize(cameraPosition - cameraTarget); + Vector3 xaxis = Vector3.Normalize(Vector3.Cross(cameraUpVector, zaxis)); + Vector3 yaxis = Vector3.Cross(zaxis, xaxis); + + Matrix4x4 result; + + result.M11 = xaxis.X; + result.M12 = yaxis.X; + result.M13 = zaxis.X; + result.M14 = 0.0f; + result.M21 = xaxis.Y; + result.M22 = yaxis.Y; + result.M23 = zaxis.Y; + result.M24 = 0.0f; + result.M31 = xaxis.Z; + result.M32 = yaxis.Z; + result.M33 = zaxis.Z; + result.M34 = 0.0f; + result.M41 = -Vector3.Dot(xaxis, cameraPosition); + result.M42 = -Vector3.Dot(yaxis, cameraPosition); + result.M43 = -Vector3.Dot(zaxis, cameraPosition); + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a world matrix with the specified parameters. + /// + /// The position of the object; used in translation operations. + /// Forward direction of the object. + /// Upward direction of the object; usually [0, 1, 0]. + /// The world matrix. + public static Matrix4x4 CreateWorld(Vector3 position, Vector3 forward, Vector3 up) + { + Vector3 zaxis = Vector3.Normalize(-forward); + Vector3 xaxis = Vector3.Normalize(Vector3.Cross(up, zaxis)); + Vector3 yaxis = Vector3.Cross(zaxis, xaxis); + + Matrix4x4 result; + + result.M11 = xaxis.X; + result.M12 = xaxis.Y; + result.M13 = xaxis.Z; + result.M14 = 0.0f; + result.M21 = yaxis.X; + result.M22 = yaxis.Y; + result.M23 = yaxis.Z; + result.M24 = 0.0f; + result.M31 = zaxis.X; + result.M32 = zaxis.Y; + result.M33 = zaxis.Z; + result.M34 = 0.0f; + result.M41 = position.X; + result.M42 = position.Y; + result.M43 = position.Z; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a rotation matrix from the given Quaternion rotation value. + /// + /// The source Quaternion. + /// The rotation matrix. + public static Matrix4x4 CreateFromQuaternion(Quaternion quaternion) + { + Matrix4x4 result; + + float xx = quaternion.X * quaternion.X; + float yy = quaternion.Y * quaternion.Y; + float zz = quaternion.Z * quaternion.Z; + + float xy = quaternion.X * quaternion.Y; + float wz = quaternion.Z * quaternion.W; + float xz = quaternion.Z * quaternion.X; + float wy = quaternion.Y * quaternion.W; + float yz = quaternion.Y * quaternion.Z; + float wx = quaternion.X * quaternion.W; + + result.M11 = 1.0f - 2.0f * (yy + zz); + result.M12 = 2.0f * (xy + wz); + result.M13 = 2.0f * (xz - wy); + result.M14 = 0.0f; + result.M21 = 2.0f * (xy - wz); + result.M22 = 1.0f - 2.0f * (zz + xx); + result.M23 = 2.0f * (yz + wx); + result.M24 = 0.0f; + result.M31 = 2.0f * (xz + wy); + result.M32 = 2.0f * (yz - wx); + result.M33 = 1.0f - 2.0f * (yy + xx); + result.M34 = 0.0f; + result.M41 = 0.0f; + result.M42 = 0.0f; + result.M43 = 0.0f; + result.M44 = 1.0f; + + return result; + } + + /// + /// Creates a rotation matrix from the specified yaw, pitch, and roll. + /// + /// Angle of rotation, in radians, around the Y-axis. + /// Angle of rotation, in radians, around the X-axis. + /// Angle of rotation, in radians, around the Z-axis. + /// The rotation matrix. + public static Matrix4x4 CreateFromYawPitchRoll(float yaw, float pitch, float roll) + { + Quaternion q = Quaternion.CreateFromYawPitchRoll(yaw, pitch, roll); + + return Matrix4x4.CreateFromQuaternion(q); + } + + /// + /// Creates a Matrix that flattens geometry into a specified Plane as if casting a shadow from a specified light source. + /// + /// The direction from which the light that will cast the shadow is coming. + /// The Plane onto which the new matrix should flatten geometry so as to cast a shadow. + /// A new Matrix that can be used to flatten geometry onto the specified plane from the specified direction. + public static Matrix4x4 CreateShadow(Vector3 lightDirection, Plane plane) + { + Plane p = Plane.Normalize(plane); + + float dot = p.Normal.X * lightDirection.X + p.Normal.Y * lightDirection.Y + p.Normal.Z * lightDirection.Z; + float a = -p.Normal.X; + float b = -p.Normal.Y; + float c = -p.Normal.Z; + float d = -p.D; + + Matrix4x4 result; + + result.M11 = a * lightDirection.X + dot; + result.M21 = b * lightDirection.X; + result.M31 = c * lightDirection.X; + result.M41 = d * lightDirection.X; + + result.M12 = a * lightDirection.Y; + result.M22 = b * lightDirection.Y + dot; + result.M32 = c * lightDirection.Y; + result.M42 = d * lightDirection.Y; + + result.M13 = a * lightDirection.Z; + result.M23 = b * lightDirection.Z; + result.M33 = c * lightDirection.Z + dot; + result.M43 = d * lightDirection.Z; + + result.M14 = 0.0f; + result.M24 = 0.0f; + result.M34 = 0.0f; + result.M44 = dot; + + return result; + } + + /// + /// Creates a Matrix that reflects the coordinate system about a specified Plane. + /// + /// The Plane about which to create a reflection. + /// A new matrix expressing the reflection. + public static Matrix4x4 CreateReflection(Plane value) + { + value = Plane.Normalize(value); + + float a = value.Normal.X; + float b = value.Normal.Y; + float c = value.Normal.Z; + + float fa = -2.0f * a; + float fb = -2.0f * b; + float fc = -2.0f * c; + + Matrix4x4 result; + + result.M11 = fa * a + 1.0f; + result.M12 = fb * a; + result.M13 = fc * a; + result.M14 = 0.0f; + + result.M21 = fa * b; + result.M22 = fb * b + 1.0f; + result.M23 = fc * b; + result.M24 = 0.0f; + + result.M31 = fa * c; + result.M32 = fb * c; + result.M33 = fc * c + 1.0f; + result.M34 = 0.0f; + + result.M41 = fa * value.D; + result.M42 = fb * value.D; + result.M43 = fc * value.D; + result.M44 = 1.0f; + + return result; + } + + /// + /// Calculates the determinant of the matrix. + /// + /// The determinant of the matrix. + public float GetDeterminant() + { + // | a b c d | | f g h | | e g h | | e f h | | e f g | + // | e f g h | = a | j k l | - b | i k l | + c | i j l | - d | i j k | + // | i j k l | | n o p | | m o p | | m n p | | m n o | + // | m n o p | + // + // | f g h | + // a | j k l | = a ( f ( kp - lo ) - g ( jp - ln ) + h ( jo - kn ) ) + // | n o p | + // + // | e g h | + // b | i k l | = b ( e ( kp - lo ) - g ( ip - lm ) + h ( io - km ) ) + // | m o p | + // + // | e f h | + // c | i j l | = c ( e ( jp - ln ) - f ( ip - lm ) + h ( in - jm ) ) + // | m n p | + // + // | e f g | + // d | i j k | = d ( e ( jo - kn ) - f ( io - km ) + g ( in - jm ) ) + // | m n o | + // + // Cost of operation + // 17 adds and 28 muls. + // + // add: 6 + 8 + 3 = 17 + // mul: 12 + 16 = 28 + + float a = M11, b = M12, c = M13, d = M14; + float e = M21, f = M22, g = M23, h = M24; + float i = M31, j = M32, k = M33, l = M34; + float m = M41, n = M42, o = M43, p = M44; + + float kp_lo = k * p - l * o; + float jp_ln = j * p - l * n; + float jo_kn = j * o - k * n; + float ip_lm = i * p - l * m; + float io_km = i * o - k * m; + float in_jm = i * n - j * m; + + return a * (f * kp_lo - g * jp_ln + h * jo_kn) - + b * (e * kp_lo - g * ip_lm + h * io_km) + + c * (e * jp_ln - f * ip_lm + h * in_jm) - + d * (e * jo_kn - f * io_km + g * in_jm); + } + + /// + /// Attempts to calculate the inverse of the given matrix. If successful, result will contain the inverted matrix. + /// + /// The source matrix to invert. + /// If successful, contains the inverted matrix. + /// True if the source matrix could be inverted; False otherwise. + public static bool Invert(Matrix4x4 matrix, out Matrix4x4 result) + { + // -1 + // If you have matrix M, inverse Matrix M can compute + // + // -1 1 + // M = --------- A + // det(M) + // + // A is adjugate (adjoint) of M, where, + // + // T + // A = C + // + // C is Cofactor matrix of M, where, + // i + j + // C = (-1) * det(M ) + // ij ij + // + // [ a b c d ] + // M = [ e f g h ] + // [ i j k l ] + // [ m n o p ] + // + // First Row + // 2 | f g h | + // C = (-1) | j k l | = + ( f ( kp - lo ) - g ( jp - ln ) + h ( jo - kn ) ) + // 11 | n o p | + // + // 3 | e g h | + // C = (-1) | i k l | = - ( e ( kp - lo ) - g ( ip - lm ) + h ( io - km ) ) + // 12 | m o p | + // + // 4 | e f h | + // C = (-1) | i j l | = + ( e ( jp - ln ) - f ( ip - lm ) + h ( in - jm ) ) + // 13 | m n p | + // + // 5 | e f g | + // C = (-1) | i j k | = - ( e ( jo - kn ) - f ( io - km ) + g ( in - jm ) ) + // 14 | m n o | + // + // Second Row + // 3 | b c d | + // C = (-1) | j k l | = - ( b ( kp - lo ) - c ( jp - ln ) + d ( jo - kn ) ) + // 21 | n o p | + // + // 4 | a c d | + // C = (-1) | i k l | = + ( a ( kp - lo ) - c ( ip - lm ) + d ( io - km ) ) + // 22 | m o p | + // + // 5 | a b d | + // C = (-1) | i j l | = - ( a ( jp - ln ) - b ( ip - lm ) + d ( in - jm ) ) + // 23 | m n p | + // + // 6 | a b c | + // C = (-1) | i j k | = + ( a ( jo - kn ) - b ( io - km ) + c ( in - jm ) ) + // 24 | m n o | + // + // Third Row + // 4 | b c d | + // C = (-1) | f g h | = + ( b ( gp - ho ) - c ( fp - hn ) + d ( fo - gn ) ) + // 31 | n o p | + // + // 5 | a c d | + // C = (-1) | e g h | = - ( a ( gp - ho ) - c ( ep - hm ) + d ( eo - gm ) ) + // 32 | m o p | + // + // 6 | a b d | + // C = (-1) | e f h | = + ( a ( fp - hn ) - b ( ep - hm ) + d ( en - fm ) ) + // 33 | m n p | + // + // 7 | a b c | + // C = (-1) | e f g | = - ( a ( fo - gn ) - b ( eo - gm ) + c ( en - fm ) ) + // 34 | m n o | + // + // Fourth Row + // 5 | b c d | + // C = (-1) | f g h | = - ( b ( gl - hk ) - c ( fl - hj ) + d ( fk - gj ) ) + // 41 | j k l | + // + // 6 | a c d | + // C = (-1) | e g h | = + ( a ( gl - hk ) - c ( el - hi ) + d ( ek - gi ) ) + // 42 | i k l | + // + // 7 | a b d | + // C = (-1) | e f h | = - ( a ( fl - hj ) - b ( el - hi ) + d ( ej - fi ) ) + // 43 | i j l | + // + // 8 | a b c | + // C = (-1) | e f g | = + ( a ( fk - gj ) - b ( ek - gi ) + c ( ej - fi ) ) + // 44 | i j k | + // + // Cost of operation + // 53 adds, 104 muls, and 1 div. + float a = matrix.M11, b = matrix.M12, c = matrix.M13, d = matrix.M14; + float e = matrix.M21, f = matrix.M22, g = matrix.M23, h = matrix.M24; + float i = matrix.M31, j = matrix.M32, k = matrix.M33, l = matrix.M34; + float m = matrix.M41, n = matrix.M42, o = matrix.M43, p = matrix.M44; + + float kp_lo = k * p - l * o; + float jp_ln = j * p - l * n; + float jo_kn = j * o - k * n; + float ip_lm = i * p - l * m; + float io_km = i * o - k * m; + float in_jm = i * n - j * m; + + float a11 = +(f * kp_lo - g * jp_ln + h * jo_kn); + float a12 = -(e * kp_lo - g * ip_lm + h * io_km); + float a13 = +(e * jp_ln - f * ip_lm + h * in_jm); + float a14 = -(e * jo_kn - f * io_km + g * in_jm); + + float det = a * a11 + b * a12 + c * a13 + d * a14; + + if (Math.Abs(det) < float.Epsilon) + { + result = new Matrix4x4(float.NaN, float.NaN, float.NaN, float.NaN, + float.NaN, float.NaN, float.NaN, float.NaN, + float.NaN, float.NaN, float.NaN, float.NaN, + float.NaN, float.NaN, float.NaN, float.NaN); + return false; + } + + float invDet = 1.0f / det; + + result.M11 = a11 * invDet; + result.M21 = a12 * invDet; + result.M31 = a13 * invDet; + result.M41 = a14 * invDet; + + result.M12 = -(b * kp_lo - c * jp_ln + d * jo_kn) * invDet; + result.M22 = +(a * kp_lo - c * ip_lm + d * io_km) * invDet; + result.M32 = -(a * jp_ln - b * ip_lm + d * in_jm) * invDet; + result.M42 = +(a * jo_kn - b * io_km + c * in_jm) * invDet; + + float gp_ho = g * p - h * o; + float fp_hn = f * p - h * n; + float fo_gn = f * o - g * n; + float ep_hm = e * p - h * m; + float eo_gm = e * o - g * m; + float en_fm = e * n - f * m; + + result.M13 = +(b * gp_ho - c * fp_hn + d * fo_gn) * invDet; + result.M23 = -(a * gp_ho - c * ep_hm + d * eo_gm) * invDet; + result.M33 = +(a * fp_hn - b * ep_hm + d * en_fm) * invDet; + result.M43 = -(a * fo_gn - b * eo_gm + c * en_fm) * invDet; + + float gl_hk = g * l - h * k; + float fl_hj = f * l - h * j; + float fk_gj = f * k - g * j; + float el_hi = e * l - h * i; + float ek_gi = e * k - g * i; + float ej_fi = e * j - f * i; + + result.M14 = -(b * gl_hk - c * fl_hj + d * fk_gj) * invDet; + result.M24 = +(a * gl_hk - c * el_hi + d * ek_gi) * invDet; + result.M34 = -(a * fl_hj - b * el_hi + d * ej_fi) * invDet; + result.M44 = +(a * fk_gj - b * ek_gi + c * ej_fi) * invDet; + + return true; + } + + struct CanonicalBasis + { + public Vector3 Row0; + public Vector3 Row1; + public Vector3 Row2; + }; + + [System.Security.SecuritySafeCritical] + struct VectorBasis + { + public unsafe Vector3* Element0; + public unsafe Vector3* Element1; + public unsafe Vector3* Element2; + } + + /// + /// Attempts to extract the scale, translation, and rotation components from the given scale/rotation/translation matrix. + /// If successful, the out parameters will contained the extracted values. + /// + /// The source matrix. + /// The scaling component of the transformation matrix. + /// The rotation component of the transformation matrix. + /// The translation component of the transformation matrix + /// True if the source matrix was successfully decomposed; False otherwise. + [System.Security.SecuritySafeCritical] + public static bool Decompose(Matrix4x4 matrix, out Vector3 scale, out Quaternion rotation, out Vector3 translation) + { + bool result = true; + + unsafe + { + fixed (Vector3* scaleBase = &scale) + { + float* pfScales = (float*)scaleBase; + const float EPSILON = 0.0001f; + float det; + + VectorBasis vectorBasis; + Vector3** pVectorBasis = (Vector3**)&vectorBasis; + + Matrix4x4 matTemp = Matrix4x4.Identity; + CanonicalBasis canonicalBasis = new CanonicalBasis(); + Vector3* pCanonicalBasis = &canonicalBasis.Row0; + + canonicalBasis.Row0 = new Vector3(1.0f, 0.0f, 0.0f); + canonicalBasis.Row1 = new Vector3(0.0f, 1.0f, 0.0f); + canonicalBasis.Row2 = new Vector3(0.0f, 0.0f, 1.0f); + + translation = new Vector3( + matrix.M41, + matrix.M42, + matrix.M43); + + pVectorBasis[0] = (Vector3*)&matTemp.M11; + pVectorBasis[1] = (Vector3*)&matTemp.M21; + pVectorBasis[2] = (Vector3*)&matTemp.M31; + + *(pVectorBasis[0]) = new Vector3(matrix.M11, matrix.M12, matrix.M13); + *(pVectorBasis[1]) = new Vector3(matrix.M21, matrix.M22, matrix.M23); + *(pVectorBasis[2]) = new Vector3(matrix.M31, matrix.M32, matrix.M33); + + scale.X = pVectorBasis[0]->Length(); + scale.Y = pVectorBasis[1]->Length(); + scale.Z = pVectorBasis[2]->Length(); + + uint a, b, c; + #region Ranking + float x = pfScales[0], y = pfScales[1], z = pfScales[2]; + if (x < y) + { + if (y < z) + { + a = 2; + b = 1; + c = 0; + } + else + { + a = 1; + + if (x < z) + { + b = 2; + c = 0; + } + else + { + b = 0; + c = 2; + } + } + } + else + { + if (x < z) + { + a = 2; + b = 0; + c = 1; + } + else + { + a = 0; + + if (y < z) + { + b = 2; + c = 1; + } + else + { + b = 1; + c = 2; + } + } + } + #endregion + + if (pfScales[a] < EPSILON) + { + *(pVectorBasis[a]) = pCanonicalBasis[a]; + } + + *pVectorBasis[a] = Vector3.Normalize(*pVectorBasis[a]); + + if (pfScales[b] < EPSILON) + { + uint cc; + float fAbsX, fAbsY, fAbsZ; + + fAbsX = (float)Math.Abs(pVectorBasis[a]->X); + fAbsY = (float)Math.Abs(pVectorBasis[a]->Y); + fAbsZ = (float)Math.Abs(pVectorBasis[a]->Z); + + #region Ranking + if (fAbsX < fAbsY) + { + if (fAbsY < fAbsZ) + { + cc = 0; + } + else + { + if (fAbsX < fAbsZ) + { + cc = 0; + } + else + { + cc = 2; + } + } + } + else + { + if (fAbsX < fAbsZ) + { + cc = 1; + } + else + { + if (fAbsY < fAbsZ) + { + cc = 1; + } + else + { + cc = 2; + } + } + } + #endregion + + *pVectorBasis[b] = Vector3.Cross(*pVectorBasis[a], *(pCanonicalBasis + cc)); + } + + *pVectorBasis[b] = Vector3.Normalize(*pVectorBasis[b]); + + if (pfScales[c] < EPSILON) + { + *pVectorBasis[c] = Vector3.Cross(*pVectorBasis[a], *pVectorBasis[b]); + } + + *pVectorBasis[c] = Vector3.Normalize(*pVectorBasis[c]); + + det = matTemp.GetDeterminant(); + + // use Kramer's rule to check for handedness of coordinate system + if (det < 0.0f) + { + // switch coordinate system by negating the scale and inverting the basis vector on the x-axis + pfScales[a] = -pfScales[a]; + *pVectorBasis[a] = -(*pVectorBasis[a]); + + det = -det; + } + + det -= 1.0f; + det *= det; + + if ((EPSILON < det)) + { + // Non-SRT matrix encountered + rotation = Quaternion.Identity; + result = false; + } + else + { + // generate the quaternion from the matrix + rotation = Quaternion.CreateFromRotationMatrix(matTemp); + } + } + } + + return result; + } + + /// + /// Transforms the given matrix by applying the given Quaternion rotation. + /// + /// The source matrix to transform. + /// The rotation to apply. + /// The transformed matrix. + public static Matrix4x4 Transform(Matrix4x4 value, Quaternion rotation) + { + // Compute rotation matrix. + float x2 = rotation.X + rotation.X; + float y2 = rotation.Y + rotation.Y; + float z2 = rotation.Z + rotation.Z; + + float wx2 = rotation.W * x2; + float wy2 = rotation.W * y2; + float wz2 = rotation.W * z2; + float xx2 = rotation.X * x2; + float xy2 = rotation.X * y2; + float xz2 = rotation.X * z2; + float yy2 = rotation.Y * y2; + float yz2 = rotation.Y * z2; + float zz2 = rotation.Z * z2; + + float q11 = 1.0f - yy2 - zz2; + float q21 = xy2 - wz2; + float q31 = xz2 + wy2; + + float q12 = xy2 + wz2; + float q22 = 1.0f - xx2 - zz2; + float q32 = yz2 - wx2; + + float q13 = xz2 - wy2; + float q23 = yz2 + wx2; + float q33 = 1.0f - xx2 - yy2; + + Matrix4x4 result; + + // First row + result.M11 = value.M11 * q11 + value.M12 * q21 + value.M13 * q31; + result.M12 = value.M11 * q12 + value.M12 * q22 + value.M13 * q32; + result.M13 = value.M11 * q13 + value.M12 * q23 + value.M13 * q33; + result.M14 = value.M14; + + // Second row + result.M21 = value.M21 * q11 + value.M22 * q21 + value.M23 * q31; + result.M22 = value.M21 * q12 + value.M22 * q22 + value.M23 * q32; + result.M23 = value.M21 * q13 + value.M22 * q23 + value.M23 * q33; + result.M24 = value.M24; + + // Third row + result.M31 = value.M31 * q11 + value.M32 * q21 + value.M33 * q31; + result.M32 = value.M31 * q12 + value.M32 * q22 + value.M33 * q32; + result.M33 = value.M31 * q13 + value.M32 * q23 + value.M33 * q33; + result.M34 = value.M34; + + // Fourth row + result.M41 = value.M41 * q11 + value.M42 * q21 + value.M43 * q31; + result.M42 = value.M41 * q12 + value.M42 * q22 + value.M43 * q32; + result.M43 = value.M41 * q13 + value.M42 * q23 + value.M43 * q33; + result.M44 = value.M44; + + return result; + } + + /// + /// Transposes the rows and columns of a matrix. + /// + /// The source matrix. + /// The transposed matrix. + public static Matrix4x4 Transpose(Matrix4x4 matrix) + { + Matrix4x4 result; + + result.M11 = matrix.M11; + result.M12 = matrix.M21; + result.M13 = matrix.M31; + result.M14 = matrix.M41; + result.M21 = matrix.M12; + result.M22 = matrix.M22; + result.M23 = matrix.M32; + result.M24 = matrix.M42; + result.M31 = matrix.M13; + result.M32 = matrix.M23; + result.M33 = matrix.M33; + result.M34 = matrix.M43; + result.M41 = matrix.M14; + result.M42 = matrix.M24; + result.M43 = matrix.M34; + result.M44 = matrix.M44; + + return result; + } + + /// + /// Linearly interpolates between the corresponding values of two matrices. + /// + /// The first source matrix. + /// The second source matrix. + /// The relative weight of the second source matrix. + /// The interpolated matrix. + public static Matrix4x4 Lerp(Matrix4x4 matrix1, Matrix4x4 matrix2, float amount) + { + Matrix4x4 result; + + // First row + result.M11 = matrix1.M11 + (matrix2.M11 - matrix1.M11) * amount; + result.M12 = matrix1.M12 + (matrix2.M12 - matrix1.M12) * amount; + result.M13 = matrix1.M13 + (matrix2.M13 - matrix1.M13) * amount; + result.M14 = matrix1.M14 + (matrix2.M14 - matrix1.M14) * amount; + + // Second row + result.M21 = matrix1.M21 + (matrix2.M21 - matrix1.M21) * amount; + result.M22 = matrix1.M22 + (matrix2.M22 - matrix1.M22) * amount; + result.M23 = matrix1.M23 + (matrix2.M23 - matrix1.M23) * amount; + result.M24 = matrix1.M24 + (matrix2.M24 - matrix1.M24) * amount; + + // Third row + result.M31 = matrix1.M31 + (matrix2.M31 - matrix1.M31) * amount; + result.M32 = matrix1.M32 + (matrix2.M32 - matrix1.M32) * amount; + result.M33 = matrix1.M33 + (matrix2.M33 - matrix1.M33) * amount; + result.M34 = matrix1.M34 + (matrix2.M34 - matrix1.M34) * amount; + + // Fourth row + result.M41 = matrix1.M41 + (matrix2.M41 - matrix1.M41) * amount; + result.M42 = matrix1.M42 + (matrix2.M42 - matrix1.M42) * amount; + result.M43 = matrix1.M43 + (matrix2.M43 - matrix1.M43) * amount; + result.M44 = matrix1.M44 + (matrix2.M44 - matrix1.M44) * amount; + + return result; + } + + /// + /// Returns a new matrix with the negated elements of the given matrix. + /// + /// The source matrix. + /// The negated matrix. + public static Matrix4x4 Negate(Matrix4x4 value) + { + Matrix4x4 result; + + result.M11 = -value.M11; + result.M12 = -value.M12; + result.M13 = -value.M13; + result.M14 = -value.M14; + result.M21 = -value.M21; + result.M22 = -value.M22; + result.M23 = -value.M23; + result.M24 = -value.M24; + result.M31 = -value.M31; + result.M32 = -value.M32; + result.M33 = -value.M33; + result.M34 = -value.M34; + result.M41 = -value.M41; + result.M42 = -value.M42; + result.M43 = -value.M43; + result.M44 = -value.M44; + + return result; + } + + /// + /// Adds two matrices together. + /// + /// The first source matrix. + /// The second source matrix. + /// The resulting matrix. + public static Matrix4x4 Add(Matrix4x4 value1, Matrix4x4 value2) + { + Matrix4x4 result; + + result.M11 = value1.M11 + value2.M11; + result.M12 = value1.M12 + value2.M12; + result.M13 = value1.M13 + value2.M13; + result.M14 = value1.M14 + value2.M14; + result.M21 = value1.M21 + value2.M21; + result.M22 = value1.M22 + value2.M22; + result.M23 = value1.M23 + value2.M23; + result.M24 = value1.M24 + value2.M24; + result.M31 = value1.M31 + value2.M31; + result.M32 = value1.M32 + value2.M32; + result.M33 = value1.M33 + value2.M33; + result.M34 = value1.M34 + value2.M34; + result.M41 = value1.M41 + value2.M41; + result.M42 = value1.M42 + value2.M42; + result.M43 = value1.M43 + value2.M43; + result.M44 = value1.M44 + value2.M44; + + return result; + } + + /// + /// Subtracts the second matrix from the first. + /// + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix4x4 Subtract(Matrix4x4 value1, Matrix4x4 value2) + { + Matrix4x4 result; + + result.M11 = value1.M11 - value2.M11; + result.M12 = value1.M12 - value2.M12; + result.M13 = value1.M13 - value2.M13; + result.M14 = value1.M14 - value2.M14; + result.M21 = value1.M21 - value2.M21; + result.M22 = value1.M22 - value2.M22; + result.M23 = value1.M23 - value2.M23; + result.M24 = value1.M24 - value2.M24; + result.M31 = value1.M31 - value2.M31; + result.M32 = value1.M32 - value2.M32; + result.M33 = value1.M33 - value2.M33; + result.M34 = value1.M34 - value2.M34; + result.M41 = value1.M41 - value2.M41; + result.M42 = value1.M42 - value2.M42; + result.M43 = value1.M43 - value2.M43; + result.M44 = value1.M44 - value2.M44; + + return result; + } + + /// + /// Multiplies a matrix by another matrix. + /// + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4x4 Multiply(Matrix4x4 value1, Matrix4x4 value2) + { + Matrix4x4 result; + + // First row + result.M11 = value1.M11 * value2.M11 + value1.M12 * value2.M21 + value1.M13 * value2.M31 + value1.M14 * value2.M41; + result.M12 = value1.M11 * value2.M12 + value1.M12 * value2.M22 + value1.M13 * value2.M32 + value1.M14 * value2.M42; + result.M13 = value1.M11 * value2.M13 + value1.M12 * value2.M23 + value1.M13 * value2.M33 + value1.M14 * value2.M43; + result.M14 = value1.M11 * value2.M14 + value1.M12 * value2.M24 + value1.M13 * value2.M34 + value1.M14 * value2.M44; + + // Second row + result.M21 = value1.M21 * value2.M11 + value1.M22 * value2.M21 + value1.M23 * value2.M31 + value1.M24 * value2.M41; + result.M22 = value1.M21 * value2.M12 + value1.M22 * value2.M22 + value1.M23 * value2.M32 + value1.M24 * value2.M42; + result.M23 = value1.M21 * value2.M13 + value1.M22 * value2.M23 + value1.M23 * value2.M33 + value1.M24 * value2.M43; + result.M24 = value1.M21 * value2.M14 + value1.M22 * value2.M24 + value1.M23 * value2.M34 + value1.M24 * value2.M44; + + // Third row + result.M31 = value1.M31 * value2.M11 + value1.M32 * value2.M21 + value1.M33 * value2.M31 + value1.M34 * value2.M41; + result.M32 = value1.M31 * value2.M12 + value1.M32 * value2.M22 + value1.M33 * value2.M32 + value1.M34 * value2.M42; + result.M33 = value1.M31 * value2.M13 + value1.M32 * value2.M23 + value1.M33 * value2.M33 + value1.M34 * value2.M43; + result.M34 = value1.M31 * value2.M14 + value1.M32 * value2.M24 + value1.M33 * value2.M34 + value1.M34 * value2.M44; + + // Fourth row + result.M41 = value1.M41 * value2.M11 + value1.M42 * value2.M21 + value1.M43 * value2.M31 + value1.M44 * value2.M41; + result.M42 = value1.M41 * value2.M12 + value1.M42 * value2.M22 + value1.M43 * value2.M32 + value1.M44 * value2.M42; + result.M43 = value1.M41 * value2.M13 + value1.M42 * value2.M23 + value1.M43 * value2.M33 + value1.M44 * value2.M43; + result.M44 = value1.M41 * value2.M14 + value1.M42 * value2.M24 + value1.M43 * value2.M34 + value1.M44 * value2.M44; + + return result; + } + + /// + /// Multiplies a matrix by a scalar value. + /// + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix4x4 Multiply(Matrix4x4 value1, float value2) + { + Matrix4x4 result; + + result.M11 = value1.M11 * value2; + result.M12 = value1.M12 * value2; + result.M13 = value1.M13 * value2; + result.M14 = value1.M14 * value2; + result.M21 = value1.M21 * value2; + result.M22 = value1.M22 * value2; + result.M23 = value1.M23 * value2; + result.M24 = value1.M24 * value2; + result.M31 = value1.M31 * value2; + result.M32 = value1.M32 * value2; + result.M33 = value1.M33 * value2; + result.M34 = value1.M34 * value2; + result.M41 = value1.M41 * value2; + result.M42 = value1.M42 * value2; + result.M43 = value1.M43 * value2; + result.M44 = value1.M44 * value2; + + return result; + } + + /// + /// Returns a new matrix with the negated elements of the given matrix. + /// + /// The source matrix. + /// The negated matrix. + public static Matrix4x4 operator -(Matrix4x4 value) + { + Matrix4x4 m; + + m.M11 = -value.M11; + m.M12 = -value.M12; + m.M13 = -value.M13; + m.M14 = -value.M14; + m.M21 = -value.M21; + m.M22 = -value.M22; + m.M23 = -value.M23; + m.M24 = -value.M24; + m.M31 = -value.M31; + m.M32 = -value.M32; + m.M33 = -value.M33; + m.M34 = -value.M34; + m.M41 = -value.M41; + m.M42 = -value.M42; + m.M43 = -value.M43; + m.M44 = -value.M44; + + return m; + } + + /// + /// Adds two matrices together. + /// + /// The first source matrix. + /// The second source matrix. + /// The resulting matrix. + public static Matrix4x4 operator +(Matrix4x4 value1, Matrix4x4 value2) + { + Matrix4x4 m; + + m.M11 = value1.M11 + value2.M11; + m.M12 = value1.M12 + value2.M12; + m.M13 = value1.M13 + value2.M13; + m.M14 = value1.M14 + value2.M14; + m.M21 = value1.M21 + value2.M21; + m.M22 = value1.M22 + value2.M22; + m.M23 = value1.M23 + value2.M23; + m.M24 = value1.M24 + value2.M24; + m.M31 = value1.M31 + value2.M31; + m.M32 = value1.M32 + value2.M32; + m.M33 = value1.M33 + value2.M33; + m.M34 = value1.M34 + value2.M34; + m.M41 = value1.M41 + value2.M41; + m.M42 = value1.M42 + value2.M42; + m.M43 = value1.M43 + value2.M43; + m.M44 = value1.M44 + value2.M44; + + return m; + } + + /// + /// Subtracts the second matrix from the first. + /// + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix4x4 operator -(Matrix4x4 value1, Matrix4x4 value2) + { + Matrix4x4 m; + + m.M11 = value1.M11 - value2.M11; + m.M12 = value1.M12 - value2.M12; + m.M13 = value1.M13 - value2.M13; + m.M14 = value1.M14 - value2.M14; + m.M21 = value1.M21 - value2.M21; + m.M22 = value1.M22 - value2.M22; + m.M23 = value1.M23 - value2.M23; + m.M24 = value1.M24 - value2.M24; + m.M31 = value1.M31 - value2.M31; + m.M32 = value1.M32 - value2.M32; + m.M33 = value1.M33 - value2.M33; + m.M34 = value1.M34 - value2.M34; + m.M41 = value1.M41 - value2.M41; + m.M42 = value1.M42 - value2.M42; + m.M43 = value1.M43 - value2.M43; + m.M44 = value1.M44 - value2.M44; + + return m; + } + + /// + /// Multiplies a matrix by another matrix. + /// + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4x4 operator *(Matrix4x4 value1, Matrix4x4 value2) + { + Matrix4x4 m; + + // First row + m.M11 = value1.M11 * value2.M11 + value1.M12 * value2.M21 + value1.M13 * value2.M31 + value1.M14 * value2.M41; + m.M12 = value1.M11 * value2.M12 + value1.M12 * value2.M22 + value1.M13 * value2.M32 + value1.M14 * value2.M42; + m.M13 = value1.M11 * value2.M13 + value1.M12 * value2.M23 + value1.M13 * value2.M33 + value1.M14 * value2.M43; + m.M14 = value1.M11 * value2.M14 + value1.M12 * value2.M24 + value1.M13 * value2.M34 + value1.M14 * value2.M44; + + // Second row + m.M21 = value1.M21 * value2.M11 + value1.M22 * value2.M21 + value1.M23 * value2.M31 + value1.M24 * value2.M41; + m.M22 = value1.M21 * value2.M12 + value1.M22 * value2.M22 + value1.M23 * value2.M32 + value1.M24 * value2.M42; + m.M23 = value1.M21 * value2.M13 + value1.M22 * value2.M23 + value1.M23 * value2.M33 + value1.M24 * value2.M43; + m.M24 = value1.M21 * value2.M14 + value1.M22 * value2.M24 + value1.M23 * value2.M34 + value1.M24 * value2.M44; + + // Third row + m.M31 = value1.M31 * value2.M11 + value1.M32 * value2.M21 + value1.M33 * value2.M31 + value1.M34 * value2.M41; + m.M32 = value1.M31 * value2.M12 + value1.M32 * value2.M22 + value1.M33 * value2.M32 + value1.M34 * value2.M42; + m.M33 = value1.M31 * value2.M13 + value1.M32 * value2.M23 + value1.M33 * value2.M33 + value1.M34 * value2.M43; + m.M34 = value1.M31 * value2.M14 + value1.M32 * value2.M24 + value1.M33 * value2.M34 + value1.M34 * value2.M44; + + // Fourth row + m.M41 = value1.M41 * value2.M11 + value1.M42 * value2.M21 + value1.M43 * value2.M31 + value1.M44 * value2.M41; + m.M42 = value1.M41 * value2.M12 + value1.M42 * value2.M22 + value1.M43 * value2.M32 + value1.M44 * value2.M42; + m.M43 = value1.M41 * value2.M13 + value1.M42 * value2.M23 + value1.M43 * value2.M33 + value1.M44 * value2.M43; + m.M44 = value1.M41 * value2.M14 + value1.M42 * value2.M24 + value1.M43 * value2.M34 + value1.M44 * value2.M44; + + return m; + } + + /// + /// Multiplies a matrix by a scalar value. + /// + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix4x4 operator *(Matrix4x4 value1, float value2) + { + Matrix4x4 m; + + m.M11 = value1.M11 * value2; + m.M12 = value1.M12 * value2; + m.M13 = value1.M13 * value2; + m.M14 = value1.M14 * value2; + m.M21 = value1.M21 * value2; + m.M22 = value1.M22 * value2; + m.M23 = value1.M23 * value2; + m.M24 = value1.M24 * value2; + m.M31 = value1.M31 * value2; + m.M32 = value1.M32 * value2; + m.M33 = value1.M33 * value2; + m.M34 = value1.M34 * value2; + m.M41 = value1.M41 * value2; + m.M42 = value1.M42 * value2; + m.M43 = value1.M43 * value2; + m.M44 = value1.M44 * value2; + return m; + } + + /// + /// Returns a boolean indicating whether the given two matrices are equal. + /// + /// The first matrix to compare. + /// The second matrix to compare. + /// True if the given matrices are equal; False otherwise. + public static bool operator ==(Matrix4x4 value1, Matrix4x4 value2) + { + return (value1.M11 == value2.M11 && value1.M22 == value2.M22 && value1.M33 == value2.M33 && value1.M44 == value2.M44 && // Check diagonal element first for early out. + value1.M12 == value2.M12 && value1.M13 == value2.M13 && value1.M14 == value2.M14 && + value1.M21 == value2.M21 && value1.M23 == value2.M23 && value1.M24 == value2.M24 && + value1.M31 == value2.M31 && value1.M32 == value2.M32 && value1.M34 == value2.M34 && + value1.M41 == value2.M41 && value1.M42 == value2.M42 && value1.M43 == value2.M43); + } + + /// + /// Returns a boolean indicating whether the given two matrices are not equal. + /// + /// The first matrix to compare. + /// The second matrix to compare. + /// True if the given matrices are not equal; False if they are equal. + public static bool operator !=(Matrix4x4 value1, Matrix4x4 value2) + { + return (value1.M11 != value2.M11 || value1.M12 != value2.M12 || value1.M13 != value2.M13 || value1.M14 != value2.M14 || + value1.M21 != value2.M21 || value1.M22 != value2.M22 || value1.M23 != value2.M23 || value1.M24 != value2.M24 || + value1.M31 != value2.M31 || value1.M32 != value2.M32 || value1.M33 != value2.M33 || value1.M34 != value2.M34 || + value1.M41 != value2.M41 || value1.M42 != value2.M42 || value1.M43 != value2.M43 || value1.M44 != value2.M44); + } + + /// + /// Returns a boolean indicating whether this matrix instance is equal to the other given matrix. + /// + /// The matrix to compare this instance to. + /// True if the matrices are equal; False otherwise. + public bool Equals(Matrix4x4 other) + { + return (M11 == other.M11 && M22 == other.M22 && M33 == other.M33 && M44 == other.M44 && // Check diagonal element first for early out. + M12 == other.M12 && M13 == other.M13 && M14 == other.M14 && + M21 == other.M21 && M23 == other.M23 && M24 == other.M24 && + M31 == other.M31 && M32 == other.M32 && M34 == other.M34 && + M41 == other.M41 && M42 == other.M42 && M43 == other.M43); + } + + /// + /// Returns a boolean indicating whether the given Object is equal to this matrix instance. + /// + /// The Object to compare against. + /// True if the Object is equal to this matrix; False otherwise. + public override bool Equals(object obj) + { + if (obj is Matrix4x4) + { + return Equals((Matrix4x4)obj); + } + + return false; + } + + /// + /// Returns a String representing this matrix instance. + /// + /// The string representation. + public override string ToString() + { + CultureInfo ci = CultureInfo.CurrentCulture; + + return String.Format(ci, "{{ {{M11:{0} M12:{1} M13:{2} M14:{3}}} {{M21:{4} M22:{5} M23:{6} M24:{7}}} {{M31:{8} M32:{9} M33:{10} M34:{11}}} {{M41:{12} M42:{13} M43:{14} M44:{15}}} }}", + M11.ToString(ci), M12.ToString(ci), M13.ToString(ci), M14.ToString(ci), + M21.ToString(ci), M22.ToString(ci), M23.ToString(ci), M24.ToString(ci), + M31.ToString(ci), M32.ToString(ci), M33.ToString(ci), M34.ToString(ci), + M41.ToString(ci), M42.ToString(ci), M43.ToString(ci), M44.ToString(ci)); + } + + /// + /// Returns the hash code for this instance. + /// + /// The hash code. + public override int GetHashCode() + { + return M11.GetHashCode() + M12.GetHashCode() + M13.GetHashCode() + M14.GetHashCode() + + M21.GetHashCode() + M22.GetHashCode() + M23.GetHashCode() + M24.GetHashCode() + + M31.GetHashCode() + M32.GetHashCode() + M33.GetHashCode() + M34.GetHashCode() + + M41.GetHashCode() + M42.GetHashCode() + M43.GetHashCode() + M44.GetHashCode(); + } + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/Plane.cs b/external/referencesource/System.Numerics/System/Numerics/Plane.cs new file mode 100644 index 0000000000..e1747c39bc --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/Plane.cs @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Globalization; +using System.Runtime.CompilerServices; + +namespace System.Numerics +{ + /// + /// A structure encapsulating a 3D Plane + /// + public struct Plane : IEquatable + { + /// + /// The normal vector of the Plane. + /// + public Vector3 Normal; + /// + /// The distance of the Plane along its normal from the origin. + /// + public float D; + + /// + /// Constructs a Plane from the X, Y, and Z components of its normal, and its distance from the origin on that normal. + /// + /// The X-component of the normal. + /// The Y-component of the normal. + /// The Z-component of the normal. + /// The distance of the Plane along its normal from the origin. + public Plane(float x, float y, float z, float d) + { + Normal = new Vector3(x, y, z); + this.D = d; + } + + /// + /// Constructs a Plane from the given normal and distance along the normal from the origin. + /// + /// The Plane's normal vector. + /// The Plane's distance from the origin along its normal vector. + public Plane(Vector3 normal, float d) + { + this.Normal = normal; + this.D = d; + } + + /// + /// Constructs a Plane from the given Vector4. + /// + /// A vector whose first 3 elements describe the normal vector, + /// and whose W component defines the distance along that normal from the origin. + public Plane(Vector4 value) + { + Normal = new Vector3(value.X, value.Y, value.Z); + D = value.W; + } + + /// + /// Creates a Plane that contains the three given points. + /// + /// The first point defining the Plane. + /// The second point defining the Plane. + /// The third point defining the Plane. + /// The Plane containing the three points. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Plane CreateFromVertices(Vector3 point1, Vector3 point2, Vector3 point3) + { + if (Vector.IsHardwareAccelerated) + { + Vector3 a = point2 - point1; + Vector3 b = point3 - point1; + + // N = Cross(a, b) + Vector3 n = Vector3.Cross(a, b); + Vector3 normal = Vector3.Normalize(n); + + // D = - Dot(N, point1) + float d = -Vector3.Dot(normal, point1); + + return new Plane(normal, d); + } + else + { + float ax = point2.X - point1.X; + float ay = point2.Y - point1.Y; + float az = point2.Z - point1.Z; + + float bx = point3.X - point1.X; + float by = point3.Y - point1.Y; + float bz = point3.Z - point1.Z; + + // N=Cross(a,b) + float nx = ay * bz - az * by; + float ny = az * bx - ax * bz; + float nz = ax * by - ay * bx; + + // Normalize(N) + float ls = nx * nx + ny * ny + nz * nz; + float invNorm = 1.0f / (float)Math.Sqrt((double)ls); + + Vector3 normal = new Vector3( + nx * invNorm, + ny * invNorm, + nz * invNorm); + + return new Plane( + normal, + -(normal.X * point1.X + normal.Y * point1.Y + normal.Z * point1.Z)); + } + } + + /// + /// Creates a new Plane whose normal vector is the source Plane's normal vector normalized. + /// + /// The source Plane. + /// The normalized Plane. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Plane Normalize(Plane value) + { + const float FLT_EPSILON = 1.192092896e-07f; // smallest such that 1.0+FLT_EPSILON != 1.0 + if (Vector.IsHardwareAccelerated) + { + float normalLengthSquared = value.Normal.LengthSquared(); + if (Math.Abs(normalLengthSquared - 1.0f) < FLT_EPSILON) + { + // It already normalized, so we don't need to farther process. + return value; + } + float normalLength = (float)Math.Sqrt(normalLengthSquared); + return new Plane( + value.Normal / normalLength, + value.D / normalLength); + } + else + { + float f = value.Normal.X * value.Normal.X + value.Normal.Y * value.Normal.Y + value.Normal.Z * value.Normal.Z; + + if (Math.Abs(f - 1.0f) < FLT_EPSILON) + { + return value; // It already normalized, so we don't need to further process. + } + + float fInv = 1.0f / (float)Math.Sqrt(f); + + return new Plane( + value.Normal.X * fInv, + value.Normal.Y * fInv, + value.Normal.Z * fInv, + value.D * fInv); + } + } + + /// + /// Transforms a normalized Plane by a Matrix. + /// + /// The normalized Plane to transform. + /// This Plane must already be normalized, so that its Normal vector is of unit length, before this method is called. + /// The transformation matrix to apply to the Plane. + /// The transformed Plane. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Plane Transform(Plane plane, Matrix4x4 matrix) + { + Matrix4x4 m; + Matrix4x4.Invert(matrix, out m); + + float x = plane.Normal.X, y = plane.Normal.Y, z = plane.Normal.Z, w = plane.D; + + return new Plane( + x * m.M11 + y * m.M12 + z * m.M13 + w * m.M14, + x * m.M21 + y * m.M22 + z * m.M23 + w * m.M24, + x * m.M31 + y * m.M32 + z * m.M33 + w * m.M34, + x * m.M41 + y * m.M42 + z * m.M43 + w * m.M44); + } + + /// + /// Transforms a normalized Plane by a Quaternion rotation. + /// + /// The normalized Plane to transform. + /// This Plane must already be normalized, so that its Normal vector is of unit length, before this method is called. + /// The Quaternion rotation to apply to the Plane. + /// A new Plane that results from applying the rotation. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Plane Transform(Plane plane, Quaternion rotation) + { + // Compute rotation matrix. + float x2 = rotation.X + rotation.X; + float y2 = rotation.Y + rotation.Y; + float z2 = rotation.Z + rotation.Z; + + float wx2 = rotation.W * x2; + float wy2 = rotation.W * y2; + float wz2 = rotation.W * z2; + float xx2 = rotation.X * x2; + float xy2 = rotation.X * y2; + float xz2 = rotation.X * z2; + float yy2 = rotation.Y * y2; + float yz2 = rotation.Y * z2; + float zz2 = rotation.Z * z2; + + float m11 = 1.0f - yy2 - zz2; + float m21 = xy2 - wz2; + float m31 = xz2 + wy2; + + float m12 = xy2 + wz2; + float m22 = 1.0f - xx2 - zz2; + float m32 = yz2 - wx2; + + float m13 = xz2 - wy2; + float m23 = yz2 + wx2; + float m33 = 1.0f - xx2 - yy2; + + float x = plane.Normal.X, y = plane.Normal.Y, z = plane.Normal.Z; + + return new Plane( + x * m11 + y * m21 + z * m31, + x * m12 + y * m22 + z * m32, + x * m13 + y * m23 + z * m33, + plane.D); + } + + /// + /// Calculates the dot product of a Plane and Vector4. + /// + /// The Plane. + /// The Vector4. + /// The dot product. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Dot(Plane plane, Vector4 value) + { + return plane.Normal.X * value.X + + plane.Normal.Y * value.Y + + plane.Normal.Z * value.Z + + plane.D * value.W; + } + + /// + /// Returns the dot product of a specified Vector3 and the normal vector of this Plane plus the distance (D) value of the Plane. + /// + /// The plane. + /// The Vector3. + /// The resulting value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float DotCoordinate(Plane plane, Vector3 value) + { + if (Vector.IsHardwareAccelerated) + { + return Vector3.Dot(plane.Normal, value) + plane.D; + } + else + { + return plane.Normal.X * value.X + + plane.Normal.Y * value.Y + + plane.Normal.Z * value.Z + + plane.D; + } + } + + /// + /// Returns the dot product of a specified Vector3 and the Normal vector of this Plane. + /// + /// The plane. + /// The Vector3. + /// The resulting dot product. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float DotNormal(Plane plane, Vector3 value) + { + if (Vector.IsHardwareAccelerated) + { + return Vector3.Dot(plane.Normal, value); + } + else + { + return plane.Normal.X * value.X + + plane.Normal.Y * value.Y + + plane.Normal.Z * value.Z; + } + } + + /// + /// Returns a boolean indicating whether the two given Planes are equal. + /// + /// The first Plane to compare. + /// The second Plane to compare. + /// True if the Planes are equal; False otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Plane value1, Plane value2) + { + return (value1.Normal.X == value2.Normal.X && + value1.Normal.Y == value2.Normal.Y && + value1.Normal.Z == value2.Normal.Z && + value1.D == value2.D); + } + + /// + /// Returns a boolean indicating whether the two given Planes are not equal. + /// + /// The first Plane to compare. + /// The second Plane to compare. + /// True if the Planes are not equal; False if they are equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Plane value1, Plane value2) + { + return (value1.Normal.X != value2.Normal.X || + value1.Normal.Y != value2.Normal.Y || + value1.Normal.Z != value2.Normal.Z || + value1.D != value2.D); + } + + /// + /// Returns a boolean indicating whether the given Plane is equal to this Plane instance. + /// + /// The Plane to compare this instance to. + /// True if the other Plane is equal to this instance; False otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(Plane other) + { + if (Vector.IsHardwareAccelerated) + { + return this.Normal.Equals(other.Normal) && this.D == other.D; + } + else + { + return (Normal.X == other.Normal.X && + Normal.Y == other.Normal.Y && + Normal.Z == other.Normal.Z && + D == other.D); + } + } + + /// + /// Returns a boolean indicating whether the given Object is equal to this Plane instance. + /// + /// The Object to compare against. + /// True if the Object is equal to this Plane; False otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object obj) + { + if (obj is Plane) + { + return Equals((Plane)obj); + } + + return false; + } + + /// + /// Returns a String representing this Plane instance. + /// + /// The string representation. + public override string ToString() + { + CultureInfo ci = CultureInfo.CurrentCulture; + + return String.Format(ci, "{{Normal:{0} D:{1}}}", Normal.ToString(), D.ToString(ci)); + } + + /// + /// Returns the hash code for this instance. + /// + /// The hash code. + public override int GetHashCode() + { + return Normal.GetHashCode() + D.GetHashCode(); + } + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/Quaternion.cs b/external/referencesource/System.Numerics/System/Numerics/Quaternion.cs new file mode 100644 index 0000000000..75f6c32f31 --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/Quaternion.cs @@ -0,0 +1,792 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Globalization; + +namespace System.Numerics +{ + /// + /// A structure encapsulating a four-dimensional vector (x,y,z,w), + /// which is used to efficiently rotate an object about the (x,y,z) vector by the angle theta, where w = cos(theta/2). + /// + public struct Quaternion : IEquatable + { + /// + /// Specifies the X-value of the vector component of the Quaternion. + /// + public float X; + /// + /// Specifies the Y-value of the vector component of the Quaternion. + /// + public float Y; + /// + /// Specifies the Z-value of the vector component of the Quaternion. + /// + public float Z; + /// + /// Specifies the rotation component of the Quaternion. + /// + public float W; + + /// + /// Returns a Quaternion representing no rotation. + /// + public static Quaternion Identity + { + get { return new Quaternion(0, 0, 0, 1); } + } + + /// + /// Returns whether the Quaternion is the identity Quaternion. + /// + public bool IsIdentity + { + get { return X == 0f && Y == 0f && Z == 0f && W == 1f; } + } + + /// + /// Constructs a Quaternion from the given components. + /// + /// The X component of the Quaternion. + /// The Y component of the Quaternion. + /// The Z component of the Quaternion. + /// The W component of the Quaternion. + public Quaternion(float x, float y, float z, float w) + { + this.X = x; + this.Y = y; + this.Z = z; + this.W = w; + } + + /// + /// Constructs a Quaternion from the given vector and rotation parts. + /// + /// The vector part of the Quaternion. + /// The rotation part of the Quaternion. + public Quaternion(Vector3 vectorPart, float scalarPart) + { + X = vectorPart.X; + Y = vectorPart.Y; + Z = vectorPart.Z; + W = scalarPart; + } + + /// + /// Calculates the length of the Quaternion. + /// + /// The computed length of the Quaternion. + public float Length() + { + float ls = X * X + Y * Y + Z * Z + W * W; + + return (float)Math.Sqrt((double)ls); + } + + /// + /// Calculates the length squared of the Quaternion. This operation is cheaper than Length(). + /// + /// The length squared of the Quaternion. + public float LengthSquared() + { + return X * X + Y * Y + Z * Z + W * W; + } + + /// + /// Divides each component of the Quaternion by the length of the Quaternion. + /// + /// The source Quaternion. + /// The normalized Quaternion. + public static Quaternion Normalize(Quaternion value) + { + Quaternion ans; + + float ls = value.X * value.X + value.Y * value.Y + value.Z * value.Z + value.W * value.W; + + float invNorm = 1.0f / (float)Math.Sqrt((double)ls); + + ans.X = value.X * invNorm; + ans.Y = value.Y * invNorm; + ans.Z = value.Z * invNorm; + ans.W = value.W * invNorm; + + return ans; + } + + /// + /// Creates the conjugate of a specified Quaternion. + /// + /// The Quaternion of which to return the conjugate. + /// A new Quaternion that is the conjugate of the specified one. + public static Quaternion Conjugate(Quaternion value) + { + Quaternion ans; + + ans.X = -value.X; + ans.Y = -value.Y; + ans.Z = -value.Z; + ans.W = value.W; + + return ans; + } + + /// + /// Returns the inverse of a Quaternion. + /// + /// The source Quaternion. + /// The inverted Quaternion. + public static Quaternion Inverse(Quaternion value) + { + // -1 ( a -v ) + // q = ( ------------- ------------- ) + // ( a^2 + |v|^2 , a^2 + |v|^2 ) + + Quaternion ans; + + float ls = value.X * value.X + value.Y * value.Y + value.Z * value.Z + value.W * value.W; + float invNorm = 1.0f / ls; + + ans.X = -value.X * invNorm; + ans.Y = -value.Y * invNorm; + ans.Z = -value.Z * invNorm; + ans.W = value.W * invNorm; + + return ans; + } + + /// + /// Creates a Quaternion from a vector and an angle to rotate about the vector. + /// + /// The vector to rotate around. + /// The angle, in radians, to rotate around the vector. + /// The created Quaternion. + public static Quaternion CreateFromAxisAngle(Vector3 axis, float angle) + { + Quaternion ans; + + float halfAngle = angle * 0.5f; + float s = (float)Math.Sin(halfAngle); + float c = (float)Math.Cos(halfAngle); + + ans.X = axis.X * s; + ans.Y = axis.Y * s; + ans.Z = axis.Z * s; + ans.W = c; + + return ans; + } + + /// + /// Creates a new Quaternion from the given yaw, pitch, and roll, in radians. + /// + /// The yaw angle, in radians, around the Y-axis. + /// The pitch angle, in radians, around the X-axis. + /// The roll angle, in radians, around the Z-axis. + /// + public static Quaternion CreateFromYawPitchRoll(float yaw, float pitch, float roll) + { + // Roll first, about axis the object is facing, then + // pitch upward, then yaw to face into the new heading + float sr, cr, sp, cp, sy, cy; + + float halfRoll = roll * 0.5f; + sr = (float)Math.Sin(halfRoll); + cr = (float)Math.Cos(halfRoll); + + float halfPitch = pitch * 0.5f; + sp = (float)Math.Sin(halfPitch); + cp = (float)Math.Cos(halfPitch); + + float halfYaw = yaw * 0.5f; + sy = (float)Math.Sin(halfYaw); + cy = (float)Math.Cos(halfYaw); + + Quaternion result; + + result.X = cy * sp * cr + sy * cp * sr; + result.Y = sy * cp * cr - cy * sp * sr; + result.Z = cy * cp * sr - sy * sp * cr; + result.W = cy * cp * cr + sy * sp * sr; + + return result; + } + + /// + /// Creates a Quaternion from the given rotation matrix. + /// + /// The rotation matrix. + /// The created Quaternion. + public static Quaternion CreateFromRotationMatrix(Matrix4x4 matrix) + { + float trace = matrix.M11 + matrix.M22 + matrix.M33; + + Quaternion q = new Quaternion(); + + if (trace > 0.0f) + { + float s = (float)Math.Sqrt(trace + 1.0f); + q.W = s * 0.5f; + s = 0.5f / s; + q.X = (matrix.M23 - matrix.M32) * s; + q.Y = (matrix.M31 - matrix.M13) * s; + q.Z = (matrix.M12 - matrix.M21) * s; + } + else + { + if (matrix.M11 >= matrix.M22 && matrix.M11 >= matrix.M33) + { + float s = (float)Math.Sqrt(1.0f + matrix.M11 - matrix.M22 - matrix.M33); + float invS = 0.5f / s; + q.X = 0.5f * s; + q.Y = (matrix.M12 + matrix.M21) * invS; + q.Z = (matrix.M13 + matrix.M31) * invS; + q.W = (matrix.M23 - matrix.M32) * invS; + } + else if (matrix.M22 > matrix.M33) + { + float s = (float)Math.Sqrt(1.0f + matrix.M22 - matrix.M11 - matrix.M33); + float invS = 0.5f / s; + q.X = (matrix.M21 + matrix.M12) * invS; + q.Y = 0.5f * s; + q.Z = (matrix.M32 + matrix.M23) * invS; + q.W = (matrix.M31 - matrix.M13) * invS; + } + else + { + float s = (float)Math.Sqrt(1.0f + matrix.M33 - matrix.M11 - matrix.M22); + float invS = 0.5f / s; + q.X = (matrix.M31 + matrix.M13) * invS; + q.Y = (matrix.M32 + matrix.M23) * invS; + q.Z = 0.5f * s; + q.W = (matrix.M12 - matrix.M21) * invS; + } + } + + return q; + } + + /// + /// Calculates the dot product of two Quaternions. + /// + /// The first source Quaternion. + /// The second source Quaternion. + /// The dot product of the Quaternions. + public static float Dot(Quaternion quaternion1, Quaternion quaternion2) + { + return quaternion1.X * quaternion2.X + + quaternion1.Y * quaternion2.Y + + quaternion1.Z * quaternion2.Z + + quaternion1.W * quaternion2.W; + } + + /// + /// Interpolates between two quaternions, using spherical linear interpolation. + /// + /// The first source Quaternion. + /// The second source Quaternion. + /// The relative weight of the second source Quaternion in the interpolation. + /// The interpolated Quaternion. + public static Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, float amount) + { + const float epsilon = 1e-6f; + + float t = amount; + + float cosOmega = quaternion1.X * quaternion2.X + quaternion1.Y * quaternion2.Y + + quaternion1.Z * quaternion2.Z + quaternion1.W * quaternion2.W; + + bool flip = false; + + if (cosOmega < 0.0f) + { + flip = true; + cosOmega = -cosOmega; + } + + float s1, s2; + + if (cosOmega > (1.0f - epsilon)) + { + // Too close, do straight linear interpolation. + s1 = 1.0f - t; + s2 = (flip) ? -t : t; + } + else + { + float omega = (float)Math.Acos(cosOmega); + float invSinOmega = (float)(1 / Math.Sin(omega)); + + s1 = (float)Math.Sin((1.0f - t) * omega) * invSinOmega; + s2 = (flip) + ? (float)-Math.Sin(t * omega) * invSinOmega + : (float)Math.Sin(t * omega) * invSinOmega; + } + + Quaternion ans; + + ans.X = s1 * quaternion1.X + s2 * quaternion2.X; + ans.Y = s1 * quaternion1.Y + s2 * quaternion2.Y; + ans.Z = s1 * quaternion1.Z + s2 * quaternion2.Z; + ans.W = s1 * quaternion1.W + s2 * quaternion2.W; + + return ans; + } + + /// + /// Linearly interpolates between two quaternions. + /// + /// The first source Quaternion. + /// The second source Quaternion. + /// The relative weight of the second source Quaternion in the interpolation. + /// The interpolated Quaternion. + public static Quaternion Lerp(Quaternion quaternion1, Quaternion quaternion2, float amount) + { + float t = amount; + float t1 = 1.0f - t; + + Quaternion r = new Quaternion(); + + float dot = quaternion1.X * quaternion2.X + quaternion1.Y * quaternion2.Y + + quaternion1.Z * quaternion2.Z + quaternion1.W * quaternion2.W; + + if (dot >= 0.0f) + { + r.X = t1 * quaternion1.X + t * quaternion2.X; + r.Y = t1 * quaternion1.Y + t * quaternion2.Y; + r.Z = t1 * quaternion1.Z + t * quaternion2.Z; + r.W = t1 * quaternion1.W + t * quaternion2.W; + } + else + { + r.X = t1 * quaternion1.X - t * quaternion2.X; + r.Y = t1 * quaternion1.Y - t * quaternion2.Y; + r.Z = t1 * quaternion1.Z - t * quaternion2.Z; + r.W = t1 * quaternion1.W - t * quaternion2.W; + } + + // Normalize it. + float ls = r.X * r.X + r.Y * r.Y + r.Z * r.Z + r.W * r.W; + float invNorm = 1.0f / (float)Math.Sqrt((double)ls); + + r.X *= invNorm; + r.Y *= invNorm; + r.Z *= invNorm; + r.W *= invNorm; + + return r; + } + + /// + /// Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation. + /// + /// The first Quaternion rotation in the series. + /// The second Quaternion rotation in the series. + /// A new Quaternion representing the concatenation of the value1 rotation followed by the value2 rotation. + public static Quaternion Concatenate(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + // Concatenate rotation is actually q2 * q1 instead of q1 * q2. + // So that's why value2 goes q1 and value1 goes q2. + float q1x = value2.X; + float q1y = value2.Y; + float q1z = value2.Z; + float q1w = value2.W; + + float q2x = value1.X; + float q2y = value1.Y; + float q2z = value1.Z; + float q2w = value1.W; + + // cross(av, bv) + float cx = q1y * q2z - q1z * q2y; + float cy = q1z * q2x - q1x * q2z; + float cz = q1x * q2y - q1y * q2x; + + float dot = q1x * q2x + q1y * q2y + q1z * q2z; + + ans.X = q1x * q2w + q2x * q1w + cx; + ans.Y = q1y * q2w + q2y * q1w + cy; + ans.Z = q1z * q2w + q2z * q1w + cz; + ans.W = q1w * q2w - dot; + + return ans; + } + + /// + /// Flips the sign of each component of the quaternion. + /// + /// The source Quaternion. + /// The negated Quaternion. + public static Quaternion Negate(Quaternion value) + { + Quaternion ans; + + ans.X = -value.X; + ans.Y = -value.Y; + ans.Z = -value.Z; + ans.W = -value.W; + + return ans; + } + + /// + /// Adds two Quaternions element-by-element. + /// + /// The first source Quaternion. + /// The second source Quaternion. + /// The result of adding the Quaternions. + public static Quaternion Add(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + ans.X = value1.X + value2.X; + ans.Y = value1.Y + value2.Y; + ans.Z = value1.Z + value2.Z; + ans.W = value1.W + value2.W; + + return ans; + } + + /// + /// Subtracts one Quaternion from another. + /// + /// The first source Quaternion. + /// The second Quaternion, to be subtracted from the first. + /// The result of the subtraction. + public static Quaternion Subtract(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + ans.X = value1.X - value2.X; + ans.Y = value1.Y - value2.Y; + ans.Z = value1.Z - value2.Z; + ans.W = value1.W - value2.W; + + return ans; + } + + /// + /// Multiplies two Quaternions together. + /// + /// The Quaternion on the left side of the multiplication. + /// The Quaternion on the right side of the multiplication. + /// The result of the multiplication. + public static Quaternion Multiply(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + float q1x = value1.X; + float q1y = value1.Y; + float q1z = value1.Z; + float q1w = value1.W; + + float q2x = value2.X; + float q2y = value2.Y; + float q2z = value2.Z; + float q2w = value2.W; + + // cross(av, bv) + float cx = q1y * q2z - q1z * q2y; + float cy = q1z * q2x - q1x * q2z; + float cz = q1x * q2y - q1y * q2x; + + float dot = q1x * q2x + q1y * q2y + q1z * q2z; + + ans.X = q1x * q2w + q2x * q1w + cx; + ans.Y = q1y * q2w + q2y * q1w + cy; + ans.Z = q1z * q2w + q2z * q1w + cz; + ans.W = q1w * q2w - dot; + + return ans; + } + + /// + /// Multiplies a Quaternion by a scalar value. + /// + /// The source Quaternion. + /// The scalar value. + /// The result of the multiplication. + public static Quaternion Multiply(Quaternion value1, float value2) + { + Quaternion ans; + + ans.X = value1.X * value2; + ans.Y = value1.Y * value2; + ans.Z = value1.Z * value2; + ans.W = value1.W * value2; + + return ans; + } + + /// + /// Divides a Quaternion by another Quaternion. + /// + /// The source Quaternion. + /// The divisor. + /// The result of the division. + public static Quaternion Divide(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + float q1x = value1.X; + float q1y = value1.Y; + float q1z = value1.Z; + float q1w = value1.W; + + //------------------------------------- + // Inverse part. + float ls = value2.X * value2.X + value2.Y * value2.Y + + value2.Z * value2.Z + value2.W * value2.W; + float invNorm = 1.0f / ls; + + float q2x = -value2.X * invNorm; + float q2y = -value2.Y * invNorm; + float q2z = -value2.Z * invNorm; + float q2w = value2.W * invNorm; + + //------------------------------------- + // Multiply part. + + // cross(av, bv) + float cx = q1y * q2z - q1z * q2y; + float cy = q1z * q2x - q1x * q2z; + float cz = q1x * q2y - q1y * q2x; + + float dot = q1x * q2x + q1y * q2y + q1z * q2z; + + ans.X = q1x * q2w + q2x * q1w + cx; + ans.Y = q1y * q2w + q2y * q1w + cy; + ans.Z = q1z * q2w + q2z * q1w + cz; + ans.W = q1w * q2w - dot; + + return ans; + } + + /// + /// Flips the sign of each component of the quaternion. + /// + /// The source Quaternion. + /// The negated Quaternion. + public static Quaternion operator -(Quaternion value) + { + Quaternion ans; + + ans.X = -value.X; + ans.Y = -value.Y; + ans.Z = -value.Z; + ans.W = -value.W; + + return ans; + } + + /// + /// Adds two Quaternions element-by-element. + /// + /// The first source Quaternion. + /// The second source Quaternion. + /// The result of adding the Quaternions. + public static Quaternion operator +(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + ans.X = value1.X + value2.X; + ans.Y = value1.Y + value2.Y; + ans.Z = value1.Z + value2.Z; + ans.W = value1.W + value2.W; + + return ans; + } + + /// + /// Subtracts one Quaternion from another. + /// + /// The first source Quaternion. + /// The second Quaternion, to be subtracted from the first. + /// The result of the subtraction. + public static Quaternion operator -(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + ans.X = value1.X - value2.X; + ans.Y = value1.Y - value2.Y; + ans.Z = value1.Z - value2.Z; + ans.W = value1.W - value2.W; + + return ans; + } + + /// + /// Multiplies two Quaternions together. + /// + /// The Quaternion on the left side of the multiplication. + /// The Quaternion on the right side of the multiplication. + /// The result of the multiplication. + public static Quaternion operator *(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + float q1x = value1.X; + float q1y = value1.Y; + float q1z = value1.Z; + float q1w = value1.W; + + float q2x = value2.X; + float q2y = value2.Y; + float q2z = value2.Z; + float q2w = value2.W; + + // cross(av, bv) + float cx = q1y * q2z - q1z * q2y; + float cy = q1z * q2x - q1x * q2z; + float cz = q1x * q2y - q1y * q2x; + + float dot = q1x * q2x + q1y * q2y + q1z * q2z; + + ans.X = q1x * q2w + q2x * q1w + cx; + ans.Y = q1y * q2w + q2y * q1w + cy; + ans.Z = q1z * q2w + q2z * q1w + cz; + ans.W = q1w * q2w - dot; + + return ans; + } + + /// + /// Multiplies a Quaternion by a scalar value. + /// + /// The source Quaternion. + /// The scalar value. + /// The result of the multiplication. + public static Quaternion operator *(Quaternion value1, float value2) + { + Quaternion ans; + + ans.X = value1.X * value2; + ans.Y = value1.Y * value2; + ans.Z = value1.Z * value2; + ans.W = value1.W * value2; + + return ans; + } + + /// + /// Divides a Quaternion by another Quaternion. + /// + /// The source Quaternion. + /// The divisor. + /// The result of the division. + public static Quaternion operator /(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + float q1x = value1.X; + float q1y = value1.Y; + float q1z = value1.Z; + float q1w = value1.W; + + //------------------------------------- + // Inverse part. + float ls = value2.X * value2.X + value2.Y * value2.Y + + value2.Z * value2.Z + value2.W * value2.W; + float invNorm = 1.0f / ls; + + float q2x = -value2.X * invNorm; + float q2y = -value2.Y * invNorm; + float q2z = -value2.Z * invNorm; + float q2w = value2.W * invNorm; + + //------------------------------------- + // Multiply part. + + // cross(av, bv) + float cx = q1y * q2z - q1z * q2y; + float cy = q1z * q2x - q1x * q2z; + float cz = q1x * q2y - q1y * q2x; + + float dot = q1x * q2x + q1y * q2y + q1z * q2z; + + ans.X = q1x * q2w + q2x * q1w + cx; + ans.Y = q1y * q2w + q2y * q1w + cy; + ans.Z = q1z * q2w + q2z * q1w + cz; + ans.W = q1w * q2w - dot; + + return ans; + } + + /// + /// Returns a boolean indicating whether the two given Quaternions are equal. + /// + /// The first Quaternion to compare. + /// The second Quaternion to compare. + /// True if the Quaternions are equal; False otherwise. + public static bool operator ==(Quaternion value1, Quaternion value2) + { + return (value1.X == value2.X && + value1.Y == value2.Y && + value1.Z == value2.Z && + value1.W == value2.W); + } + + /// + /// Returns a boolean indicating whether the two given Quaternions are not equal. + /// + /// The first Quaternion to compare. + /// The second Quaternion to compare. + /// True if the Quaternions are not equal; False if they are equal. + public static bool operator !=(Quaternion value1, Quaternion value2) + { + return (value1.X != value2.X || + value1.Y != value2.Y || + value1.Z != value2.Z || + value1.W != value2.W); + } + + /// + /// Returns a boolean indicating whether the given Quaternion is equal to this Quaternion instance. + /// + /// The Quaternion to compare this instance to. + /// True if the other Quaternion is equal to this instance; False otherwise. + public bool Equals(Quaternion other) + { + return (X == other.X && + Y == other.Y && + Z == other.Z && + W == other.W); + } + + /// + /// Returns a boolean indicating whether the given Object is equal to this Quaternion instance. + /// + /// The Object to compare against. + /// True if the Object is equal to this Quaternion; False otherwise. + public override bool Equals(object obj) + { + if (obj is Quaternion) + { + return Equals((Quaternion)obj); + } + + return false; + } + + /// + /// Returns a String representing this Quaternion instance. + /// + /// The string representation. + public override string ToString() + { + CultureInfo ci = CultureInfo.CurrentCulture; + + return String.Format(ci, "{{X:{0} Y:{1} Z:{2} W:{3}}}", X.ToString(ci), Y.ToString(ci), Z.ToString(ci), W.ToString(ci)); + } + + /// + /// Returns the hash code for this instance. + /// + /// The hash code. + public override int GetHashCode() + { + return X.GetHashCode() + Y.GetHashCode() + Z.GetHashCode() + W.GetHashCode(); + } + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/Vector2.cs b/external/referencesource/System.Numerics/System/Numerics/Vector2.cs new file mode 100644 index 0000000000..1702c846a9 --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/Vector2.cs @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Globalization; +using System.Runtime.CompilerServices; +using System.Text; + +namespace System.Numerics +{ + /// + /// A structure encapsulating two single precision floating point values and provides hardware accelerated methods. + /// + public partial struct Vector2 : IEquatable, IFormattable + { + #region Public Static Properties + /// + /// Returns the vector (0,0). + /// + public static Vector2 Zero { get { return new Vector2(); } } + /// + /// Returns the vector (1,1). + /// + public static Vector2 One { get { return new Vector2(1.0f, 1.0f); } } + /// + /// Returns the vector (1,0). + /// + public static Vector2 UnitX { get { return new Vector2(1.0f, 0.0f); } } + /// + /// Returns the vector (0,1). + /// + public static Vector2 UnitY { get { return new Vector2(0.0f, 1.0f); } } + #endregion Public Static Properties + + #region Public instance methods + /// + /// Returns the hash code for this instance. + /// + /// The hash code. + public override int GetHashCode() + { + int hash = this.X.GetHashCode(); + hash = HashCodeHelper.CombineHashCodes(hash, this.Y.GetHashCode()); + return hash; + } + + /// + /// Returns a boolean indicating whether the given Object is equal to this Vector2 instance. + /// + /// The Object to compare against. + /// True if the Object is equal to this Vector2; False otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object obj) + { + if (!(obj is Vector2)) + return false; + return Equals((Vector2)obj); + } + + /// + /// Returns a String representing this Vector2 instance. + /// + /// The string representation. + public override string ToString() + { + return ToString("G", CultureInfo.CurrentCulture); + } + + /// + /// Returns a String representing this Vector2 instance, using the specified format to format individual elements. + /// + /// The format of individual elements. + /// The string representation. + public string ToString(string format) + { + return ToString(format, CultureInfo.CurrentCulture); + } + + /// + /// Returns a String representing this Vector2 instance, using the specified format to format individual elements + /// and the given IFormatProvider. + /// + /// The format of individual elements. + /// The format provider to use when formatting elements. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + StringBuilder sb = new StringBuilder(); + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + sb.Append('<'); + sb.Append(this.X.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.Y.ToString(format, formatProvider)); + sb.Append('>'); + return sb.ToString(); + } + + /// + /// Returns the length of the vector. + /// + /// The vector's length. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Length() + { + if (Vector.IsHardwareAccelerated) + { + float ls = Vector2.Dot(this, this); + return (float)Math.Sqrt(ls); + } + else + { + float ls = X * X + Y * Y; + return (float)Math.Sqrt((double)ls); + } + } + + /// + /// Returns the length of the vector squared. This operation is cheaper than Length(). + /// + /// The vector's length squared. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float LengthSquared() + { + if (Vector.IsHardwareAccelerated) + { + return Vector2.Dot(this, this); + } + else + { + return X * X + Y * Y; + } + } + #endregion Public Instance Methods + + #region Public Static Methods + /// + /// Returns the Euclidean distance between the two given points. + /// + /// The first point. + /// The second point. + /// The distance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Distance(Vector2 value1, Vector2 value2) + { + if (Vector.IsHardwareAccelerated) + { + Vector2 difference = value1 - value2; + float ls = Vector2.Dot(difference, difference); + return (float)System.Math.Sqrt(ls); + } + else + { + float dx = value1.X - value2.X; + float dy = value1.Y - value2.Y; + + float ls = dx * dx + dy * dy; + + return (float)Math.Sqrt((double)ls); + } + } + + /// + /// Returns the Euclidean distance squared between the two given points. + /// + /// The first point. + /// The second point. + /// The distance squared. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float DistanceSquared(Vector2 value1, Vector2 value2) + { + if (Vector.IsHardwareAccelerated) + { + Vector2 difference = value1 - value2; + return Vector2.Dot(difference, difference); + } + else + { + float dx = value1.X - value2.X; + float dy = value1.Y - value2.Y; + + return dx * dx + dy * dy; + } + } + + /// + /// Returns a vector with the same direction as the given vector, but with a length of 1. + /// + /// The vector to normalize. + /// The normalized vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Normalize(Vector2 value) + { + if (Vector.IsHardwareAccelerated) + { + float length = value.Length(); + return value / length; + } + else + { + float ls = value.X * value.X + value.Y * value.Y; + float invNorm = 1.0f / (float)Math.Sqrt((double)ls); + + return new Vector2( + value.X * invNorm, + value.Y * invNorm); + } + } + + /// + /// Returns the reflection of a vector off a surface that has the specified normal. + /// + /// The source vector. + /// The normal of the surface being reflected off. + /// The reflected vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Reflect(Vector2 vector, Vector2 normal) + { + if (Vector.IsHardwareAccelerated) + { + float dot = Vector2.Dot(vector, normal); + return vector - (2 * dot * normal); + } + else + { + float dot = vector.X * normal.X + vector.Y * normal.Y; + + return new Vector2( + vector.X - 2.0f * dot * normal.X, + vector.Y - 2.0f * dot * normal.Y); + } + } + + /// + /// Restricts a vector between a min and max value. + /// + /// The source vector. + /// The minimum value. + /// The maximum value. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max) + { + // This compare order is very important!!! + // We must follow HLSL behavior in the case user specified min value is bigger than max value. + float x = value1.X; + x = (x > max.X) ? max.X : x; + x = (x < min.X) ? min.X : x; + + float y = value1.Y; + y = (y > max.Y) ? max.Y : y; + y = (y < min.Y) ? min.Y : y; + + return new Vector2(x, y); + } + + /// + /// Linearly interpolates between two vectors based on the given weighting. + /// + /// The first source vector. + /// The second source vector. + /// Value between 0 and 1 indicating the weight of the second source vector. + /// The interpolated vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount) + { + return new Vector2( + value1.X + (value2.X - value1.X) * amount, + value1.Y + (value2.Y - value1.Y) * amount); + } + + /// + /// Transforms a vector by the given matrix. + /// + /// The source vector. + /// The transformation matrix. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Transform(Vector2 position, Matrix3x2 matrix) + { + return new Vector2( + position.X * matrix.M11 + position.Y * matrix.M21 + matrix.M31, + position.X * matrix.M12 + position.Y * matrix.M22 + matrix.M32); + } + + /// + /// Transforms a vector by the given matrix. + /// + /// The source vector. + /// The transformation matrix. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Transform(Vector2 position, Matrix4x4 matrix) + { + return new Vector2( + position.X * matrix.M11 + position.Y * matrix.M21 + matrix.M41, + position.X * matrix.M12 + position.Y * matrix.M22 + matrix.M42); + } + + /// + /// Transforms a vector normal by the given matrix. + /// + /// The source vector. + /// The transformation matrix. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 TransformNormal(Vector2 normal, Matrix3x2 matrix) + { + return new Vector2( + normal.X * matrix.M11 + normal.Y * matrix.M21, + normal.X * matrix.M12 + normal.Y * matrix.M22); + } + + /// + /// Transforms a vector normal by the given matrix. + /// + /// The source vector. + /// The transformation matrix. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 TransformNormal(Vector2 normal, Matrix4x4 matrix) + { + return new Vector2( + normal.X * matrix.M11 + normal.Y * matrix.M21, + normal.X * matrix.M12 + normal.Y * matrix.M22); + } + + /// + /// Transforms a vector by the given Quaternion rotation value. + /// + /// The source vector to be rotated. + /// The rotation to apply. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Transform(Vector2 value, Quaternion rotation) + { + float x2 = rotation.X + rotation.X; + float y2 = rotation.Y + rotation.Y; + float z2 = rotation.Z + rotation.Z; + + float wz2 = rotation.W * z2; + float xx2 = rotation.X * x2; + float xy2 = rotation.X * y2; + float yy2 = rotation.Y * y2; + float zz2 = rotation.Z * z2; + + return new Vector2( + value.X * (1.0f - yy2 - zz2) + value.Y * (xy2 - wz2), + value.X * (xy2 + wz2) + value.Y * (1.0f - xx2 - zz2)); + } + #endregion Public Static Methods + + #region Public operator methods + // all the below methods should be inlined as they are + // implemented over JIT intrinsics + + /// + /// Adds two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The summed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Add(Vector2 left, Vector2 right) + { + return left + right; + } + + /// + /// Subtracts the second vector from the first. + /// + /// The first source vector. + /// The second source vector. + /// The difference vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Subtract(Vector2 left, Vector2 right) + { + return left - right; + } + + /// + /// Multiplies two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The product vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Multiply(Vector2 left, Vector2 right) + { + return left * right; + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The scaled vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Multiply(Vector2 left, Single right) + { + return left * right; + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The scalar value. + /// The source vector. + /// The scaled vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Multiply(Single left, Vector2 right) + { + return left * right; + } + + /// + /// Divides the first vector by the second. + /// + /// The first source vector. + /// The second source vector. + /// The vector resulting from the division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Divide(Vector2 left, Vector2 right) + { + return left / right; + } + + /// + /// Divides the vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The result of the division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Divide(Vector2 left, Single divisor) + { + return left / divisor; + } + + /// + /// Negates a given vector. + /// + /// The source vector. + /// The negated vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Negate(Vector2 value) + { + return -value; + } + #endregion Public operator methods + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/Vector2_Intrinsics.cs b/external/referencesource/System.Numerics/System/Numerics/Vector2_Intrinsics.cs new file mode 100644 index 0000000000..cd526bd34c --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/Vector2_Intrinsics.cs @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Runtime.CompilerServices; + +namespace System.Numerics +{ + // This file contains the definitions for all of the JIT intrinsic methods and properties that are recognized by the current x64 JIT compiler. + // The implementation defined here is used in any circumstance where the JIT fails to recognize these members as intrinsic. + // The JIT recognizes these methods and properties by name and signature: if either is changed, the JIT will no longer recognize the member. + // Some methods declared here are not strictly intrinsic, but delegate to an intrinsic method. For example, only one overload of CopyTo() + + public partial struct Vector2 + { + /// + /// The X component of the vector. + /// + public Single X; + /// + /// The Y component of the vector. + /// + public Single Y; + + #region Constructors + /// + /// Constructs a vector whose elements are all the single specified value. + /// + /// The element to fill the vector with. + [JitIntrinsic] + public Vector2(Single value) : this(value, value) { } + + /// + /// Constructs a vector with the given individual elements. + /// + /// The X component. + /// The Y component. + [JitIntrinsic] + public Vector2(Single x, Single y) + { + X = x; + Y = y; + } + #endregion Constructors + + #region Public Instance Methods + /// + /// Copies the contents of the vector into the given array. + /// + /// The destination array. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTo(Single[] array) + { + CopyTo(array, 0); + } + + /// + /// Copies the contents of the vector into the given array, starting from the given index. + /// + /// If array is null. + /// If array is multidimensional. + /// If index is greater than end of the array or index is less than zero. + /// If number of elements in source vector is greater than those available in destination array + /// or if there are not enough elements to copy. + public void CopyTo(Single[] array, int index) + { + if (array == null) + { + // Match the JIT's exception type here. For perf, a NullReference is thrown instead of an ArgumentNull. + throw new NullReferenceException(SR.GetString("Arg_NullArgumentNullRef")); + } + if (index < 0 || index >= array.Length) + { + throw new ArgumentOutOfRangeException(SR.GetString("Arg_ArgumentOutOfRangeException", index)); + } + if ((array.Length - index) < 2) + { + throw new ArgumentException(SR.GetString("Arg_ElementsInSourceIsGreaterThanDestination", index)); + } + array[index] = X; + array[index + 1] = Y; + } + + /// + /// Returns a boolean indicating whether the given Vector2 is equal to this Vector2 instance. + /// + /// The Vector2 to compare this instance to. + /// True if the other Vector2 is equal to this instance; False otherwise. + [JitIntrinsic] + public bool Equals(Vector2 other) + { + return this.X == other.X && this.Y == other.Y; + } + #endregion Public Instance Methods + + #region Public Static Methods + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Dot(Vector2 value1, Vector2 value2) + { + return value1.X * value2.X + + value1.Y * value2.Y; + } + + /// + /// Returns a vector whose elements are the minimum of each of the pairs of elements in the two source vectors. + /// + /// The first source vector. + /// The second source vector. + /// The minimized vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Min(Vector2 value1, Vector2 value2) + { + return new Vector2( + (value1.X < value2.X) ? value1.X : value2.X, + (value1.Y < value2.Y) ? value1.Y : value2.Y); + } + + /// + /// Returns a vector whose elements are the maximum of each of the pairs of elements in the two source vectors + /// + /// The first source vector + /// The second source vector + /// The maximized vector + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Max(Vector2 value1, Vector2 value2) + { + return new Vector2( + (value1.X > value2.X) ? value1.X : value2.X, + (value1.Y > value2.Y) ? value1.Y : value2.Y); + } + + /// + /// Returns a vector whose elements are the absolute values of each of the source vector's elements. + /// + /// The source vector. + /// The absolute value vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 Abs(Vector2 value) + { + return new Vector2(Math.Abs(value.X), Math.Abs(value.Y)); + } + + /// + /// Returns a vector whose elements are the square root of each of the source vector's elements. + /// + /// The source vector. + /// The square root vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 SquareRoot(Vector2 value) + { + return new Vector2((Single)Math.Sqrt(value.X), (Single)Math.Sqrt(value.Y)); + } + #endregion Public Static Methods + + #region Public Static Operators + /// + /// Adds two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The summed vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 operator +(Vector2 left, Vector2 right) + { + return new Vector2(left.X + right.X, left.Y + right.Y); + } + + /// + /// Subtracts the second vector from the first. + /// + /// The first source vector. + /// The second source vector. + /// The difference vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 operator -(Vector2 left, Vector2 right) + { + return new Vector2(left.X - right.X, left.Y - right.Y); + } + + /// + /// Multiplies two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The product vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 operator *(Vector2 left, Vector2 right) + { + return new Vector2(left.X * right.X, left.Y * right.Y); + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The scalar value. + /// The source vector. + /// The scaled vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 operator *(Single left, Vector2 right) + { + return new Vector2(left, left) * right; + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The scaled vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 operator *(Vector2 left, Single right) + { + return left * new Vector2(right, right); + } + + /// + /// Divides the first vector by the second. + /// + /// The first source vector. + /// The second source vector. + /// The vector resulting from the division. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 operator /(Vector2 left, Vector2 right) + { + return new Vector2(left.X / right.X, left.Y / right.Y); + } + + /// + /// Divides the vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The result of the division. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 operator /(Vector2 value1, float value2) + { + float invDiv = 1.0f / value2; + return new Vector2( + value1.X * invDiv, + value1.Y * invDiv); + } + + /// + /// Negates a given vector. + /// + /// The source vector. + /// The negated vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector2 operator -(Vector2 value) + { + return Zero - value; + } + + /// + /// Returns a boolean indicating whether the two given vectors are equal. + /// + /// The first vector to compare. + /// The second vector to compare. + /// True if the vectors are equal; False otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Vector2 left, Vector2 right) + { + return left.Equals(right); + } + + /// + /// Returns a boolean indicating whether the two given vectors are not equal. + /// + /// The first vector to compare. + /// The second vector to compare. + /// True if the vectors are not equal; False if they are equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Vector2 left, Vector2 right) + { + return !(left == right); + } + #endregion Public Static Operators + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/Vector3.cs b/external/referencesource/System.Numerics/System/Numerics/Vector3.cs new file mode 100644 index 0000000000..e6a5b067e7 --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/Vector3.cs @@ -0,0 +1,471 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Globalization; +using System.Runtime.CompilerServices; +using System.Text; + +namespace System.Numerics +{ + /// + /// A structure encapsulating three single precision floating point values and provides hardware accelerated methods. + /// + public partial struct Vector3 : IEquatable, IFormattable + { + #region Public Static Properties + /// + /// Returns the vector (0,0,0). + /// + public static Vector3 Zero { get { return new Vector3(); } } + /// + /// Returns the vector (1,1,1). + /// + public static Vector3 One { get { return new Vector3(1.0f, 1.0f, 1.0f); } } + /// + /// Returns the vector (1,0,0). + /// + public static Vector3 UnitX { get { return new Vector3(1.0f, 0.0f, 0.0f); } } + /// + /// Returns the vector (0,1,0). + /// + public static Vector3 UnitY { get { return new Vector3(0.0f, 1.0f, 0.0f); } } + /// + /// Returns the vector (0,0,1). + /// + public static Vector3 UnitZ { get { return new Vector3(0.0f, 0.0f, 1.0f); } } + #endregion Public Static Properties + + #region Public Instance Methods + + /// + /// Returns the hash code for this instance. + /// + /// The hash code. + public override int GetHashCode() + { + int hash = this.X.GetHashCode(); + hash = HashCodeHelper.CombineHashCodes(hash, this.Y.GetHashCode()); + hash = HashCodeHelper.CombineHashCodes(hash, this.Z.GetHashCode()); + return hash; + } + + /// + /// Returns a boolean indicating whether the given Object is equal to this Vector3 instance. + /// + /// The Object to compare against. + /// True if the Object is equal to this Vector3; False otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object obj) + { + if (!(obj is Vector3)) + return false; + return Equals((Vector3)obj); + } + + /// + /// Returns a String representing this Vector3 instance. + /// + /// The string representation. + public override string ToString() + { + return ToString("G", CultureInfo.CurrentCulture); + } + + /// + /// Returns a String representing this Vector3 instance, using the specified format to format individual elements. + /// + /// The format of individual elements. + /// The string representation. + public string ToString(string format) + { + return ToString(format, CultureInfo.CurrentCulture); + } + + /// + /// Returns a String representing this Vector3 instance, using the specified format to format individual elements + /// and the given IFormatProvider. + /// + /// The format of individual elements. + /// The format provider to use when formatting elements. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + StringBuilder sb = new StringBuilder(); + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + sb.Append('<'); + sb.Append(((IFormattable)this.X).ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(((IFormattable)this.Y).ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(((IFormattable)this.Z).ToString(format, formatProvider)); + sb.Append('>'); + return sb.ToString(); + } + + /// + /// Returns the length of the vector. + /// + /// The vector's length. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Length() + { + if (Vector.IsHardwareAccelerated) + { + float ls = Vector3.Dot(this, this); + return (float)System.Math.Sqrt(ls); + } + else + { + float ls = X * X + Y * Y + Z * Z; + return (float)System.Math.Sqrt(ls); + } + } + + /// + /// Returns the length of the vector squared. This operation is cheaper than Length(). + /// + /// The vector's length squared. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float LengthSquared() + { + if (Vector.IsHardwareAccelerated) + { + return Vector3.Dot(this, this); + } + else + { + return X * X + Y * Y + Z * Z; + } + } + #endregion Public Instance Methods + + #region Public Static Methods + /// + /// Returns the Euclidean distance between the two given points. + /// + /// The first point. + /// The second point. + /// The distance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Distance(Vector3 value1, Vector3 value2) + { + if (Vector.IsHardwareAccelerated) + { + Vector3 difference = value1 - value2; + float ls = Vector3.Dot(difference, difference); + return (float)System.Math.Sqrt(ls); + } + else + { + float dx = value1.X - value2.X; + float dy = value1.Y - value2.Y; + float dz = value1.Z - value2.Z; + + float ls = dx * dx + dy * dy + dz * dz; + + return (float)System.Math.Sqrt((double)ls); + } + } + + /// + /// Returns the Euclidean distance squared between the two given points. + /// + /// The first point. + /// The second point. + /// The distance squared. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float DistanceSquared(Vector3 value1, Vector3 value2) + { + if (Vector.IsHardwareAccelerated) + { + Vector3 difference = value1 - value2; + return Vector3.Dot(difference, difference); + } + else + { + float dx = value1.X - value2.X; + float dy = value1.Y - value2.Y; + float dz = value1.Z - value2.Z; + + return dx * dx + dy * dy + dz * dz; + } + } + + /// + /// Returns a vector with the same direction as the given vector, but with a length of 1. + /// + /// The vector to normalize. + /// The normalized vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Normalize(Vector3 value) + { + if (Vector.IsHardwareAccelerated) + { + float length = value.Length(); + return value / length; + } + else + { + float ls = value.X * value.X + value.Y * value.Y + value.Z * value.Z; + float length = (float)System.Math.Sqrt(ls); + return new Vector3(value.X / length, value.Y / length, value.Z / length); + } + } + + /// + /// Computes the cross product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The cross product. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Cross(Vector3 vector1, Vector3 vector2) + { + return new Vector3( + vector1.Y * vector2.Z - vector1.Z * vector2.Y, + vector1.Z * vector2.X - vector1.X * vector2.Z, + vector1.X * vector2.Y - vector1.Y * vector2.X); + } + + /// + /// Returns the reflection of a vector off a surface that has the specified normal. + /// + /// The source vector. + /// The normal of the surface being reflected off. + /// The reflected vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Reflect(Vector3 vector, Vector3 normal) + { + if (Vector.IsHardwareAccelerated) + { + float dot = Vector3.Dot(vector, normal); + Vector3 temp = normal * dot * 2f; + return vector - temp; + } + else + { + float dot = vector.X * normal.X + vector.Y * normal.Y + vector.Z * normal.Z; + float tempX = normal.X * dot * 2f; + float tempY = normal.Y * dot * 2f; + float tempZ = normal.Z * dot * 2f; + return new Vector3(vector.X - tempX, vector.Y - tempY, vector.Z - tempZ); + } + } + + /// + /// Restricts a vector between a min and max value. + /// + /// The source vector. + /// The minimum value. + /// The maximum value. + /// The restricted vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Clamp(Vector3 value1, Vector3 min, Vector3 max) + { + // This compare order is very important!!! + // We must follow HLSL behavior in the case user specified min value is bigger than max value. + + float x = value1.X; + x = (x > max.X) ? max.X : x; + x = (x < min.X) ? min.X : x; + + float y = value1.Y; + y = (y > max.Y) ? max.Y : y; + y = (y < min.Y) ? min.Y : y; + + float z = value1.Z; + z = (z > max.Z) ? max.Z : z; + z = (z < min.Z) ? min.Z : z; + + return new Vector3(x, y, z); + } + + /// + /// Linearly interpolates between two vectors based on the given weighting. + /// + /// The first source vector. + /// The second source vector. + /// Value between 0 and 1 indicating the weight of the second source vector. + /// The interpolated vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount) + { + if (Vector.IsHardwareAccelerated) + { + Vector3 firstInfluence = value1 * (1f - amount); + Vector3 secondInfluence = value2 * amount; + return firstInfluence + secondInfluence; + } + else + { + return new Vector3( + value1.X + (value2.X - value1.X) * amount, + value1.Y + (value2.Y - value1.Y) * amount, + value1.Z + (value2.Z - value1.Z) * amount); + } + } + + /// + /// Transforms a vector by the given matrix. + /// + /// The source vector. + /// The transformation matrix. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Transform(Vector3 position, Matrix4x4 matrix) + { + return new Vector3( + position.X * matrix.M11 + position.Y * matrix.M21 + position.Z * matrix.M31 + matrix.M41, + position.X * matrix.M12 + position.Y * matrix.M22 + position.Z * matrix.M32 + matrix.M42, + position.X * matrix.M13 + position.Y * matrix.M23 + position.Z * matrix.M33 + matrix.M43); + } + + /// + /// Transforms a vector normal by the given matrix. + /// + /// The source vector. + /// The transformation matrix. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 TransformNormal(Vector3 normal, Matrix4x4 matrix) + { + return new Vector3( + normal.X * matrix.M11 + normal.Y * matrix.M21 + normal.Z * matrix.M31, + normal.X * matrix.M12 + normal.Y * matrix.M22 + normal.Z * matrix.M32, + normal.X * matrix.M13 + normal.Y * matrix.M23 + normal.Z * matrix.M33); + } + + /// + /// Transforms a vector by the given Quaternion rotation value. + /// + /// The source vector to be rotated. + /// The rotation to apply. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Transform(Vector3 value, Quaternion rotation) + { + float x2 = rotation.X + rotation.X; + float y2 = rotation.Y + rotation.Y; + float z2 = rotation.Z + rotation.Z; + + float wx2 = rotation.W * x2; + float wy2 = rotation.W * y2; + float wz2 = rotation.W * z2; + float xx2 = rotation.X * x2; + float xy2 = rotation.X * y2; + float xz2 = rotation.X * z2; + float yy2 = rotation.Y * y2; + float yz2 = rotation.Y * z2; + float zz2 = rotation.Z * z2; + + return new Vector3( + value.X * (1.0f - yy2 - zz2) + value.Y * (xy2 - wz2) + value.Z * (xz2 + wy2), + value.X * (xy2 + wz2) + value.Y * (1.0f - xx2 - zz2) + value.Z * (yz2 - wx2), + value.X * (xz2 - wy2) + value.Y * (yz2 + wx2) + value.Z * (1.0f - xx2 - yy2)); + } + #endregion Public Static Methods + + #region Public operator methods + + // All these methods should be inlined as they are implemented + // over JIT intrinsics + + /// + /// Adds two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The summed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Add(Vector3 left, Vector3 right) + { + return left + right; + } + + /// + /// Subtracts the second vector from the first. + /// + /// The first source vector. + /// The second source vector. + /// The difference vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Subtract(Vector3 left, Vector3 right) + { + return left - right; + } + + /// + /// Multiplies two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The product vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Multiply(Vector3 left, Vector3 right) + { + return left * right; + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The scaled vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Multiply(Vector3 left, Single right) + { + return left * right; + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The scalar value. + /// The source vector. + /// The scaled vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Multiply(Single left, Vector3 right) + { + return left * right; + } + + /// + /// Divides the first vector by the second. + /// + /// The first source vector. + /// The second source vector. + /// The vector resulting from the division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Divide(Vector3 left, Vector3 right) + { + return left / right; + } + + /// + /// Divides the vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The result of the division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Divide(Vector3 left, Single divisor) + { + return left / divisor; + } + + /// + /// Negates a given vector. + /// + /// The source vector. + /// The negated vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Negate(Vector3 value) + { + return -value; + } + #endregion Public operator methods + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/Vector3_Intrinsics.cs b/external/referencesource/System.Numerics/System/Numerics/Vector3_Intrinsics.cs new file mode 100644 index 0000000000..628301fd81 --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/Vector3_Intrinsics.cs @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Runtime.CompilerServices; + +namespace System.Numerics +{ + // This file contains the definitions for all of the JIT intrinsic methods and properties that are recognized by the current x64 JIT compiler. + // The implementation defined here is used in any circumstance where the JIT fails to recognize these members as intrinsic. + // The JIT recognizes these methods and properties by name and signature: if either is changed, the JIT will no longer recognize the member. + // Some methods declared here are not strictly intrinsic, but delegate to an intrinsic method. For example, only one overload of CopyTo() + // is actually recognized by the JIT, but both are here for simplicity. + + public partial struct Vector3 + { + /// + /// The X component of the vector. + /// + public Single X; + /// + /// The Y component of the vector. + /// + public Single Y; + /// + /// The Z component of the vector. + /// + public Single Z; + + #region Constructors + /// + /// Constructs a vector whose elements are all the single specified value. + /// + /// The element to fill the vector with. + [JitIntrinsic] + public Vector3(Single value) : this(value, value, value) { } + + /// + /// Constructs a Vector3 from the given Vector2 and a third value. + /// + /// The Vector to extract X and Y components from. + /// The Z component. + public Vector3(Vector2 value, float z) : this(value.X, value.Y, z) { } + + /// + /// Constructs a vector with the given individual elements. + /// + /// The X component. + /// The Y component. + /// The Z component. + [JitIntrinsic] + public Vector3(Single x, Single y, Single z) + { + X = x; + Y = y; + Z = z; + } + #endregion Constructors + + #region Public Instance Methods + /// + /// Copies the contents of the vector into the given array. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTo(Single[] array) + { + CopyTo(array, 0); + } + + /// + /// Copies the contents of the vector into the given array, starting from index. + /// + /// If array is null. + /// If array is multidimensional. + /// If index is greater than end of the array or index is less than zero. + /// If number of elements in source vector is greater than those available in destination array. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTo(Single[] array, int index) + { + if (array == null) + { + // Match the JIT's exception type here. For perf, a NullReference is thrown instead of an ArgumentNull. + throw new NullReferenceException(SR.GetString("Arg_NullArgumentNullRef")); + } + if (index < 0 || index >= array.Length) + { + throw new ArgumentOutOfRangeException(SR.GetString("Arg_ArgumentOutOfRangeException", index)); + } + if ((array.Length - index) < 3) + { + throw new ArgumentException(SR.GetString("Arg_ElementsInSourceIsGreaterThanDestination", index)); + } + array[index] = X; + array[index + 1] = Y; + array[index + 2] = Z; + } + + /// + /// Returns a boolean indicating whether the given Vector3 is equal to this Vector3 instance. + /// + /// The Vector3 to compare this instance to. + /// True if the other Vector3 is equal to this instance; False otherwise. + [JitIntrinsic] + public bool Equals(Vector3 other) + { + return X == other.X && + Y == other.Y && + Z == other.Z; + } + #endregion Public Instance Methods + + #region Public Static Methods + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Dot(Vector3 vector1, Vector3 vector2) + { + return vector1.X * vector2.X + + vector1.Y * vector2.Y + + vector1.Z * vector2.Z; + } + + /// + /// Returns a vector whose elements are the minimum of each of the pairs of elements in the two source vectors. + /// + /// The first source vector. + /// The second source vector. + /// The minimized vector. + [JitIntrinsic] + public static Vector3 Min(Vector3 value1, Vector3 value2) + { + return new Vector3( + (value1.X < value2.X) ? value1.X : value2.X, + (value1.Y < value2.Y) ? value1.Y : value2.Y, + (value1.Z < value2.Z) ? value1.Z : value2.Z); + } + + /// + /// Returns a vector whose elements are the maximum of each of the pairs of elements in the two source vectors. + /// + /// The first source vector. + /// The second source vector. + /// The maximized vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Max(Vector3 value1, Vector3 value2) + { + return new Vector3( + (value1.X > value2.X) ? value1.X : value2.X, + (value1.Y > value2.Y) ? value1.Y : value2.Y, + (value1.Z > value2.Z) ? value1.Z : value2.Z); + } + + /// + /// Returns a vector whose elements are the absolute values of each of the source vector's elements. + /// + /// The source vector. + /// The absolute value vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 Abs(Vector3 value) + { + return new Vector3(Math.Abs(value.X), Math.Abs(value.Y), Math.Abs(value.Z)); + } + + /// + /// Returns a vector whose elements are the square root of each of the source vector's elements. + /// + /// The source vector. + /// The square root vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 SquareRoot(Vector3 value) + { + return new Vector3((Single)Math.Sqrt(value.X), (Single)Math.Sqrt(value.Y), (Single)Math.Sqrt(value.Z)); + } + #endregion Public Static Methods + + #region Public Static Operators + /// + /// Adds two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The summed vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 operator +(Vector3 left, Vector3 right) + { + return new Vector3(left.X + right.X, left.Y + right.Y, left.Z + right.Z); + } + + /// + /// Subtracts the second vector from the first. + /// + /// The first source vector. + /// The second source vector. + /// The difference vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 operator -(Vector3 left, Vector3 right) + { + return new Vector3(left.X - right.X, left.Y - right.Y, left.Z - right.Z); + } + + /// + /// Multiplies two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The product vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 operator *(Vector3 left, Vector3 right) + { + return new Vector3(left.X * right.X, left.Y * right.Y, left.Z * right.Z); + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The scaled vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 operator *(Vector3 left, Single right) + { + return left * new Vector3(right); + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The scalar value. + /// The source vector. + /// The scaled vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 operator *(Single left, Vector3 right) + { + return new Vector3(left) * right; + } + + /// + /// Divides the first vector by the second. + /// + /// The first source vector. + /// The second source vector. + /// The vector resulting from the division. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 operator /(Vector3 left, Vector3 right) + { + return new Vector3(left.X / right.X, left.Y / right.Y, left.Z / right.Z); + } + + /// + /// Divides the vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The result of the division. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 operator /(Vector3 value1, float value2) + { + float invDiv = 1.0f / value2; + + return new Vector3( + value1.X * invDiv, + value1.Y * invDiv, + value1.Z * invDiv); + } + + /// + /// Negates a given vector. + /// + /// The source vector. + /// The negated vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector3 operator -(Vector3 value) + { + return Zero - value; + } + + /// + /// Returns a boolean indicating whether the two given vectors are equal. + /// + /// The first vector to compare. + /// The second vector to compare. + /// True if the vectors are equal; False otherwise. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Vector3 left, Vector3 right) + { + return (left.X == right.X && + left.Y == right.Y && + left.Z == right.Z); + } + + /// + /// Returns a boolean indicating whether the two given vectors are not equal. + /// + /// The first vector to compare. + /// The second vector to compare. + /// True if the vectors are not equal; False if they are equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Vector3 left, Vector3 right) + { + return (left.X != right.X || + left.Y != right.Y || + left.Z != right.Z); + } + #endregion Public Static Operators + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/Vector4.cs b/external/referencesource/System.Numerics/System/Numerics/Vector4.cs new file mode 100644 index 0000000000..a2893b3bc2 --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/Vector4.cs @@ -0,0 +1,520 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Globalization; +using System.Runtime.CompilerServices; +using System.Text; + +namespace System.Numerics +{ + /// + /// A structure encapsulating four single precision floating point values and provides hardware accelerated methods. + /// + public partial struct Vector4 : IEquatable, IFormattable + { + #region Public Static Properties + /// + /// Returns the vector (0,0,0,0). + /// + public static Vector4 Zero { get { return new Vector4(); } } + /// + /// Returns the vector (1,1,1,1). + /// + public static Vector4 One { get { return new Vector4(1.0f, 1.0f, 1.0f, 1.0f); } } + /// + /// Returns the vector (1,0,0,0). + /// + public static Vector4 UnitX { get { return new Vector4(1.0f, 0.0f, 0.0f, 0.0f); } } + /// + /// Returns the vector (0,1,0,0). + /// + public static Vector4 UnitY { get { return new Vector4(0.0f, 1.0f, 0.0f, 0.0f); } } + /// + /// Returns the vector (0,0,1,0). + /// + public static Vector4 UnitZ { get { return new Vector4(0.0f, 0.0f, 1.0f, 0.0f); } } + /// + /// Returns the vector (0,0,0,1). + /// + public static Vector4 UnitW { get { return new Vector4(0.0f, 0.0f, 0.0f, 1.0f); } } + #endregion Public Static Properties + + #region Public instance methods + /// + /// Returns the hash code for this instance. + /// + /// The hash code. + public override int GetHashCode() + { + int hash = this.X.GetHashCode(); + hash = HashCodeHelper.CombineHashCodes(hash, this.Y.GetHashCode()); + hash = HashCodeHelper.CombineHashCodes(hash, this.Z.GetHashCode()); + hash = HashCodeHelper.CombineHashCodes(hash, this.W.GetHashCode()); + return hash; + } + + /// + /// Returns a boolean indicating whether the given Object is equal to this Vector4 instance. + /// + /// The Object to compare against. + /// True if the Object is equal to this Vector4; False otherwise. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object obj) + { + if (!(obj is Vector4)) + return false; + return Equals((Vector4)obj); + } + + /// + /// Returns a String representing this Vector4 instance. + /// + /// The string representation. + public override string ToString() + { + return ToString("G", CultureInfo.CurrentCulture); + } + + /// + /// Returns a String representing this Vector4 instance, using the specified format to format individual elements. + /// + /// The format of individual elements. + /// The string representation. + public string ToString(string format) + { + return ToString(format, CultureInfo.CurrentCulture); + } + + /// + /// Returns a String representing this Vector4 instance, using the specified format to format individual elements + /// and the given IFormatProvider. + /// + /// The format of individual elements. + /// The format provider to use when formatting elements. + /// The string representation. + public string ToString(string format, IFormatProvider formatProvider) + { + StringBuilder sb = new StringBuilder(); + string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; + sb.Append('<'); + sb.Append(this.X.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.Y.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.Z.ToString(format, formatProvider)); + sb.Append(separator); + sb.Append(' '); + sb.Append(this.W.ToString(format, formatProvider)); + sb.Append('>'); + return sb.ToString(); + } + + /// + /// Returns the length of the vector. This operation is cheaper than Length(). + /// + /// The vector's length. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Length() + { + if (Vector.IsHardwareAccelerated) + { + float ls = Vector4.Dot(this, this); + return (float)System.Math.Sqrt(ls); + } + else + { + float ls = X * X + Y * Y + Z * Z + W * W; + + return (float)Math.Sqrt((double)ls); + } + } + + /// + /// Returns the length of the vector squared. + /// + /// The vector's length squared. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float LengthSquared() + { + if (Vector.IsHardwareAccelerated) + { + return Vector4.Dot(this, this); + } + else + { + return X * X + Y * Y + Z * Z + W * W; + } + } + #endregion Public Instance Methods + + #region Public Static Methods + /// + /// Returns the Euclidean distance between the two given points. + /// + /// The first point. + /// The second point. + /// The distance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Distance(Vector4 value1, Vector4 value2) + { + if (Vector.IsHardwareAccelerated) + { + Vector4 difference = value1 - value2; + float ls = Vector4.Dot(difference, difference); + return (float)System.Math.Sqrt(ls); + } + else + { + float dx = value1.X - value2.X; + float dy = value1.Y - value2.Y; + float dz = value1.Z - value2.Z; + float dw = value1.W - value2.W; + + float ls = dx * dx + dy * dy + dz * dz + dw * dw; + + return (float)Math.Sqrt((double)ls); + } + } + + /// + /// Returns the Euclidean distance squared between the two given points. + /// + /// The first point. + /// The second point. + /// The distance squared. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float DistanceSquared(Vector4 value1, Vector4 value2) + { + if (Vector.IsHardwareAccelerated) + { + Vector4 difference = value1 - value2; + return Vector4.Dot(difference, difference); + } + else + { + float dx = value1.X - value2.X; + float dy = value1.Y - value2.Y; + float dz = value1.Z - value2.Z; + float dw = value1.W - value2.W; + + return dx * dx + dy * dy + dz * dz + dw * dw; + } + } + + /// + /// Returns a vector with the same direction as the given vector, but with a length of 1. + /// + /// The vector to normalize. + /// The normalized vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Normalize(Vector4 vector) + { + if (Vector.IsHardwareAccelerated) + { + float length = vector.Length(); + return vector / length; + } + else + { + float ls = vector.X * vector.X + vector.Y * vector.Y + vector.Z * vector.Z + vector.W * vector.W; + float invNorm = 1.0f / (float)Math.Sqrt((double)ls); + + return new Vector4( + vector.X * invNorm, + vector.Y * invNorm, + vector.Z * invNorm, + vector.W * invNorm); + } + } + + /// + /// Restricts a vector between a min and max value. + /// + /// The source vector. + /// The minimum value. + /// The maximum value. + /// The restricted vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Clamp(Vector4 value1, Vector4 min, Vector4 max) + { + // This compare order is very important!!! + // We must follow HLSL behavior in the case user specified min value is bigger than max value. + + float x = value1.X; + x = (x > max.X) ? max.X : x; + x = (x < min.X) ? min.X : x; + + float y = value1.Y; + y = (y > max.Y) ? max.Y : y; + y = (y < min.Y) ? min.Y : y; + + float z = value1.Z; + z = (z > max.Z) ? max.Z : z; + z = (z < min.Z) ? min.Z : z; + + float w = value1.W; + w = (w > max.W) ? max.W : w; + w = (w < min.W) ? min.W : w; + + return new Vector4(x, y, z, w); + } + + /// + /// Linearly interpolates between two vectors based on the given weighting. + /// + /// The first source vector. + /// The second source vector. + /// Value between 0 and 1 indicating the weight of the second source vector. + /// The interpolated vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Lerp(Vector4 value1, Vector4 value2, float amount) + { + return new Vector4( + value1.X + (value2.X - value1.X) * amount, + value1.Y + (value2.Y - value1.Y) * amount, + value1.Z + (value2.Z - value1.Z) * amount, + value1.W + (value2.W - value1.W) * amount); + } + + /// + /// Transforms a vector by the given matrix. + /// + /// The source vector. + /// The transformation matrix. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Transform(Vector2 position, Matrix4x4 matrix) + { + return new Vector4( + position.X * matrix.M11 + position.Y * matrix.M21 + matrix.M41, + position.X * matrix.M12 + position.Y * matrix.M22 + matrix.M42, + position.X * matrix.M13 + position.Y * matrix.M23 + matrix.M43, + position.X * matrix.M14 + position.Y * matrix.M24 + matrix.M44); + } + + /// + /// Transforms a vector by the given matrix. + /// + /// The source vector. + /// The transformation matrix. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Transform(Vector3 position, Matrix4x4 matrix) + { + return new Vector4( + position.X * matrix.M11 + position.Y * matrix.M21 + position.Z * matrix.M31 + matrix.M41, + position.X * matrix.M12 + position.Y * matrix.M22 + position.Z * matrix.M32 + matrix.M42, + position.X * matrix.M13 + position.Y * matrix.M23 + position.Z * matrix.M33 + matrix.M43, + position.X * matrix.M14 + position.Y * matrix.M24 + position.Z * matrix.M34 + matrix.M44); + } + + /// + /// Transforms a vector by the given matrix. + /// + /// The source vector. + /// The transformation matrix. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Transform(Vector4 vector, Matrix4x4 matrix) + { + return new Vector4( + vector.X * matrix.M11 + vector.Y * matrix.M21 + vector.Z * matrix.M31 + vector.W * matrix.M41, + vector.X * matrix.M12 + vector.Y * matrix.M22 + vector.Z * matrix.M32 + vector.W * matrix.M42, + vector.X * matrix.M13 + vector.Y * matrix.M23 + vector.Z * matrix.M33 + vector.W * matrix.M43, + vector.X * matrix.M14 + vector.Y * matrix.M24 + vector.Z * matrix.M34 + vector.W * matrix.M44); + } + + /// + /// Transforms a vector by the given Quaternion rotation value. + /// + /// The source vector to be rotated. + /// The rotation to apply. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Transform(Vector2 value, Quaternion rotation) + { + float x2 = rotation.X + rotation.X; + float y2 = rotation.Y + rotation.Y; + float z2 = rotation.Z + rotation.Z; + + float wx2 = rotation.W * x2; + float wy2 = rotation.W * y2; + float wz2 = rotation.W * z2; + float xx2 = rotation.X * x2; + float xy2 = rotation.X * y2; + float xz2 = rotation.X * z2; + float yy2 = rotation.Y * y2; + float yz2 = rotation.Y * z2; + float zz2 = rotation.Z * z2; + + return new Vector4( + value.X * (1.0f - yy2 - zz2) + value.Y * (xy2 - wz2), + value.X * (xy2 + wz2) + value.Y * (1.0f - xx2 - zz2), + value.X * (xz2 - wy2) + value.Y * (yz2 + wx2), + 1.0f); + } + + /// + /// Transforms a vector by the given Quaternion rotation value. + /// + /// The source vector to be rotated. + /// The rotation to apply. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Transform(Vector3 value, Quaternion rotation) + { + float x2 = rotation.X + rotation.X; + float y2 = rotation.Y + rotation.Y; + float z2 = rotation.Z + rotation.Z; + + float wx2 = rotation.W * x2; + float wy2 = rotation.W * y2; + float wz2 = rotation.W * z2; + float xx2 = rotation.X * x2; + float xy2 = rotation.X * y2; + float xz2 = rotation.X * z2; + float yy2 = rotation.Y * y2; + float yz2 = rotation.Y * z2; + float zz2 = rotation.Z * z2; + + return new Vector4( + value.X * (1.0f - yy2 - zz2) + value.Y * (xy2 - wz2) + value.Z * (xz2 + wy2), + value.X * (xy2 + wz2) + value.Y * (1.0f - xx2 - zz2) + value.Z * (yz2 - wx2), + value.X * (xz2 - wy2) + value.Y * (yz2 + wx2) + value.Z * (1.0f - xx2 - yy2), + 1.0f); + } + + /// + /// Transforms a vector by the given Quaternion rotation value. + /// + /// The source vector to be rotated. + /// The rotation to apply. + /// The transformed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Transform(Vector4 value, Quaternion rotation) + { + float x2 = rotation.X + rotation.X; + float y2 = rotation.Y + rotation.Y; + float z2 = rotation.Z + rotation.Z; + + float wx2 = rotation.W * x2; + float wy2 = rotation.W * y2; + float wz2 = rotation.W * z2; + float xx2 = rotation.X * x2; + float xy2 = rotation.X * y2; + float xz2 = rotation.X * z2; + float yy2 = rotation.Y * y2; + float yz2 = rotation.Y * z2; + float zz2 = rotation.Z * z2; + + return new Vector4( + value.X * (1.0f - yy2 - zz2) + value.Y * (xy2 - wz2) + value.Z * (xz2 + wy2), + value.X * (xy2 + wz2) + value.Y * (1.0f - xx2 - zz2) + value.Z * (yz2 - wx2), + value.X * (xz2 - wy2) + value.Y * (yz2 + wx2) + value.Z * (1.0f - xx2 - yy2), + value.W); + } + #endregion Public Static Methods + + #region Public operator methods + // All these methods should be inlines as they are implemented + // over JIT intrinsics + + /// + /// Adds two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The summed vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Add(Vector4 left, Vector4 right) + { + return left + right; + } + + /// + /// Subtracts the second vector from the first. + /// + /// The first source vector. + /// The second source vector. + /// The difference vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Subtract(Vector4 left, Vector4 right) + { + return left - right; + } + + /// + /// Multiplies two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The product vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Multiply(Vector4 left, Vector4 right) + { + return left * right; + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The scaled vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Multiply(Vector4 left, Single right) + { + return left * new Vector4(right, right, right, right); + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The scalar value. + /// The source vector. + /// The scaled vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Multiply(Single left, Vector4 right) + { + return new Vector4(left, left, left, left) * right; + } + + /// + /// Divides the first vector by the second. + /// + /// The first source vector. + /// The second source vector. + /// The vector resulting from the division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Divide(Vector4 left, Vector4 right) + { + return left / right; + } + + /// + /// Divides the vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The result of the division. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Divide(Vector4 left, Single divisor) + { + return left / divisor; + } + + /// + /// Negates a given vector. + /// + /// The source vector. + /// The negated vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Negate(Vector4 value) + { + return -value; + } + #endregion Public operator methods + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/Vector4_Intrinsics.cs b/external/referencesource/System.Numerics/System/Numerics/Vector4_Intrinsics.cs new file mode 100644 index 0000000000..97ca8021fc --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/Vector4_Intrinsics.cs @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Runtime.CompilerServices; + +namespace System.Numerics +{ + // This file contains the definitions for all of the JIT intrinsic methods and properties that are recognized by the current x64 JIT compiler. + // The implementation defined here is used in any circumstance where the JIT fails to recognize these members as intrinsic. + // The JIT recognizes these methods and properties by name and signature: if either is changed, the JIT will no longer recognize the member. + // Some methods declared here are not strictly intrinsic, but delegate to an intrinsic method. For example, only one overload of CopyTo() + + public partial struct Vector4 + { + /// + /// The X component of the vector. + /// + public Single X; + /// + /// The Y component of the vector. + /// + public Single Y; + /// + /// The Z component of the vector. + /// + public Single Z; + /// + /// The W component of the vector. + /// + public Single W; + + #region Constructors + + /// + /// Constructs a vector whose elements are all the single specified value. + /// + /// The element to fill the vector with. + [JitIntrinsic] + public Vector4(Single value) + : this(value, value, value, value) + { + } + /// + /// Constructs a vector with the given individual elements. + /// + /// W component. + /// X component. + /// Y component. + /// Z component. + [JitIntrinsic] + public Vector4(Single x, Single y, Single z, Single w) + { + W = w; + X = x; + Y = y; + Z = z; + } + + /// + /// Constructs a Vector4 from the given Vector2 and a Z and W component. + /// + /// The vector to use as the X and Y components. + /// The Z component. + /// The W component. + public Vector4(Vector2 value, Single z, Single w) + { + X = value.X; + Y = value.Y; + Z = z; + W = w; + } + + /// + /// Constructs a Vector4 from the given Vector3 and a W component. + /// + /// The vector to use as the X, Y, and Z components. + /// The W component. + public Vector4(Vector3 value, Single w) + { + X = value.X; + Y = value.Y; + Z = value.Z; + W = w; + } + #endregion Constructors + + #region Public Instance Methods + /// + /// Copies the contents of the vector into the given array. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTo(Single[] array) + { + CopyTo(array, 0); + } + + /// + /// Copies the contents of the vector into the given array, starting from index. + /// + /// If array is null. + /// If array is multidimensional. + /// If index is greater than end of the array or index is less than zero. + /// If number of elements in source vector is greater than those available in destination array. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CopyTo(Single[] array, int index) + { + if (array == null) + { + // Match the JIT's exception type here. For perf, a NullReference is thrown instead of an ArgumentNull. + throw new NullReferenceException(SR.GetString("Arg_NullArgumentNullRef")); + } + if (index < 0 || index >= array.Length) + { + throw new ArgumentOutOfRangeException(SR.GetString("Arg_ArgumentOutOfRangeException", index)); + } + if ((array.Length - index) < 4) + { + throw new ArgumentException(SR.GetString("Arg_ElementsInSourceIsGreaterThanDestination", index)); + } + array[index] = X; + array[index + 1] = Y; + array[index + 2] = Z; + array[index + 3] = W; + } + + /// + /// Returns a boolean indicating whether the given Vector4 is equal to this Vector4 instance. + /// + /// The Vector4 to compare this instance to. + /// True if the other Vector4 is equal to this instance; False otherwise. + [JitIntrinsic] + public bool Equals(Vector4 other) + { + return this.X == other.X + && this.Y == other.Y + && this.Z == other.Z + && this.W == other.W; + } + #endregion Public Instance Methods + + #region Public Static Methods + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Dot(Vector4 vector1, Vector4 vector2) + { + return vector1.X * vector2.X + + vector1.Y * vector2.Y + + vector1.Z * vector2.Z + + vector1.W * vector2.W; + } + + /// + /// Returns a vector whose elements are the minimum of each of the pairs of elements in the two source vectors. + /// + /// The first source vector. + /// The second source vector. + /// The minimized vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Min(Vector4 value1, Vector4 value2) + { + return new Vector4( + (value1.X < value2.X) ? value1.X : value2.X, + (value1.Y < value2.Y) ? value1.Y : value2.Y, + (value1.Z < value2.Z) ? value1.Z : value2.Z, + (value1.W < value2.W) ? value1.W : value2.W); + } + + /// + /// Returns a vector whose elements are the maximum of each of the pairs of elements in the two source vectors. + /// + /// The first source vector. + /// The second source vector. + /// The maximized vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Max(Vector4 value1, Vector4 value2) + { + return new Vector4( + (value1.X > value2.X) ? value1.X : value2.X, + (value1.Y > value2.Y) ? value1.Y : value2.Y, + (value1.Z > value2.Z) ? value1.Z : value2.Z, + (value1.W > value2.W) ? value1.W : value2.W); + } + + /// + /// Returns a vector whose elements are the absolute values of each of the source vector's elements. + /// + /// The source vector. + /// The absolute value vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 Abs(Vector4 value) + { + return new Vector4(Math.Abs(value.X), Math.Abs(value.Y), Math.Abs(value.Z), Math.Abs(value.W)); + } + + /// + /// Returns a vector whose elements are the square root of each of the source vector's elements. + /// + /// The source vector. + /// The square root vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 SquareRoot(Vector4 value) + { + return new Vector4((Single)Math.Sqrt(value.X), (Single)Math.Sqrt(value.Y), (Single)Math.Sqrt(value.Z), (Single)Math.Sqrt(value.W)); + } + #endregion Public Static Methods + + #region Public static operators + /// + /// Adds two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The summed vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 operator +(Vector4 left, Vector4 right) + { + return new Vector4(left.X + right.X, left.Y + right.Y, left.Z + right.Z, left.W + right.W); + } + + /// + /// Subtracts the second vector from the first. + /// + /// The first source vector. + /// The second source vector. + /// The difference vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 operator -(Vector4 left, Vector4 right) + { + return new Vector4(left.X - right.X, left.Y - right.Y, left.Z - right.Z, left.W - right.W); + } + + /// + /// Multiplies two vectors together. + /// + /// The first source vector. + /// The second source vector. + /// The product vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 operator *(Vector4 left, Vector4 right) + { + return new Vector4(left.X * right.X, left.Y * right.Y, left.Z * right.Z, left.W * right.W); + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The scaled vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 operator *(Vector4 left, Single right) + { + return left * new Vector4(right); + } + + /// + /// Multiplies a vector by the given scalar. + /// + /// The scalar value. + /// The source vector. + /// The scaled vector. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 operator *(Single left, Vector4 right) + { + return new Vector4(left) * right; + } + + /// + /// Divides the first vector by the second. + /// + /// The first source vector. + /// The second source vector. + /// The vector resulting from the division. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 operator /(Vector4 left, Vector4 right) + { + return new Vector4(left.X / right.X, left.Y / right.Y, left.Z / right.Z, left.W / right.W); + } + + /// + /// Divides the vector by the given scalar. + /// + /// The source vector. + /// The scalar value. + /// The result of the division. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 operator /(Vector4 value1, float value2) + { + float invDiv = 1.0f / value2; + + return new Vector4( + value1.X * invDiv, + value1.Y * invDiv, + value1.Z * invDiv, + value1.W * invDiv); + } + + /// + /// Negates a given vector. + /// + /// The source vector. + /// The negated vector. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector4 operator -(Vector4 value) + { + return Zero - value; + } + + /// + /// Returns a boolean indicating whether the two given vectors are equal. + /// + /// The first vector to compare. + /// The second vector to compare. + /// True if the vectors are equal; False otherwise. + [JitIntrinsic] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Vector4 left, Vector4 right) + { + return left.Equals(right); + } + + /// + /// Returns a boolean indicating whether the two given vectors are not equal. + /// + /// The first vector to compare. + /// The second vector to compare. + /// True if the vectors are not equal; False if they are equal. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Vector4 left, Vector4 right) + { + return !(left == right); + } + #endregion Public static operators + } +} diff --git a/external/referencesource/System.Numerics/System/Numerics/Vector_Operations.cs b/external/referencesource/System.Numerics/System/Numerics/Vector_Operations.cs new file mode 100644 index 0000000000..69215a062f --- /dev/null +++ b/external/referencesource/System.Numerics/System/Numerics/Vector_Operations.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Runtime.CompilerServices; + +namespace System.Numerics +{ + /// + /// Contains various methods useful for creating, manipulating, combining, and converting generic vectors with one another. + /// + internal static class Vector + { + // Every operation must either be a JIT intrinsic or implemented over a JIT intrinsic + // as a thin wrapper + // Operations implemented over a JIT intrinsic should be inlined + // Methods that do not have a type parameter are recognized as intrinsics + /// + /// Returns whether or not vector operations are subject to hardware acceleration through JIT intrinsic support. + /// + [JitIntrinsic] + public static bool IsHardwareAccelerated + { + get + { + return false; + } + } + } +} diff --git a/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCache.cs b/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCache.cs index f9030cc409..816319755c 100644 --- a/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCache.cs +++ b/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCache.cs @@ -466,6 +466,9 @@ namespace System.Runtime.Caching { } public long Trim(int percent) { + if (percent > 100) { + percent = 100; + } long trimmed = 0; if (_disposed == 0) { foreach (MemoryCacheStore store in _stores) { diff --git a/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheEntry.cs b/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheEntry.cs index 931bcee888..de32f8fcd8 100644 --- a/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheEntry.cs +++ b/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheEntry.cs @@ -230,7 +230,7 @@ namespace System.Runtime.Caching { internal void RemoveDependent(MemoryCacheEntryChangeMonitor dependent) { lock (this) { - if (_fields._dependents != null) { + if (_fields != null && _fields._dependents != null) { _fields._dependents.Remove(dependent); } } diff --git a/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheStore.cs b/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheStore.cs index 0ff86ea9ce..45128a44bc 100644 --- a/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheStore.cs +++ b/external/referencesource/System.Runtime.Caching/System/Caching/MemoryCacheStore.cs @@ -14,7 +14,6 @@ namespace System.Runtime.Caching { internal sealed class MemoryCacheStore : IDisposable { const int INSERT_BLOCK_WAIT = 10000; const int MAX_COUNT = Int32.MaxValue / 2; - const int MIN_COUNT = 10; private Hashtable _entries; private Object _entriesLock; @@ -140,7 +139,7 @@ namespace System.Runtime.Caching { if (_disposed == 0) { existingEntry = _entries[key] as MemoryCacheEntry; // has it expired? - if (existingEntry != null && entry.UtcAbsExp <= DateTime.UtcNow) { + if (existingEntry != null && existingEntry.UtcAbsExp <= DateTime.UtcNow) { toBeReleasedEntry = existingEntry; toBeReleasedEntry.State = EntryState.RemovingFromCache; existingEntry = null; @@ -300,21 +299,18 @@ namespace System.Runtime.Caching { } internal long TrimInternal(int percent) { + Dbg.Assert(percent <= 100, "percent <= 100"); + int count = Count; int toTrim = 0; // do we need to drop a percentage of entries? if (percent > 0) { - toTrim = (int)(((long)count * (long)percent) / 100L); + toTrim = (int)Math.Ceiling(((long)count * (long)percent) / 100D); // would this leave us above MAX_COUNT? int minTrim = count - MAX_COUNT; if (toTrim < minTrim) { toTrim = minTrim; } - // would this put us below MIN_COUNT? - int maxTrim = count - MIN_COUNT; - if (toTrim > maxTrim) { - toTrim = maxTrim; - } } // do we need to trim? if (toTrim <= 0 || _disposed == 1) { diff --git a/external/referencesource/System.Runtime.DurableInstancing/AssemblyInfo.cs b/external/referencesource/System.Runtime.DurableInstancing/AssemblyInfo.cs index 03a00d90c1..028caa7645 100644 --- a/external/referencesource/System.Runtime.DurableInstancing/AssemblyInfo.cs +++ b/external/referencesource/System.Runtime.DurableInstancing/AssemblyInfo.cs @@ -33,7 +33,7 @@ using System.Security.Permissions; [assembly: InternalsVisibleTo("System.ServiceModel.Activation, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("System.ServiceModel.Routing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] -// +// TODO, 62799, fix this to be System.Runtime.Friend [assembly: InternalsVisibleTo("CDF.CIT.Scenarios.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("Microsoft.CDF.Test.Persistence, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] // Need to provide InternalsVisibleTo System.Runtime.Serialization to allow serialization of internal DataContracts/DataMembers in partial trust. diff --git a/external/referencesource/System.Runtime.DurableInstancing/System/Runtime/ICancelable.cs b/external/referencesource/System.Runtime.DurableInstancing/System/Runtime/ICancelable.cs index 09ba59b65b..e9a543a6ad 100644 --- a/external/referencesource/System.Runtime.DurableInstancing/System/Runtime/ICancelable.cs +++ b/external/referencesource/System.Runtime.DurableInstancing/System/Runtime/ICancelable.cs @@ -10,4 +10,4 @@ namespace System.Runtime { void Cancel(); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ClassDataContract.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ClassDataContract.cs index 6e80e10716..9ea613ebc3 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ClassDataContract.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/ClassDataContract.cs @@ -820,7 +820,7 @@ namespace System.Runtime.Serialization if (BaseContract != null) { - if (hasDataContractAttribute && dataContractAttribute.IsReferenceSetExplicit) + if (hasDataContractAttribute && dataContractAttribute.IsReferenceSetExplicitly) { bool baseIsReference = this.BaseContract.IsReference; if ((baseIsReference && !dataContractAttribute.IsReference) || @@ -920,7 +920,7 @@ namespace System.Runtime.Serialization ThrowInvalidDataContractException(SR.GetString(SR.InvalidMember, DataContract.GetClrTypeFullName(type), member.Name)); DataMemberAttribute memberAttribute = (DataMemberAttribute)memberAttributes[0]; - if (memberAttribute.IsNameSetExplicit) + if (memberAttribute.IsNameSetExplicitly) { if (memberAttribute.Name == null || memberAttribute.Name.Length == 0) ThrowInvalidDataContractException(SR.GetString(SR.InvalidDataMemberName, member.Name, DataContract.GetClrTypeFullName(type))); diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContract.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContract.cs index 75092529f3..f26a107c43 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContract.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContract.cs @@ -539,14 +539,14 @@ namespace System.Runtime.Serialization string itemName = null, keyName = null, valueName = null; if (collectionContractAttribute != null) { - if (collectionContractAttribute.IsItemNameSetExplicit) + if (collectionContractAttribute.IsItemNameSetExplicitly) { if (collectionContractAttribute.ItemName == null || collectionContractAttribute.ItemName.Length == 0) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidCollectionContractItemName, DataContract.GetClrTypeFullName(UnderlyingType)))); itemName = DataContract.EncodeLocalName(collectionContractAttribute.ItemName); itemNameSetExplicit = true; } - if (collectionContractAttribute.IsKeyNameSetExplicit) + if (collectionContractAttribute.IsKeyNameSetExplicitly) { if (collectionContractAttribute.KeyName == null || collectionContractAttribute.KeyName.Length == 0) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidCollectionContractKeyName, DataContract.GetClrTypeFullName(UnderlyingType)))); @@ -554,7 +554,7 @@ namespace System.Runtime.Serialization throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidCollectionContractKeyNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.KeyName))); keyName = DataContract.EncodeLocalName(collectionContractAttribute.KeyName); } - if (collectionContractAttribute.IsValueNameSetExplicit) + if (collectionContractAttribute.IsValueNameSetExplicitly) { if (collectionContractAttribute.ValueName == null || collectionContractAttribute.ValueName.Length == 0) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.InvalidCollectionContractValueName, DataContract.GetClrTypeFullName(UnderlyingType)))); diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContractAttribute.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContractAttribute.cs index f7ed6f2910..6fee2df607 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContractAttribute.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/CollectionDataContractAttribute.cs @@ -13,12 +13,12 @@ namespace System.Runtime.Serialization string keyName; string valueName; bool isReference; - bool isNameSetExplicit; - bool isNamespaceSetExplicit; - bool isReferenceSetExplicit; - bool isItemNameSetExplicit; - bool isKeyNameSetExplicit; - bool isValueNameSetExplicit; + bool isNameSetExplicitly; + bool isNamespaceSetExplicitly; + bool isReferenceSetExplicitly; + bool isItemNameSetExplicitly; + bool isKeyNameSetExplicitly; + bool isValueNameSetExplicitly; public CollectionDataContractAttribute() { @@ -30,13 +30,13 @@ namespace System.Runtime.Serialization set { ns = value; - isNamespaceSetExplicit = true; + isNamespaceSetExplicitly = true; } } - internal bool IsNamespaceSetExplicit + public bool IsNamespaceSetExplicitly { - get { return isNamespaceSetExplicit; } + get { return isNamespaceSetExplicitly; } } public string Name @@ -45,13 +45,13 @@ namespace System.Runtime.Serialization set { name = value; - isNameSetExplicit = true; + isNameSetExplicitly = true; } } - internal bool IsNameSetExplicit + public bool IsNameSetExplicitly { - get { return isNameSetExplicit; } + get { return isNameSetExplicitly; } } public string ItemName @@ -60,13 +60,13 @@ namespace System.Runtime.Serialization set { itemName = value; - isItemNameSetExplicit = true; + isItemNameSetExplicitly = true; } } - internal bool IsItemNameSetExplicit + public bool IsItemNameSetExplicitly { - get { return isItemNameSetExplicit; } + get { return isItemNameSetExplicitly; } } public string KeyName @@ -75,7 +75,7 @@ namespace System.Runtime.Serialization set { keyName = value; - isKeyNameSetExplicit = true; + isKeyNameSetExplicitly = true; } } @@ -85,18 +85,18 @@ namespace System.Runtime.Serialization set { isReference = value; - isReferenceSetExplicit = true; + isReferenceSetExplicitly = true; } } - internal bool IsReferenceSetExplicit + public bool IsReferenceSetExplicitly { - get { return isReferenceSetExplicit; } + get { return isReferenceSetExplicitly; } } - internal bool IsKeyNameSetExplicit + public bool IsKeyNameSetExplicitly { - get { return isKeyNameSetExplicit; } + get { return isKeyNameSetExplicitly; } } public string ValueName @@ -105,13 +105,13 @@ namespace System.Runtime.Serialization set { valueName = value; - isValueNameSetExplicit = true; + isValueNameSetExplicitly = true; } } - internal bool IsValueNameSetExplicit + public bool IsValueNameSetExplicitly { - get { return isValueNameSetExplicit; } + get { return isValueNameSetExplicitly; } } } diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContract.cs.REMOVED.git-id b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContract.cs.REMOVED.git-id index 1b3047f2d0..8f3536459d 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContract.cs.REMOVED.git-id +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContract.cs.REMOVED.git-id @@ -1 +1 @@ -68d510c66635a8bc1d30f6dcb6c0c9ab53137deb \ No newline at end of file +c63c76f91537ad23db1f24fb585d429c313200cd \ No newline at end of file diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractAttribute.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractAttribute.cs index cafac3b78c..8a555df1a6 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractAttribute.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractAttribute.cs @@ -9,10 +9,10 @@ namespace System.Runtime.Serialization { string name; string ns; - bool isNameSetExplicit; - bool isNamespaceSetExplicit; + bool isNameSetExplicitly; + bool isNamespaceSetExplicitly; bool isReference; - bool isReferenceSetExplicit; + bool isReferenceSetExplicitly; public DataContractAttribute() { @@ -24,13 +24,13 @@ namespace System.Runtime.Serialization set { isReference = value; - isReferenceSetExplicit = true; + isReferenceSetExplicitly = true; } } - internal bool IsReferenceSetExplicit + public bool IsReferenceSetExplicitly { - get { return isReferenceSetExplicit; } + get { return isReferenceSetExplicitly; } } public string Namespace @@ -39,13 +39,13 @@ namespace System.Runtime.Serialization set { ns = value; - isNamespaceSetExplicit = true; + isNamespaceSetExplicitly = true; } } - internal bool IsNamespaceSetExplicit + public bool IsNamespaceSetExplicitly { - get { return isNamespaceSetExplicit; } + get { return isNamespaceSetExplicitly; } } public string Name @@ -54,13 +54,13 @@ namespace System.Runtime.Serialization set { name = value; - isNameSetExplicit = true; + isNameSetExplicitly = true; } } - internal bool IsNameSetExplicit + public bool IsNameSetExplicitly { - get { return isNameSetExplicit; } + get { return isNameSetExplicitly; } } } diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractSet.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractSet.cs index 7c541c25dd..ca40aeefd6 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractSet.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataContractSet.cs @@ -15,8 +15,6 @@ namespace System.Runtime.Serialization internal class DataContractSet { - // Same string used in MessageContractImporter of System.ServiceModel.dll - const String FailedReferenceTypeExceptionKey = "System.Runtime.Serialization.FailedReferenceType"; Dictionary contracts; Dictionary processedContracts; IDataContractSurrogate dataContractSurrogate; @@ -368,20 +366,7 @@ namespace System.Runtime.Serialization if (type == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ReferencedTypesCannotContainNull))); - try - { - AddReferencedType(referencedTypesDictionary, type); - } - catch (InvalidDataContractException ex) - { - ex.Data.Add(FailedReferenceTypeExceptionKey, type); - throw; - } - catch (InvalidOperationException ex) - { - ex.Data.Add(FailedReferenceTypeExceptionKey, type); - throw; - } + AddReferencedType(referencedTypesDictionary, type); } } } @@ -413,7 +398,22 @@ namespace System.Runtime.Serialization { if (IsTypeReferenceable(type)) { - XmlQualifiedName stableName = this.GetStableName(type); + XmlQualifiedName stableName; + try + { + stableName = this.GetStableName(type); + } + catch (InvalidDataContractException) + { + // Type not referenceable if we can't get a stable name. + return; + } + catch (InvalidOperationException) + { + // Type not referenceable if we can't get a stable name. + return; + } + object value; if (referencedTypes.TryGetValue(stableName, out value)) { @@ -500,11 +500,28 @@ namespace System.Runtime.Serialization static bool IsTypeReferenceable(Type type) { Type itemType; - return (type.IsSerializable || - type.IsDefined(Globals.TypeOfDataContractAttribute, false) || - (Globals.TypeOfIXmlSerializable.IsAssignableFrom(type) && !type.IsGenericTypeDefinition) || - CollectionDataContract.IsCollection(type, out itemType) || - ClassDataContract.IsNonAttributedTypeValidForSerialization(type)); + + try + { + return (type.IsSerializable || + type.IsDefined(Globals.TypeOfDataContractAttribute, false) || + (Globals.TypeOfIXmlSerializable.IsAssignableFrom(type) && !type.IsGenericTypeDefinition) || + CollectionDataContract.IsCollection(type, out itemType) || + ClassDataContract.IsNonAttributedTypeValidForSerialization(type)); + } + catch (Exception ex) + { + // An exception can be thrown in the designer when a project has a runtime binding redirection for a referenced assembly or a reference dependent assembly. + // Type.IsDefined is known to throw System.IO.FileLoadException. + // ClassDataContract.IsNonAttributedTypeValidForSerialization is known to throw System.IO.FileNotFoundException. + // We guard against all non-critical exceptions. + if (Fx.IsFatal(ex)) + { + throw; + } + } + + return false; } } } diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataMemberAttribute.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataMemberAttribute.cs index 114f1a94ba..0da4890600 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataMemberAttribute.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/DataMemberAttribute.cs @@ -8,7 +8,7 @@ namespace System.Runtime.Serialization public sealed class DataMemberAttribute : Attribute { string name; - bool isNameSetExplicit; + bool isNameSetExplicitly; int order = -1; bool isRequired; bool emitDefaultValue = Globals.DefaultEmitDefaultValue; @@ -20,12 +20,12 @@ namespace System.Runtime.Serialization public string Name { get { return name; } - set { name = value; isNameSetExplicit = true; } + set { name = value; isNameSetExplicitly = true; } } - internal bool IsNameSetExplicit + public bool IsNameSetExplicitly { - get { return isNameSetExplicit; } + get { return isNameSetExplicitly; } } public int Order diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/EnumDataContract.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/EnumDataContract.cs index f9c411fdf4..d9f1dc3128 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/EnumDataContract.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/EnumDataContract.cs @@ -290,7 +290,7 @@ namespace System.Runtime.Serialization EnumMemberAttribute memberAttribute = (EnumMemberAttribute)memberAttributes[0]; DataMember memberContract = new DataMember(field); - if (memberAttribute.IsValueSetExplicit) + if (memberAttribute.IsValueSetExplicitly) { if (memberAttribute.Value == null || memberAttribute.Value.Length == 0) ThrowInvalidDataContractException(SR.GetString(SR.InvalidEnumMemberValue, field.Name, DataContract.GetClrTypeFullName(type))); diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/EnumMemberAttribute.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/EnumMemberAttribute.cs index 6a0fb9b47c..fbcc335330 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/EnumMemberAttribute.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/EnumMemberAttribute.cs @@ -8,7 +8,7 @@ namespace System.Runtime.Serialization public sealed class EnumMemberAttribute : Attribute { string value; - bool isValueSetExplicit; + bool isValueSetExplicitly; public EnumMemberAttribute() { @@ -17,12 +17,12 @@ namespace System.Runtime.Serialization public string Value { get { return this.value; } - set { this.value = value; this.isValueSetExplicit = true; } + set { this.value = value; this.isValueSetExplicitly = true; } } - internal bool IsValueSetExplicit + public bool IsValueSetExplicitly { - get { return this.isValueSetExplicit; } + get { return this.isValueSetExplicitly; } } } } diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Globals.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Globals.cs index fa97ce9c0b..f18da31004 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Globals.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Globals.cs @@ -1092,23 +1092,6 @@ namespace System.Runtime.Serialization } } - [SecurityCritical] - static Type typeOfSafeSerializationManager; - static bool typeOfSafeSerializationManagerSet; - internal static Type TypeOfSafeSerializationManager - { - [SecuritySafeCritical] - get - { - if (!typeOfSafeSerializationManagerSet) - { - typeOfSafeSerializationManager = TypeOfInt.Assembly.GetType("System.Runtime.Serialization.SafeSerializationManager"); - typeOfSafeSerializationManagerSet = true; - } - return typeOfSafeSerializationManager; - } - } - [SecurityCritical] static Uri dataContractXsdBaseNamespaceUri; internal static Uri DataContractXsdBaseNamespaceUri @@ -1122,6 +1105,7 @@ namespace System.Runtime.Serialization } } +#if !DISABLE_CAS_USE [Fx.Tag.SecurityNote(Critical = "Holds instance of SecurityPermission that we will Demand for SerializationFormatter." + " Should not be modified to something else.")] [SecurityCritical] @@ -1153,7 +1137,7 @@ namespace System.Runtime.Serialization return memberAccessPermission; } } - +#endif public const bool DefaultIsRequired = false; public const bool DefaultEmitDefaultValue = true; @@ -1164,8 +1148,6 @@ namespace System.Runtime.Serialization public readonly static string NewObjectId = string.Empty; public const string SimpleSRSInternalsVisiblePattern = @"^[\s]*System\.Runtime\.Serialization[\s]*$"; public const string FullSRSInternalsVisiblePattern = @"^[\s]*System\.Runtime\.Serialization[\s]*,[\s]*PublicKey[\s]*=[\s]*(?i:00000000000000000400000000000000)[\s]*$"; - public const string SafeSerializationManagerName = "SafeSerializationManager"; - public const string SafeSerializationManagerNamespace = "http://schemas.datacontract.org/2004/07/System.Runtime.Serialization"; public const string NullObjectId = null; public const string Space = " "; public const string OpenBracket = "["; diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/JsonNodeType.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/JsonNodeType.cs index c0f6374a40..b99510be2b 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/JsonNodeType.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/Json/JsonNodeType.cs @@ -14,4 +14,4 @@ namespace System.Runtime.Serialization.Json StandaloneText, Collection } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerContext.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerContext.cs index c1f09aedca..6a71d9a194 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerContext.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerContext.cs @@ -89,11 +89,13 @@ namespace System.Runtime.Serialization [SecuritySafeCritical] public void DemandSerializationFormatterPermission() { +#if !DISABLE_CAS_USE if (!demandedSerializationFormatterPermission) { Globals.SerializationFormatterPermission.Demand(); demandedSerializationFormatterPermission = true; } +#endif } [Fx.Tag.SecurityNote(Critical = "Demands MemberAccess permission. demanding the right permission is critical.", @@ -101,11 +103,13 @@ namespace System.Runtime.Serialization [SecuritySafeCritical] public void DemandMemberAccessPermission() { +#if !DISABLE_CAS_USE if (!demandedMemberAccessPermission) { Globals.MemberAccessPermission.Demand(); demandedMemberAccessPermission = true; } + #endif } public StreamingContext GetStreamingContext() @@ -278,10 +282,6 @@ namespace System.Runtime.Serialization DataContract dataContract = PrimitiveDataContract.GetPrimitiveDataContract(typeName.Name, typeName.Namespace); if (dataContract == null) { - if (typeName.Name == Globals.SafeSerializationManagerName && typeName.Namespace == Globals.SafeSerializationManagerNamespace && Globals.TypeOfSafeSerializationManager != null) - { - return GetDataContract(Globals.TypeOfSafeSerializationManager); - } dataContract = scopedKnownTypes.GetDataContract(typeName); if (dataContract == null) { diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerReadContextComplex.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerReadContextComplex.cs index 4479f5055a..acc54533c8 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerReadContextComplex.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerReadContextComplex.cs @@ -193,7 +193,7 @@ namespace System.Runtime.Serialization { if (TD.DCDeserializeWithSurrogateStartIsEnabled()) { - TD.DCDeserializeWithSurrogateStart(surrogateDataContract.UnderlyingType.FullName); + TD.DCDeserializeWithSurrogateStart(declaredType.FullName); } DataContract dataContract = surrogateDataContract ?? diff --git a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerWriteContext.cs b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerWriteContext.cs index a5f77c25af..3d953393b4 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerWriteContext.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerWriteContext.cs @@ -494,8 +494,10 @@ namespace System.Runtime.Serialization [MethodImpl(MethodImplOptions.NoInlining)] internal void GetObjectData(ISerializable obj, SerializationInfo serInfo, StreamingContext context) { +#if !DISABLE_CAS_USE // Demand the serialization formatter permission every time Globals.SerializationFormatterPermission.Demand(); +#endif obj.GetObjectData(serInfo, context); } diff --git a/external/referencesource/System.Runtime.Serialization/System/Xml/XmlBaseReader.cs.REMOVED.git-id b/external/referencesource/System.Runtime.Serialization/System/Xml/XmlBaseReader.cs.REMOVED.git-id index 564783321f..ba8488be21 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Xml/XmlBaseReader.cs.REMOVED.git-id +++ b/external/referencesource/System.Runtime.Serialization/System/Xml/XmlBaseReader.cs.REMOVED.git-id @@ -1 +1 @@ -6b1de6eb1d939934205dc38fa1676f6dfdb83186 \ No newline at end of file +008ed195fb5be846e544d683f6ae95ec2f25c1fe \ No newline at end of file diff --git a/external/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryWriter.cs b/external/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryWriter.cs index 5c94636bb6..bfb1b2a982 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryWriter.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Xml/XmlDictionaryWriter.cs @@ -523,7 +523,10 @@ namespace System.Xml Operation operation = Operation.Read; IStreamProvider streamProvider; XmlDictionaryWriter writer; + Func writeBlockHandler; + static Func handleWriteBlock = HandleWriteBlock; + static Func handleWriteBlockAsync = HandleWriteBlockAsync; static AsyncCallback onContinueWork = Fx.ThunkCallback(OnContinueWork); public WriteValueAsyncResult(XmlDictionaryWriter writer, IStreamProvider value, AsyncCallback callback, object state) @@ -531,6 +534,7 @@ namespace System.Xml { this.streamProvider = value; this.writer = writer; + this.writeBlockHandler = this.writer.Settings != null && this.writer.Settings.Async ? handleWriteBlockAsync : handleWriteBlock; this.stream = value.GetStream(); if (this.stream == null) { @@ -598,7 +602,7 @@ namespace System.Xml } else { - if (HandleWriteBlock(result)) + if (this.writeBlockHandler(result, this)) { // Write completed ([....] or async, doesn't matter) AdjustBlockSize(); @@ -631,24 +635,43 @@ namespace System.Xml } //returns whether or not I completed. - bool HandleWriteBlock(IAsyncResult result) + static bool HandleWriteBlock(IAsyncResult result, WriteValueAsyncResult thisPtr) { if (result == null) { - result = this.writer.BeginWriteBase64(this.block, 0, this.bytesRead, onContinueWork, this); + result = thisPtr.writer.BeginWriteBase64(thisPtr.block, 0, thisPtr.bytesRead, onContinueWork, thisPtr); if (!result.CompletedSynchronously) { return false; } } - this.writer.EndWriteBase64(result); + thisPtr.writer.EndWriteBase64(result); + return true; + } + + //returns whether or not I completed. + static bool HandleWriteBlockAsync(IAsyncResult result, WriteValueAsyncResult thisPtr) + { + Task task = (Task)result; + + if (task == null) + { + task = thisPtr.writer.WriteBase64Async(thisPtr.block, 0, thisPtr.bytesRead); + task.AsAsyncResult(onContinueWork, thisPtr); + return false; + } + + task.GetAwaiter().GetResult(); + return true; } static void OnContinueWork(IAsyncResult result) { - if (result.CompletedSynchronously) + // If result is a Task we shouldn't check for Synchronous completion + // We should only return if we're in the async completion path and if the result completed synchronously. + if (result.CompletedSynchronously && !(result is Task)) { return; } diff --git a/external/referencesource/System.Runtime.Serialization/System/Xml/XmlStreamNodeWriter.cs b/external/referencesource/System.Runtime.Serialization/System/Xml/XmlStreamNodeWriter.cs index a31aeb7668..7162dbfa38 100644 --- a/external/referencesource/System.Runtime.Serialization/System/Xml/XmlStreamNodeWriter.cs +++ b/external/referencesource/System.Runtime.Serialization/System/Xml/XmlStreamNodeWriter.cs @@ -656,9 +656,13 @@ namespace System.Xml while (true) { - while (chars < charsMax && *chars < 0x80) + while (chars < charsMax) { - *bytes = (byte)(*chars); + char t = *chars; + if (t >= 0x80) + break; + + *bytes = (byte)t; bytes++; chars++; } diff --git a/external/referencesource/System.ServiceModel.Activation/System/ServiceModel/Activation/IServiceModelActivationHandler.cs b/external/referencesource/System.ServiceModel.Activation/System/ServiceModel/Activation/IServiceModelActivationHandler.cs index 87872c243c..cc29448954 100644 --- a/external/referencesource/System.ServiceModel.Activation/System/ServiceModel/Activation/IServiceModelActivationHandler.cs +++ b/external/referencesource/System.ServiceModel.Activation/System/ServiceModel/Activation/IServiceModelActivationHandler.cs @@ -10,4 +10,4 @@ namespace System.ServiceModel.Activation { ServiceHostFactoryBase GetFactory(); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel.Activities/SuppressMessages.cs b/external/referencesource/System.ServiceModel.Activities/SuppressMessages.cs index 5187c6b8b8..9caa3edf6b 100644 --- a/external/referencesource/System.ServiceModel.Activities/SuppressMessages.cs +++ b/external/referencesource/System.ServiceModel.Activities/SuppressMessages.cs @@ -6,7 +6,7 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime; - // + // TODO, 47676, see the TODO on BookmarkNameHelper.CreateBookmarkName [module: SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUncalledPrivateCode, Scope = "member", Target = "System.ServiceModel.Activities.SR.ConflictingBookmarkName(System.Object,System.Object):System.String")] [module: SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUncalledPrivateCode, Scope = "member", Target = "System.ServiceModel.Activities.SR.TransactedReceiveScopeMustHaveValidReceive(System.Object):System.String")] [module: SuppressMessage(FxCop.Category.Performance, FxCop.Rule.AvoidUncalledPrivateCode, Scope = "member", Target = "System.ServiceModel.Activities.SR.AbortInstanceOnTransactionFailureDoesNotMatch(System.Object,System.Object):System.String")] diff --git a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/AppSettings.cs b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/AppSettings.cs index 4265ccae14..6a4ec0676b 100644 --- a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/AppSettings.cs +++ b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/AppSettings.cs @@ -15,11 +15,17 @@ namespace System.ServiceModel.Activities // false [default] to NOT have InstanceKeys automatically disassociated by default, so that they stay around until the completion of the workflow. // true to have InstanceKeys automatically dissociated by default. Doing this affects the extensibility point WorkflowInstance.OnDisassociateKeys. - // + // // // NOTE - There is a similar setting in System.Activities because the changes affected by this are in both assemblies. private static bool defaultAutomaticInstanceKeyDisassociation; + // The number of seconds to wait for non-protocol bookmarks if we receive a request, but the protocol bookmark for that Receive activity is not ready. + // Default = 60 (1 minute). + // A value of 0 implies that we should not wait at all and the "out of order" exception should be thrown, rather than the timeout exception. + // + private static int filterResumeTimeoutInSeconds; + internal static bool DefaultAutomaticInstanceKeyDisassociation { get @@ -29,6 +35,15 @@ namespace System.ServiceModel.Activities } } + internal static int FilterResumeTimeoutInSeconds + { + get + { + EnsureSettingsLoaded(); + return filterResumeTimeoutInSeconds; + } + } + private static void EnsureSettingsLoaded() { if (!settingsInitialized) @@ -50,11 +65,17 @@ namespace System.ServiceModel.Activities defaultAutomaticInstanceKeyDisassociation = false; } + if (settings == null || !int.TryParse(settings["microsoft:WorkflowServices:FilterResumeTimeoutInSeconds"], out filterResumeTimeoutInSeconds) || + (filterResumeTimeoutInSeconds < 0)) + { + filterResumeTimeoutInSeconds = 60; + } + settingsInitialized = true; } } } } - } + } } } diff --git a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/WorkflowServiceInstance.cs.REMOVED.git-id b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/WorkflowServiceInstance.cs.REMOVED.git-id index 0aa593141b..f3655fcb3d 100644 --- a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/WorkflowServiceInstance.cs.REMOVED.git-id +++ b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/Dispatcher/WorkflowServiceInstance.cs.REMOVED.git-id @@ -1 +1 @@ -cf3db836fbd33190f34d8037fc149fcf0adabc61 \ No newline at end of file +e5ea1459fff7b1cd603c92ad680205fd8d059d63 \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/IWorkflowInstanceManagement.cs b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/IWorkflowInstanceManagement.cs index c46da590cf..f0ac8481d0 100644 --- a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/IWorkflowInstanceManagement.cs +++ b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/IWorkflowInstanceManagement.cs @@ -76,7 +76,7 @@ namespace System.ServiceModel.Activities void EndUnsuspend(IAsyncResult result); //Transacted Operation - // + // TODO, 21237, Post One-Way Tx flow support below operations should be changed to Oneway. [OperationContract(Name = XD2.WorkflowInstanceManagementService.TransactedCancel)] [TransactionFlow(TransactionFlowOption.Allowed)] diff --git a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/SerializerOption.cs b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/SerializerOption.cs index 0f15577587..fd8f1477db 100644 --- a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/SerializerOption.cs +++ b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/SerializerOption.cs @@ -12,4 +12,4 @@ namespace System.ServiceModel.Activities DataContractSerializer, XmlSerializer }; -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/WorkflowService.cs b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/WorkflowService.cs index ff7cacca10..f955b0e8c4 100644 --- a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/WorkflowService.cs +++ b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/WorkflowService.cs @@ -295,6 +295,10 @@ namespace System.ServiceModel.Activities SkipValidatingRootConfiguration = source.SkipValidatingRootConfiguration, PrepareForRuntime = source.PrepareForRuntime, Environment = source.Environment, + // Retain the same cancellation token. Otherwise we can't cancel the validation of WorkflowService objects + // which can make the designer unreponsive if the validation takes a long time. + CancellationToken = source.CancellationToken + }; foreach (KeyValuePair> constrants in source.AdditionalConstraints) diff --git a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/WorkflowServiceHost.cs b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/WorkflowServiceHost.cs index 35b49245a6..3574b87ff0 100644 --- a/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/WorkflowServiceHost.cs +++ b/external/referencesource/System.ServiceModel.Activities/System/ServiceModel/Activities/WorkflowServiceHost.cs @@ -31,7 +31,6 @@ namespace System.ServiceModel.Activities static readonly Type mexBehaviorType = typeof(ServiceMetadataBehavior); static readonly TimeSpan defaultPersistTimeout = TimeSpan.FromSeconds(30); static readonly TimeSpan defaultTrackTimeout = TimeSpan.FromSeconds(30); - static readonly TimeSpan defaultFilterResumeTimeout = TimeSpan.FromMinutes(1); static readonly Type baseActivityType = typeof(Activity); static readonly Type correlationQueryBehaviorType = typeof(CorrelationQueryBehavior); static readonly Type bufferedReceiveServiceBehaviorType = typeof(BufferedReceiveServiceBehavior); @@ -482,7 +481,7 @@ namespace System.ServiceModel.Activities this.PersistTimeout = defaultPersistTimeout; this.TrackTimeout = defaultTrackTimeout; - this.FilterResumeTimeout = defaultFilterResumeTimeout; + this.FilterResumeTimeout = TimeSpan.FromSeconds(AppSettings.FilterResumeTimeoutInSeconds); } protected override void InitializeRuntime() diff --git a/external/referencesource/System.ServiceModel.Channels/AssemblyInfo.cs b/external/referencesource/System.ServiceModel.Channels/AssemblyInfo.cs index 8bf65c7eef..fc11912b0f 100644 --- a/external/referencesource/System.ServiceModel.Channels/AssemblyInfo.cs +++ b/external/referencesource/System.ServiceModel.Channels/AssemblyInfo.cs @@ -25,4 +25,4 @@ using System.Windows.Markup; // Friend assemblies [assembly: InternalsVisibleToAttribute("NetFx.Checkin.Common.NetFxFriends, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] -[assembly: InternalsVisibleToAttribute("System.ServiceModel.Friend, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] +[assembly: InternalsVisibleToAttribute("System.ServiceModel.Friend, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/ByteStreamMessage.cs b/external/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/ByteStreamMessage.cs index 8e8428a649..7a76f6e4a2 100644 --- a/external/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/ByteStreamMessage.cs +++ b/external/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/ByteStreamMessage.cs @@ -8,6 +8,7 @@ namespace System.ServiceModel.Channels using System.IO; using System.Net.Http; using System.Runtime; + using System.Threading.Tasks; using System.Xml; public static class ByteStreamMessage @@ -552,6 +553,13 @@ namespace System.ServiceModel.Channels static bool HandleWriteBodyContents(IAsyncResult result) { + // If result is a task, we need to get the result so that exceptions are bubbled up in case the task is faulted. + Task t = result as Task; + if (t != null) + { + t.GetAwaiter().GetResult(); + } + WriteBodyContentsAsyncResult thisPtr = (WriteBodyContentsAsyncResult)result.AsyncState; thisPtr.writer.WriteEndElement(); return true; diff --git a/external/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/XmlByteStreamWriter.cs b/external/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/XmlByteStreamWriter.cs index dd553772c3..d337effa36 100644 --- a/external/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/XmlByteStreamWriter.cs +++ b/external/referencesource/System.ServiceModel.Channels/System/ServiceModel/Channels/XmlByteStreamWriter.cs @@ -7,6 +7,7 @@ namespace System.ServiceModel.Channels using System; using System.IO; using System.Runtime; + using System.Threading; using System.Threading.Tasks; using System.Xml; @@ -15,6 +16,7 @@ namespace System.ServiceModel.Channels bool ownsStream; ByteStreamWriterState state; Stream stream; + XmlWriterSettings settings; public XmlByteStreamWriter(Stream stream, bool ownsStream) { @@ -30,6 +32,24 @@ namespace System.ServiceModel.Channels get { return ByteStreamWriterStateToWriteState(this.state); } } + public override XmlWriterSettings Settings + { + get + { + if (settings == null) + { + XmlWriterSettings newSettings = new XmlWriterSettings() + { + Async = true + }; + + Interlocked.CompareExchange(ref this.settings, newSettings, null); + } + + return this.settings; + } + } + public override void Close() { if (this.state != ByteStreamWriterState.Closed) diff --git a/external/referencesource/System.ServiceModel.Discovery/AssemblyInfo.cs b/external/referencesource/System.ServiceModel.Discovery/AssemblyInfo.cs index 4e2db6bd50..66c938965e 100644 --- a/external/referencesource/System.ServiceModel.Discovery/AssemblyInfo.cs +++ b/external/referencesource/System.ServiceModel.Discovery/AssemblyInfo.cs @@ -3,4 +3,4 @@ using System.Runtime.CompilerServices; // Friends Assembly [assembly: InternalsVisibleTo("System.ServiceModel.Friend, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] -// Partial Trust : +// Partial Trust : \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel.Internals/AssemblyInfo.cs b/external/referencesource/System.ServiceModel.Internals/AssemblyInfo.cs index 8377034069..715b38b201 100644 --- a/external/referencesource/System.ServiceModel.Internals/AssemblyInfo.cs +++ b/external/referencesource/System.ServiceModel.Internals/AssemblyInfo.cs @@ -58,7 +58,7 @@ using System.Security.Permissions; [assembly: InternalsVisibleTo("System.Activities.DurableInstancing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("XsdBuildTask, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] -// +// TODO, 62799, fix this to be System.Runtime.Friend [assembly: InternalsVisibleTo("System.ServiceModel.Friend, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] [assembly: InternalsVisibleTo("Microsoft.CDF.Test.Persistence, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("CDF.CIT.Scenarios.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs b/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs index 5089c87277..f3ab701ee2 100644 --- a/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs +++ b/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/DiagnosticTraceBase.cs @@ -309,7 +309,9 @@ namespace System.Runtime.Diagnostics { currentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionHandler); this.SetLevel(this.TraceSource.Switch.Level); +#if MONO_FEATURE_MULTIPLE_APPDOMAINS currentDomain.DomainUnload += new EventHandler(ExitOrUnloadEventHandler); +#endif currentDomain.ProcessExit += new EventHandler(ExitOrUnloadEventHandler); } } diff --git a/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogCategory.cs b/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogCategory.cs index 1417a78c8a..033f09386f 100644 --- a/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogCategory.cs +++ b/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogCategory.cs @@ -23,4 +23,4 @@ namespace System.Runtime.Diagnostics ListenerAdapter } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogEventId.cs b/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogEventId.cs index eeb8e04a67..d7fcf0b3d2 100644 --- a/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogEventId.cs +++ b/external/referencesource/System.ServiceModel.Internals/System/Runtime/Diagnostics/EventLogEventId.cs @@ -18,7 +18,7 @@ namespace System.Runtime.Diagnostics // The Severity and Facility assigned in EventLog.mc must match those assigned via the EventId here. // If the EventId's do not match, the EventViewer will not be able to display the strings defined in EventLog.mc correctly. In this case, the following error message will be included in the logged event: // "The description for Event ID XX from source System.ServiceModel 4.0.0.0 cannot be found..." - // To inspect the value ----igend to the enum elements below, build 'ndp\cdf\src\System.ServiceModel.Internals', and inspect System.ServiceModel.Internals\System.ServiceModel.Internals.asmmeta + // To inspect the value assigend to the enum elements below, build 'ndp\cdf\src\System.ServiceModel.Internals', and inspect System.ServiceModel.Internals\System.ServiceModel.Internals.asmmeta // To inspect the EventId generated from EventLog.mc, build 'ndp\cdf\src\WCF\EventLog', and open ServiceModelEvents.dll.mui with \\indigofs\PrivateLabDebugShare\sarada\RPFRecorder\RPFRecorder.exe (convert EventId from decimal to hex). // You could also use any other method of viewing ServiceModelEvents.dll.mui which would allow you to inspect the EventId enum EventLogEventId : uint diff --git a/external/referencesource/System.ServiceModel.Internals/System/Runtime/Interop/UnsafeNativeMethods.cs b/external/referencesource/System.ServiceModel.Internals/System/Runtime/Interop/UnsafeNativeMethods.cs index 5b7526842c..8cc7d8e10e 100644 --- a/external/referencesource/System.ServiceModel.Internals/System/Runtime/Interop/UnsafeNativeMethods.cs +++ b/external/referencesource/System.ServiceModel.Internals/System/Runtime/Interop/UnsafeNativeMethods.cs @@ -13,6 +13,7 @@ namespace System.Runtime.Interop using System.Runtime.InteropServices; using System.Diagnostics.CodeAnalysis; using System.Runtime.Diagnostics; + using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME; [SuppressUnmanagedCodeSecurity] static class UnsafeNativeMethods @@ -34,7 +35,7 @@ namespace System.Runtime.Interop internal uint Size; [FieldOffset(12)] internal int Reserved; - } + } [SuppressMessage(FxCop.Category.Security, FxCop.Rule.ReviewSuppressUnmanagedCodeSecurityUsage, Justification = "This PInvoke call has been reviewed")] @@ -73,7 +74,17 @@ namespace System.Runtime.Interop [DllImport(KERNEL32, SetLastError = true)] [ResourceExposure(ResourceScope.None)] [SecurityCritical] - public static extern void GetSystemTimeAsFileTime([Out] out long time); + private static extern void GetSystemTimeAsFileTime([Out] out FILETIME time); + + [SecurityCritical] + public static void GetSystemTimeAsFileTime(out long time) { + FILETIME fileTime; + GetSystemTimeAsFileTime(out fileTime); + time = 0; + time |= (uint)fileTime.dwHighDateTime; + time <<= sizeof(uint) * 8; + time |= (uint)fileTime.dwLowDateTime; + } [SuppressMessage(FxCop.Category.Security, FxCop.Rule.SpecifyMarshalingForPInvokeStringArguments, Justification = "")] [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto)] diff --git a/external/referencesource/System.ServiceModel.Routing/System/ServiceModel/Routing/ProcessRequestAsyncResult.cs b/external/referencesource/System.ServiceModel.Routing/System/ServiceModel/Routing/ProcessRequestAsyncResult.cs index 96de717996..707fae242d 100644 --- a/external/referencesource/System.ServiceModel.Routing/System/ServiceModel/Routing/ProcessRequestAsyncResult.cs +++ b/external/referencesource/System.ServiceModel.Routing/System/ServiceModel/Routing/ProcessRequestAsyncResult.cs @@ -248,6 +248,22 @@ namespace System.ServiceModel.Routing return true; } } + else if (exception is ProtocolException) + { + // This exception may happen when the current cached channel was closed due to end service recycles. + // We abort the channel in this case and clean it up from the session. + // We will then retry the request one more time only. In retried request, it will create a new channel because the cached channel has been cleaned up. + if (!this.abortedRetry) + { + SessionChannels sessionChannels = this.service.GetSessionChannels(this.messageRpc.Impersonating); + if (sessionChannels != null) + { + this.abortedRetry = true; + sessionChannels.AbortChannel(sendOperation.CurrentEndpoint); + return true; + } + } + } if (sendOperation.TryMoveToAlternate(exception)) { diff --git a/external/referencesource/System.ServiceModel.Web/GlobalSuppressions.cs b/external/referencesource/System.ServiceModel.Web/GlobalSuppressions.cs index e430960c25..332b14376f 100644 --- a/external/referencesource/System.ServiceModel.Web/GlobalSuppressions.cs +++ b/external/referencesource/System.ServiceModel.Web/GlobalSuppressions.cs @@ -7,7 +7,7 @@ using System.Diagnostics.CodeAnalysis; [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.ServiceModel.SR2.resources", MessageId = "Infos", Justification = "This represents the ParameterInfo class defined in System.Reflection")] [module: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "namespace", Target = "System.Xml.Linq", MessageId = "Linq")] -// [....], BEGIN FxCop violations for code in Microsoft.Web.Script.Services.* +// krisragh, BEGIN FxCop violations for code in Microsoft.Web.Script.Services.* [module: SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline", Scope = "member", Target = "Microsoft.Web.Script.Services.WebServiceTypeData..cctor()")] [module: SuppressMessage("Reliability", "Reliability102:WrapExceptionsRule", Scope = "member", Target = "Microsoft.Web.Script.Services.WebServiceTypeData.ThrowCannotGenerateProxyForTypeError(System.Xml.XmlQualifiedName):System.Void")] [module: SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Scope = "member", Target = "Microsoft.Web.Script.Services.WebServiceClientProxyGenerator..ctor(System.String,System.Boolean)", MessageId = "debug")] @@ -25,7 +25,7 @@ using System.Diagnostics.CodeAnalysis; [module: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Web.Script.Services.WebServiceParameterData.get_ParameterType():Microsoft.Web.Script.Services.WebServiceTypeData")] [module: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Web.Script.Services.WebServiceTypeData.set_TypeName(System.String):System.Void")] [module: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Web.Script.Services.WebServiceTypeData.set_TypeNamespace(System.String):System.Void")] -// [....], END FxCop violations for code in Microsoft.Web.Script.Services.* +// krisragh, END FxCop violations for code in Microsoft.Web.Script.Services.* [module: SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Scope = "member", Target = "System.Runtime.Serialization.DataContractContentExtensions.ReadAsDataContract(System.ServiceModel.Web.Client.Http.HttpContent,System.Runtime.Serialization.DataContractSerializer):T")] diff --git a/external/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/HelpHtmlBuilder.cs b/external/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/HelpHtmlBuilder.cs index 9f3b6f5699..84ca48641c 100644 --- a/external/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/HelpHtmlBuilder.cs +++ b/external/referencesource/System.ServiceModel.Web/System/ServiceModel/Dispatcher/HelpHtmlBuilder.cs @@ -363,7 +363,7 @@ namespace System.ServiceModel.Dispatcher else { return new XElement(HtmlPElementName, - new XElement(HtmlAElementName, new XAttribute(HtmlNameAttributeName, "#" + label), title), + new XElement(HtmlAElementName, new XAttribute(HtmlNameAttributeName, label), title), new XElement(HtmlPreElementName, new XAttribute(HtmlClassAttributeName, label), content)); } } diff --git a/external/referencesource/System.ServiceModel/InternalApis/Clr/inc/AppContextDefaultValues.cs b/external/referencesource/System.ServiceModel/InternalApis/Clr/inc/AppContextDefaultValues.cs new file mode 100644 index 0000000000..8a130a0f34 --- /dev/null +++ b/external/referencesource/System.ServiceModel/InternalApis/Clr/inc/AppContextDefaultValues.cs @@ -0,0 +1,169 @@ +// ==++== +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// ==--== +using System; +using System.Collections.Generic; + +namespace System +{ + internal static partial class AppContextDefaultValues + { + public static void PopulateDefaultValues() + { + string platformIdentifier, profile; + int version; + + ParseTargetFrameworkName(out platformIdentifier, out profile, out version); + + // Call into each library to populate their default switches + PopulateDefaultValuesPartial(platformIdentifier, profile, version); + } + + /// + /// We have this separate method for getting the parsed elements out of the TargetFrameworkName so we can + /// more easily support this on other platforms. + /// + private static void ParseTargetFrameworkName(out string identifier, out string profile, out int version) + { + string targetFrameworkMoniker = AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName; + + // If we don't have a TFM then we should default to the 4.0 behavior where all quirks are turned on. + if (!TryParseFrameworkName(targetFrameworkMoniker, out identifier, out version, out profile)) + { +#if FEATURE_CORECLR + if (CompatibilitySwitches.UseLatestBehaviorWhenTFMNotSpecified) + { + // If we want to use the latest behavior it is enough to set the value of the switch to string.Empty. + // When the get to the caller of this method (PopulateDefaultValuesPartial) we are going to use the + // identifier we just set to decide which switches to turn on. By having an empty string as the + // identifier we are simply saying -- don't turn on any switches, and we are going to get the latest + // behavior for all the switches + identifier = string.Empty; + } + else +#endif + { + identifier = ".NETFramework"; + version = 40000; + profile = string.Empty; + } + } + } + + // This code was a constructor copied from the FrameworkName class, which is located in System.dll. + // Parses strings in the following format: ", Version=[v|V], Profile=" + // - The identifier and version is required, profile is optional + // - Only three components are allowed. + // - The version string must be in the System.Version format; an optional "v" or "V" prefix is allowed + private static bool TryParseFrameworkName(String frameworkName, out String identifier, out int version, out String profile) + { + // For parsing a target Framework moniker, from the FrameworkName class + const char c_componentSeparator = ','; + const char c_keyValueSeparator = '='; + const char c_versionValuePrefix = 'v'; + const String c_versionKey = "Version"; + const String c_profileKey = "Profile"; + + identifier = profile = string.Empty; + version = 0; + + if (frameworkName == null || frameworkName.Length == 0) + { + return false; + } + + String[] components = frameworkName.Split(c_componentSeparator); + version = 0; + + // Identifer and Version are required, Profile is optional. + if (components.Length < 2 || components.Length > 3) + { + return false; + } + + // + // 1) Parse the "Identifier", which must come first. Trim any whitespace + // + identifier = components[0].Trim(); + + if (identifier.Length == 0) + { + return false; + } + + bool versionFound = false; + profile = null; + + // + // The required "Version" and optional "Profile" component can be in any order + // + for (int i = 1; i < components.Length; i++) + { + // Get the key/value pair separated by '=' + string[] keyValuePair = components[i].Split(c_keyValueSeparator); + + if (keyValuePair.Length != 2) + { + return false; + } + + // Get the key and value, trimming any whitespace + string key = keyValuePair[0].Trim(); + string value = keyValuePair[1].Trim(); + + // + // 2) Parse the required "Version" key value + // + if (key.Equals(c_versionKey, StringComparison.OrdinalIgnoreCase)) + { + versionFound = true; + + // Allow the version to include a 'v' or 'V' prefix... + if (value.Length > 0 && (value[0] == c_versionValuePrefix || value[0] == 'V')) + { + value = value.Substring(1); + } + Version realVersion = new Version(value); + // The version class will represent some unset values as -1 internally (instead of 0). + version = realVersion.Major * 10000; + if (realVersion.Minor > 0) + version += realVersion.Minor * 100; + if (realVersion.Build > 0) + version += realVersion.Build; + } + // + // 3) Parse the optional "Profile" key value + // + else if (key.Equals(c_profileKey, StringComparison.OrdinalIgnoreCase)) + { + if (!String.IsNullOrEmpty(value)) + { + profile = value; + } + } + else + { + return false; + } + } + + if (!versionFound) + { + return false; + } + + return true; + } + + // This is a partial method. Platforms (such as Desktop) can provide an implementation of it that will read override value + // from whatever mechanism is available on that platform. If no implementation is provided, the compiler is going to remove the calls + // to it from the code + static partial void TryGetSwitchOverridePartial(string switchName, ref bool overrideFound, ref bool overrideValue); + + /// This is a partial method. This method is responsible for populating the default values based on a TFM. + /// It is partial because each library should define this method in their code to contain their defaults. + static partial void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version); + } +} diff --git a/external/referencesource/System.ServiceModel/InternalApis/Clr/inc/LocalAppContext.cs b/external/referencesource/System.ServiceModel/InternalApis/Clr/inc/LocalAppContext.cs new file mode 100644 index 0000000000..f05b599ed3 --- /dev/null +++ b/external/referencesource/System.ServiceModel/InternalApis/Clr/inc/LocalAppContext.cs @@ -0,0 +1,128 @@ +// ==++== +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// ==--== + +// NOTE: This file should not be included in mscorlib. This should only be included in FX libraries that need to provide switches +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Threading; + +namespace System +{ + internal static partial class LocalAppContext + { + private delegate bool TryGetSwitchDelegate(string switchName, out bool value); + + private static TryGetSwitchDelegate TryGetSwitchFromCentralAppContext; + private static bool s_canForwardCalls; + + private static Dictionary s_switchMap = new Dictionary(); + private static readonly object s_syncLock = new object(); + + private static bool DisableCaching { get; set; } + + static LocalAppContext() + { + // Try to setup the callback into the central AppContext + s_canForwardCalls = SetupDelegate(); + + // Populate the default values of the local app context + AppContextDefaultValues.PopulateDefaultValues(); + + // Cache the value of the switch that help with testing + DisableCaching = IsSwitchEnabled(@"TestSwitch.LocalAppContext.DisableCaching"); + } + + public static bool IsSwitchEnabled(string switchName) + { + if (s_canForwardCalls) + { + bool isEnabledCentrally; + if (TryGetSwitchFromCentralAppContext(switchName, out isEnabledCentrally)) + { + // we found the switch, so return whatever value it has + return isEnabledCentrally; + } + // if we could not get the value from the central authority, try the local storage. + } + + return IsSwitchEnabledLocal(switchName); + } + + private static bool IsSwitchEnabledLocal(string switchName) + { + // read the value from the set of local defaults + bool isEnabled, isPresent; + lock (s_switchMap) + { + isPresent = s_switchMap.TryGetValue(switchName, out isEnabled); + } + + // If the value is in the set of local switches, reutrn the value + if (isPresent) + { + return isEnabled; + } + + // if we could not find the switch name, we should return 'false' + // This will preserve the concept of switches been 'off' unless explicitly set to 'on' + return false; + } + + private static bool SetupDelegate() + { + Type appContextType = typeof(object).Assembly.GetType("System.AppContext"); + if (appContextType == null) + return false; + + MethodInfo method = appContextType.GetMethod( + "TryGetSwitch", // the method name + BindingFlags.Static | BindingFlags.Public, // binding flags + null, // use the default binder + new Type[] { typeof(string), typeof(bool).MakeByRefType() }, + null); // parameterModifiers - this is ignored by the default binder + if (method == null) + return false; + + // Create delegate if we found the method. + TryGetSwitchFromCentralAppContext = (TryGetSwitchDelegate)Delegate.CreateDelegate(typeof(TryGetSwitchDelegate), method); + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static bool GetCachedSwitchValue(string switchName, ref int switchValue) + { + if (switchValue < 0) return false; + if (switchValue > 0) return true; + + return GetCachedSwitchValueInternal(switchName, ref switchValue); + } + + private static bool GetCachedSwitchValueInternal(string switchName, ref int switchValue) + { + if (LocalAppContext.DisableCaching) + { + return LocalAppContext.IsSwitchEnabled(switchName); + } + + bool isEnabled = LocalAppContext.IsSwitchEnabled(switchName); + switchValue = isEnabled ? 1 /*true*/ : -1 /*false*/; + return isEnabled; + } + + /// + /// This method is going to be called from the AppContextDefaultValues class when setting up the + /// default values for the switches. !!!! This method is called during the static constructor so it does not + /// take a lock !!!! If you are planning to use this outside of that, please ensure proper locking. + /// + internal static void DefineSwitchDefault(string switchName, bool initialValue) + { + s_switchMap[switchName] = initialValue; + } + } +} diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Administration/EndpointInstanceProvider.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Administration/EndpointInstanceProvider.cs index 755291d6c7..25dbbdf242 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Administration/EndpointInstanceProvider.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Administration/EndpointInstanceProvider.cs @@ -120,7 +120,7 @@ namespace System.ServiceModel.Administration { Fx.Assert(null != endpoint, ""); Fx.Assert(null != instance, ""); - instance.SetProperty(AdministrationStrings.CounterInstanceName, PerformanceCounters.PerformanceCountersEnabled ? EndpointPerformanceCounters.CreateFriendlyInstanceName(endpoint.ServiceName, endpoint.Contract.Name, endpoint.Address.AbsoluteUri.ToUpperInvariant()) : String.Empty); + instance.SetProperty(AdministrationStrings.CounterInstanceName, PerformanceCounters.PerformanceCountersEnabled ? EndpointPerformanceCounters.GetFriendlyInstanceName(endpoint.ServiceName, endpoint.Contract.Name, endpoint.Address.AbsoluteUri.ToUpperInvariant()) : String.Empty); instance.SetProperty(AdministrationStrings.Name, endpoint.Name); instance.SetProperty(AdministrationStrings.ContractName, endpoint.Contract.Name); FillAddressInfo(endpoint, instance); @@ -668,7 +668,7 @@ namespace System.ServiceModel.Administration if (PerformanceCounters.PerformanceCountersEnabled && null != endpointInfo) { - result = OperationPerformanceCounters.CreateFriendlyInstanceName(endpointInfo.ServiceName, endpointInfo.Contract.Name, operationName, endpointInfo.Address.AbsoluteUri.ToUpperInvariant()); + result = OperationPerformanceCounters.GetFriendlyInstanceName(endpointInfo.ServiceName, endpointInfo.Contract.Name, operationName, endpointInfo.Address.AbsoluteUri.ToUpperInvariant()); } return result; diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Administration/ServiceInstanceProvider.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Administration/ServiceInstanceProvider.cs index 4fced34d3b..23593fd0ac 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Administration/ServiceInstanceProvider.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Administration/ServiceInstanceProvider.cs @@ -132,7 +132,7 @@ namespace System.ServiceModel.Administration Fx.Assert(null != instance, ""); Fx.Assert(null != info, ""); ProviderBase.FillCollectionInfo(info.Service.BaseAddresses, instance, AdministrationStrings.BaseAddresses); - instance.SetProperty(AdministrationStrings.CounterInstanceName, PerformanceCounters.PerformanceCountersEnabled ? ServicePerformanceCounters.CreateFriendlyInstanceName(info.Service) : String.Empty); + instance.SetProperty(AdministrationStrings.CounterInstanceName, PerformanceCounters.PerformanceCountersEnabled ? ServicePerformanceCounters.GetFriendlyInstanceName(info.Service) : String.Empty); instance.SetProperty(AdministrationStrings.ConfigurationName, info.ConfigurationName); instance.SetProperty(AdministrationStrings.DistinguishedName, info.DistinguishedName); instance.SetProperty(AdministrationStrings.Name, info.Name); diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/AppContextDefaultValues.Default.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/AppContextDefaultValues.Default.cs new file mode 100644 index 0000000000..5f591137e3 --- /dev/null +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/AppContextDefaultValues.Default.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +namespace System +{ + using System; + using System.ServiceModel; + + internal static partial class AppContextDefaultValues + { + static partial void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version) + { + // When defining a new switch you should add it to the last known version. + // For instance, if you are adding a switch in .NET 4.6 (the release after 4.5.2) you should defined your switch + // like this: + // if (version <= 40502) ... + // This ensures that all previous versions of that platform (up-to 4.5.2) will get the old behavior by default + // NOTE: When adding a default value for a switch please make sure that the default value is added to ALL of the existing platforms! + // NOTE: When adding a new if statement for the version please ensure that ALL previous switches are enabled (ie. don't use else if) + switch (platformIdentifier) + { + case ".NETCore": + case ".NETFramework": + { + if (version <= 40502) + { + LocalAppContextSwitches.SetDefaultsLessOrEqual_452(); + } + + break; + } + } + } + } +} diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/CacheSetting.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/CacheSetting.cs index 3c83ed6c90..7b8aa168f1 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/CacheSetting.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/CacheSetting.cs @@ -10,4 +10,4 @@ namespace System.ServiceModel AlwaysOn, AlwaysOff } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs index 8beb939caa..cc976b636e 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs @@ -126,10 +126,19 @@ namespace System.ServiceModel.Channels public override void Close() { - this.FlushPendingBuffer(); - stream.Close(); - this.WaitForAllWritesToComplete(); - this.closed = true; + try + { + if (!this.closed) + { + this.FlushPendingBuffer(); + stream.Close(); + this.WaitForAllWritesToComplete(); + } + } + finally + { + this.closed = true; + } } public override void Flush() diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/ChannelDemuxer.cs.REMOVED.git-id b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/ChannelDemuxer.cs.REMOVED.git-id index 814f15c783..bfdb5085ef 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/ChannelDemuxer.cs.REMOVED.git-id +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/ChannelDemuxer.cs.REMOVED.git-id @@ -1 +1 @@ -bf44d9efe557a80fed2c9fe79388602c857ecbfa \ No newline at end of file +8187627a3c626ffd202a933cbf037c37879803d8 \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/ClientWebSocketFactory.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/ClientWebSocketFactory.cs index 48fe8d3c73..d096477625 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/ClientWebSocketFactory.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/ClientWebSocketFactory.cs @@ -26,4 +26,4 @@ namespace System.ServiceModel.Channels // we estimate that implementors of a custom web socket factory will find it enough too. public abstract WebSocket CreateWebSocket(Stream connection, WebSocketTransportSettings settings); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs index 6fcf11dd12..482d0bfde8 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs @@ -35,6 +35,7 @@ namespace System.ServiceModel.Channels { static bool httpWebRequestWebPermissionDenied = false; static RequestCachePolicy requestCachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache); + static long connectionGroupNamePrefix = 0; readonly ClientWebSocketFactory clientWebSocketFactory; @@ -65,6 +66,7 @@ namespace System.ServiceModel.Channels WebSocketTransportSettings webSocketSettings; ConnectionBufferPool bufferPool; Lazy webSocketSoapContentType; + string uniqueConnectionGroupNamePrefix; internal HttpChannelFactory(HttpTransportBindingElement bindingElement, BindingContext context) : base(bindingElement, context, HttpTransportDefaults.GetDefaultMessageEncoderFactory()) @@ -183,6 +185,15 @@ namespace System.ServiceModel.Channels } this.webSocketSoapContentType = new Lazy(() => { return this.MessageEncoderFactory.CreateSessionEncoder().ContentType; }, LazyThreadSafetyMode.ExecutionAndPublication); + + if (ServiceModelAppSettings.HttpTransportPerFactoryConnectionPool) + { + this.uniqueConnectionGroupNamePrefix = Interlocked.Increment(ref connectionGroupNamePrefix).ToString(); + } + else + { + this.uniqueConnectionGroupNamePrefix = string.Empty; + } } public bool AllowCookies @@ -665,7 +676,7 @@ namespace System.ServiceModel.Channels } string prefix = this.OnGetConnectionGroupPrefix(httpWebRequest, clientCertificateToken); - inputString = string.Concat(prefix, inputString); + inputString = string.Concat(this.uniqueConnectionGroupNamePrefix, prefix, inputString); string credentialHash = null; @@ -1170,6 +1181,7 @@ namespace System.ServiceModel.Channels ChannelBinding channelBinding; int webRequestCompleted; EventTraceActivity eventTraceActivity; + const string ConnectionGroupPrefixMessagePropertyName = "HttpTransportConnectionGroupNamePrefix"; public HttpChannelRequest(HttpRequestChannel channel, HttpChannelFactory factory) { @@ -1179,11 +1191,27 @@ namespace System.ServiceModel.Channels this.factory = factory; } + private string GetConnectionGroupPrefix(Message message) + { + object property; + if (message.Properties.TryGetValue(ConnectionGroupPrefixMessagePropertyName, out property)) + { + string prefix = property as string; + if (prefix != null) + { + return prefix; + } + } + + return string.Empty; + } + public void SendRequest(Message message, TimeSpan timeout) { TimeoutHelper timeoutHelper = new TimeoutHelper(timeout); factory.ApplyManualAddressing(ref this.to, ref this.via, message); this.webRequest = channel.GetWebRequest(this.to, this.via, ref timeoutHelper); + this.webRequest.ConnectionGroupName = GetConnectionGroupPrefix(message) + this.webRequest.ConnectionGroupName; Message request = message; diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs.REMOVED.git-id b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs.REMOVED.git-id index 23b5f0cbb7..1294077748 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs.REMOVED.git-id +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs.REMOVED.git-id @@ -1 +1 @@ -d2389c42a4141d68294b289c4b94a4a6d24729a9 \ No newline at end of file +5df21319d3d6e9046fc229fc5459ad17a351de9b \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelListener.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelListener.cs index 95f6f9c565..3f9f1727f7 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelListener.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelListener.cs @@ -23,7 +23,7 @@ namespace System.ServiceModel.Channels where TChannel : class, IChannel { readonly bool useCustomClientCertificateVerification; - readonly bool shouldValidateClientCertificate; + bool shouldValidateClientCertificate; bool useHostedClientCertificateMapping; bool requireClientCertificate; SecurityTokenAuthenticator certificateAuthenticator; @@ -125,6 +125,12 @@ namespace System.ServiceModel.Channels { base.ApplyHostedContext(virtualPath, isMetadataListener); useHostedClientCertificateMapping = AspNetEnvironment.Current.ValidateHttpsSettings(virtualPath, ref this.requireClientCertificate); + + // We want to validate the certificate if IIS is set to require a client certificate + if (this.requireClientCertificate) + { + this.shouldValidateClientCertificate = true; + } } internal override ITransportManagerRegistration CreateTransportManagerRegistration(Uri listenUri) diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelAcceptor.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelAcceptor.cs index 6a0e7fb98d..a5b62241f4 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelAcceptor.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelAcceptor.cs @@ -14,4 +14,4 @@ namespace System.ServiceModel.Channels IAsyncResult BeginWaitForChannel(TimeSpan timeout, AsyncCallback callback, object state); bool EndWaitForChannel(IAsyncResult result); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelBindingProvider.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelBindingProvider.cs index 80d524ef8f..d9c4d69946 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelBindingProvider.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelBindingProvider.cs @@ -11,4 +11,4 @@ namespace System.ServiceModel.Channels void EnableChannelBindingSupport(); bool IsChannelBindingSupportEnabled { get; } } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IHttpCookieContainerManager.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IHttpCookieContainerManager.cs index 84d0fd0d93..d684cbc9cf 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IHttpCookieContainerManager.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IHttpCookieContainerManager.cs @@ -17,4 +17,4 @@ namespace System.ServiceModel.Channels /// CookieContainer CookieContainer { get; set; } } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IReliableFactorySettings.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IReliableFactorySettings.cs index 38df4d9ca8..a6f06de1e8 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IReliableFactorySettings.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IReliableFactorySettings.cs @@ -25,4 +25,4 @@ namespace System.ServiceModel.Channels TimeSpan SendTimeout { get; } } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IStreamUpgradeChannelBindingProvider.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IStreamUpgradeChannelBindingProvider.cs index e98a53f6f9..ff8aeb3b70 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IStreamUpgradeChannelBindingProvider.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/IStreamUpgradeChannelBindingProvider.cs @@ -11,4 +11,4 @@ namespace System.ServiceModel.Channels ChannelBinding GetChannelBinding(StreamUpgradeInitiator upgradeInitiator, ChannelBindingKind kind); ChannelBinding GetChannelBinding(StreamUpgradeAcceptor upgradeAcceptor, ChannelBindingKind kind); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs index 504eb71482..de966e4499 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs @@ -507,7 +507,7 @@ namespace System.ServiceModel.Channels switch (header.HeaderType) { case HeaderType.BufferedMessageHeader: - AddHeader(new Header(header.HeaderKind, CaptureBufferedHeader(collection.bufferedMessageData, + AddHeader(new Header(header.HeaderKind, collection.CaptureBufferedHeader(collection.bufferedMessageData, header.HeaderInfo, headerIndex), processing)); break; case HeaderType.ReadableHeader: diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SafeNativeMethods.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SafeNativeMethods.cs index f63d363b4e..261d8c688e 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SafeNativeMethods.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SafeNativeMethods.cs @@ -7,6 +7,7 @@ namespace System.ServiceModel.Channels using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; + using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME; [SuppressUnmanagedCodeSecurity] internal static class SafeNativeMethods @@ -20,10 +21,19 @@ namespace System.ServiceModel.Channels [Out] out uint increment, [Out] out uint adjustmentDisabled ); - + [DllImport(KERNEL32, SetLastError = true)] [ResourceExposure(ResourceScope.None)] - public static extern void GetSystemTimeAsFileTime(out long time); + private static extern void GetSystemTimeAsFileTime([Out] out FILETIME time); + + public static void GetSystemTimeAsFileTime(out long time) { + FILETIME fileTime; + GetSystemTimeAsFileTime(out fileTime); + time = 0; + time |= (uint)fileTime.dwHighDateTime; + time <<= sizeof(uint) * 8; + time |= (uint)fileTime.dwLowDateTime; + } [Fx.Tag.SecurityNote(Critical = "Calls critical method GetSystemTimeAdjustment.", Safe = "Method is a SafeNativeMethod.")] diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs index 4220d500c1..baf6e2dfdb 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs @@ -3,6 +3,7 @@ //----------------------------------------------------------------------------- namespace System.ServiceModel.Channels { + using System.Security.Authentication; using System.ComponentModel; using System.Collections.Generic; using System.Net.Security; @@ -16,10 +17,12 @@ namespace System.ServiceModel.Channels { IdentityVerifier identityVerifier; bool requireClientCertificate; + SslProtocols sslProtocols; public SslStreamSecurityBindingElement() { this.requireClientCertificate = TransportDefaults.RequireClientCertificate; + this.sslProtocols = TransportDefaults.SslProtocols; } protected SslStreamSecurityBindingElement(SslStreamSecurityBindingElement elementToBeCloned) @@ -27,6 +30,7 @@ namespace System.ServiceModel.Channels { this.identityVerifier = elementToBeCloned.identityVerifier; this.requireClientCertificate = elementToBeCloned.requireClientCertificate; + this.sslProtocols = elementToBeCloned.sslProtocols; } public IdentityVerifier IdentityVerifier @@ -64,6 +68,20 @@ namespace System.ServiceModel.Channels } } + [DefaultValue(TransportDefaults.SslProtocols)] + public SslProtocols SslProtocols + { + get + { + return this.sslProtocols; + } + set + { + SslProtocolsHelper.Validate(value); + this.sslProtocols = value; + } + } + public override IChannelFactory BuildChannelFactory(BindingContext context) { if (context == null) @@ -218,7 +236,7 @@ namespace System.ServiceModel.Channels return false; } - return this.requireClientCertificate == ssl.requireClientCertificate; + return this.requireClientCertificate == ssl.requireClientCertificate && this.sslProtocols == ssl.sslProtocols; } [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs index 2def8e744e..a675b39930 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs @@ -34,17 +34,19 @@ namespace System.ServiceModel.Channels bool requireClientCertificate; string scheme; bool enableChannelBinding; + SslProtocols sslProtocols; - SslStreamSecurityUpgradeProvider(IDefaultCommunicationTimeouts timeouts, SecurityTokenManager clientSecurityTokenManager, bool requireClientCertificate, string scheme, IdentityVerifier identityVerifier) + SslStreamSecurityUpgradeProvider(IDefaultCommunicationTimeouts timeouts, SecurityTokenManager clientSecurityTokenManager, bool requireClientCertificate, string scheme, IdentityVerifier identityVerifier, SslProtocols sslProtocols) : base(timeouts) { this.identityVerifier = identityVerifier; this.scheme = scheme; this.clientSecurityTokenManager = clientSecurityTokenManager; this.requireClientCertificate = requireClientCertificate; + this.sslProtocols = sslProtocols; } - SslStreamSecurityUpgradeProvider(IDefaultCommunicationTimeouts timeouts, SecurityTokenProvider serverTokenProvider, bool requireClientCertificate, SecurityTokenAuthenticator clientCertificateAuthenticator, string scheme, IdentityVerifier identityVerifier) + SslStreamSecurityUpgradeProvider(IDefaultCommunicationTimeouts timeouts, SecurityTokenProvider serverTokenProvider, bool requireClientCertificate, SecurityTokenAuthenticator clientCertificateAuthenticator, string scheme, IdentityVerifier identityVerifier, SslProtocols sslProtocols) : base(timeouts) { this.serverTokenProvider = serverTokenProvider; @@ -52,6 +54,7 @@ namespace System.ServiceModel.Channels this.clientCertificateAuthenticator = clientCertificateAuthenticator; this.identityVerifier = identityVerifier; this.scheme = scheme; + this.sslProtocols = sslProtocols; } public static SslStreamSecurityUpgradeProvider CreateClientProvider( @@ -65,7 +68,7 @@ namespace System.ServiceModel.Channels } SecurityTokenManager tokenManager = credentialProvider.CreateSecurityTokenManager(); - return new SslStreamSecurityUpgradeProvider(context.Binding, tokenManager, bindingElement.RequireClientCertificate, context.Binding.Scheme, bindingElement.IdentityVerifier); + return new SslStreamSecurityUpgradeProvider(context.Binding, tokenManager, bindingElement.RequireClientCertificate, context.Binding.Scheme, bindingElement.IdentityVerifier, bindingElement.SslProtocols); } public static SslStreamSecurityUpgradeProvider CreateServerProvider( @@ -99,7 +102,7 @@ namespace System.ServiceModel.Channels TransportSecurityHelpers.GetCertificateTokenAuthenticator(tokenManager, context.Binding.Scheme, listenUri); return new SslStreamSecurityUpgradeProvider(context.Binding, tokenProvider, bindingElement.RequireClientCertificate, - certificateAuthenticator, context.Binding.Scheme, bindingElement.IdentityVerifier); + certificateAuthenticator, context.Binding.Scheme, bindingElement.IdentityVerifier, bindingElement.SslProtocols); } public override EndpointIdentity Identity @@ -164,6 +167,11 @@ namespace System.ServiceModel.Channels get { return this.scheme; } } + public SslProtocols SslProtocols + { + get { return this.sslProtocols; } + } + public override T GetProperty() { if (typeof(T) == typeof(IChannelBindingProvider) || typeof(T) == typeof(IStreamUpgradeChannelBindingProvider)) @@ -589,7 +597,7 @@ namespace System.ServiceModel.Channels try { sslStream.AuthenticateAsServer(this.parent.ServerCertificate, this.parent.RequireClientCertificate, - SslProtocols.Default, false); + this.parent.SslProtocols, false); } catch (AuthenticationException exception) { @@ -703,7 +711,7 @@ namespace System.ServiceModel.Channels this.sslStream = new SslStream(stream, false, this.acceptor.ValidateRemoteCertificate); return this.sslStream.BeginAuthenticateAsServer(this.acceptor.parent.ServerCertificate, - this.acceptor.parent.RequireClientCertificate, SslProtocols.Default, false, callback, this); + this.acceptor.parent.RequireClientCertificate, this.acceptor.parent.SslProtocols, false, callback, this); } protected override Stream OnCompleteAuthenticateAsServer(IAsyncResult result) @@ -910,7 +918,7 @@ namespace System.ServiceModel.Channels SslStream sslStream = new SslStream(stream, false, this.ValidateRemoteCertificate, selectionCallback); try { - sslStream.AuthenticateAsClient(string.Empty, clientCertificates, SslProtocols.Default, false); + sslStream.AuthenticateAsClient(string.Empty, clientCertificates, this.parent.SslProtocols, false); } catch (SecurityTokenValidationException tokenValidationException) { @@ -995,7 +1003,7 @@ namespace System.ServiceModel.Channels try { return this.sslStream.BeginAuthenticateAsClient(string.Empty, this.clientCertificates, - SslProtocols.Default, false, callback, this); + this.initiator.parent.SslProtocols, false, callback, this); } catch (SecurityTokenValidationException tokenValidationException) { diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDefaults.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDefaults.cs index ce6834f178..4de327474f 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDefaults.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDefaults.cs @@ -8,6 +8,7 @@ namespace System.ServiceModel.Channels using System.Net.Security; using System.Net.WebSockets; using System.Runtime; + using System.Security.Authentication; using System.Security.Principal; using System.ServiceModel; using System.ServiceModel.Dispatcher; @@ -201,6 +202,10 @@ namespace System.ServiceModel.Channels internal const bool RequireClientCertificate = false; internal const int MaxFaultSize = MaxBufferSize; internal const int MaxSecurityFaultSize = 16384; + internal const SslProtocols SslProtocols = System.Security.Authentication.SslProtocols.Ssl3 | + System.Security.Authentication.SslProtocols.Tls | + System.Security.Authentication.SslProtocols.Tls11 | + System.Security.Authentication.SslProtocols.Tls12; // Calling CreateFault on an incoming message can expose some DoS-related security // vulnerabilities when a service is in streaming mode. See MB 47592 for more details. diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs index 647dce82c4..bade3dab69 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs @@ -1099,6 +1099,12 @@ namespace System.ServiceModel.Channels [MarshalAs(UnmanagedType.U1), Out] out bool pfEnabled ); + +#if !FEATURE_CORECLR + // On CoreCLR this is not the way to determine if a process is a tailored application (which means APPX). + // On CoreCLR AppX is determined by a flag past to the host which is exposed by AppDomain.IsAppXProcess in mscorlib. + // The reason for this if-def is to ensure nobody takes a dependency on this on CoreCLR. + // AppModel.h functions (Win8+) [DllImport(KERNEL32, CharSet = CharSet.None, EntryPoint = "GetCurrentPackageId")] [SecurityCritical] @@ -1128,6 +1134,7 @@ namespace System.ServiceModel.Channels /// Indicates weather the running application is an immersive (or modern) Windows 8 (or later) application. /// internal static Lazy IsTailoredApplication = new Lazy(() => _IsTailoredApplication()); +#endif //!FEATURE_CORECLR } [SuppressUnmanagedCodeSecurity] diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/WebSocketTransportDuplexSessionChannel.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/WebSocketTransportDuplexSessionChannel.cs index b342bddf9e..91558a6d54 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/WebSocketTransportDuplexSessionChannel.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Channels/WebSocketTransportDuplexSessionChannel.cs @@ -664,7 +664,7 @@ namespace System.ServiceModel.Channels new ArraySegment(internalBuffer, receivedByteCount, internalBuffer.Length - receivedByteCount), CancellationToken.None); - await receiveTask.ContinueOnCapturedContextFlow(); + await receiveTask.ConfigureAwait(false); result = receiveTask.Result; this.CheckCloseStatus(result); @@ -847,7 +847,8 @@ namespace System.ServiceModel.Channels if (this.streamWaitTask != null) { //// Wait until the previous stream message finished. - await this.streamWaitTask.Task.ContinueOnCapturedContextFlow(); + + await this.streamWaitTask.Task.ConfigureAwait(false); } this.streamWaitTask = new TaskCompletionSource(); @@ -857,7 +858,7 @@ namespace System.ServiceModel.Channels { if (!this.useStreaming) { - await this.ReadBufferedMessageAsync(); + await this.ReadBufferedMessageAsync().ConfigureAwait(false); } else { @@ -875,7 +876,8 @@ namespace System.ServiceModel.Channels Task receiveTask = this.webSocket.ReceiveAsync( new ArraySegment(buffer, 0, this.receiveBufferSize), CancellationToken.None); - await receiveTask.ContinueOnCapturedContextFlow(); + + await receiveTask.ConfigureAwait(false); WebSocketReceiveResult result = receiveTask.Result; this.CheckCloseStatus(result); diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IClassFactory.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IClassFactory.cs index 66772f888a..4d9c3b8699 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IClassFactory.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IClassFactory.cs @@ -11,4 +11,4 @@ internal interface IClassFactory [return: MarshalAs(UnmanagedType.Interface)] object CreateInstance([In, MarshalAs(UnmanagedType.IUnknown)] object pUnkOuter, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid); void LockServer([In, MarshalAs(UnmanagedType.Bool)]bool fLock); -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IContextSecurityPerimeter.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IContextSecurityPerimeter.cs index 06d679d8bc..d21b965591 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IContextSecurityPerimeter.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IContextSecurityPerimeter.cs @@ -16,4 +16,4 @@ namespace System.ServiceModel.ComIntegration void SetPerimeterFlag([MarshalAs(UnmanagedType.Bool)] bool flag); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IServerSecurity.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IServerSecurity.cs index 7fb9461b3c..a0d0fb6253 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IServerSecurity.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IServerSecurity.cs @@ -30,4 +30,4 @@ namespace System.ServiceModel.ComIntegration bool IsImpersonating(); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/SafeNativeMethods.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/SafeNativeMethods.cs index 5a64e2fec1..5b37e80a69 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/SafeNativeMethods.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/SafeNativeMethods.cs @@ -56,7 +56,7 @@ namespace System.ServiceModel.ComIntegration ACTIVATE_LOCAL = 0x08, ACTIVATE_REMOTE = 0x10 } - + enum TOKEN_INFORMATION_CLASS { TokenUser = 1, @@ -96,6 +96,7 @@ namespace System.ServiceModel.ComIntegration ERROR_INSUFFICIENT_BUFFER = 122, ERROR_NO_TOKEN = 1008, ERROR_NONE_MAPPED = 1332, + ERROR_NO_SUCH_DOMAIN = 1355, } enum EXTENDED_NAME_FORMAT @@ -112,6 +113,32 @@ namespace System.ServiceModel.ComIntegration NameDnsDomainName = 12 } + [Flags] + enum DSFlags : uint + { + DS_FORCE_REDISCOVERY = 0x00000001, + DS_DIRECTORY_SERVICE_REQUIRED = 0x00000010, + DS_DIRECTORY_SERVICE_PREFERRED = 0x00000020, + DS_GC_SERVER_REQUIRED = 0x00000040, + DS_PDC_REQUIRED = 0x00000080, + DS_BACKGROUND_ONLY = 0x00000100, + DS_IP_REQUIRED = 0x00000200, + DS_KDC_REQUIRED = 0x00000400, + DS_TIMESERV_REQUIRED = 0x00000800, + DS_WRITABLE_REQUIRED = 0x00001000, + DS_GOOD_TIMESERV_PREFERRED = 0x00002000, + DS_AVOID_SELF = 0x00004000, + DS_ONLY_LDAP_NEEDED = 0x00008000, + DS_IS_FLAT_NAME = 0x00010000, + DS_IS_DNS_NAME = 0x00020000, + DS_TRY_NEXTCLOSEST_SITE = 0x00040000, + DS_DIRECTORY_SERVICE_6_REQUIRED = 0x00080000, + DS_WEB_SERVICE_REQUIRED = 0x00100000, + DS_DIRECTORY_SERVICE_8_REQUIRED = 0x00200000, + DS_RETURN_DNS_NAME = 0x40000000, + DS_RETURN_FLAT_NAME = 0x80000000, + } + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] struct TagVariant { @@ -228,6 +255,7 @@ namespace System.ServiceModel.ComIntegration internal const String OLEAUT32 = "oleaut32.dll"; internal const String COMSVCS = "comsvcs.dll"; internal const String SECUR32 = "secur32.dll"; + internal const String NETAPI32 = "netapi32.dll"; internal const int ERROR_MORE_DATA = 0xEA; internal const int ERROR_SUCCESS = 0; @@ -493,7 +521,21 @@ namespace System.ServiceModel.ComIntegration [DllImport(SECUR32, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.U1)] [ResourceExposure(ResourceScope.None)] - internal extern static bool TranslateName(string input, EXTENDED_NAME_FORMAT inputFormat, EXTENDED_NAME_FORMAT outputFormat, StringBuilder outputString, out uint size); + internal static extern bool TranslateName(string input, EXTENDED_NAME_FORMAT inputFormat, EXTENDED_NAME_FORMAT outputFormat, StringBuilder outputString, out uint size); + + [DllImport(NETAPI32, ExactSpelling = true, EntryPoint = "DsGetDcNameW", CharSet = CharSet.Unicode, SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + internal static extern int DsGetDcName( + [In] string computerName, + [In] string domainName, + [In] IntPtr domainGuid, + [In] string siteName, + [In] uint flags, + [Out] out IntPtr domainControllerInfo); + + [DllImport(NETAPI32)] + [ResourceExposure(ResourceScope.None)] + internal static extern int NetApiBufferFree([In] IntPtr buffer); } internal static class InterfaceHelper diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationStrings.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationStrings.cs index 390b21cd4b..6d3b0516ad 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationStrings.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationStrings.cs @@ -401,6 +401,7 @@ namespace System.ServiceModel.Configuration internal const string Soap12WSAddressing10 = "Soap12WSAddressing10"; internal const string Soap12WSAddressingAugust2004 = "Soap12WSAddressingAugust2004"; internal const string SslCertificateAuthentication = "sslCertificateAuthentication"; + internal const string SslProtocols = "sslProtocols"; internal const string SslStreamSecuritySectionName = "sslStreamSecurity"; internal const string StandardEndpoint = "standardEndpoint"; internal const string StandardEndpointsSectionName = "standardEndpoints"; diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/Properties.cs.REMOVED.git-id b/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/Properties.cs.REMOVED.git-id index 2c0a46ea13..574f59fed7 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/Properties.cs.REMOVED.git-id +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/Properties.cs.REMOVED.git-id @@ -1 +1 @@ -0d026927dac6a667d11d34c7ee6cb903c3d5c1c6 \ No newline at end of file +35c78297859f7342bb6f1137a045ea1bf79b932c \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataEndpointCollectionElement.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataEndpointCollectionElement.cs index 63590402f6..4cac2ac309 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataEndpointCollectionElement.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataEndpointCollectionElement.cs @@ -12,4 +12,4 @@ namespace System.ServiceModel.Configuration public partial class ServiceMetadataEndpointCollectionElement : StandardEndpointCollectionElement { } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs index fdcc8f9805..025ebc7943 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs @@ -5,7 +5,9 @@ namespace System.ServiceModel.Configuration { using System.Configuration; + using System.Security.Authentication; using System.ServiceModel.Channels; + using System.ServiceModel.Security; public sealed partial class SslStreamSecurityElement : BindingElementExtensionElement { @@ -21,12 +23,22 @@ namespace System.ServiceModel.Configuration set { base[ConfigurationStrings.RequireClientCertificate] = value; } } + [ConfigurationProperty(ConfigurationStrings.SslProtocols, DefaultValue = TransportDefaults.SslProtocols)] + [ServiceModelEnumValidator(typeof(SslProtocolsHelper))] + public SslProtocols SslProtocols + { + get { return (SslProtocols)base[ConfigurationStrings.SslProtocols]; } + private set { base[ConfigurationStrings.SslProtocols] = value; } + } + + public override void ApplyConfiguration(BindingElement bindingElement) { base.ApplyConfiguration(bindingElement); SslStreamSecurityBindingElement sslBindingElement = (SslStreamSecurityBindingElement)bindingElement; sslBindingElement.RequireClientCertificate = this.RequireClientCertificate; + sslBindingElement.SslProtocols = this.SslProtocols; } protected internal override BindingElement CreateBindingElement() @@ -50,6 +62,7 @@ namespace System.ServiceModel.Configuration SslStreamSecurityElement source = (SslStreamSecurityElement)from; #pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument this.RequireClientCertificate = source.RequireClientCertificate; + this.SslProtocols = source.SslProtocols; } protected internal override void InitializeFrom(BindingElement bindingElement) @@ -58,6 +71,7 @@ namespace System.ServiceModel.Configuration SslStreamSecurityBindingElement sslBindingElement = (SslStreamSecurityBindingElement)bindingElement; SetPropertyValueIfNotDefaultValue(ConfigurationStrings.RequireClientCertificate, sslBindingElement.RequireClientCertificate); + SetPropertyValueIfNotDefaultValue(ConfigurationStrings.SslProtocols, sslBindingElement.SslProtocols); } } } diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportSecurityElement.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportSecurityElement.cs index 8dd7f7a821..c07d01f40a 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportSecurityElement.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportSecurityElement.cs @@ -13,6 +13,7 @@ namespace System.ServiceModel.Configuration using System.ServiceModel; using System.ServiceModel.Security; using System.ComponentModel; + using System.Security.Authentication; public sealed partial class TcpTransportSecurityElement : ServiceModelConfigurationElement { @@ -39,6 +40,14 @@ namespace System.ServiceModel.Configuration private set { base[ConfigurationStrings.ExtendedProtectionPolicy] = value; } } + [ConfigurationProperty(ConfigurationStrings.SslProtocols, DefaultValue = TransportDefaults.SslProtocols)] + [ServiceModelEnumValidator(typeof(SslProtocolsHelper))] + public SslProtocols SslProtocols + { + get { return (SslProtocols)base[ConfigurationStrings.SslProtocols]; } + private set { base[ConfigurationStrings.SslProtocols] = value; } + } + internal void ApplyConfiguration(TcpTransportSecurity security) { if (security == null) @@ -48,6 +57,7 @@ namespace System.ServiceModel.Configuration security.ClientCredentialType = this.ClientCredentialType; security.ProtectionLevel = this.ProtectionLevel; security.ExtendedProtectionPolicy = ChannelBindingUtility.BuildPolicy(this.ExtendedProtectionPolicy); + security.SslProtocols = this.SslProtocols; } internal void InitializeFrom(TcpTransportSecurity security) @@ -59,6 +69,7 @@ namespace System.ServiceModel.Configuration SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ClientCredentialType, security.ClientCredentialType); SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ProtectionLevel, security.ProtectionLevel); ChannelBindingUtility.InitializeFrom(security.ExtendedProtectionPolicy, this.ExtendedProtectionPolicy); + SetPropertyValueIfNotDefaultValue(ConfigurationStrings.SslProtocols, security.SslProtocols); } } } diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Description/DispatcherBuilder.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Description/DispatcherBuilder.cs index f3625150b0..1106d1758c 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Description/DispatcherBuilder.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Description/DispatcherBuilder.cs @@ -788,6 +788,12 @@ namespace System.ServiceModel.Description } } // end foreach "endpoint" + // Clear performance counter cache. + if ((PerformanceCounters.PerformanceCountersEnabled || PerformanceCounters.MinimalPerformanceCountersEnabled) && ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + System.Diagnostics.PerformanceCounter.CloseSharedResources(); + } + if (canReceiveInTransaction) { BindingElementCollection bindingElements = binding.CreateBindingElements(); diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IPolicyImportExtension.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IPolicyImportExtension.cs index aef0d3ff6c..66d83a9cdb 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IPolicyImportExtension.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IPolicyImportExtension.cs @@ -8,4 +8,4 @@ namespace System.ServiceModel.Description { void ImportPolicy(MetadataImporter importer, PolicyConversionContext context); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlExportExtension.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlExportExtension.cs index 8f21363d28..263bff5c4b 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlExportExtension.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlExportExtension.cs @@ -10,4 +10,4 @@ namespace System.ServiceModel.Description void ExportEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext context); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlImportExtension.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlImportExtension.cs index 992b4d989b..4166891415 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlImportExtension.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlImportExtension.cs @@ -17,4 +17,4 @@ namespace System.ServiceModel.Description void ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext context); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ActivityType.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ActivityType.cs index 4c4431f847..951d2e5f3a 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ActivityType.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ActivityType.cs @@ -22,4 +22,4 @@ namespace System.ServiceModel.Diagnostics WmiPutInstance, NumItems, // leave this item at the end of the list. } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersBase.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersBase.cs index 89aa50b117..95b174c15c 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersBase.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersBase.cs @@ -77,9 +77,14 @@ namespace System.ServiceModel.Diagnostics this.instanceName = CreateFriendlyInstanceName(service, contract, uri); } - static internal string CreateFriendlyInstanceName(string service, string contract, string uri) + private static string GetFullInstanceName(string service, string contract, string uri) { // instance name is: serviceName.interfaceName.operationName@uri + return String.Format("{0}.{1}@{2}", service, contract, uri); + } + + private static string GetShortInstanceName(string service, string contract, string uri) + { int length = service.Length + contract.Length + uri.Length + 2; if (length > maxCounterLength) @@ -115,6 +120,32 @@ namespace System.ServiceModel.Diagnostics return service + "." + contract + "@" + uri.Replace('/', '|'); } + internal static string CreateFriendlyInstanceName(string service, string contract, string uri) + { + string shortInstanceName = GetShortInstanceName(service, contract, uri); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(service, contract, uri); + + return EnsureUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELENDPOINT.EndpointPerfCounters, shortInstanceName, fullInstanceName); + } + + internal static string GetFriendlyInstanceName(string service, string contract, string uri) + { + string shortInstanceName = GetShortInstanceName(service, contract, uri); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(service, contract, uri); + + return GetUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELENDPOINT.EndpointPerfCounters, shortInstanceName, fullInstanceName); + } + private static truncOptions GetCompressionTasks(int totalLen, int serviceLen, int contractLen, int uriLen) { truncOptions bitmask = 0; diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersV2.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersV2.cs index 930153e8e2..447f3c6cdb 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersV2.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersV2.cs @@ -154,6 +154,18 @@ namespace System.ServiceModel.Diagnostics get { return this.endpointCounterSetInstance != null; } } + // Immediately disposes and nulls the CounterSetInstance. This differs from Dispose because Dispose is "lazy" in that + // it holds weak references to the instances so we don't get corrupted state if the values are updated later. This + // method is used in situations when we need to delete the instance immediately and know the values won't be updated. + internal void DeleteInstance() + { + if (this.endpointCounterSetInstance != null) + { + this.endpointCounterSetInstance.Dispose(); + this.endpointCounterSetInstance = null; + } + } + protected override void Dispose(bool disposing) { try diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/MessageLogger.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/MessageLogger.cs index 3b84da0fe1..10237200ca 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/MessageLogger.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/MessageLogger.cs @@ -489,7 +489,7 @@ namespace System.ServiceModel.Diagnostics { if ((source & MessageLoggingSource.Malformed) != 0) { - if (!TD.MessageLogWarning(data.ToString())) + if (TD.MessageLogWarningIsEnabled() && !TD.MessageLogWarning(data.ToString())) { if (TD.MessageLogEventSizeExceededIsEnabled()) { @@ -499,7 +499,7 @@ namespace System.ServiceModel.Diagnostics } else { - if (!TD.MessageLogInfo(data.ToString())) + if (TD.MessageLogInfoIsEnabled() && !TD.MessageLogInfo(data.ToString())) { if (TD.MessageLogEventSizeExceededIsEnabled()) { diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersBase.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersBase.cs index d6f84e4612..4e53f24b33 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersBase.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersBase.cs @@ -72,9 +72,15 @@ namespace System.ServiceModel.Diagnostics this.instanceName = CreateFriendlyInstanceName(service, contract, operationName, uri); } - static internal string CreateFriendlyInstanceName(string service, string contract, string operation, string uri) + + private static string GetFullInstanceName(string service, string contract, string operation, string uri) { // instance name is: serviceName.interfaceName.operationName@uri + return String.Format("{0}.{1}.{2}@{3}", service, contract, operation, uri); + } + + private static string GetShortInstanceName(string service, string contract, string operation, string uri) + { int length = service.Length + contract.Length + operation.Length + uri.Length + 3; if (length > maxCounterLength) @@ -117,6 +123,32 @@ namespace System.ServiceModel.Diagnostics return service + "." + contract + "." + operation + "@" + uri.Replace('/', '|'); } + internal static string CreateFriendlyInstanceName(string service, string contract, string operation, string uri) + { + string shortInstanceName = GetShortInstanceName(service, contract, operation, uri); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(service, contract, operation, uri); + + return EnsureUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELOPERATION.OperationPerfCounters, shortInstanceName, fullInstanceName); + } + + internal static string GetFriendlyInstanceName(string service, string contract, string operation, string uri) + { + string shortInstanceName = GetShortInstanceName(service, contract, operation, uri); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(service, contract, operation, uri); + + return GetUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELOPERATION.OperationPerfCounters, shortInstanceName, fullInstanceName); + } + static truncOptions GetCompressionTasks(int totalLen, int serviceLen, int contractLen, int operationLen, int uriLen) { truncOptions bitmask = 0; diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersV2.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersV2.cs index 697a2e1163..0226391b1c 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersV2.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersV2.cs @@ -139,6 +139,18 @@ namespace System.ServiceModel.Diagnostics get { return this.operationCounterSetInstance != null; } } + // Immediately disposes and nulls the CounterSetInstance. This differs from Dispose because Dispose is "lazy" in that + // it holds weak references to the instances so we don't get corrupted state if the values are updated later. This + // method is used in situations when we need to delete the instance immediately and know the values won't be updated. + internal void DeleteInstance() + { + if (this.operationCounterSetInstance != null) + { + this.operationCounterSetInstance.Dispose(); + this.operationCounterSetInstance = null; + } + } + protected override void Dispose(bool disposing) { try diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersBase.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersBase.cs index b2988a8b22..3043e5afe7 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersBase.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersBase.cs @@ -33,11 +33,67 @@ namespace System.ServiceModel.Diagnostics get; } + private static string GetInstanceNameWithHash(string instanceName, string fullInstanceName) + { + return String.Format("{0}{1}", instanceName, StringUtil.GetNonRandomizedHashCode(fullInstanceName).ToString("X", CultureInfo.InvariantCulture)); + } + + protected static string EnsureUniqueInstanceName(string categoryName, string instanceName, string fullInstanceName) + { + if (String.IsNullOrEmpty(categoryName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("categoryName"); + if (String.IsNullOrEmpty(instanceName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("instanceName"); + if (String.IsNullOrEmpty(fullInstanceName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("fullInstanceName"); + + try + { + // If the instance name is already used, append a hash of the full name to it. + if (PerformanceCounterCategory.InstanceExists(instanceName, categoryName)) + { + return GetInstanceNameWithHash(instanceName, fullInstanceName); + } + } + catch + { + // If an exception is thrown, return the instance name without modification. + } + + return instanceName; + } + + protected static string GetUniqueInstanceName(string categoryName, string instanceName, string fullInstanceName) + { + if (String.IsNullOrEmpty(categoryName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("categoryName"); + if (String.IsNullOrEmpty(instanceName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("instanceName"); + if (String.IsNullOrEmpty(fullInstanceName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("fullInstanceName"); + + try + { + // If the instance name with the hash appended exists, return it. + string nameWithHash = GetInstanceNameWithHash(instanceName, fullInstanceName); + if (PerformanceCounterCategory.InstanceExists(nameWithHash, categoryName)) + { + return nameWithHash; + } + } + catch + { + // If an exception is thrown, return the instance name without modification. + } + + return instanceName; + } + // remove count chars from string and add a 2 char hash code to beginning or end, as specified. protected static string GetHashedString(string str, int startIndex, int count, bool hashAtEnd) { string returnVal = str.Remove(startIndex, count); - string hash = ((uint)str.GetHashCode() % 99).ToString("00", CultureInfo.InvariantCulture); + string hash = ((uint)StringUtil.GetNonRandomizedHashCode(str) % 99).ToString("00", CultureInfo.InvariantCulture); return hashAtEnd ? returnVal + hash : hash + returnVal; } diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersFactory.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersFactory.cs index 5f540b16b9..d5dbfcb93e 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersFactory.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersFactory.cs @@ -9,6 +9,8 @@ namespace System.ServiceModel.Diagnostics static class PerformanceCountersFactory { + private static bool categoriesExist = false; + static internal ServicePerformanceCountersBase CreateServiceCounters(ServiceHostBase serviceHost) { if (!CheckPermissions()) @@ -20,6 +22,7 @@ namespace System.ServiceModel.Diagnostics { try { + EnsureCategoriesExistIfNeeded(); var counters = new ServicePerformanceCountersV2(serviceHost); // Workaround Sys.Diag.PerformanceData problem: // Ensure that all three categories are initialized so other processes can still @@ -60,6 +63,7 @@ namespace System.ServiceModel.Diagnostics { try { + EnsureCategoriesExistIfNeeded(); return new EndpointPerformanceCountersV2(service, contract, uri); } #pragma warning suppress 56500 // covered by FxCOP @@ -94,6 +98,7 @@ namespace System.ServiceModel.Diagnostics { try { + EnsureCategoriesExistIfNeeded(); return new OperationPerformanceCountersV2(service, contract, operationName, uri); } #pragma warning suppress 56500 // covered by FxCOP @@ -139,5 +144,81 @@ namespace System.ServiceModel.Diagnostics return false; } + + // If EnsureUniquePerformanceCounterInstanceName is enabled, PerformanceCountersBase.cs will be checking if instances + // exist in each of these categories, so we need to ensure the categories all exist. This works around System.Diagnostics + // calls using PerformanceCounterLib to cache which categories do/don't exist. + private static void EnsureCategoriesExistIfNeeded() + { + if (categoriesExist || !ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return; + } + + OperationPerformanceCountersV2 operationCounter = null; + EndpointPerformanceCountersV2 endpointCounter = null; + ServicePerformanceCountersV2 serviceCounter = null; + + try + { + if (PerformanceCounterCategory.Exists(PerformanceCounterStrings.SERVICEMODELOPERATION.OperationPerfCounters) && + PerformanceCounterCategory.Exists(PerformanceCounterStrings.SERVICEMODELENDPOINT.EndpointPerfCounters) && + PerformanceCounterCategory.Exists(PerformanceCounterStrings.SERVICEMODELSERVICE.ServicePerfCounters)) + { + categoriesExist = true; + return; + } + + // Categories do not exist. Update PerformanceCounterLib's cache using dummy counters. + const string dummyValue = "_WCF_Admin"; + + + // Older operating systems (such as windows 7) report the category as not existing unless a counter instance + // has been created in it. Create one instance in each of the categories to ensure they will exist in the cache + // that System.Diagnostics calls use. + ServiceHost dummyServiceHost = new ServiceHost(typeof(object), new Uri("http://" + dummyValue)); + operationCounter = new OperationPerformanceCountersV2(dummyValue, dummyValue, dummyValue, dummyValue); + endpointCounter = new EndpointPerformanceCountersV2(dummyValue, dummyValue, dummyValue); + serviceCounter = new ServicePerformanceCountersV2(dummyServiceHost); + + // Throw away cached categories, then read from the categories to cause the cache to be repopulated. + PerformanceCounter.CloseSharedResources(); + PerformanceCounterCategory.Exists(dummyValue); + } + catch (UnauthorizedAccessException) + { + // Don't have permission to read performance counters. Trace a warning. + if (DiagnosticUtility.ShouldTraceWarning) + { + TraceUtility.TraceEvent(TraceEventType.Warning, + TraceCode.PerformanceCountersFailedForService, + SR.GetString(SR.EnsureCategoriesExistFailedPermission)); + } + } + catch + { + // Failed to ensure all of the categories exist. Catch the exception and try to create the counter anyway. + } + finally + { + // Delete the dummy counters, we don't need them anymore. + if (operationCounter != null) + { + operationCounter.DeleteInstance(); + } + + if (endpointCounter != null) + { + endpointCounter.DeleteInstance(); + } + + if (serviceCounter != null) + { + serviceCounter.DeleteInstance(); + } + + categoriesExist = true; + } + } } } diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersBase.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersBase.cs index 547633b753..0443a521d5 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersBase.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersBase.cs @@ -143,16 +143,31 @@ namespace System.ServiceModel.Diagnostics get { return (int)PerfCounters.TotalCounters; } } - static internal string CreateFriendlyInstanceName(ServiceHostBase serviceHost) + private static string GetServiceUri(ServiceHostBase serviceHost, ServiceInfo serviceInfo) { - // instance name is: serviceName@uri - ServiceInfo serviceInfo = new ServiceInfo(serviceHost); - string serviceName = serviceInfo.ServiceName; string uri; if (!TryGetFullVirtualPath(serviceHost, out uri)) { uri = serviceInfo.FirstAddress; } + return uri; + } + + private static string GetFullInstanceName(ServiceHostBase serviceHost) + { + // instance name is: serviceName@uri + ServiceInfo serviceInfo = new ServiceInfo(serviceHost); + string serviceName = serviceInfo.ServiceName; + string uri = GetServiceUri(serviceHost, serviceInfo); + return String.Format("{0}@{1}", serviceName, uri); + } + + private static string GetShortInstanceName(ServiceHostBase serviceHost) + { + ServiceInfo serviceInfo = new ServiceInfo(serviceHost); + string serviceName = serviceInfo.ServiceName; + string uri = GetServiceUri(serviceHost, serviceInfo); + int length = serviceName.Length + uri.Length + 2; if (length > maxCounterLength) @@ -181,6 +196,32 @@ namespace System.ServiceModel.Diagnostics return serviceName + "@" + uri.Replace('/', '|'); } + internal static string CreateFriendlyInstanceName(ServiceHostBase serviceHost) + { + string shortInstanceName = GetShortInstanceName(serviceHost); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(serviceHost); + + return EnsureUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELSERVICE.ServicePerfCounters, shortInstanceName, fullInstanceName); + } + + internal static string GetFriendlyInstanceName(ServiceHostBase serviceHost) + { + string shortInstanceName = GetShortInstanceName(serviceHost); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(serviceHost); + + return GetUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELSERVICE.ServicePerfCounters, shortInstanceName, fullInstanceName); + } + static bool TryGetFullVirtualPath(ServiceHostBase serviceHost, out string uri) { VirtualPathExtension pathExtension = serviceHost.Extensions.Find(); diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersV2.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersV2.cs index 9e53c72fe2..b037f388f4 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersV2.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersV2.cs @@ -232,6 +232,18 @@ using System.ServiceModel.Administration; get { return this.serviceCounterSetInstance != null; } } + // Immediately disposes and nulls the CounterSetInstance. This differs from Dispose because Dispose is "lazy" in that + // it holds weak references to the instances so we don't get corrupted state if the values are updated later. This + // method is used in situations when we need to delete the instance immediately and know the values won't be updated. + internal void DeleteInstance() + { + if (this.serviceCounterSetInstance != null) + { + this.serviceCounterSetInstance.Dispose(); + this.serviceCounterSetInstance = null; + } + } + protected override void Dispose(bool disposing) { try diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/TraceUtility.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/TraceUtility.cs index c51655adf8..17d2b24eaf 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/TraceUtility.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/TraceUtility.cs @@ -554,6 +554,24 @@ namespace System.ServiceModel.Diagnostics return retval; } + + internal static ServiceModelActivity ExtractActivity(RequestContext request) + { + try + { + return TraceUtility.ExtractActivity(request.RequestMessage); + } + catch (Exception e) + { + if (Fx.IsFatal(e)) + { + throw; + } + } + + return null; + } + internal static Guid ExtractActivityId(Message message) { if (TraceUtility.MessageFlowTracingOnly) diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ChannelHandler.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ChannelHandler.cs index 317a6f9a56..d4c7285a86 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ChannelHandler.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ChannelHandler.cs @@ -5,6 +5,7 @@ namespace System.ServiceModel.Dispatcher { using System; + using System.Diagnostics; using System.Globalization; using System.Runtime; using System.Runtime.CompilerServices; @@ -769,7 +770,7 @@ namespace System.ServiceModel.Dispatcher bool HandleError(Exception e, ref ErrorHandlerFaultInfo faultInfo) { - if (!(e != null)) + if (e == null) { Fx.Assert(SR.GetString(SR.GetString(SR.SFxNonExceptionThrown))); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.GetString(SR.SFxNonExceptionThrown)))); @@ -944,7 +945,8 @@ namespace System.ServiceModel.Dispatcher return false; } - ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? TraceUtility.ExtractActivity(request.RequestMessage) : null; + ServiceModelActivity activity = DiagnosticUtility.ShouldUseActivity ? TraceUtility.ExtractActivity(request) : null; + using (ServiceModelActivity.BoundOperation(activity)) { if (this.HandleRequestAsReply(request)) @@ -1440,7 +1442,7 @@ namespace System.ServiceModel.Dispatcher { if (this.isConcurrent) { - this.isPumpAcquired = 0; + Interlocked.Exchange(ref this.isPumpAcquired, 0); } } @@ -1793,8 +1795,6 @@ namespace System.ServiceModel.Dispatcher } this.requestInfo.ChannelHandlerOwnsInstanceContextThrottle = (this.requestInfo.ExistingInstanceContext == null); - - if (this.DispatchAndReleasePump(request, false, null)) { this.EnsurePump(); @@ -1802,9 +1802,42 @@ namespace System.ServiceModel.Dispatcher } } + bool TryRetrievingInstanceContext(RequestContext request) + { + try + { + return TryRetrievingInstanceContextCore(request); + } + catch (Exception ex) + { + if (Fx.IsFatal(ex)) + { + throw; + } + + DiagnosticUtility.TraceHandledException(ex, TraceEventType.Error); + + try + { + request.Close(); + } + catch (Exception e) + { + if (Fx.IsFatal(e)) + { + throw; + } + + request.Abort(); + } + + return false; + } + } + //Return: False denotes failure, Caller should discard the request. // : True denotes operation is sucessful. - bool TryRetrievingInstanceContext(RequestContext request) + bool TryRetrievingInstanceContextCore(RequestContext request) { bool releasePump = true; try @@ -1870,6 +1903,7 @@ namespace System.ServiceModel.Dispatcher } this.HandleError(e, request, channel); + return false; } finally @@ -1949,10 +1983,7 @@ namespace System.ServiceModel.Dispatcher { if (this.isConcurrent) { - if (this.isPumpAcquired != 0 || Interlocked.CompareExchange(ref this.isPumpAcquired, 1, 0) != 0) - { - return false; - } + return Interlocked.CompareExchange(ref this.isPumpAcquired, 1, 0) == 0; } return true; diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs index cb52945280..caf32a6274 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs @@ -1030,7 +1030,7 @@ namespace System.ServiceModel.Dispatcher void ProcessMessage31(ref MessageRpc rpc) { - rpc.NextProcessor = this.ProcessMessage4; + rpc.NextProcessor = this.processMessage4; if (this.transaction != null) { diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ServiceThrottle.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ServiceThrottle.cs index b7fa151262..1712f11c32 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ServiceThrottle.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ServiceThrottle.cs @@ -50,16 +50,23 @@ namespace System.ServiceModel.Dispatcher { get { - lock (this.ThisLock) + if (this.calls == null) { - if (this.calls == null) + lock (this.ThisLock) { - this.calls = new FlowThrottle(this.GotCall, ServiceThrottle.DefaultMaxConcurrentCallsCpuCount, - ServiceThrottle.MaxConcurrentCallsPropertyName, ServiceThrottle.MaxConcurrentCallsConfigName); - this.calls.SetRatio(this.RatioCallsToken); + if (this.calls == null) + { + FlowThrottle callsFt = new FlowThrottle(this.GotCall, ServiceThrottle.DefaultMaxConcurrentCallsCpuCount, + ServiceThrottle.MaxConcurrentCallsPropertyName, ServiceThrottle.MaxConcurrentCallsConfigName); + + callsFt.SetRatio(this.RatioCallsToken); + + this.calls = callsFt; + } } - return this.calls; } + + return this.calls; } } @@ -67,16 +74,23 @@ namespace System.ServiceModel.Dispatcher { get { - lock (this.ThisLock) + if (this.sessions == null) { - if (this.sessions == null) + lock (this.ThisLock) { - this.sessions = new FlowThrottle(this.GotSession, ServiceThrottle.DefaultMaxConcurrentSessionsCpuCount, - ServiceThrottle.MaxConcurrentSessionsPropertyName, ServiceThrottle.MaxConcurrentSessionsConfigName); - this.sessions.SetRatio(this.RatioSessionsToken); + if (this.sessions == null) + { + FlowThrottle sessionsFt = new FlowThrottle(this.GotSession, ServiceThrottle.DefaultMaxConcurrentSessionsCpuCount, + ServiceThrottle.MaxConcurrentSessionsPropertyName, ServiceThrottle.MaxConcurrentSessionsConfigName); + + sessionsFt.SetRatio(this.RatioSessionsToken); + + this.sessions = sessionsFt; + } } - return this.sessions; } + + return this.sessions; } } @@ -84,16 +98,22 @@ namespace System.ServiceModel.Dispatcher { get { - lock (this.ThisLock) + if (this.dynamic == null) { - if (this.dynamic == null) + lock (this.ThisLock) { - this.dynamic = new QuotaThrottle(this.GotDynamic, new object()); - this.dynamic.Owner = "ServiceHost"; + if (this.dynamic == null) + { + QuotaThrottle dynamicQt = new QuotaThrottle(this.GotDynamic, new object()); + dynamicQt.Owner = "ServiceHost"; + + this.dynamic = dynamicQt; + } } - this.UpdateIsActive(); - return this.dynamic; } + + this.UpdateIsActive(); + return this.dynamic; } } @@ -158,20 +178,27 @@ namespace System.ServiceModel.Dispatcher { get { - lock (this.ThisLock) + if (this.instanceContexts == null) { - if (this.instanceContexts == null) + lock (this.ThisLock) { - this.instanceContexts = new FlowThrottle(this.GotInstanceContext, Int32.MaxValue, - ServiceThrottle.MaxConcurrentInstancesPropertyName, ServiceThrottle.MaxConcurrentInstancesConfigName); - this.instanceContexts.SetRatio(this.RatioInstancesToken); - if (this.servicePerformanceCounters != null) + if (this.instanceContexts == null) { - InitializeInstancePerfCounterSettings(); + FlowThrottle instanceContextsFt = new FlowThrottle(this.GotInstanceContext, Int32.MaxValue, + ServiceThrottle.MaxConcurrentInstancesPropertyName, ServiceThrottle.MaxConcurrentInstancesConfigName); + instanceContextsFt.SetRatio(this.RatioInstancesToken); + + if (this.servicePerformanceCounters != null) + { + InitializeInstancePerfCounterSettings(instanceContextsFt); + } + + this.instanceContexts = instanceContextsFt; } } - return this.instanceContexts; } + + return this.instanceContexts; } } @@ -191,7 +218,7 @@ namespace System.ServiceModel.Dispatcher //instance throttle is created through the behavior, set the perf counter callbacks if initialized if (this.instanceContexts != null) { - InitializeInstancePerfCounterSettings(); + InitializeInstancePerfCounterSettings(this.instanceContexts); } //this.calls and this.sessions throttles are created by the constructor. Set the perf counter callbacks @@ -199,14 +226,14 @@ namespace System.ServiceModel.Dispatcher InitializeSessionsPerfCounterSettings(); } - void InitializeInstancePerfCounterSettings() + void InitializeInstancePerfCounterSettings(FlowThrottle instanceContextsFt) { - Fx.Assert(this.instanceContexts != null, "Expect instanceContext to be initialized"); + Fx.Assert(instanceContextsFt != null, "Expect instanceContext to be initialized"); Fx.Assert(this.servicePerformanceCounters != null, "expect servicePerformanceCounters to be set"); - this.instanceContexts.SetAcquired(this.AcquiredInstancesToken); - this.instanceContexts.SetReleased(this.ReleasedInstancesToken); - this.instanceContexts.SetRatio(this.RatioInstancesToken); - this.servicePerformanceCounters.SetThrottleBase((int)ServicePerformanceCounters.PerfCounters.InstancesPercentMaxInstancesBase, this.instanceContexts.Capacity); + instanceContextsFt.SetAcquired(this.AcquiredInstancesToken); + instanceContextsFt.SetReleased(this.ReleasedInstancesToken); + instanceContextsFt.SetRatio(this.RatioInstancesToken); + this.servicePerformanceCounters.SetThrottleBase((int)ServicePerformanceCounters.PerfCounters.InstancesPercentMaxInstancesBase, instanceContextsFt.Capacity); } void InitializeCallsPerfCounterSettings() diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/EndpointTrait.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/EndpointTrait.cs index a1805b2d60..cc42d3bda8 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/EndpointTrait.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/EndpointTrait.cs @@ -9,4 +9,4 @@ namespace System.ServiceModel { public abstract ChannelFactory CreateChannelFactory(); } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/LocalAppContextSwitches.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/LocalAppContextSwitches.cs new file mode 100644 index 0000000000..616b1feddc --- /dev/null +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/LocalAppContextSwitches.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +namespace System.ServiceModel +{ + using System; + using System.Runtime.CompilerServices; + + // When adding a quirk, name it such that false is new behavior and true is old behavior. + // You are opting IN to old behavior. The new behavior is default. + // For example, we want to enable the functionality to explicitly add a connection close header + // in 4.6 and above. So we set DisableExplicitConnectionCloseHeader to true if running 4.5.2 or less. + internal static class LocalAppContextSwitches + { + private const string DisableExplicitConnectionCloseHeaderString = "Switch.System.ServiceModel.DisableExplicitConnectionCloseHeader"; + private const string AllowUnsignedToHeaderString = "Switch.System.ServiceModel.AllowUnsignedToHeader"; + + private static int disableExplicitConnectionCloseHeader; + private static int allowUnsignedToHeader; + + public static bool DisableExplicitConnectionCloseHeader + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return LocalAppContext.GetCachedSwitchValue(DisableExplicitConnectionCloseHeaderString, ref disableExplicitConnectionCloseHeader); + } + } + + public static bool AllowUnsignedToHeader + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return LocalAppContext.GetCachedSwitchValue(AllowUnsignedToHeaderString, ref allowUnsignedToHeader); + } + } + + public static void SetDefaultsLessOrEqual_452() + { + // Define the switches that should be true for 4.5.2 or less, false for 4.6+. + LocalAppContext.DefineSwitchDefault(DisableExplicitConnectionCloseHeaderString, true); + } + } +} diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/OSVersion.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/OSVersion.cs index b70de21180..165d8db22b 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/OSVersion.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/OSVersion.cs @@ -46,4 +46,4 @@ namespace System.ServiceModel /// PostWin8, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs index e24e7b2ecc..913840d035 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs @@ -18,6 +18,7 @@ namespace System.ServiceModel.Security using System.Net.Security; using System.Runtime; using System.Security; + using System.Security.Authentication; using System.Security.Authentication.ExtendedProtection; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; @@ -105,6 +106,28 @@ namespace System.ServiceModel.Security } } + static class SslProtocolsHelper + { + internal static bool IsDefined(SslProtocols value) + { + SslProtocols allValues = SslProtocols.None; + foreach (var protocol in Enum.GetValues(typeof(SslProtocols))) + { + allValues |= (SslProtocols)protocol; + } + return (value & allValues) == value; + } + + internal static void Validate(SslProtocols value) + { + if (!IsDefined(value)) + { + throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException("value", (int)value, + typeof(SslProtocols))); + } + } + } + static class TokenImpersonationLevelHelper { internal static bool IsDefined(TokenImpersonationLevel value) diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Security/TransportSecurityProtocol.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Security/TransportSecurityProtocol.cs index cf865bbb42..93c2c9b13a 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Security/TransportSecurityProtocol.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Security/TransportSecurityProtocol.cs @@ -240,6 +240,13 @@ namespace System.ServiceModel.Security securityHeader.ExpectEndorsingTokens = expectEndorsingTokens; securityHeader.MaxReceivedMessageSize = factory.SecurityBindingElement.MaxReceivedMessageSize; securityHeader.ReaderQuotas = factory.SecurityBindingElement.ReaderQuotas; + + // Due to compatibility, only honor this setting if this app setting is enabled + if (ServiceModelAppSettings.UseConfiguredTransportSecurityHeaderLayout) + { + securityHeader.Layout = factory.SecurityHeaderLayout; + } + TimeoutHelper timeoutHelper = new TimeoutHelper(timeout); if (!factory.ActAsInitiator) { diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityOneDotZeroReceiveSecurityHeader.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityOneDotZeroReceiveSecurityHeader.cs index ee27b7d35d..fdf3f0ce69 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityOneDotZeroReceiveSecurityHeader.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityOneDotZeroReceiveSecurityHeader.cs @@ -222,7 +222,7 @@ namespace System.ServiceModel.Security } if (!isHeaderEncrypted && reader.IsStartElement(SecurityXXX2005Strings.EncryptedHeader, SecurityXXX2005Strings.Namespace)) - { + { XmlDictionaryReader localreader = headers.GetReaderAtHeader(i); localreader.ReadStartElement(SecurityXXX2005Strings.EncryptedHeader, SecurityXXX2005Strings.Namespace); @@ -234,7 +234,7 @@ namespace System.ServiceModel.Security { isHeaderEncrypted = true; } - } + } } this.ElementManager.VerifyUniquenessAndSetHeaderId(id, i); @@ -611,9 +611,27 @@ namespace System.ServiceModel.Security throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SR.GetString(SR.TransportSecuredMessageMissingToHeader))); XmlDictionaryReader toHeaderReader = this.Message.Headers.GetReaderAtHeader(headerIndex); id = toHeaderReader.GetAttribute(XD.UtilityDictionary.IdAttribute, XD.UtilityDictionary.Namespace); - if (id == null) - throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SR.GetString(SR.UnsignedToHeaderInTransportSecuredMessage))); - signedXml.EnsureDigestValidity(id, toHeaderReader); + + // DevDiv:938534 - We added a flag that allow unsigned headers. If this is set, we do not throw an Exception but move on to CompleteSignatureVerification() + if (LocalAppContextSwitches.AllowUnsignedToHeader) + { + // The lack of an id indicates that the sender did not wish to sign the header. We can safely assume that null indicates this header is not signed. + // If id is not null, then we need to validate the Digest and ensure signature is valid. The exception is thrown deeper in the System.IdentityModel stack. + if (id != null) + { + signedXml.EnsureDigestValidityIfIdMatches(id, toHeaderReader); + } + } + else + { + // default behavior for all platforms + if (id == null) + { + // + throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SR.GetString(SR.UnsignedToHeaderInTransportSecuredMessage))); + } + signedXml.EnsureDigestValidity(id, toHeaderReader); + } } signedXml.CompleteSignatureVerification(); return token; @@ -692,7 +710,7 @@ namespace System.ServiceModel.Security } } - // This check makes sure that if RequireSignedPrimaryToken is true (ProtectTokens is enabled on sbe) then the incoming message + // This check makes sure that if RequireSignedPrimaryToken is true (ProtectTokens is enabled on sbe) then the incoming message // should have the primary signature over the primary(signing)token. if (isPrimarySignature && this.RequireSignedPrimaryToken && !this.ElementManager.IsPrimaryTokenSigned) { diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAppSettings.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAppSettings.cs new file mode 100644 index 0000000000..b7c7db2a42 --- /dev/null +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAppSettings.cs @@ -0,0 +1,99 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// + +namespace System.ServiceModel +{ + using System.Collections.Specialized; + using System.Configuration; + using System.Diagnostics.CodeAnalysis; + using System.Runtime; + + // Due to friend relationships with other assemblies, naming this class as AppSettings causes ambiguity when building those assemblies + internal static class ServiceModelAppSettings + { + internal const string HttpTransportPerFactoryConnectionPoolString = "wcf:httpTransportBinding:useUniqueConnectionPoolPerFactory"; + internal const string EnsureUniquePerformanceCounterInstanceNamesString = "wcf:ensureUniquePerformanceCounterInstanceNames"; + internal const string UseConfiguredTransportSecurityHeaderLayoutString = "wcf:useConfiguredTransportSecurityHeaderLayout"; + const bool DefaultHttpTransportPerFactoryConnectionPool = false; + const bool DefaultEnsureUniquePerformanceCounterInstanceNames = false; + const bool DefaultUseConfiguredTransportSecurityHeaderLayout = false; + static bool httpTransportPerFactoryConnectionPool; + static bool ensureUniquePerformanceCounterInstanceNames; + static bool useConfiguredTransportSecurityHeaderLayout; + static volatile bool settingsInitalized = false; + static object appSettingsLock = new object(); + + internal static bool HttpTransportPerFactoryConnectionPool + { + get + { + EnsureSettingsLoaded(); + + return httpTransportPerFactoryConnectionPool; + } + } + + internal static bool EnsureUniquePerformanceCounterInstanceNames + { + get + { + EnsureSettingsLoaded(); + + return ensureUniquePerformanceCounterInstanceNames; + } + } + + internal static bool UseConfiguredTransportSecurityHeaderLayout + { + get + { + EnsureSettingsLoaded(); + + return useConfiguredTransportSecurityHeaderLayout; + } + } + + [SuppressMessage(FxCop.Category.ReliabilityBasic, "Reliability104:CaughtAndHandledExceptionsRule", + Justification = "Handle the configuration exceptions here to avoid regressions on customer's existing scenarios")] + static void EnsureSettingsLoaded() + { + if (!settingsInitalized) + { + lock (appSettingsLock) + { + if (!settingsInitalized) + { + NameValueCollection appSettingsSection = null; + try + { + appSettingsSection = ConfigurationManager.AppSettings; + } + catch (ConfigurationErrorsException) + { + } + finally + { + if ((appSettingsSection == null) || !bool.TryParse(appSettingsSection[HttpTransportPerFactoryConnectionPoolString], out httpTransportPerFactoryConnectionPool)) + { + httpTransportPerFactoryConnectionPool = DefaultHttpTransportPerFactoryConnectionPool; + } + + if ((appSettingsSection == null) || !bool.TryParse(appSettingsSection[EnsureUniquePerformanceCounterInstanceNamesString], out ensureUniquePerformanceCounterInstanceNames)) + { + ensureUniquePerformanceCounterInstanceNames = DefaultEnsureUniquePerformanceCounterInstanceNames; + } + + if ((appSettingsSection == null) || !bool.TryParse(appSettingsSection[UseConfiguredTransportSecurityHeaderLayoutString], out useConfiguredTransportSecurityHeaderLayout)) + { + useConfiguredTransportSecurityHeaderLayout = DefaultUseConfiguredTransportSecurityHeaderLayout; + } + + settingsInitalized = true; + } + } + } + } + } + } +} diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAttributeTargets.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAttributeTargets.cs index a509ec937b..6e73e4d044 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAttributeTargets.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAttributeTargets.cs @@ -20,4 +20,4 @@ namespace System.ServiceModel public const AttributeTargets ContractBehavior = ServiceBehavior | ClientBehavior; public const AttributeTargets OperationBehavior = AttributeTargets.Method; } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelStrings.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelStrings.cs index b90c5b928a..f8d14752a3 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelStrings.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelStrings.cs @@ -8,4 +8,4 @@ namespace System.ServiceModel public abstract int Count { get; } public abstract string this[int index] { get; } } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/StringUtil.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/StringUtil.cs new file mode 100644 index 0000000000..cb8e8ef58a --- /dev/null +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/StringUtil.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +namespace System.ServiceModel +{ + internal static class StringUtil + { + private static readonly bool randomizedStringHashingEnabled; + + static StringUtil() + { + // StringComparer.InvariantCultureIgnoreCase.GetHashCode is a stable hash between 32 and 64 bits. + // Test the result of this GetHashCode against a known test vector to see if randomized hashing is enabled. + randomizedStringHashingEnabled = StringComparer.InvariantCultureIgnoreCase.GetHashCode("The quick brown fox jumps over the lazy dog.") != 0x703e662e; + } + + // This should be used instead of String.GetHashCode if the value should be + // stable even if UseRandomizedStringHashing is enabled. + internal static int GetNonRandomizedHashCode(string str) + { + if (!randomizedStringHashingEnabled) + { + return str.GetHashCode(); + } + + return GetStableHashCode(str); + } + + // This is copied from the 32 bit implementation from String.GetHashCode. + // Since ServiceModel is compiled for MSIL, we can't have different functionality + // for 32 and 64 bits. + [System.Security.SecuritySafeCritical] + private static int GetStableHashCode(string str) + { + unsafe + { + fixed (char* src = str) + { + int hash1 = (5381 << 16) + 5381; + int hash2 = hash1; + + // 32 bit machines. + int* pint = (int*)src; + int len = str.Length; + while (len > 2) + { + hash1 = ((hash1 << 5) + hash1 + (hash1 >> 27)) ^ pint[0]; + hash2 = ((hash2 << 5) + hash2 + (hash2 >> 27)) ^ pint[1]; + pint += 2; + len -= 4; + } + + if (len > 0) + { + hash1 = ((hash1 << 5) + hash1 + (hash1 >> 27)) ^ pint[0]; + } + + return hash1 + (hash2 * 1566083941); + } + } + } + } +} diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs index 2b294d1ace..a417e2b9dc 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs @@ -502,9 +502,8 @@ namespace System.ServiceModel.Syndication } } } - reader.ReadStartElement(); - link.Uri = new Uri(reader.ReadString(), UriKind.RelativeOrAbsolute); - reader.ReadEndElement(); + string uri = reader.ReadElementString(); + link.Uri = new Uri(uri, UriKind.RelativeOrAbsolute); return link; } @@ -655,10 +654,17 @@ namespace System.ServiceModel.Syndication } else if (reader.IsStartElement(Rss20Constants.PubDateTag, Rss20Constants.Rss20Namespace)) { + bool canReadContent = !reader.IsEmptyElement; reader.ReadStartElement(); - string str = reader.ReadString(); - result.PublishDate = DateFromString(str, reader); - reader.ReadEndElement(); + if (canReadContent) + { + string str = reader.ReadString(); + if (!string.IsNullOrEmpty(str)) + { + result.PublishDate = DateFromString(str, reader); + } + reader.ReadEndElement(); + } } else if (reader.IsStartElement(Rss20Constants.SourceTag, Rss20Constants.Rss20Namespace)) { @@ -691,9 +697,7 @@ namespace System.ServiceModel.Syndication } } } - reader.ReadStartElement(); - string feedTitle = reader.ReadString(); - reader.ReadEndElement(); + string feedTitle = reader.ReadElementString(); feed.Title = new TextSyndicationContent(feedTitle); result.SourceFeed = feed; } @@ -947,9 +951,17 @@ namespace System.ServiceModel.Syndication } else if (reader.IsStartElement(Rss20Constants.LastBuildDateTag, Rss20Constants.Rss20Namespace)) { + bool canReadContent = !reader.IsEmptyElement; reader.ReadStartElement(); - result.LastUpdatedTime = DateFromString(reader.ReadString(), reader); - reader.ReadEndElement(); + if (canReadContent) + { + string str = reader.ReadString(); + if (!string.IsNullOrEmpty(str)) + { + result.LastUpdatedTime = DateFromString(str, reader); + } + reader.ReadEndElement(); + } } else if (reader.IsStartElement(Rss20Constants.CategoryTag, Rss20Constants.Rss20Namespace)) { diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/TcpTransportSecurity.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/TcpTransportSecurity.cs index af674bcdf0..cecfed85e3 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/TcpTransportSecurity.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/TcpTransportSecurity.cs @@ -4,6 +4,7 @@ namespace System.ServiceModel { using System; + using System.Security.Authentication; using System.Security.Authentication.ExtendedProtection; using System.ServiceModel.Channels; using System.ServiceModel.Security; @@ -19,12 +20,14 @@ namespace System.ServiceModel TcpClientCredentialType clientCredentialType; ProtectionLevel protectionLevel; ExtendedProtectionPolicy extendedProtectionPolicy; + SslProtocols sslProtocols; public TcpTransportSecurity() { this.clientCredentialType = DefaultClientCredentialType; this.protectionLevel = DefaultProtectionLevel; this.extendedProtectionPolicy = ChannelBindingUtility.DefaultPolicy; + this.sslProtocols = TransportDefaults.SslProtocols; } [DefaultValue(DefaultClientCredentialType)] @@ -78,6 +81,17 @@ namespace System.ServiceModel } } + [DefaultValue(TransportDefaults.SslProtocols)] + public SslProtocols SslProtocols + { + get { return this.sslProtocols; } + set + { + SslProtocolsHelper.Validate(value); + this.sslProtocols = value; + } + } + SslStreamSecurityBindingElement CreateSslBindingElement(bool requireClientCertificate) { if (this.protectionLevel != ProtectionLevel.EncryptAndSign) @@ -88,17 +102,20 @@ namespace System.ServiceModel SslStreamSecurityBindingElement result = new SslStreamSecurityBindingElement(); result.RequireClientCertificate = requireClientCertificate; + result.SslProtocols = sslProtocols; return result; } - static bool IsSslBindingElement(BindingElement element, TcpTransportSecurity transportSecurity, out bool requireClientCertificate) + static bool IsSslBindingElement(BindingElement element, TcpTransportSecurity transportSecurity, out bool requireClientCertificate, out SslProtocols sslProtocols) { requireClientCertificate = false; + sslProtocols = TransportDefaults.SslProtocols; SslStreamSecurityBindingElement ssl = element as SslStreamSecurityBindingElement; if (ssl == null) return false; transportSecurity.ProtectionLevel = ProtectionLevel.EncryptAndSign; requireClientCertificate = ssl.RequireClientCertificate; + sslProtocols = ssl.SslProtocols; return true; } @@ -110,7 +127,8 @@ namespace System.ServiceModel internal static bool SetTransportProtectionOnly(BindingElement transport, TcpTransportSecurity transportSecurity) { bool requireClientCertificate; - return IsSslBindingElement(transport, transportSecurity, out requireClientCertificate); + SslProtocols sslProtocols; + return IsSslBindingElement(transport, transportSecurity, out requireClientCertificate, out sslProtocols); } internal BindingElement CreateTransportProtectionAndAuthentication() @@ -130,15 +148,17 @@ namespace System.ServiceModel internal static bool SetTransportProtectionAndAuthentication(BindingElement transport, TcpTransportSecurity transportSecurity) { bool requireClientCertificate = false; + SslProtocols sslProtocols = TransportDefaults.SslProtocols; if (transport is WindowsStreamSecurityBindingElement) { transportSecurity.ClientCredentialType = TcpClientCredentialType.Windows; transportSecurity.ProtectionLevel = ((WindowsStreamSecurityBindingElement)transport).ProtectionLevel; return true; } - else if (IsSslBindingElement(transport, transportSecurity, out requireClientCertificate)) + else if (IsSslBindingElement(transport, transportSecurity, out requireClientCertificate, out sslProtocols)) { transportSecurity.ClientCredentialType = requireClientCertificate ? TcpClientCredentialType.Certificate : TcpClientCredentialType.None; + transportSecurity.SslProtocols = sslProtocols; return true; } return false; @@ -148,6 +168,7 @@ namespace System.ServiceModel { return this.ClientCredentialType != TcpTransportSecurity.DefaultClientCredentialType || this.ProtectionLevel != TcpTransportSecurity.DefaultProtectionLevel + || this.SslProtocols != TransportDefaults.SslProtocols || ShouldSerializeExtendedProtectionPolicy(); } diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/Transactions/IsolationFlags.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/Transactions/IsolationFlags.cs index 927e14c670..b4c249c430 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/Transactions/IsolationFlags.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/Transactions/IsolationFlags.cs @@ -21,4 +21,4 @@ namespace System.ServiceModel.Transactions Optimistic = 0x00000010, ReadOnly = 0x00000020 } -} +} \ No newline at end of file diff --git a/external/referencesource/System.ServiceModel/System/ServiceModel/UpnEndpointIdentity.cs b/external/referencesource/System.ServiceModel/System/ServiceModel/UpnEndpointIdentity.cs index c00f1e0d9a..ee6af2c46a 100644 --- a/external/referencesource/System.ServiceModel/System/ServiceModel/UpnEndpointIdentity.cs +++ b/external/referencesource/System.ServiceModel/System/ServiceModel/UpnEndpointIdentity.cs @@ -80,7 +80,11 @@ namespace System.ServiceModel try { downlevelName = windowsIdentity.Name; - upnName = GetUpnFromDownlevelName(downlevelName); + + if (this.IsMachineJoinedToDomain()) + { + upnName = GetUpnFromDownlevelName(downlevelName); + } } #pragma warning suppress 56500 // covered by FxCOP catch (Exception e) @@ -89,13 +93,34 @@ namespace System.ServiceModel { throw; } + DiagnosticUtility.TraceHandledException(e, TraceEventType.Warning); } + // if the AD cannot be queried for the fully qualified domain name, // fall back to the downlevel UPN name return upnName ?? downlevelName; } + bool IsMachineJoinedToDomain() + { + IntPtr pDomainControllerInfo = IntPtr.Zero; + + try + { + int result = SafeNativeMethods.DsGetDcName(null, null, IntPtr.Zero, null, (uint)DSFlags.DS_DIRECTORY_SERVICE_REQUIRED, out pDomainControllerInfo); + + return result != (int)Win32Error.ERROR_NO_SUCH_DOMAIN; + } + finally + { + if (pDomainControllerInfo != IntPtr.Zero) + { + SafeNativeMethods.NetApiBufferFree(pDomainControllerInfo); + } + } + } + // Duplicate code from SecurityImpersonationBehavior string GetUpnFromDownlevelName(string downlevelName) { @@ -108,6 +133,7 @@ namespace System.ServiceModel { throw DiagnosticUtility.ExceptionUtility.ThrowHelperWarning(new InvalidOperationException(SR.GetString(SR.DownlevelNameCannotMapToUpn, downlevelName))); } + string shortDomainName = downlevelName.Substring(0, delimiterPos + 1); string userName = downlevelName.Substring(delimiterPos + 1); string fullDomainName; diff --git a/external/referencesource/System.Web.ApplicationServices/Properties/AssemblyInfo.cs b/external/referencesource/System.Web.ApplicationServices/Properties/AssemblyInfo.cs index b643d49d37..d3dbff8619 100644 --- a/external/referencesource/System.Web.ApplicationServices/Properties/AssemblyInfo.cs +++ b/external/referencesource/System.Web.ApplicationServices/Properties/AssemblyInfo.cs @@ -9,4 +9,4 @@ using System.Runtime.CompilerServices; [module: SuppressMessage("Microsoft.Naming", "CA1701:ResourceStringCompoundWordsShouldBeCasedCorrectly", MessageId = "username", Scope = "resource", Target = "System.Web.ApplicationServicesStrings.resources", - Justification = "The use of the word is correct in a technical context.")] + Justification = "The use of the word is correct in a technical context.")] \ No newline at end of file diff --git a/external/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesignerHelper.cs b/external/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesignerHelper.cs index 3b53951fe8..652acc5872 100644 --- a/external/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesignerHelper.cs +++ b/external/referencesource/System.Web.Entity.Design/System/Data/WebControls/Design/EntityDataSourceDesignerHelper.cs @@ -70,6 +70,7 @@ namespace System.Web.UI.Design.WebControls private bool _forceSchemaRetrieval; private readonly EntityDataSourceDesigner _owner; private bool _canLoadWebConfig; + private bool _usingEntityFrameworkVersionHigherThanFive = false; #endregion internal EntityDataSourceDesignerHelper(EntityDataSource entityDataSource, bool interactiveMode) @@ -96,7 +97,7 @@ namespace System.Web.UI.Design.WebControls } Debug.Assert(_owner != null, "expected non-null owner"); - Debug.Assert(_webApplication != null, "expected non-null web application service"); + Debug.Assert(_webApplication != null, "expected non-null web application service"); } internal void AddSystemWebEntityReference() @@ -627,9 +628,16 @@ namespace System.Web.UI.Design.WebControls catch (Exception ex) { StringBuilder exceptionMessage = new StringBuilder(); - exceptionMessage.AppendLine(Strings.Error_MetadataLoadError); - exceptionMessage.AppendLine(); - exceptionMessage.Append(ex.Message); + if (_usingEntityFrameworkVersionHigherThanFive) + { + exceptionMessage.Append(Strings.Error_UnsupportedVersionOfEntityFramework); + } + else + { + exceptionMessage.AppendLine(Strings.Error_MetadataLoadError); + exceptionMessage.AppendLine(); + exceptionMessage.Append(ex.Message); + } ShowError(exceptionMessage.ToString()); } } @@ -657,9 +665,17 @@ namespace System.Web.UI.Design.WebControls { foreach (Type type in typeDiscoverySvc.GetTypes(typeof(object), false /*excludeGlobalTypes*/)) { - if (!_assemblies.Contains(type.Assembly) && !IsSystemAssembly(type.Assembly.FullName)) + var assembly = type.Assembly; + if (!_usingEntityFrameworkVersionHigherThanFive + && assembly.GetName().Name.Equals("EntityFramework", StringComparison.InvariantCultureIgnoreCase) + && assembly.GetName().Version.Major > 5) { - _assemblies.Add(type.Assembly); + _usingEntityFrameworkVersionHigherThanFive = true; + ShowError(Strings.Error_UnsupportedVersionOfEntityFramework); + } + if (!_assemblies.Contains(assembly) && !IsSystemAssembly(assembly.FullName)) + { + _assemblies.Add(assembly); } } } diff --git a/external/referencesource/System.Web.Entity/AssemblyInfo.cs b/external/referencesource/System.Web.Entity/AssemblyInfo.cs index 2cab554ad9..48281823db 100644 --- a/external/referencesource/System.Web.Entity/AssemblyInfo.cs +++ b/external/referencesource/System.Web.Entity/AssemblyInfo.cs @@ -3,8 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // // -// @owner [....] -// @backupOwner [....] +// @owner barryfr +// @backupOwner cmeek //--------------------------------------------------------------------- // Ensures that this library never satisfies a link demand by virtue of being a GACed diff --git a/external/referencesource/System.Web.Extensions/Handlers/ScriptModule.cs b/external/referencesource/System.Web.Extensions/Handlers/ScriptModule.cs index c6e323ff26..150fb37f35 100644 --- a/external/referencesource/System.Web.Extensions/Handlers/ScriptModule.cs +++ b/external/referencesource/System.Web.Extensions/Handlers/ScriptModule.cs @@ -143,6 +143,10 @@ namespace System.Web.Handlers { response.Cache.SetCacheability(HttpCacheability.NoCache); response.ContentType = "text/plain"; + // DevDiv#961281 + // Allow apps to access to the redirect location + context.Items[PageRequestManager.AsyncPostBackRedirectLocationKey] = redirectLocation; + // Preserve redirected state: TFS#882879 response.IsRequestBeingRedirected = true; diff --git a/external/referencesource/System.Web.Extensions/ui/EmbeddedResourceFinder.cs b/external/referencesource/System.Web.Extensions/ui/EmbeddedResourceFinder.cs index 4695543de1..56f254eac2 100644 --- a/external/referencesource/System.Web.Extensions/ui/EmbeddedResourceFinder.cs +++ b/external/referencesource/System.Web.Extensions/ui/EmbeddedResourceFinder.cs @@ -9,4 +9,4 @@ // work properly is the assembly name is different from // the namespace. The work around is to use a type which is // outside the root namespace. -internal class EmbeddedResourceFinder { } +internal class EmbeddedResourceFinder { } \ No newline at end of file diff --git a/external/referencesource/System.Web.Extensions/ui/PageRequestManager.cs b/external/referencesource/System.Web.Extensions/ui/PageRequestManager.cs index 191bab69f4..b643255390 100644 --- a/external/referencesource/System.Web.Extensions/ui/PageRequestManager.cs +++ b/external/referencesource/System.Web.Extensions/ui/PageRequestManager.cs @@ -49,6 +49,7 @@ namespace System.Web.UI { internal const string AsyncPostBackErrorKey = "System.Web.UI.PageRequestManager:AsyncPostBackError"; internal const string AsyncPostBackErrorMessageKey = "System.Web.UI.PageRequestManager:AsyncPostBackErrorMessage"; internal const string AsyncPostBackErrorHttpCodeKey = "System.Web.UI.PageRequestManager:AsyncPostBackErrorHttpCode"; + internal const string AsyncPostBackRedirectLocationKey = "System.Web.UI.PageRequestManager:AsyncPostBackRedirectLocation"; private const string PageTitleToken = "pageTitle"; private const string FocusToken = "focus"; private const string AsyncPostFormField = "__ASYNCPOST"; diff --git a/external/referencesource/System.Web.Mobile/GlobalSuppressions.cs.REMOVED.git-id b/external/referencesource/System.Web.Mobile/GlobalSuppressions.cs.REMOVED.git-id index 59d0a7e3e4..2851571356 100644 --- a/external/referencesource/System.Web.Mobile/GlobalSuppressions.cs.REMOVED.git-id +++ b/external/referencesource/System.Web.Mobile/GlobalSuppressions.cs.REMOVED.git-id @@ -1 +1 @@ -620078002876de5d58461ad5a61fb6f8bb3f3dae \ No newline at end of file +87c20afb68987704a259c1d3389e54a33ed1ef7c \ No newline at end of file diff --git a/external/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/InterchangeableLists.cs b/external/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/InterchangeableLists.cs index 5d76164de8..28f745fc7c 100644 --- a/external/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/InterchangeableLists.cs +++ b/external/referencesource/System.Web.Mobile/UI/MobileControls/Design/Util/InterchangeableLists.cs @@ -45,7 +45,7 @@ namespace System.Web.UI.Design.MobileControls.Util // This call is required by the Windows.Forms Form Designer. InitializeComponent(); - // + // TODO: Add any initialization after the InitForm call _downButton.Image = GenericUI.SortDownIcon; _upButton.Image = GenericUI.SortUpIcon; UpdateButtonEnabling(); @@ -337,4 +337,4 @@ namespace System.Web.UI.Design.MobileControls.Util } } } -#endif +#endif \ No newline at end of file diff --git a/external/referencesource/System.Web.Services/System/Web/Services/Configuration/Protocols.cs b/external/referencesource/System.Web.Services/System/Web/Services/Configuration/Protocols.cs index 4e4279c6b3..f54892bf82 100644 --- a/external/referencesource/System.Web.Services/System/Web/Services/Configuration/Protocols.cs +++ b/external/referencesource/System.Web.Services/System/Web/Services/Configuration/Protocols.cs @@ -19,4 +19,4 @@ namespace System.Web.Services.Configuration // composite flag AnyHttpSoap = 0x21, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryClientProtocol.cs b/external/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryClientProtocol.cs index de45dfdd88..aafe6f1c77 100644 --- a/external/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryClientProtocol.cs +++ b/external/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryClientProtocol.cs @@ -453,15 +453,15 @@ namespace System.Web.Services.Discovery { while (currentDir.Length > 0) { if (currentDir.Length <= fullPath.Length && string.Compare(currentDir, fullPath.Substring(0, currentDir.Length), StringComparison.OrdinalIgnoreCase) == 0) { answer += fullPath.Substring(currentDir.Length); - if (answer.StartsWith("\\", StringComparison.Ordinal)) + if (answer.StartsWith(""+Path.DirectorySeparatorChar, StringComparison.Ordinal)) answer = answer.Substring(1); return answer; } - answer += "..\\"; + answer += ".." + Path.DirectorySeparatorChar; if (currentDir.Length < 2) break; else { - int lastSlash = currentDir.LastIndexOf('\\', currentDir.Length - 2); + int lastSlash = currentDir.LastIndexOf(Path.DirectorySeparatorChar, currentDir.Length - 2); currentDir = currentDir.Substring(0, lastSlash + 1); } } diff --git a/external/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryRequestHandler.cs b/external/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryRequestHandler.cs index 4d6c3ff086..50ae58825a 100644 --- a/external/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryRequestHandler.cs +++ b/external/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryRequestHandler.cs @@ -81,7 +81,7 @@ namespace System.Web.Services.Discovery { // Determine start url path for search DynamicDiscoSearcher searcher; Uri searchStartUrl = context.Request.Url; - string escapedUri = Uri.EscapeUriString(searchStartUrl.ToString()).Replace("#", "%23"); + string escapedUri = RuntimeUtils.EscapeUri(searchStartUrl); string searchStartUrlDir = GetDirPartOfPath( escapedUri ); // URL path without file name string strLocalPath = GetDirPartOfPath(searchStartUrl.LocalPath); diff --git a/external/referencesource/System.Web.Services/System/Web/Services/NativeMethods.cs b/external/referencesource/System.Web.Services/System/Web/Services/NativeMethods.cs index c13cc27ace..a7748c42bd 100644 --- a/external/referencesource/System.Web.Services/System/Web/Services/NativeMethods.cs +++ b/external/referencesource/System.Web.Services/System/Web/Services/NativeMethods.cs @@ -24,4 +24,4 @@ namespace System.Web.Services { internal static extern int GetModuleHandle(String modName); } } -#endif +#endif \ No newline at end of file diff --git a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/DiscoveryServerProtocol.cs b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/DiscoveryServerProtocol.cs index 2c5dbfdcae..80582549c7 100644 --- a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/DiscoveryServerProtocol.cs +++ b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/DiscoveryServerProtocol.cs @@ -238,7 +238,7 @@ namespace System.Web.Services.Protocols { // if not create a new DiscoveryServerType and cache it // bool excludeSchemeHostPortFromCachingKey = this.IsCacheUnderPressure(typeof(DiscoveryServerProtocol), Type); - string escapedUri = Uri.EscapeUriString(Request.Url.ToString()).Replace("#", "%23"); + string escapedUri = RuntimeUtils.EscapeUri(Request.Url); serverType = new DiscoveryServerType(Type, escapedUri, excludeSchemeHostPortFromCachingKey); AddToCache(typeof(DiscoveryServerProtocol), Type, serverType, excludeSchemeHostPortFromCachingKey); } diff --git a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/DocumentationServerProtocol.cs b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/DocumentationServerProtocol.cs index 20d424cf6d..f8fb6d44a5 100644 --- a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/DocumentationServerProtocol.cs +++ b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/DocumentationServerProtocol.cs @@ -119,7 +119,7 @@ namespace System.Web.Services.Protocols { // // bool excludeSchemeHostPortFromCachingKey = this.IsCacheUnderPressure(typeof(DocumentationServerProtocol), Type); - string escapedUri = Uri.EscapeUriString(Request.Url.ToString()).Replace("#", "%23"); + string escapedUri = RuntimeUtils.EscapeUri(Request.Url); serverType = new DocumentationServerType(Type, escapedUri, excludeSchemeHostPortFromCachingKey); AddToCache(typeof(DocumentationServerProtocol), Type, serverType, excludeSchemeHostPortFromCachingKey); } diff --git a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/RuntimeUtils.cs b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/RuntimeUtils.cs index 90342b65ff..f2ed4a2f16 100644 --- a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/RuntimeUtils.cs +++ b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/RuntimeUtils.cs @@ -86,5 +86,13 @@ namespace System.Web.Services.Protocols { return true; return false; } + + internal static string EscapeUri(Uri uri) { + if (null == uri) { + throw new ArgumentNullException("uri"); + } + + return uri.GetComponents(UriComponents.SerializationInfoString, UriFormat.UriEscaped).Replace("#", "%23"); + } } } diff --git a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/ScatterGatherStream.cs b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/ScatterGatherStream.cs index abb1f1b12d..8f27b78ecf 100644 --- a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/ScatterGatherStream.cs +++ b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/ScatterGatherStream.cs @@ -368,4 +368,4 @@ namespace System.Web.Services.Protocols { } } } -#endif +#endif \ No newline at end of file diff --git a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapServerMessage.cs b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapServerMessage.cs index 0f24a7100b..39d0dd2ae7 100644 --- a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapServerMessage.cs +++ b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapServerMessage.cs @@ -58,7 +58,7 @@ namespace System.Web.Services.Protocols { /// [To be supplied.] /// public override string Url { - get { return Uri.EscapeUriString(protocol.Request.Url.ToString()).Replace("#", "%23"); } + get { return RuntimeUtils.EscapeUri(protocol.Request.Url); } } /// diff --git a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapServiceRoutingStyle.cs b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapServiceRoutingStyle.cs index 194e68e41d..0614e69cd1 100644 --- a/external/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapServiceRoutingStyle.cs +++ b/external/referencesource/System.Web.Services/System/Web/Services/Protocols/SoapServiceRoutingStyle.cs @@ -14,4 +14,4 @@ namespace System.Web.Services.Protocols { RequestElement, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Web/Abstractions/HttpContextWrapper.cs b/external/referencesource/System.Web/Abstractions/HttpContextWrapper.cs index 45b0e533ff..c9320500e0 100644 --- a/external/referencesource/System.Web/Abstractions/HttpContextWrapper.cs +++ b/external/referencesource/System.Web/Abstractions/HttpContextWrapper.cs @@ -125,7 +125,7 @@ namespace System.Web { public override bool IsPostNotification { get { - return _context.IsDebuggingEnabled; + return _context.IsPostNotification; } } diff --git a/external/referencesource/System.Web/Abstractions/HttpRequestBase.cs b/external/referencesource/System.Web/Abstractions/HttpRequestBase.cs index 5942b4f520..5c20e85e25 100644 --- a/external/referencesource/System.Web/Abstractions/HttpRequestBase.cs +++ b/external/referencesource/System.Web/Abstractions/HttpRequestBase.cs @@ -247,6 +247,12 @@ namespace System.Web { } } + public virtual ITlsTokenBindingInfo TlsTokenBindingInfo { + get { + throw new NotImplementedException(); + } + } + public virtual int TotalBytes { get { throw new NotImplementedException(); diff --git a/external/referencesource/System.Web/Abstractions/HttpRequestWrapper.cs b/external/referencesource/System.Web/Abstractions/HttpRequestWrapper.cs index c7b67b4f6a..63072b5fe4 100644 --- a/external/referencesource/System.Web/Abstractions/HttpRequestWrapper.cs +++ b/external/referencesource/System.Web/Abstractions/HttpRequestWrapper.cs @@ -258,6 +258,12 @@ namespace System.Web { } } + public override ITlsTokenBindingInfo TlsTokenBindingInfo { + get { + return _httpRequest.TlsTokenBindingInfo; + } + } + public override int TotalBytes { get { return _httpRequest.TotalBytes; @@ -331,7 +337,7 @@ namespace System.Web { public override Stream GetBufferlessInputStream(bool disableMaxRequestLength) { return _httpRequest.GetBufferlessInputStream(disableMaxRequestLength); } - + public override void InsertEntityBody() { _httpRequest.InsertEntityBody(); } diff --git a/external/referencesource/System.Web/Abstractions/HttpResponseBase.cs b/external/referencesource/System.Web/Abstractions/HttpResponseBase.cs index f7bebb6de9..3d0639d182 100644 --- a/external/referencesource/System.Web/Abstractions/HttpResponseBase.cs +++ b/external/referencesource/System.Web/Abstractions/HttpResponseBase.cs @@ -13,6 +13,7 @@ namespace System.Web { using System.Runtime.CompilerServices; using System.Text; using System.Threading; + using System.Threading.Tasks; using System.Web.Caching; using System.Web.Routing; @@ -361,6 +362,10 @@ namespace System.Web { throw new NotImplementedException(); } + public virtual Task FlushAsync() { + throw new NotImplementedException(); + } + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Matches HttpResponse class")] public virtual void Pics(String value) { @@ -504,5 +509,13 @@ namespace System.Web { public virtual void WriteSubstitution(HttpResponseSubstitutionCallback callback) { throw new NotImplementedException(); } + + public virtual void PushPromise(string path) { + throw new NotImplementedException(); + } + + public virtual void PushPromise(string path, string method, NameValueCollection headers) { + throw new NotImplementedException(); + } } } diff --git a/external/referencesource/System.Web/Abstractions/HttpResponseWrapper.cs b/external/referencesource/System.Web/Abstractions/HttpResponseWrapper.cs index 165e96e3ec..ea862607c4 100644 --- a/external/referencesource/System.Web/Abstractions/HttpResponseWrapper.cs +++ b/external/referencesource/System.Web/Abstractions/HttpResponseWrapper.cs @@ -12,6 +12,7 @@ namespace System.Web { using System.Runtime.CompilerServices; using System.Text; using System.Threading; + using System.Threading.Tasks; using System.Web.Caching; using System.Web.Routing; @@ -356,6 +357,10 @@ namespace System.Web { _httpResponse.Flush(); } + public override Task FlushAsync() { + return _httpResponse.FlushAsync(); + } + public override void Pics(string value) { _httpResponse.Pics(value); } @@ -471,5 +476,13 @@ namespace System.Web { public override void WriteSubstitution(HttpResponseSubstitutionCallback callback) { _httpResponse.WriteSubstitution(callback); } + + public override void PushPromise(string path) { + _httpResponse.PushPromise(path); + } + + public override void PushPromise(string path, string method, NameValueCollection headers) { + _httpResponse.PushPromise(path, method, headers); + } } } diff --git a/external/referencesource/System.Web/AspNetSynchronizationContext.cs b/external/referencesource/System.Web/AspNetSynchronizationContext.cs index 05da4054b6..50d1538c9b 100644 --- a/external/referencesource/System.Web/AspNetSynchronizationContext.cs +++ b/external/referencesource/System.Web/AspNetSynchronizationContext.cs @@ -10,6 +10,7 @@ namespace System.Web { using System.Diagnostics.CodeAnalysis; using System.Runtime.ExceptionServices; using System.Threading; + using System.Threading.Tasks; using System.Web.Util; internal sealed class AspNetSynchronizationContext : AspNetSynchronizationContextBase { @@ -129,6 +130,11 @@ namespace System.Web { _state.Helper.QueueAsynchronous(() => callback(state)); } + // The method is used to post async func. + internal void PostAsync(Func callback, Object state) { + _state.Helper.QueueAsynchronousAsync(callback, state); + } + internal override void ProhibitVoidAsyncOperations() { _state.AllowVoidAsyncOperations = false; diff --git a/external/referencesource/System.Web/BufferAllocator.cs b/external/referencesource/System.Web/BufferAllocator.cs index 4981c68ab3..cc768f8aa4 100644 --- a/external/referencesource/System.Web/BufferAllocator.cs +++ b/external/referencesource/System.Web/BufferAllocator.cs @@ -12,6 +12,7 @@ namespace System.Web { using System.Collections; + using System.Collections.Generic; using System.IO; using System.Globalization; @@ -20,10 +21,31 @@ namespace System.Web { ////////////////////////////////////////////////////////////////////////////// // Generic buffer recycling + internal interface IBufferAllocator { + object GetBuffer(); + void ReuseBuffer(object buffer); + void ReleaseAllBuffers(); + int BufferSize { get; } + } + + internal interface IBufferAllocator : IBufferAllocator { + new T[] GetBuffer(); + T[] GetBuffer(int minSize); + void ReuseBuffer(T[] buffer); + } + + internal interface IAllocatorProvider { + IBufferAllocator CharBufferAllocator { get; } + IBufferAllocator IntBufferAllocator { get; } + IBufferAllocator IntPtrBufferAllocator { get; } + + void TrimMemory(); + } + /* * Base class for allocator doing buffer recycling */ - internal abstract class BufferAllocator { + internal abstract class BufferAllocator : IBufferAllocator { private int _maxFree; private int _numFree; private Stack _buffers; @@ -46,7 +68,7 @@ namespace System.Web { _maxFree = maxFree * s_ProcsFudgeFactor; } - internal void ReleaseAllBuffers() { + public void ReleaseAllBuffers() { if (_numFree > 0) { lock (this) { _buffers.Clear(); @@ -55,7 +77,7 @@ namespace System.Web { } } - internal /*public*/ Object GetBuffer() { + public object GetBuffer() { Object buffer = null; if (_numFree > 0) { @@ -73,7 +95,7 @@ namespace System.Web { return buffer; } - internal void ReuseBuffer(Object buffer) { + public void ReuseBuffer(object buffer) { if (_numFree < _maxFree) { lock(this) { if (_numFree < _maxFree) { @@ -88,6 +110,7 @@ namespace System.Web { * To be implemented by a derived class */ abstract protected Object AllocBuffer(); + abstract public int BufferSize { get; } } /* @@ -103,6 +126,12 @@ namespace System.Web { protected override Object AllocBuffer() { return new byte[_bufferSize]; } + + public override int BufferSize { + get { + return _bufferSize; + } + } } /* @@ -120,6 +149,12 @@ namespace System.Web { protected override Object AllocBuffer() { return new char[_bufferSize]; } + + public override int BufferSize { + get { + return _bufferSize; + } + } } /* @@ -137,6 +172,12 @@ namespace System.Web { protected override Object AllocBuffer() { return new int[_arraySize]; } + + public override int BufferSize { + get { + return _arraySize; + } + } } /* @@ -154,6 +195,231 @@ namespace System.Web { protected override Object AllocBuffer() { return new IntPtr[_arraySize]; } + + public override int BufferSize { + get { + return _arraySize; + } + } } + + + /* + * Simple Buffer Allocator - Reusable buffers pool + * Thread UNSAFE! Lock free. Caller must guarantee non-concurent access. + * Use as member of already pooled instances (like HttpApplication) that prohibit concurent access to avoid taking locks + */ + internal class SimpleBufferAllocator : IBufferAllocator { + private Stack _buffers; + private readonly int _bufferSize; + + public SimpleBufferAllocator(int bufferSize) { + if (bufferSize <= 0) { + throw new ArgumentOutOfRangeException("bufferSize"); + } + + _buffers = new Stack(); + _bufferSize = bufferSize; + } + + public T[] GetBuffer() { + return GetBufferImpl(); + } + + public T[] GetBuffer(int minSize) { + if (minSize < 0) { + throw new ArgumentOutOfRangeException("minSize"); + } + + T[] buffer = null; + + if (minSize <= BufferSize) { + // Get from the pool + buffer = GetBufferImpl(); + } + else { + // Allocate a new buffer. It will not be reused later + buffer = AllocBuffer(minSize); + } + + return buffer; + } + + object IBufferAllocator.GetBuffer() { + return GetBufferImpl(); + } + + public void ReuseBuffer(T[] buffer) { + ReuseBufferImpl(buffer); + } + + void IBufferAllocator.ReuseBuffer(object buffer) { + ReuseBufferImpl((T[]) buffer); + } + + public void ReleaseAllBuffers() { + _buffers.Clear(); + } + + public int BufferSize { + get { + return _bufferSize; + } + } + + private T[] GetBufferImpl() { + T[] buffer = null; + + if (_buffers.Count > 0) { + // Get an exisitng buffer + buffer = _buffers.Pop(); + } + else { + // Create a new buffer + buffer = AllocBuffer(BufferSize); + } + + return buffer; + } + + private void ReuseBufferImpl(T[] buffer) { + // Accept back only buffers that match the orirignal buffer size + if (buffer != null && buffer.Length == BufferSize) { + _buffers.Push(buffer); + } + } + + private static T[] AllocBuffer(int size) { + return new T[size]; + } + } + + + /* + * Adapter to convert IBufferAllocator to generic IBufferAllocator<> + */ + class BufferAllocatorWrapper : IBufferAllocator { + private IBufferAllocator _allocator; + + public BufferAllocatorWrapper(IBufferAllocator allocator) { + Debug.Assert(allocator != null); + + _allocator = allocator; + } + + public T[] GetBuffer() { + return (T[])_allocator.GetBuffer(); + } + + public T[] GetBuffer(int minSize) { + if (minSize < 0) { + throw new ArgumentOutOfRangeException("minSize"); + } + + T[] buffer = null; + + if (minSize <= BufferSize) { + // Get from the allocator + buffer = (T[])_allocator.GetBuffer(); + } + else { + // Allocate a new buffer. It will not be reused later + buffer = new T[minSize]; + } + + return buffer; + } + + public void ReuseBuffer(T[] buffer) { + // Accept back only buffers that match the orirignal buffer size + if (buffer != null && buffer.Length == BufferSize) { + _allocator.ReuseBuffer(buffer); + } + } + + object IBufferAllocator.GetBuffer() { + return _allocator.GetBuffer(); + } + + void IBufferAllocator.ReuseBuffer(object buffer) { + ReuseBuffer((T[])buffer); + } + + public void ReleaseAllBuffers() { + _allocator.ReleaseAllBuffers(); + } + + public int BufferSize { + get { + return _allocator.BufferSize; + } + } + } + + + /* + * Provider for different buffer allocators + */ + internal class AllocatorProvider : IAllocatorProvider { + private IBufferAllocator _charAllocator = null; + private IBufferAllocator _intAllocator = null; + private IBufferAllocator _intPtrAllocator = null; + + public IBufferAllocator CharBufferAllocator { + get { + return _charAllocator; + } + + set { + if (value == null) { + throw new ArgumentNullException("value"); + } + + _charAllocator = value; + } + } + + public IBufferAllocator IntBufferAllocator { + get { + return _intAllocator; + } + + set { + if (value == null) { + throw new ArgumentNullException("value"); + } + + _intAllocator = value; + } + } + + public IBufferAllocator IntPtrBufferAllocator { + get { + return _intPtrAllocator; + } + + set { + if (value == null) { + throw new ArgumentNullException("value"); + } + + _intPtrAllocator = value; + } + } + + public void TrimMemory() { + if (_charAllocator != null) { + _charAllocator.ReleaseAllBuffers(); + } + + if (_intAllocator != null) { + _intAllocator.ReleaseAllBuffers(); + } + + if (_intPtrAllocator != null) { + _intPtrAllocator.ReleaseAllBuffers(); + } + } + } } diff --git a/external/referencesource/System.Web/Compilation/BuildManagerHost.cs b/external/referencesource/System.Web/Compilation/BuildManagerHost.cs index 121ee730af..5f1591c4ea 100644 --- a/external/referencesource/System.Web/Compilation/BuildManagerHost.cs +++ b/external/referencesource/System.Web/Compilation/BuildManagerHost.cs @@ -666,7 +666,7 @@ internal class BuildManagerHost : MarshalByRefObject, IRegisteredObject { hashCodeCombiner = new HashCodeCombiner(); } - hashCodeCombiner.AddInt(_stringDictionary[virtualDependency].GetHashCode()); + hashCodeCombiner.AddInt(StringUtil.GetNonRandomizedHashCode((string)_stringDictionary[virtualDependency])); continue; } diff --git a/external/referencesource/System.Web/Compilation/BuildResultCache.cs b/external/referencesource/System.Web/Compilation/BuildResultCache.cs index 700233c709..1e3bfd5a82 100644 --- a/external/referencesource/System.Web/Compilation/BuildResultCache.cs +++ b/external/referencesource/System.Web/Compilation/BuildResultCache.cs @@ -456,7 +456,10 @@ internal abstract class DiskBuildResultCache: BuildResultCache { // as it will not be used in future. if (HostingEnvironment.ShutdownInitiated) { BuildResultCompiledAssemblyBase compiledResult = result as BuildResultCompiledAssemblyBase; - if (compiledResult != null) + + // DevDiv2 880034: check if ResultAssembly is null before calling GetName(). + // UsesExistingAssembly could be true in updatable compilation scenarios. + if (compiledResult != null && compiledResult.ResultAssembly != null && !compiledResult.UsesExistingAssembly) MarkAssemblyAndRelatedFilesForDeletion(compiledResult.ResultAssembly.GetName().Name); return; } diff --git a/external/referencesource/System.Web/Compilation/CompilationLock.cs b/external/referencesource/System.Web/Compilation/CompilationLock.cs index 7ed6960eed..5872f0ea61 100644 --- a/external/referencesource/System.Web/Compilation/CompilationLock.cs +++ b/external/referencesource/System.Web/Compilation/CompilationLock.cs @@ -169,7 +169,8 @@ internal static class CompilationLock { // Create the mutex (or just get it if another process created it). // Make the mutex unique per application - int hashCode = ("CompilationLock" + HttpRuntime.AppDomainAppId.ToLower(CultureInfo.InvariantCulture)).GetHashCode(); + int hashCode = StringUtil.GetNonRandomizedHashCode("CompilationLock" + HttpRuntime.AppDomainAppId.ToLower(CultureInfo.InvariantCulture)); + _mutex = new CompilationMutex( "CL" + hashCode.ToString("x", CultureInfo.InvariantCulture), diff --git a/external/referencesource/System.Web/Configuration/BuildProvider.cs b/external/referencesource/System.Web/Configuration/BuildProvider.cs index 76cc4b645f..f19c19721b 100644 --- a/external/referencesource/System.Web/Configuration/BuildProvider.cs +++ b/external/referencesource/System.Web/Configuration/BuildProvider.cs @@ -70,7 +70,7 @@ namespace System.Web.Configuration { return (o != null && StringUtil.EqualsIgnoreCase(Extension, o.Extension) && Type == o.Type); } public override int GetHashCode() { - return HashCodeCombiner.CombineHashCodes(Extension.ToLower(CultureInfo.InvariantCulture).GetHashCode(), + return HashCodeCombiner.CombineHashCodes(StringUtil.GetNonRandomizedHashCode(Extension.ToLower(CultureInfo.InvariantCulture)), Type.GetHashCode()); } diff --git a/external/referencesource/System.Web/Configuration/FolderLevelBuildProvider.cs b/external/referencesource/System.Web/Configuration/FolderLevelBuildProvider.cs index 8d7d681ac6..bec2a0d62a 100644 --- a/external/referencesource/System.Web/Configuration/FolderLevelBuildProvider.cs +++ b/external/referencesource/System.Web/Configuration/FolderLevelBuildProvider.cs @@ -61,7 +61,7 @@ namespace System.Web.Configuration { return (o != null && StringUtil.EqualsIgnoreCase(Name, o.Name) && Type == o.Type); } public override int GetHashCode() { - return HashCodeCombiner.CombineHashCodes(Name.ToLower(CultureInfo.InvariantCulture).GetHashCode(), + return HashCodeCombiner.CombineHashCodes(StringUtil.GetNonRandomizedHashCode(Name.ToLower(CultureInfo.InvariantCulture)), Type.GetHashCode()); } diff --git a/external/referencesource/System.Web/Configuration/HttpCapabilitiesBase.cs b/external/referencesource/System.Web/Configuration/HttpCapabilitiesBase.cs index 7cd78d448a..e2f95210c4 100644 --- a/external/referencesource/System.Web/Configuration/HttpCapabilitiesBase.cs +++ b/external/referencesource/System.Web/Configuration/HttpCapabilitiesBase.cs @@ -404,7 +404,8 @@ namespace System.Web.Configuration { return null; } - Regex regex = new Regex("\\.NET CLR (?'clrVersion'[0-9\\.]*)"); + // Adding timeout for Regex in case of malicious UA string causing DoS + Regex regex = RegexUtil.CreateRegex("\\.NET CLR (?'clrVersion'[0-9\\.]*)", RegexOptions.None); MatchCollection matches = regex.Matches(ua); if (matches.Count == 0) { diff --git a/external/referencesource/System.Web/Configuration/MachineKeySection.cs b/external/referencesource/System.Web/Configuration/MachineKeySection.cs index ec0608ac24..11d8924310 100644 --- a/external/referencesource/System.Web/Configuration/MachineKeySection.cs +++ b/external/referencesource/System.Web/Configuration/MachineKeySection.cs @@ -106,8 +106,8 @@ namespace System.Web.Configuration internal byte[] ValidationKeyInternal { get { RuntimeDataInitialize(); return (byte[])_ValidationKey.Clone(); } } internal byte[] DecryptionKeyInternal { get { RuntimeDataInitialize(); return (byte[])_DecryptionKey.Clone(); } } - internal static int HashSize { get { s_config.RuntimeDataInitialize(); return _HashSize; } } - internal static int ValidationKeySize { get { s_config.RuntimeDataInitialize(); return _AutoGenValidationKeySize; } } + internal static int HashSize { get { EnsureConfig(); s_config.RuntimeDataInitialize(); return _HashSize; } } + internal static int ValidationKeySize { get { EnsureConfig(); s_config.RuntimeDataInitialize(); return _AutoGenValidationKeySize; } } static MachineKeySection() { @@ -369,7 +369,7 @@ namespace System.Web.Configuration } if (fAppSpecific) { - int dwCode = StringComparer.InvariantCultureIgnoreCase.GetHashCode( appName ); + int dwCode = StringUtil.GetNonRandomizedStringComparerHashCode(appName); _ValidationKey[0] = (byte)(dwCode & 0xff); _ValidationKey[1] = (byte)((dwCode & 0xff00) >> 8); _ValidationKey[2] = (byte)((dwCode & 0xff0000) >> 16); @@ -377,7 +377,7 @@ namespace System.Web.Configuration } if (fAppIdSpecific) { - int dwCode = StringComparer.InvariantCultureIgnoreCase.GetHashCode( appId ); + int dwCode = StringUtil.GetNonRandomizedStringComparerHashCode(appId); _ValidationKey[4] = (byte)(dwCode & 0xff); _ValidationKey[5] = (byte)((dwCode & 0xff00) >> 8); _ValidationKey[6] = (byte)((dwCode & 0xff0000) >> 16); @@ -425,7 +425,7 @@ namespace System.Web.Configuration } if (fAppSpecific) { - int dwCode = StringComparer.InvariantCultureIgnoreCase.GetHashCode(appName); + int dwCode = StringUtil.GetNonRandomizedStringComparerHashCode(appName); _DecryptionKey[0] = (byte)(dwCode & 0xff); _DecryptionKey[1] = (byte)((dwCode & 0xff00) >> 8); _DecryptionKey[2] = (byte)((dwCode & 0xff0000) >> 16); @@ -433,7 +433,7 @@ namespace System.Web.Configuration } if (fAppIdSpecific) { - int dwCode = StringComparer.InvariantCultureIgnoreCase.GetHashCode(appId); + int dwCode = StringUtil.GetNonRandomizedStringComparerHashCode(appId); _DecryptionKey[4] = (byte)(dwCode & 0xff); _DecryptionKey[5] = (byte)((dwCode & 0xff00) >> 8); _DecryptionKey[6] = (byte)((dwCode & 0xff0000) >> 16); diff --git a/external/referencesource/System.Web/Configuration/MembershipSection.cs b/external/referencesource/System.Web/Configuration/MembershipSection.cs index f3ea42245b..a58f233ea6 100644 --- a/external/referencesource/System.Web/Configuration/MembershipSection.cs +++ b/external/referencesource/System.Web/Configuration/MembershipSection.cs @@ -48,6 +48,7 @@ namespace System.Web.Configuration { minRequiredPasswordLength="int" The minimum number of characters required in a password minRequiredNonAlphanumericCharacters="int" The minimum number of non-alphanumeric characters that are required in a password passwordStrengthRegularExpression="string" The regular expression used to test the password strength + passwordStrengthRegexTimeout="int" The timeout in milliseconds for the regex we use to check password strength --> @@ -60,6 +61,7 @@ namespace System.Web.Configuration { minRequiredPasswordLength="7" minRequireNonAlphanumericCharacters="1" passwordStrengthRegularExpression="" + passwordStrengthRegexTimeout="2000" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" diff --git a/external/referencesource/System.Web/Configuration/RegexWorker.cs b/external/referencesource/System.Web/Configuration/RegexWorker.cs index 34d9ce4cda..2d1059b687 100644 --- a/external/referencesource/System.Web/Configuration/RegexWorker.cs +++ b/external/referencesource/System.Web/Configuration/RegexWorker.cs @@ -88,7 +88,8 @@ namespace System.Web.Configuration { target = String.Empty; } - Regex regex = new Regex(regexExpression, RegexOptions.ExplicitCapture); + // Adding timeout for Regex in case of malicious string causing DoS + Regex regex = RegexUtil.CreateRegex(regexExpression, RegexOptions.ExplicitCapture); Match match = regex.Match(target); if(match.Success == false) { return false; diff --git a/external/referencesource/System.Web/Configuration/RuntimeConfig.cs b/external/referencesource/System.Web/Configuration/RuntimeConfig.cs index 165eb0320c..71507e5148 100644 --- a/external/referencesource/System.Web/Configuration/RuntimeConfig.cs +++ b/external/referencesource/System.Web/Configuration/RuntimeConfig.cs @@ -59,7 +59,6 @@ namespace System.Web.Configuration { // For config implemented with IConfigurationSectionHandler, this // may return null, non-null, or throw an exception. // - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] static internal RuntimeConfig GetConfig(HttpContext context) { if (!HttpConfigurationSystem.UseHttpConfigurationSystem) { return GetClientRuntimeConfig(); @@ -359,7 +358,6 @@ namespace System.Web.Configuration { } internal PagesSection Pages { - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] get { return (PagesSection) GetSection("system.web/pages", typeof(PagesSection), ResultsIndex.Pages); } diff --git a/external/referencesource/System.Web/Configuration/TicketCompatibilityMode.cs b/external/referencesource/System.Web/Configuration/TicketCompatibilityMode.cs index 98dde74111..167e0fdaf8 100644 --- a/external/referencesource/System.Web/Configuration/TicketCompatibilityMode.cs +++ b/external/referencesource/System.Web/Configuration/TicketCompatibilityMode.cs @@ -9,4 +9,4 @@ namespace System.Web.Configuration { Framework20 = 0, Framework40 = 1, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Web/ErrorFormatter.cs b/external/referencesource/System.Web/ErrorFormatter.cs index 7e3585ba61..da1e84b81c 100644 --- a/external/referencesource/System.Web/ErrorFormatter.cs +++ b/external/referencesource/System.Web/ErrorFormatter.cs @@ -1851,6 +1851,7 @@ namespace System.Web { protected string _message; private Exception _e; private StringCollection _adaptiveMiscContent = new StringCollection(); + private bool _allowSourceCode; internal ConfigErrorFormatter(System.Configuration.ConfigurationException e) : base(null /*virtualPath*/, e.Filename, null, e.Line) { @@ -1861,6 +1862,11 @@ namespace System.Web { _adaptiveMiscContent.Add(_message); } + public bool AllowSourceCode { + get { return _allowSourceCode; } + set { _allowSourceCode = value; } + } + protected override Encoding SourceFileEncoding { get { return Encoding.UTF8; } } @@ -1892,6 +1898,16 @@ namespace System.Web { protected override StringCollection AdaptiveMiscContent { get { return _adaptiveMiscContent;} } + + protected override string ColoredSquareContent { + get { + if (!AllowSourceCode) { + return SR.GetString(SR.Generic_Err_Remote_Desc); + } + + return base.ColoredSquareContent; + } + } } /* diff --git a/external/referencesource/System.Web/EtwTrace.cs b/external/referencesource/System.Web/EtwTrace.cs index cfbe331a35..8a5b641c7e 100644 --- a/external/referencesource/System.Web/EtwTrace.cs +++ b/external/referencesource/System.Web/EtwTrace.cs @@ -185,7 +185,6 @@ namespace System.Web { return verbosity; } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] internal static bool IsTraceEnabled(int level, int flag) { if (level < _traceLevel && ((flag & _traceFlags) != EtwTraceFlags.None)) return true; diff --git a/external/referencesource/System.Web/GlobalSuppressions.cs.REMOVED.git-id b/external/referencesource/System.Web/GlobalSuppressions.cs.REMOVED.git-id index fe70d1d998..1aae129d7d 100644 --- a/external/referencesource/System.Web/GlobalSuppressions.cs.REMOVED.git-id +++ b/external/referencesource/System.Web/GlobalSuppressions.cs.REMOVED.git-id @@ -1 +1 @@ -06e9d1dc4fafc6cc8aa615dea6155959fce3b251 \ No newline at end of file +a08a78cade267cf2dc03c9b1a531fa6d60318d42 \ No newline at end of file diff --git a/external/referencesource/System.Web/GlobalSuppressions3.cs b/external/referencesource/System.Web/GlobalSuppressions3.cs index 204e6dcca4..7a9617468f 100644 --- a/external/referencesource/System.Web/GlobalSuppressions3.cs +++ b/external/referencesource/System.Web/GlobalSuppressions3.cs @@ -136,4 +136,4 @@ using System.Diagnostics.CodeAnalysis; [module: SuppressMessage("Microsoft.Usage","CA2213:DisposableFieldsShouldBeDisposed", MessageId="_rawContent", Scope="member", Target="System.Web.HttpBufferlessInputStream.#Dispose(System.Boolean)", Justification="Baselined from previous FxCop.")] [module: SuppressMessage("Microsoft.Usage","CA1806:DoNotIgnoreMethodResults", MessageId="System.Web.UnsafeNativeMethods.StartPrefetchActivity(System.UInt32)", Scope="member", Target="System.Web.HttpRuntime.#HostingInit(System.Web.Hosting.HostingEnvironmentFlags,System.Security.Policy.PolicyLevel,System.Exception)", Justification="Baselined from previous FxCop.")] -#endregion +#endregion \ No newline at end of file diff --git a/external/referencesource/System.Web/Hosting/AppDomainFactory.cs b/external/referencesource/System.Web/Hosting/AppDomainFactory.cs index c14cfb1e9c..530e00340c 100644 --- a/external/referencesource/System.Web/Hosting/AppDomainFactory.cs +++ b/external/referencesource/System.Web/Hosting/AppDomainFactory.cs @@ -190,14 +190,18 @@ namespace System.Web.Hosting { _appManager.Close(); } - internal static String ConstructSimpleAppName(string virtPath) { + internal static String ConstructSimpleAppName(string virtPath, bool isDevEnvironment) { // devdiv 710164: Still repro - ctrl-f5 a WAP project might show "Cannot create/shadow copy when a file exists" error // since the hash file lists are different, IISExpress launched by VS cannot reuse the build result from VS build. // It deletes the build files generated by CBM and starts another round of build. This causes interruption between IISExpress and VS // and leads to this shallow copy exception. // fix: make the dev IISExpress build to a special drop location + // devdiv 1038337: execution permission cannot be acquired under partial trust with ctrl-f5. + // We previously use HostingEnvironment to determine whether it is under dev environment and the returned string. However, + // for partial trust scenario, this method is called before HostingEnvironment has been initialized, we thus may return a wrong value. + // To fix it, we requir the caller to pass in a flag indicating whether it is under dev environment. if (virtPath.Length <= 1) { // root? - if (!BuildManagerHost.InClientBuildManager && HostingEnvironment.IsDevelopmentEnvironment) + if (!BuildManagerHost.InClientBuildManager && isDevEnvironment) return "vs"; else return "root"; diff --git a/external/referencesource/System.Web/Hosting/ApplicationHost.cs b/external/referencesource/System.Web/Hosting/ApplicationHost.cs index 0bd1944ed0..d465bcd978 100644 --- a/external/referencesource/System.Web/Hosting/ApplicationHost.cs +++ b/external/referencesource/System.Web/Hosting/ApplicationHost.cs @@ -49,7 +49,8 @@ namespace System.Web.Hosting { ApplicationManager appManager = ApplicationManager.GetApplicationManager(); - String appId = (String.Concat(virtualDir, physicalDir).GetHashCode()).ToString("x"); + String appId = StringUtil.GetNonRandomizedHashCode(String.Concat(virtualDir, physicalDir)).ToString("x"); + ObjectHandle h = appManager.CreateInstanceInNewWorkerAppDomain( hostType, appId, VirtualPath.CreateNonRelative(virtualDir), physicalDir); diff --git a/external/referencesource/System.Web/Hosting/ApplicationManager.cs b/external/referencesource/System.Web/Hosting/ApplicationManager.cs index 491956b790..e02ad7fb55 100644 --- a/external/referencesource/System.Web/Hosting/ApplicationManager.cs +++ b/external/referencesource/System.Web/Hosting/ApplicationManager.cs @@ -57,6 +57,7 @@ namespace System.Web.Hosting { public sealed class ApplicationManager : MarshalByRefObject { + private const string _clrQuirkAppSettingsAppContextPrefix = "AppContext.SetSwitch:"; private const string _regexMatchTimeoutKey = "REGEX_DEFAULT_MATCH_TIMEOUT"; private static readonly StrongName _mwiV1StrongName = GetMicrosoftWebInfrastructureV1StrongName(); @@ -734,6 +735,14 @@ namespace System.Web.Hosting { } } + // ApplicationManager is loaded into the default AppDomain + // ASP.NET doesn't set string hash randomization for the defaul AppDomain, so we can assume the existing CLR implementation here is unchanged + // Note, it won't work if is used, because the entire process is subject to string hash randomization + internal int GetNonRandomizedStringComparerHashCode(string s, bool ignoreCase) { + StringComparer comparer = ignoreCase ? StringComparer.InvariantCultureIgnoreCase : StringComparer.InvariantCulture; + return comparer.GetHashCode(s); + } + // // communication with hosting environments // @@ -972,8 +981,10 @@ namespace System.Web.Hosting { customLoaderException.Throw(); } - // DevDiv #392603 - disallow running applications when string hash code randomization is enabled - if (EnvironmentInfo.IsStringHashCodeRandomizationEnabled) { + // We support randomized string hash code, but not for the default AppDomain + // Don't allow string hash randomization for the defaul AppDomain (i.e. ) + // Application should use AppSettings instead to opt-in. + if (EnvironmentInfo.IsStringHashCodeRandomizationDetected) { throw new ConfigurationErrorsException(SR.GetString(SR.Require_stable_string_hash_codes)); } @@ -1009,7 +1020,7 @@ namespace System.Web.Hosting { // in the AppDomain data guarantees that it is available before the first call to the config system. FrameworkName targetFrameworkName = httpRuntimeSection.GetTargetFrameworkName(); if (targetFrameworkName != null) { - appDomainAdditionalData[BinaryCompatibility.TargetFrameworkKey] = targetFrameworkName; + appDomainAdditionalData[System.Web.Util.BinaryCompatibility.TargetFrameworkKey] = targetFrameworkName; } if (!skipAdditionalConfigChecks) { @@ -1028,7 +1039,39 @@ namespace System.Web.Hosting { AppSettingsSection appSettingsSection = appConfig.AppSettings; KeyValueConfigurationElement useTaskFriendlySynchronizationContextElement = appSettingsSection.Settings["aspnet:UseTaskFriendlySynchronizationContext"]; if (!(useTaskFriendlySynchronizationContextElement != null && Boolean.TryParse(useTaskFriendlySynchronizationContextElement.Value, out requireHostExecutionContextManager))) { - requireHostExecutionContextManager = new BinaryCompatibility(targetFrameworkName).TargetsAtLeastFramework45 ? true : false; + requireHostExecutionContextManager = new System.Web.Util.BinaryCompatibility(targetFrameworkName).TargetsAtLeastFramework45 ? true : false; + } + + // DevDiv #390704 - Add support for randomized string hash algorithm + KeyValueConfigurationElement useRandomizedStringHashAlgorithmElement = appSettingsSection.Settings["aspnet:UseRandomizedStringHashAlgorithm"]; + bool useRandomizedStringHashAlgorithm = false; + if (useRandomizedStringHashAlgorithmElement != null && Boolean.TryParse(useRandomizedStringHashAlgorithmElement.Value, out useRandomizedStringHashAlgorithm)) { + switches.UseRandomizedStringHashAlgorithm = useRandomizedStringHashAlgorithm; + } + + // DevDiv #1041102 - Allow specifying quirks via switches + // The keys must begin with "AppContext.SetSwitch" and have a non-zero key name length, + // and the values must be parseable as Booleans. + Dictionary clrQuirks = null; + foreach (KeyValueConfigurationElement element in appSettingsSection.Settings) { + if (element.Key != null && element.Key.Length > _clrQuirkAppSettingsAppContextPrefix.Length && element.Key.StartsWith(_clrQuirkAppSettingsAppContextPrefix, StringComparison.OrdinalIgnoreCase)) { + bool value; + if (Boolean.TryParse(element.Value, out value)) { + if (clrQuirks == null) { + clrQuirks = new Dictionary(); + } + + clrQuirks[element.Key.Substring(_clrQuirkAppSettingsAppContextPrefix.Length)] = value; + } + } + } + + if (clrQuirks != null && clrQuirks.Count > 0) { + if (hostingParameters == null) { + hostingParameters = new HostingEnvironmentParameters(); + } + + hostingParameters.ClrQuirksSwitches = clrQuirks.ToArray(); } // DevDiv #248126 - Allow configuration of FileChangeMonitor behavior @@ -1057,8 +1100,10 @@ namespace System.Web.Hosting { // we only do this check if [the default value] is specified, since the // element can only be set at machine-level in a hosted environment. DeploymentSection deploymentSection = (DeploymentSection)appConfig.GetSection("system.web/deployment"); + bool isDevEnvironment = false; if (deploymentSection != null && !deploymentSection.Retail && EnvironmentInfo.WasLaunchedFromDevelopmentEnvironment) { appDomainAdditionalData[".devEnvironment"] = true; + isDevEnvironment = true; // DevDiv #275724 - Allow LocalDB support in partial trust scenarios // Normally LocalDB requires full trust since it's the equivalent of unmanaged code execution. If this is @@ -1092,7 +1137,7 @@ namespace System.Web.Hosting { SecurityPolicySection securityPolicySection = (SecurityPolicySection)appConfig.GetSection("system.web/securityPolicy"); CompilationSection compilationSection = (CompilationSection)appConfig.GetSection("system.web/compilation"); FullTrustAssembliesSection fullTrustAssembliesSection = (FullTrustAssembliesSection)appConfig.GetSection("system.web/fullTrustAssemblies"); - policyLevel = GetPartialTrustPolicyLevel(trustSection, securityPolicySection, compilationSection, physicalPath, virtualPath); + policyLevel = GetPartialTrustPolicyLevel(trustSection, securityPolicySection, compilationSection, physicalPath, virtualPath, isDevEnvironment); permissionSet = policyLevel.GetNamedPermissionSet(trustSection.PermissionSetName); if (permissionSet == null) { throw new ConfigurationErrorsException(SR.GetString(SR.Permission_set_not_found, trustSection.PermissionSetName)); @@ -1331,10 +1376,14 @@ setup, } } + + // devdiv 1038337: execution permission cannot be acquired under partial trust with ctrl-f5. + // We build the codegen path in default domain. In order to build the right path, + // caller must pass in a flag indicating whether it is under dev environment. [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "We carefully control this method's caller.")] private static PolicyLevel GetPartialTrustPolicyLevel( TrustSection trustSection, SecurityPolicySection securityPolicySection, - CompilationSection compilationSection, string physicalPath, VirtualPath virtualPath) { + CompilationSection compilationSection, string physicalPath, VirtualPath virtualPath, bool isDevEnvironment) { if (securityPolicySection == null || securityPolicySection.TrustLevels[trustSection.Level] == null) { throw new ConfigurationErrorsException(SR.GetString(SR.Unable_to_get_policy_file, trustSection.Level), String.Empty, 0); } @@ -1405,7 +1454,7 @@ setup, tempDirectory = Path.Combine(tempDirectory, HttpRuntime.codegenDirName); } String simpleAppName = System.Web.Hosting.AppManagerAppDomainFactory.ConstructSimpleAppName( - VirtualPath.GetVirtualPathStringNoTrailingSlash(virtualPath)); + VirtualPath.GetVirtualPathStringNoTrailingSlash(virtualPath), isDevEnvironment); String binDir = Path.Combine(tempDirectory, simpleAppName); binDir = FileUtil.RemoveTrailingDirectoryBackSlash(binDir); String binDirUrl = HttpRuntime.MakeFileUrl(binDir); @@ -1727,6 +1776,7 @@ setup, private sealed class AppDomainSwitches { public bool UseLegacyCas; + public bool UseRandomizedStringHashAlgorithm; public void Apply(AppDomainSetup setup) { List switches = new List(); @@ -1736,6 +1786,10 @@ setup, switches.Add("NetFx40_LegacySecurityPolicy"); } + if (UseRandomizedStringHashAlgorithm) { + switches.Add("UseRandomizedStringHashAlgorithm"); + } + if (switches.Count > 0) { setup.SetCompatibilitySwitches(switches); } @@ -1747,10 +1801,10 @@ setup, // This prevents accidental misuse of this type via querying the environment after user code has had a chance to // run, which could potentially affect the environment itself. private static class EnvironmentInfo { - public static readonly bool IsStringHashCodeRandomizationEnabled = GetIsStringHashCodeRandomizationEnabled(); + public static readonly bool IsStringHashCodeRandomizationDetected = GetIsStringHashCodeRandomizationDetected(); public static readonly bool WasLaunchedFromDevelopmentEnvironment = GetWasLaunchedFromDevelopmentEnvironmentValue(); - private static bool GetIsStringHashCodeRandomizationEnabled() { + private static bool GetIsStringHashCodeRandomizationDetected() { // known test vector return (StringComparer.InvariantCultureIgnoreCase.GetHashCode("The quick brown fox jumps over the lazy dog.") != 0x703e662e); } diff --git a/external/referencesource/System.Web/Hosting/HostingEnvironment.cs b/external/referencesource/System.Web/Hosting/HostingEnvironment.cs index 1dda494cbe..d5d2c15e35 100644 --- a/external/referencesource/System.Web/Hosting/HostingEnvironment.cs +++ b/external/referencesource/System.Web/Hosting/HostingEnvironment.cs @@ -86,6 +86,11 @@ namespace System.Web.Hosting { get; set; } + + public KeyValuePair[] ClrQuirksSwitches { + get; + set; + } } public sealed class HostingEnvironment : MarshalByRefObject { @@ -279,6 +284,10 @@ namespace System.Web.Hosting { BuildManagerHost.SupportsMultiTargeting = true; } + // Set CLR quirks switches before the config system is initialized since config might depend on them + if (_hostingParameters != null && _hostingParameters.ClrQuirksSwitches != null && _hostingParameters.ClrQuirksSwitches.Length > 0) { + SetClrQuirksSwitches(_hostingParameters.ClrQuirksSwitches); + } // // init config system using private config if applicable @@ -434,6 +443,32 @@ namespace System.Web.Hosting { } } + private static void SetClrQuirksSwitches(KeyValuePair[] switches) { + // First, see if the static API AppContext.SetSwitch even exists. + // Type.GetType will return null if the type doesn't exist; it will throw on catastrophic failure. + + Type appContextType = Type.GetType("System.AppContext, " + AssemblyRef.Mscorlib); + if (appContextType == null) { + return; // wrong version of mscorlib - do nothing + } + + Action setter = (Action)Delegate.CreateDelegate( + typeof(Action), + appContextType, + "SetSwitch", + ignoreCase: false, + throwOnBindFailure: false); + if (setter == null) { + return; // wrong version of mscorlib - do nothing + } + + // Finally, set each switch individually. + + foreach (var sw in switches) { + setter(sw.Key, sw.Value); + } + } + // If an exception was thrown during initialization, return it. public static Exception InitializationException { diff --git a/external/referencesource/System.Web/Hosting/IIS7WorkerRequest.cs.REMOVED.git-id b/external/referencesource/System.Web/Hosting/IIS7WorkerRequest.cs.REMOVED.git-id index 015ec8b645..8487209524 100644 --- a/external/referencesource/System.Web/Hosting/IIS7WorkerRequest.cs.REMOVED.git-id +++ b/external/referencesource/System.Web/Hosting/IIS7WorkerRequest.cs.REMOVED.git-id @@ -1 +1 @@ -104c2e5619eb888ddfb4a78df758a7759c7319be \ No newline at end of file +11db9517311df13fd3dac1b168d64148dc88a659 \ No newline at end of file diff --git a/external/referencesource/System.Web/Hosting/IISUnsafeMethods.cs b/external/referencesource/System.Web/Hosting/IISUnsafeMethods.cs index c2282b5b8f..c1fd851c79 100644 --- a/external/referencesource/System.Web/Hosting/IISUnsafeMethods.cs +++ b/external/referencesource/System.Web/Hosting/IISUnsafeMethods.cs @@ -682,5 +682,30 @@ namespace System.Web.Hosting { [In, MarshalAs(UnmanagedType.BStr)] string sectionName, [In, MarshalAs(UnmanagedType.BStr)] string propertyName, [Out, MarshalAs(UnmanagedType.Struct)] out object value); // marshaled as VARIANT + + [DllImport(_IIS_NATIVE_DLL)] + [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Justification = "We carefully control this method's callers.")] + internal static extern int MgdPushPromise( + [In] IntPtr context, + [In, MarshalAs(UnmanagedType.LPWStr)] string path, + [In, MarshalAs(UnmanagedType.LPWStr)] string queryString, + [In, MarshalAs(UnmanagedType.LPStr)] string method, + [In] int numHeaders, + [In, MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr)] string[] headersNames, + [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] headersValues); + + [DllImport(_IIS_NATIVE_DLL)] + [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Justification = "We carefully control this method's callers.")] + internal static extern bool MgdIsAppPoolShuttingDown(); + + [DllImport(_IIS_NATIVE_DLL)] + [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Justification = "We carefully control this method's callers.")] + internal static extern int MgdGetTlsTokenBindingIdentifiers( + [In] IntPtr pHandler, + [In, Out] ref IntPtr tokenBindingHandle, + [Out] out IntPtr providedToken, + [Out] out uint providedTokenSize, + [Out] out IntPtr referredToken, + [Out] out uint referredTokenSize); } } diff --git a/external/referencesource/System.Web/Hosting/IPipelineRuntime.cs b/external/referencesource/System.Web/Hosting/IPipelineRuntime.cs index 49dc623a3b..222d02f8af 100644 --- a/external/referencesource/System.Web/Hosting/IPipelineRuntime.cs +++ b/external/referencesource/System.Web/Hosting/IPipelineRuntime.cs @@ -573,7 +573,17 @@ namespace System.Web.Hosting { } context.NotificationContext = new NotificationContext(flags /*CurrentNotificationFlags*/, isReEntry); + + Action verifierCheck = null; + if (AppVerifier.IsAppVerifierEnabled) { + verifierCheck = AppVerifier.GetRequestNotificationStatusCheckDelegate(context, (RequestNotification)currentNotification, isPostNotification); + } + status = HttpRuntime.ProcessRequestNotification(wr, context); + + if (verifierCheck != null) { + AppVerifier.InvokeVerifierCheck(verifierCheck, status); + } } finally { if (status != RequestNotificationStatus.Pending) { diff --git a/external/referencesource/System.Web/Hosting/ISAPIWorkerRequest.cs.REMOVED.git-id b/external/referencesource/System.Web/Hosting/ISAPIWorkerRequest.cs.REMOVED.git-id index 0283ea8d29..e6c2eb8d26 100644 --- a/external/referencesource/System.Web/Hosting/ISAPIWorkerRequest.cs.REMOVED.git-id +++ b/external/referencesource/System.Web/Hosting/ISAPIWorkerRequest.cs.REMOVED.git-id @@ -1 +1 @@ -6b26e37c0094170dda0b90f622c5fbe3165344f7 \ No newline at end of file +ce3d178ea98df8349b79281a9f46ddb56a0a5d73 \ No newline at end of file diff --git a/external/referencesource/System.Web/Hosting/ProcessHost.cs b/external/referencesource/System.Web/Hosting/ProcessHost.cs index 7e7540030b..84ef7393ae 100644 --- a/external/referencesource/System.Web/Hosting/ProcessHost.cs +++ b/external/referencesource/System.Web/Hosting/ProcessHost.cs @@ -567,7 +567,7 @@ namespace System.Web.Hosting { ISAPIApplicationHost appHost = CreateAppHost(appId, null); - // get app domaoin protocol handler type from config + // get app domain protocol handler type from config Type handlerType = GetAppDomainProtocolHandlerType(protocolId); AppDomainProtocolHandler handler = null; @@ -986,7 +986,7 @@ namespace System.Web.Hosting { internal static void PreloadApplicationIfNotShuttingdown (string appId, LockableAppDomainContext ac) { // If GL_STOP_LISTENING wasn't triggered, the reset is likely due to a configuration change. - if (ProcessHost.DefaultHost != null && !HostingEnvironment.StopListeningWasCalled) { + if (ProcessHost.DefaultHost != null && !UnsafeIISMethods.MgdIsAppPoolShuttingDown()) { // Start the new app on another thread instead of hijacking the current app unloading thread ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object o) { lock (ac) { @@ -1007,7 +1007,7 @@ namespace System.Web.Hosting { })); } } - + // New for Dev10. // creates a new AppDomain, preloads and calls user code in it internal void PreloadApplicationIfRequired( diff --git a/external/referencesource/System.Web/Hosting/TlsTokenBindingInfo.cs b/external/referencesource/System.Web/Hosting/TlsTokenBindingInfo.cs new file mode 100644 index 0000000000..32c9a84a3b --- /dev/null +++ b/external/referencesource/System.Web/Hosting/TlsTokenBindingInfo.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//------------------------------------------------------------------------------ + +namespace System.Web.Hosting { + using System; + + internal sealed class TlsTokenBindingInfo : ITlsTokenBindingInfo { + private readonly byte[] _providedTokenBindingId; + private readonly byte[] _referredTokenBindingId; + + internal TlsTokenBindingInfo(byte[] providedTokenBindingId, byte[] referredTokenBindingId) { + _providedTokenBindingId = providedTokenBindingId; + _referredTokenBindingId = referredTokenBindingId; + } + + public byte[] GetProvidedTokenBindingId() { + return (_providedTokenBindingId != null) + ? (byte[])_providedTokenBindingId.Clone() + : null; + } + + public byte[] GetReferredTokenBindingId() { + return (_referredTokenBindingId != null) + ? (byte[])_referredTokenBindingId.Clone() + : null; + } + } +} diff --git a/external/referencesource/System.Web/HttpApplication.cs.REMOVED.git-id b/external/referencesource/System.Web/HttpApplication.cs.REMOVED.git-id index 6362b52f9d..ff673950e1 100644 --- a/external/referencesource/System.Web/HttpApplication.cs.REMOVED.git-id +++ b/external/referencesource/System.Web/HttpApplication.cs.REMOVED.git-id @@ -1 +1 @@ -9f8015b252708419b3e2b686ecb1830663b5796e \ No newline at end of file +eff422558e332b96b845c2f140b46d0117076596 \ No newline at end of file diff --git a/external/referencesource/System.Web/HttpCachePolicy.cs b/external/referencesource/System.Web/HttpCachePolicy.cs index ca6e24574f..5cdde5d300 100644 --- a/external/referencesource/System.Web/HttpCachePolicy.cs +++ b/external/referencesource/System.Web/HttpCachePolicy.cs @@ -315,9 +315,10 @@ namespace System.Web { HttpCacheValidateHandler handler = _validationCallbackInfo[i].handler; string targetTypeName = System.Web.UI.Util.GetAssemblyQualifiedTypeName(handler.Method.ReflectedType); string methodName = handler.Method.Name; - callbackInfos[i] = targetTypeName; - callbackInfos[i+1] = methodName; + callbackInfos[2 * i] = targetTypeName; + callbackInfos[2 * i + 1] = methodName; } + _validationCallbackInfoForSerialization = callbackInfos; } @@ -339,7 +340,7 @@ namespace System.Web { throw new SerializationException(SR.GetString(SR.Type_cannot_be_resolved, targetTypeName)); } HttpCacheValidateHandler handler = (HttpCacheValidateHandler) Delegate.CreateDelegate(typeof(HttpCacheValidateHandler), target, methodName); - callbackInfos[i] = new ValidationCallbackInfo(handler, null); + callbackInfos[i / 2] = new ValidationCallbackInfo(handler, null); } _validationCallbackInfo = callbackInfos; } diff --git a/external/referencesource/System.Web/HttpContext.cs b/external/referencesource/System.Web/HttpContext.cs index 357c37bbc9..4d02a0a8a8 100644 --- a/external/referencesource/System.Web/HttpContext.cs +++ b/external/referencesource/System.Web/HttpContext.cs @@ -757,6 +757,15 @@ namespace System.Web { } else { _appInstance = value; + + // Use HttpApplication instance custom allocator provider + if (_isIntegratedPipeline) { + // The provider allows null - everyone should fallback to default implementation + IAllocatorProvider allocator = _appInstance != null ? _appInstance.AllocatorProvider : null; + + _response.SetAllocatorProvider(allocator); + ((IIS7WorkerRequest)_wr).AllocatorProvider = allocator; + } } } } @@ -902,7 +911,6 @@ namespace System.Web { /// /// public HttpRequest Request { - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] get { if (HideRequestResponse) throw new HttpException(SR.GetString(SR.Request_not_available)); @@ -918,7 +926,6 @@ namespace System.Web { /// /// public HttpResponse Response { - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] get { if (HideRequestResponse || HasWebSocketRequestTransitionCompleted) throw new HttpException(SR.GetString(SR.Response_not_available)); @@ -1723,7 +1730,6 @@ namespace System.Web { */ - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] internal void BeginCancellablePeriod() { // It could be caused by an exception in OnThreadStart if (Volatile.Read(ref _timeoutStartTimeUtcTicks) == -1) { @@ -1741,7 +1747,6 @@ namespace System.Web { Interlocked.CompareExchange(ref _timeoutState, 0, 1); } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] internal void WaitForExceptionIfCancelled() { while (Volatile.Read(ref _timeoutState) == -1) Thread.Sleep(100); @@ -2256,7 +2261,7 @@ namespace System.Web { return CultureUtil.CreateReadOnlyCulture(userLanguages, requireSpecific); } catch { - return CultureUtil.CreateReadOnlyCulture(configString, requireSpecific); + return CultureUtil.CreateReadOnlyCulture(configString.Substring(5 /* "auto:".Length */), requireSpecific); } } else { diff --git a/external/referencesource/System.Web/HttpHeaderCollection.cs b/external/referencesource/System.Web/HttpHeaderCollection.cs index b5d194025a..806a1aaf8f 100644 --- a/external/referencesource/System.Web/HttpHeaderCollection.cs +++ b/external/referencesource/System.Web/HttpHeaderCollection.cs @@ -146,7 +146,7 @@ namespace System.Web { string svValue = replace ? value : base.Get(name); HttpServerVarsCollection serverVars = _request.ServerVariables as HttpServerVarsCollection; if (serverVars != null) { - serverVars.SynchronizeServerVariable("HTTP_" + name.ToUpper(CultureInfo.InvariantCulture).Replace('-', '_'), svValue); + serverVars.SynchronizeServerVariable("HTTP_" + name.ToUpper(CultureInfo.InvariantCulture).Replace('-', '_'), svValue, ensurePopulated: false); } // invalidate Params collection @@ -194,7 +194,7 @@ namespace System.Web { // update managed copy of server variable HttpServerVarsCollection serverVars = _request.ServerVariables as HttpServerVarsCollection; if (serverVars != null) { - serverVars.SynchronizeServerVariable("HTTP_" + name.ToUpper(CultureInfo.InvariantCulture).Replace('-', '_'), null); + serverVars.SynchronizeServerVariable("HTTP_" + name.ToUpper(CultureInfo.InvariantCulture).Replace('-', '_'), null, ensurePopulated: false); } // invalidate Params collection diff --git a/external/referencesource/System.Web/HttpRequest.cs.REMOVED.git-id b/external/referencesource/System.Web/HttpRequest.cs.REMOVED.git-id index dbe1061dd3..4c840df167 100644 --- a/external/referencesource/System.Web/HttpRequest.cs.REMOVED.git-id +++ b/external/referencesource/System.Web/HttpRequest.cs.REMOVED.git-id @@ -1 +1 @@ -5b5f88b5ccea0f72ee2d5c09476a5b202afa70db \ No newline at end of file +9ad5bc288ab09d9e6a76dedf6e473bc26a2f3645 \ No newline at end of file diff --git a/external/referencesource/System.Web/HttpResponse.cs.REMOVED.git-id b/external/referencesource/System.Web/HttpResponse.cs.REMOVED.git-id index 490b9c0c31..7fbe9fa049 100644 --- a/external/referencesource/System.Web/HttpResponse.cs.REMOVED.git-id +++ b/external/referencesource/System.Web/HttpResponse.cs.REMOVED.git-id @@ -1 +1 @@ -4292770411d315dce8698bcaa7064db3d106730c \ No newline at end of file +b92ce62520ba19dc4df09601e85545381237d6a8 \ No newline at end of file diff --git a/external/referencesource/System.Web/HttpRuntime.cs.REMOVED.git-id b/external/referencesource/System.Web/HttpRuntime.cs.REMOVED.git-id index 59418b3334..e2b30fb99b 100644 --- a/external/referencesource/System.Web/HttpRuntime.cs.REMOVED.git-id +++ b/external/referencesource/System.Web/HttpRuntime.cs.REMOVED.git-id @@ -1 +1 @@ -52b6fd197e0ad170fec98322839d3ac5136b6565 \ No newline at end of file +23b97ec0eefb4c4f39cb11ab4e5f20f0f3ddb94a \ No newline at end of file diff --git a/external/referencesource/System.Web/HttpServerVarsCollection.cs b/external/referencesource/System.Web/HttpServerVarsCollection.cs index 68622b1950..aef84223a5 100644 --- a/external/referencesource/System.Web/HttpServerVarsCollection.cs +++ b/external/referencesource/System.Web/HttpServerVarsCollection.cs @@ -13,6 +13,7 @@ namespace System.Web { using System; using System.Collections; + using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Runtime.Serialization; using System.Security.Permissions; @@ -24,6 +25,7 @@ namespace System.Web { private bool _populated; private HttpRequest _request; private IIS7WorkerRequest _iis7workerRequest; + private List _unsyncedEntries; // We preallocate the base collection with a size that should be sufficient // to store all server variables w/o having to expand @@ -47,7 +49,6 @@ namespace System.Web { _request = null; } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] internal void AddStatic(String name, String value) { if (value == null) value = String.Empty; @@ -61,7 +62,6 @@ namespace System.Web { BaseAdd(name, new HttpServerVarsCollectionEntry(name, var)); } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] private String GetServerVar(Object e) { HttpServerVarsCollectionEntry entry = (HttpServerVarsCollectionEntry)e; return (entry != null) ? entry.GetValue(_request) : null; @@ -77,6 +77,22 @@ namespace System.Web { MakeReadWrite(); _request.FillInServerVariablesCollection(); + // Add all unsynchronized entries, if any + if (_unsyncedEntries != null) { + foreach (var entry in _unsyncedEntries) { + var existingEntry = (HttpServerVarsCollectionEntry)BaseGet(entry.Name); + if (existingEntry != null && existingEntry.IsDynamic) { + // Exisiting dynamic server variables cannot be modified - ignore the new value + continue; + } + + InvalidateCachedArrays(); + BaseSet(entry.Name, entry); // Update an existing entry, or create one if it's new + } + + _unsyncedEntries.Clear(); + } + if (_iis7workerRequest == null) { MakeReadOnly(); } @@ -239,13 +255,23 @@ namespace System.Web { } // updates managed copy of server variable with current value from native header block - internal void SynchronizeServerVariable(String name, String value) { + internal void SynchronizeServerVariable(String name, String value, bool ensurePopulated = true) { if (name == null) { throw new ArgumentNullException("name"); } if (value != null) { - SetServerVariableManagedOnly(name, value); + if (this._populated || ensurePopulated) { + SetServerVariableManagedOnly(name, value); + } + else { + // Lazy synchronization - when populate is indeed required + if (_unsyncedEntries == null) { + _unsyncedEntries = new List(); + } + + _unsyncedEntries.Add(new HttpServerVarsCollectionEntry(name, value)); + } } else { base.Remove(name); @@ -295,19 +321,16 @@ namespace System.Web { _request.InvalidateParams(); } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] public override String Get(int index) { Populate(); return GetServerVar(BaseGet(index)); } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] public override String[] GetValues(int index) { String s = Get(index); return(s != null) ? new String[1] { s} : null; } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] public override String GetKey(int index) { Populate(); return base.GetKey(index); diff --git a/external/referencesource/System.Web/HttpWriter.cs b/external/referencesource/System.Web/HttpWriter.cs index 13aebbf55a..9627b3231b 100644 --- a/external/referencesource/System.Web/HttpWriter.cs +++ b/external/referencesource/System.Web/HttpWriter.cs @@ -39,6 +39,8 @@ namespace System.Web { internal const int MAX_FREE_CHAR_BUFFERS = 64; // keep this number of unused buffers internal const int MAX_BYTES_TO_COPY = 128; // copy results of char conversion vs using recycleable buffers internal const int MAX_RESOURCE_BYTES_TO_COPY = 4*1024; // resource strings below this size are copied to buffers + internal const int INT_BUFFER_SIZE = 128; // default size for int[] buffers + internal const int INTPTR_BUFFER_SIZE = 128; // default size for IntPtr[] buffers } /* @@ -86,11 +88,6 @@ namespace System.Web { internal sealed class HttpResponseBufferElement : HttpBaseMemoryResponseBufferElement, IHttpResponseElement { private byte[] _data; - private static UbyteBufferAllocator s_Allocator = - new UbyteBufferAllocator(BufferingParams.OUTPUT_BUFFER_SIZE, - BufferingParams.MAX_FREE_OUTPUT_BUFFERS); - - /* * Constructor that accepts the data buffer and holds on to it */ @@ -798,9 +795,8 @@ namespace System.Web { private int _charBufferFree; private ArrayList _substElements = null; - private static CharBufferAllocator s_Allocator = - new CharBufferAllocator(BufferingParams.CHAR_BUFFER_SIZE, - BufferingParams.MAX_FREE_CHAR_BUFFERS); + static IAllocatorProvider s_DefaultAllocator = null; + IAllocatorProvider _allocator = null; // Use only via HttpWriter.AllocationProvider to ensure proper fallback // cached data from the response // can be invalidated via UpdateResponseXXX methods @@ -824,9 +820,10 @@ namespace System.Web { _buffers = new ArrayList(); _lastBuffer = null; - _charBuffer = (char[])s_Allocator.GetBuffer(); - _charBufferLength = _charBuffer.Length; - _charBufferFree = _charBufferLength; + // Setup the buffer on demand using CharBuffer property + _charBuffer = null; + _charBufferLength = 0; + _charBufferFree = 0; UpdateResponseBuffering(); @@ -933,7 +930,7 @@ namespace System.Web { // recycle char buffers if (_charBuffer != null) { - s_Allocator.ReuseBuffer(_charBuffer); + AllocatorProvider.CharBufferAllocator.ReuseBuffer(_charBuffer); _charBuffer = null; } @@ -942,13 +939,39 @@ namespace System.Web { } internal static void ReleaseAllPooledBuffers() { - s_Allocator.ReleaseAllBuffers(); + if (s_DefaultAllocator != null) { + s_DefaultAllocator.TrimMemory(); + } } internal void ClearSubstitutionBlocks() { _substElements = null; } + internal IAllocatorProvider AllocatorProvider { + private get { + if (_allocator == null) { + if (s_DefaultAllocator == null) { + // Create default static allocator + IBufferAllocator charAllocator = new CharBufferAllocator(BufferingParams.CHAR_BUFFER_SIZE, BufferingParams.MAX_FREE_CHAR_BUFFERS); + + AllocatorProvider alloc = new AllocatorProvider(); + alloc.CharBufferAllocator = new BufferAllocatorWrapper(charAllocator); + + Interlocked.CompareExchange(ref s_DefaultAllocator, alloc, null); + } + + _allocator = s_DefaultAllocator; + } + + return _allocator; + } + + set { + _allocator = value; + } + } + private void RecycleBufferElements() { if (_buffers != null) { @@ -968,6 +991,19 @@ namespace System.Web { _charBufferFree = _charBufferLength; } + private char[] CharBuffer { + get { + if (_charBuffer == null) { + _charBuffer = AllocatorProvider.CharBufferAllocator.GetBuffer(); + + _charBufferLength = _charBuffer.Length; + _charBufferFree = _charBufferLength; + } + + return _charBuffer; + } + } + private void FlushCharBuffer(bool flushEncoder) { int numChars = _charBufferLength - _charBufferFree; @@ -986,7 +1022,7 @@ namespace System.Web { if (estByteSize <= BufferingParams.MAX_BYTES_TO_COPY || !_responseBufferingOn) { // small size -- allocate intermediate buffer and copy into the output buffer byte[] byteBuffer = new byte[estByteSize]; - int realByteSize = _responseEncoder.GetBytes(_charBuffer, 0, numChars, + int realByteSize = _responseEncoder.GetBytes(CharBuffer, 0, numChars, byteBuffer, 0, flushEncoder); BufferData(byteBuffer, 0, realByteSize, false); } @@ -1004,7 +1040,7 @@ namespace System.Web { // byte buffers must be long enough to keep everything in char buffer Debug.Assert(free >= estByteSize); - _lastBuffer.AppendEncodedChars(_charBuffer, 0, numChars, _responseEncoder, flushEncoder); + _lastBuffer.AppendEncodedChars(CharBuffer, 0, numChars, _responseEncoder, flushEncoder); } _charBufferFree = _charBufferLength; @@ -1561,11 +1597,13 @@ namespace System.Web { return; } + char[] buffer = CharBuffer; + if (_charBufferFree == 0) { FlushCharBuffer(false); } - _charBuffer[_charBufferLength - _charBufferFree] = ch; + buffer[_charBufferLength - _charBufferFree] = ch; _charBufferFree--; if (!_responseBufferingOn) { @@ -1595,13 +1633,15 @@ namespace System.Web { if (count == 0) return; + char[] charBuffer = CharBuffer; + while (count > 0) { if (_charBufferFree == 0) { FlushCharBuffer(false); } int n = (count < _charBufferFree) ? count : _charBufferFree; - System.Array.Copy(buffer, index, _charBuffer, _charBufferLength - _charBufferFree, n); + System.Array.Copy(buffer, index, charBuffer, _charBufferLength - _charBufferFree, n); _charBufferFree -= n; index += n; count -= n; @@ -1623,13 +1663,15 @@ namespace System.Web { if (s == null) return; + char[] buffer = CharBuffer; + if (s.Length == 0) { // Ensure flush if string is empty } else if (s.Length < _charBufferFree) { // fast path - 99% of string writes will not overrun the buffer // avoid redundant arg checking in string.CopyTo - StringUtil.UnsafeStringCopy(s, 0, _charBuffer, _charBufferLength - _charBufferFree, s.Length); + StringUtil.UnsafeStringCopy(s, 0, buffer, _charBufferLength - _charBufferFree, s.Length); _charBufferFree -= s.Length; } else { @@ -1645,7 +1687,7 @@ namespace System.Web { n = (count < _charBufferFree) ? count : _charBufferFree; // avoid redundant arg checking in string.CopyTo - StringUtil.UnsafeStringCopy(s, index, _charBuffer, _charBufferLength - _charBufferFree, n); + StringUtil.UnsafeStringCopy(s, index, buffer, _charBufferLength - _charBufferFree, n); _charBufferFree -= n; index += n; @@ -1682,13 +1724,15 @@ namespace System.Web { return; } + char[] buffer = CharBuffer; + if (count == 0) { // Ensure flush if string is empty } else if (count < _charBufferFree) { // fast path - 99% of string writes will not overrun the buffer // avoid redundant arg checking in string.CopyTo - StringUtil.UnsafeStringCopy(s, index, _charBuffer, _charBufferLength - _charBufferFree, count); + StringUtil.UnsafeStringCopy(s, index, buffer, _charBufferLength - _charBufferFree, count); _charBufferFree -= count; } else { @@ -1702,7 +1746,7 @@ namespace System.Web { n = (count < _charBufferFree) ? count : _charBufferFree; // avoid redundant arg checking in string.CopyTo - StringUtil.UnsafeStringCopy(s, index, _charBuffer, _charBufferLength - _charBufferFree, n); + StringUtil.UnsafeStringCopy(s, index, buffer, _charBufferLength - _charBufferFree, n); _charBufferFree -= n; index += n; @@ -1756,12 +1800,14 @@ namespace System.Web { // It turns out this is way more efficient than the TextWriter version of // WriteLine which ends up calling Write with a 2 char array + char[] buffer = CharBuffer; + if (_charBufferFree < 2) FlushCharBuffer(false); int pos = _charBufferLength - _charBufferFree; - _charBuffer[pos] = '\r'; - _charBuffer[pos + 1] = '\n'; + buffer[pos] = '\r'; + buffer[pos + 1] = '\n'; _charBufferFree -= 2; if (!_responseBufferingOn) diff --git a/external/referencesource/System.Web/ITlsTokenBindingInfo.cs b/external/referencesource/System.Web/ITlsTokenBindingInfo.cs new file mode 100644 index 0000000000..c363db89f8 --- /dev/null +++ b/external/referencesource/System.Web/ITlsTokenBindingInfo.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//------------------------------------------------------------------------------ + +namespace System.Web { + using System; + + // Represents token binding information for a request. + // TLS token bindings help mitigate the risk of impersonation by an + // attacker in the event an authenticated client's bearer tokens are + // somehow exfiltrated from the client's machine. + // More info: https://datatracker.ietf.org/doc/draft-popov-token-binding/ + public interface ITlsTokenBindingInfo { + // Gets the 'provided' token binding identifier associated with + // the request. This method could return null if the client did + // not supply a 'provided' token binding or if the client did + // not supply a valid proof of possession for the associated + // private key. + // + // The caller should treat this token binding id as an opaque blob + // and should not try to parse it. + byte[] GetProvidedTokenBindingId(); + + // Gets the 'referred' token binding identifier associated with + // the request. This method could return null if the client did + // not supply a 'referred' token binding or if the client did + // not supply a valid proof of possession for the associated + // private key. + // + // The caller should treat this token binding id as an opaque blob + // and should not try to parse it. + byte[] GetReferredTokenBindingId(); + } +} diff --git a/external/referencesource/System.Web/IntraPartitionAPIs/xsp/PerfCounterEnum.cs b/external/referencesource/System.Web/IntraPartitionAPIs/xsp/PerfCounterEnum.cs new file mode 100644 index 0000000000..5df7d83c27 --- /dev/null +++ b/external/referencesource/System.Web/IntraPartitionAPIs/xsp/PerfCounterEnum.cs @@ -0,0 +1,131 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) Microsoft Corporation. All Rights Reserved. +// Information Contained Herein is Proprietary and Confidential. +// +//------------------------------------------------------------------------------ + +/* + * PerfCounters class + */ +namespace System.Web { + + // Global enums + internal enum GlobalPerfCounter { + + APPLICATION_RESTARTS = 0, + APPLICATIONS_RUNNING = 1, + REQUESTS_DISCONNECTED = 2, + REQUEST_EXECUTION_TIME = 3, + REQUESTS_REJECTED = 4, + REQUESTS_QUEUED = 5, + WPS_RUNNING = 6, + WPS_RESTARTS = 7, + REQUEST_WAIT_TIME = 8, + STATE_SERVER_SESSIONS_ACTIVE = 9, + STATE_SERVER_SESSIONS_ABANDONED = 10, + STATE_SERVER_SESSIONS_TIMED_OUT = 11, + STATE_SERVER_SESSIONS_TOTAL = 12, + REQUESTS_CURRENT = 13, + GLOBAL_AUDIT_SUCCESS = 14, + GLOBAL_AUDIT_FAIL = 15, + GLOBAL_EVENTS_ERROR = 16, + GLOBAL_EVENTS_HTTP_REQ_ERROR = 17, + GLOBAL_EVENTS_HTTP_INFRA_ERROR = 18, + REQUESTS_IN_NATIVE_QUEUE = 19, + + } + + internal enum AppPerfCounter { + + ANONYMOUS_REQUESTS = 20, + TOTAL_CACHE_ENTRIES = 21, + TOTAL_CACHE_TURNOVER_RATE = 22, + TOTAL_CACHE_HITS = 23, + TOTAL_CACHE_MISSES = 24, + TOTAL_CACHE_RATIO_BASE = 25, + API_CACHE_ENTRIES = 26, + API_CACHE_TURNOVER_RATE = 27, + API_CACHE_HITS = 28, + API_CACHE_MISSES = 29, + API_CACHE_RATIO_BASE = 30, + OUTPUT_CACHE_ENTRIES = 31, + OUTPUT_CACHE_TURNOVER_RATE = 32, + OUTPUT_CACHE_HITS = 33, + OUTPUT_CACHE_MISSES = 34, + OUTPUT_CACHE_RATIO_BASE = 35, + COMPILATIONS = 36, + DEBUGGING_REQUESTS = 37, + ERRORS_PRE_PROCESSING = 38, + ERRORS_COMPILING = 39, + ERRORS_DURING_REQUEST = 40, + ERRORS_UNHANDLED = 41, + ERRORS_TOTAL = 42, + PIPELINES = 43, + REQUEST_BYTES_IN = 44, + REQUEST_BYTES_OUT = 45, + REQUESTS_EXECUTING = 46, + REQUESTS_FAILED = 47, + REQUESTS_NOT_FOUND = 48, + REQUESTS_NOT_AUTHORIZED = 49, + REQUESTS_IN_APPLICATION_QUEUE = 50, + REQUESTS_TIMED_OUT = 51, + REQUESTS_SUCCEDED = 52, + REQUESTS_TOTAL = 53, + SESSIONS_ACTIVE = 54, + SESSIONS_ABANDONED = 55, + SESSIONS_TIMED_OUT = 56, + SESSIONS_TOTAL = 57, + TRANSACTIONS_ABORTED = 58, + TRANSACTIONS_COMMITTED = 59, + TRANSACTIONS_PENDING = 60, + TRANSACTIONS_TOTAL = 61, + SESSION_STATE_SERVER_CONNECTIONS = 62, + SESSION_SQL_SERVER_CONNECTIONS = 63, + EVENTS_TOTAL = 64, + EVENTS_APP = 65, + EVENTS_ERROR = 66, + EVENTS_HTTP_REQ_ERROR = 67, + EVENTS_HTTP_INFRA_ERROR = 68, + EVENTS_WEB_REQ = 69, + AUDIT_SUCCESS = 70, + AUDIT_FAIL = 71, + MEMBER_SUCCESS = 72, + MEMBER_FAIL = 73, + FORMS_AUTH_SUCCESS = 74, + FORMS_AUTH_FAIL = 75, + VIEWSTATE_MAC_FAIL = 76, + APP_REQUEST_EXEC_TIME = 77, + APP_REQUEST_DISCONNECTED = 78, + APP_REQUESTS_REJECTED = 79, + APP_REQUEST_WAIT_TIME = 80, + CACHE_PERCENT_MACH_MEM_LIMIT_USED = 81, + CACHE_PERCENT_MACH_MEM_LIMIT_USED_BASE = 82, + CACHE_PERCENT_PROC_MEM_LIMIT_USED = 83, + CACHE_PERCENT_PROC_MEM_LIMIT_USED_BASE = 84, + CACHE_TOTAL_TRIMS = 85, + CACHE_API_TRIMS = 86, + CACHE_OUTPUT_TRIMS = 87, + APP_CPU_USED = 88, + APP_CPU_USED_BASE = 89, + APP_MEMORY_USED = 90, + REQUEST_BYTES_IN_WEBSOCKETS = 91, + REQUEST_BYTES_OUT_WEBSOCKETS = 92, + REQUESTS_EXECUTING_WEBSOCKETS = 93, + REQUESTS_FAILED_WEBSOCKETS = 94, + REQUESTS_SUCCEEDED_WEBSOCKETS = 95, + REQUESTS_TOTAL_WEBSOCKETS = 96, + + } + + // StateService enums + internal enum StateServicePerfCounter { + + STATE_SERVICE_SESSIONS_ACTIVE = 97, + STATE_SERVICE_SESSIONS_ABANDONED = 98, + STATE_SERVICE_SESSIONS_TIMED_OUT = 99, + STATE_SERVICE_SESSIONS_TOTAL = 100, + + } +} + diff --git a/external/referencesource/System.Web/LegacyAspNetSynchronizationContext.cs b/external/referencesource/System.Web/LegacyAspNetSynchronizationContext.cs index 3cc6471e6c..2bbdf1b4f3 100644 --- a/external/referencesource/System.Web/LegacyAspNetSynchronizationContext.cs +++ b/external/referencesource/System.Web/LegacyAspNetSynchronizationContext.cs @@ -19,7 +19,7 @@ namespace System.Web { internal sealed class LegacyAspNetSynchronizationContext : AspNetSynchronizationContextBase { private HttpApplication _application; - private Action _appVerifierCallback; + private Action _appVerifierCallback; private bool _disabled; private bool _syncCaller; private bool _invalidOperationEncountered; @@ -34,14 +34,14 @@ namespace System.Web { _lastCompletionCallbackLock = new object(); } - private void CheckForRequestCompletionIfRequired() { + private void CheckForRequestStateIfRequired() { if (_appVerifierCallback != null) { - _appVerifierCallback(); + _appVerifierCallback(false); } } private void CallCallback(SendOrPostCallback callback, Object state) { - CheckForRequestCompletionIfRequired(); + CheckForRequestStateIfRequired(); // don't take app lock for [....] caller to avoid deadlocks in case they poll for result if (_syncCaller) { diff --git a/external/referencesource/System.Web/OutputCacheModule.cs b/external/referencesource/System.Web/OutputCacheModule.cs index 426b94d53e..de6b2d7c02 100644 --- a/external/referencesource/System.Web/OutputCacheModule.cs +++ b/external/referencesource/System.Web/OutputCacheModule.cs @@ -352,7 +352,7 @@ namespace System.Web.Caching { return 0; } for (int i = startIndex; i < contentEncodings.Length; i++) { - if (contentEncodings[i] == acceptEncodingWithoutWeight) { + if (StringUtil.EqualsIgnoreCase(contentEncodings[i], acceptEncodingWithoutWeight)) { return i; // found } } @@ -393,7 +393,7 @@ namespace System.Web.Caching { int acceptEncodingLength = acceptEncoding.Length; int maxSearchIndex = acceptEncodingLength - codingLength; while (startSearchIndex < maxSearchIndex) { - int indexStart = acceptEncoding.IndexOf(coding, startSearchIndex, StringComparison.Ordinal); + int indexStart = acceptEncoding.IndexOf(coding, startSearchIndex, StringComparison.OrdinalIgnoreCase); if (indexStart == -1) { break; // not found diff --git a/external/referencesource/System.Web/PerfCounters.cs b/external/referencesource/System.Web/PerfCounters.cs index 8ec096c786..de258ce7d5 100644 --- a/external/referencesource/System.Web/PerfCounters.cs +++ b/external/referencesource/System.Web/PerfCounters.cs @@ -86,7 +86,6 @@ namespace System.Web { // Make sure webengine.dll is loaded before attempting to call into it (ASURT 98531) - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] internal static void IncrementCounter(AppPerfCounter counter) { if (_instance != null) UnsafeNativeMethods.PerfIncrementCounter(_instance.UnsafeHandle, (int) counter); @@ -97,13 +96,11 @@ namespace System.Web { UnsafeNativeMethods.PerfDecrementCounter(_instance.UnsafeHandle, (int) counter); } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] internal static void IncrementCounterEx(AppPerfCounter counter, int delta) { if (_instance != null) UnsafeNativeMethods.PerfIncrementCounterEx(_instance.UnsafeHandle, (int) counter, delta); } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] internal static void SetCounter(AppPerfCounter counter, int value) { if (_instance != null) UnsafeNativeMethods.PerfSetCounter(_instance.UnsafeHandle, (int) counter, value); @@ -127,7 +124,6 @@ namespace System.Web { return -1; } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] internal static void IncrementGlobalCounter(GlobalPerfCounter counter) { if (_global != IntPtr.Zero) UnsafeNativeMethods.PerfIncrementCounter(_global, (int) counter); diff --git a/external/referencesource/System.Web/Properties/AssemblyInfo.cs b/external/referencesource/System.Web/Properties/AssemblyInfo.cs index b41f9f2532..03328e0a58 100644 --- a/external/referencesource/System.Web/Properties/AssemblyInfo.cs +++ b/external/referencesource/System.Web/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ using System.Web.Security; [assembly:System.Runtime.InteropServices.TypeLibVersion(2, 4)] // Opts into the VS loading icons from the FrameworkIcon Satellite assemblies found under VSIP\Icons -[assembly:System.Drawing.BitmapSuffixInSatelliteAssemblyAttribute()] +[assembly:System.Drawing.BitmapSuffixInSatelliteAssemblyAttribute()] \ No newline at end of file diff --git a/external/referencesource/System.Web/Security/ADMembershipProvider.cs.REMOVED.git-id b/external/referencesource/System.Web/Security/ADMembershipProvider.cs.REMOVED.git-id index c9f55811a9..18ec4a381f 100644 --- a/external/referencesource/System.Web/Security/ADMembershipProvider.cs.REMOVED.git-id +++ b/external/referencesource/System.Web/Security/ADMembershipProvider.cs.REMOVED.git-id @@ -1 +1 @@ -86b5c0a6f2c00fb083dda0132b35aa86179280a6 \ No newline at end of file +6fc96d5a48329aa8e7ef17bceda3f17990c6df42 \ No newline at end of file diff --git a/external/referencesource/System.Web/Security/AntiXss/GlobalSuppressions.cs b/external/referencesource/System.Web/Security/AntiXss/GlobalSuppressions.cs index 8c90454923..9d76e56b8f 100644 --- a/external/referencesource/System.Web/Security/AntiXss/GlobalSuppressions.cs +++ b/external/referencesource/System.Web/Security/AntiXss/GlobalSuppressions.cs @@ -55,4 +55,4 @@ using System.Diagnostics.CodeAnalysis; [module: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Ol", Scope = "member", Target = "System.Web.Security.AntiXss.LowerMidCodeCharts.#OlChiki", Justification = "AntiXSS baseline.")] [module: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Li", Scope = "member", Target = "System.Web.Security.AntiXss.UpperCodeCharts.#KayahLi", Justification = "AntiXSS baseline.")] [module: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Yi", Scope = "member", Target = "System.Web.Security.AntiXss.UpperMidCodeCharts.#YiSyllables", Justification = "AntiXSS baseline.")] -[module: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Yi", Scope = "member", Target = "System.Web.Security.AntiXss.UpperMidCodeCharts.#YiRadicals", Justification = "AntiXSS baseline.")] +[module: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Yi", Scope = "member", Target = "System.Web.Security.AntiXss.UpperMidCodeCharts.#YiRadicals", Justification = "AntiXSS baseline.")] \ No newline at end of file diff --git a/external/referencesource/System.Web/Security/IVType.cs b/external/referencesource/System.Web/Security/IVType.cs index 4752ea1cf0..e3c5cc23b0 100644 --- a/external/referencesource/System.Web/Security/IVType.cs +++ b/external/referencesource/System.Web/Security/IVType.cs @@ -26,4 +26,4 @@ namespace System.Web.Configuration // multiple times. Hash = 2, } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Web/Security/MembershipPasswordAttribute.cs b/external/referencesource/System.Web/Security/MembershipPasswordAttribute.cs index a9814daaea..b50ac700a5 100644 --- a/external/referencesource/System.Web/Security/MembershipPasswordAttribute.cs +++ b/external/referencesource/System.Web/Security/MembershipPasswordAttribute.cs @@ -5,6 +5,7 @@ using System.Globalization; using System.Linq; using System.Text.RegularExpressions; + using System.Web.Util; /// /// Validates whether a password field meets the current Membership Provider's password requirements. @@ -143,6 +144,9 @@ } } } + + // The timeout for the regex we use to check password strength + public int? PasswordStrengthRegexTimeout { get; set; } #endregion #region Overriden Methods @@ -189,7 +193,8 @@ Regex passwordStrengthRegex; try { - passwordStrengthRegex = new Regex(passwordStrengthRegularExpression); + // Adding timeout for Regex in case of malicious string causing DoS + passwordStrengthRegex = RegexUtil.CreateRegex(passwordStrengthRegularExpression, RegexOptions.None, PasswordStrengthRegexTimeout); } catch (ArgumentException ex) { throw new InvalidOperationException(SR.GetString(SR.MembershipPasswordAttribute_InvalidRegularExpression), ex); diff --git a/external/referencesource/System.Web/Security/RolePrincipal.cs b/external/referencesource/System.Web/Security/RolePrincipal.cs index 3f15fb6896..a54f497b9d 100644 --- a/external/referencesource/System.Web/Security/RolePrincipal.cs +++ b/external/referencesource/System.Web/Security/RolePrincipal.cs @@ -98,7 +98,7 @@ namespace System.Web.Security { private void InitFromEncryptedTicket( string encryptedTicket ) { - if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc)) + if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc) && HttpContext.Current != null) EtwTrace.Trace(EtwTraceType.ETW_TYPE_ROLE_BEGIN, HttpContext.Current.WorkerRequest); if (string.IsNullOrEmpty(encryptedTicket)) @@ -140,14 +140,14 @@ namespace System.Web.Security { RenewIfOld(); - if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc)) + if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc) && HttpContext.Current != null) EtwTrace.Trace( EtwTraceType.ETW_TYPE_ROLE_END, HttpContext.Current.WorkerRequest, "RolePrincipal", _Identity.Name); return; Exit: Init(); _CachedListChanged = true; - if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc)) + if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc) && HttpContext.Current != null) EtwTrace.Trace(EtwTraceType.ETW_TYPE_ROLE_END, HttpContext.Current.WorkerRequest, "RolePrincipal", _Identity.Name); return; } diff --git a/external/referencesource/System.Web/Security/Roles.cs b/external/referencesource/System.Web/Security/Roles.cs index 32ccd2df1e..a875365eda 100644 --- a/external/referencesource/System.Web/Security/Roles.cs +++ b/external/referencesource/System.Web/Security/Roles.cs @@ -93,7 +93,7 @@ namespace System.Web.Security { // authorization static public bool IsUserInRole(string username, string roleName) { - if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc)) + if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc) && HttpContext.Current != null) EtwTrace.Trace(EtwTraceType.ETW_TYPE_ROLE_BEGIN, HttpContext.Current.WorkerRequest); EnsureEnabled(); @@ -111,7 +111,7 @@ namespace System.Web.Security { isUserInRole = Provider.IsUserInRole(username, roleName); return isUserInRole; } finally { - if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc)) { + if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc) && HttpContext.Current != null) { if (EtwTrace.IsTraceEnabled(EtwTraceLevel.Verbose, EtwTraceFlags.AppSvc)) { string status = SR.Resources.GetString(isUserInRole ? SR.Etw_Success : SR.Etw_Failure, CultureInfo.InstalledUICulture); EtwTrace.Trace(EtwTraceType.ETW_TYPE_ROLE_IS_USER_IN_ROLE, HttpContext.Current.WorkerRequest, isRolePrincipal ? "RolePrincipal" : Provider.GetType().FullName, username, roleName, status); @@ -129,7 +129,7 @@ namespace System.Web.Security { static public string[] GetRolesForUser (string username){ - if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc)) + if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc) && HttpContext.Current != null) EtwTrace.Trace(EtwTraceType.ETW_TYPE_ROLE_BEGIN, HttpContext.Current.WorkerRequest); EnsureEnabled(); @@ -150,7 +150,7 @@ namespace System.Web.Security { } return roles; } finally { - if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc)) { + if (HostingEnvironment.IsHosted && EtwTrace.IsTraceEnabled(EtwTraceLevel.Information, EtwTraceFlags.AppSvc) && HttpContext.Current != null) { if (EtwTrace.IsTraceEnabled(EtwTraceLevel.Verbose, EtwTraceFlags.AppSvc)) { string roleNames = null; if (roles != null && roles.Length > 0) diff --git a/external/referencesource/System.Web/Security/SQLMembershipProvider.cs b/external/referencesource/System.Web/Security/SQLMembershipProvider.cs index 3204cb7551..af1cf0fced 100644 --- a/external/referencesource/System.Web/Security/SQLMembershipProvider.cs +++ b/external/referencesource/System.Web/Security/SQLMembershipProvider.cs @@ -77,7 +77,7 @@ namespace System.Web.Security { _AppName = value; } } - + private string _sqlConnectionString; private bool _EnablePasswordRetrieval; private bool _EnablePasswordReset; @@ -94,6 +94,7 @@ namespace System.Web.Security { private MembershipPasswordFormat _PasswordFormat; private MembershipPasswordCompatibilityMode _LegacyPasswordCompatibilityMode = MembershipPasswordCompatibilityMode.Framework20; private string s_HashAlgorithm = null; + private int? _passwordStrengthRegexTimeout; private const int PASSWORD_SIZE = 14; @@ -124,6 +125,7 @@ namespace System.Web.Security { _PasswordAttemptWindow = SecUtility.GetIntValue( config, "passwordAttemptWindow", 10, false, 0 ); _MinRequiredPasswordLength = SecUtility.GetIntValue( config, "minRequiredPasswordLength", 7, false, 128 ); _MinRequiredNonalphanumericCharacters = SecUtility.GetIntValue( config, "minRequiredNonalphanumericCharacters", 1, true, 128 ); + _passwordStrengthRegexTimeout = SecUtility.GetNullableIntValue(config, "passwordStrengthRegexTimeout"); _PasswordStrengthRegularExpression = config["passwordStrengthRegularExpression"]; if( _PasswordStrengthRegularExpression != null ) @@ -203,6 +205,7 @@ namespace System.Web.Security { config.Remove("minRequiredNonalphanumericCharacters"); config.Remove("passwordStrengthRegularExpression"); config.Remove("passwordCompatMode"); + config.Remove("passwordStrengthRegexTimeout"); if (config.Count > 0) { string attribUnrecognized = config.GetKey(0); if (!String.IsNullOrEmpty(attribUnrecognized)) @@ -331,7 +334,7 @@ namespace System.Web.Security { if( PasswordStrengthRegularExpression.Length > 0 ) { - if( !Regex.IsMatch( password, PasswordStrengthRegularExpression ) ) + if( !RegexUtil.IsMatch( password, PasswordStrengthRegularExpression, RegexOptions.None, _passwordStrengthRegexTimeout ) ) { status = MembershipCreateStatus.InvalidPassword; return null; @@ -422,7 +425,7 @@ namespace System.Web.Security { throw; } } - + ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// @@ -580,7 +583,7 @@ namespace System.Web.Security { if( PasswordStrengthRegularExpression.Length > 0 ) { - if( !Regex.IsMatch( newPassword, PasswordStrengthRegularExpression ) ) + if( !RegexUtil.IsMatch( newPassword, PasswordStrengthRegularExpression, RegexOptions.None, _passwordStrengthRegexTimeout ) ) { throw new ArgumentException(SR.GetString(SR.Password_does_not_match_regular_expression, "newPassword")); diff --git a/external/referencesource/System.Web/State/sqlstateclientmanager.cs b/external/referencesource/System.Web/State/sqlstateclientmanager.cs index ff98e5f683..0f991d742f 100644 --- a/external/referencesource/System.Web/State/sqlstateclientmanager.cs +++ b/external/referencesource/System.Web/State/sqlstateclientmanager.cs @@ -392,7 +392,8 @@ namespace System.Web.SessionState { if (s_usePartition) { throw new HttpException( SR.GetString(SR.Cant_connect_sql_session_database_partition_resolver, - s_configPartitionResolverType, conn.DataSource, conn.Database)); + s_configPartitionResolverType, conn.DataSource, conn.Database), + e); } else { throw new HttpException( diff --git a/external/referencesource/System.Web/System.Web.txt.REMOVED.git-id b/external/referencesource/System.Web/System.Web.txt.REMOVED.git-id index 7d136be550..70370c956a 100644 --- a/external/referencesource/System.Web/System.Web.txt.REMOVED.git-id +++ b/external/referencesource/System.Web/System.Web.txt.REMOVED.git-id @@ -1 +1 @@ -81be1e2a632fc13b356b8ff87751f824b2fab989 \ No newline at end of file +a98718381d95c9093f35a4a393544943139770b4 \ No newline at end of file diff --git a/external/referencesource/System.Web/UI/ConflictOptions.cs b/external/referencesource/System.Web/UI/ConflictOptions.cs index 6fce0c1620..916a363e5a 100644 --- a/external/referencesource/System.Web/UI/ConflictOptions.cs +++ b/external/referencesource/System.Web/UI/ConflictOptions.cs @@ -23,4 +23,4 @@ namespace System.Web.UI { /// CompareAllValues = 1 } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Web/UI/Control.cs.REMOVED.git-id b/external/referencesource/System.Web/UI/Control.cs.REMOVED.git-id index 4b81a71a98..b3425820b3 100644 --- a/external/referencesource/System.Web/UI/Control.cs.REMOVED.git-id +++ b/external/referencesource/System.Web/UI/Control.cs.REMOVED.git-id @@ -1 +1 @@ -1a9686a27e5ed415605485f8f16e5724c00e1b37 \ No newline at end of file +7a21a881ad31bc5c73e652ddcd35b79bf8875b50 \ No newline at end of file diff --git a/external/referencesource/System.Web/UI/ControlCollection.cs b/external/referencesource/System.Web/UI/ControlCollection.cs index 29e193397d..61aacfdc5b 100644 --- a/external/referencesource/System.Web/UI/ControlCollection.cs +++ b/external/referencesource/System.Web/UI/ControlCollection.cs @@ -192,7 +192,6 @@ namespace System.Web.UI { /// /// public virtual int Count { - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] get { return _size; } @@ -363,14 +362,12 @@ namespace System.Web.UI { } object IEnumerator.Current { - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] get { return Current; } } public Control Current { - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] get { if (index == -1) throw new InvalidOperationException(SR.GetString(SR.ListEnumCurrentOutOfRange)); diff --git a/external/referencesource/System.Web/UI/EmptyTextWriter.cs b/external/referencesource/System.Web/UI/EmptyTextWriter.cs index bab0f2435b..eddd0967fe 100644 --- a/external/referencesource/System.Web/UI/EmptyTextWriter.cs +++ b/external/referencesource/System.Web/UI/EmptyTextWriter.cs @@ -138,4 +138,4 @@ namespace System.Web.UI } } } -#endif +#endif \ No newline at end of file diff --git a/external/referencesource/System.Web/UI/HTMLTextWriter.cs b/external/referencesource/System.Web/UI/HTMLTextWriter.cs index e8eafdfb8c..af76ac63b0 100644 --- a/external/referencesource/System.Web/UI/HTMLTextWriter.cs +++ b/external/referencesource/System.Web/UI/HTMLTextWriter.cs @@ -139,7 +139,9 @@ namespace System.Web.UI { RegisterTag("big", HtmlTextWriterTag.Big, TagType.Inline); RegisterTag("blockquote", HtmlTextWriterTag.Blockquote, TagType.Other); RegisterTag("body", HtmlTextWriterTag.Body, TagType.Other); - RegisterTag("br", HtmlTextWriterTag.Br, TagType.Other); + // Devdiv 852940, BR is a self-closing tag + RegisterTag("br", HtmlTextWriterTag.Br, + BinaryCompatibility.Current.TargetsAtLeastFramework46 ? TagType.NonClosing : TagType.Other); RegisterTag("button", HtmlTextWriterTag.Button, TagType.Inline); RegisterTag("caption", HtmlTextWriterTag.Caption, TagType.Other); RegisterTag("center", HtmlTextWriterTag.Center, TagType.Other); @@ -373,7 +375,6 @@ namespace System.Web.UI { } //Writes a string to the text stream. - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] public override void Write(string s) { if (tabsPending) { OutputTabs(); @@ -390,7 +391,6 @@ namespace System.Web.UI { } //Writes a character to the text stream. - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] public override void Write(char value) { if (tabsPending) { OutputTabs(); @@ -1128,22 +1128,18 @@ namespace System.Web.UI { } } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] protected virtual string RenderBeforeTag() { return null; } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] protected virtual string RenderBeforeContent() { return null; } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] protected virtual string RenderAfterContent() { return null; } - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] protected virtual string RenderAfterTag() { return null; } diff --git a/external/referencesource/System.Web/UI/HtmlControls/HtmlControl.cs b/external/referencesource/System.Web/UI/HtmlControls/HtmlControl.cs index 157049e640..7061b39e0d 100644 --- a/external/referencesource/System.Web/UI/HtmlControls/HtmlControl.cs +++ b/external/referencesource/System.Web/UI/HtmlControls/HtmlControl.cs @@ -73,7 +73,6 @@ namespace System.Web.UI.HtmlControls { DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), ] public AttributeCollection Attributes { - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] get { if (_attributes == null) _attributes = new AttributeCollection(ViewState); diff --git a/external/referencesource/System.Web/UI/HtmlForm.cs b/external/referencesource/System.Web/UI/HtmlForm.cs index ce4088eaf6..9c06f604b8 100644 --- a/external/referencesource/System.Web/UI/HtmlForm.cs +++ b/external/referencesource/System.Web/UI/HtmlForm.cs @@ -286,7 +286,9 @@ namespace System.Web.UI.HtmlControls { action = clientFilePath.VirtualPathString; int iPos = action.LastIndexOf('/'); if (iPos >= 0) { - action = action.Substring(iPos + 1); + // Ensure the segment is always a relative path, so prepend a dot-segment + // (RFC section 4.2 Relative Reference) + action = "./" + action.Substring(iPos + 1); } } else { diff --git a/external/referencesource/System.Web/UI/IUpdatePanel.cs b/external/referencesource/System.Web/UI/IUpdatePanel.cs index 1bafbf1e45..37bffe52a7 100644 --- a/external/referencesource/System.Web/UI/IUpdatePanel.cs +++ b/external/referencesource/System.Web/UI/IUpdatePanel.cs @@ -7,4 +7,4 @@ namespace System.Web.UI { internal interface IUpdatePanel { } -} +} \ No newline at end of file diff --git a/external/referencesource/System.Web/UI/LiteralControl.cs b/external/referencesource/System.Web/UI/LiteralControl.cs index 99e8f1616f..f7e9fe26c7 100644 --- a/external/referencesource/System.Web/UI/LiteralControl.cs +++ b/external/referencesource/System.Web/UI/LiteralControl.cs @@ -74,7 +74,6 @@ namespace System.Web.UI { /// /// Saves any state that was modified after mark. /// - [System.Runtime.TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] protected internal override void Render(HtmlTextWriter output) { output.Write(_text); } diff --git a/external/referencesource/System.Web/UI/Page.cs.REMOVED.git-id b/external/referencesource/System.Web/UI/Page.cs.REMOVED.git-id index bbb10525fe..8f2162c3f9 100644 --- a/external/referencesource/System.Web/UI/Page.cs.REMOVED.git-id +++ b/external/referencesource/System.Web/UI/Page.cs.REMOVED.git-id @@ -1 +1 @@ -9f9f36cfd550af92e7788a1987855cb9b701618b \ No newline at end of file +974680fd74222db0b425c15c2e38618f0c4c6439 \ No newline at end of file diff --git a/external/referencesource/System.Web/UI/PartialCachingControl.cs b/external/referencesource/System.Web/UI/PartialCachingControl.cs index c7eb347bfb..9efc13a587 100644 --- a/external/referencesource/System.Web/UI/PartialCachingControl.cs +++ b/external/referencesource/System.Web/UI/PartialCachingControl.cs @@ -844,10 +844,8 @@ internal class ControlCachedVary { public override int GetHashCode () { HashCodeCombiner hashCodeCombiner = new HashCodeCombiner(); - // Cast _varyByCustom to an object, since the HashCodeCombiner.AddObject(string) - // overload uses StringUtil.GetStringHashCode(). We want to use String.GetHashCode() - // in this method, since we do not require a stable hash code across architectures. - hashCodeCombiner.AddObject((object)_varyByCustom); + // We need non-randomized hash code for _varyByCustom + hashCodeCombiner.AddInt(StringUtil.GetNonRandomizedHashCode(_varyByCustom)); hashCodeCombiner.AddArray(_varyByParams); hashCodeCombiner.AddArray(_varyByControls); diff --git a/external/referencesource/System.Web/UI/TemplateControl.cs b/external/referencesource/System.Web/UI/TemplateControl.cs index b5ad9dad2f..26fee24362 100644 --- a/external/referencesource/System.Web/UI/TemplateControl.cs +++ b/external/referencesource/System.Web/UI/TemplateControl.cs @@ -194,7 +194,7 @@ public abstract class TemplateControl : Control, INamingContainer, IFilterResolu /// Occurs when an uncaught exception is thrown. /// [ - WebSysDescription(SR.Page_Error) + WebSysDescription(SR.Page_ErrorDescription) ] public event EventHandler Error { add { diff --git a/external/referencesource/System.Web/UI/TraceContext.cs b/external/referencesource/System.Web/UI/TraceContext.cs index b1c853675b..476a9ec005 100644 --- a/external/referencesource/System.Web/UI/TraceContext.cs +++ b/external/referencesource/System.Web/UI/TraceContext.cs @@ -759,7 +759,7 @@ namespace System.Web { private void InitRequest() { // Master request is assumed to be initialized first System.Web.Util.Debug.Assert(_masterRequest != null); - + DataSet requestData = _masterRequest.Clone(); // request info @@ -786,19 +786,19 @@ namespace System.Web { AddRow(requestData, SR.Trace_Request, row); // header info - int i; - String[] keys = _context.Request.Headers.AllKeys; - for (i=0; i"); - // + // UNDONE: formAdapter.RenderExtraCardElements(this); writer.BeginFormOrPanel(); } @@ -432,7 +432,7 @@ namespace System.Web.UI.Adapters { RenderTargetAndArgumentPostFields(writer, target, argument, postFieldType); RenderPostFieldVariableDictionary(writer, _dynamicPostFields); RenderPostFieldDictionary(writer, _staticPostFields); - // + // UNDONE: Add postbacks for variables which are not on the current page. writer.WriteEndTag("go"); } @@ -442,8 +442,8 @@ namespace System.Web.UI.Adapters { return; } writer.Write("?"); - // - + // UNDONE: MMIT IPageAdapter.PersistCookielessData NYI + // if(Page.Adapter.PersistCookielessData && Browser["canRenderOneventAndPrevElementsTogether"] != "false") if (!StringUtil.EqualsIgnoreCase((string)Browser["canRenderOneventAndPrevElementsTogether"], "false")) { queryString = writer.ReplaceFormsCookieWithVariable(queryString); } @@ -504,7 +504,7 @@ namespace System.Web.UI.Adapters { writer.Write(""); RenderFormPostInGoAction(writer, null, _postBackEventArgumentVarName, WmlPostFieldType.Variable, String.Empty); - // + // REVIEW: Should we always include page hidden variables. writer.WriteLine(""); writer.WriteLine(""); diff --git a/external/referencesource/System.Web/UI/WebControls/Adapters/WmlPhoneLinkAdapter.cs b/external/referencesource/System.Web/UI/WebControls/Adapters/WmlPhoneLinkAdapter.cs index c4dfaa39a2..efccabe639 100644 --- a/external/referencesource/System.Web/UI/WebControls/Adapters/WmlPhoneLinkAdapter.cs +++ b/external/referencesource/System.Web/UI/WebControls/Adapters/WmlPhoneLinkAdapter.cs @@ -11,7 +11,7 @@ namespace System.Web.UI.WebControls.Adapters { public class WmlPhoneLinkAdapter : PhoneLinkAdapter { - // + // UNDONE: Add style. protected internal override void Render(HtmlTextWriter markupWriter) { WmlTextWriter writer = (WmlTextWriter)markupWriter; String text, url, phoneNumber; @@ -42,7 +42,7 @@ namespace System.Web.UI.WebControls.Adapters { if (Page != null && Page.Request != null) { browser = Page.Request.Browser; } - // + // TODO: Replace hard coded string key. if (browser != null && (String)browser["canInitiateVoiceCall"] != "true") { text = String.Format(controlText, originalNumber); @@ -54,7 +54,7 @@ namespace System.Web.UI.WebControls.Adapters { // showing as text so it can be selected. If it is not // formatted in the text yet, append it to the end of the // text. - // + // TODO: Replace hard coded string key. if (browser != null && browser["requiresPhoneNumbersAsPlainText"] == "true") { text = controlText + " " + phoneNumber; url = String.Empty; diff --git a/external/referencesource/System.Web/UI/WebControls/Adapters/WmlRadioButtonAdapter.cs b/external/referencesource/System.Web/UI/WebControls/Adapters/WmlRadioButtonAdapter.cs index 397b021374..7923294a17 100644 --- a/external/referencesource/System.Web/UI/WebControls/Adapters/WmlRadioButtonAdapter.cs +++ b/external/referencesource/System.Web/UI/WebControls/Adapters/WmlRadioButtonAdapter.cs @@ -141,14 +141,14 @@ namespace System.Web.UI.WebControls.Adapters { // RenderAsGroup returns a RadioButtonGroup object if the group should be // rendered in a single  1 2 3 4 5  \n\t\t\t\t\t\t\t\r\n\t\r\n\r\n\r\n\n\t\t\t\t\n\t\t\t\r\n\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\r\n\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\r\n\r\n\r\n
\n\t\t\t\t\t\t\t\t\t\t\tM1\n\t\t\t\t\t\t\t\t\t\t\tM2
\n\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t0\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t
\r\n\n\t\t\t\t\t\r\n\t\r\n\t\r\n\r\n
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t    \n\t\t\t\t\t\t\t
\r\n\n\t\t\t\t
"; -#else - string originalHtml = "\r\n\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\r\n\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\r\n\r\n\r\n
\n\t\t\t\t\t\t\t\t\t\t\tM1\n\t\t\t\t\t\t\t\t\t\t\tM2
\n\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t0\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t
\r\n\n\t\t\t\t\t\r\n\t\r\n\t\r\n\r\n
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t 1 2 3 4 5  \n\t\t\t\t\t\t\t
\r\n\n\t\t\t\t
\n\t\t\t\r\n\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\r\n\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\r\n\r\n\r\n
\n\t\t\t\t\t\t\t\t\t\t\tM1\n\t\t\t\t\t\t\t\t\t\t\tM2
\n\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t0\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t
\r\n\n\t\t\t\t\t\r\n\t\r\n\t\r\n\r\n
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t    \n\t\t\t\t\t\t\t
\r\n\n\t\t\t\t
"; -#endif WebTest t = new WebTest ("ListViewTotalRowCount_Bug604053.aspx"); string pageHtml = t.Run (); string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml); diff --git a/mcs/class/System.Web.Extensions/Test/code/WebTestLocal.cs b/mcs/class/System.Web.Extensions/Test/code/WebTestLocal.cs index 31197a56ae..898d9d3ea8 100644 --- a/mcs/class/System.Web.Extensions/Test/code/WebTestLocal.cs +++ b/mcs/class/System.Web.Extensions/Test/code/WebTestLocal.cs @@ -10,12 +10,10 @@ namespace MonoTests.SystemWeb.Framework #if !DOTNET CopyResource (myself, "Web.mono.config", "Web.config"); #endif -#if NET_4_5 - CopyResource (myself, "profile.config.4.5", "profile.config"); -#elif NET_4_0 - CopyResource (myself, "profile.config.4.0", "profile.config"); +#if NET_4_6 + CopyResource (myself, "profile.config.4.x", "profile.config"); #else - CopyResource (myself, "profile.config.2.0", "profile.config"); + #error "Unknown profile" #endif } } diff --git a/mcs/class/System.Web.Extensions/Test/resources/profile.config.2.0 b/mcs/class/System.Web.Extensions/Test/resources/profile.config.2.0 deleted file mode 100644 index 97ef36905f..0000000000 --- a/mcs/class/System.Web.Extensions/Test/resources/profile.config.2.0 +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/mcs/class/System.Web.Extensions/Test/resources/profile.config.4.5 b/mcs/class/System.Web.Extensions/Test/resources/profile.config.4.5 deleted file mode 100644 index 526002fd5b..0000000000 --- a/mcs/class/System.Web.Extensions/Test/resources/profile.config.4.5 +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/mcs/class/System.Web.Extensions/Test/resources/profile.config.4.0 b/mcs/class/System.Web.Extensions/Test/resources/profile.config.4.x similarity index 89% rename from mcs/class/System.Web.Extensions/Test/resources/profile.config.4.0 rename to mcs/class/System.Web.Extensions/Test/resources/profile.config.4.x index 0a652271a4..126cacca57 100644 --- a/mcs/class/System.Web.Extensions/Test/resources/profile.config.4.0 +++ b/mcs/class/System.Web.Extensions/Test/resources/profile.config.4.x @@ -3,6 +3,6 @@ - + diff --git a/mcs/class/System.Web.Routing/Makefile b/mcs/class/System.Web.Routing/Makefile index e2b0a9f1a9..09df4e8819 100644 --- a/mcs/class/System.Web.Routing/Makefile +++ b/mcs/class/System.Web.Routing/Makefile @@ -6,21 +6,8 @@ LIBRARY = System.Web.Routing.dll LIB_REFS = System System.Core System.Web System.Web.Abstractions LIB_MCS_FLAGS = -ifdef DEBUG -LIB_MCS_FLAGS += -define:DEBUG -endif - TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) EXTRA_DISTFILES = -# This is a .NET 3.5+ assembly -VALID_PROFILE := $(filter net_4_5, $(PROFILE)) -ifndef VALID_PROFILE -LIBRARY_NAME = dummy-System.Web.Routing.dll -NO_INSTALL = yes -NO_SIGN_ASSEMBLY = yes -NO_TEST = yes -endif - include ../../build/library.make diff --git a/mcs/class/System.Web.Routing/System.Web.Routing.dll.sources b/mcs/class/System.Web.Routing/System.Web.Routing.dll.sources index be16d0b3b4..c030663c14 100644 --- a/mcs/class/System.Web.Routing/System.Web.Routing.dll.sources +++ b/mcs/class/System.Web.Routing/System.Web.Routing.dll.sources @@ -1,22 +1,3 @@ ../../build/common/Consts.cs ../../build/common/MonoTODOAttribute.cs Assembly/AssemblyInfo.cs -System.Web.Routing/HttpMethodConstraint.cs -System.Web.Routing/IRouteConstraint.cs -System.Web.Routing/IRouteHandler.cs -System.Web.Routing/PatternParser.cs -System.Web.Routing/PatternToken.cs -System.Web.Routing/PatternTokenType.cs -System.Web.Routing/RequestContext.cs -System.Web.Routing/Route.cs -System.Web.Routing/RouteBase.cs -System.Web.Routing/RouteCollection.cs -System.Web.Routing/RouteData.cs -System.Web.Routing/RouteDirection.cs -System.Web.Routing/RouteTable.cs -System.Web.Routing/RouteValueDictionary.cs -System.Web.Routing/RouteValueDictionaryExtensions.cs -System.Web.Routing/StopRoutingHandler.cs -System.Web.Routing/UrlRoutingHandler.cs -System.Web.Routing/UrlRoutingModule.cs -System.Web.Routing/VirtualPathData.cs diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog b/mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog deleted file mode 100644 index cdbb490a76..0000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog +++ /dev/null @@ -1,225 +0,0 @@ -2010-06-05 Marek Habersack - - * UrlRoutingModule.cs: 4.0 doesn't do the UrlRouting.axd magic, it - simply remaps the current handler to the one obtained from the - route. - -2010-05-06 Marek Habersack - - * RouteCollection.cs: GetVirtualPath throws ArgumentException - when named route is not found in the collection. - -2010-05-05 Marek Habersack - - * UrlRoutingModule.cs: PostMapRequestHandler is obsolete in 4.0 - - * RouteValueDictionary.cs: do not process type fields in - RouteValueDictionary (object) - - * RouteCollection.cs: GetRouteData throws an exception if Request - is null in the passed context. - Added Ignore* and MapPageRoute* 4.0 APIs - - * RequestContext.cs: 4.0 API update - - * PatternParser.cs: match parser rewrite to encompass 4.0 bug - fixes. We don't emulate some of the pre-4.0 routing bugs anymore. - -2009-11-23 Marek Habersack - - * Route.cs: GetRouteData throws NotImplementedException only when - pathInfo for the current request is a non-empty string. Patch from - Tiaan , thanks! - -2009-11-09 Marek Habersack - - * RouteCollection.cs: GetVirtualPath doesn't append trailing slash - to application path blindly anymore. Fixes bug #553022 - -2009-09-09 Marek Habersack - - * Route.cs: when Url is set to null, create a parser for empty - string. Fixes bug #537751 - - * PatternParser.cs: Parse allows for null/empty URLs. Fixes bug - #537751 - -2009-09-08 Marek Habersack - - * UrlRoutingModule.cs: store original request path in - PostResolveRequestCache and restore it in - PostMapRequestHandler. Fixes bug #537089 - -2009-08-19 Marek Habersack - - * Route.cs: GetRouteData adds contents of its DataTokens - dictionary to the returned RouteData.DataTokens dictionary. Fixes - bug #523330. Patch from Dax@daxxfiles.net, thanks! - -2009-06-25 Marek Habersack - - * PatternParser.cs: parameter name lookups must be - case-insensitive. - Null and empty (string) parameters are skipped when building query - part of the action path. - -2009-06-16 Marek Habersack - - * RouteValueDictionaryExtensions.cs: do not compile if - SYSTEMCORE_DEP is not defined - - * PatternParser.cs: if SYSTEMCORE_DEP is not defined, do not - compile parts which require RouteValueDictionaryExtensions. - - * Decorated all classes with the TypeForwardedFrom attribute for - the 4.0 profile. - -2009-06-04 Marek Habersack - - * RouteValueDictionaryExtensions.cs: if both values are strings in - Has (string, value), compare them case-insensitively. Fixes bug - #502555 - -2009-05-27 Marek Habersack - - * PatternParser.cs: if Match is passed an empty path, do not - attempt to match the Url segments, skip to defaults matching right - away. - -2009-05-25 Marek Habersack - - * UrlPattern.cs: removed - replaced by PatternParser below. - - * RouteValueDictionaryExtensions.cs: added - some shortcuts for - using RouteValueDictionary in PatternParser - - * Route.cs: use the new PatternParser. - Factored out ProcessConstraint into ProcessConstraintInternal so - that the latter can be used by the PatternParser class. - Added parameter checks in ProcessConstraint. - - * PatternTokenType.cs: added - - * PatternToken.cs: added a helper class for the pattern parser. - - * PatternParser.cs: added. New implementation of url - parser/matcher/generator which fixes all URL isues known so - far. Fixes bug #504378 - -2009-05-12 Gonzalo Paniagua Javier - - * UrlPattern.cs: if the pattern is line {a}/{b} and {b} is substituted - by an empty string, remove the '/' too. - -2009-05-12 Gonzalo Paniagua Javier - - * UrlPattern.cs: non-string default arguments work now. - -2009-05-12 Marek Habersack - - * UrlPattern.cs: TrySubstitute performs substitution trimming. If - a segment would be set to a default value and all of its following - segments as well, it will be omitted from the generated URL. The - value comparison is done case-insensitively when the dictionary - values are strings. Fixes bug #502555 - -2009-05-11 Marek Habersack - - * UrlPattern.cs: TrySubstitute treats defaults differently - now. They are not consulted when checking if the passed values - match the pattern, but only when substituting the values. Fixes - bug #502555 - -2009-05-05 Marek Habersack - - * UrlPattern.cs: Match adds defaults values should some keys be - missing from the url. Fixes bug #500739 - - * Route.cs: a small GetRouteData loop optimization - -2009-02-18 Marek Habersack - - * UrlPattern.cs: TrySubstitute now gets the collection of default - values and uses it to replace url segments instead of failing when - the passed values collection is missing a segment. - Do not use the tokens array in Match. - - * RouteCollection.cs: check if name is null or empty, not just - null in GetVirtualPath - - * Route.cs: url.TrySubstitute should be passed the defaults - collection when called from GetVirtualPath - -2009-02-14 Marek Habersack - - * UrlPattern.cs: use the defaults collection when matching a path - and segments are missing. - - * RouteCollection.cs: GetRouteData must use VirtualPathProvider - to check for virtual path existence. - -2008-10-23 Atsushi Enomoto - - * UrlPattern.cs : fixed possible out-of-range case ("tableName/" in - DynamicData). - -2008-10-17 Atsushi Enomoto - - * RouteValueDictionary.cs : its string comparison is case - insensitive. - -2008-10-17 Atsushi Enomoto - - * UrlPattern.cs : fixed pattern match for such string that has - suffix. (DynamicData uses it.) - -2008-10-16 Atsushi Enomoto - - * RouteValueDictionary.cs : object argument is actually for - anonymous type instance. - -2008-10-10 Atsushi Enomoto - - * UrlRoutingModule.cs : implement PostMapRequestHandler() and - PostResolveRequestCache() to work correctly in order. - Now it should practically work. - -2008-09-18 Atsushi Enomoto - - * UrlRoutingModule.cs, RouteCollection.cs : - handle RouteExistingFiles. - -2008-09-18 Atsushi Enomoto - - * Route.cs : reject invalid constraint. - * UrlRoutingHandler.cs : more ProcessRequest() impl. - * UrlRoutingModule.cs : note. - -2008-09-17 Atsushi Enomoto - - * HttpMethodConstraint.cs, Route.cs, RouteCollection.cs, - UrlPattern.cs, UrlRoutingModule.cs: - ongoing UrlRoutingModule implementation. - -2008-09-12 Atsushi Enomoto - - * HttpMethodConstraint.cs, Route.cs, UrlPattern.cs, - RouteCollection.cs : implement Route.GetRouteData() and - HttpMethodConstraint.Match(). - -2008-09-12 Atsushi Enomoto - - * UrlPattern.cs : new file for URL pattern processing. - * Route.cs : use above. - -2008-09-11 Atsushi Enomoto - - * HttpMethodConstraint.cs, RequestContext.cs, Route.cs, - RouteCollection.cs, RouteData.cs, RouteTable.cs, - RouteValueDictionary.cs, StopRoutingHandler.cs, - UrlRoutingHandler.cs, UrlRoutingModule.cs, VirtualPathData.cs: - some implementation. - -2008-09-04 Atsushi Enomoto - - *.cs: initial checkin. diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/IRouteConstraint.cs b/mcs/class/System.Web.Routing/System.Web.Routing/IRouteConstraint.cs deleted file mode 100644 index 00118433b4..0000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing/IRouteConstraint.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// IRouteConstraint.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.Runtime.CompilerServices; -using System.Security.Permissions; -using System.Web; - -namespace System.Web.Routing -{ - [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")] - public interface IRouteConstraint - { - bool Match (HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection); - } -} diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/IRouteHandler.cs b/mcs/class/System.Web.Routing/System.Web.Routing/IRouteHandler.cs deleted file mode 100644 index a9a0d091cf..0000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing/IRouteHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// IRouteHandler.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.Runtime.CompilerServices; -using System.Security.Permissions; -using System.Web; - -namespace System.Web.Routing -{ - [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")] - public interface IRouteHandler - { - IHttpHandler GetHttpHandler (RequestContext requestContext); - } -} diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/RequestContext.cs b/mcs/class/System.Web.Routing/System.Web.Routing/RequestContext.cs deleted file mode 100644 index 62c6957c7f..0000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing/RequestContext.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// RequestContext.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.Runtime.CompilerServices; -using System.Security.Permissions; -using System.Web; - -namespace System.Web.Routing -{ - [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")] - [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public class RequestContext - { - public RequestContext () - { - HttpContext = null; - RouteData = null; - } - public RequestContext (HttpContextBase httpContext, RouteData routeData) - { - if (httpContext == null) - throw new ArgumentNullException ("httpContext"); - if (routeData == null) - throw new ArgumentNullException ("routeData"); - - HttpContext = httpContext; - RouteData = routeData; - } - - public virtual HttpContextBase HttpContext { get; set; } - public virtual RouteData RouteData { get; set; } - } -} diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/RouteBase.cs b/mcs/class/System.Web.Routing/System.Web.Routing/RouteBase.cs deleted file mode 100644 index 7e7d92135e..0000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing/RouteBase.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// RouteBase.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.Runtime.CompilerServices; -using System.Security.Permissions; -using System.Web; - -namespace System.Web.Routing -{ - [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")] - [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public abstract class RouteBase - { - public abstract RouteData GetRouteData (HttpContextBase httpContext); - public abstract VirtualPathData GetVirtualPath (RequestContext requestContext, RouteValueDictionary values); - } -} diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/RouteDirection.cs b/mcs/class/System.Web.Routing/System.Web.Routing/RouteDirection.cs deleted file mode 100644 index 693d1dceac..0000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing/RouteDirection.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// RouteDirection.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.Runtime.CompilerServices; - -namespace System.Web.Routing -{ - [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")] - public enum RouteDirection - { - IncomingRequest, - UrlGeneration - } -} diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/RouteTable.cs b/mcs/class/System.Web.Routing/System.Web.Routing/RouteTable.cs deleted file mode 100644 index ff0bc2e13d..0000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing/RouteTable.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// RouteTable.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.Runtime.CompilerServices; -using System.Security.Permissions; -using System.Web; - -namespace System.Web.Routing -{ - [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")] - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public class RouteTable - { - static RouteTable () - { - Routes = new RouteCollection (); - } - - public static RouteCollection Routes { get; private set; } - } -} diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/RouteValueDictionary.cs b/mcs/class/System.Web.Routing/System.Web.Routing/RouteValueDictionary.cs deleted file mode 100644 index eeef0dda75..0000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing/RouteValueDictionary.cs +++ /dev/null @@ -1,184 +0,0 @@ -// -// RouteValueDictionary.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.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Runtime.CompilerServices; -using System.Security.Permissions; -using System.Web; - -using PairCollection = System.Collections.Generic.ICollection>; - -namespace System.Web.Routing -{ - [TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")] - [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public class RouteValueDictionary : IDictionary - { - internal class CaseInsensitiveStringComparer : IEqualityComparer - { - public static readonly CaseInsensitiveStringComparer Instance = new CaseInsensitiveStringComparer (); - - public int GetHashCode (string obj) - { - return obj.ToLower (CultureInfo.InvariantCulture).GetHashCode (); - } - - public bool Equals (string obj1, string obj2) - { - return String.Equals (obj1, obj2, StringComparison.OrdinalIgnoreCase); - } - } - - Dictionary d = new Dictionary (CaseInsensitiveStringComparer.Instance); - - public RouteValueDictionary () - { - } - - public RouteValueDictionary (IDictionary dictionary) - { - if (dictionary == null) - throw new ArgumentNullException ("dictionary"); - foreach (var p in dictionary) - Add (p.Key, p.Value); - } - - public RouteValueDictionary (object values) // anonymous type instance - { - if (values == null) - return; - - foreach (var pi in values.GetType ().GetProperties ()) { - try { - Add (pi.Name, pi.GetValue (values, null)); - } catch { - // ignore - } - } - } - - public int Count { - get { return d.Count; } - } - - bool PairCollection.IsReadOnly { - get { return ((PairCollection) d).IsReadOnly; } - } - - ICollection IDictionary.Keys { - get { return d.Keys; } - } - - ICollection IDictionary.Values { - get { return d.Values; } - } - - public object this [string key] { - get { object v; return d.TryGetValue (key, out v) ? v : null; } - set { d [key] = value; } - } - - public Dictionary.KeyCollection Keys { - get { return d.Keys; } - } - - public Dictionary.ValueCollection Values { - get { return d.Values; } - } - - public void Add (string key, object value) - { - d.Add (key, value); - } - - public void Clear () - { - d.Clear (); - } - - public bool ContainsKey (string key) - { - return d.ContainsKey (key); - } - - public bool ContainsValue (object value) - { - return d.ContainsValue (value); - } - - public Dictionary.Enumerator GetEnumerator () - { - return d.GetEnumerator (); - } - - void ICollection>.Add (KeyValuePair item) - { - ((PairCollection) d).Add (item); - } - - bool ICollection>.Contains (KeyValuePair item) - { - return ((PairCollection) d).Contains (item); - } - - void ICollection>.CopyTo (KeyValuePair [] array, int arrayIndex) - { - ((PairCollection) d).CopyTo (array, arrayIndex); - } - - bool ICollection>.Remove (KeyValuePair item) - { - return ((PairCollection) d).Remove (item); - } - - IEnumerator> IEnumerable>.GetEnumerator() - { - return d.GetEnumerator (); - } - - IEnumerator IEnumerable.GetEnumerator () - { - return d.GetEnumerator (); - } - - public bool Remove (string key) - { - return d.Remove (key); - } - - public bool TryGetValue (string key, out object value) - { - return d.TryGetValue (key, out value); - } - } -} diff --git a/mcs/class/System.Web.Routing/Test/System.Web.Routing/FakeHttpWorkerRequest.cs b/mcs/class/System.Web.Routing/Test/System.Web.Routing/FakeHttpWorkerRequest.cs index 5d59be0c2f..1e536b0dcf 100644 --- a/mcs/class/System.Web.Routing/Test/System.Web.Routing/FakeHttpWorkerRequest.cs +++ b/mcs/class/System.Web.Routing/Test/System.Web.Routing/FakeHttpWorkerRequest.cs @@ -81,11 +81,7 @@ namespace MonoTests.Common public override string GetRawUrl () { -#if NET_4_0 return "/GetRawUrl"; -#else - return "GetRawUrl"; -#endif } public override string GetHttpVerbName () diff --git a/mcs/class/System.Web.Routing/Test/System.Web.Routing/RequestContext.cs b/mcs/class/System.Web.Routing/Test/System.Web.Routing/RequestContext.cs index 7e890be793..5d2aeceb85 100644 --- a/mcs/class/System.Web.Routing/Test/System.Web.Routing/RequestContext.cs +++ b/mcs/class/System.Web.Routing/Test/System.Web.Routing/RequestContext.cs @@ -40,7 +40,6 @@ namespace MonoTests.System.Web.Routing [TestFixture] public class RequestContextTest { -#if NET_4_0 [Test] public void DefaultConstructor () { @@ -49,7 +48,6 @@ namespace MonoTests.System.Web.Routing Assert.AreEqual (null, rc.HttpContext, "#A1"); Assert.AreEqual (null, rc.RouteData, "#A2"); } -#endif [Test] public void Constructor_HttpContextBase_RouteData () { @@ -72,14 +70,12 @@ namespace MonoTests.System.Web.Routing var rc = new RequestContext (ctx, new RouteData ()); Assert.AreSame (ctx, rc.HttpContext, "#A1"); -#if NET_4_0 ctx = new HttpContextWrapper (new HttpContext (new HttpRequest ("filename", "http://localhost/filename", String.Empty), new HttpResponse (new StringWriter ()))); rc.HttpContext = ctx; Assert.AreSame (ctx, rc.HttpContext, "#A2"); rc.HttpContext = null; Assert.IsNull (rc.HttpContext, "#A3"); -#endif } [Test] @@ -90,14 +86,12 @@ namespace MonoTests.System.Web.Routing var rc = new RequestContext (ctx, rd); Assert.AreSame (rd, rc.RouteData, "#A1"); -#if NET_4_0 rd = new RouteData (); rc.RouteData = rd; Assert.AreSame (rd, rc.RouteData, "#A2"); rc.RouteData = null; Assert.IsNull (rc.RouteData, "#A3"); -#endif } } } diff --git a/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteCollectionTest.cs b/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteCollectionTest.cs index 18b52ea11b..c2d2d51a28 100644 --- a/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteCollectionTest.cs +++ b/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteCollectionTest.cs @@ -131,17 +131,8 @@ namespace MonoTests.System.Web.Routing { var rd = new RouteCollection () { RouteExistingFiles = true }.GetRouteData (new HttpContextStub2 (null, null, null)); Assert.IsNull (rd, "#A1"); -#if NET_4_0 rd = new RouteCollection ().GetRouteData (new HttpContextStub2 (null, null, null)); Assert.IsNull (rd, "#A2"); -#else - try { - new RouteCollection ().GetRouteData (new HttpContextStub2 (null, null, null)); - Assert.Fail ("#A3"); - } catch (NotImplementedException) { - // it should fail due to the NIE on AppRelativeCurrentExecutionFilePath. - } -#endif } [Test] @@ -648,7 +639,6 @@ namespace MonoTests.System.Web.Routing Assert.IsNotNull (rd, "#A1"); } -#if NET_4_0 [Test] public void Ignore_String () { @@ -926,6 +916,15 @@ namespace MonoTests.System.Web.Routing Assert.AreEqual (typeof (PageRouteHandler), rd.RouteHandler.GetType (), "#A4-3"); Assert.IsFalse (((PageRouteHandler) rd.RouteHandler).CheckPhysicalUrlAccess, "#A4-4"); } -#endif + + [Test] // https://bugzilla.xamarin.com/show_bug.cgi?id=13909 + public void MapPageRoute_Bug13909 () + { + var c = new RouteCollection (); + + c.MapPageRoute("test", "test", "~/test.aspx"); + c.Clear(); + c.MapPageRoute("test", "test", "~/test.aspx"); + } } } diff --git a/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteTest.cs b/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteTest.cs index b9e9be7247..c9fd18a29c 100644 --- a/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteTest.cs +++ b/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteTest.cs @@ -627,7 +627,6 @@ namespace MonoTests.System.Web.Routing var hc = new HttpContextStub ("~/xyzxyzxyzxyzblah", String.Empty); var rd = r.GetRouteData (hc); -#if NET_4_0 || !DOTNET // When running on Mono this test succeeds - it was a bug in .NET routing for 3.5 which // we don't reproduce anymore. Assert.IsNotNull (rd, "#1"); @@ -637,9 +636,6 @@ namespace MonoTests.System.Web.Routing Assert.AreEqual ("xyz", rd.Values ["foo"], "#4-1"); Assert.AreEqual ("xyz", rd.Values ["bar"], "#4-2"); Assert.AreEqual ("blah", rd.Values ["baz"], "#4-3"); -#else - Assert.IsNull (rd, "#1"); -#endif } [Test] @@ -738,7 +734,6 @@ namespace MonoTests.System.Web.Routing var hc = new HttpContextStub ("~/xyzxyzxyzxyzxyzxyzblah", String.Empty); var rd = r.GetRouteData (hc); -#if NET_4_0 || !DOTNET // When running on Mono this test succeeds - it was a bug in .NET routing for 3.5 which // we don't reproduce anymore. Assert.IsNotNull (rd, "#1"); @@ -748,9 +743,6 @@ namespace MonoTests.System.Web.Routing Assert.AreEqual ("xyzxyzxyz", rd.Values ["foo"], "#4-1"); Assert.AreEqual ("xyz", rd.Values ["bar"], "#4-2"); Assert.AreEqual ("blah", rd.Values ["baz"], "#4-3"); -#else - Assert.IsNull (rd, "#1"); -#endif } [Test] @@ -776,7 +768,6 @@ namespace MonoTests.System.Web.Routing var hc = new HttpContextStub ("~/xyzxyzxyzdabxyzblah", String.Empty); var rd = r.GetRouteData (hc); -#if NET_4_0 || !DOTNET // When running on Mono this test succeeds - it was a bug in .NET routing for 3.5 which // we don't reproduce anymore. Assert.IsNotNull (rd, "#1"); @@ -786,9 +777,6 @@ namespace MonoTests.System.Web.Routing Assert.AreEqual ("xyz", rd.Values ["foo"], "#4-1"); Assert.AreEqual ("dab", rd.Values ["bar"], "#4-2"); Assert.AreEqual ("blah", rd.Values ["baz"], "#4-3"); -#else - Assert.IsNull (rd, "#1"); -#endif } [Test] @@ -798,7 +786,6 @@ namespace MonoTests.System.Web.Routing var hc = new HttpContextStub ("~/xyzxyzxyzxyzxyz", String.Empty); var rd = r.GetRouteData (hc); -#if NET_4_0 || !DOTNET // When running on Mono this test succeeds - it was a bug in .NET routing for 3.5 which // we don't reproduce anymore. Assert.IsNotNull (rd, "#1"); @@ -808,9 +795,6 @@ namespace MonoTests.System.Web.Routing Assert.AreEqual ("xyz", rd.Values ["foo"], "#4-1"); Assert.AreEqual ("xyz", rd.Values ["bar"], "#4-2"); Assert.AreEqual ("xyz", rd.Values ["baz"], "#4-3"); -#else - Assert.IsNull (rd, "#1"); -#endif } [Test] @@ -1375,7 +1359,6 @@ namespace MonoTests.System.Web.Routing } -#if NET_4_0 [Test (Description="Bug #671753")] public void GetVirtualPath15 () { @@ -1396,7 +1379,6 @@ namespace MonoTests.System.Web.Routing Assert.IsNotNull (RouteTable.Routes.GetVirtualPath (rc, "TestRoute", new RouteValueDictionary ()), "#A3"); Assert.IsNotNull (RouteTable.Routes.GetVirtualPath (rc, "TestRoute", null), "#A4"); } -#endif [Test (Description="Xamarin Bug #9116")] public void GetVirtualPath16 () diff --git a/mcs/class/System.Web.Routing/Test/System.Web.Routing/TestStubTypes.cs b/mcs/class/System.Web.Routing/Test/System.Web.Routing/TestStubTypes.cs index 817ae81973..45f3ede612 100644 --- a/mcs/class/System.Web.Routing/Test/System.Web.Routing/TestStubTypes.cs +++ b/mcs/class/System.Web.Routing/Test/System.Web.Routing/TestStubTypes.cs @@ -248,7 +248,6 @@ namespace MonoTests.System.Web.Routing public string RewrittenPath { get; set; } } -#if NET_4_0 class FakeHttpRequestWrapper : HttpRequestWrapper { string requestUrl; @@ -320,7 +319,6 @@ namespace MonoTests.System.Web.Routing wrapper = new FakeHttpRequestWrapper (requestUrl, path, appPath); } } -#endif public class MyStopRoutingHandler : StopRoutingHandler { public IHttpHandler CallGetHttpHandler (RequestContext rc) diff --git a/mcs/class/System.Web.Routing/Test/System.Web.Routing/UrlRoutingModuleTest.cs b/mcs/class/System.Web.Routing/Test/System.Web.Routing/UrlRoutingModuleTest.cs index a55d911e56..784dc51089 100644 --- a/mcs/class/System.Web.Routing/Test/System.Web.Routing/UrlRoutingModuleTest.cs +++ b/mcs/class/System.Web.Routing/Test/System.Web.Routing/UrlRoutingModuleTest.cs @@ -85,17 +85,6 @@ namespace MonoTests.System.Web.Routing m.PostResolveRequestCache (new HttpContextStub2 ("~/foo/bar", null)); } -#if !NET_4_0 - [Test] - [ExpectedException (typeof (InvalidOperationException))] - public void PostResolveRequestCacheNullHttpHandler () - { - var m = new UrlRoutingModule (); - RouteTable.Routes.Add (new MyRoute ("foo/bar", new NullRouteHandler ())); - - m.PostResolveRequestCache (new HttpContextStub2 ("~/foo/bar", null)); - } -#endif [Test] [ExpectedException (typeof (NotImplementedException))] public void PostResolveRequestCacheNoPath () @@ -106,53 +95,15 @@ namespace MonoTests.System.Web.Routing m.PostResolveRequestCache (new HttpContextStub2 ("~/foo/bar", null)); } -#if !NET_4_0 - [Test] - public void PostResolveRequestCacheCallRewritePath () - { - var m = new UrlRoutingModule (); - RouteTable.Routes.Add (new MyRoute ("{foo}/{bar}", new MyRouteHandler ())); - var hc = new HttpContextStub2 ("~/x/y", "z"); - try { - m.PostResolveRequestCache (hc); - Assert.Fail ("#1"); - } catch (ApplicationException ex) { - Assert.AreEqual ("~/UrlRouting.axd", ex.Message, "#2"); - } - } - - [Test] - public void PostResolveRequestCacheModifiedPath () - { - var m = new UrlRoutingModule (); - RouteTable.Routes.Add (new MyRoute ("{foo}/{bar}", new MyRouteHandler ())); - var hc = new HttpContextStub2 ("~/x/y", "z", "apppath"); - hc.SetResponse (new HttpResponseStub (2)); - try { - m.PostResolveRequestCache (hc); - Assert.Fail ("#1"); - } catch (ApplicationException ex) { - Assert.AreEqual ("~/UrlRouting.axd", ex.Message, "#2"); - } - } -#endif [Test] public void PostResolveRequestCache () { var m = new UrlRoutingModule (); RouteTable.Routes.Add (new MyRoute ("{foo}/{bar}", new MyRouteHandler ())); -#if NET_4_0 var hc = new HttpContextStub4 ("~/x/y", "z", "apppath", false); -#else - var hc = new HttpContextStub3 ("~/x/y", "z", "apppath", false); -#endif hc.SetResponse (new HttpResponseStub (2)); m.PostResolveRequestCache (hc); -#if NET_4_0 Assert.AreEqual (null, hc.RewrittenPath, "#1"); -#else - Assert.AreEqual ("~/UrlRouting.axd", hc.RewrittenPath, "#1"); -#endif // it internally stores the handler } @@ -203,49 +154,23 @@ namespace MonoTests.System.Web.Routing { var m = new UrlRoutingModule (); RouteTable.Routes.Add (new MyRoute ("{foo}/{bar}", new MyRouteHandler ())); -#if NET_4_0 var hc = new HttpContextStub4 ("~/x/y", "z", "apppath", true); -#else - var hc = new HttpContextStub3 ("~/x/y", "z", "apppath", true); -#endif hc.HttpHandler = new MyHttpHandler (); hc.SetResponse (new HttpResponseStub (2)); m.PostResolveRequestCache (hc); -#if NET_4_0 Assert.AreEqual (null, hc.RewrittenPath, "#1"); -#else - Assert.AreEqual ("~/UrlRouting.axd", hc.RewrittenPath, "#1"); -#endif // It tries to set Handler and causes NIE m.PostMapRequestHandler (hc); } [Test] -#if !NET_4_0 - [ExpectedException (typeof (ApplicationException))] -#endif public void Pipeline3 () { var m = new UrlRoutingModule (); RouteTable.Routes.Add (new MyRoute ("{foo}/{bar}", new MyRouteHandler ())); -#if NET_4_0 var hc = new HttpContextStub5 ("~/x/y", String.Empty, "apppath"); -#else - var hc = new HttpContextStub2 ("~/x/y", String.Empty, "apppath"); -#endif hc.SetResponse (new HttpResponseStub (2)); -#if NET_4_0 Assert.IsNull (m.RouteCollection.GetRouteData (hc), "#0"); -#else - Assert.IsNotNull (m.RouteCollection.GetRouteData (hc), "#0"); - m.PostResolveRequestCache (hc); - try { - m.PostMapRequestHandler (hc); - Assert.Fail ("#1"); - } catch (ApplicationException ex) { - Assert.AreEqual ("~/UrlRouting.axd", ex.Message, "#2"); - } -#endif } } } diff --git a/mcs/class/System.Web.Routing/net_4_0_System.Web.Routing.dll.sources b/mcs/class/System.Web.Routing/net_4_0_System.Web.Routing.dll.sources deleted file mode 100644 index c030663c14..0000000000 --- a/mcs/class/System.Web.Routing/net_4_0_System.Web.Routing.dll.sources +++ /dev/null @@ -1,3 +0,0 @@ -../../build/common/Consts.cs -../../build/common/MonoTODOAttribute.cs -Assembly/AssemblyInfo.cs diff --git a/mcs/class/System.Web.Routing/net_4_5_System.Web.Routing.dll.sources b/mcs/class/System.Web.Routing/net_4_5_System.Web.Routing.dll.sources deleted file mode 100644 index 7194672a8c..0000000000 --- a/mcs/class/System.Web.Routing/net_4_5_System.Web.Routing.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include net_4_0_System.Web.Routing.dll.sources diff --git a/mcs/class/System.Web.Services/Makefile b/mcs/class/System.Web.Services/Makefile index a77c368389..c189f7963e 100644 --- a/mcs/class/System.Web.Services/Makefile +++ b/mcs/class/System.Web.Services/Makefile @@ -3,8 +3,7 @@ SUBDIRS = include ../../build/rules.make LIBRARY = System.Web.Services.dll -MOBILE := $(filter monotouch monotouch_watch monodroid xammac mobile mobile_static, $(PROFILE)) -ifdef MOBILE +ifdef MOBILE_PROFILE LIB_REFS = System System.Xml LIB_MCS_FLAGS = \ -nowarn:649 -nowarn:169 \ @@ -47,6 +46,14 @@ endif TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:618 +ifndef NO_THREAD_ABORT +TEST_MCS_FLAGS += -d:MONO_FEATURE_THREAD_ABORT +endif + +ifndef NO_THREAD_SUSPEND_RESUME +TEST_MCS_FLAGS += -d:MONO_FEATURE_THREAD_SUSPEND_RESUME +endif + EXTRA_DISTFILES = \ System.Web.Services.Description/web-reference.xsd \ System.Web.Services.Description/wsdl-1.1.xsd \ diff --git a/mcs/class/System.Web.Services/System.Web.Services_test.dll.sources b/mcs/class/System.Web.Services/System.Web.Services_test.dll.sources index a2a540c685..1d055d9cda 100644 --- a/mcs/class/System.Web.Services/System.Web.Services_test.dll.sources +++ b/mcs/class/System.Web.Services/System.Web.Services_test.dll.sources @@ -31,6 +31,6 @@ System.Web.Services.Description/WebReferenceOptionsTest.cs System.Web.Services.Description/WebServicesInteroperabilityTest.cs System.Web.Services.Protocols/LogicalMethodInfoTest.cs System.Web.Services.Protocols/SoapHttpClientProtocolTest.cs -System.Web.Services.Protocols/SocketResponder.cs System.Web.Services.Protocols/WebClientProtocolTest.cs System.Web.Services.Protocols/SoapServerTypeTest.cs +../../test-helpers/SocketResponder.cs diff --git a/mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/SoapHttpClientProtocolTest.cs b/mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/SoapHttpClientProtocolTest.cs index 68673dbac4..0019e05c27 100755 --- a/mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/SoapHttpClientProtocolTest.cs +++ b/mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/SoapHttpClientProtocolTest.cs @@ -39,6 +39,8 @@ using System.Xml.Serialization; using NUnit.Framework; +using MonoTests.Helpers; + namespace MonoTests.System.Web.Services.Protocols { [TestFixture] @@ -49,9 +51,7 @@ namespace MonoTests.System.Web.Services.Protocols public void OutParametersTest () { IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 5000); - using (SocketResponder sr = new SocketResponder (localEP, new SocketRequestHandler (OutParametersResponse))) { - sr.Start (); - + using (SocketResponder sr = new SocketResponder (localEP, s => OutParametersResponse (s))) { FooService service = new FooService (); service.Url = "http://" + IPAddress.Loopback.ToString () + ":5000/"; @@ -62,8 +62,6 @@ namespace MonoTests.System.Web.Services.Protocols Assert.AreEqual (0, a, "#A2"); Assert.IsFalse (b, "#A3"); service.Dispose (); - - sr.Stop (); } } @@ -72,9 +70,7 @@ namespace MonoTests.System.Web.Services.Protocols public void FaultTest () { IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 5000); - using (SocketResponder sr = new SocketResponder (localEP, new SocketRequestHandler (FaultResponse_Qualified))) { - sr.Start (); - + using (SocketResponder sr = new SocketResponder (localEP, s => FaultResponse_Qualified (s))) { FooService service = new FooService (); service.Url = "http://" + IPAddress.Loopback.ToString () + ":5000/"; try { @@ -97,13 +93,9 @@ namespace MonoTests.System.Web.Services.Protocols Assert.AreEqual ("Failure processing request.", ex.Message, "#A9"); } service.Dispose (); - - sr.Stop (); } - using (SocketResponder sr = new SocketResponder (localEP, new SocketRequestHandler (FaultResponse_Unqualified))) { - sr.Start (); - + using (SocketResponder sr = new SocketResponder (localEP, s => FaultResponse_Unqualified (s))) { FooService service = new FooService (); service.Url = "http://" + IPAddress.Loopback.ToString () + ":5000/"; try { @@ -126,8 +118,6 @@ namespace MonoTests.System.Web.Services.Protocols Assert.AreEqual ("Failure processing request.", ex.Message, "#B9"); } service.Dispose (); - - sr.Stop (); } } diff --git a/mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/SocketResponder.cs b/mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/SocketResponder.cs deleted file mode 100644 index 8e26ee6fbf..0000000000 --- a/mcs/class/System.Web.Services/Test/System.Web.Services.Protocols/SocketResponder.cs +++ /dev/null @@ -1,118 +0,0 @@ -// -// SocketResponder.cs - Utility class for tests that require a listener -// -// Author: -// Gert Driesen (drieseng@users.sourceforge.net) -// -// Copyright (C) 2007 Gert Driesen -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.IO; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Threading; - -namespace MonoTests.System.Web.Services.Protocols -{ - public delegate byte [] SocketRequestHandler (Socket socket); - - public class SocketResponder : IDisposable - { - private TcpListener tcpListener; - private readonly IPEndPoint _localEndPoint; - private Thread listenThread; - private SocketRequestHandler _requestHandler; - private bool _stopped = true; - private readonly object _syncRoot = new object (); - - private const int SOCKET_CLOSED = 10004; - - public SocketResponder (IPEndPoint localEP, SocketRequestHandler requestHandler) - { - _localEndPoint = localEP; - _requestHandler = requestHandler; - } - - public IPEndPoint LocalEndPoint - { - get { return _localEndPoint; } - } - - public void Dispose () - { - Stop (); - } - - public bool IsStopped - { - get - { - lock (_syncRoot) { - return _stopped; - } - } - } - - public void Start () - { - lock (_syncRoot) { - if (!_stopped) - return; - _stopped = false; - listenThread = new Thread (new ThreadStart (Listen)); - listenThread.Start (); - Thread.Sleep (20); // allow listener to start - } - } - - public void Stop () - { - lock (_syncRoot) { - if (_stopped) - return; - _stopped = true; - if (tcpListener != null) { - tcpListener.Stop (); - tcpListener = null; - } - } - } - - private void Listen () - { - tcpListener = new TcpListener (LocalEndPoint); - tcpListener.Start (); - try { - Socket socket = tcpListener.AcceptSocket (); - socket.Send (_requestHandler (socket)); - socket.Close (); - } catch (SocketException ex) { - // ignore interruption of blocking call - if (ex.ErrorCode != SOCKET_CLOSED) - throw; - } - } - } -} diff --git a/mcs/class/System.Web.Services/monotouch_tv_System.Web.Services.dll.sources b/mcs/class/System.Web.Services/monotouch_tv_System.Web.Services.dll.sources new file mode 100644 index 0000000000..9e39dcc73b --- /dev/null +++ b/mcs/class/System.Web.Services/monotouch_tv_System.Web.Services.dll.sources @@ -0,0 +1 @@ +#include mobile_System.Web.Services.dll.sources diff --git a/mcs/class/System.Web/Assembly/AssemblyInfo.cs b/mcs/class/System.Web/Assembly/AssemblyInfo.cs index a10e374faf..67619f0209 100644 --- a/mcs/class/System.Web/Assembly/AssemblyInfo.cs +++ b/mcs/class/System.Web/Assembly/AssemblyInfo.cs @@ -85,9 +85,7 @@ using System.Web.UI; #endif [assembly: InternalsVisibleTo ("SystemWebTestShim, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] -[assembly: InternalsVisibleTo ("System.Web_test_net_2_0, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] -[assembly: InternalsVisibleTo ("System.Web_test_net_4_0, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] -[assembly: InternalsVisibleTo ("System.Web_test_net_4_5, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] +[assembly: InternalsVisibleTo ("System.Web_test_net_4_x, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] // Resources [assembly: WebResource ("TreeView_noexpand.gif", "image/gif")] diff --git a/mcs/class/System.Web/Makefile b/mcs/class/System.Web/Makefile index ece23d446e..21fad6ab52 100644 --- a/mcs/class/System.Web/Makefile +++ b/mcs/class/System.Web/Makefile @@ -240,6 +240,8 @@ OTHER_LIB_MCS_FLAGS += -r:System.Web.ApplicationServices.dll OTHER_RES += $(RESOURCE_FILES_4) endif +RESOURCE_STRINGS = ../../../external/referencesource/System.Web/System.Web.txt + LIB_REFS = System System.Core System.Drawing System.Data System.Xml System.EnterpriseServices System.Runtime.Serialization.Formatters.Soap System.ComponentModel.DataAnnotations LIB_MCS_FLAGS = \ -unsafe \ diff --git a/mcs/class/System.Web/ReferenceSources/SR.cs.REMOVED.git-id b/mcs/class/System.Web/ReferenceSources/SR.cs.REMOVED.git-id new file mode 100644 index 0000000000..f62d0f658f --- /dev/null +++ b/mcs/class/System.Web/ReferenceSources/SR.cs.REMOVED.git-id @@ -0,0 +1 @@ +29db6615b5ce14e369eba09c5e0d78ec0f9c65c7 \ No newline at end of file diff --git a/mcs/class/System.Web/System.Web.Caching/IOutputCacheEntry.cs b/mcs/class/System.Web/System.Web.Caching/IOutputCacheEntry.cs deleted file mode 100644 index 1f788edc02..0000000000 --- a/mcs/class/System.Web/System.Web.Caching/IOutputCacheEntry.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// Authors: -// Marek Habersack -// -// (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.Collections.Generic; - -namespace System.Web.Caching -{ - public interface IOutputCacheEntry - { - List HeaderElements { get; set; } - List ResponseElements { get; set; } - } -} diff --git a/mcs/class/System.Web/System.Web.Compilation/AppResourcesAssemblyBuilder.cs b/mcs/class/System.Web/System.Web.Compilation/AppResourcesAssemblyBuilder.cs index da8d37df9f..895440d3a6 100644 --- a/mcs/class/System.Web/System.Web.Compilation/AppResourcesAssemblyBuilder.cs +++ b/mcs/class/System.Web/System.Web.Compilation/AppResourcesAssemblyBuilder.cs @@ -48,7 +48,7 @@ namespace System.Web.Compilation class AppResourcesAssemblyBuilder { static string framework_version = "4.5"; - static string profile_path = "net_4_5"; + static string profile_path = "net_4_x"; CompilationSection config; CompilerInfo ci; CodeDomProvider _provider; diff --git a/mcs/class/System.Web/System.Web.Compilation/BuildProviderAppliesTo.cs b/mcs/class/System.Web/System.Web.Compilation/BuildProviderAppliesTo.cs deleted file mode 100644 index f49eedf6d2..0000000000 --- a/mcs/class/System.Web/System.Web.Compilation/BuildProviderAppliesTo.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.Compilation.BuildProviderAppliesTo -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2006 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.Compilation -{ - [Flags] - public enum BuildProviderAppliesTo - { - Web = 1, /* generate code from files in directories *other* than App_Code, - App_LocalResources, and App_GlobalResources */ - Code = 1 << 1, /* generate code only for App_Code/* */ - Resources = 1 << 2, /* generate code only for App_LocalResources/* and App_GlobalResources/* */ - All = 7 /* generate code for everything. default value for the attribute */ - } -} - - diff --git a/mcs/class/System.Web/System.Web.Compilation/BuildProviderAppliesToAttribute.cs b/mcs/class/System.Web/System.Web.Compilation/BuildProviderAppliesToAttribute.cs deleted file mode 100644 index 3ec58fefcc..0000000000 --- a/mcs/class/System.Web/System.Web.Compilation/BuildProviderAppliesToAttribute.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// System.Web.Compilation.BuildProviderAppliesToAttribute -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2006-2009 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.Compilation -{ - [AttributeUsage (AttributeTargets.Class)] - public sealed class BuildProviderAppliesToAttribute : Attribute - { - BuildProviderAppliesTo appliesTo; - - public BuildProviderAppliesToAttribute (BuildProviderAppliesTo appliesTo) - { - this.appliesTo = appliesTo; - } - - public BuildProviderAppliesTo AppliesTo { - get { return appliesTo; } - } - } - -} - - diff --git a/mcs/class/System.Web/System.Web.Compilation/DesignTimeResourceProviderFactoryAttribute.cs b/mcs/class/System.Web/System.Web.Compilation/DesignTimeResourceProviderFactoryAttribute.cs deleted file mode 100644 index 4992586135..0000000000 --- a/mcs/class/System.Web/System.Web.Compilation/DesignTimeResourceProviderFactoryAttribute.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// System.Web.Compilation.DesignTimeResourceProviderFactoryAttribute -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2006 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -using System; -using System.CodeDom; -using System.Web.UI; - -namespace System.Web.Compilation { - - [AttributeUsage (AttributeTargets.Class)] - public sealed class DesignTimeResourceProviderFactoryAttribute : Attribute - { - string factoryTypeName; - - public DesignTimeResourceProviderFactoryAttribute (string factoryTypeName) - { - this.factoryTypeName = factoryTypeName; - } - - public DesignTimeResourceProviderFactoryAttribute (System.Type factoryType) - { - this.factoryTypeName = factoryType.AssemblyQualifiedName; - } - - public override bool IsDefaultAttribute () - { - return factoryTypeName == null; - } - - public string FactoryTypeName { - get { return factoryTypeName; } - } - - } - -} - - diff --git a/mcs/class/System.Web/System.Web.Compilation/ExpressionEditorAttribute.cs b/mcs/class/System.Web/System.Web.Compilation/ExpressionEditorAttribute.cs deleted file mode 100644 index 9234a6b42b..0000000000 --- a/mcs/class/System.Web/System.Web.Compilation/ExpressionEditorAttribute.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// System.Web.Compilation.ExpressionEditorAttribute -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2006 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -namespace System.Web.Compilation { - - [AttributeUsage (AttributeTargets.Class)] - public sealed class ExpressionEditorAttribute : Attribute - { - string typeName; - - public ExpressionEditorAttribute (string typeName) - { - this.typeName = typeName; - } - - public ExpressionEditorAttribute (Type type) - { - this.typeName = type.AssemblyQualifiedName; - } - - public string EditorTypeName { - get { return typeName; } - } - - [MonoTODO ("Not implemented")] - public override bool Equals (object obj) - { - throw new NotImplementedException (); - } - - [MonoTODO ("Not implemented")] - public override int GetHashCode () - { - throw new NotImplementedException (); - } - - } -} - - diff --git a/mcs/class/System.Web/System.Web.Compilation/ExpressionPrefixAttribute.cs b/mcs/class/System.Web/System.Web.Compilation/ExpressionPrefixAttribute.cs deleted file mode 100644 index edea592bc3..0000000000 --- a/mcs/class/System.Web/System.Web.Compilation/ExpressionPrefixAttribute.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// System.Web.Compilation.ExpressionPrefixAttribute -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2006 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -namespace System.Web.Compilation { - - [AttributeUsage (AttributeTargets.Class)] - public sealed class ExpressionPrefixAttribute : Attribute - { - string expressionPrefix; - - public ExpressionPrefixAttribute (string expressionPrefix) - { - this.expressionPrefix = expressionPrefix; - } - - public string ExpressionPrefix { - get { return expressionPrefix; } - } - } -} - - diff --git a/mcs/class/System.Web/System.Web.Compilation/FolderLevelBuildProviderAppliesTo.cs b/mcs/class/System.Web/System.Web.Compilation/FolderLevelBuildProviderAppliesTo.cs deleted file mode 100644 index 9a03ab29cb..0000000000 --- a/mcs/class/System.Web/System.Web.Compilation/FolderLevelBuildProviderAppliesTo.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// Authors: -// Marek Habersack -// -// (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; - -namespace System.Web.Compilation -{ - [FlagsAttribute] - public enum FolderLevelBuildProviderAppliesTo - { - None = 0x00, - Code = 0x01, - WebReferences = 0x02, - LocalResources = 0x04, - GlobalResources = 0x08 - } -} diff --git a/mcs/class/System.Web/System.Web.Compilation/FolderLevelBuildProviderAppliesToAttribute.cs b/mcs/class/System.Web/System.Web.Compilation/FolderLevelBuildProviderAppliesToAttribute.cs deleted file mode 100644 index 3e1db0781b..0000000000 --- a/mcs/class/System.Web/System.Web.Compilation/FolderLevelBuildProviderAppliesToAttribute.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// Authors: -// Marek Habersack -// -// (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; - -namespace System.Web.Compilation -{ - [AttributeUsage (AttributeTargets.Class, AllowMultiple = false)] - public sealed class FolderLevelBuildProviderAppliesToAttribute : Attribute - { - public FolderLevelBuildProviderAppliesTo AppliesTo { - get; private set; - } - - public FolderLevelBuildProviderAppliesToAttribute (FolderLevelBuildProviderAppliesTo appliesTo) - { - this.AppliesTo = appliesTo; - } - } -} diff --git a/mcs/class/System.Web/System.Web.Compilation/IAssemblyPostProcessor.cs b/mcs/class/System.Web/System.Web.Compilation/IAssemblyPostProcessor.cs deleted file mode 100644 index 5c1d4fc758..0000000000 --- a/mcs/class/System.Web/System.Web.Compilation/IAssemblyPostProcessor.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.Compilation.IAssemblyPostProcessor -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2006-2009 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.Compilation -{ - public interface IAssemblyPostProcessor : IDisposable - { - void PostProcessAssembly (string path); - } -} - - diff --git a/mcs/class/System.Web/System.Web.Compilation/IImplicitResourceProvider.cs b/mcs/class/System.Web/System.Web.Compilation/IImplicitResourceProvider.cs deleted file mode 100644 index bb204bd5ed..0000000000 --- a/mcs/class/System.Web/System.Web.Compilation/IImplicitResourceProvider.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// System.Web.Compilation.IImplicitResourceProvider.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - - - -using System.Collections; -using System.Globalization; - -namespace System.Web.Compilation -{ - public interface IImplicitResourceProvider - { - object GetObject (ImplicitResourceKey key, CultureInfo culture); - ICollection GetImplicitResourceKeys (string keyPrefix); - } -} - diff --git a/mcs/class/System.Web/System.Web.Compilation/ImplicitResourceKey.cs b/mcs/class/System.Web/System.Web.Compilation/ImplicitResourceKey.cs deleted file mode 100644 index 4f3357a512..0000000000 --- a/mcs/class/System.Web/System.Web.Compilation/ImplicitResourceKey.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// System.Web.Compilation.IImplicitResourceProvider.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.Compilation -{ - public sealed class ImplicitResourceKey - { - string filter; - string keyPrefix; - string property; - - public ImplicitResourceKey (string filter, string keyPrefix, string property) - { - this.filter = filter; - this.keyPrefix = keyPrefix; - this.property = property; - } - - public ImplicitResourceKey () - { - } - - public string Filter { - get { return filter; } - set { filter = value; } - } - - public string KeyPrefix { - get { return keyPrefix; } - set { keyPrefix = value; } - } - - public string Property { - get { return property; } - set { property = value; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/AdapterDictionary.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/AdapterDictionary.cs deleted file mode 100644 index bddb7215b3..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/AdapterDictionary.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// System.Web.Configuration.AdapterDictionary -// -// Authors: -// Lluis Sanchez Gual (lluis@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.Collections.Specialized; -using System.Runtime.Serialization; - -namespace System.Web.Configuration -{ - [Serializable] - public class AdapterDictionary: OrderedDictionary, IDeserializationCallback - { - public string this [string key] { - get { return (string) base [key]; } - set { base [key] = value; } - } - - [MonoTODO ("Not implemented")] - void IDeserializationCallback.OnDeserialization (object sender) - { - throw new NotImplementedException (); - } - } -} - diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/AuthenticationMode.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/AuthenticationMode.cs deleted file mode 100644 index a42b964a01..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/AuthenticationMode.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.Configuration.AuthenticationMode.cs -// -// Authors: -// Miguel de Icaza (miguel@novell.com) -// -// (C) 2005 Novell, Inc. -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.Configuration { - public enum AuthenticationMode { - None, - Windows, - Passport, - Forms - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationRuleAction.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationRuleAction.cs deleted file mode 100644 index 9f8aef49e1..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationRuleAction.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// System.Web.Configuration.AuthorizationRuleAction.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.Configuration -{ - public enum AuthorizationRuleAction - { - Deny, - Allow - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/CustomErrorsMode.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/CustomErrorsMode.cs deleted file mode 100644 index 174484f459..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/CustomErrorsMode.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.Configuration.CustomErrorsMode.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.Configuration -{ - public enum CustomErrorsMode - { - RemoteOnly, - On, - Off - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/CustomErrorsRedirectMode.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/CustomErrorsRedirectMode.cs deleted file mode 100644 index 49656c0b0d..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/CustomErrorsRedirectMode.cs +++ /dev/null @@ -1,37 +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; - -namespace System.Web.Configuration -{ - public enum CustomErrorsRedirectMode - { - ResponseRedirect, - ResponseRewrite - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/FormsAuthPasswordFormat.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/FormsAuthPasswordFormat.cs deleted file mode 100644 index 5ac12e1b51..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/FormsAuthPasswordFormat.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.Configuration.FormsAuthPasswordFormat.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.Configuration { - - public enum FormsAuthPasswordFormat - { - Clear, - SHA1, - MD5 - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/FormsProtectionEnum.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/FormsProtectionEnum.cs deleted file mode 100644 index 2b14f121be..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/FormsProtectionEnum.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.Configuration.FormsProtectionEnum.cs -// -// Author: -// Gonzalo Paniagua Javier -// -// 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. -// - -namespace System.Web.Configuration { - public enum FormsProtectionEnum { - All, - None, - Encryption, - Validation - } -} - diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/IConfigMapPath.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/IConfigMapPath.cs deleted file mode 100644 index e81a4e5b17..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/IConfigMapPath.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.IConfigMapPath -// -// Authors: -// Marek Habersack (mhabersack@novell.com) -// -// (C) 2007 Novell, Inc -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; - -namespace System.Web.Configuration -{ - public interface IConfigMapPath - { - string GetAppPathForPath (string siteID, string path); - void GetDefaultSiteNameAndID (out string siteName, out string siteID); - string GetMachineConfigFilename (); - void GetPathConfigFilename (string siteID, string path, out string directory, out string baseName); - string GetRootWebConfigFilename (); - string MapPath (string siteID, string path); - void ResolveSiteArgument (string siteArgument, out string siteName, out string siteID); - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/IConfigMapPathFactory.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/IConfigMapPathFactory.cs deleted file mode 100644 index 3220f0aab2..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/IConfigMapPathFactory.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.HttpCacheVaryByContentEncodings -// -// Authors: -// Marek Habersack (mhabersack@novell.com) -// -// (C) 2007 Novell, Inc -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Collections.Generic; -using System.Security.Permissions; - -namespace System.Web.Configuration -{ - public interface IConfigMapPathFactory - { - IConfigMapPath Create (string virtualPath, string physicalPath); - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/IRemoteWebConfigurationHostServer.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/IRemoteWebConfigurationHostServer.cs deleted file mode 100644 index f47b0fd018..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/IRemoteWebConfigurationHostServer.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// System.Web.Configuration.IRemoteWebConfigurationHostServer.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -using System.Resources; -using System.Runtime.InteropServices; - -namespace System.Web.Configuration -{ - [ComVisibleAttribute (true)] - [GuidAttribute ("A99B591A-23C6-4238-8452-C7B0E895063D")] - public interface IRemoteWebConfigurationHostServer - { - string DoEncryptOrDecrypt ( - bool do_encrypt, string xml_string, string protection_provider_name, - string protection_provider_type, string [] params_keys, string [] param_values); - - byte [] GetData (string filename, bool getReadTimeOnly, out long readTime); - - void GetFileDetails (string name, out bool exists, out long size, out long create_data, out long last_write_date); - - string GetFilePaths (int webLevel, string path, string site, string locationSubPath); - - void WriteData (string fileName, string templateFileName, byte [] data, ref long readTime); - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/MachineKeyCompatibilityMode.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/MachineKeyCompatibilityMode.cs deleted file mode 100644 index 38c5e55eaf..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/MachineKeyCompatibilityMode.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// System.Web.Configuration.MachineKeyCompatibilityMode -// -// Authors: -// Sebastien Pouliot -// -// Copyright (C) 2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.Configuration { - - public enum MachineKeyCompatibilityMode { - Framework20SP1 = 0, - Framework20SP2 = 1 - } -} - diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/MachineKeyValidation.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/MachineKeyValidation.cs deleted file mode 100644 index 47d7ef1be8..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/MachineKeyValidation.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.Configuration.MachineKeyValidation.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004, 2010 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.Configuration -{ - public - enum MachineKeyValidation - { - MD5 = 0, - SHA1 = 1, - TripleDES = 2, - AES = 3, - HMACSHA256 = 4, - HMACSHA384 = 5, - HMACSHA512 = 6, - Custom = 7 - } -} - diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/PagesEnableSessionState.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/PagesEnableSessionState.cs deleted file mode 100644 index fd4b3f9a33..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/PagesEnableSessionState.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.Configuration.PagesEnableSessionState.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -using System.Resources; - -namespace System.Web.Configuration -{ - public - enum PagesEnableSessionState - { - False = 0, - ReadOnly = 1, - True = 2 - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/ProcessModelComAuthenticationLevel.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/ProcessModelComAuthenticationLevel.cs deleted file mode 100644 index 5fc0be9795..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/ProcessModelComAuthenticationLevel.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.Configuration.ProcessModelComAuthenticationLevel.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.Configuration -{ - public enum ProcessModelComAuthenticationLevel - { - None, - Call, - Connect, - Default, - Pkt, - PktIntegrity, - PktPrivacy - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/ProcessModelComImpersonationLevel.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/ProcessModelComImpersonationLevel.cs deleted file mode 100644 index dbc587fa83..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/ProcessModelComImpersonationLevel.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.Configuration.ProcessModelComImpersonationLevel.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.Configuration -{ - public enum ProcessModelComImpersonationLevel - { - Default, - Anonymous, - Delegate, - Identify, - Impersonate - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/ProcessModelLogLevel.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/ProcessModelLogLevel.cs deleted file mode 100644 index 8c48062717..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/ProcessModelLogLevel.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.Configuration.ProcessModelLogLevel.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.Configuration -{ - public enum ProcessModelLogLevel - { - None, - All, - Errors - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/SerializationMode.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/SerializationMode.cs deleted file mode 100644 index 05ba2c86e3..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/SerializationMode.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.Configuration.SerializationMode.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -using System.Resources; - -namespace System.Web.Configuration -{ - public enum SerializationMode - { - String = 0, - Xml = 1, - Binary = 2, - ProviderSpecific = 3 - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/SystemWebCachingSectionGroup.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/SystemWebCachingSectionGroup.cs deleted file mode 100644 index 3451f503c3..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/SystemWebCachingSectionGroup.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// System.Web.Configuration.SystemWebCachingSectionGroup -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Configuration; - - -namespace System.Web.Configuration { - - public sealed class SystemWebCachingSectionGroup : ConfigurationSectionGroup - { - [ConfigurationProperty ("cache")] - public CacheSection Cache { - get { return (CacheSection) Sections ["cache"];} - } - - [ConfigurationProperty ("outputCache")] - public OutputCacheSection OutputCache { - get { return (OutputCacheSection) Sections ["outputCache"];} - } - - [ConfigurationProperty ("outputCacheSettings")] - public OutputCacheSettingsSection OutputCacheSettings { - get { return (OutputCacheSettingsSection) Sections ["outputCacheSettings"];} - } - - [ConfigurationProperty ("sqlCacheDependency")] - public SqlCacheDependencySection SqlCacheDependency { - get { return (SqlCacheDependencySection) Sections ["sqlCacheDependency"];} - } - - } - -} - - diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/TraceDisplayMode.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/TraceDisplayMode.cs deleted file mode 100644 index e3dc7170b2..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/TraceDisplayMode.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.Configuration.TraceDisplayMode.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -using System.Resources; - -namespace System.Web.Configuration -{ - public enum TraceDisplayMode - { - SortByTime = 1, - SortByCategory = 2 - } -} diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/WebApplicationLevel.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/WebApplicationLevel.cs deleted file mode 100644 index a70dd9ade8..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/WebApplicationLevel.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.Configuration.WebApplicationLevel enum -// -// Author: -// Sebastien Pouliot -// -// 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. -// - - -namespace System.Web.Configuration { - - public enum WebApplicationLevel { - AboveApplication = 10, - AtApplication = 20, - BelowApplication = 30 - } -} - diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/XhtmlConformanceMode.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/XhtmlConformanceMode.cs deleted file mode 100644 index 279e0fe93f..0000000000 --- a/mcs/class/System.Web/System.Web.Configuration_2.0/XhtmlConformanceMode.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.Configuration.XhtmlConformanceMode.cs -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.Configuration -{ - public enum XhtmlConformanceMode - { - Transitional, - Legacy, - Strict - } -} diff --git a/mcs/class/System.Web/System.Web.Hosting/IApplicationHost.cs b/mcs/class/System.Web/System.Web.Hosting/IApplicationHost.cs deleted file mode 100644 index ae6eb685c9..0000000000 --- a/mcs/class/System.Web/System.Web.Hosting/IApplicationHost.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// System.Web.IConfigMapPath -// -// Authors: -// Marek Habersack (mhabersack@novell.com) -// -// (C) 2009 Novell, Inc -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Security.Permissions; -using System.Web.Configuration; - -namespace System.Web.Hosting -{ - [AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] - [AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public interface IApplicationHost - { - IConfigMapPathFactory GetConfigMapPathFactory (); - IntPtr GetConfigToken (); - string GetPhysicalPath (); - string GetSiteID (); - string GetSiteName (); - string GetVirtualPath (); - void MessageReceived (); - } -} diff --git a/mcs/class/System.Web/System.Web.Hosting/IRegisteredObject.cs b/mcs/class/System.Web/System.Web.Hosting/IRegisteredObject.cs deleted file mode 100644 index 4a309494b9..0000000000 --- a/mcs/class/System.Web/System.Web.Hosting/IRegisteredObject.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.Hosting.IRegisteredObject.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -using System; -using System.Runtime.InteropServices; - -namespace System.Web.Hosting -{ - public interface IRegisteredObject - { - void Stop (bool immediate); - } -} diff --git a/mcs/class/System.Web/System.Web.Profile/ProfileEventArgs.cs b/mcs/class/System.Web/System.Web.Profile/ProfileEventArgs.cs deleted file mode 100644 index 5e4813b958..0000000000 --- a/mcs/class/System.Web/System.Web.Profile/ProfileEventArgs.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// System.Web.UI.WebControls.ProfileEventArgs.cs -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.Profile -{ - - public sealed class ProfileEventArgs : EventArgs - { - public ProfileEventArgs (HttpContext context) - { - this.context = context; - } - - public HttpContext Context { - get { - return context; - } - } - - public ProfileBase Profile { - get { - return profile; - } - set { - profile = value; - } - } - - ProfileBase profile; - HttpContext context; - } - -} - diff --git a/mcs/class/System.Web/System.Web.Profile/ProfileEventHandler.cs b/mcs/class/System.Web/System.Web.Profile/ProfileEventHandler.cs deleted file mode 100644 index 8ee7aaae5a..0000000000 --- a/mcs/class/System.Web/System.Web.Profile/ProfileEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.ProfileEventHandler.cs -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.Profile -{ - public delegate void ProfileEventHandler (object sender, ProfileEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.Profile/ProfileGroupBase.cs b/mcs/class/System.Web/System.Web.Profile/ProfileGroupBase.cs deleted file mode 100644 index 9ac173f75d..0000000000 --- a/mcs/class/System.Web/System.Web.Profile/ProfileGroupBase.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// System.Web.UI.WebControls.ProfileGroupBase.cs -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// Vladimir Krasnov (vladimirk@mainsoft.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Configuration; - -namespace System.Web.Profile -{ - public class ProfileGroupBase - { - ProfileBase _parent = null; - string _name = null; - - public ProfileGroupBase () - { - } - - public void Init (ProfileBase parent, string myName) - { - _parent = parent; - _name = myName; - } - - public object GetPropertyValue (string propertyName) - { - return _parent.GetPropertyValue (_name + "." + propertyName); - } - - public void SetPropertyValue (string propertyName, object propertyValue) - { - _parent.SetPropertyValue (_name + "." + propertyName, propertyValue); - } - - public object this [string propertyName] { - get { - return GetPropertyValue (propertyName); - } - set { - SetPropertyValue (propertyName, value); - } - } - } -} - diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/HttpMethodConstraint.cs b/mcs/class/System.Web/System.Web.Routing/HttpMethodConstraint.cs similarity index 100% rename from mcs/class/System.Web.Routing/System.Web.Routing/HttpMethodConstraint.cs rename to mcs/class/System.Web/System.Web.Routing/HttpMethodConstraint.cs diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/PatternParser.cs b/mcs/class/System.Web/System.Web.Routing/PatternParser.cs similarity index 100% rename from mcs/class/System.Web.Routing/System.Web.Routing/PatternParser.cs rename to mcs/class/System.Web/System.Web.Routing/PatternParser.cs diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/PatternToken.cs b/mcs/class/System.Web/System.Web.Routing/PatternToken.cs similarity index 100% rename from mcs/class/System.Web.Routing/System.Web.Routing/PatternToken.cs rename to mcs/class/System.Web/System.Web.Routing/PatternToken.cs diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/PatternTokenType.cs b/mcs/class/System.Web/System.Web.Routing/PatternTokenType.cs similarity index 100% rename from mcs/class/System.Web.Routing/System.Web.Routing/PatternTokenType.cs rename to mcs/class/System.Web/System.Web.Routing/PatternTokenType.cs diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/Route.cs b/mcs/class/System.Web/System.Web.Routing/Route.cs similarity index 100% rename from mcs/class/System.Web.Routing/System.Web.Routing/Route.cs rename to mcs/class/System.Web/System.Web.Routing/Route.cs diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs b/mcs/class/System.Web/System.Web.Routing/RouteCollection.cs similarity index 99% rename from mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs rename to mcs/class/System.Web/System.Web.Routing/RouteCollection.cs index d53c063441..a8ae41da81 100644 --- a/mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs +++ b/mcs/class/System.Web/System.Web.Routing/RouteCollection.cs @@ -107,8 +107,10 @@ namespace System.Web.Routing protected override void ClearItems () { - lock (GetWriteLock ()) + lock (GetWriteLock ()) { base.ClearItems (); + d.Clear (); + } } public IDisposable GetReadLock () diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/RouteData.cs b/mcs/class/System.Web/System.Web.Routing/RouteData.cs similarity index 100% rename from mcs/class/System.Web.Routing/System.Web.Routing/RouteData.cs rename to mcs/class/System.Web/System.Web.Routing/RouteData.cs diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/RouteValueDictionaryExtensions.cs b/mcs/class/System.Web/System.Web.Routing/RouteValueDictionaryExtensions.cs similarity index 100% rename from mcs/class/System.Web.Routing/System.Web.Routing/RouteValueDictionaryExtensions.cs rename to mcs/class/System.Web/System.Web.Routing/RouteValueDictionaryExtensions.cs diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/StopRoutingHandler.cs b/mcs/class/System.Web/System.Web.Routing/StopRoutingHandler.cs similarity index 100% rename from mcs/class/System.Web.Routing/System.Web.Routing/StopRoutingHandler.cs rename to mcs/class/System.Web/System.Web.Routing/StopRoutingHandler.cs diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/UrlRoutingHandler.cs b/mcs/class/System.Web/System.Web.Routing/UrlRoutingHandler.cs similarity index 100% rename from mcs/class/System.Web.Routing/System.Web.Routing/UrlRoutingHandler.cs rename to mcs/class/System.Web/System.Web.Routing/UrlRoutingHandler.cs diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/UrlRoutingModule.cs b/mcs/class/System.Web/System.Web.Routing/UrlRoutingModule.cs similarity index 100% rename from mcs/class/System.Web.Routing/System.Web.Routing/UrlRoutingModule.cs rename to mcs/class/System.Web/System.Web.Routing/UrlRoutingModule.cs diff --git a/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs b/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs index ab273d4970..491d74f6c4 100644 --- a/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs +++ b/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs @@ -213,22 +213,19 @@ namespace System.Web.Security DateTime now = DateTime.Now; DateTime then; - if (createPersistentCookie) - then = now.AddYears (50); - else - then = now.AddMinutes (timeout); + if (createPersistentCookie) + then = now.AddMinutes(timeout); + else + then = DateTime.MinValue; FormsAuthenticationTicket ticket = new FormsAuthenticationTicket (1, userName, now, - then, + createPersistentCookie?then:now.AddYears (50), createPersistentCookie, String.Empty, cookiePath); - if (!createPersistentCookie) - then = DateTime.MinValue; - HttpCookie cookie = new HttpCookie (cookieName, Encrypt (ticket), strCookiePath, then); if (requireSSL) cookie.Secure = true; diff --git a/mcs/class/System.Web/System.Web.Security/FormsAuthenticationEventArgs.cs b/mcs/class/System.Web/System.Web.Security/FormsAuthenticationEventArgs.cs deleted file mode 100644 index c1fc437c4f..0000000000 --- a/mcs/class/System.Web/System.Web.Security/FormsAuthenticationEventArgs.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// System.Web.Security.FormsAuthenticationEventArgs -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2002 Ximian, Inc (http://www.ximian.com) -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Security.Permissions; -using System.Security.Principal; - -namespace System.Web.Security -{ - // CAS - no InheritanceDemand here as the class is sealed - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public sealed class FormsAuthenticationEventArgs : EventArgs - { - IPrincipal user; - HttpContext context; - - public FormsAuthenticationEventArgs (HttpContext context) - { - this.context = context; - } - - public HttpContext Context - { - get { - return context; - } - } - - public IPrincipal User - { - get { - return user; - } - - [SecurityPermission (SecurityAction.Demand, ControlPrincipal = true)] - set { - user = value; - } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.Security/FormsAuthenticationEventHandler.cs b/mcs/class/System.Web/System.Web.Security/FormsAuthenticationEventHandler.cs deleted file mode 100644 index 710aa55ad1..0000000000 --- a/mcs/class/System.Web/System.Web.Security/FormsAuthenticationEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.Security.FormsAuthenticationEventHandler -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2002 Ximian, Inc (http://www.ximian.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.Web.Security -{ - public delegate void FormsAuthenticationEventHandler (object sender, FormsAuthenticationEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.Security/PassportAuthenticationEventArgs.cs b/mcs/class/System.Web/System.Web.Security/PassportAuthenticationEventArgs.cs deleted file mode 100644 index 292e815803..0000000000 --- a/mcs/class/System.Web/System.Web.Security/PassportAuthenticationEventArgs.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// System.Web.Security.PassportAuthenticationEventArgs -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2002 Ximian, Inc (http://www.ximian.com) -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Security.Permissions; -using System.Security.Principal; - -namespace System.Web.Security -{ - // CAS - no InheritanceDemand here as the class is sealed - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - [Obsolete ("This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")] - public sealed class PassportAuthenticationEventArgs : EventArgs - { - PassportIdentity identity; - HttpContext context; - IPrincipal user; - - public PassportAuthenticationEventArgs (PassportIdentity identity, HttpContext context) - { - this.identity = identity; - this.context = context; - } - - public HttpContext Context - { - get { - return context; - } - } - - public PassportIdentity Identity - { - get { - return identity; - } - } - - public IPrincipal User - { - get { - return user; - } - - [SecurityPermission (SecurityAction.Demand, ControlPrincipal = true)] - set { - user = value; - } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.Security/PassportAuthenticationEventHandler.cs b/mcs/class/System.Web/System.Web.Security/PassportAuthenticationEventHandler.cs deleted file mode 100644 index 3cad8b5640..0000000000 --- a/mcs/class/System.Web/System.Web.Security/PassportAuthenticationEventHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.Security.PassportAuthenticationEventHandler -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2002 Ximian, Inc (http://www.ximian.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.Web.Security -{ - [Obsolete ("This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")] - public delegate void PassportAuthenticationEventHandler (object sender, - PassportAuthenticationEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.Security/RoleManagerEventArgs.cs b/mcs/class/System.Web/System.Web.Security/RoleManagerEventArgs.cs deleted file mode 100644 index 874e817351..0000000000 --- a/mcs/class/System.Web/System.Web.Security/RoleManagerEventArgs.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// System.Web.Security.RoleManagerEventArgs -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; -using System.Collections.Specialized; -using System.Text; - -namespace System.Web.Security { - public sealed class RoleManagerEventArgs : EventArgs { - public RoleManagerEventArgs (HttpContext context) - { - this.context = context; - } - - HttpContext context; - public HttpContext Context { - get { return context; } - } - - bool rolesPopulated; - public bool RolesPopulated { - get { return rolesPopulated; } - set { rolesPopulated = value; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.Security/RoleManagerEventHandler.cs b/mcs/class/System.Web/System.Web.Security/RoleManagerEventHandler.cs deleted file mode 100644 index ad0cabe7eb..0000000000 --- a/mcs/class/System.Web/System.Web.Security/RoleManagerEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.Security.RoleManagerEventHandler -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web.Security { - public delegate void RoleManagerEventHandler (object sender, RoleManagerEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.Security/WindowsAuthenticationEventArgs.cs b/mcs/class/System.Web/System.Web.Security/WindowsAuthenticationEventArgs.cs deleted file mode 100644 index 519ab293bf..0000000000 --- a/mcs/class/System.Web/System.Web.Security/WindowsAuthenticationEventArgs.cs +++ /dev/null @@ -1,76 +0,0 @@ -// -// System.Web.Security.WindowsAuthenticationEventArgs -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2002 Ximian, Inc (http://www.ximian.com) -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Security.Permissions; -using System.Security.Principal; - -namespace System.Web.Security -{ - // CAS - no InheritanceDemand here as the class is sealed - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public sealed class WindowsAuthenticationEventArgs : EventArgs - { - WindowsIdentity identity; - HttpContext context; - IPrincipal user; - - public WindowsAuthenticationEventArgs (WindowsIdentity identity, HttpContext context) - { - this.identity = identity; - this.context = context; - } - - public System.Web.HttpContext Context - { - get { - return context; - } - } - - public WindowsIdentity Identity - { - get { - return identity; - } - } - - public IPrincipal User - { - get { - return user; - } - - [SecurityPermission (SecurityAction.Demand, ControlPrincipal = true)] - set { - user = value; - } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.Security/WindowsAuthenticationEventHandler.cs b/mcs/class/System.Web/System.Web.Security/WindowsAuthenticationEventHandler.cs deleted file mode 100644 index 29b67e2478..0000000000 --- a/mcs/class/System.Web/System.Web.Security/WindowsAuthenticationEventHandler.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// System.Web.Security.WindowsAuthenticationEventHandler -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2002 Ximian, Inc (http://www.ximian.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.Web.Security -{ - public delegate void WindowsAuthenticationEventHandler (object sender, - WindowsAuthenticationEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.SessionState_2.0/IReadOnlySessionState.cs b/mcs/class/System.Web/System.Web.SessionState_2.0/IReadOnlySessionState.cs deleted file mode 100644 index 5d71a0d86b..0000000000 --- a/mcs/class/System.Web/System.Web.SessionState_2.0/IReadOnlySessionState.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// System.Web.SessionState.IReadOnlySessionState -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2002 Ximian, Inc (http://www.ximian.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.Web.SessionState { -public interface IReadOnlySessionState : IRequiresSessionState -{ -} -} - diff --git a/mcs/class/System.Web/System.Web.SessionState_2.0/IRequiresSessionState.cs b/mcs/class/System.Web/System.Web.SessionState_2.0/IRequiresSessionState.cs deleted file mode 100644 index 4d0264d198..0000000000 --- a/mcs/class/System.Web/System.Web.SessionState_2.0/IRequiresSessionState.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// System.Web.SessionState.IRequiresSessionState -// -// Authors: -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// -// (C) 2002 Ximian, Inc (http://www.ximian.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.Web.SessionState { -public interface IRequiresSessionState -{ -} -} - diff --git a/mcs/class/System.Web/System.Web.SessionState_2.0/SessionStateBehavior.cs b/mcs/class/System.Web/System.Web.SessionState_2.0/SessionStateBehavior.cs deleted file mode 100644 index 488104f288..0000000000 --- a/mcs/class/System.Web/System.Web.SessionState_2.0/SessionStateBehavior.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// -// Authors: -// Marek Habersack -// - -// -// Copyright (C) 2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; - -namespace System.Web.SessionState -{ - public enum SessionStateBehavior - { - Default, - Required, - ReadOnly, - Disabled - } -} diff --git a/mcs/class/System.Web/System.Web.UI.Adapters/WmlPostFieldType.cs b/mcs/class/System.Web/System.Web.UI.Adapters/WmlPostFieldType.cs deleted file mode 100644 index c1cb48028b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.Adapters/WmlPostFieldType.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.Adapters.WmlPostFieldType.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.Adapters { - public enum WmlPostFieldType { - Normal = 0, - Submit = 1, - Variable = 2, - Raw = 3 - } -} - - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/ITrackingPersonalizable.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/ITrackingPersonalizable.cs deleted file mode 100644 index bbb78fa03a..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/ITrackingPersonalizable.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.ITrackingPersonalizable.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -using System.Collections.Specialized; - -namespace System.Web.UI.WebControls.WebParts -{ - public interface ITrackingPersonalizable - { - void BeginLoad (); - void BeginSave (); - void EndLoad (); - void EndSave (); - - bool TracksChanges { get; } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/ITransformerConfigurationControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/ITransformerConfigurationControl.cs deleted file mode 100644 index bae77eff99..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/ITransformerConfigurationControl.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.ITransformerConfigurationControl.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -namespace System.Web.UI.WebControls.WebParts -{ - public interface ITransformerConfigurationControl - { - event EventHandler Cancelled; - event EventHandler Succeeded; - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IVersioningPersonalizable.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IVersioningPersonalizable.cs deleted file mode 100644 index 861d633cad..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IVersioningPersonalizable.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.IVersioningPersonalizable.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -using System.Collections; - -namespace System.Web.UI.WebControls.WebParts -{ - public interface IVersioningPersonalizable - { - void Load (IDictionary unknownProperties); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebEditable.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebEditable.cs deleted file mode 100644 index f0c2f51dd4..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebEditable.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.IWebEditable.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -namespace System.Web.UI.WebControls.WebParts -{ - public interface IWebEditable - { - EditorPartCollection CreateEditorParts (); - - object WebBrowsableObject { get; } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPart.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPart.cs deleted file mode 100644 index 5ccf191cf9..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPart.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.IWebPart.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -namespace System.Web.UI.WebControls.WebParts -{ - public interface IWebPart - { - string CatalogIconImageUrl { get; set; } - string Description { get; set; } - string Subtitle { get; } - string Title { get; set; } - string TitleIconImageUrl { get; set; } - string TitleUrl { get; set; } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartField.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartField.cs deleted file mode 100644 index 94f7d45e1c..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartField.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.IWebPartField.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -using System.ComponentModel; - -namespace System.Web.UI.WebControls.WebParts -{ - public interface IWebPartField - { - void GetFieldValue (FieldCallback callback); - PropertyDescriptor Schema { get; } - } - - public delegate void FieldCallback (object fieldValue); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartHttpHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartHttpHandler.cs deleted file mode 100644 index d9b7ca9fe5..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartHttpHandler.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.IWebPartHttpHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -namespace System.Web.UI.WebControls.WebParts -{ - public interface IWebPartHttpHandler - { - PersonalizationScope DesiredScope { get; } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartParameters.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartParameters.cs deleted file mode 100644 index 739c9751c9..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartParameters.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.IWebPartParameters.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -using System.ComponentModel; -using System.Collections; - -namespace System.Web.UI.WebControls.WebParts -{ - public interface IWebPartParameters - { - void SetConsumerSchema (PropertyDescriptorCollection schema); - - void GetParametersData (ParametersCallback callback); - PropertyDescriptorCollection Schema { get; } - } - - public delegate void ParametersCallback (IDictionary parametersData); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartRow.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartRow.cs deleted file mode 100644 index f5bcdcd5fa..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartRow.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.IWebPartRow.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -using System.ComponentModel; - -namespace System.Web.UI.WebControls.WebParts -{ - public interface IWebPartRow - { - void GetRowData (RowCallback callback); - PropertyDescriptorCollection Schema { get; } - } - - public delegate void RowCallback (object rowData); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartTable.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartTable.cs deleted file mode 100644 index 74fac3a2c6..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/IWebPartTable.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.IWebPartTable.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - - -using System.Collections; -using System.ComponentModel; - -namespace System.Web.UI.WebControls.WebParts -{ - public interface IWebPartTable - { - PropertyDescriptorCollection Schema { get; } - void GetTableData (TableCallback callback); - } - - public delegate void TableCallback (ICollection tableData); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PartChromeState.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PartChromeState.cs deleted file mode 100644 index 034a7e53b1..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PartChromeState.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.PartChromeState.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls.WebParts { - public enum PartChromeState { - Normal = 0, - Minimized = 1 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PartChromeType.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PartChromeType.cs deleted file mode 100644 index d8a22ab140..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PartChromeType.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.PartChromeType.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls.WebParts { - public enum PartChromeType { - Default = 0, - TitleAndBorder = 1, - None = 2, - TitleOnly = 3, - BorderOnly = 4 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PersonalizationScope.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PersonalizationScope.cs deleted file mode 100644 index e951ca26e2..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PersonalizationScope.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.PersonalizationScope.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls.WebParts { - public enum PersonalizationScope { - User = 0, - Shared = 1 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartAuthorizationEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartAuthorizationEventHandler.cs deleted file mode 100644 index bfa5bb1a36..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartAuthorizationEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.WebPartAuthorizationEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls.WebParts { - public delegate void WebPartAuthorizationEventHandler (object source, WebPartAuthorizationEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartCancelEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartCancelEventArgs.cs deleted file mode 100644 index 6c082fa1dc..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartCancelEventArgs.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.WebPartCancelEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.ComponentModel; - -namespace System.Web.UI.WebControls.WebParts -{ - public class WebPartCancelEventArgs : CancelEventArgs - { - WebPart part; - - public WebPartCancelEventArgs (WebPart part) - { - this.part = part; - } - - public WebPart WebPart { - get { return part; } - set { part = value; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartCancelEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartCancelEventHandler.cs deleted file mode 100644 index 74b22bd478..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartCancelEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.WebPartCancelEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls.WebParts { - public delegate void WebPartCancelEventHandler (object source, WebPartCancelEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartEventArgs.cs deleted file mode 100644 index d033e6a26f..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartEventArgs.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.WebPartEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -namespace System.Web.UI.WebControls.WebParts -{ - public class WebPartEventArgs : EventArgs - { - WebPart part; - - public WebPartEventArgs (WebPart part) - { - this.part = part; - } - - public WebPart WebPart { - get { return part; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartEventHandler.cs deleted file mode 100644 index a57c67d572..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.WebPartEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls.WebParts { - public delegate void WebPartEventHandler (object source, WebPartEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartExportMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartExportMode.cs deleted file mode 100644 index c761b46ce5..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartExportMode.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.WebPartExportMode.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls.WebParts { - public enum WebPartExportMode { - None = 0, - All = 1, - NonSensitiveData = 2 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartHelpMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartHelpMode.cs deleted file mode 100644 index cb5acaa22f..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartHelpMode.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.WebPartHelpMode.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls.WebParts { - public enum WebPartHelpMode { - Modal = 0, - Modeless = 1, - Navigate = 2 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartVerbsEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartVerbsEventArgs.cs deleted file mode 100644 index 3a33897f8f..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartVerbsEventArgs.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.WebPartVerbsEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -namespace System.Web.UI.WebControls.WebParts -{ - public class WebPartVerbsEventArgs : EventArgs - { - WebPartVerbCollection verbs; - - public WebPartVerbsEventArgs () - {} - - public WebPartVerbsEventArgs (WebPartVerbCollection verbs) - { - this.verbs = verbs; - } - - public WebPartVerbCollection Verbs { - get { return verbs; } - set { verbs = value; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartVerbsEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartVerbsEventHandler.cs deleted file mode 100644 index 302abe81c6..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/WebPartVerbsEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.WebParts.WebPartVerbsEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls.WebParts { - public delegate void WebPartVerbsEventHandler (object source, WebPartVerbsEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventHandler.cs deleted file mode 100644 index 87cc6a22d3..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventHandler.cs +++ /dev/null @@ -1,31 +0,0 @@ -// -// System.Web.UI.WebControls.AdCreatedEventHandler -// -// Author: -// Ben Maurer -// -// (c) 2005 Novell -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web.UI.WebControls { - public delegate void AdCreatedEventHandler (object sender, AdCreatedEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AuthenticateEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AuthenticateEventArgs.cs deleted file mode 100644 index 57ecfb8185..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/AuthenticateEventArgs.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// System.Web.UI.WebControls.AuthenticateEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public class AuthenticateEventArgs : EventArgs - { - bool authenticated; - - public AuthenticateEventArgs (): this (false) - { - } - - public AuthenticateEventArgs (bool authenticated) - { - this.authenticated = authenticated; - } - - public bool Authenticated { - get { return authenticated; } - set { authenticated = value; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AuthenticateEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AuthenticateEventHandler.cs deleted file mode 100644 index d7643b4fcd..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/AuthenticateEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.AuthenticateEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void AuthenticateEventHandler (object sender, AuthenticateEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AutoCompleteType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AutoCompleteType.cs deleted file mode 100644 index 2f9adb987b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/AutoCompleteType.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// System.Web.UI.WebControls.AutoCompleteType.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public enum AutoCompleteType - { - None = 0, - Disabled = 1, - Cellular = 2, - Company = 3, - Department = 4, - DisplayName = 5, - Email = 6, - FirstName = 7, - Gender = 8, - HomeCity = 9, - HomeCountryRegion = 10, - HomeFax = 11, - HomePhone = 12, - HomeState = 13, - HomeStreetAddress = 14, - HomeZipCode = 15, - Homepage = 16, - JobTitle = 17, - LastName = 18, - MiddleName = 19, - Notes = 20, - Office = 21, - Pager = 22, - BusinessCity = 23, - BusinessCountryRegion = 24, - BusinessFax = 25, - BusinessPhone = 26, - BusinessState = 27, - BusinessStreetAddress = 28, - BusinessUrl = 29, - BusinessZipCode = 30, - Search = 31, - } -} - - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs deleted file mode 100644 index c3d11efacc..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.UI.WebControls.BorderStyle.cs -// -// Author: -// Dick Porter -// -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public enum BorderStyle - { - NotSet, - None, - Dotted, - Dashed, - Solid, - Double, - Groove, - Ridge, - Inset, - Outset - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BulletedListEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BulletedListEventArgs.cs deleted file mode 100644 index c39ba5daec..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/BulletedListEventArgs.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// System.Web.UI.WebControls.BulletedListEventArgs.cs -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web.UI.WebControls -{ - public class BulletedListEventArgs : EventArgs - { - int index; - - public BulletedListEventArgs (int index) - { - this.index = index; - } - - public int Index { get { return index; } } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BulletedListEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BulletedListEventHandler.cs deleted file mode 100644 index f6a44d2b06..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/BulletedListEventHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.Web.UI.WebControls.BulletedListEventHandler.cs -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web.UI.WebControls -{ - public delegate void BulletedListEventHandler (object sender, BulletedListEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs deleted file mode 100644 index b18eeb933b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.UI.WebControls.ButtonColumnType.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls -{ - public enum ButtonColumnType - { - LinkButton, - PushButton - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ButtonType.cs deleted file mode 100644 index afcaa14fe7..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonType.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.UI.WebControls.ButtonType.cs -// -// Author: Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls -{ - public enum ButtonType - { - Button = 0, - Image = 1, - Link = 2, - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs deleted file mode 100644 index 3820c52ee9..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.WebControls.CalendarSelectionMode.cs -// -// Author: -// Jordi Mas i Hernandez -// -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public enum CalendarSelectionMode - { - None, - Day, - DayWeek, - DayWeekMonth - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs index 905740a1ea..27c3a7fb9d 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs @@ -370,7 +370,11 @@ namespace System.Web.UI.WebControls Page page = Page; string onclick = page != null ? page.ClientScript.GetPostBackEventReference (GetPostBackOptions (), true) : String.Empty; onclick = String.Concat ("setTimeout('", onclick.Replace ("\\", "\\\\").Replace ("'", "\\'"), "', 0)"); - w.AddAttribute (HtmlTextWriterAttribute.Onclick, BuildScriptAttribute ("onclick", onclick)); + if (common_attrs != null && common_attrs ["onclick"] != null) { + onclick = ClientScriptManager.EnsureEndsWithSemicolon (common_attrs ["onclick"]) + onclick; + common_attrs.Remove ("onclick"); + } + w.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick); } if (AccessKey.Length > 0) diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventArgs.cs deleted file mode 100644 index e3cc9439a4..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventArgs.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// System.Web.UI.WebControls.CommandEventArgs.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public class CommandEventArgs : EventArgs - { - object argument; - string name; - - public CommandEventArgs (CommandEventArgs e) - { - this.argument = e.CommandArgument; - this.name = e.CommandName; - } - - public CommandEventArgs (string name, object argument) - { - this.argument = argument; - this.name = name; - } - - public object CommandArgument { - get { return argument; } - } - - public string CommandName { - get { return name; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventHandler.cs deleted file mode 100644 index 1ed9272800..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventHandler.cs +++ /dev/null @@ -1,31 +0,0 @@ -// -// System.Web.UI.WebControls.CommandEventHandler.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public delegate void CommandEventHandler (object sender, CommandEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ContentDirection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ContentDirection.cs deleted file mode 100644 index 7dd164ed3b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ContentDirection.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.UI.WebControls.ContentDirection.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls -{ - public enum ContentDirection - { - NotSet = 0, - LeftToRight = 1, - RightToLeft = 2 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CreateUserErrorEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CreateUserErrorEventArgs.cs deleted file mode 100644 index 580c655aef..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/CreateUserErrorEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// System.Web.UI.WebControls.CreateUserErrorEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System.Web.Security; - -namespace System.Web.UI.WebControls -{ - public class CreateUserErrorEventArgs : EventArgs - { - MembershipCreateStatus status; - - public CreateUserErrorEventArgs (MembershipCreateStatus status) - { - this.status = status; - } - - public MembershipCreateStatus CreateUserError { - get { return status; } - set { status = value; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CreateUserErrorEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CreateUserErrorEventHandler.cs deleted file mode 100644 index 708b20479b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/CreateUserErrorEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.CreateUserErrorEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void CreateUserErrorEventHandler (object sender, CreateUserErrorEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataBoundControlMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataBoundControlMode.cs deleted file mode 100644 index df8d68f735..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataBoundControlMode.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.UI.WebControls.DataBoundControlMode -// -// 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. -// - -namespace System.Web.UI.WebControls -{ - public enum DataBoundControlMode - { - ReadOnly, - Edit, - Insert - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataControlCellType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataControlCellType.cs deleted file mode 100644 index bda308a1e3..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataControlCellType.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// System.Web.UI.WebControls.DataControlCellType.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -namespace System.Web.UI.WebControls -{ - public enum DataControlCellType - { - Header = 0, - Footer = 1, - DataCell = 2 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataControlRowState.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataControlRowState.cs deleted file mode 100644 index cf0ecfad1c..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataControlRowState.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.WebControls.DataControlRowState.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -namespace System.Web.UI.WebControls -{ - [Flags] - public enum DataControlRowState - { - Normal = 0, - Alternate = 1, - Selected = 2, - Edit = 4, - Insert = 8 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataControlRowType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataControlRowType.cs deleted file mode 100644 index 6d02c7955f..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataControlRowType.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.WebControls.DataControlRowType.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -namespace System.Web.UI.WebControls -{ - public enum DataControlRowType - { - Header = 0, - Footer = 1, - DataRow = 2, - Separator = 3, - Pager = 4, - EmptyDataRow = 5 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventArgs.cs deleted file mode 100644 index 8c29dfca54..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventArgs.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// System.Web.UI.WebControls.DataGridCommandEventArgs.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public class DataGridCommandEventArgs : CommandEventArgs - { - DataGridItem item; - object source; - - public DataGridCommandEventArgs (DataGridItem item, object source, CommandEventArgs args) - : base (args) - { - this.item = item; - this.source = source; - } - - public DataGridItem Item { - get { return item; } - } - - public object CommandSource { - get { return source; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventHandler.cs deleted file mode 100644 index a9d198e55a..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.DataGridCommandEventHandler.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public delegate void DataGridCommandEventHandler ( - object sender, - DataGridCommandEventArgs e); - -} \ No newline at end of file diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventArgs.cs deleted file mode 100644 index 54698827e2..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventArgs.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// System.Web.UI.WebControls.DataGridItemEventArgs.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public class DataGridItemEventArgs : EventArgs - { - DataGridItem item; - - public DataGridItemEventArgs (DataGridItem item) - { - this.item = item; - } - - public DataGridItem Item { - get { return item; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventHandler.cs deleted file mode 100644 index 7047c043f8..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.Web.UI.WebControls.DataGridItemEventHandler.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public delegate void DataGridItemEventHandler ( - object sender, - DataGridItemEventArgs e); -} \ No newline at end of file diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventArgs.cs deleted file mode 100644 index fbcccf7774..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// System.Web.UI.WebControls.DataGridPageChangedEventArgs.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public class DataGridPageChangedEventArgs : EventArgs - { - object source; - int index; - - public DataGridPageChangedEventArgs (object source, int index) - { - this.source = source; - this.index = index; - } - - public object CommandSource { - get { return source; } - } - - public int NewPageIndex { - get { return index; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs deleted file mode 100644 index ce8adc8b03..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.Web.UI.WebControls.DataGridPageChangedEventHandler.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public delegate void DataGridPageChangedEventHandler ( - object sender, - DataGridPageChangedEventArgs e); -} \ No newline at end of file diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventArgs.cs deleted file mode 100644 index c85d7df5b6..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventArgs.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// System.Web.UI.WebControls.DataGridSortCommandEventArgs.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Web.UI.WebControls; - -namespace System.Web.UI.WebControls -{ - public class DataGridSortCommandEventArgs : EventArgs - { - object source; - string expr; - - public DataGridSortCommandEventArgs (object source, DataGridCommandEventArgs args) - { - this.source = source; - this.expr = args.CommandArgument.ToString (); - } - - public object CommandSource { - get { return source; } - } - - public string SortExpression { - get { return expr; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs deleted file mode 100644 index b88303be53..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.Web.UI.WebControls.DataGridSortCommandEventHandler.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public delegate void DataGridSortCommandEventHandler ( - object sender, - DataGridSortCommandEventArgs e); -} \ No newline at end of file diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventArgs.cs deleted file mode 100644 index 083d82ffef..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventArgs.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// System.Web.UI.WebControls.DataListCommandEventArgs.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public class DataListCommandEventArgs : CommandEventArgs - { - DataListItem item; - object source; - - public DataListCommandEventArgs (DataListItem item, object source, CommandEventArgs args) - : base (args) - { - this.item = item; - this.source = source; - } - - public DataListItem Item { - get { return item; } - } - - public object CommandSource { - get { return source; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventHandler.cs deleted file mode 100644 index b36c526319..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.DataListCommandEventHandler.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public delegate void DataListCommandEventHandler ( - object sender, - DataListCommandEventArgs e); - -} \ No newline at end of file diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventArgs.cs deleted file mode 100644 index 666487f5fc..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventArgs.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// System.Web.UI.WebControls.DataListCommandEventArgs.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public class DataListItemEventArgs : EventArgs - { - DataListItem item; - - public DataListItemEventArgs (DataListItem item) - { - this.item = item; - } - - public DataListItem Item { - get { return item; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventHandler.cs deleted file mode 100644 index 5fb9d3c79a..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventHandler.cs +++ /dev/null @@ -1,30 +0,0 @@ -// -// System.Web.UI.WebControls.DataListItemEventHandler -// -// Author: Ben Maurer -// -// 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. -// - -namespace System.Web.UI.WebControls { - public delegate void DataListItemEventHandler (object sender, DataListItemEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DayNameFormat.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DayNameFormat.cs deleted file mode 100644 index e7e00756de..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DayNameFormat.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.WebControls.DayNameFormat.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls -{ - public enum DayNameFormat - { - Full, - Short, - FirstLetter, - FirstTwoLetters, - Shortest - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventHandler.cs deleted file mode 100644 index 022c8e29fe..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.Web.UI.WebControls.DayRenderEventHandler.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public delegate void DayRenderEventHandler ( - object sender, - DayRenderEventArgs e); -} \ No newline at end of file diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewCommandEventArgs.cs deleted file mode 100644 index b45abd539b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewCommandEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewCommandEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public class DetailsViewCommandEventArgs : CommandEventArgs - { - object source; - - public DetailsViewCommandEventArgs (object source, CommandEventArgs arguments) : base (arguments) - { - this.source = source; - } - - public object CommandSource { - get { return source; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewCommandEventHandler.cs deleted file mode 100644 index da199dd820..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewCommandEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewCommandEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void DetailsViewCommandEventHandler (object sender, DetailsViewCommandEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewDeleteEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewDeleteEventHandler.cs deleted file mode 100644 index 8ce41dc306..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewDeleteEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewDeleteEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void DetailsViewDeleteEventHandler (object sender, DetailsViewDeleteEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewDeletedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewDeletedEventHandler.cs deleted file mode 100644 index ff6007a1b2..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewDeletedEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewDeletedEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void DetailsViewDeletedEventHandler (object sender, DetailsViewDeletedEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewInsertEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewInsertEventHandler.cs deleted file mode 100644 index c9a386553a..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewInsertEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewInsertEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void DetailsViewInsertEventHandler (object sender, DetailsViewInsertEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewInsertedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewInsertedEventHandler.cs deleted file mode 100644 index 4f9fa828f6..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewInsertedEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewInsertedEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void DetailsViewInsertedEventHandler (object sender, DetailsViewInsertedEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewMode.cs deleted file mode 100644 index 8f2904b0eb..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewMode.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewMode.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls -{ - public enum DetailsViewMode - { - ReadOnly = 0, - Edit = 1, - Insert = 2 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewModeEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewModeEventArgs.cs deleted file mode 100644 index ff3bbecc13..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewModeEventArgs.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewModeEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Web.UI.WebControls -{ - public class DetailsViewModeEventArgs : CancelEventArgs - { - DetailsViewMode mode; - bool cancelEdit; - - public DetailsViewModeEventArgs (DetailsViewMode mode, bool cancelingEdit) - { - this.mode = mode; - this.cancelEdit = cancelingEdit; - } - - public bool CancelingEdit { - get { return cancelEdit; } - } - - public DetailsViewMode NewMode { - get { return mode; } - set { mode = value;} - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewModeEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewModeEventHandler.cs deleted file mode 100644 index 817c6f3c3d..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewModeEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewModeEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void DetailsViewModeEventHandler (object sender, DetailsViewModeEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewPageEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewPageEventArgs.cs deleted file mode 100644 index 9ea2972d11..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewPageEventArgs.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewPageEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Web.UI.WebControls -{ - public class DetailsViewPageEventArgs : CancelEventArgs - { - private int pageIndex; - - public DetailsViewPageEventArgs (int pageIndex ) - { - this.pageIndex = pageIndex; - } - - public int NewPageIndex { - get { return pageIndex; } - set { pageIndex = value;} - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewPageEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewPageEventHandler.cs deleted file mode 100644 index bc1784689b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewPageEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewPageEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void DetailsViewPageEventHandler (object sender, DetailsViewPageEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewUpdateEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewUpdateEventHandler.cs deleted file mode 100644 index 07f14615d4..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewUpdateEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewUpdateEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void DetailsViewUpdateEventHandler (object sender, DetailsViewUpdateEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewUpdatedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewUpdatedEventHandler.cs deleted file mode 100644 index b3cfdd8fef..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/DetailsViewUpdatedEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.DetailsViewUpdatedEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void DetailsViewUpdatedEventHandler (object sender, DetailsViewUpdatedEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FirstDayOfWeek.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FirstDayOfWeek.cs deleted file mode 100644 index 540daba26e..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FirstDayOfWeek.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2005 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Peter Bartok (pbartok@novell.com) -// -// - -namespace System.Web.UI.WebControls { - public enum FirstDayOfWeek { - Sunday = 0, - Monday = 1, - Tuesday = 2, - Wednesday = 3, - Thursday = 4, - Friday = 5, - Saturday = 6, - Default = 7 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontSize.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontSize.cs deleted file mode 100644 index 8ef4eae602..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FontSize.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// System.Web.UI.WebControls.FontSize.cs -// -// Authors: -// Miguel de Icaza (miguel@novell.com) -// -// (C) 2005 Novell, Inc. -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - public enum FontSize { - NotSet, - AsUnit, - Smaller, - Larger, - XXSmall, - XSmall, - Small, - Medium, - Large, - XLarge, - XXLarge - - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewCommandEventHandler.cs deleted file mode 100644 index 1c34d9ec89..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewCommandEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.FormViewCommandEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void FormViewCommandEventHandler (object sender, FormViewCommandEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewDeleteEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewDeleteEventHandler.cs deleted file mode 100644 index 13cd81e55c..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewDeleteEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.FormViewDeleteEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void FormViewDeleteEventHandler (object sender, FormViewDeleteEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewDeletedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewDeletedEventHandler.cs deleted file mode 100644 index a35e16142c..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewDeletedEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.FormViewDeletedEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void FormViewDeletedEventHandler (object sender, FormViewDeletedEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewInsertEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewInsertEventHandler.cs deleted file mode 100644 index e7de4799e9..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewInsertEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.FormViewInsertEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void FormViewInsertEventHandler (object sender, FormViewInsertEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewInsertedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewInsertedEventHandler.cs deleted file mode 100644 index 6b835cb6b7..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewInsertedEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.FormViewInsertedEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void FormViewInsertedEventHandler (object sender, FormViewInsertedEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewMode.cs deleted file mode 100644 index 4858c4eece..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewMode.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.UI.WebControls.FormViewMode.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls -{ - public enum FormViewMode - { - ReadOnly = 0, - Edit = 1, - Insert = 2 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewModeEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewModeEventArgs.cs deleted file mode 100644 index 68a6f26ce9..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewModeEventArgs.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// System.Web.UI.WebControls.FormViewModeEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Web.UI.WebControls -{ - public class FormViewModeEventArgs : CancelEventArgs - { - FormViewMode mode; - bool cancelEdit; - - public FormViewModeEventArgs (FormViewMode mode, bool cancelingEdit) - { - this.mode = mode; - this.cancelEdit = cancelingEdit; - } - - public bool CancelingEdit { - get { return cancelEdit; } - } - - public FormViewMode NewMode { - get { return mode; } - set { mode = value;} - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewModeEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewModeEventHandler.cs deleted file mode 100644 index 0cdee2368c..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewModeEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebContrls.FormViewModeEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void FormViewModeEventHandler (object sender, FormViewModeEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewPageEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewPageEventArgs.cs deleted file mode 100644 index b5f9f4392d..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewPageEventArgs.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// System.Web.UI.WebControls.FormViewPageEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Web.UI.WebControls -{ - public class FormViewPageEventArgs : CancelEventArgs - { - int pageIndex; - - public FormViewPageEventArgs (int pageIndex ) - { - this.pageIndex = pageIndex; - } - - public int NewPageIndex { - get { return pageIndex; } - set { pageIndex = value;} - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewPageEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewPageEventHandler.cs deleted file mode 100644 index 9a77a43cb5..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewPageEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.FormViewPageEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void FormViewPageEventHandler (object sender, FormViewPageEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewUpdateEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewUpdateEventHandler.cs deleted file mode 100644 index 0b1b8c5838..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewUpdateEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebContrls.FormViewUpdateEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void FormViewUpdateEventHandler (object sender, FormViewUpdateEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewUpdatedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FormViewUpdatedEventHandler.cs deleted file mode 100644 index fa8df60d66..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/FormViewUpdatedEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.FormViewUpdatedEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void FormViewUpdatedEventHandler (object sender, FormViewUpdatedEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridLines.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridLines.cs deleted file mode 100644 index ad247e4fb8..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridLines.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.UI.HtmlControls.GridLines.cs -// -// Author: -// Sebastien Pouliot -// -// 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. -// - -namespace System.Web.UI.WebControls { - - public enum GridLines { - None, - Horizontal, - Vertical, - Both - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCancelEditEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCancelEditEventArgs.cs deleted file mode 100644 index 5d26d91310..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCancelEditEventArgs.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewCancelEditEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Web.UI.WebControls -{ - public class GridViewCancelEditEventArgs : CancelEventArgs - { - int rowIndex; - - public GridViewCancelEditEventArgs (int index) - { - this.rowIndex = index; - } - - public int RowIndex { - get { return rowIndex; } - } - - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCancelEditEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCancelEditEventHandler.cs deleted file mode 100644 index 7a982462ff..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCancelEditEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewCancelEditEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void GridViewCancelEditEventHandler (object sender, GridViewCancelEditEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCommandEventArgs.cs deleted file mode 100644 index 2a205b3c6d..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCommandEventArgs.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewCommandEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public class GridViewCommandEventArgs : CommandEventArgs - { - object source; - GridViewRow row; - - public GridViewCommandEventArgs (object source, CommandEventArgs arguments) : base (arguments) - { - this.source = source; - this.row = null; - } - - public GridViewCommandEventArgs (GridViewRow row, object source, CommandEventArgs arguments) : base (arguments) - { - this.source = source; - this.row = row; - } - - public object CommandSource { - get { return source; } - } - - internal GridViewRow Row { - get { return row; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCommandEventHandler.cs deleted file mode 100644 index 807aec7862..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewCommandEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewCommandEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void GridViewCommandEventHandler (object sender, GridViewCommandEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewDeleteEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewDeleteEventHandler.cs deleted file mode 100644 index 42bf97161b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewDeleteEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewDeleteEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void GridViewDeleteEventHandler (object sender, GridViewDeleteEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewDeletedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewDeletedEventHandler.cs deleted file mode 100644 index cb17de0b45..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewDeletedEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewDeletedEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void GridViewDeletedEventHandler (object sender, GridViewDeletedEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewEditEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewEditEventArgs.cs deleted file mode 100644 index ecc38b847a..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewEditEventArgs.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewEditEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Web.UI.WebControls -{ - public class GridViewEditEventArgs : CancelEventArgs - { - public GridViewEditEventArgs (int editIndex) - { - this.NewEditIndex = editIndex; - } - - public int NewEditIndex { - get; - set; - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewEditEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewEditEventHandler.cs deleted file mode 100644 index 621ffd9695..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewEditEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewEditEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void GridViewEditEventHandler (object sender, GridViewEditEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewPageEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewPageEventArgs.cs deleted file mode 100644 index 68ff1ffb51..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewPageEventArgs.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewPageEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Web.UI.WebControls -{ - public class GridViewPageEventArgs : CancelEventArgs - { - public GridViewPageEventArgs (int pageIndex ) - { - this.NewPageIndex = pageIndex; - } - - public int NewPageIndex { - get; - set; - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewPageEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewPageEventHandler.cs deleted file mode 100644 index 39b638ae32..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewPageEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewPageEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void GridViewPageEventHandler (object sender, GridViewPageEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewRowEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewRowEventArgs.cs deleted file mode 100644 index e1bffc6cdf..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewRowEventArgs.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewRowEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public class GridViewRowEventArgs : EventArgs - { - GridViewRow row; - - public GridViewRowEventArgs (GridViewRow row ) - { - this.row = row; - } - - public GridViewRow Row { - get { return row; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewRowEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewRowEventHandler.cs deleted file mode 100644 index 3ab9a8e123..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewRowEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewRowEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls -{ - public delegate void GridViewRowEventHandler (object sender, GridViewRowEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSelectEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSelectEventArgs.cs deleted file mode 100644 index 93d96fe0fd..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSelectEventArgs.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewSelectEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Web.UI.WebControls -{ - public class GridViewSelectEventArgs : CancelEventArgs - { - public GridViewSelectEventArgs (int selectedIndex ) - { - this.NewSelectedIndex = selectedIndex; - } - - public int NewSelectedIndex { - get; - set; - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSelectEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSelectEventHandler.cs deleted file mode 100644 index 62b2ca2e07..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSelectEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewSelectEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void GridViewSelectEventHandler (object sender, GridViewSelectEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSortEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSortEventArgs.cs deleted file mode 100644 index 752aa45116..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSortEventArgs.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewSortEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Web.UI.WebControls -{ - public class GridViewSortEventArgs : CancelEventArgs - { - public GridViewSortEventArgs (string expression, SortDirection sortDirection) - { - this.SortExpression = expression; - this.SortDirection = sortDirection; - } - - public string SortExpression { - get; - set; - } - - public SortDirection SortDirection { - get; - set; - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSortEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSortEventHandler.cs deleted file mode 100644 index a285525066..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewSortEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewSortEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void GridViewSortEventHandler (object sender, GridViewSortEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewUpdateEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewUpdateEventHandler.cs deleted file mode 100644 index 7161bd4e16..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewUpdateEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebContrls.GridViewUpdateEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void GridViewUpdateEventHandler (object sender, GridViewUpdateEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewUpdatedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridViewUpdatedEventHandler.cs deleted file mode 100644 index 94abf598a4..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/GridViewUpdatedEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.GridViewUpdatedEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void GridViewUpdatedEventHandler (object sender, GridViewUpdatedEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/HorizontalAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/HorizontalAlign.cs deleted file mode 100644 index 8b412028f3..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/HorizontalAlign.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.UI.WebControls.HorizontalAlign.cs -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Web.UI.WebControls { - - [TypeConverter (typeof (System.Web.UI.WebControls.HorizontalAlignConverter))] - public enum HorizontalAlign { - NotSet, - Left, - Center, - Right, - Justify - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/HotSpotMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/HotSpotMode.cs deleted file mode 100644 index 0ee5fa6abe..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/HotSpotMode.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.WebControls.HotSpotMode.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls -{ - public enum HotSpotMode - { - NotSet = 0, - Navigate = 1, - PostBack = 2, - Inactive = 3 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/IButtonControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/IButtonControl.cs deleted file mode 100644 index 6d591af192..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/IButtonControl.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// System.Web.UI.WebControls.IButtonControl.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls -{ - public interface IButtonControl - { - bool CausesValidation { get; set; } - string CommandArgument { get; set; } - string CommandName { get; set; } - string PostBackUrl { get; set; } - string Text { get; set; } - string ValidationGroup { get; set; } - - event EventHandler Click; - event CommandEventHandler Command; - } -} - - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ICallbackContainer.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ICallbackContainer.cs deleted file mode 100644 index ea46c05957..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ICallbackContainer.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.WebControls.ICallbackContainer.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls -{ - public interface ICallbackContainer - { - string GetCallbackScript (IButtonControl control, string argument); - } -} - - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ICompositeControlDesignerAccessor.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ICompositeControlDesignerAccessor.cs deleted file mode 100644 index a8317edb0e..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ICompositeControlDesignerAccessor.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.WebControls. ICompositeControlDesignerAccessor.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; - -namespace System.Web.UI.WebControls -{ - public interface ICompositeControlDesignerAccessor - { - void RecreateChildControls (); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/IDataBoundControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/IDataBoundControl.cs deleted file mode 100644 index 2504d41ee1..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/IDataBoundControl.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.UI.WebControls.IDataBoundControl -// -// Authors: -// 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. -// - -using System.ComponentModel; -using System.Collections; -using System.Security.Permissions; -using System.Web.UI.WebControls; - -namespace System.Web.UI.WebControls -{ - public interface IDataBoundControl - { - string[] DataKeyNames { get; set; } - string DataMember { get; set; } - object DataSource { get; set; } - string DataSourceID { get; set; } - IDataSource DataSourceObject { get; } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/IDataBoundItemControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/IDataBoundItemControl.cs deleted file mode 100644 index 71e8612b84..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/IDataBoundItemControl.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.UI.WebControls.IDataBoundItemControl -// -// Authors: -// 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. -// - -using System.ComponentModel; -using System.Collections; -using System.Security.Permissions; -using System.Web.UI.WebControls; - -namespace System.Web.UI.WebControls -{ - public interface IDataBoundItemControl : IDataBoundControl - { - DataKey DataKey { get; } - DataBoundControlMode Mode { get; } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/IDataBoundListControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/IDataBoundListControl.cs deleted file mode 100644 index 4982e2da29..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/IDataBoundListControl.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.UI.WebControls.IDataBoundListControl -// -// Authors: -// 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. -// - -using System.ComponentModel; -using System.Collections; -using System.Security.Permissions; -using System.Web.UI.WebControls; - -namespace System.Web.UI.WebControls -{ - public interface IDataBoundListControl : IDataBoundControl - { - string[] ClientIDRowSuffix { get; set; } - DataKeyArray DataKeys { get; } - bool EnablePersistedSelection { get; set; } - DataKey SelectedDataKey { get; } - int SelectedIndex { get; set; } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/IFieldControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/IFieldControl.cs deleted file mode 100644 index 840faf07d0..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/IFieldControl.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.WebControls.IFieldControl -// -// Authors: -// 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. -// - -using System.ComponentModel; -using System.Collections; -using System.Security.Permissions; -using System.Web.UI.WebControls; - -namespace System.Web.UI.WebControls -{ - public interface IFieldControl - { - IAutoFieldGenerator FieldsGenerator { get; set; } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/IPersistedSelector.cs b/mcs/class/System.Web/System.Web.UI.WebControls/IPersistedSelector.cs deleted file mode 100644 index 85a62d5df9..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/IPersistedSelector.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// System.Web.UI.WebControls.IPersistedSelector.cs -// -// Author: -// Atsushi Enomoto -// -// (C) 2008-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Security.Permissions; -using System.Web; - -namespace System.Web.UI.WebControls -{ - public interface IPersistedSelector - { - DataKey DataKey { get; set; } - } -} - - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/IRepeatInfoUser.cs b/mcs/class/System.Web/System.Web.UI.WebControls/IRepeatInfoUser.cs deleted file mode 100644 index 3348d9ad63..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/IRepeatInfoUser.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// System.Web.UI.WebControls.IRepeatInfoUser -// -// Author: -// Ben Maurer -// -// (c) 2005 Novell -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web.UI.WebControls { - - public interface IRepeatInfoUser { - - Style GetItemStyle (ListItemType itemType, int repeatIndex); - void RenderItem (WebControls.ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer); - - bool HasFooter { - get; - } - bool HasHeader { - get; - } - bool HasSeparators { - get; - } - int RepeatedItemCount { - get; - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ImageAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ImageAlign.cs deleted file mode 100644 index a8bd885439..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ImageAlign.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// System.Web.UI.WebControls.ImageAlign.cs -// -// Author: -// Sebastien Pouliot -// -// 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. -// - -namespace System.Web.UI.WebControls { - - public enum ImageAlign { - NotSet, - Left, - Right, - Baseline, - Top, - Middle, - Bottom, - AbsBottom, - AbsMiddle, - TextTop - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ImageMapEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ImageMapEventArgs.cs deleted file mode 100644 index 9327e67e9b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ImageMapEventArgs.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// System.Web.UI.WebControls.ImageMapEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public class ImageMapEventArgs : EventArgs - { - string value; - - public ImageMapEventArgs (string value) - { - this.value = value; - } - - public string PostBackValue { - get { return value; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ImageMapEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ImageMapEventHandler.cs deleted file mode 100644 index ad0566f4bd..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ImageMapEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.ImageMapEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls -{ - public delegate void ImageMapEventHandler (object sender, ImageMapEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListItemType.cs deleted file mode 100644 index 539cad6956..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemType.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// System.Web.UI.WebControls.ListItemType.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public enum ListItemType - { - Header, - Footer, - Item, - AlternatingItem, - SelectedItem, - EditItem, - Separator, - Pager - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListSelectionMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListSelectionMode.cs deleted file mode 100644 index 64ee4865aa..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ListSelectionMode.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.UI.WebControls.ListItemType.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public enum ListSelectionMode - { - Single, - Multiple - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LiteralMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LiteralMode.cs deleted file mode 100644 index c23f344ddd..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/LiteralMode.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.LiteralMode.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - public enum LiteralMode { - Transform = 0, - PassThrough = 1, - Encode = 2 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LoginCancelEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LoginCancelEventArgs.cs deleted file mode 100644 index 6e72687ca2..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/LoginCancelEventArgs.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// System.Web.UI.WebControls.LoginCancelEventArgs class -// -// Author: -// Sebastien Pouliot -// -// 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. -// - - -namespace System.Web.UI.WebControls { - - public class LoginCancelEventArgs : EventArgs - { - bool cancel; - - public LoginCancelEventArgs () - { - cancel = false; - } - - public LoginCancelEventArgs (bool cancel) - { - this.cancel = cancel; - } - - public bool Cancel { - get { return cancel; } - set { cancel = value; } - } - - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LoginCancelEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LoginCancelEventHandler.cs deleted file mode 100644 index 8953b486e6..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/LoginCancelEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.LoginCancelEventHandler delegate -// -// Author: -// Sebastien Pouliot -// -// 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. -// - - -namespace System.Web.UI.WebControls { - - public delegate void LoginCancelEventHandler (object sender, LoginCancelEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LoginFailureAction.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LoginFailureAction.cs deleted file mode 100644 index e4fb167152..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/LoginFailureAction.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// System.Web.UI.WebControls.LoginFailureAction.cs -// -// Author: Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - - public enum LoginFailureAction - { - Refresh = 0, - RedirectToLoginPage = 1, - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LogoutAction.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LogoutAction.cs deleted file mode 100644 index e942866351..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/LogoutAction.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.LogoutAction.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - public enum LogoutAction { - Refresh = 0, - Redirect = 1, - RedirectToLoginPage = 2 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/MailMessageEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/MailMessageEventArgs.cs deleted file mode 100644 index 778f037e3d..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/MailMessageEventArgs.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// System.Web.UI.WebControls.MalMessageEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.Net.Mail; - -namespace System.Web.UI.WebControls -{ - public class MailMessageEventArgs : LoginCancelEventArgs - { - MailMessage message; - - public MailMessageEventArgs (MailMessage message) - { - this.message = message; - } - - public MailMessage Message { - get { return message; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/MailMessageEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/MailMessageEventHandler.cs deleted file mode 100644 index a9baaf1bce..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/MailMessageEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// System.Web.UI.WebControls.MailMessageEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls { - public delegate void MailMessageEventHandler (object sender, MailMessageEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/MenuEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/MenuEventArgs.cs deleted file mode 100644 index 83da6ea863..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/MenuEventArgs.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// System.Web.UI.WebControls.MenuEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -namespace System.Web.UI.WebControls -{ - public sealed class MenuEventArgs : CommandEventArgs - { - MenuItem item; - object source; - - public MenuEventArgs (MenuItem item) : base ("", null) - { - this.item = item; - this.source = null; - } - - public MenuEventArgs (MenuItem item, object source, CommandEventArgs arguments) : base (arguments) - { - this.item = item; - this.source = source; - } - - public object CommandSource { - get { return source; } - } - - public MenuItem Item { - get { return item; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/MenuEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/MenuEventHandler.cs deleted file mode 100644 index 0286227fe4..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/MenuEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// System.Web.UI.WebControls.MenuEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls { - public delegate void MenuEventHandler (object sender, MenuEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/MenuRenderingMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/MenuRenderingMode.cs deleted file mode 100644 index 9baa741270..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/MenuRenderingMode.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// 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; - -namespace System.Web.UI.WebControls -{ - public enum MenuRenderingMode - { - Default, - Table, - List, - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventArgs.cs deleted file mode 100644 index 0cfc749dfb..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventArgs.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// System.Web.UI.WebControls.MonthChangedEventArgs.cs -// -// Authors: -// Jackson Harper (jackson@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Security.Permissions; - -namespace System.Web.UI.WebControls { - - // CAS - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public class MonthChangedEventArgs { - - DateTime new_date; - DateTime prev_date; - - public MonthChangedEventArgs (DateTime newDate, DateTime previousDate) - { - new_date = newDate; - prev_date = previousDate; - } - - public DateTime NewDate { - get { return new_date; } - } - - public DateTime PreviousDate { - get { return prev_date; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventHandler.cs deleted file mode 100644 index 1bc2cec95c..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventHandler.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.WebControls.MonthChangedEventHandler.cs -// -// Authors: -// Jackson Harper (jackson@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public delegate void MonthChangedEventHandler (object sender, - MonthChangedEventArgs e); - -} - - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/NextPrevFormat.cs b/mcs/class/System.Web/System.Web.UI.WebControls/NextPrevFormat.cs deleted file mode 100644 index 0fa4064bb3..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/NextPrevFormat.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.WebControls.NextPrevFormat.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public enum NextPrevFormat - { - CustomText, - ShortMonth, - FullMonth - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceDisposingEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceDisposingEventArgs.cs deleted file mode 100644 index 68ca641d4f..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceDisposingEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// System.Web.UI.WebControls.ObjectDataSourceDisposingEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.ComponentModel; - -namespace System.Web.UI.WebControls -{ - public class ObjectDataSourceDisposingEventArgs : CancelEventArgs - { - object objectInstance; - - public ObjectDataSourceDisposingEventArgs (object objectInstance) - { - this.objectInstance = objectInstance; - } - - public object ObjectInstance { - get { return objectInstance; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceDisposingEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceDisposingEventHandler.cs deleted file mode 100644 index f90e1b1497..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceDisposingEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// System.Web.UI.WebContrls.ObjectDataSourceDisposingEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls { - public delegate void ObjectDataSourceDisposingEventHandler (object sender, ObjectDataSourceDisposingEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceEventArgs.cs deleted file mode 100644 index ea48fd7334..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceEventArgs.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// System.Web.UI.WebControls.ObjectDataSourceEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -namespace System.Web.UI.WebControls -{ - public class ObjectDataSourceEventArgs : EventArgs - { - object objectInstance; - - public ObjectDataSourceEventArgs (object objectInstance) - { - this.objectInstance = objectInstance; - } - - public object ObjectInstance { - get { return objectInstance; } - set { objectInstance = value; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceFilteringEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceFilteringEventArgs.cs deleted file mode 100644 index 7c2dbd9351..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceFilteringEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// System.Web.UI.WebControls.ObjectDataSourceFilteringEventArgs.cs -// -// Authors: -// Lluis Sanchez Gual (lluis@novell.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.Collections; -using System.Collections.Specialized; - -namespace System.Web.UI.WebControls -{ - public class ObjectDataSourceFilteringEventArgs : System.ComponentModel.CancelEventArgs - { - IOrderedDictionary parameters; - - public ObjectDataSourceFilteringEventArgs (IOrderedDictionary parameterValues) - { - this.parameters = parameterValues; - } - - public IOrderedDictionary ParameterValues { - get { return parameters; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceFilteringEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceFilteringEventHandler.cs deleted file mode 100644 index b806640e7b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceFilteringEventHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.ObjectDataSourceFilteringEventHandler.cs -// -// Authors: -// Lluis Sanchez Gual (lluis@novell.com) -// -// (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. -// - - - -namespace System.Web.UI.WebControls -{ - public delegate void ObjectDataSourceFilteringEventHandler (object sender, ObjectDataSourceFilteringEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceMethodEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceMethodEventArgs.cs deleted file mode 100644 index 5becedb10f..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceMethodEventArgs.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.Collections; -using System.Collections.Specialized; - -namespace System.Web.UI.WebControls -{ - public class ObjectDataSourceMethodEventArgs : System.ComponentModel.CancelEventArgs - { - IOrderedDictionary parameters; - - public ObjectDataSourceMethodEventArgs (IOrderedDictionary inputParameters) - { - this.parameters = inputParameters; - } - - public IOrderedDictionary InputParameters { - get { return parameters; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceMethodEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceMethodEventHandler.cs deleted file mode 100644 index 8814e615d1..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceMethodEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// System.Web.UI.WebContrls.ObjectDataSourceMethodEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls { - public delegate void ObjectDataSourceMethodEventHandler (object sender, ObjectDataSourceMethodEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceSelectingEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceSelectingEventArgs.cs deleted file mode 100644 index c5908d4eee..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceSelectingEventArgs.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.Collections; -using System.Collections.Specialized; - -namespace System.Web.UI.WebControls -{ - public class ObjectDataSourceSelectingEventArgs: ObjectDataSourceMethodEventArgs - { - private bool executeSelectCount; - private DataSourceSelectArguments arguments; - - public ObjectDataSourceSelectingEventArgs (IOrderedDictionary inputParameters, DataSourceSelectArguments arguments, bool executeSelectCount) : base (inputParameters) - { - this.executeSelectCount = executeSelectCount; - this.arguments = arguments; - } - - public bool ExecutingSelectCount { - get { return executeSelectCount; } - } - - public DataSourceSelectArguments Arguments { - get { return arguments; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceSelectingEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceSelectingEventHandler.cs deleted file mode 100644 index a4abf86f8f..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceSelectingEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// System.Web.UI.WebContrls.ObjectDataSourceSelectingEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls { - public delegate void ObjectDataSourceSelectingEventHandler (object sender, ObjectDataSourceSelectingEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceStatusEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceStatusEventArgs.cs deleted file mode 100644 index ea9c728e97..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceStatusEventArgs.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.Collections; - -namespace System.Web.UI.WebControls -{ - public class ObjectDataSourceStatusEventArgs : EventArgs - { - readonly object returnVal; - readonly IDictionary outPutParam; - readonly Exception exception; - bool exceptionHandled; - int affectedRows; - - public ObjectDataSourceStatusEventArgs (object returnVal, IDictionary outPutParam) - : - this (returnVal, outPutParam, null) { } - - public ObjectDataSourceStatusEventArgs (object returnVal, IDictionary outPutParam, Exception e) - { - this.returnVal = returnVal; - this.outPutParam = outPutParam; - this.exception = e; - this.exceptionHandled = false; - this.affectedRows = -1; - } - - public int AffectedRows { - get { return affectedRows; } - set { affectedRows = value; } - } - - public Exception Exception { - get { return exception; } - } - - public bool ExceptionHandled { - get { return exceptionHandled; } - set { exceptionHandled = value; } - } - - public IDictionary OutputParameters { - get { return outPutParam; } - } - - public object ReturnValue { - get { return returnVal; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceStatusEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceStatusEventHandler.cs deleted file mode 100644 index 9d96763b23..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceStatusEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// System.Web.UI.WebContrls.ObjectDataSourceStatusEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls { - public delegate void ObjectDataSourceStatusEventHandler (object sender, ObjectDataSourceStatusEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Orientation.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Orientation.cs deleted file mode 100644 index 6f9ff797cd..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/Orientation.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.Web.UI.WebControls.Orientation.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - public enum Orientation { - Horizontal = 0, - Vertical = 1 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PagerButtons.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PagerButtons.cs deleted file mode 100644 index dfb8dce4e6..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/PagerButtons.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.PagerButtons.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - public enum PagerButtons { - NextPrevious = 0, - Numeric = 1, - NextPreviousFirstLast = 2, - NumericFirstLast = 3 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PagerMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PagerMode.cs deleted file mode 100644 index 20dcf26650..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/PagerMode.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.UI.WebControls.PagerMode.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public enum PagerMode - { - NextPrev, - NumericPages - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PagerPosition.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PagerPosition.cs deleted file mode 100644 index 7793a71abf..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/PagerPosition.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.WebControls.PagerPosition.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public enum PagerPosition - { - Bottom, - Top, - TopAndBottom - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PathDirection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PathDirection.cs deleted file mode 100644 index c124802a8f..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/PathDirection.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.Web.UI.WebControls.PathDirection.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - public enum PathDirection { - RootToCurrent = 0, - CurrentToRoot = 1 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatDirection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeatDirection.cs deleted file mode 100644 index 21eb560772..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatDirection.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.UI.WebControls.RepeatDirection.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public enum RepeatDirection - { - Horizontal, - Vertical - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatLayout.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeatLayout.cs deleted file mode 100644 index d0ff4c5c7e..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatLayout.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.WebControls.RepeatLayout.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public enum RepeatLayout - { - Table, - Flow, - UnorderedList, - OrderedList - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventArgs.cs deleted file mode 100644 index 0e707f1b31..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventArgs.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// System.Web.UI.WebControls.RepeaterCommandEventArgs.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public - class RepeaterCommandEventArgs : CommandEventArgs - { - RepeaterItem item; - object source; - - public RepeaterCommandEventArgs ( - RepeaterItem item, - object source, - CommandEventArgs args) - : base (args) - { - this.item = item; - this.source = source; - } - - public RepeaterItem Item { - get { return item; } - } - - public object CommandSource { - get { return source; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventHandler.cs deleted file mode 100644 index 828b25d37d..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.Web.UI.WebControls.RepeaterEventHandler.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public delegate void RepeaterCommandEventHandler ( - object sender, - RepeaterCommandEventArgs e); -} \ No newline at end of file diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventArgs.cs deleted file mode 100644 index f008a2aefc..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.UI.WebControls.RepeaterItemEventArgs.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public - class RepeaterItemEventArgs : EventArgs - { - RepeaterItem item; - - public RepeaterItemEventArgs (RepeaterItem item) - { - this.item = item; - } - - public RepeaterItem Item { - get { return item; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventHandler.cs deleted file mode 100644 index 56c2d6ac02..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventHandler.cs +++ /dev/null @@ -1,30 +0,0 @@ -// -// System.Web.UI.WebControls.RepeaterItemEventHandler -// -// Author: Ben Maurer -// -// 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. -// - -namespace System.Web.UI.WebControls { - public delegate void RepeaterItemEventHandler (object sender, RepeaterItemEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SendMailErrorEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SendMailErrorEventHandler.cs deleted file mode 100644 index 9ca58aa308..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SendMailErrorEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// System.Web.UI.WebContrls.SendMailErrorEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls { - public delegate void SendMailErrorEventHandler (object sender, SendMailErrorEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventHandler.cs deleted file mode 100644 index 99f86e8a78..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.Web.UI.WebControls.ServerValidateEventHandler.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - - public delegate void ServerValidateEventHandler ( - object sender, - ServerValidateEventArgs e); -} \ No newline at end of file diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItemEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItemEventArgs.cs deleted file mode 100644 index fc54cfe9cb..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItemEventArgs.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// System.Web.UI.WebControls.SiteMapNodeItemEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -namespace System.Web.UI.WebControls -{ - public class SiteMapNodeItemEventArgs : EventArgs - { - SiteMapNodeItem item; - - public SiteMapNodeItemEventArgs (SiteMapNodeItem item) - { - this.item = item; - } - - public SiteMapNodeItem Item { - get { return item; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItemEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItemEventHandler.cs deleted file mode 100644 index 03d4d1694b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItemEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// System.Web.UI.WebControls.SiteMapNodeItemEventHandler.cs; -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI.WebControls { - public delegate void SiteMapNodeItemEventHandler (object sender, SiteMapNodeItemEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItemType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItemType.cs deleted file mode 100644 index 20def316ba..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SiteMapNodeItemType.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.SiteMapNodeItemType.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - public enum SiteMapNodeItemType { - Root = 0, - Parent = 1, - Current = 2, - PathSeparator = 3 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SortDirection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SortDirection.cs deleted file mode 100644 index b6d6ac2503..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SortDirection.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.SortDirection.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls -{ - public enum SortDirection - { - Ascending = 0, - Descending = 1 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceCommandEventArgs.cs deleted file mode 100644 index 6e8fd8942c..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceCommandEventArgs.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// System.Web.UI.WebControls.SqlDataSourceCommandEventArgs -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; -using System.Collections.Specialized; -using System.Text; -using System.Data.Common; -using System.ComponentModel; - -namespace System.Web.UI.WebControls { - public class SqlDataSourceCommandEventArgs : CancelEventArgs { - - public SqlDataSourceCommandEventArgs (DbCommand command) - { - this.command = command; - } - - DbCommand command; - public DbCommand Command { - get { return command; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceCommandEventHandler.cs deleted file mode 100644 index 477e8e9d14..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceCommandEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.SqlDataSourceCommandEventHandler -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web.UI.WebControls { - public delegate void SqlDataSourceCommandEventHandler (object source, SqlDataSourceCommandEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceCommandType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceCommandType.cs deleted file mode 100644 index ba766e63df..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceCommandType.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.WebControls.SqlDataSourceCommandType -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (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. -// - -namespace System.Web.UI.WebControls { - - public enum SqlDataSourceCommandType - { - Text = 0, - StoredProcedure = 1 - } - -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceFilteringEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceFilteringEventArgs.cs deleted file mode 100644 index 4300d875a6..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceFilteringEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// System.Web.UI.WebControls.SqlDataSourceFilteringEventArgs -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2005 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections.Specialized; -using System.ComponentModel; - -namespace System.Web.UI.WebControls -{ - public class SqlDataSourceFilteringEventArgs : CancelEventArgs - { - public SqlDataSourceFilteringEventArgs (IOrderedDictionary param_values) - { - this.param_values = param_values; - } - - public IOrderedDictionary ParameterValues - { - get { return param_values; } - } - - IOrderedDictionary param_values; - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceFilteringEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceFilteringEventHandler.cs deleted file mode 100644 index b5c8cd9e36..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceFilteringEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// System.Web.UI.WebControls.SqlDataSourceFilteringEventHandler -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (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. -// - -namespace System.Web.UI.WebControls { - public delegate void SqlDataSourceFilteringEventHandler (object sender, SqlDataSourceFilteringEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceMode.cs deleted file mode 100644 index f30828ea1e..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceMode.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.UI.WebControls.SqlDataSourceMode -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; -using System.Collections.Specialized; -using System.Text; - -namespace System.Web.UI.WebControls { - public enum SqlDataSourceMode { - DataReader, - DataSet - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceSelectingEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceSelectingEventArgs.cs deleted file mode 100644 index bb3bc4abe1..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceSelectingEventArgs.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// System.Web.UI.WebControls.SqlDataSourceSelectinEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Data.Common; - -namespace System.Web.UI.WebControls { - public class SqlDataSourceSelectingEventArgs : SqlDataSourceCommandEventArgs { - DataSourceSelectArguments arguments; - - public SqlDataSourceSelectingEventArgs (DbCommand command, DataSourceSelectArguments argument) - : base (command) - { - this.arguments = argument; - } - - public DataSourceSelectArguments Arguments { - get { return arguments; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceSelectingEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceSelectingEventHandler.cs deleted file mode 100644 index f2bbad36c1..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceSelectingEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.SqlDataSourceSelectingEventHandler -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - public delegate void SqlDataSourceSelectingEventHandler (object source, SqlDataSourceSelectingEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceStatusEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceStatusEventArgs.cs deleted file mode 100644 index cd8447f40e..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceStatusEventArgs.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// System.Web.UI.WebControls.SqlDataSourceStatusEventArgs -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2003 Ben Maurer -// (C) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; -using System.Collections.Specialized; -using System.Text; -using System.Data.Common; - -namespace System.Web.UI.WebControls { - public class SqlDataSourceStatusEventArgs : EventArgs { - public SqlDataSourceStatusEventArgs (DbCommand command, int rowsAffected, Exception exception) - { - this.command = command; - this.rowsAffected = rowsAffected; - this.exception = exception; - this.exceptionHandled = false; - } - - DbCommand command; - Exception exception; - int rowsAffected; - bool exceptionHandled; - - public DbCommand Command { - get { return command; } - } - - public Exception Exception { - get { return exception; } - } - - public int AffectedRows { - get { return rowsAffected; } - } - - public bool ExceptionHandled { - get { return exceptionHandled; } - set { exceptionHandled = value; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceStatusEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceStatusEventHandler.cs deleted file mode 100644 index 90176d65ca..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceStatusEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.SqlDataSourceStatusEventHandler -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web.UI.WebControls { - public delegate void SqlDataSourceStatusEventHandler (object source, SqlDataSourceStatusEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceView.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceView.cs index 1e191bf31d..9b7122e2ed 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceView.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceView.cs @@ -293,8 +293,8 @@ namespace System.Web.UI.WebControls { catch (Exception e) { exception = e; } - SqlDataSourceStatusEventArgs selectedArgs = - new SqlDataSourceStatusEventArgs (command, reader.RecordsAffected, exception); + int rows = reader == null ? 0 : reader.RecordsAffected; + SqlDataSourceStatusEventArgs selectedArgs = new SqlDataSourceStatusEventArgs (command, rows, exception); OnSelected (selectedArgs); if (exception != null && !selectedArgs.ExceptionHandled) throw exception; diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Table.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Table.cs index 865c463688..0bde072c28 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/Table.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/Table.cs @@ -248,11 +248,6 @@ namespace System.Web.UI.WebControls { writer.Write (s); writer.RenderEndTag (); } -// #if !NET_4_0 -// else if (HasControls ()) { -// writer.Indent++; -// } -// #endif } void IPostBackEventHandler.RaisePostBackEvent (string argument) diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableCaptionAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableCaptionAlign.cs deleted file mode 100644 index 47fbf84153..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/TableCaptionAlign.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.WebControls.TableCaptionAlign.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - - // present in Fx 1.1 SP1 - public enum TableCaptionAlign { - NotSet = 0, - Top = 1, - Bottom = 2, - Left = 3, - Right = 4 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableHeaderScope.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableHeaderScope.cs deleted file mode 100644 index 0e92808e0e..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/TableHeaderScope.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.TableHeaderScope.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - public enum TableHeaderScope { - NotSet = 0, - Row = 1, - Column = 2 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableRowSection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableRowSection.cs deleted file mode 100644 index 09246fe83f..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/TableRowSection.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.TableRowSection.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - public enum TableRowSection { - TableHeader = 0, - TableBody = 1, - TableFooter = 2 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TextAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TextAlign.cs deleted file mode 100644 index b792f8aabf..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/TextAlign.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.TextAlign.cs -// -// Author: -// Dick Porter -// -// 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. -// - -namespace System.Web.UI.WebControls { - public enum TextAlign { - Left = 0x01, - Right - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxMode.cs deleted file mode 100644 index eb3287bcef..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxMode.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.WebControls.TextBoxMode.cs -// -// Authors: -// Jordi Mas i Hernandez (jordi@ximian.com) -// -// (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. -// - - -namespace System.Web.UI.WebControls { - public enum TextBoxMode { - SingleLine, - MultiLine, - Password, - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeEventArgs.cs deleted file mode 100644 index d7baad9411..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeEventArgs.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// System.Web.UI.WebControls.TreeNodeEventArgs.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -namespace System.Web.UI.WebControls -{ - public sealed class TreeNodeEventArgs : EventArgs - { - TreeNode node; - - public TreeNodeEventArgs (TreeNode node) - { - this.node = node; - } - - public TreeNode Node { - get { return node; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeEventHandler.cs deleted file mode 100644 index b63cd3c02b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// System.Web.UI.WebControls.TreeNodeEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - public delegate void TreeNodeEventHandler (object source, TreeNodeEventArgs e); -} - diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeSelectAction.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeSelectAction.cs deleted file mode 100644 index 03ac383c25..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeSelectAction.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.WebControls.TreeNodeSelectAction.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - public enum TreeNodeSelectAction { - Select = 0, - Expand = 1, - SelectExpand = 2, - None = 3 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TreeViewImageSet.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TreeViewImageSet.cs deleted file mode 100644 index bafa2737ba..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/TreeViewImageSet.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// System.Web.UI.WebControls.TreeViewImageSet.cs -// -// Author: Sanjay Gupta (gsanjay@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. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -namespace System.Web.UI.WebControls { - public enum TreeViewImageSet { - Custom = 0, - XPFileExplorer = 1, - Msdn = 2, - WindowsHelp = 3, - Simple = 4, - Simple2 = 5, - BulletedList = 6, - BulletedList2 = 7, - BulletedList3 = 8, - BulletedList4 = 9, - Arrows = 10, - News = 11, - Contacts = 12, - Inbox = 13, - Events = 14, - Faq = 15 - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/UnitType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/UnitType.cs deleted file mode 100644 index dfe59ffb3f..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/UnitType.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.UI.WebControls.UnitType.cs -// -// Authors: -// Miguel de Icaza (miguel@novell.com) -// -// (C) 2005 Novell, Inc. -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI.WebControls { - public enum UnitType { - // Empty - Pixel = 1, - Point, - Pica, - Inch, - Mm, - Cm, - Percentage, - Em, - Ex - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationCompareOperator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidationCompareOperator.cs deleted file mode 100644 index b6333ac3c7..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationCompareOperator.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// System.Web.UI.WebControls.ValidationCompareOperator.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public enum ValidationCompareOperator - { - Equal, - NotEqual, - GreaterThan, - GreaterThanEqual, - LessThan, - LessThanEqual, - DataTypeCheck - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationDataType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidationDataType.cs deleted file mode 100644 index 5d25210c4e..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationDataType.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.WebControls.ValidationSummaryDisplayMode.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public enum ValidationDataType - { - String, - Integer, - Double, - Date, - Currency - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs deleted file mode 100644 index 73a3ffb268..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.WebControls.ValidationSummaryDisplayMode.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public enum ValidationSummaryDisplayMode - { - List, - BulletList, - SingleParagraph - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidatorDisplay.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidatorDisplay.cs deleted file mode 100644 index 172c22868b..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidatorDisplay.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.WebControls.ValidatorDisplay.cs -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI.WebControls { - - public enum ValidatorDisplay - { - None, - Static, - Dynamic - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/VerticalAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/VerticalAlign.cs deleted file mode 100644 index efe067d6cd..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/VerticalAlign.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.WebControls.VerticalAlign.cs -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Web.UI.WebControls { - - [TypeConverter (typeof (System.Web.UI.WebControls.VerticalAlignConverter))] - public enum VerticalAlign { - NotSet, - Top, - Middle, - Bottom - } -} diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs deleted file mode 100644 index f2965a3485..0000000000 --- a/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2005 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Peter Bartok (pbartok@novell.com) -// Marek Safar (marek.safar@gmail.com) -// -// - -using System.Collections; -using System.Drawing; -using System.Globalization; -using System.ComponentModel; -using System.Security.Permissions; -using System.Web.Util; - -namespace System.Web.UI.WebControls { - - // CAS - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public class WebColorConverter : ColorConverter - { - // Converts from string to Color - public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) - { - if (value is string) { - string s = ((string)value).Trim(); - return ColorTranslator.FromHtml (s); - } - - return base.ConvertFrom (context, culture, value); - } - - // Converts from Color to string - public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) - { - if (!(value is Color) || destinationType != typeof (string)) - return base.ConvertTo (context, culture, value, destinationType); - - Color c = (Color) value; - - if (culture == null) - culture = Helpers.InvariantCulture; - - string s = c.ToKnownColor ().ToString (); - if (s != "0") - return s; - - return String.Concat ("#", c.R.ToString ("X2"), c.G.ToString ("X2"), c.B.ToString ("X2")); - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/ClientIDMode.cs b/mcs/class/System.Web/System.Web.UI/ClientIDMode.cs deleted file mode 100644 index 75a4af78b2..0000000000 --- a/mcs/class/System.Web/System.Web.UI/ClientIDMode.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// Authors: -// Marek Habersack (mhabersack@novell.com) -// -// (C) 2002,2003 Ximian, Inc. (http://www.ximian.com) -// Copyright (C) 2003-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI -{ - public enum ClientIDMode - { - Inherit, - AutoID, - Predictable, - Static - } -} diff --git a/mcs/class/System.Web/System.Web.UI/ConflictOptions.cs b/mcs/class/System.Web/System.Web.UI/ConflictOptions.cs deleted file mode 100644 index 448054872e..0000000000 --- a/mcs/class/System.Web/System.Web.UI/ConflictOptions.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.ConflictOptions.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI { - public enum ConflictOptions { - OverwriteChanges = 0, - CompareAllValues = 1 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/ConstructorNeedsTagAttribute.cs b/mcs/class/System.Web/System.Web.UI/ConstructorNeedsTagAttribute.cs deleted file mode 100644 index 3e30cbadb2..0000000000 --- a/mcs/class/System.Web/System.Web.UI/ConstructorNeedsTagAttribute.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// System.Web.UI.ConstructorNeedsTagAttribute.cs -// -// Duncan Mak (duncan@ximian.com) -// -// (C) Ximian, Inc. -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Security.Permissions; - -namespace System.Web.UI { - - // CAS - no InheritanceDemand here as the class is sealed - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - // attributes - [AttributeUsage (AttributeTargets.Class)] - public sealed class ConstructorNeedsTagAttribute : Attribute - { - bool needsTag; - - public ConstructorNeedsTagAttribute () - { - needsTag = false; - } - - public ConstructorNeedsTagAttribute (bool needsTag) - { - this.needsTag = needsTag; - } - - public bool NeedsTag { - get { return needsTag; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/ControlBuilderAttribute.cs b/mcs/class/System.Web/System.Web.UI/ControlBuilderAttribute.cs deleted file mode 100644 index be84ba2516..0000000000 --- a/mcs/class/System.Web/System.Web.UI/ControlBuilderAttribute.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// System.Web.UI.ControlBuilderAttribute.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// Gonzalo Paniagua Javier (gonzalo@ximian.com) -// Sebastien Pouliot -// -// (C) 2002 Ximian, Inc. (http://www.ximian.com) -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Security.Permissions; - -namespace System.Web.UI { - - // CAS - no InheritanceDemand here as the class is sealed - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - // attributes - [AttributeUsage (AttributeTargets.Class)] - public sealed class ControlBuilderAttribute : Attribute - { - Type builderType; - public static readonly ControlBuilderAttribute Default = new ControlBuilderAttribute (null); - - public ControlBuilderAttribute (Type builderType) - { - this.builderType = builderType; - } - - public Type BuilderType { - get { return builderType; } - } - - public override bool Equals (object obj) - { - ControlBuilderAttribute cba = (obj as ControlBuilderAttribute); - if (cba == null) - return false; - return (cba.builderType == builderType); - } - - public override int GetHashCode () - { - return base.GetHashCode (); - } - - public override bool IsDefaultAttribute () - { - return (builderType == null); - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/CssClassPropertyAttribute.cs b/mcs/class/System.Web/System.Web.UI/CssClassPropertyAttribute.cs deleted file mode 100644 index 10d77ede62..0000000000 --- a/mcs/class/System.Web/System.Web.UI/CssClassPropertyAttribute.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// System.Web.UI.CssClassPropertyAttribute -// -// Authors: -// Atsushi Enomoto -// -// (C) 2008-2010 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; -using System.Security.Permissions; - -namespace System.Web.UI { - [AttributeUsage (AttributeTargets.Property)] - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public sealed class CssClassPropertyAttribute : Attribute - { - public CssClassPropertyAttribute () - { - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/DataBindingHandlerAttribute.cs b/mcs/class/System.Web/System.Web.UI/DataBindingHandlerAttribute.cs deleted file mode 100644 index d5ff98455d..0000000000 --- a/mcs/class/System.Web/System.Web.UI/DataBindingHandlerAttribute.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// System.Web.UI.WebControls.DataBindingHandlerAttribute class -// -// Author: Duncan Mak (duncan@novell.com) -// -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Security.Permissions; - -namespace System.Web.UI { - - // CAS - no InheritanceDemand here as the class is sealed - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - // attributes - [AttributeUsage (AttributeTargets.Class)] - public sealed class DataBindingHandlerAttribute : Attribute - { - string name; - - static DataBindingHandlerAttribute () - { - Default = new DataBindingHandlerAttribute (); - } - - public DataBindingHandlerAttribute () - : this (String.Empty) - { - } - - public DataBindingHandlerAttribute (string name) - { - this.name = (name != null) ? name : String.Empty; - } - - public DataBindingHandlerAttribute (Type type) - { - this.name = type.AssemblyQualifiedName; - } - - public static readonly DataBindingHandlerAttribute Default; - - public override bool Equals (object obj) - { - DataBindingHandlerAttribute other = obj as DataBindingHandlerAttribute; - if (other == null) { - return false; - } - - return HandlerTypeName.Equals (other.HandlerTypeName); - } - - public override int GetHashCode () - { - return HandlerTypeName.GetHashCode (); - } - - public string HandlerTypeName { - get { return name; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/DataKeyPropertyAttribute.cs b/mcs/class/System.Web/System.Web.UI/DataKeyPropertyAttribute.cs deleted file mode 100644 index efb9c58601..0000000000 --- a/mcs/class/System.Web/System.Web.UI/DataKeyPropertyAttribute.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// Authors: -// Marek Habersack -// -// (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; - -namespace System.Web.UI -{ - [AttributeUsage (AttributeTargets.Class)] - public sealed class DataKeyPropertyAttribute : Attribute - { - public string Name { get; private set; } - - public DataKeyPropertyAttribute (string name) - { - this.Name = name; - } - - public override bool Equals (object obj) - { - var attr = obj as DataKeyPropertyAttribute; - if (attr == null) - return false; - - return String.Compare (this.Name, attr.Name, StringComparison.Ordinal) == 0; - } - - public override int GetHashCode () - { - string name = Name; - if (name == null) - return 0; - - return name.GetHashCode (); - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/DataSourceCacheExpiry.cs b/mcs/class/System.Web/System.Web.UI/DataSourceCacheExpiry.cs deleted file mode 100644 index 8413fc9562..0000000000 --- a/mcs/class/System.Web/System.Web.UI/DataSourceCacheExpiry.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.UI.DataSourceCacheExpiry.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI { - public enum DataSourceCacheExpiry { - Absolute = 0, - Sliding = 1 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/DataSourceCapabilities.cs b/mcs/class/System.Web/System.Web.UI/DataSourceCapabilities.cs deleted file mode 100644 index 0de8d95c22..0000000000 --- a/mcs/class/System.Web/System.Web.UI/DataSourceCapabilities.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.DataSourceCapabilities.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI { - [Flags] - public enum DataSourceCapabilities { - None = 0, - Sort = 1, - Page = 2, - RetrieveTotalRowCount = 4 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/DataSourceOperation.cs b/mcs/class/System.Web/System.Web.UI/DataSourceOperation.cs deleted file mode 100644 index 6cea69cb79..0000000000 --- a/mcs/class/System.Web/System.Web.UI/DataSourceOperation.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.DataSourceOperation.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI { - public enum DataSourceOperation { - Delete = 0, - Insert = 1, - Select = 2, - Update = 3, - SelectCount = 4 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/FileLevelControlBuilderAttribute.cs b/mcs/class/System.Web/System.Web.UI/FileLevelControlBuilderAttribute.cs deleted file mode 100644 index 16f6fba853..0000000000 --- a/mcs/class/System.Web/System.Web.UI/FileLevelControlBuilderAttribute.cs +++ /dev/null @@ -1,83 +0,0 @@ -// -// System.Web.UI.FileLevelControlBuilderAttribute.cs -// -// Authors: -// Arina Itkes (arinai@mainsoft.com) -// Marek Habersack (mhabersack@novell.com) -// -// (C) 2007 Mainsoft Co. (http://www.mainsoft.com) -// (C) 2009-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. -// - -namespace System.Web.UI -{ - [AttributeUsageAttribute (AttributeTargets.Class)] - public sealed class FileLevelControlBuilderAttribute : Attribute - { - public static readonly FileLevelControlBuilderAttribute Default = new FileLevelControlBuilderAttribute (null); - - public FileLevelControlBuilderAttribute (Type builderType) - { - this.BuilderType = builderType; - } - - public Type BuilderType { - get; - private set; - } - - public override bool Equals (Object obj) - { - var attr = obj as FileLevelControlBuilderAttribute; - return ((attr != null) && this.BuilderType == attr.BuilderType); - } - - public new static bool Equals (Object objA, Object objB) - { - var attrA = objA as FileLevelControlBuilderAttribute; - if (attrA == null) - return false; - - var attrB = objB as FileLevelControlBuilderAttribute; - if (attrB == null) - return false; - - return (attrA.BuilderType == attrB.BuilderType); - } - - public override int GetHashCode () - { - Type type = BuilderType; - if (type == null) - return base.GetHashCode (); - - return type.GetHashCode (); - } - - public override bool IsDefaultAttribute () - { - return this == Default; - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/FilterableAttribute.cs b/mcs/class/System.Web/System.Web.UI/FilterableAttribute.cs deleted file mode 100644 index afbfb3bb68..0000000000 --- a/mcs/class/System.Web/System.Web.UI/FilterableAttribute.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -// System.Web.UI.FilterableAttribute -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; - -namespace System.Web.UI { - [AttributeUsage (AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false, Inherited = true)] - public sealed class FilterableAttribute : Attribute - { - bool filterable; - - public FilterableAttribute (bool filterable) - { - this.filterable = filterable; - } - - public static readonly FilterableAttribute Default = new FilterableAttribute (true); - - public static readonly FilterableAttribute No = new FilterableAttribute (false); - - public static readonly FilterableAttribute Yes = new FilterableAttribute (true); - - public bool Filterable { - get { return filterable; } - } - - public override bool Equals (object obj) - { - if (obj != null && obj is FilterableAttribute) { - FilterableAttribute fa = (FilterableAttribute) obj; - return (this.filterable == fa.filterable); - } - return false; - } - - public override int GetHashCode () - { - return this.filterable.GetHashCode (); - } - - public override bool IsDefaultAttribute () - { - return Equals (Default); - } - - public static bool IsObjectFilterable (object obj) - { - return IsTypeFilterable (obj.GetType ()); - } - - public static bool IsPropertyFilterable (PropertyDescriptor propDesc) - { - System.ComponentModel.AttributeCollection attributes = propDesc.Attributes; - if (attributes.Count != 0) { - foreach (Attribute attrib in attributes) - if (attrib is FilterableAttribute) - return true; - } - return false; - } - - public static bool IsTypeFilterable (Type type) - { - Object [] attributes = type.GetCustomAttributes (typeof (FilterableAttribute), false); - if (attributes.Length != 0) { - foreach (Attribute attrib in attributes) - if (attrib is FilterableAttribute) - return true; - } - return false; - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterAttribute.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriterAttribute.cs deleted file mode 100644 index e4d334fb31..0000000000 --- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterAttribute.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// System.Web.UI.HtmlTextWriterTag -// -// Author: -// Ben Maurer -// -// (c) 2005-2010 Novell -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web.UI -{ - public enum HtmlTextWriterAttribute { - Accesskey, - Align, - Alt, - Background, - Bgcolor, - Border, - Bordercolor, - Cellpadding, - Cellspacing, - Checked, - Class, - Cols, - Colspan, - Disabled, - For, - Height, - Href, - Id, - Maxlength, - Multiple, - Name, - Nowrap, - Onchange, - Onclick, - ReadOnly, - Rows, - Rowspan, - Rules, - Selected, - Size, - Src, - Style, - Tabindex, - Target, - Title, - Type, - Valign, - Value, - Width, - Wrap, - Abbr, - AutoComplete, - Axis, - Content, - Coords, - DesignerRegion, - Dir, - Headers, - Longdesc, - Rel, - Scope, - Shape, - Usemap, - VCardName - } -} diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterStyle.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriterStyle.cs deleted file mode 100644 index 95c33db455..0000000000 --- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterStyle.cs +++ /dev/null @@ -1,76 +0,0 @@ -// -// System.Web.UI.HtmlTextWriterStyle -// -// Author: -// Ben Maurer -// -// (c) 2005-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. -// - -namespace System.Web.UI -{ - public enum HtmlTextWriterStyle { - BackgroundColor, - BackgroundImage, - BorderCollapse, - BorderColor, - BorderStyle, - BorderWidth, - Color, - FontFamily, - FontSize, - FontStyle, - FontWeight, - Height, - TextDecoration, - Width, - ListStyleImage, - ListStyleType, - Cursor, - Direction, - Display, - Filter, - FontVariant, - Left, - Margin, - MarginBottom, - MarginLeft, - MarginRight, - MarginTop, - Overflow, - OverflowX, - OverflowY, - Padding, - PaddingBottom, - PaddingLeft, - PaddingRight, - PaddingTop, - Position, - TextAlign, - VerticalAlign, - TextOverflow, - Top, - Visibility, - WhiteSpace, - ZIndex - } -} diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterTag.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriterTag.cs deleted file mode 100644 index 37277f5856..0000000000 --- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterTag.cs +++ /dev/null @@ -1,130 +0,0 @@ -// -// System.Web.UI.HtmlTextWriterTag -// -// Author: -// Ben Maurer -// -// (c) 2005-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. -// - -namespace System.Web.UI -{ - public enum HtmlTextWriterTag { - Unknown, - A, - Acronym, - Address, - Area, - B, - Base, - Basefont, - Bdo, - Bgsound, - Big, - Blockquote, - Body, - Br, - Button, - Caption, - Center, - Cite, - Code, - Col, - Colgroup, - Dd, - Del, - Dfn, - Dir, - Div, - Dl, - Dt, - Em, - Embed, - Fieldset, - Font, - Form, - Frame, - Frameset, - H1, - H2, - H3, - H4, - H5, - H6, - Head, - Hr, - Html, - I, - Iframe, - Img, - Input, - Ins, - Isindex, - Kbd, - Label, - Legend, - Li, - Link, - Map, - Marquee, - Menu, - Meta, - Nobr, - Noframes, - Noscript, - Object, - Ol, - Option, - P, - Param, - Pre, - Q, - Rt, - Ruby, - S, - Samp, - Script, - Select, - Small, - Span, - Strike, - Strong, - Style, - Sub, - Sup, - Table, - Tbody, - Td, - Textarea, - Tfoot, - Th, - Thead, - Title, - Tr, - Tt, - U, - Ul, - Var, - Wbr, - Xml - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IAttributeAccessor.cs b/mcs/class/System.Web/System.Web.UI/IAttributeAccessor.cs deleted file mode 100644 index 1b67f20f9b..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IAttributeAccessor.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.UI.IAttributeAccessor.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Web; - -namespace System.Web.UI -{ - public interface IAttributeAccessor - { - string GetAttribute(string key); - void SetAttribute(string key, string value); - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IAutoFieldGenerator.cs b/mcs/class/System.Web/System.Web.UI/IAutoFieldGenerator.cs deleted file mode 100644 index 22708f4e66..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IAutoFieldGenerator.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.UI.WebControls.IPersistedSelector.cs -// -// Author: -// Atsushi Enomoto -// -// (C) 2008-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Security.Permissions; -using System.Web; - -namespace System.Web.UI -{ - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public interface IAutoFieldGenerator - { - ICollection GenerateFields (Control control); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IBindableControl.cs b/mcs/class/System.Web/System.Web.UI/IBindableControl.cs deleted file mode 100644 index 6135da9ca4..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IBindableControl.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.UI.IBindableControl.cs -// -// Authors: -// Atsushi Enomoto -// -// (C) 2008-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections.Specialized; -using System.Security.Permissions; -using System.Web; - -namespace System.Web.UI -{ - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public interface IBindableControl - { - void ExtractValues (IOrderedDictionary dictionary); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IBindableTemplate.cs b/mcs/class/System.Web/System.Web.UI/IBindableTemplate.cs deleted file mode 100644 index 0fbb1fc6b1..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IBindableTemplate.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.IBindableTemplate.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections.Specialized; - -namespace System.Web.UI -{ - public interface IBindableTemplate: ITemplate - { - IOrderedDictionary ExtractValues (Control control); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/ICallbackEventHandler.cs b/mcs/class/System.Web/System.Web.UI/ICallbackEventHandler.cs deleted file mode 100644 index cd2a65b7d6..0000000000 --- a/mcs/class/System.Web/System.Web.UI/ICallbackEventHandler.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.ICallbackEventHandler.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI -{ - public interface ICallbackEventHandler - { - string GetCallbackResult (); - void RaiseCallbackEvent (string eventArgs); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IControlBuilderAccessor.cs b/mcs/class/System.Web/System.Web.UI/IControlBuilderAccessor.cs deleted file mode 100644 index cfd9a1dd53..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IControlBuilderAccessor.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.IControlBuilderAccessor.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI -{ - public interface IControlBuilderAccessor - { - ControlBuilder ControlBuilder { get; } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IControlDesignerAccessor.cs b/mcs/class/System.Web/System.Web.UI/IControlDesignerAccessor.cs deleted file mode 100644 index 51f1152594..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IControlDesignerAccessor.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// System.Web.UI.IControlDesignerAccessor.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Web.UI -{ - public interface IControlDesignerAccessor - { - - IDictionary GetDesignModeState (); - void SetDesignModeState (IDictionary designData); - void SetOwnerControl (Control control); - - IDictionary UserData { get; } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IDReferencePropertyAttribute.cs b/mcs/class/System.Web/System.Web.UI/IDReferencePropertyAttribute.cs deleted file mode 100644 index bfc7a33c4d..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IDReferencePropertyAttribute.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// System.Web.UI.IDReferencePropertyAttribute.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI -{ - public sealed class IDReferencePropertyAttribute : Attribute - { - Type controlType; - - public IDReferencePropertyAttribute () - { - } - - public IDReferencePropertyAttribute (Type controlReferenceType) - { - controlType = controlReferenceType; - } - - public override bool Equals (object obj) - { - if (obj != null && obj is IDReferencePropertyAttribute) - return (this.controlType == ((IDReferencePropertyAttribute) obj).controlType); - return false; - } - - public override int GetHashCode () - { - return controlType.GetHashCode (); - } - - public Type ReferencedControlType { - get { return controlType; } - } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IDataBindingsAccessor.cs b/mcs/class/System.Web/System.Web.UI/IDataBindingsAccessor.cs deleted file mode 100644 index 83cb04739a..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IDataBindingsAccessor.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.UI.IDataBindingsAccessor.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Web; - -namespace System.Web.UI -{ - public interface IDataBindingsAccessor - { - DataBindingCollection DataBindings {get;} - bool HasDataBindings {get;} - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IDataItemContainer.cs b/mcs/class/System.Web/System.Web.UI/IDataItemContainer.cs deleted file mode 100644 index ba9e3abd62..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IDataItemContainer.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.UI.IDataItemContainer.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI -{ - public interface IDataItemContainer: INamingContainer - { - object DataItem { get; } - int DataItemIndex { get; } - int DisplayIndex { get; } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IDataKeysControl.cs b/mcs/class/System.Web/System.Web.UI/IDataKeysControl.cs deleted file mode 100644 index d819c5279d..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IDataKeysControl.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// Authors: -// Marek Habersack -// -// (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.Web.UI.WebControls; - -namespace System.Web.UI -{ - public interface IDataKeysControl - { - string[] ClientIDRowSuffix { get; } - DataKeyArray ClientIDRowSuffixDataKeys { get; } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IDataSource.cs b/mcs/class/System.Web/System.Web.UI/IDataSource.cs deleted file mode 100644 index 33a21d318f..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IDataSource.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// System.Web.UI.IDataSource -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; -using System.Collections.Specialized; -using System.Text; - -namespace System.Web.UI { - public interface IDataSource { - event EventHandler DataSourceChanged; - DataSourceView GetView (string viewName); - ICollection GetViewNames (); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IDataSourceViewSchemaAccessor.cs b/mcs/class/System.Web/System.Web.UI/IDataSourceViewSchemaAccessor.cs deleted file mode 100644 index 63d4f2ea6e..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IDataSourceViewSchemaAccessor.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.IDataSourceViewSchemaAccessor.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI -{ - public interface IDataSourceViewSchemaAccessor - { - object DataSourceViewSchema { get; set; } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IExpressionsAccessor.cs b/mcs/class/System.Web/System.Web.UI/IExpressionsAccessor.cs deleted file mode 100644 index 22f497d7a3..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IExpressionsAccessor.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.IExpressionsAccessor.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI -{ - public interface IExpressionsAccessor - { - ExpressionBindingCollection Expressions { get; } - bool HasExpressions { get; } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IFilterResolutionService.cs b/mcs/class/System.Web/System.Web.UI/IFilterResolutionService.cs deleted file mode 100644 index a6111e5a3e..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IFilterResolutionService.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.IFilterResolutionService.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI -{ - public interface IFilterResolutionService - { - int CompareFilters (string filter1, string filter2); - bool EvaluateFilter (string filterName); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IHierarchicalDataSource.cs b/mcs/class/System.Web/System.Web.UI/IHierarchicalDataSource.cs deleted file mode 100644 index 5416a4cb5f..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IHierarchicalDataSource.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.UI.IHierarchicalDataSource -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; -using System.Collections.Specialized; -using System.Text; - -namespace System.Web.UI { - public interface IHierarchicalDataSource { - event EventHandler DataSourceChanged; - HierarchicalDataSourceView GetHierarchicalView (string viewPath); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IHierarchicalEnumerable.cs b/mcs/class/System.Web/System.Web.UI/IHierarchicalEnumerable.cs deleted file mode 100644 index ca3f1a5341..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IHierarchicalEnumerable.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.IHierarchicalEnumerable -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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; - -namespace System.Web.UI { - public interface IHierarchicalEnumerable : IEnumerable { - IHierarchyData GetHierarchyData (object enumeratedItem); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IHierarchyData.cs b/mcs/class/System.Web/System.Web.UI/IHierarchyData.cs deleted file mode 100644 index 800e732468..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IHierarchyData.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.IHierarchyData -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web.UI { - public interface IHierarchyData { - IHierarchicalEnumerable GetChildren (); - IHierarchyData GetParent (); - bool HasChildren { get; } - object Item { get; } - string Path { get; } - string Type { get; } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/INamingContainer.cs b/mcs/class/System.Web/System.Web.UI/INamingContainer.cs deleted file mode 100644 index 62cf0654e6..0000000000 --- a/mcs/class/System.Web/System.Web.UI/INamingContainer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.INamingContainer.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Web; - -namespace System.Web.UI -{ - public interface INamingContainer - { - } -} diff --git a/mcs/class/System.Web/System.Web.UI/INavigateUIData.cs b/mcs/class/System.Web/System.Web.UI/INavigateUIData.cs deleted file mode 100644 index d48d595208..0000000000 --- a/mcs/class/System.Web/System.Web.UI/INavigateUIData.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.INavigateUIData -// -// Authors: -// Ben Maurer (bmaurer@users.sourceforge.net) -// -// (C) 2003 Ben Maurer -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web.UI -{ - public interface INavigateUIData { - string Name { get; } - string NavigateUrl { get; } - string Value { get; } - string Description { get; } - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/INonBindingContainer.cs b/mcs/class/System.Web/System.Web.UI/INonBindingContainer.cs deleted file mode 100644 index 5f428e58c6..0000000000 --- a/mcs/class/System.Web/System.Web.UI/INonBindingContainer.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// System.Web.UI.INonBindingContainer -// -// Authors: -// Marek Habersack (mhabersack@novell.com) -// -// (C) 2008-2010 Novell, Inc. (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -namespace System.Web.UI -{ - // Apparently this attribute is used in place of our BINDING_CONTAINER control mask bit, - // which makes sense as in certain scenarios (e.g. TemplateControlAttribute naming a - // container type which cannot be used for two-way binding) the check must be made on type, - // not on object. - // - // This interface is briefly mentioned in: - // http://www.developmentnow.com/g/10_2006_6_0_0_776419/DataBinding-to-SubProperties.htm - // - // For a sample of why this is needed, see: - // - // http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.templatepagerfield.pagertemplate.aspx - // The C# code on the above page won't work without this interface being implemented and - // used in ControlBuilder.BindingContainerType. The reason why the sample wouldn't work is - // that the TemplatePagerField.PagerTemplate property carries a custom TemplateContainer - // (typeof (DataPagerFieldItem)) attribute and, without INonBindingContainer interface - // attached to DataPagerFieldItem, mono would generate code with the Container and - // BindingContainer referring to DataPagerFieldItem. In such case, attempting to access - // DataPager properties would obviously fail. Looking at the MS.NET generated code, - // Container and BindingContainer are of the DataPager type in this instance. - // - internal interface INonBindingContainer - { - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IParserAccessor.cs b/mcs/class/System.Web/System.Web.UI/IParserAccessor.cs deleted file mode 100644 index f49d833839..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IParserAccessor.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.IParserAccessor.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Web; - -namespace System.Web.UI -{ - public interface IParserAccessor - { - void AddParsedSubObject(object obj); - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IPostBackDataHandler.cs b/mcs/class/System.Web/System.Web.UI/IPostBackDataHandler.cs deleted file mode 100644 index 4b3ff91160..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IPostBackDataHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// System.Web.UI.IPostBackDataHandler.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Web; -using System.Collections.Specialized; - -namespace System.Web.UI -{ - public interface IPostBackDataHandler - { - bool LoadPostData(string postDataKey, NameValueCollection postCollection); - void RaisePostDataChangedEvent(); - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IPostBackEventHandler.cs b/mcs/class/System.Web/System.Web.UI/IPostBackEventHandler.cs deleted file mode 100644 index 94daa50724..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IPostBackEventHandler.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.IPostBackEventHandler.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Web; - -namespace System.Web.UI -{ - public interface IPostBackEventHandler - { - void RaisePostBackEvent(string eventArgument); - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IResourceUrlGenerator.cs b/mcs/class/System.Web/System.Web.UI/IResourceUrlGenerator.cs deleted file mode 100644 index 496cc9992b..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IResourceUrlGenerator.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.IResourceUrlGenerator.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI -{ - public interface IResourceUrlGenerator - { - string GetResourceUrl (Type type, string resource); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IStateFormatter.cs b/mcs/class/System.Web/System.Web.UI/IStateFormatter.cs deleted file mode 100644 index 10378d34b8..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IStateFormatter.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// System.Web.UI.IStateFormatter.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; - -namespace System.Web.UI -{ - public interface IStateFormatter - { - object Deserialize (string serializationState); - string Serialize (object state); - } -} - - diff --git a/mcs/class/System.Web/System.Web.UI/IStateManager.cs b/mcs/class/System.Web/System.Web.UI/IStateManager.cs deleted file mode 100644 index 64a189428d..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IStateManager.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// System.Web.UI.IStateManager.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Web; - -namespace System.Web.UI -{ - public interface IStateManager - { - void LoadViewState(object state); - object SaveViewState(); - void TrackViewState(); - bool IsTrackingViewState { get; } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IStyleSheet.cs b/mcs/class/System.Web/System.Web.UI/IStyleSheet.cs deleted file mode 100644 index dc1256c959..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IStyleSheet.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.UI.IStyleSheet.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Web.UI.WebControls; - -namespace System.Web.UI -{ - public interface IStyleSheet - { - void CreateStyleRule (Style style, IUrlResolutionService urlResolver, string selection); - void RegisterStyle (Style style, IUrlResolutionService urlResolver); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/ITemplate.cs b/mcs/class/System.Web/System.Web.UI/ITemplate.cs deleted file mode 100644 index 9ebb6a470e..0000000000 --- a/mcs/class/System.Web/System.Web.UI/ITemplate.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.ITemplate.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Web; - -namespace System.Web.UI -{ - public interface ITemplate - { - void InstantiateIn(Control container); - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IThemeResolutionService.cs b/mcs/class/System.Web/System.Web.UI/IThemeResolutionService.cs deleted file mode 100644 index df19c8c1bb..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IThemeResolutionService.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.UI.IThemeResolutionService.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Web.UI -{ - public interface IThemeResolutionService - { - ThemeProvider [] GetAllThemeProviders (); - ThemeProvider GetStylesheetThemeProvider (); - ThemeProvider GetThemeProvider (); - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IUrlResolutionService.cs b/mcs/class/System.Web/System.Web.UI/IUrlResolutionService.cs deleted file mode 100644 index 8b01605206..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IUrlResolutionService.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.IUrlResolutionService.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Web.UI -{ - public interface IUrlResolutionService - { - string ResolveClientUrl (string url); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IUserControlDesignerAccessor.cs b/mcs/class/System.Web/System.Web.UI/IUserControlDesignerAccessor.cs deleted file mode 100644 index 064d994dd0..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IUserControlDesignerAccessor.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.IUserControlDesignerAccessor.cs -// -// Author: -// Andreas Nahr (ClassDevelopment@A-SoftTech.com) -// -// (C) 2003 Andreas Nahr -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web.UI -{ - public interface IUserControlDesignerAccessor - { - string InnerText { get; set; } - string TagName { get; set; } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/IUserControlTypeResolutionService.cs b/mcs/class/System.Web/System.Web.UI/IUserControlTypeResolutionService.cs deleted file mode 100644 index 3629bde724..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IUserControlTypeResolutionService.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.UI.IUserControlTypeResolutionService.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Web.UI -{ - public interface IUserControlTypeResolutionService - { - Type GetType (string prefixTag, string tagName); - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/IValidator.cs b/mcs/class/System.Web/System.Web.UI/IValidator.cs deleted file mode 100644 index 60aed884c7..0000000000 --- a/mcs/class/System.Web/System.Web.UI/IValidator.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// System.Web.UI.IValidator.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Web; - -namespace System.Web.UI -{ - public interface IValidator - { - void Validate(); - string ErrorMessage {get; set;} - bool IsValid {get; set;} - } -} diff --git a/mcs/class/System.Web/System.Web.UI/ImageClickEventHandler.cs b/mcs/class/System.Web/System.Web.UI/ImageClickEventHandler.cs deleted file mode 100644 index b3609051dd..0000000000 --- a/mcs/class/System.Web/System.Web.UI/ImageClickEventHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.UI.ImageClickEventHandler.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Web; - -namespace System.Web.UI -{ - public delegate void ImageClickEventHandler(object sender, ImageClickEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web.UI/NonVisualControlAttribute.cs b/mcs/class/System.Web/System.Web.UI/NonVisualControlAttribute.cs deleted file mode 100644 index e5950e69cf..0000000000 --- a/mcs/class/System.Web/System.Web.UI/NonVisualControlAttribute.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// System.Web.UI.WebControls.NonVisualControlAttribute.cs -// -// Authors: -// Lluis Sanchez Gual (lluis@novell.com) -// -// (C) 2005-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Web.UI -{ - public sealed class NonVisualControlAttribute: Attribute - { - public static readonly NonVisualControlAttribute Visual = new NonVisualControlAttribute (false); - public static readonly NonVisualControlAttribute NonVisual = new NonVisualControlAttribute (true); - public static readonly NonVisualControlAttribute Default = Visual; - - bool nonVisual; - - public NonVisualControlAttribute (): this (true) - { - } - - public NonVisualControlAttribute (bool nonVisual) - { - this.nonVisual = nonVisual; - } - - public override bool Equals (object obj) - { - NonVisualControlAttribute ot = obj as NonVisualControlAttribute; - return ot != null && ot.nonVisual == nonVisual; - } - - public override int GetHashCode () - { - return GetType().GetHashCode () + nonVisual.GetHashCode (); - } - - public override bool IsDefaultAttribute () - { - return Equals (Default); - } - - public bool IsNonVisual { - get { return nonVisual; } - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/PersistChildrenAttribute.cs b/mcs/class/System.Web/System.Web.UI/PersistChildrenAttribute.cs deleted file mode 100644 index 35f6fad68b..0000000000 --- a/mcs/class/System.Web/System.Web.UI/PersistChildrenAttribute.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// System.Web.UI.PersistChildrenAttribute.cs -// -// Duncan Mak (duncan@ximian.com) -// -// (C) Ximian, Inc. -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Security.Permissions; - -namespace System.Web.UI { - - // CAS - no InheritanceDemand here as the class is sealed - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - // attributes - [AttributeUsage (AttributeTargets.Class)] - public sealed class PersistChildrenAttribute : Attribute - { - bool persist; - bool usesCustomPersistence; - - public PersistChildrenAttribute (bool persist) - { - this.persist = persist; - } - - public PersistChildrenAttribute (bool persist, - bool usesCustomPersistence) - { - this.persist = persist; - this.usesCustomPersistence = usesCustomPersistence; - } - - public static readonly PersistChildrenAttribute Default = new PersistChildrenAttribute (true); - public static readonly PersistChildrenAttribute Yes = new PersistChildrenAttribute (true); - public static readonly PersistChildrenAttribute No = new PersistChildrenAttribute (false); - - public bool Persist { - get { return persist; } - } - - public bool UsesCustomPersistence - { - get { - return (usesCustomPersistence); - } - } - - public override bool Equals (object obj) - { - PersistChildrenAttribute pobj = (obj as PersistChildrenAttribute); - if (pobj == null) - return false; - - return (pobj.persist == persist && pobj.usesCustomPersistence == usesCustomPersistence); - } - - public override int GetHashCode () - { - return persist ? 1 : 0; - } - - public override bool IsDefaultAttribute () - { - /* No idea what the usesCustomPersistence - * default is (I assume false, but its not - * documented) - */ - return (persist == true); - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/PersistenceMode.cs b/mcs/class/System.Web/System.Web.UI/PersistenceMode.cs deleted file mode 100644 index 125ed53ffd..0000000000 --- a/mcs/class/System.Web/System.Web.UI/PersistenceMode.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// System.Web.UI.PersistenceMode.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Web; - -namespace System.Web.UI -{ - public enum PersistenceMode - { - Attribute = 0, - InnerProperty = 1, - InnerDefaultProperty = 2, - EncodedInnerDefaultProperty = 3, - } -} diff --git a/mcs/class/System.Web/System.Web.UI/SupportsEventValidationAttribute.cs b/mcs/class/System.Web/System.Web.UI/SupportsEventValidationAttribute.cs deleted file mode 100644 index f0f166276d..0000000000 --- a/mcs/class/System.Web/System.Web.UI/SupportsEventValidationAttribute.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// System.Web.UI.SupportsEventValidationAttribute class -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Security.Permissions; - -namespace System.Web.UI -{ - // CAS - no InheritanceDemand here as the class is sealed - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - // attributes - [AttributeUsage (AttributeTargets.Class)] - public sealed class SupportsEventValidationAttribute : Attribute - { - public SupportsEventValidationAttribute () - { - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/TemplateInstance.cs b/mcs/class/System.Web/System.Web.UI/TemplateInstance.cs deleted file mode 100644 index 6cf743d637..0000000000 --- a/mcs/class/System.Web/System.Web.UI/TemplateInstance.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// System.Web.UI.TemplateInstance.cs -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI -{ - public enum TemplateInstance - { - Multiple = 0, - Single = 1 - } -} - diff --git a/mcs/class/System.Web/System.Web.UI/TemplateInstanceAttribute.cs b/mcs/class/System.Web/System.Web.UI/TemplateInstanceAttribute.cs deleted file mode 100644 index 282915e2fd..0000000000 --- a/mcs/class/System.Web/System.Web.UI/TemplateInstanceAttribute.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// System.Web.UI.TemplateInstanceAttribute.cs -// -// Noam Lampert (noaml@mainsoft.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System.ComponentModel; -using System.Security.Permissions; - -namespace System.Web.UI -{ - // attributes - [AttributeUsage (AttributeTargets.Property)] - public sealed class TemplateInstanceAttribute : Attribute - { - #region Fields - - readonly TemplateInstance _instance; - - public static readonly TemplateInstanceAttribute Single; - public static readonly TemplateInstanceAttribute Multiple; - public static readonly TemplateInstanceAttribute Default; - - #endregion - - #region Constructors - - static TemplateInstanceAttribute () { - Single = new TemplateInstanceAttribute (TemplateInstance.Single); - Multiple = new TemplateInstanceAttribute (TemplateInstance.Multiple); - Default = Multiple; - } - - #endregion - - #region Properties - - public TemplateInstance Instances { get { return _instance; } } - - #endregion - - #region Methods - - public TemplateInstanceAttribute (TemplateInstance instance) { - _instance = instance; - } - - public override bool IsDefaultAttribute () { - return Equals (Default); - } - - public override bool Equals (object obj) { - if (this == obj) - return true; - - TemplateInstanceAttribute other = obj as TemplateInstanceAttribute; - if (obj == null) - return false; - - return Instances == other.Instances; - } - - public override int GetHashCode () { - return (int) Instances; - } - - #endregion - } -} diff --git a/mcs/class/System.Web/System.Web.UI/ThemeableAttribute.cs b/mcs/class/System.Web/System.Web.UI/ThemeableAttribute.cs deleted file mode 100644 index 6dc7d59728..0000000000 --- a/mcs/class/System.Web/System.Web.UI/ThemeableAttribute.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// System.Web.UI.ThemeableAttribute -// -// Authors: -// Sanjay Gupta (gsanjay@novell.com) -// -// (C) 2004 Novell, Inc. (http://www.novell.com) -// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; -using System.Security.Permissions; - -namespace System.Web.UI -{ - // CAS - no InheritanceDemand here as the class is sealed - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - // attributes - [AttributeUsage (AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false, Inherited = true)] - public sealed class ThemeableAttribute : Attribute { - - bool themeable; - public ThemeableAttribute (bool themeable) - { - this.themeable = themeable; - } - - public static readonly ThemeableAttribute Default = new ThemeableAttribute (true); - - public static readonly ThemeableAttribute No = new ThemeableAttribute (false); - - public static readonly ThemeableAttribute Yes = new ThemeableAttribute (true); - - public bool Themeable { - get { return themeable; } - } - - public override bool Equals (object obj) - { - if (obj != null && obj is ThemeableAttribute) { - ThemeableAttribute ta = (ThemeableAttribute) obj; - return (this.themeable == ta.themeable); - } - return false; - } - - public override int GetHashCode () - { - return this.themeable.GetHashCode (); - } - - public override bool IsDefaultAttribute() - { - return Equals (Default); - } - - public static bool IsObjectThemeable (object obj) - { - return IsTypeThemeable (obj.GetType ()); - } - - public static bool IsTypeThemeable (Type type) - { - Object [] attributes = type.GetCustomAttributes (typeof (ThemeableAttribute), false); - if (attributes.Length != 0) { - foreach (Attribute attrib in attributes) - if (attrib is ThemeableAttribute) - return true; - } - return false; - } - } -} diff --git a/mcs/class/System.Web/System.Web.UI/ViewStateEncryptionMode.cs b/mcs/class/System.Web/System.Web.UI/ViewStateEncryptionMode.cs deleted file mode 100644 index 03593a04b4..0000000000 --- a/mcs/class/System.Web/System.Web.UI/ViewStateEncryptionMode.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.Configuration.ViewStateEncryptionMode -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2005-2010 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web.UI -{ - public enum ViewStateEncryptionMode - { - Auto, - Always, - Never - } -} diff --git a/mcs/class/System.Web/System.Web.Util/HttpEncoder.cs b/mcs/class/System.Web/System.Web.Util/HttpEncoder.cs index 2629156713..abf6238524 100644 --- a/mcs/class/System.Web/System.Web.Util/HttpEncoder.cs +++ b/mcs/class/System.Web/System.Web.Util/HttpEncoder.cs @@ -35,7 +35,7 @@ using System.Collections.Generic; using System.Configuration; using System.IO; using System.Text; -#if !NO_SYSTEM_WEB_DEPENDENCY && NET_4_0 && !MOBILE +#if !NO_SYSTEM_WEB_DEPENDENCY && !MOBILE using System.Web.Configuration; #endif diff --git a/mcs/class/System.Web/System.Web.Util/IWebObjectFactory.cs b/mcs/class/System.Web/System.Web.Util/IWebObjectFactory.cs deleted file mode 100644 index 890d1d5d40..0000000000 --- a/mcs/class/System.Web/System.Web.Util/IWebObjectFactory.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.Web.Util.IWebObjectFactory interface -// -// Author: -// Sebastien Pouliot -// -// 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. -// - - -namespace System.Web.Util { - - public interface IWebObjectFactory { - - object CreateInstance (); - } -} - diff --git a/mcs/class/System.Web/System.Web.Util/RequestValidationSource.cs b/mcs/class/System.Web/System.Web.Util/RequestValidationSource.cs deleted file mode 100644 index 7153d719d3..0000000000 --- a/mcs/class/System.Web/System.Web.Util/RequestValidationSource.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// 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. -// -namespace System.Web.Util -{ - public enum RequestValidationSource - { - QueryString, - Form, - Cookies, - Files, - RawUrl, - Path, - PathInfo, - Headers - } -} diff --git a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs index 4f07e83f13..e229a913f8 100644 --- a/mcs/class/System.Web/System.Web.Util/UrlUtils.cs +++ b/mcs/class/System.Web/System.Web.Util/UrlUtils.cs @@ -54,7 +54,7 @@ namespace System.Web.Util { if (path.StartsWith (appvpath)) path = path.Substring (appvpath.Length); - if (path [0] == '/') + if (path.StartsWith("/")) path = path.Length > 1 ? path.Substring (1) : ""; return Canonic (appvpath + "(" + id + ")/" + path); diff --git a/mcs/class/System.Web/System.Web.dll.sources b/mcs/class/System.Web/System.Web.dll.sources index ef284f5be9..4e492be3e4 100644 --- a/mcs/class/System.Web/System.Web.dll.sources +++ b/mcs/class/System.Web/System.Web.dll.sources @@ -73,8 +73,8 @@ System.Web.Compilation/BuildManagerDirectoryBuilder.cs System.Web.Compilation/BuildManagerRemoveEntryEventHandler.cs System.Web.Compilation/BuildManagerHostUnloadEventArgs.cs System.Web.Compilation/BuildManagerHostUnloadEventHandler.cs -System.Web.Compilation/BuildProviderAppliesToAttribute.cs -System.Web.Compilation/BuildProviderAppliesTo.cs +../../../external/referencesource/System.Web/Compilation/BuildProviderAppliesToAttribute.cs +../../../external/referencesource/System.Web/Compilation/BuildProviderAppliesTo.cs System.Web.Compilation/BuildProviderGroup.cs System.Web.Compilation/BuildProviderResultFlags.cs System.Web.Compilation/BuildProvider.cs @@ -87,20 +87,19 @@ System.Web.Compilation/CompilerType.cs System.Web.Compilation/ConnectionStringsExpressionBuilder.cs System.Web.Compilation/DefaultResourceProviderFactory.cs System.Web.Compilation/DefaultResourceProvider.cs -System.Web.Compilation/DesignTimeResourceProviderFactoryAttribute.cs +../../../external/referencesource/System.Web/Compilation/DesignTimeResourceProviderFactoryAttribute.cs System.Web.Compilation/Directive.cs System.Web.Compilation/ExpressionBuilderContext.cs System.Web.Compilation/ExpressionBuilder.cs -System.Web.Compilation/ExpressionEditorAttribute.cs -System.Web.Compilation/ExpressionPrefixAttribute.cs +../../../external/referencesource/System.Web/Compilation/ExpressionEditorAttribute.cs +../../../external/referencesource/System.Web/Compilation/ExpressionPrefixAttribute.cs System.Web.Compilation/ForceCopyBuildProvider.cs System.Web.Compilation/GenericBuildProvider.cs System.Web.Compilation/GlobalAsaxCompiler.cs -System.Web.Compilation/IAssemblyPostProcessor.cs +../../../external/referencesource/System.Web/Compilation/IAssemblyPostProcessor.cs System.Web.Compilation/IgnoreFileBuildProvider.cs -System.Web.Compilation/IImplicitResourceProvider.cs +../../../external/referencesource/System.Web/Compilation/IImplicitResourceProvider.cs System.Web.Compilation/ILocation.cs -System.Web.Compilation/ImplicitResourceKey.cs System.Web.Compilation/IResourceProvider.cs System.Web.Compilation/LinePragmaCodeInfo.cs System.Web.Compilation/Location.cs @@ -140,14 +139,14 @@ System.Web.Configuration_2.0/nBrowser/File.cs System.Web.Configuration_2.0/nBrowser/Build.cs System.Web.Configuration_2.0/nBrowser/Node.cs System.Web.Configuration_2.0/nBrowser/Exception.cs -System.Web.Configuration_2.0/AdapterDictionary.cs +../../../external/referencesource/System.Web/Configuration/AdapterDictionary.cs System.Web.Configuration_2.0/AnonymousIdentificationSection.cs System.Web.Configuration_2.0/ApplicationSettingsConfigurationFileMap.cs System.Web.Configuration_2.0/AssemblyCollection.cs System.Web.Configuration_2.0/AssemblyInfo.cs -System.Web.Configuration_2.0/AuthenticationMode.cs +../../../external/referencesource/System.Web/Configuration/AuthenticationMode.cs System.Web.Configuration_2.0/AuthenticationSection.cs -System.Web.Configuration_2.0/AuthorizationRuleAction.cs +../../../external/referencesource/System.Web/Configuration/AuthorizationRuleAction.cs System.Web.Configuration_2.0/AuthorizationRule.cs System.Web.Configuration_2.0/AuthorizationRuleCollection.cs System.Web.Configuration_2.0/AuthorizationSection.cs @@ -166,9 +165,9 @@ System.Web.Configuration_2.0/Compiler.cs System.Web.Configuration_2.0/CompilerCollection.cs System.Web.Configuration_2.0/CustomError.cs System.Web.Configuration_2.0/CustomErrorCollection.cs -System.Web.Configuration_2.0/CustomErrorsMode.cs +../../../external/referencesource/System.Web/Configuration/CustomErrorsMode.cs System.Web.Configuration_2.0/CustomErrorsSection.cs -System.Web.Configuration_2.0/CustomErrorsRedirectMode.cs +../../../external/referencesource/System.Web/Configuration/CustomErrorsRedirectMode.cs System.Web.Configuration_2.0/DeploymentSection.cs System.Web.Configuration_2.0/EventMappingSettings.cs System.Web.Configuration_2.0/EventMappingSettingsCollection.cs @@ -178,8 +177,8 @@ System.Web.Configuration_2.0/FormsAuthenticationConfiguration.cs System.Web.Configuration_2.0/FormsAuthenticationCredentials.cs System.Web.Configuration_2.0/FormsAuthenticationUser.cs System.Web.Configuration_2.0/FormsAuthenticationUserCollection.cs -System.Web.Configuration_2.0/FormsAuthPasswordFormat.cs -System.Web.Configuration_2.0/FormsProtectionEnum.cs +../../../external/referencesource/System.Web/Configuration/FormsAuthPasswordFormat.cs +../../../external/referencesource/System.Web/Configuration/FormsProtectionEnum.cs System.Web.Configuration_2.0/GlobalizationSection.cs System.Web.Configuration_2.0/HandlersUtil.cs System.Web.Configuration_2.0/HealthMonitoringSection.cs @@ -196,14 +195,14 @@ System.Web.Configuration_2.0/HttpModuleActionCollection.cs System.Web.Configuration_2.0/HttpModulesSection.cs System.Web.Configuration_2.0/HttpRuntimeSection.cs System.Web.Configuration_2.0/IdentitySection.cs -System.Web.Configuration_2.0/IConfigMapPath.cs -System.Web.Configuration_2.0/IConfigMapPathFactory.cs -System.Web.Configuration_2.0/IRemoteWebConfigurationHostServer.cs +../../../external/referencesource/System.Web/Configuration/IConfigMapPath.cs +../../../external/referencesource/System.Web/Configuration/IConfigMapPathFactory.cs +../../../external/referencesource/System.Web/Configuration/IRemoteWebConfigurationHostServer.cs System.Web.Configuration_2.0/LowerCaseStringConverter.cs System.Web.Configuration_2.0/LruCache.cs System.Web.Configuration_2.0/MachineKeyRegistryStorage.cs System.Web.Configuration_2.0/MachineKeySection.cs -System.Web.Configuration_2.0/MachineKeyValidation.cs +../../../external/referencesource/System.Web/Configuration/MachineKeyValidation.cs System.Web.Configuration_2.0/MachineKeyValidationConverter.cs System.Web.Configuration_2.0/MembershipSection.cs System.Web.Configuration_2.0/MonoSettingsSection.cs @@ -214,14 +213,14 @@ System.Web.Configuration_2.0/OutputCacheProfile.cs System.Web.Configuration_2.0/OutputCacheProfileCollection.cs System.Web.Configuration_2.0/OutputCacheSection.cs System.Web.Configuration_2.0/OutputCacheSettingsSection.cs -System.Web.Configuration_2.0/PagesEnableSessionState.cs +../../../external/referencesource/System.Web/Configuration/PagesEnableSessionState.cs System.Web.Configuration_2.0/PagesSection.cs System.Web.Configuration_2.0/PassportAuthentication.cs System.Web.Configuration_2.0/PositiveTimeSpanValidator.cs System.Web.Configuration_2.0/ProcessModelSection.cs -System.Web.Configuration_2.0/ProcessModelComAuthenticationLevel.cs -System.Web.Configuration_2.0/ProcessModelComImpersonationLevel.cs -System.Web.Configuration_2.0/ProcessModelLogLevel.cs +../../../external/referencesource/System.Web/Configuration/ProcessModelComAuthenticationLevel.cs +../../../external/referencesource/System.Web/Configuration/ProcessModelComImpersonationLevel.cs +../../../external/referencesource/System.Web/Configuration/ProcessModelLogLevel.cs System.Web.Configuration_2.0/ProfileGroupSettings.cs System.Web.Configuration_2.0/ProfileGroupSettingsCollection.cs System.Web.Configuration_2.0/ProfilePropertyNameValidator.cs @@ -237,7 +236,7 @@ System.Web.Configuration_2.0/RoleManagerSection.cs System.Web.Configuration_2.0/RootProfilePropertySettingsCollection.cs System.Web.Configuration_2.0/RuleSettings.cs System.Web.Configuration_2.0/RuleSettingsCollection.cs -System.Web.Configuration_2.0/SerializationMode.cs +../../../external/referencesource/System.Web/Configuration/SerializationMode.cs System.Web.Configuration_2.0/SecurityPolicySection.cs System.Web.Configuration_2.0/SessionPageStateSection.cs System.Web.Configuration_2.0/SessionStateSection.cs @@ -245,13 +244,13 @@ System.Web.Configuration_2.0/SiteMapSection.cs System.Web.Configuration_2.0/SqlCacheDependencyDatabase.cs System.Web.Configuration_2.0/SqlCacheDependencyDatabaseCollection.cs System.Web.Configuration_2.0/SqlCacheDependencySection.cs -System.Web.Configuration_2.0/SystemWebCachingSectionGroup.cs +../../../external/referencesource/System.Web/Configuration/SystemWebCachingSectionGroup.cs System.Web.Configuration_2.0/SystemWebSectionGroup.cs System.Web.Configuration_2.0/TagMapCollection.cs System.Web.Configuration_2.0/TagMapInfo.cs System.Web.Configuration_2.0/TagPrefixCollection.cs System.Web.Configuration_2.0/TagPrefixInfo.cs -System.Web.Configuration_2.0/TraceDisplayMode.cs +../../../external/referencesource/System.Web/Configuration/TraceDisplayMode.cs System.Web.Configuration_2.0/TraceSection.cs System.Web.Configuration_2.0/TransformerInfo.cs System.Web.Configuration_2.0/TransformerInfoCollection.cs @@ -263,7 +262,7 @@ System.Web.Configuration_2.0/UrlMappingCollection.cs System.Web.Configuration_2.0/UrlMappingsSection.cs System.Web.Configuration_2.0/VirtualDirectoryMappingCollection.cs System.Web.Configuration_2.0/VirtualDirectoryMapping.cs -System.Web.Configuration_2.0/WebApplicationLevel.cs +../../../external/referencesource/System.Web/Configuration/WebApplicationLevel.cs System.Web.Configuration_2.0/WebConfigurationFileMap.cs System.Web.Configuration_2.0/WebConfigurationHost.cs System.Web.Configuration_2.0/WebConfigurationManager.cs @@ -272,7 +271,7 @@ System.Web.Configuration_2.0/WebContext.cs System.Web.Configuration_2.0/WebPartsPersonalization.cs System.Web.Configuration_2.0/WebPartsPersonalizationAuthorization.cs System.Web.Configuration_2.0/WebPartsSection.cs -System.Web.Configuration_2.0/XhtmlConformanceMode.cs +../../../external/referencesource/System.Web/Configuration/XhtmlConformanceMode.cs System.Web.Configuration_2.0/XhtmlConformanceSection.cs System.Web.Configuration.Internal/IInternalConfigWebHost.cs System.Web/DefaultHttpHandler.cs @@ -296,10 +295,10 @@ System.Web.Hosting/DefaultVirtualFile.cs System.Web.Hosting/DefaultVirtualPathProvider.cs System.Web.Hosting/HostingEnvironment.cs System.Web.Hosting/IAppDomainFactory.cs -System.Web.Hosting/IApplicationHost.cs +../../../external/referencesource/System.Web/Hosting/IApplicationHost.cs System.Web.Hosting/IAppManagerAppDomainFactory.cs System.Web.Hosting/IISAPIRuntime.cs -System.Web.Hosting/IRegisteredObject.cs +../../../external/referencesource/System.Web/Hosting/IRegisteredObject.cs System.Web.Hosting/ISAPIRuntime.cs System.Web.Hosting/SimpleWorkerRequest.cs System.Web.Hosting/VirtualDirectory.cs @@ -352,17 +351,17 @@ System.Web/HttpValidationStatus.cs System.Web/HttpWorkerRequest.cs System.Web/HttpWriter.cs System.Web/IntPtrStream.cs -System.Web/IHttpAsyncHandler.cs -System.Web/IHttpHandler.cs -System.Web/IHttpHandlerFactory.cs +../../../external/referencesource/System.Web/IHttpAsyncHandler.cs +../../../external/referencesource/System.Web/IHttpHandler.cs +../../../external/referencesource/System.Web/IHttpHandlerFactory.cs System.Web/IHttpMapPath.cs -System.Web/IHttpModule.cs +../../../external/referencesource/System.Web/IHttpModule.cs System.Web/IisTraceListener.cs System.Web/IPartitionResolver.cs System.Web/InputFilterStream.cs System.Web/OutputFilterStream.cs -System.Web/RequestNotification.cs -System.Web/RequestNotificationStatus.cs +../../../external/referencesource/System.Web/RequestNotification.cs +../../../external/referencesource/System.Web/RequestNotificationStatus.cs System.Web.Mail/Base64AttachmentEncoder.cs System.Web.Mail/IAttachmentEncoder.cs System.Web.Mail/MailAddressCollection.cs @@ -407,9 +406,9 @@ System.Web.Profile/ProfileAuthenticationOption.cs System.Web.Profile/ProfileAutoSaveEventArgs.cs System.Web.Profile/ProfileAutoSaveEventHandler.cs System.Web.Profile/ProfileBase.cs -System.Web.Profile/ProfileEventArgs.cs -System.Web.Profile/ProfileEventHandler.cs -System.Web.Profile/ProfileGroupBase.cs +../../../external/referencesource/System.Web/Profile/ProfileEventArgs.cs +../../../external/referencesource/System.Web/Profile/ProfileEventHandler.cs +../../../external/referencesource/System.Web/Profile/HttpProfileGroupBase.cs System.Web.Profile/ProfileInfoCollection.cs System.Web.Profile/ProfileInfo.cs System.Web.Profile/ProfileManager.cs @@ -437,19 +436,19 @@ System.Web.Security/DefaultAuthenticationEventHandler.cs System.Web.Security/DefaultAuthenticationModule.cs System.Web.Security/FileAuthorizationModule.cs System.Web.Security/FormsAuthentication.cs -System.Web.Security/FormsAuthenticationEventArgs.cs -System.Web.Security/FormsAuthenticationEventHandler.cs +../../../external/referencesource/System.Web/Security/FormsAuthenticationEventArgs.cs +../../../external/referencesource/System.Web/Security/FormsAuthenticationEventHandler.cs System.Web.Security/FormsAuthenticationModule.cs System.Web.Security/FormsAuthenticationTicket.cs System.Web.Security/FormsIdentity.cs System.Web.Security/Membership.cs System.Web.Security/MembershipHelper.cs -System.Web.Security/PassportAuthenticationEventArgs.cs -System.Web.Security/PassportAuthenticationEventHandler.cs +../../../external/referencesource/System.Web/Security/PassportAuthenticationEventArgs.cs +../../../external/referencesource/System.Web/Security/PassportAuthenticationEventHandler.cs System.Web.Security/PassportAuthenticationModule.cs System.Web.Security/PassportIdentity.cs -System.Web.Security/RoleManagerEventArgs.cs -System.Web.Security/RoleManagerEventHandler.cs +../../../external/referencesource/System.Web/Security/RoleManagerEventArgs.cs +../../../external/referencesource/System.Web/Security/RoleManagerEventHandler.cs System.Web.Security/RoleManagerModule.cs System.Web.Security/RolePrincipal.cs System.Web.Security/RoleProviderCollection.cs @@ -459,15 +458,15 @@ System.Web.Security/SqliteRoleProvider.cs System.Web.Security/SqlMembershipProvider.cs System.Web.Security/SqlRoleProvider.cs System.Web.Security/UrlAuthorizationModule.cs -System.Web.Security/WindowsAuthenticationEventArgs.cs -System.Web.Security/WindowsAuthenticationEventHandler.cs +../../../external/referencesource/System.Web/Security/WindowsAuthenticationEventArgs.cs +../../../external/referencesource/System.Web/Security/WindowsAuthenticationEventHandler.cs System.Web.Security/WindowsAuthenticationModule.cs System.Web/ServerVariablesCollection.cs System.Web.SessionState_2.0/HttpSessionStateContainer.cs System.Web.SessionState_2.0/HttpSessionState.cs System.Web.SessionState_2.0/IHttpSessionState.cs -System.Web.SessionState_2.0/IReadOnlySessionState.cs -System.Web.SessionState_2.0/IRequiresSessionState.cs +../../../external/referencesource/System.Web/State/IReadOnlySessionState.cs +../../../external/referencesource/System.Web/State/IRequiresSessionState.cs System.Web.SessionState_2.0/ISessionIDManager.cs System.Web.SessionState_2.0/ISessionStateItemCollection.cs System.Web.SessionState_2.0/IStateRuntime.cs @@ -497,15 +496,15 @@ System.Web/StaticFileHandler.cs System.Web/StaticSiteMapProvider.cs System.Web/TempFileStream.cs System.Web/TraceContext.cs -System.Web/TraceContextEventArgs.cs -System.Web/TraceContextEventHandler.cs +../../../external/referencesource/System.Web/UI/TraceContextEventArgs.cs +../../../external/referencesource/System.Web/UI/TraceContextEventHandler.cs System.Web/TraceContextRecord.cs System.Web/TraceData.cs System.Web/TraceManager.cs System.Web/TraceMode.cs System.Web.UI.Adapters/ControlAdapter.cs System.Web.UI.Adapters/PageAdapter.cs -System.Web.UI.Adapters/WmlPostFieldType.cs +../../../external/referencesource/System.Web/UI/WebControls/Adapters/WmlPostFieldType.cs System.Web.UI/ApplicationFileParser.cs System.Web.UI/AttributeCollection.cs System.Web.UI/BaseParser.cs @@ -525,9 +524,9 @@ System.Web.UI/CompilationMode.cs System.Web.UI/CompiledBindableTemplateBuilder.cs System.Web.UI/CompiledTemplateBuilder.cs System.Web.UI/ComplexPropertyEntry.cs -System.Web.UI/ConflictOptions.cs -System.Web.UI/ConstructorNeedsTagAttribute.cs -System.Web.UI/ControlBuilderAttribute.cs +../../../external/referencesource/System.Web/UI/ConflictOptions.cs +../../../external/referencesource/System.Web/UI/ConstructorNeedsTagAttribute.cs +../../../external/referencesource/System.Web/UI/ControlBuilderAttribute.cs System.Web.UI/ControlBuilder.cs System.Web.UI/ControlCachePolicy.cs System.Web.UI/ControlCollection.cs @@ -535,20 +534,20 @@ System.Web.UI/Control.cs System.Web.UI/ControlSkin.cs System.Web.UI/ControlSkinDelegate.cs System.Web.UI/ControlValuePropertyAttribute.cs -System.Web.UI/CssClassPropertyAttribute.cs +../../../external/referencesource/System.Web/UI/CssClassPropertyAttribute.cs System.Web.UI/CssStyleCollection.cs System.Web.UI/DataBinder.cs System.Web.UI/DataBindingBuilder.cs System.Web.UI/DataBindingCollection.cs System.Web.UI/DataBinding.cs -System.Web.UI/DataBindingHandlerAttribute.cs +../../../external/referencesource/System.Web/UI/DataBindingHandlerAttribute.cs System.Web.UI/DataBoundLiteralControl.cs System.Web.UI/DataSourceCacheDurationConverter.cs -System.Web.UI/DataSourceCacheExpiry.cs -System.Web.UI/DataSourceCapabilities.cs +../../../external/referencesource/System.Web/UI/DataSourceCacheExpiry.cs +../../../external/referencesource/System.Web/UI/DataSourceCapabilities.cs System.Web.UI/DataSourceControl.cs System.Web.UI/DataSourceControlBuilder.cs -System.Web.UI/DataSourceOperation.cs +../../../external/referencesource/System.Web/UI/DataSourceOperation.cs System.Web.UI/DataSourceSelectArguments.cs System.Web.UI/DataSourceView.cs System.Web.UI/DataSourceViewOperationCallback.cs @@ -562,9 +561,9 @@ System.Web.UI/ExpressionBindingCollection.cs System.Web.UI/ExpressionBinding.cs System.Web.UI/ExtractTemplateValuesMethod.cs System.Web.UI/FileLevelUserControlBuilder.cs -System.Web.UI/FileLevelControlBuilderAttribute.cs +../../../external/referencesource/System.Web/UI/FileLevelControlBuilderAttribute.cs System.Web.UI/FileLevelPageControlBuilder.cs -System.Web.UI/FilterableAttribute.cs +../../../external/referencesource/System.Web/UI/FilterableAttribute.cs System.Web.UI/HiddenFieldPageStatePersister.cs System.Web.UI/HierarchicalDataSourceControl.cs System.Web.UI/HierarchicalDataSourceView.cs @@ -603,52 +602,54 @@ System.Web.UI.HtmlControls/HtmlTableRowCollection.cs System.Web.UI.HtmlControls/HtmlTableRow.cs System.Web.UI.HtmlControls/HtmlTextArea.cs System.Web.UI.HtmlControls/HtmlTitle.cs -System.Web.UI/HtmlTextWriterAttribute.cs +../../../external/referencesource/System.Web/UI/HtmlTextWriterAttribute.cs System.Web.UI/HtmlTextWriter.cs -System.Web.UI/HtmlTextWriterStyle.cs -System.Web.UI/HtmlTextWriterTag.cs -System.Web.UI/IAttributeAccessor.cs -System.Web.UI/IAutoFieldGenerator.cs -System.Web.UI/IBindableControl.cs -System.Web.UI/IBindableTemplate.cs -System.Web.UI/ICallbackEventHandler.cs +../../../external/referencesource/System.Web/UI/HtmlTextWriterStyle.cs +../../../external/referencesource/System.Web/UI/HtmlTextWriterTag.cs +../../../external/referencesource/System.Web/UI/IAttributeAccessor.cs +../../../external/referencesource/System.Web/UI/IAutoFieldGenerator.cs +../../../external/referencesource/System.Web/UI/IBindableControl.cs +../../../external/referencesource/System.Web/UI/IBindableTemplate.cs +../../../external/referencesource/System.Web/UI/ICallbackEventHandler.cs System.Web.UI/ICheckBoxControl.cs -System.Web.UI/IControlBuilderAccessor.cs -System.Web.UI/IControlDesignerAccessor.cs -System.Web.UI/IDataBindingsAccessor.cs -System.Web.UI/IDataItemContainer.cs -System.Web.UI/IDataSource.cs -System.Web.UI/IDataSourceViewSchemaAccessor.cs -System.Web.UI/IDReferencePropertyAttribute.cs +../../../external/referencesource/System.Web/UI/IControlBuilderAccessor.cs +../../../external/referencesource/System.Web/UI/IControlDesignerAccessor.cs +../../../external/referencesource/System.Web/UI/IDataBindingsAccessor.cs +../../../external/referencesource/System.Web/UI/IDataItemContainer.cs +../../../external/referencesource/System.Web/UI/IDataSource.cs +../../../external/referencesource/System.Web/UI/IDataSourceViewSchemaAccessor.cs +../../../external/referencesource/System.Web/UI/IDReferencePropertyAttribute.cs System.Web.UI/IEditableTextControl.cs -System.Web.UI/IExpressionsAccessor.cs -System.Web.UI/IFilterResolutionService.cs +../../../external/referencesource/System.Web/UI/IExpressionsAccessor.cs +../../../external/referencesource/System.Web/UI/IFilterResolutionService.cs System.Web.UI/IgnoreUnknownContentAttribute.cs -System.Web.UI/IHierarchicalDataSource.cs -System.Web.UI/IHierarchicalEnumerable.cs -System.Web.UI/IHierarchyData.cs +../../../external/referencesource/System.Web/UI/IHierarchicalDataSource.cs +../../../external/referencesource/System.Web/UI/IHierarchicalEnumerable.cs +../../../external/referencesource/System.Web/UI/IHierarchyData.cs System.Web.UI/ImageClickEventArgs.cs -System.Web.UI/ImageClickEventHandler.cs +../../../external/referencesource/System.Web/UI/ImageClickEventHandler.cs System.Web.UI/IndexedString.cs -System.Web.UI/INamingContainer.cs -System.Web.UI/INonBindingContainer.cs -System.Web.UI/INavigateUIData.cs -System.Web.UI/IParserAccessor.cs -System.Web.UI/IPostBackDataHandler.cs -System.Web.UI/IPostBackEventHandler.cs -System.Web.UI/IResourceUrlGenerator.cs -System.Web.UI/IStateFormatter.cs -System.Web.UI/IStateManager.cs +../../../external/referencesource/System.Web/UI/INamingContainer.cs +../../../external/referencesource/System.Web/UI/INonBindingContainer.cs +../../../external/referencesource/System.Web/UI/INavigateUIData.cs +../../../external/referencesource/System.Web/UI/IParserAccessor.cs +../../../external/referencesource/System.Web/UI/IPostBackDataHandler.cs +../../../external/referencesource/System.Web/UI/IPostBackEventHandler.cs +../../../external/referencesource/System.Web/UI/IResourceUrlGenerator.cs +../../../external/referencesource/System.Web/UI/IStateFormatter.cs +../../../external/referencesource/System.Web/UI/IStateManager.cs System.Web.UI/IScriptManager.cs -System.Web.UI/IStyleSheet.cs +../../../external/referencesource/System.Web/UI/IStyleSheet.cs +../../../external/referencesource/System.Web/UI/IScriptResourceDefinition.cs +../../../external/referencesource/System.Web/UI/IScriptResourceMapping.cs System.Web.UI/ITagNameToTypeMapper.cs -System.Web.UI/ITemplate.cs +../../../external/referencesource/System.Web/UI/ITemplate.cs System.Web.UI/ITextControl.cs -System.Web.UI/IThemeResolutionService.cs -System.Web.UI/IUrlResolutionService.cs -System.Web.UI/IUserControlDesignerAccessor.cs -System.Web.UI/IUserControlTypeResolutionService.cs -System.Web.UI/IValidator.cs +../../../external/referencesource/System.Web/UI/IThemeResolutionService.cs +../../../external/referencesource/System.Web/UI/IUrlResolutionService.cs +../../../external/referencesource/System.Web/UI/IUserControlDesignerAccessor.cs +../../../external/referencesource/System.Web/UI/IUserControlTypeResolutionService.cs +../../../external/referencesource/System.Web/UI/IValidator.cs System.Web.UI/ListSourceHelper.cs System.Web.UI/LiteralControl.cs System.Web.UI/LosFormatter.cs @@ -657,7 +658,7 @@ System.Web.UI/MasterPage.cs System.Web.UI/MasterPageControlBuilder.cs System.Web.UI/MasterPageParser.cs System.Web.UI/MinimizableAttributeTypeConverter.cs -System.Web.UI/NonVisualControlAttribute.cs +../../../external/referencesource/System.Web/UI/NonVisualControlAttribute.cs System.Web.UI/ObjectConverter.cs System.Web.UI/ObjectPersistData.cs System.Web.UI/ObjectStateFormatter.cs @@ -680,9 +681,9 @@ System.Web.UI/Pair.cs System.Web.UI/ParseChildrenAttribute.cs System.Web.UI/PartialCachingAttribute.cs System.Web.UI/PartialCachingControl.cs -System.Web.UI/PersistChildrenAttribute.cs +../../../external/referencesource/System.Web/UI/PersistChildrenAttribute.cs System.Web.UI/PersistenceModeAttribute.cs -System.Web.UI/PersistenceMode.cs +../../../external/referencesource/System.Web/UI/PersistenceMode.cs System.Web.UI/PostBackOptions.cs System.Web.UI/PropertyConverter.cs System.Web.UI/PropertyEntry.cs @@ -700,18 +701,18 @@ System.Web.UI/StateItem.cs System.Web.UI/StateManagedCollection.cs System.Web.UI/StaticPartialCachingControl.cs System.Web.UI/StringPropertyBuilder.cs -System.Web.UI/SupportsEventValidationAttribute.cs +../../../external/referencesource/System.Web/UI/SupportsEventValidationAttribute.cs System.Web.UI/TagPrefixAttribute.cs System.Web.UI/TemplateBuilder.cs System.Web.UI/TemplateContainerAttribute.cs System.Web.UI/TemplateContentType.cs System.Web.UI/TemplateControl.cs System.Web.UI/TemplateControlParser.cs -System.Web.UI/TemplateInstance.cs -System.Web.UI/TemplateInstanceAttribute.cs +../../../external/referencesource/System.Web/UI/TemplateInstance.cs +../../../external/referencesource/System.Web/UI/TemplateInstanceAttribute.cs System.Web.UI/TemplateParser.cs System.Web.UI/TemplatePropertyEntry.cs -System.Web.UI/ThemeableAttribute.cs +../../../external/referencesource/System.Web/UI/ThemeableAttribute.cs System.Web.UI/ThemeProvider.cs System.Web.UI/ToolboxDataAttribute.cs System.Web.UI/Triplet.cs @@ -727,7 +728,7 @@ System.Web.UI/VerificationAttribute.cs System.Web.UI/VerificationConditionalOperator.cs System.Web.UI/VerificationReportLevel.cs System.Web.UI/VerificationRule.cs -System.Web.UI/ViewStateEncryptionMode.cs +../../../external/referencesource/System.Web/UI/ViewStateEncryptionMode.cs System.Web.UI/ViewStateException.cs System.Web.UI/ViewStateModeByIdAttribute.cs System.Web.UI/VirtualReferenceType.cs @@ -739,12 +740,12 @@ System.Web.UI.WebControls.Adapters/WebControlAdapter.cs System.Web.UI.WebControls/AccessDataSource.cs System.Web.UI.WebControls/AccessDataSourceView.cs System.Web.UI.WebControls/AdCreatedEventArgs.cs -System.Web.UI.WebControls/AdCreatedEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/AdCreatedEventHandler.cs System.Web.UI.WebControls/AdRotator.cs System.Web.UI.WebControls/AssociatedControlConverter.cs -System.Web.UI.WebControls/AuthenticateEventArgs.cs -System.Web.UI.WebControls/AuthenticateEventHandler.cs -System.Web.UI.WebControls/AutoCompleteType.cs +../../../external/referencesource/System.Web/UI/WebControls/AuthenticateEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/AuthenticateEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/AutoCompleteType.cs System.Web.UI.WebControls/AutoGeneratedField.cs System.Web.UI.WebControls/AutoGeneratedFieldProperties.cs System.Web.UI.WebControls/BaseCompareValidator.cs @@ -752,23 +753,23 @@ System.Web.UI.WebControls/BaseDataBoundControl.cs System.Web.UI.WebControls/BaseDataList.cs System.Web.UI.WebControls/BaseMenuRenderer.cs System.Web.UI.WebControls/BaseValidator.cs -System.Web.UI.WebControls/BorderStyle.cs +../../../external/referencesource/System.Web/UI/WebControls/BorderStyle.cs System.Web.UI.WebControls/BoundColumn.cs System.Web.UI.WebControls/BoundField.cs System.Web.UI.WebControls/BulletedList.cs System.Web.UI.WebControls/BulletedListDisplayMode.cs -System.Web.UI.WebControls/BulletedListEventArgs.cs -System.Web.UI.WebControls/BulletedListEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/BulletedListEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/BulletedListEventHandler.cs System.Web.UI.WebControls/BulletStyle.cs System.Web.UI.WebControls/ButtonColumn.cs -System.Web.UI.WebControls/ButtonColumnType.cs +../../../external/referencesource/System.Web/UI/WebControls/ButtonColumnType.cs System.Web.UI.WebControls/Button.cs System.Web.UI.WebControls/ButtonFieldBase.cs System.Web.UI.WebControls/ButtonField.cs -System.Web.UI.WebControls/ButtonType.cs +../../../external/referencesource/System.Web/UI/WebControls/ButtonType.cs System.Web.UI.WebControls/Calendar.cs System.Web.UI.WebControls/CalendarDay.cs -System.Web.UI.WebControls/CalendarSelectionMode.cs +../../../external/referencesource/System.Web/UI/WebControls/CalendarSelectionMode.cs System.Web.UI.WebControls/ChangePassword.cs System.Web.UI.WebControls/CheckBox.cs System.Web.UI.WebControls/CheckBoxField.cs @@ -776,8 +777,8 @@ System.Web.UI.WebControls/CheckBoxList.cs System.Web.UI.WebControls/ChildTable.cs System.Web.UI.WebControls/CircleHotSpot.cs System.Web.UI.WebControls/CollectionDataSource.cs -System.Web.UI.WebControls/CommandEventArgs.cs -System.Web.UI.WebControls/CommandEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/CommandEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/CommandEventHandler.cs System.Web.UI.WebControls/CommandField.cs System.Web.UI.WebControls/CompareValidator.cs System.Web.UI.WebControls/CompleteWizardStep.cs @@ -786,165 +787,165 @@ System.Web.UI.WebControls/CompositeDataBoundControl.cs System.Web.UI.WebControls/ContainedTable.cs System.Web.UI.WebControls/ContentControlBuilderInternal.cs System.Web.UI.WebControls/Content.cs -System.Web.UI.WebControls/ContentDirection.cs +../../../external/referencesource/System.Web/UI/WebControls/ContentDirection.cs System.Web.UI.WebControls/ContentPlaceHolderBuilder.cs System.Web.UI.WebControls/ContentPlaceHolder.cs System.Web.UI.WebControls/ControlIDConverter.cs System.Web.UI.WebControls/ControlParameter.cs System.Web.UI.WebControls/ControlPropertyNameConverter.cs System.Web.UI.WebControls/CookieParameter.cs -System.Web.UI.WebControls/CreateUserErrorEventArgs.cs -System.Web.UI.WebControls/CreateUserErrorEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/CreateUserErrorEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/CreateUserErrorEventHandler.cs System.Web.UI.WebControls/CreateUserWizard.cs System.Web.UI.WebControls/CreateUserWizardStep.cs System.Web.UI.WebControls/CustomValidator.cs System.Web.UI.WebControls/DataBoundControl.cs -System.Web.UI.WebControls/DataBoundControlMode.cs +../../../external/referencesource/System.Web/UI/WebControls/DataBoundControlMode.cs System.Web.UI.WebControls/DataControlButton.cs -System.Web.UI.WebControls/DataControlCellType.cs +../../../external/referencesource/System.Web/UI/WebControls/DataControlCellType.cs System.Web.UI.WebControls/DataControlCommands.cs System.Web.UI.WebControls/DataControlFieldCell.cs System.Web.UI.WebControls/DataControlFieldCollection.cs System.Web.UI.WebControls/DataControlField.cs System.Web.UI.WebControls/DataControlFieldHeaderCell.cs -System.Web.UI.WebControls/DataControlRowState.cs -System.Web.UI.WebControls/DataControlRowType.cs +../../../external/referencesource/System.Web/UI/WebControls/DataControlRowState.cs +../../../external/referencesource/System.Web/UI/WebControls/DataControlRowType.cs System.Web.UI.WebControls/DataGridColumnCollection.cs System.Web.UI.WebControls/DataGridColumn.cs -System.Web.UI.WebControls/DataGridCommandEventArgs.cs -System.Web.UI.WebControls/DataGridCommandEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DataGridCommandEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/DataGridCommandEventHandler.cs System.Web.UI.WebControls/DataGrid.cs System.Web.UI.WebControls/DataGridItemCollection.cs System.Web.UI.WebControls/DataGridItem.cs -System.Web.UI.WebControls/DataGridItemEventArgs.cs -System.Web.UI.WebControls/DataGridItemEventHandler.cs -System.Web.UI.WebControls/DataGridPageChangedEventArgs.cs -System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DataGridItemEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/DataGridItemEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DataGridPageChangedEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/DataGridPageChangedEventHandler.cs System.Web.UI.WebControls/DataGridPagerStyle.cs -System.Web.UI.WebControls/DataGridSortCommandEventArgs.cs -System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DataGridSortCommandEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/DataGridSortCommandEventHandler.cs System.Web.UI.WebControls/DataKeyArray.cs System.Web.UI.WebControls/DataKeyCollection.cs System.Web.UI.WebControls/DataKey.cs -System.Web.UI.WebControls/DataListCommandEventArgs.cs -System.Web.UI.WebControls/DataListCommandEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DataListCommandEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/DataListCommandEventHandler.cs System.Web.UI.WebControls/DataList.cs System.Web.UI.WebControls/DataListItemCollection.cs System.Web.UI.WebControls/DataListItem.cs -System.Web.UI.WebControls/DataListItemEventArgs.cs -System.Web.UI.WebControls/DataListItemEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DataListItemEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/DataListItemEventHandler.cs System.Web.UI.WebControls/DataSourceCacheManager.cs -System.Web.UI.WebControls/DayNameFormat.cs +../../../external/referencesource/System.Web/UI/WebControls/DayNameFormat.cs System.Web.UI.WebControls/DayRenderEventArgs.cs -System.Web.UI.WebControls/DayRenderEventHandler.cs -System.Web.UI.WebControls/DetailsViewCommandEventArgs.cs -System.Web.UI.WebControls/DetailsViewCommandEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DayRenderEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewCommandEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewCommandEventHandler.cs System.Web.UI.WebControls/DetailsView.cs System.Web.UI.WebControls/DetailsViewDeletedEventArgs.cs -System.Web.UI.WebControls/DetailsViewDeletedEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewDeletedEventHandler.cs System.Web.UI.WebControls/DetailsViewDeleteEventArgs.cs -System.Web.UI.WebControls/DetailsViewDeleteEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewDeleteEventHandler.cs System.Web.UI.WebControls/DetailsViewInsertedEventArgs.cs -System.Web.UI.WebControls/DetailsViewInsertedEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewInsertedEventHandler.cs System.Web.UI.WebControls/DetailsViewInsertEventArgs.cs -System.Web.UI.WebControls/DetailsViewInsertEventHandler.cs -System.Web.UI.WebControls/DetailsViewMode.cs -System.Web.UI.WebControls/DetailsViewModeEventArgs.cs -System.Web.UI.WebControls/DetailsViewModeEventHandler.cs -System.Web.UI.WebControls/DetailsViewPageEventArgs.cs -System.Web.UI.WebControls/DetailsViewPageEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewInsertEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewMode.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewModeEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewModeEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewPageEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewPageEventHandler.cs System.Web.UI.WebControls/DetailsViewPagerRow.cs System.Web.UI.WebControls/DetailsViewRowCollection.cs System.Web.UI.WebControls/DetailsViewRow.cs System.Web.UI.WebControls/DetailsViewUpdatedEventArgs.cs -System.Web.UI.WebControls/DetailsViewUpdatedEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewUpdatedEventHandler.cs System.Web.UI.WebControls/DetailsViewUpdateEventArgs.cs -System.Web.UI.WebControls/DetailsViewUpdateEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/DetailsViewUpdateEventHandler.cs System.Web.UI.WebControls/DropDownList.cs System.Web.UI.WebControls/EditCommandColumn.cs System.Web.UI.WebControls/EmbeddedMailObject.cs System.Web.UI.WebControls/EmbeddedMailObjectsCollection.cs System.Web.UI.WebControls/FileUpload.cs -System.Web.UI.WebControls/FirstDayOfWeek.cs +../../../external/referencesource/System.Web/UI/WebControls/FirstDayOfWeek.cs System.Web.UI.WebControls/FontInfo.cs System.Web.UI.WebControls/FontNamesConverter.cs -System.Web.UI.WebControls/FontSize.cs +../../../external/referencesource/System.Web/UI/WebControls/FontSize.cs System.Web.UI.WebControls/FontUnitConverter.cs System.Web.UI.WebControls/FontUnit.cs System.Web.UI.WebControls/FormParameter.cs System.Web.UI.WebControls/FormViewCommandEventArgs.cs -System.Web.UI.WebControls/FormViewCommandEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewCommandEventHandler.cs System.Web.UI.WebControls/FormView.cs System.Web.UI.WebControls/FormViewDeletedEventArgs.cs -System.Web.UI.WebControls/FormViewDeletedEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewDeletedEventHandler.cs System.Web.UI.WebControls/FormViewDeleteEventArgs.cs -System.Web.UI.WebControls/FormViewDeleteEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewDeleteEventHandler.cs System.Web.UI.WebControls/FormViewInsertedEventArgs.cs -System.Web.UI.WebControls/FormViewInsertedEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewInsertedEventHandler.cs System.Web.UI.WebControls/FormViewInsertEventArgs.cs -System.Web.UI.WebControls/FormViewInsertEventHandler.cs -System.Web.UI.WebControls/FormViewMode.cs -System.Web.UI.WebControls/FormViewModeEventArgs.cs -System.Web.UI.WebControls/FormViewModeEventHandler.cs -System.Web.UI.WebControls/FormViewPageEventArgs.cs -System.Web.UI.WebControls/FormViewPageEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewInsertEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewMode.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewModeEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewModeEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewPageEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewPageEventHandler.cs System.Web.UI.WebControls/FormViewRow.cs System.Web.UI.WebControls/FormViewPagerRow.cs System.Web.UI.WebControls/FormViewUpdatedEventArgs.cs -System.Web.UI.WebControls/FormViewUpdatedEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewUpdatedEventHandler.cs System.Web.UI.WebControls/FormViewUpdateEventArgs.cs -System.Web.UI.WebControls/FormViewUpdateEventHandler.cs -System.Web.UI.WebControls/GridLines.cs -System.Web.UI.WebControls/GridViewCancelEditEventArgs.cs -System.Web.UI.WebControls/GridViewCancelEditEventHandler.cs -System.Web.UI.WebControls/GridViewCommandEventArgs.cs -System.Web.UI.WebControls/GridViewCommandEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/FormViewUpdateEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/GridLines.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewCancelEditEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewCancelEditEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewCommandEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewCommandEventHandler.cs System.Web.UI.WebControls/GridView.cs System.Web.UI.WebControls/GridViewDeletedEventArgs.cs -System.Web.UI.WebControls/GridViewDeletedEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewDeletedEventHandler.cs System.Web.UI.WebControls/GridViewDeleteEventArgs.cs -System.Web.UI.WebControls/GridViewDeleteEventHandler.cs -System.Web.UI.WebControls/GridViewEditEventArgs.cs -System.Web.UI.WebControls/GridViewEditEventHandler.cs -System.Web.UI.WebControls/GridViewPageEventArgs.cs -System.Web.UI.WebControls/GridViewPageEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewDeleteEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewEditEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewEditEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewPageEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewPageEventHandler.cs System.Web.UI.WebControls/GridViewRowCollection.cs System.Web.UI.WebControls/GridViewRow.cs -System.Web.UI.WebControls/GridViewRowEventArgs.cs -System.Web.UI.WebControls/GridViewRowEventHandler.cs -System.Web.UI.WebControls/GridViewSelectEventArgs.cs -System.Web.UI.WebControls/GridViewSelectEventHandler.cs -System.Web.UI.WebControls/GridViewSortEventArgs.cs -System.Web.UI.WebControls/GridViewSortEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewRowEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewRowEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewSelectEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewSelectEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewSortEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewSortEventHandler.cs System.Web.UI.WebControls/GridViewUpdatedEventArgs.cs -System.Web.UI.WebControls/GridViewUpdatedEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewUpdatedEventHandler.cs System.Web.UI.WebControls/GridViewUpdateEventArgs.cs -System.Web.UI.WebControls/GridViewUpdateEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/GridViewUpdateEventHandler.cs System.Web.UI.WebControls/HiddenField.cs System.Web.UI.WebControls/HierarchicalDataBoundControl.cs System.Web.UI.WebControls/HorizontalAlignConverter.cs -System.Web.UI.WebControls/HorizontalAlign.cs +../../../external/referencesource/System.Web/UI/WebControls/HorizontalAlign.cs System.Web.UI.WebControls/HotSpotCollection.cs System.Web.UI.WebControls/HotSpot.cs -System.Web.UI.WebControls/HotSpotMode.cs +../../../external/referencesource/System.Web/UI/WebControls/HotSpotMode.cs System.Web.UI.WebControls/HyperLinkColumn.cs System.Web.UI.WebControls/HyperLinkControlBuilder.cs System.Web.UI.WebControls/HyperLink.cs System.Web.UI.WebControls/HyperLinkField.cs -System.Web.UI.WebControls/IButtonControl.cs -System.Web.UI.WebControls/ICallbackContainer.cs -System.Web.UI.WebControls/ICompositeControlDesignerAccessor.cs -System.Web.UI.WebControls/ImageAlign.cs +../../../external/referencesource/System.Web/UI/WebControls/IButtonControl.cs +../../../external/referencesource/System.Web/UI/WebControls/ICallbackContainer.cs +../../../external/referencesource/System.Web/UI/WebControls/ICompositeControlDesignerAccessor.cs +../../../external/referencesource/System.Web/UI/WebControls/ImageAlign.cs System.Web.UI.WebControls/ImageButton.cs System.Web.UI.WebControls/Image.cs System.Web.UI.WebControls/ImageField.cs System.Web.UI.WebControls/ImageMap.cs -System.Web.UI.WebControls/ImageMapEventArgs.cs -System.Web.UI.WebControls/ImageMapEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/ImageMapEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/ImageMapEventHandler.cs System.Web.UI.WebControls/IMenuRenderer.cs -System.Web.UI.WebControls/IPersistedSelector.cs +../../../external/referencesource/System.Web/UI/WebControls/IPersistedSelector.cs System.Web.UI.WebControls/IPostBackContainer.cs -System.Web.UI.WebControls/IRepeatInfoUser.cs +../../../external/referencesource/System.Web/UI/WebControls/IRepeatInfoUser.cs System.Web.UI.WebControls/LabelControlBuilder.cs System.Web.UI.WebControls/Label.cs System.Web.UI.WebControls/LinkButtonControlBuilder.cs @@ -954,27 +955,27 @@ System.Web.UI.WebControls/ListControl.cs System.Web.UI.WebControls/ListItemCollection.cs System.Web.UI.WebControls/ListItemControlBuilder.cs System.Web.UI.WebControls/ListItem.cs -System.Web.UI.WebControls/ListItemType.cs -System.Web.UI.WebControls/ListSelectionMode.cs +../../../external/referencesource/System.Web/UI/WebControls/ListItemType.cs +../../../external/referencesource/System.Web/UI/WebControls/ListSelectionMode.cs System.Web.UI.WebControls/LiteralControlBuilder.cs System.Web.UI.WebControls/Literal.cs -System.Web.UI.WebControls/LiteralMode.cs +../../../external/referencesource/System.Web/UI/WebControls/LiteralMode.cs System.Web.UI.WebControls/Localize.cs System.Web.UI.WebControls/Login.cs -System.Web.UI.WebControls/LoginCancelEventArgs.cs -System.Web.UI.WebControls/LoginCancelEventHandler.cs -System.Web.UI.WebControls/LoginFailureAction.cs +../../../external/referencesource/System.Web/UI/WebControls/LoginCancelEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/LoginCancelEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/LoginFailureAction.cs System.Web.UI.WebControls/LoginName.cs System.Web.UI.WebControls/LoginStatus.cs System.Web.UI.WebControls/LoginTextLayout.cs System.Web.UI.WebControls/LoginView.cs -System.Web.UI.WebControls/LogoutAction.cs +../../../external/referencesource/System.Web/UI/WebControls/LogoutAction.cs System.Web.UI.WebControls/MailDefinition.cs -System.Web.UI.WebControls/MailMessageEventArgs.cs -System.Web.UI.WebControls/MailMessageEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/MailMessageEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/MailMessageEventHandler.cs System.Web.UI.WebControls/Menu.cs -System.Web.UI.WebControls/MenuEventArgs.cs -System.Web.UI.WebControls/MenuEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/MenuEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/MenuEventHandler.cs System.Web.UI.WebControls/MenuItemBindingCollection.cs System.Web.UI.WebControls/MenuItemBinding.cs System.Web.UI.WebControls/MenuItemCollection.cs @@ -983,37 +984,37 @@ System.Web.UI.WebControls/MenuItemStyleCollection.cs System.Web.UI.WebControls/MenuItemStyle.cs System.Web.UI.WebControls/MenuItemTemplateContainer.cs System.Web.UI.WebControls/MenuTableRenderer.cs -System.Web.UI.WebControls/MonthChangedEventArgs.cs -System.Web.UI.WebControls/MonthChangedEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/MonthChangedEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/MonthChangedEventHandler.cs System.Web.UI.WebControls/MultiView.cs System.Web.UI.WebControls/MultiViewControlBuilder.cs -System.Web.UI.WebControls/NextPrevFormat.cs +../../../external/referencesource/System.Web/UI/WebControls/NextPrevFormat.cs System.Web.UI.WebControls/ObjectDataSource.cs -System.Web.UI.WebControls/ObjectDataSourceDisposingEventArgs.cs -System.Web.UI.WebControls/ObjectDataSourceDisposingEventHandler.cs -System.Web.UI.WebControls/ObjectDataSourceEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/ObjectDataSourceDisposingEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/ObjectDataSourceDisposingEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/ObjectDataSourceEventArgs.cs System.Web.UI.WebControls/ObjectDataSourceEventHandler.cs -System.Web.UI.WebControls/ObjectDataSourceFilteringEventArgs.cs -System.Web.UI.WebControls/ObjectDataSourceFilteringEventHandler.cs -System.Web.UI.WebControls/ObjectDataSourceMethodEventArgs.cs -System.Web.UI.WebControls/ObjectDataSourceMethodEventHandler.cs -System.Web.UI.WebControls/ObjectDataSourceSelectingEventArgs.cs -System.Web.UI.WebControls/ObjectDataSourceSelectingEventHandler.cs -System.Web.UI.WebControls/ObjectDataSourceStatusEventArgs.cs -System.Web.UI.WebControls/ObjectDataSourceStatusEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/ObjectDataSourceFilteringEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/ObjectDataSourceFilteringEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/ObjectDataSourceMethodEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/ObjectDataSourceMethodEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/ObjectDataSourceSelectingEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/ObjectDataSourceSelectingEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/ObjectDataSourceStatusEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/ObjectDataSourceStatusEventHandler.cs System.Web.UI.WebControls/ObjectDataSourceView.cs -System.Web.UI.WebControls/Orientation.cs +../../../external/referencesource/System.Web/UI/WebControls/Orientation.cs System.Web.UI.WebControls/PagedDataSource.cs -System.Web.UI.WebControls/PagerButtons.cs -System.Web.UI.WebControls/PagerMode.cs -System.Web.UI.WebControls/PagerPosition.cs +../../../external/referencesource/System.Web/UI/WebControls/PagerButtons.cs +../../../external/referencesource/System.Web/UI/WebControls/PagerMode.cs +../../../external/referencesource/System.Web/UI/WebControls/PagerPosition.cs System.Web.UI.WebControls/PagerSettings.cs System.Web.UI.WebControls/Panel.cs System.Web.UI.WebControls/PanelStyle.cs System.Web.UI.WebControls/ParameterCollection.cs System.Web.UI.WebControls/Parameter.cs System.Web.UI.WebControls/PasswordRecovery.cs -System.Web.UI.WebControls/PathDirection.cs +../../../external/referencesource/System.Web/UI/WebControls/PathDirection.cs System.Web.UI.WebControls/PlaceHolderControlBuilder.cs System.Web.UI.WebControls/PlaceHolder.cs System.Web.UI.WebControls/PolygonHotSpot.cs @@ -1024,55 +1025,55 @@ System.Web.UI.WebControls/RadioButtonList.cs System.Web.UI.WebControls/RangeValidator.cs System.Web.UI.WebControls/RectangleHotSpot.cs System.Web.UI.WebControls/RegularExpressionValidator.cs -System.Web.UI.WebControls/RepeatDirection.cs -System.Web.UI.WebControls/RepeaterCommandEventArgs.cs -System.Web.UI.WebControls/RepeaterCommandEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/RepeatDirection.cs +../../../external/referencesource/System.Web/UI/WebControls/RepeaterCommandEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/RepeaterCommandEventHandler.cs System.Web.UI.WebControls/Repeater.cs System.Web.UI.WebControls/RepeaterItemCollection.cs System.Web.UI.WebControls/RepeaterItem.cs -System.Web.UI.WebControls/RepeaterItemEventArgs.cs -System.Web.UI.WebControls/RepeaterItemEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/RepeaterItemEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/RepeaterItemEventHandler.cs System.Web.UI.WebControls/RepeatInfo.cs -System.Web.UI.WebControls/RepeatLayout.cs +../../../external/referencesource/System.Web/UI/WebControls/RepeatLayout.cs System.Web.UI.WebControls/RequiredFieldValidator.cs System.Web.UI.WebControls/RoleGroup.cs System.Web.UI.WebControls/RoleGroupCollection.cs System.Web.UI.WebControls/ScrollBars.cs System.Web.UI.WebControls/SelectedDatesCollection.cs System.Web.UI.WebControls/SendMailErrorEventArgs.cs -System.Web.UI.WebControls/SendMailErrorEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/SendMailErrorEventHandler.cs System.Web.UI.WebControls/ServerValidateEventArgs.cs -System.Web.UI.WebControls/ServerValidateEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/ServerValidateEventHandler.cs System.Web.UI.WebControls/SessionParameter.cs System.Web.UI.WebControls/SiteMapDataSource.cs System.Web.UI.WebControls/SiteMapDataSourceView.cs System.Web.UI.WebControls/SiteMapHierarchicalDataSourceView.cs System.Web.UI.WebControls/SiteMapNodeItem.cs -System.Web.UI.WebControls/SiteMapNodeItemEventArgs.cs -System.Web.UI.WebControls/SiteMapNodeItemEventHandler.cs -System.Web.UI.WebControls/SiteMapNodeItemType.cs +../../../external/referencesource/System.Web/UI/WebControls/SiteMapNodeItemEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/SiteMapNodeItemEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/SiteMapNodeItemType.cs System.Web.UI.WebControls/SiteMapPath.cs System.Web.UI.WebControls/SiteMapViewType.cs -System.Web.UI.WebControls/SortDirection.cs +../../../external/referencesource/System.Web/UI/WebControls/SortDirection.cs System.Web.UI.WebControls/StyleCollection.cs -System.Web.UI.WebControls/SqlDataSourceCommandEventArgs.cs -System.Web.UI.WebControls/SqlDataSourceCommandEventHandler.cs -System.Web.UI.WebControls/SqlDataSourceCommandType.cs -System.Web.UI.WebControls/SqlDataSourceFilteringEventHandler.cs -System.Web.UI.WebControls/SqlDataSourceFilteringEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/SqlDataSourceCommandEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/SqlDataSourceCommandEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/SqlDataSourceCommandType.cs +../../../external/referencesource/System.Web/UI/WebControls/SqlDataSourceFilteringEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/SqlDataSourceFilteringEventArgs.cs System.Web.UI.WebControls/SqlDataSource.cs -System.Web.UI.WebControls/SqlDataSourceMode.cs -System.Web.UI.WebControls/SqlDataSourceSelectingEventHandler.cs -System.Web.UI.WebControls/SqlDataSourceSelectingEventArgs.cs -System.Web.UI.WebControls/SqlDataSourceStatusEventArgs.cs -System.Web.UI.WebControls/SqlDataSourceStatusEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/SqlDataSourceMode.cs +../../../external/referencesource/System.Web/UI/WebControls/SqlDataSourceSelectingEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/SqlDataSourceSelectingEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/SqlDataSourceStatusEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/SqlDataSourceStatusEventHandler.cs System.Web.UI.WebControls/SqlDataSourceView.cs System.Web.UI.WebControls/StringArrayConverter.cs System.Web.UI.WebControls/Style.cs System.Web.UI.WebControls/SubMenuStyleCollection.cs System.Web.UI.WebControls/SubMenuStyle.cs System.Web.UI.WebControls/Substitution.cs -System.Web.UI.WebControls/TableCaptionAlign.cs +../../../external/referencesource/System.Web/UI/WebControls/TableCaptionAlign.cs System.Web.UI.WebControls/TableCellCollection.cs System.Web.UI.WebControls/TableCellControlBuilder.cs System.Web.UI.WebControls/TableCell.cs @@ -1080,48 +1081,48 @@ System.Web.UI.WebControls/Table.cs System.Web.UI.WebControls/TableFooterRow.cs System.Web.UI.WebControls/TableHeaderCell.cs System.Web.UI.WebControls/TableHeaderRow.cs -System.Web.UI.WebControls/TableHeaderScope.cs +../../../external/referencesource/System.Web/UI/WebControls/TableHeaderScope.cs System.Web.UI.WebControls/TableItemStyle.cs System.Web.UI.WebControls/TableRowCollection.cs System.Web.UI.WebControls/TableRow.cs -System.Web.UI.WebControls/TableRowSection.cs +../../../external/referencesource/System.Web/UI/WebControls/TableRowSection.cs System.Web.UI.WebControls/TableSectionStyle.cs System.Web.UI.WebControls/TableStyle.cs System.Web.UI.WebControls/TargetConverter.cs System.Web.UI.WebControls/TemplateColumn.cs System.Web.UI.WebControls/TemplatedWizardStep.cs System.Web.UI.WebControls/TemplateField.cs -System.Web.UI.WebControls/TextAlign.cs +../../../external/referencesource/System.Web/UI/WebControls/TextAlign.cs System.Web.UI.WebControls/TextBoxControlBuilder.cs System.Web.UI.WebControls/TextBox.cs -System.Web.UI.WebControls/TextBoxMode.cs -System.Web.UI.WebControls/TitleFormat.cs +../../../external/referencesource/System.Web/UI/WebControls/TextBoxMode.cs +../../../external/referencesource/System.Web/UI/WebControls/TitleFormat.cs System.Web.UI.WebControls/TreeNodeBindingCollection.cs System.Web.UI.WebControls/TreeNodeBinding.cs System.Web.UI.WebControls/TreeNodeCollection.cs System.Web.UI.WebControls/TreeNode.cs -System.Web.UI.WebControls/TreeNodeEventArgs.cs -System.Web.UI.WebControls/TreeNodeEventHandler.cs -System.Web.UI.WebControls/TreeNodeSelectAction.cs +../../../external/referencesource/System.Web/UI/WebControls/TreeNodeEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/TreeNodeEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/TreeNodeSelectAction.cs System.Web.UI.WebControls/TreeNodeStyleCollection.cs System.Web.UI.WebControls/TreeNodeStyle.cs System.Web.UI.WebControls/TreeNodeTypes.cs System.Web.UI.WebControls/TreeView.cs -System.Web.UI.WebControls/TreeViewImageSet.cs +../../../external/referencesource/System.Web/UI/WebControls/TreeViewImageSet.cs System.Web.UI.WebControls/UnitConverter.cs System.Web.UI.WebControls/Unit.cs -System.Web.UI.WebControls/UnitType.cs +../../../external/referencesource/System.Web/UI/WebControls/UnitType.cs System.Web.UI.WebControls/ValidatedControlConverter.cs -System.Web.UI.WebControls/ValidationCompareOperator.cs -System.Web.UI.WebControls/ValidationDataType.cs +../../../external/referencesource/System.Web/UI/WebControls/ValidationCompareOperator.cs +../../../external/referencesource/System.Web/UI/WebControls/ValidationDataType.cs System.Web.UI.WebControls/ValidationSummary.cs -System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs -System.Web.UI.WebControls/ValidatorDisplay.cs +../../../external/referencesource/System.Web/UI/WebControls/ValidationSummaryDisplayMode.cs +../../../external/referencesource/System.Web/UI/WebControls/ValidatorDisplay.cs System.Web.UI.WebControls/VerticalAlignConverter.cs -System.Web.UI.WebControls/VerticalAlign.cs +../../../external/referencesource/System.Web/UI/WebControls/VerticalAlign.cs System.Web.UI.WebControls/ViewCollection.cs System.Web.UI.WebControls/View.cs -System.Web.UI.WebControls/WebColorConverter.cs +../../../external/referencesource/System.Web/UI/WebControls/WebColorConverter.cs System.Web.UI.WebControls/WebControl.cs System.Web.UI.WebControls.WebParts/ConnectionConsumerCallback.cs System.Web.UI.WebControls.WebParts/ConnectionInterfaceCollection.cs @@ -1132,38 +1133,39 @@ System.Web.UI.WebControls.WebParts/ConsumerConnectionPoint.cs System.Web.UI.WebControls.WebParts/EditorPart.cs System.Web.UI.WebControls.WebParts/EditorPartCollection.cs System.Web.UI.WebControls.WebParts/IPersonalizable.cs -System.Web.UI.WebControls.WebParts/ITrackingPersonalizable.cs -System.Web.UI.WebControls.WebParts/ITransformerConfigurationControl.cs -System.Web.UI.WebControls.WebParts/IVersioningPersonalizable.cs -System.Web.UI.WebControls.WebParts/IWebActionable.cs -System.Web.UI.WebControls.WebParts/IWebEditable.cs -System.Web.UI.WebControls.WebParts/IWebPart.cs -System.Web.UI.WebControls.WebParts/IWebPartHttpHandler.cs -System.Web.UI.WebControls.WebParts/IWebPartField.cs -System.Web.UI.WebControls.WebParts/IWebPartParameters.cs -System.Web.UI.WebControls.WebParts/IWebPartRow.cs -System.Web.UI.WebControls.WebParts/IWebPartTable.cs +../../../external/referencesource/System.Web/UI/WebParts/ITrackingPersonalizable.cs +../../../external/referencesource/System.Web/UI/WebParts/ITransformerConfigurationControl.cs +../../../external/referencesource/System.Web/UI/WebParts/IVersioningPersonalizable.cs +../../../external/referencesource/System.Web/UI/WebParts/IWebActionable.cs +../../../external/referencesource/System.Web/UI/WebParts/IWebEditable.cs +../../../external/referencesource/System.Web/UI/WebParts/IWebPart.cs +../../../external/referencesource/System.Web/UI/WebParts/IWebPartHttpHandler.cs +../../../external/referencesource/System.Web/UI/WebParts/IWebPartField.cs +../../../external/referencesource/System.Web/UI/WebParts/IWebPartParameters.cs +../../../external/referencesource/System.Web/UI/WebParts/IWebPartRow.cs +../../../external/referencesource/System.Web/UI/WebParts/IWebPartTable.cs System.Web.UI.WebControls.WebParts/Part.cs -System.Web.UI.WebControls.WebParts/PartChromeState.cs -System.Web.UI.WebControls.WebParts/PartChromeType.cs +../../../external/referencesource/System.Web/UI/WebParts/ParametersCallback.cs +../../../external/referencesource/System.Web/UI/WebParts/PartChromeState.cs +../../../external/referencesource/System.Web/UI/WebParts/PartChromeType.cs System.Web.UI.WebControls.WebParts/PersonalizableAttribute.cs -System.Web.UI.WebControls.WebParts/PersonalizationScope.cs +../../../external/referencesource/System.Web/UI/WebParts/PersonalizationScope.cs System.Web.UI.WebControls.WebParts/ProviderConnectionPoint.cs System.Web.UI.WebControls.WebParts/TypeCollection.cs System.Web.UI.WebControls.WebParts/WebPart.cs System.Web.UI.WebControls.WebParts/WebPartAuthorizationEventArgs.cs -System.Web.UI.WebControls.WebParts/WebPartAuthorizationEventHandler.cs -System.Web.UI.WebControls.WebParts/WebPartCancelEventArgs.cs -System.Web.UI.WebControls.WebParts/WebPartCancelEventHandler.cs -System.Web.UI.WebControls.WebParts/WebPartEventArgs.cs -System.Web.UI.WebControls.WebParts/WebPartEventHandler.cs -System.Web.UI.WebControls.WebParts/WebPartExportMode.cs -System.Web.UI.WebControls.WebParts/WebPartHelpMode.cs +../../../external/referencesource/System.Web/UI/WebParts/WebPartAuthorizationEventHandler.cs +../../../external/referencesource/System.Web/UI/WebParts/WebPartCancelEventArgs.cs +../../../external/referencesource/System.Web/UI/WebParts/WebPartCancelEventHandler.cs +../../../external/referencesource/System.Web/UI/WebParts/WebPartEventArgs.cs +../../../external/referencesource/System.Web/UI/WebParts/WebPartEventHandler.cs +../../../external/referencesource/System.Web/UI/WebParts/WebPartExportMode.cs +../../../external/referencesource/System.Web/UI/WebParts/WebPartHelpMode.cs System.Web.UI.WebControls.WebParts/WebPartPageMenuMode.cs System.Web.UI.WebControls.WebParts/WebPartVerbCollection.cs System.Web.UI.WebControls.WebParts/WebPartVerb.cs -System.Web.UI.WebControls.WebParts/WebPartVerbsEventArgs.cs -System.Web.UI.WebControls.WebParts/WebPartVerbsEventHandler.cs +../../../external/referencesource/System.Web/UI/WebParts/WebPartVerbsEventArgs.cs +../../../external/referencesource/System.Web/UI/WebParts/WebPartVerbsEventHandler.cs System.Web.UI.WebControls/Wizard.cs System.Web.UI.WebControls/WizardNavigationEventArgs.cs System.Web.UI.WebControls/WizardNavigationEventHandler.cs @@ -1194,7 +1196,8 @@ System.Web.Util/FileUtils.cs System.Web.Util/Helpers.cs System.Web.Util/HttpEncoder.cs System.Web.Util/ICalls.cs -System.Web.Util/IWebObjectFactory.cs +../../../external/referencesource/System.Web/Util/IObjectFactory.cs +../../../external/referencesource/System.Web/Util/StringUtil.cs System.Web.Util/IWebPropertyAccessor.cs System.Web.Util/MachineKeySectionUtils.cs System.Web.Util/RuntimeHelpers.cs @@ -1218,5 +1221,152 @@ System.Web/WebROCollection.cs System.Web/WebSysDescriptionAttribute.cs System.Web/XmlSiteMapProvider.cs +../../../external/referencesource/System.Web/IHtmlString.cs +System.Web/HtmlString.cs +../../../external/referencesource/System.Web/PreApplicationStartMethodAttribute.cs + +System.Web.Caching/FileResponseElement.cs +System.Web.Caching/HeaderElement.cs +../../../external/referencesource/System.Web/Cache/IOutputCacheEntry.cs +System.Web.Caching/MemoryResponseElement.cs +System.Web.Caching/OutputCache.cs +System.Web.Caching/OutputCacheProviderCollection.cs +../../../external/referencesource/System.Web/Cache/ResponseElement.cs +System.Web.Caching/SubstitutionResponseElement.cs +System.Web.Configuration_2.0/VersionConverter.cs +../../../external/referencesource/System.Web/Configuration/MachineKeyCompatibilityMode.cs +System.Web.Configuration_2.0/HttpCapabilitiesProvider.cs +System.Web.Configuration_2.0/HttpCapabilitiesDefaultProvider.cs +../../../external/referencesource/System.Web/Compilation/FolderLevelBuildProviderAppliesTo.cs +../../../external/referencesource/System.Web/Compilation/FolderLevelBuildProviderAppliesToAttribute.cs +System.Web.Compilation/RouteUrlExpressionBuilder.cs +System.Web.Compilation/RouteValueExpressionBuilder.cs +System.Web.Security/MachineKey.cs +System.Web.Security/MachineKeyProtection.cs +../../../external/referencesource/System.Web/State/SessionStateBehavior.cs +System.Web.Routing/PageRouteHandler.cs +../../../external/referencesource/System.Web/UI/ClientIDMode.cs +../../../external/referencesource/System.Web/UI/DataKeyPropertyAttribute.cs +System.Web.UI/FileLevelMasterPageControlBuilder.cs +../../../external/referencesource/System.Web/UI/IDataKeysControl.cs +../../../external/referencesource/System.Web/UI/ViewStateMode.cs +../../../external/referencesource/System.Web/UI/WebControls/IDataBoundControl.cs +../../../external/referencesource/System.Web/UI/WebControls/CallingDataMethodsEventHandler.cs +../../../external/referencesource/System.Web/UI/WebControls/CallingDataMethodsEventArgs.cs +../../../external/referencesource/System.Web/UI/WebControls/IDataBoundItemControl.cs +../../../external/referencesource/System.Web/UI/WebControls/IDataBoundListControl.cs +../../../external/referencesource/System.Web/UI/WebControls/IFieldControl.cs +System.Web.UI.WebControls/IRenderOuterTable.cs +System.Web.UI.WebControls/MenuListRenderer.cs +../../../external/referencesource/System.Web/UI/WebControls/MenuRenderingMode.cs +System.Web.UI.WebControls/NamedCssStyleCollection.cs +System.Web.UI.WebControls/RouteParameter.cs +System.Web.UI.WebControls/StyleBlock.cs +System.Web.UI.WebControls/WizardLayoutContainer.cs +System.Web.UI.WebControls/WizardLayoutNavigationContainer.cs +System.Web.Util/SimpleWebObjectFactory.cs +../../../external/referencesource/System.Web/Util/RequestValidationSource.cs +System.Web.Util/RequestValidator.cs + +System.Web.Routing/HttpMethodConstraint.cs +../../../external/referencesource/System.Web/Routing/IRouteConstraint.cs +../../../external/referencesource/System.Web/Routing/IRouteHandler.cs +System.Web.Routing/PatternParser.cs +System.Web.Routing/PatternToken.cs +System.Web.Routing/PatternTokenType.cs +../../../external/referencesource/System.Web/Routing/RequestContext.cs +System.Web.Routing/Route.cs +../../../external/referencesource/System.Web/Routing/RouteBase.cs +System.Web.Routing/RouteCollection.cs +System.Web.Routing/RouteData.cs +../../../external/referencesource/System.Web/Routing/RouteDirection.cs +../../../external/referencesource/System.Web/Routing/RouteTable.cs +../../../external/referencesource/System.Web/Routing/RouteValueDictionary.cs +System.Web.Routing/RouteValueDictionaryExtensions.cs +System.Web.Routing/StopRoutingHandler.cs +System.Web.Routing/UrlRoutingHandler.cs +System.Web.Routing/UrlRoutingModule.cs +../../../external/referencesource/System.Web/Routing/VirtualPathData.cs + +../../../external/referencesource/System.Web/Abstractions/HttpApplicationStateBase.cs +../../../external/referencesource/System.Web/Abstractions/HttpApplicationStateWrapper.cs +../../../external/referencesource/System.Web/Abstractions/HttpBrowserCapabilitiesBase.cs +../../../external/referencesource/System.Web/Abstractions/HttpBrowserCapabilitiesWrapper.cs +../../../external/referencesource/System.Web/Abstractions/HttpCachePolicyBase.cs +../../../external/referencesource/System.Web/Abstractions/HttpCachePolicyWrapper.cs +System.Web/HttpContextBase.cs +System.Web/HttpContextWrapper.cs +../../../external/referencesource/System.Web/Abstractions/HttpFileCollectionBase.cs +System.Web/HttpFileCollectionWrapper.cs +../../../external/referencesource/System.Web/Abstractions/HttpPostedFileBase.cs +../../../external/referencesource/System.Web/Abstractions/HttpPostedFileWrapper.cs +../../../external/referencesource/System.Web/Abstractions/HttpRequestBase.cs +System.Web/HttpRequestWrapper.cs +../../../external/referencesource/System.Web/Abstractions/HttpResponseBase.cs +System.Web/HttpResponseWrapper.cs +../../../external/referencesource/System.Web/Abstractions/HttpServerUtilityBase.cs +System.Web/HttpServerUtilityWrapper.cs +../../../external/referencesource/System.Web/Abstractions/HttpSessionStateBase.cs +../../../external/referencesource/System.Web/Abstractions/HttpSessionStateWrapper.cs +../../../external/referencesource/System.Web/Abstractions/HttpStaticObjectsCollectionBase.cs +../../../external/referencesource/System.Web/Abstractions/HttpStaticObjectsCollectionWrapper.cs + System.Collections.Concurrent/SplitOrderedList.cs +System.Web/EventHandlerTaskAsyncHelper.cs +System.Web/HttpTaskAsyncHandler.cs +System.Web/MimeMapping.cs +../../../external/referencesource/System.Web/ReadEntityBodyMode.cs +System.Web/UnvalidatedRequestValues.cs +../../../external/referencesource/System.Web/UnvalidatedRequestValuesWrapper.cs +../../../external/referencesource/System.Web/UnvalidatedRequestValuesBase.cs +System.Web/TaskAsyncResult.cs +System.Web/TaskEventHandler.cs +System.Web.Security/MembershipPasswordAttribute.cs +System.Web/DynamicModuleManager.cs + +../../../external/referencesource/System.Web/ISubscriptionToken.cs +../../../external/referencesource/System.Web/ITlsTokenBindingInfo.cs + +../../../external/referencesource/System.Web/ModelBinding/IModelNameProvider.cs +../../../external/referencesource/System.Web/ModelBinding/BindingBehaviorAttribute.cs +../../../external/referencesource/System.Web/ModelBinding/BindingBehavior.cs +../../../external/referencesource/System.Web/ModelBinding/BindNeverAttribute.cs +../../../external/referencesource/System.Web/ModelBinding/BindRequiredAttribute.cs +../../../external/referencesource/System.Web/ModelBinding/ExtensibleModelBinderAttribute.cs +../../../external/referencesource/System.Web/ModelBinding/ModelBinderProviderOptionsAttribute.cs +../../../external/referencesource/System.Web/ModelBinding/ModelErrorCollection.cs +../../../external/referencesource/System.Web/ModelBinding/ModelError.cs + + +../../../external/referencesource/System.Web/Security/AntiXss/CodeCharts.cs + +../../../external/referencesource/System.Web/UI/WebParts/WebBrowsableAttribute.cs +../../../external/referencesource/System.Web/UI/WebParts/WebDescriptionAttribute.cs +../../../external/referencesource/System.Web/UI/WebParts/WebDisplayNameAttribute.cs +../../../external/referencesource/System.Web/UI/WebParts/TableCallback.cs +../../../external/referencesource/System.Web/UI/WebParts/RowCallback.cs +../../../external/referencesource/System.Web/UI/WebParts/FieldCallback.cs + +../../../external/referencesource/System.Web/UI/UnobtrusiveValidationMode.cs +../../../external/referencesource/System.Web/UI/ValidateRequestMode.cs + +../../../external/referencesource/System.Web/Configuration/AsyncPreloadModeFlags.cs +../../../external/referencesource/System.Web/Configuration/BrowserCapsElementType.cs +../../../external/referencesource/System.Web/Configuration/BrowserTree.cs +../../../external/referencesource/System.Web/Configuration/CustomWebEventKey.cs +../../../external/referencesource/System.Web/Configuration/DelayedRegex.cs +../../../external/referencesource/System.Web/Configuration/ProfileGuidedOptimizationsFlags.cs + +../../../external/referencesource/System.Web/Configuration/RegexMatchTimeoutValidator.cs +../../../external/referencesource/System.Web/Configuration/RegexMatchTimeoutValidatorAttribute.cs +../../../external/referencesource/System.Web/Configuration/RpcAuthent.cs +../../../external/referencesource/System.Web/Configuration/RpcImpers.cs +../../../external/referencesource/System.Web/Configuration/RpcLevel.cs +../../../external/referencesource/System.Web/Configuration/TicketCompatibilityMode.cs +../../../external/referencesource/System.Web/Configuration/WebLevel.cs + +../../../external/referencesource/System.Web/WebSockets/AspNetWebSocketOptions.cs +../../../external/referencesource/System.Web/WebSockets/SubprotocolUtil.cs +../../build/common/SR.cs +ReferenceSources/SR.cs diff --git a/mcs/class/System.Web/System.Web/HeadersCollection.cs b/mcs/class/System.Web/System.Web/HeadersCollection.cs index b2a1c73b7f..fe2cf558af 100644 --- a/mcs/class/System.Web/System.Web/HeadersCollection.cs +++ b/mcs/class/System.Web/System.Web/HeadersCollection.cs @@ -39,6 +39,30 @@ namespace System.Web { } + public override void Add (string name, string value) + { + if (IsReadOnly) + throw new PlatformNotSupportedException (); + + base.Set (name, value); + } + + public override void Set (string name, string value) + { + if (IsReadOnly) + throw new PlatformNotSupportedException (); + + base.Set (name, value); + } + + public override void Remove (string name) + { + if (IsReadOnly) + throw new PlatformNotSupportedException (); + + base.Remove (name); + } + protected override void InsertInfo() { HttpWorkerRequest worker_request = _request.WorkerRequest; diff --git a/mcs/class/System.Web/System.Web/HttpApplication.cs b/mcs/class/System.Web/System.Web/HttpApplication.cs index 34c2d10576..c2fc0ddb71 100644 --- a/mcs/class/System.Web/System.Web/HttpApplication.cs +++ b/mcs/class/System.Web/System.Web/HttpApplication.cs @@ -567,9 +567,9 @@ namespace System.Web AddOnPostAuthenticateRequestAsync (bh, eh, null); } - public void AddOnPostAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnPostAuthenticateRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); PostAuthenticateRequest += new EventHandler (invoker.Invoke); } @@ -585,9 +585,9 @@ namespace System.Web AddOnPostAuthorizeRequestAsync (bh, eh, null); } - public void AddOnPostAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnPostAuthorizeRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); PostAuthorizeRequest += new EventHandler (invoker.Invoke); } @@ -603,9 +603,9 @@ namespace System.Web AddOnPostResolveRequestCacheAsync (bh, eh, null); } - public void AddOnPostResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnPostResolveRequestCacheAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); PostResolveRequestCache += new EventHandler (invoker.Invoke); } @@ -621,9 +621,9 @@ namespace System.Web AddOnPostMapRequestHandlerAsync (bh, eh, null); } - public void AddOnPostMapRequestHandlerAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnPostMapRequestHandlerAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); PostMapRequestHandler += new EventHandler (invoker.Invoke); } @@ -639,9 +639,9 @@ namespace System.Web AddOnPostAcquireRequestStateAsync (bh, eh, null); } - public void AddOnPostAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnPostAcquireRequestStateAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); PostAcquireRequestState += new EventHandler (invoker.Invoke); } @@ -657,9 +657,9 @@ namespace System.Web AddOnPostReleaseRequestStateAsync (bh, eh, null); } - public void AddOnPostReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnPostReleaseRequestStateAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); PostReleaseRequestState += new EventHandler (invoker.Invoke); } @@ -675,72 +675,72 @@ namespace System.Web AddOnPostUpdateRequestCacheAsync (bh, eh, null); } - public void AddOnPostUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnPostUpdateRequestCacheAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); PostUpdateRequestCache += new EventHandler (invoker.Invoke); } // // The new overloads that take a data parameter // - public void AddOnAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnAcquireRequestStateAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); AcquireRequestState += new EventHandler (invoker.Invoke); } - public void AddOnAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnAuthenticateRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); AuthenticateRequest += new EventHandler (invoker.Invoke); } - public void AddOnAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnAuthorizeRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); AuthorizeRequest += new EventHandler (invoker.Invoke); } - public void AddOnBeginRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnBeginRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); BeginRequest += new EventHandler (invoker.Invoke); } - public void AddOnEndRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnEndRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); EndRequest += new EventHandler (invoker.Invoke); } - public void AddOnPostRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnPostRequestHandlerExecuteAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); PostRequestHandlerExecute += new EventHandler (invoker.Invoke); } - public void AddOnPreRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnPreRequestHandlerExecuteAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); PreRequestHandlerExecute += new EventHandler (invoker.Invoke); } - public void AddOnReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnReleaseRequestStateAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); ReleaseRequestState += new EventHandler (invoker.Invoke); } - public void AddOnResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnResolveRequestCacheAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); ResolveRequestCache += new EventHandler (invoker.Invoke); } - public void AddOnUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data) + public void AddOnUpdateRequestCacheAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state) { - AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data); + AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state); UpdateRequestCache += new EventHandler (invoker.Invoke); } diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpContextBase.cs b/mcs/class/System.Web/System.Web/HttpContextBase.cs similarity index 100% rename from mcs/class/System.Web.Abstractions/System.Web/HttpContextBase.cs rename to mcs/class/System.Web/System.Web/HttpContextBase.cs diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpContextWrapper.cs b/mcs/class/System.Web/System.Web/HttpContextWrapper.cs similarity index 100% rename from mcs/class/System.Web.Abstractions/System.Web/HttpContextWrapper.cs rename to mcs/class/System.Web/System.Web/HttpContextWrapper.cs diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs b/mcs/class/System.Web/System.Web/HttpFileCollectionWrapper.cs similarity index 100% rename from mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs rename to mcs/class/System.Web/System.Web/HttpFileCollectionWrapper.cs diff --git a/mcs/class/System.Web/System.Web/HttpRequest.cs b/mcs/class/System.Web/System.Web/HttpRequest.cs index d273f1cf1f..8e9359a9f8 100755 --- a/mcs/class/System.Web/System.Web/HttpRequest.cs +++ b/mcs/class/System.Web/System.Web/HttpRequest.cs @@ -39,6 +39,7 @@ using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; using System.Security.Principal; +using System.Threading; using System.Web.Configuration; using System.Web.Management; using System.Web.UI; @@ -980,6 +981,11 @@ namespace System.Web } } + public Stream GetBufferedInputStream () + { + return input_stream; + } + public Stream GetBufferlessInputStream () { if (bufferlessInputStream == null) { @@ -993,6 +999,11 @@ namespace System.Web return bufferlessInputStream; } + public Stream GetBufferlessInputStream (bool disableMaxRequestLength) + { + return GetBufferlessInputStream (); + } + // // Stream that returns the data as it is read, without buffering // @@ -1399,6 +1410,12 @@ namespace System.Web } } + public CancellationToken TimedOutToken { + get { + throw new NotImplementedException (); + } + } + public int TotalBytes { get { Stream ins = InputStream; @@ -1508,6 +1525,38 @@ namespace System.Web } public int [] MapImageCoordinates (string imageFieldName) + { + string[] parameters = GetImageCoordinatesParameters (imageFieldName); + if (parameters == null) + return null; + int [] result = new int [2]; + try { + result [0] = Int32.Parse (parameters [0]); + result [1] = Int32.Parse (parameters [1]); + } catch { + return null; + } + + return result; + } + + public double [] MapRawImageCoordinates (string imageFieldName) + { + string[] parameters = GetImageCoordinatesParameters (imageFieldName); + if (parameters == null) + return null; + double [] result = new double [2]; + try { + result [0] = Double.Parse (parameters [0]); + result [1] = Double.Parse (parameters [1]); + } catch { + return null; + } + + return result; + } + + string [] GetImageCoordinatesParameters (string imageFieldName) { string method = HttpMethod; NameValueCollection coll = null; @@ -1526,14 +1575,7 @@ namespace System.Web string y = coll [imageFieldName + ".y"]; if (y == null || y == "") return null; - - int [] result = new int [2]; - try { - result [0] = Int32.Parse (x); - result [1] = Int32.Parse (y); - } catch { - return null; - } + string[] result = new string [] { x, y }; return result; } diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpRequestWrapper.cs b/mcs/class/System.Web/System.Web/HttpRequestWrapper.cs similarity index 87% rename from mcs/class/System.Web.Abstractions/System.Web/HttpRequestWrapper.cs rename to mcs/class/System.Web/System.Web/HttpRequestWrapper.cs index 43abae8043..fee41fe43d 100644 --- a/mcs/class/System.Web.Abstractions/System.Web/HttpRequestWrapper.cs +++ b/mcs/class/System.Web/System.Web/HttpRequestWrapper.cs @@ -38,6 +38,7 @@ using System.Runtime.Serialization; using System.Security.Permissions; using System.Security.Principal; using System.Text; +using System.Threading; using System.Web.Caching; using System.Security.Authentication.ExtendedProtection; @@ -126,6 +127,21 @@ namespace System.Web get { return w.Headers; } } + public override Stream GetBufferedInputStream () + { + return w.GetBufferedInputStream (); + } + + public override Stream GetBufferlessInputStream () + { + return w.GetBufferlessInputStream (); + } + + public override Stream GetBufferlessInputStream (System.Boolean disableMaxRequestLength) + { + return w.GetBufferlessInputStream (disableMaxRequestLength); + } + public override string HttpMethod { get { return w.HttpMethod; } } @@ -190,12 +206,16 @@ namespace System.Web } public override RequestContext RequestContext { get { return w.RequestContext; } - internal set { w.RequestContext = value; } + set { w.RequestContext = value; } } public override NameValueCollection ServerVariables { get { return w.ServerVariables; } } + public virtual CancellationToken TimedOutToken { + get { return w.TimedOutToken; } + } + public override int TotalBytes { get { return w.TotalBytes; } } @@ -247,14 +267,19 @@ namespace System.Web return w.MapImageCoordinates (imageFieldName); } - public override string MapPath (string overridePath) + public override string MapPath (string virtualPath) { - return w.MapPath (overridePath); + return w.MapPath (virtualPath); } - public override string MapPath (string overridePath, string baseVirtualDir, bool allowCrossAppMapping) + public override string MapPath (string virtualPath, string baseVirtualDir, bool allowCrossAppMapping) { - return w.MapPath (overridePath, baseVirtualDir, allowCrossAppMapping); + return w.MapPath (virtualPath, baseVirtualDir, allowCrossAppMapping); + } + + public override double [] MapRawImageCoordinates (System.String imageFieldName) + { + return w.MapRawImageCoordinates (imageFieldName); } public override void SaveAs (string filename, bool includeHeaders) diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpResponseWrapper.cs b/mcs/class/System.Web/System.Web/HttpResponseWrapper.cs similarity index 100% rename from mcs/class/System.Web.Abstractions/System.Web/HttpResponseWrapper.cs rename to mcs/class/System.Web/System.Web/HttpResponseWrapper.cs diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpServerUtilityWrapper.cs b/mcs/class/System.Web/System.Web/HttpServerUtilityWrapper.cs similarity index 100% rename from mcs/class/System.Web.Abstractions/System.Web/HttpServerUtilityWrapper.cs rename to mcs/class/System.Web/System.Web/HttpServerUtilityWrapper.cs diff --git a/mcs/class/System.Web/System.Web/IHtmlString.cs b/mcs/class/System.Web/System.Web/IHtmlString.cs deleted file mode 100644 index b8ee7abc55..0000000000 --- a/mcs/class/System.Web/System.Web/IHtmlString.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -// System.Web.IHtmlString.cs -// -// Copyright (C) 2009 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -namespace System.Web { - public interface IHtmlString { - string ToHtmlString (); - } -} - \ No newline at end of file diff --git a/mcs/class/System.Web/System.Web/IHttpAsyncHandler.cs b/mcs/class/System.Web/System.Web/IHttpAsyncHandler.cs deleted file mode 100644 index de69220196..0000000000 --- a/mcs/class/System.Web/System.Web/IHttpAsyncHandler.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.IHttpAsyncHandler.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web -{ - public interface IHttpAsyncHandler : IHttpHandler - { - IAsyncResult BeginProcessRequest(HttpContext context, - AsyncCallback cb, - object extraData); - void EndProcessRequest(IAsyncResult result); - } -} diff --git a/mcs/class/System.Web/System.Web/IHttpHandler.cs b/mcs/class/System.Web/System.Web/IHttpHandler.cs deleted file mode 100644 index ea0535ed63..0000000000 --- a/mcs/class/System.Web/System.Web/IHttpHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// System.IHttpHandler.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web -{ - public interface IHttpHandler - { - bool IsReusable { get; } - void ProcessRequest(HttpContext context); - } -} diff --git a/mcs/class/System.Web/System.Web/IHttpHandlerFactory.cs b/mcs/class/System.Web/System.Web/IHttpHandlerFactory.cs deleted file mode 100644 index d136cae3a3..0000000000 --- a/mcs/class/System.Web/System.Web/IHttpHandlerFactory.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// System.Web.IHttpHandlerFactory.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web -{ - public interface IHttpHandlerFactory - { - IHttpHandler GetHandler(HttpContext context, - string requestType, - string url, - string pathTranslated); - void ReleaseHandler(IHttpHandler handler); - } -} diff --git a/mcs/class/System.Web/System.Web/IHttpModule.cs b/mcs/class/System.Web/System.Web/IHttpModule.cs deleted file mode 100644 index 84654fcd0a..0000000000 --- a/mcs/class/System.Web/System.Web/IHttpModule.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// System.Web.IHttpModule.cs -// -// Author: -// Bob Smith -// -// (C) Bob Smith -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web { - public interface IHttpModule { - void Dispose(); - void Init(HttpApplication context); - } -} diff --git a/mcs/class/System.Web/System.Web/PreApplicationStartMethodAttribute.cs b/mcs/class/System.Web/System.Web/PreApplicationStartMethodAttribute.cs deleted file mode 100644 index ad43cb5742..0000000000 --- a/mcs/class/System.Web/System.Web/PreApplicationStartMethodAttribute.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// PreApplicationStartMethodAttribute -// -// 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; - -namespace System.Web -{ - [AttributeUsage (AttributeTargets.Assembly, AllowMultiple = false)] - public sealed class PreApplicationStartMethodAttribute : Attribute - { - public string MethodName { get; private set; } - public Type Type { get; private set; } - - public PreApplicationStartMethodAttribute (Type type, string methodName) - { - this.MethodName = methodName; - this.Type = type; - } - } -} diff --git a/mcs/class/System.Web/System.Web/ReadEntityBodyMode.cs b/mcs/class/System.Web/System.Web/ReadEntityBodyMode.cs deleted file mode 100644 index a97c3cf5f1..0000000000 --- a/mcs/class/System.Web/System.Web/ReadEntityBodyMode.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// ReadEntityBodyMode.cs -// -// Author: Martin Thwaites (github@my2cents.co.uk) -// -// Copyright (C) 2014 Martin Thwaites -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Web { - public enum ReadEntityBodyMode { - None, - Classic, - Bufferless, - Buffered, - } -} diff --git a/mcs/class/System.Web/System.Web/RequestNotification.cs b/mcs/class/System.Web/System.Web/RequestNotification.cs deleted file mode 100644 index 793deb1e50..0000000000 --- a/mcs/class/System.Web/System.Web/RequestNotification.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// System.Web.RequestNotification -// -// Authors: -// Marek Habersack (mhabersack@novell.com) -// -// (C) 2007-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. -// -namespace System.Web -{ - [FlagsAttribute] - public enum RequestNotification - { - BeginRequest = 0x0001, - AuthenticateRequest = 0x0002, - AuthorizeRequest = 0x0004, - ResolveRequestCache = 0x0008, - MapRequestHandler = 0x0010, - AcquireRequestState = 0x0020, - PreExecuteRequestHandler = 0x0040, - ExecuteRequestHandler = 0x0080, - ReleaseRequestState = 0x0100, - UpdateRequestCache = 0x0200, - LogRequest = 0x0400, - EndRequest = 0x0800, - SendResponse = 0x20000000 - } -} diff --git a/mcs/class/System.Web/System.Web/RequestNotificationStatus.cs b/mcs/class/System.Web/System.Web/RequestNotificationStatus.cs deleted file mode 100644 index 177f0c0b04..0000000000 --- a/mcs/class/System.Web/System.Web/RequestNotificationStatus.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// System.Web.RequestNotificationStatus -// -// Authors: -// Marek Habersack (mhabersack@novell.com) -// -// (C) 2007-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. -// -using System; -using System.Collections.Generic; -using System.Security.Permissions; - -namespace System.Web -{ - public enum RequestNotificationStatus - { - Continue, - Pending, - FinishRequest - } -} diff --git a/mcs/class/System.Web/System.Web/TraceContextEventArgs.cs b/mcs/class/System.Web/System.Web/TraceContextEventArgs.cs deleted file mode 100644 index f236fd47ee..0000000000 --- a/mcs/class/System.Web/System.Web/TraceContextEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// System.Web.TraceContextEventArgs class -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; -using System.Security.Permissions; - -namespace System.Web { - - // CAS - no InheritanceDemand here as the class is sealed - [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] - public sealed class TraceContextEventArgs : EventArgs { - - ICollection trace_records; - - public TraceContextEventArgs (ICollection records) - { - trace_records = records; - } - - public ICollection TraceRecords { - get { return trace_records; } - } - } -} diff --git a/mcs/class/System.Web/System.Web/TraceContextEventHandler.cs b/mcs/class/System.Web/System.Web/TraceContextEventHandler.cs deleted file mode 100644 index 762aa94bde..0000000000 --- a/mcs/class/System.Web/System.Web/TraceContextEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// System.Web.TraceContextEventHandler delegate -// -// Author: -// Sebastien Pouliot -// -// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Web -{ - public delegate void TraceContextEventHandler (object sender, TraceContextEventArgs e); -} diff --git a/mcs/class/System.Web/System.Web/UnvalidatedRequestValuesBase.cs b/mcs/class/System.Web/System.Web/UnvalidatedRequestValuesBase.cs deleted file mode 100644 index 9b54b072e2..0000000000 --- a/mcs/class/System.Web/System.Web/UnvalidatedRequestValuesBase.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -// System.Web.UnvalidatedRequestValuesBase.cs -// -// Author: -// Mike Morano -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Specialized; - - -namespace System.Web { - public abstract class UnvalidatedRequestValuesBase { - void NotImplemented () - { - throw new NotImplementedException (); - } - - public virtual HttpCookieCollection Cookies - { - get { NotImplemented (); return null; } - } - - public virtual HttpFileCollection Files - { - get { NotImplemented (); return null; } - } - - public virtual NameValueCollection Form - { - get { NotImplemented (); return null; } - } - - public virtual NameValueCollection Headers - { - get { NotImplemented (); return null; } - } - - public virtual string this[string field] - { - get { NotImplemented (); return null; } - } - - public virtual string Path - { - get { NotImplemented (); return null; } - } - - public virtual string PathInfo - { - get { NotImplemented (); return null; } - } - - public virtual NameValueCollection QueryString - { - get { NotImplemented (); return null; } - } - - public virtual string RawUrl - { - get { NotImplemented (); return null; } - } - - public virtual Uri Url - { - get { NotImplemented (); return null; } - } - } -} diff --git a/mcs/class/System.Web/System.Web/UnvalidatedRequestValuesWrapper.cs b/mcs/class/System.Web/System.Web/UnvalidatedRequestValuesWrapper.cs deleted file mode 100644 index e6b6084f2f..0000000000 --- a/mcs/class/System.Web/System.Web/UnvalidatedRequestValuesWrapper.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// System.Web.UnvalidatedRequestValuesWrapper.cs -// -// Author: -// Mike Morano -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// 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.Specialized; - - -namespace System.Web { - public class UnvalidatedRequestValuesWrapper : UnvalidatedRequestValuesBase { - UnvalidatedRequestValues rv; - - public UnvalidatedRequestValuesWrapper (UnvalidatedRequestValues requestValues) - { - rv = requestValues; - } - - public override HttpCookieCollection Cookies - { - get { return rv.Cookies; } - } - - public override HttpFileCollection Files - { - get { return rv.Files; } - } - - public override NameValueCollection Form - { - get { return rv.Form; } - } - - public override NameValueCollection Headers - { - get { return rv.Headers; } - } - - public override string this[string field] - { - get { return rv[field]; } - } - - public override string Path - { - get { return rv.Path; } - } - - public override string PathInfo - { - get { return rv.PathInfo; } - } - - public override NameValueCollection QueryString - { - get { return rv.QueryString; } - } - - public override string RawUrl - { - get { return rv.RawUrl; } - } - - public override Uri Url - { - get { return rv.Url; } - } - } -} diff --git a/mcs/class/System.Web/System.Web_test.dll.sources b/mcs/class/System.Web/System.Web_test.dll.sources index 29339b428c..4416f5a698 100644 --- a/mcs/class/System.Web/System.Web_test.dll.sources +++ b/mcs/class/System.Web/System.Web_test.dll.sources @@ -272,7 +272,6 @@ System.Web.UI.WebControls/RangeValidatorTest.cs System.Web.UI.WebControls/RectangleHotSpotTest.cs System.Web.UI.WebControls/RegularExpressionValidatorTest.cs System.Web.UI.WebControls/RepeatInfoTest.auto.cs -System.Web.UI.WebControls/RepeatInfoTest.auto.2.0.cs System.Web.UI.WebControls/RepeatInfoTest.auto.4.0.cs System.Web.UI.WebControls/RepeatInfoTest.cs System.Web.UI.WebControls/RepeatInfoUser.cs diff --git a/mcs/class/System.Web/Test/System.Web.Caching/FileResponseElementTest.cs b/mcs/class/System.Web/Test/System.Web.Caching/FileResponseElementTest.cs index ee2bd41226..ac14cee58b 100644 --- a/mcs/class/System.Web/Test/System.Web.Caching/FileResponseElementTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Caching/FileResponseElementTest.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 using System; using System.Web; using System.Web.Caching; @@ -70,4 +69,3 @@ namespace MonoTests.System.Web.Caching } } } -#endif \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.Caching/HeaderElementTest.cs b/mcs/class/System.Web/Test/System.Web.Caching/HeaderElementTest.cs index e9e5059269..7a6a7434b8 100644 --- a/mcs/class/System.Web/Test/System.Web.Caching/HeaderElementTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Caching/HeaderElementTest.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 using System; using System.Web; using System.Web.Caching; @@ -68,4 +67,3 @@ namespace MonoTests.System.Web.Caching } } } -#endif \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.Caching/MemoryResponseElementTest.cs b/mcs/class/System.Web/Test/System.Web.Caching/MemoryResponseElementTest.cs index 6f732dddcb..bfee3cc479 100644 --- a/mcs/class/System.Web/Test/System.Web.Caching/MemoryResponseElementTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Caching/MemoryResponseElementTest.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 using System; using System.Web; using System.Web.Caching; @@ -74,4 +73,3 @@ namespace MonoTests.System.Web.Caching } } } -#endif diff --git a/mcs/class/System.Web/Test/System.Web.Caching/OutputCacheTest.cs b/mcs/class/System.Web/Test/System.Web.Caching/OutputCacheTest.cs index c26e99432e..604b418f5e 100644 --- a/mcs/class/System.Web/Test/System.Web.Caching/OutputCacheTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Caching/OutputCacheTest.cs @@ -25,7 +25,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 using System; using System.Collections.Generic; using System.Configuration; @@ -134,10 +133,10 @@ namespace MonoTests.System.Web.Caching static readonly byte[] substitutionResponseElement = { 0x0, 0x1, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xC, 0x2, 0x0, 0x0, 0x0, 0x4D, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2C, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x34, 0x2E, 0x30, 0x2E, 0x30, 0x2E, 0x30, 0x2C, 0x20, 0x43, 0x75, 0x6C, 0x74, 0x75, 0x72, 0x65, 0x3D, 0x6E, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6C, 0x2C, 0x20, 0x50, 0x75, 0x62, 0x6C, 0x69, 0x63, 0x4B, 0x65, 0x79, 0x54, 0x6F, 0x6B, 0x65, 0x6E, 0x3D, 0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, 0x33, 0x61, 0x5, 0x1, 0x0, 0x0, 0x0, 0x2E, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2E, 0x43, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x67, 0x2E, 0x53, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6F, 0x6E, 0x52, 0x65, 0x73, 0x70, 0x6F, 0x6E, 0x73, 0x65, 0x45, 0x6C, 0x65, 0x6D, 0x65, 0x6E, 0x74, 0x2, 0x0, 0x0, 0x0, 0xF, 0x5F, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x4E, 0x61, 0x6D, 0x65, 0xB, 0x5F, 0x6D, 0x65, 0x74, 0x68, 0x6F, 0x64, 0x4E, 0x61, 0x6D, 0x65, 0x1, 0x1, 0x2, 0x0, 0x0, 0x0, 0x6, 0x3, 0x0, 0x0, 0x0, 0x41, 0x4D, 0x6F, 0x6E, 0x6F, 0x54, 0x65, 0x73, 0x74, 0x73, 0x2E, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2E, 0x43, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x67, 0x2E, 0x4F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x54, 0x65, 0x73, 0x74, 0x2C, 0x20, 0x44, 0x6F, 0x74, 0x4E, 0x65, 0x74, 0x34, 0x5F, 0x4E, 0x55, 0x6E, 0x69, 0x74, 0x5F, 0x54, 0x65, 0x73, 0x74, 0x73, 0x6, 0x4, 0x0, 0x0, 0x0, 0x19, 0x44, 0x75, 0x6D, 0x6D, 0x79, 0x53, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6F, 0x6E, 0x43, 0x61, 0x6C, 0x6C, 0x62, 0x61, 0x63, 0x6B, 0xB, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; static readonly byte[] badSubstitutionResponseElement = { 0x0, 0x1, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xC, 0x2, 0x0, 0x0, 0x0, 0x4D, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2C, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3D, 0x34, 0x2E, 0x30, 0x2E, 0x30, 0x2E, 0x30, 0x2C, 0x20, 0x43, 0x75, 0x6C, 0x74, 0x75, 0x72, 0x65, 0x3D, 0x6E, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6C, 0x2C, 0x20, 0x50, 0x75, 0x62, 0x6C, 0x69, 0x63, 0x4B, 0x65, 0x79, 0x54, 0x6F, 0x6B, 0x65, 0x6E, 0x3D, 0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, 0x33, 0x61, 0x5, 0x1, 0x0, 0x0, 0x0, 0x2E, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2E, 0x43, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x67, 0x2E, 0x53, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6F, 0x6E, 0x52, 0x65, 0x73, 0x70, 0x6F, 0x6E, 0x73, 0x65, 0x45, 0x6C, 0x65, 0x6D, 0x65, 0x6E, 0x74, 0x2, 0x0, 0x0, 0x0, 0xF, 0x5F, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x4E, 0x61, 0x6D, 0x65, 0xB, 0x5F, 0x6D, 0x65, 0x74, 0x68, 0x6F, 0x64, 0x4E, 0x61, 0x6D, 0x65, 0x1, 0x1, 0x2, 0x0, 0x0, 0x0, 0x6, 0x3, 0x0, 0x0, 0x0, 0x41, 0x4D, 0x6F, 0x6E, 0x6F, 0x54, 0x65, 0x73, 0x74, 0x73, 0x2E, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x2E, 0x57, 0x65, 0x62, 0x2E, 0x43, 0x61, 0x63, 0x68, 0x69, 0x6E, 0x67, 0x2E, 0x4F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x54, 0x65, 0x73, 0x74, 0x2C, 0x20, 0x44, 0x6F, 0x74, 0x4E, 0x65, 0x74, 0x34, 0x5F, 0x4E, 0x55, 0x6E, 0x69, 0x74, 0x5F, 0x54, 0x65, 0x73, 0x74, 0x73, 0x6, 0x4, 0x0, 0x0, 0x0, 0x1C, 0x44, 0x75, 0x6D, 0x6D, 0x79, 0x42, 0x61, 0x64, 0x53, 0x75, 0x62, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6F, 0x6E, 0x43, 0x61, 0x6C, 0x6C, 0x62, 0x61, 0x63, 0x6B, 0xB, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; #else - static readonly byte[] substitutionResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0x5,0x1,0x0,0x0,0x0,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x3,0x0,0x0,0x0,0x8,0x74,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0x19,0x3C,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x1,0x1,0x3,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2,0x0,0x0,0x0,0x6,0x3,0x0,0x0,0x0,0x88,0x1,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x2C,0x20,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x35,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0x4,0x0,0x0,0x0,0x19,0x44,0x75,0x6D,0x6D,0x79,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x9,0x5,0x0,0x0,0x0,0x4,0x5,0x0,0x0,0x0,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2,0x0,0x0,0x0,0x8,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x7,0x6D,0x65,0x74,0x68,0x6F,0x64,0x30,0x3,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x2F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x52,0x65,0x66,0x6C,0x65,0x63,0x74,0x69,0x6F,0x6E,0x2E,0x4D,0x65,0x6D,0x62,0x65,0x72,0x49,0x6E,0x66,0x6F,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x9,0x6,0x0,0x0,0x0,0x9,0x7,0x0,0x0,0x0,0x4,0x6,0x0,0x0,0x0,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x7,0x0,0x0,0x0,0x4,0x74,0x79,0x70,0x65,0x8,0x61,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x6,0x74,0x61,0x72,0x67,0x65,0x74,0x12,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0xE,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0xD,0x64,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x1,0x1,0x2,0x1,0x1,0x1,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x6,0x8,0x0,0x0,0x0,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x6,0x9,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0xA,0x6,0xA,0x0,0x0,0x0,0x5A,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x35,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0xB,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x9,0x4,0x0,0x0,0x0,0xA,0x4,0x7,0x0,0x0,0x0,0x2F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x52,0x65,0x66,0x6C,0x65,0x63,0x74,0x69,0x6F,0x6E,0x2E,0x4D,0x65,0x6D,0x62,0x65,0x72,0x49,0x6E,0x66,0x6F,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x7,0x0,0x0,0x0,0x4,0x4E,0x61,0x6D,0x65,0xC,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x4E,0x61,0x6D,0x65,0x9,0x43,0x6C,0x61,0x73,0x73,0x4E,0x61,0x6D,0x65,0x9,0x53,0x69,0x67,0x6E,0x61,0x74,0x75,0x72,0x65,0xA,0x53,0x69,0x67,0x6E,0x61,0x74,0x75,0x72,0x65,0x32,0xA,0x4D,0x65,0x6D,0x62,0x65,0x72,0x54,0x79,0x70,0x65,0x10,0x47,0x65,0x6E,0x65,0x72,0x69,0x63,0x41,0x72,0x67,0x75,0x6D,0x65,0x6E,0x74,0x73,0x1,0x1,0x1,0x1,0x1,0x0,0x3,0x8,0xD,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x54,0x79,0x70,0x65,0x5B,0x5D,0x9,0x4,0x0,0x0,0x0,0x9,0xA,0x0,0x0,0x0,0x9,0xB,0x0,0x0,0x0,0x6,0xF,0x0,0x0,0x0,0x3F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x53,0x74,0x72,0x69,0x6E,0x67,0x20,0x44,0x75,0x6D,0x6D,0x79,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x28,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x43,0x6F,0x6E,0x74,0x65,0x78,0x74,0x29,0x6,0x10,0x0,0x0,0x0,0x3F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x53,0x74,0x72,0x69,0x6E,0x67,0x20,0x44,0x75,0x6D,0x6D,0x79,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x28,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x43,0x6F,0x6E,0x74,0x65,0x78,0x74,0x29,0x8,0x0,0x0,0x0,0xA,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; - static readonly byte[] badSubstitutionResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0x5,0x1,0x0,0x0,0x0,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x3,0x0,0x0,0x0,0x8,0x74,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0x19,0x3C,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x1,0x1,0x3,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2,0x0,0x0,0x0,0x6,0x3,0x0,0x0,0x0,0x88,0x1,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x2C,0x20,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x35,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0x4,0x0,0x0,0x0,0x1C,0x44,0x75,0x6D,0x6D,0x79,0x42,0x61,0x64,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x9,0x5,0x0,0x0,0x0,0xC,0x6,0x0,0x0,0x0,0x5A,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x35,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x4,0x5,0x0,0x0,0x0,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x3,0x0,0x0,0x0,0x8,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x7,0x74,0x61,0x72,0x67,0x65,0x74,0x30,0x7,0x6D,0x65,0x74,0x68,0x6F,0x64,0x30,0x3,0x4,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x6,0x0,0x0,0x0,0x2F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x52,0x65,0x66,0x6C,0x65,0x63,0x74,0x69,0x6F,0x6E,0x2E,0x4D,0x65,0x6D,0x62,0x65,0x72,0x49,0x6E,0x66,0x6F,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x9,0x7,0x0,0x0,0x0,0x9,0x8,0x0,0x0,0x0,0x9,0x9,0x0,0x0,0x0,0x4,0x7,0x0,0x0,0x0,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x7,0x0,0x0,0x0,0x4,0x74,0x79,0x70,0x65,0x8,0x61,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x6,0x74,0x61,0x72,0x67,0x65,0x74,0x12,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0xE,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0xD,0x64,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x1,0x1,0x2,0x1,0x1,0x1,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x6,0xA,0x0,0x0,0x0,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x6,0xB,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0x6,0xC,0x0,0x0,0x0,0x7,0x74,0x61,0x72,0x67,0x65,0x74,0x30,0x6,0xD,0x0,0x0,0x0,0x5A,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x35,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0xE,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x9,0x4,0x0,0x0,0x0,0xA,0x5,0x8,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x0,0x0,0x0,0x0,0x6,0x0,0x0,0x0,0x4,0x9,0x0,0x0,0x0,0x2F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x52,0x65,0x66,0x6C,0x65,0x63,0x74,0x69,0x6F,0x6E,0x2E,0x4D,0x65,0x6D,0x62,0x65,0x72,0x49,0x6E,0x66,0x6F,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x7,0x0,0x0,0x0,0x4,0x4E,0x61,0x6D,0x65,0xC,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x4E,0x61,0x6D,0x65,0x9,0x43,0x6C,0x61,0x73,0x73,0x4E,0x61,0x6D,0x65,0x9,0x53,0x69,0x67,0x6E,0x61,0x74,0x75,0x72,0x65,0xA,0x53,0x69,0x67,0x6E,0x61,0x74,0x75,0x72,0x65,0x32,0xA,0x4D,0x65,0x6D,0x62,0x65,0x72,0x54,0x79,0x70,0x65,0x10,0x47,0x65,0x6E,0x65,0x72,0x69,0x63,0x41,0x72,0x67,0x75,0x6D,0x65,0x6E,0x74,0x73,0x1,0x1,0x1,0x1,0x1,0x0,0x3,0x8,0xD,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x54,0x79,0x70,0x65,0x5B,0x5D,0x9,0x4,0x0,0x0,0x0,0x9,0xD,0x0,0x0,0x0,0x9,0xE,0x0,0x0,0x0,0x6,0x12,0x0,0x0,0x0,0x42,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x53,0x74,0x72,0x69,0x6E,0x67,0x20,0x44,0x75,0x6D,0x6D,0x79,0x42,0x61,0x64,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x28,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x43,0x6F,0x6E,0x74,0x65,0x78,0x74,0x29,0x6,0x13,0x0,0x0,0x0,0x42,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x53,0x74,0x72,0x69,0x6E,0x67,0x20,0x44,0x75,0x6D,0x6D,0x79,0x42,0x61,0x64,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x28,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x43,0x6F,0x6E,0x74,0x65,0x78,0x74,0x29,0x8,0x0,0x0,0x0,0xA,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; static readonly byte[] memoryResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0x5,0x1,0x0,0x0,0x0,0x28,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4D,0x65,0x6D,0x6F,0x72,0x79,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x2,0x0,0x0,0x0,0x17,0x3C,0x42,0x75,0x66,0x66,0x65,0x72,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x17,0x3C,0x4C,0x65,0x6E,0x67,0x74,0x68,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x7,0x0,0x2,0x9,0x2,0x0,0x0,0x0,0x9,0x3,0x0,0x0,0x0,0xC,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xF,0x3,0x0,0x0,0x0,0xC,0x0,0x0,0x0,0x2,0x45,0x6E,0x63,0x6F,0x64,0x65,0x64,0x20,0x64,0x61,0x74,0x61,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; static readonly byte[] fileResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0x5,0x1,0x0,0x0,0x0,0x26,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x46,0x69,0x6C,0x65,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x3,0x0,0x0,0x0,0x17,0x3C,0x4C,0x65,0x6E,0x67,0x74,0x68,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x17,0x3C,0x4F,0x66,0x66,0x73,0x65,0x74,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x15,0x3C,0x50,0x61,0x74,0x68,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x0,0x0,0x1,0x9,0x9,0x2,0x0,0x0,0x0,0xD2,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x3,0x0,0x0,0x0,0x11,0x2F,0x70,0x61,0x74,0x68,0x2F,0x74,0x6F,0x2F,0x66,0x69,0x6C,0x65,0x2E,0x74,0x78,0x74,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; + static readonly byte[] substitutionResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0x5,0x1,0x0,0x0,0x0,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x3,0x0,0x0,0x0,0x8,0x74,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0x19,0x3C,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x1,0x1,0x3,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2,0x0,0x0,0x0,0x6,0x3,0x0,0x0,0x0,0x88,0x1,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x2C,0x20,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x78,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0x4,0x0,0x0,0x0,0x19,0x44,0x75,0x6D,0x6D,0x79,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x9,0x5,0x0,0x0,0x0,0x4,0x5,0x0,0x0,0x0,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2,0x0,0x0,0x0,0x8,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x7,0x6D,0x65,0x74,0x68,0x6F,0x64,0x30,0x3,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x2F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x52,0x65,0x66,0x6C,0x65,0x63,0x74,0x69,0x6F,0x6E,0x2E,0x4D,0x65,0x6D,0x62,0x65,0x72,0x49,0x6E,0x66,0x6F,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x9,0x6,0x0,0x0,0x0,0x9,0x7,0x0,0x0,0x0,0x4,0x6,0x0,0x0,0x0,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x7,0x0,0x0,0x0,0x4,0x74,0x79,0x70,0x65,0x8,0x61,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x6,0x74,0x61,0x72,0x67,0x65,0x74,0x12,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0xE,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0xD,0x64,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x1,0x1,0x2,0x1,0x1,0x1,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x6,0x8,0x0,0x0,0x0,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x6,0x9,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0xA,0x6,0xA,0x0,0x0,0x0,0x5A,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x78,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0xB,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x9,0x4,0x0,0x0,0x0,0xA,0x4,0x7,0x0,0x0,0x0,0x2F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x52,0x65,0x66,0x6C,0x65,0x63,0x74,0x69,0x6F,0x6E,0x2E,0x4D,0x65,0x6D,0x62,0x65,0x72,0x49,0x6E,0x66,0x6F,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x7,0x0,0x0,0x0,0x4,0x4E,0x61,0x6D,0x65,0xC,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x4E,0x61,0x6D,0x65,0x9,0x43,0x6C,0x61,0x73,0x73,0x4E,0x61,0x6D,0x65,0x9,0x53,0x69,0x67,0x6E,0x61,0x74,0x75,0x72,0x65,0xA,0x53,0x69,0x67,0x6E,0x61,0x74,0x75,0x72,0x65,0x32,0xA,0x4D,0x65,0x6D,0x62,0x65,0x72,0x54,0x79,0x70,0x65,0x10,0x47,0x65,0x6E,0x65,0x72,0x69,0x63,0x41,0x72,0x67,0x75,0x6D,0x65,0x6E,0x74,0x73,0x1,0x1,0x1,0x1,0x1,0x0,0x3,0x8,0xD,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x54,0x79,0x70,0x65,0x5B,0x5D,0x9,0x4,0x0,0x0,0x0,0x9,0xA,0x0,0x0,0x0,0x9,0xB,0x0,0x0,0x0,0x6,0xF,0x0,0x0,0x0,0x3F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x53,0x74,0x72,0x69,0x6E,0x67,0x20,0x44,0x75,0x6D,0x6D,0x79,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x28,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x43,0x6F,0x6E,0x74,0x65,0x78,0x74,0x29,0x6,0x10,0x0,0x0,0x0,0x3F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x53,0x74,0x72,0x69,0x6E,0x67,0x20,0x44,0x75,0x6D,0x6D,0x79,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x28,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x43,0x6F,0x6E,0x74,0x65,0x78,0x74,0x29,0x8,0x0,0x0,0x0,0xA,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; + static readonly byte[] badSubstitutionResponseElement = {0x0,0x1,0x0,0x0,0x0,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xC,0x2,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0x5,0x1,0x0,0x0,0x0,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x45,0x6C,0x65,0x6D,0x65,0x6E,0x74,0x3,0x0,0x0,0x0,0x8,0x74,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0x19,0x3C,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x3E,0x6B,0x5F,0x5F,0x42,0x61,0x63,0x6B,0x69,0x6E,0x67,0x46,0x69,0x65,0x6C,0x64,0x1,0x1,0x3,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2,0x0,0x0,0x0,0x6,0x3,0x0,0x0,0x0,0x88,0x1,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x2C,0x20,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x78,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0x4,0x0,0x0,0x0,0x1C,0x44,0x75,0x6D,0x6D,0x79,0x42,0x61,0x64,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x9,0x5,0x0,0x0,0x0,0xC,0x6,0x0,0x0,0x0,0x5A,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x78,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x4,0x5,0x0,0x0,0x0,0x22,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x3,0x0,0x0,0x0,0x8,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x7,0x74,0x61,0x72,0x67,0x65,0x74,0x30,0x7,0x6D,0x65,0x74,0x68,0x6F,0x64,0x30,0x3,0x4,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x6,0x0,0x0,0x0,0x2F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x52,0x65,0x66,0x6C,0x65,0x63,0x74,0x69,0x6F,0x6E,0x2E,0x4D,0x65,0x6D,0x62,0x65,0x72,0x49,0x6E,0x66,0x6F,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x9,0x7,0x0,0x0,0x0,0x9,0x8,0x0,0x0,0x0,0x9,0x9,0x0,0x0,0x0,0x4,0x7,0x0,0x0,0x0,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x7,0x0,0x0,0x0,0x4,0x74,0x79,0x70,0x65,0x8,0x61,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x6,0x74,0x61,0x72,0x67,0x65,0x74,0x12,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0xE,0x74,0x61,0x72,0x67,0x65,0x74,0x54,0x79,0x70,0x65,0x4E,0x61,0x6D,0x65,0xA,0x6D,0x65,0x74,0x68,0x6F,0x64,0x4E,0x61,0x6D,0x65,0xD,0x64,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x1,0x1,0x2,0x1,0x1,0x1,0x3,0x30,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x2B,0x44,0x65,0x6C,0x65,0x67,0x61,0x74,0x65,0x45,0x6E,0x74,0x72,0x79,0x6,0xA,0x0,0x0,0x0,0x2B,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x52,0x65,0x73,0x70,0x6F,0x6E,0x73,0x65,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x6,0xB,0x0,0x0,0x0,0x4D,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x34,0x2E,0x30,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x62,0x30,0x33,0x66,0x35,0x66,0x37,0x66,0x31,0x31,0x64,0x35,0x30,0x61,0x33,0x61,0x6,0xC,0x0,0x0,0x0,0x7,0x74,0x61,0x72,0x67,0x65,0x74,0x30,0x6,0xD,0x0,0x0,0x0,0x5A,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x5F,0x74,0x65,0x73,0x74,0x5F,0x6E,0x65,0x74,0x5F,0x34,0x5F,0x78,0x2C,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x3D,0x31,0x2E,0x33,0x2E,0x30,0x2E,0x30,0x2C,0x20,0x43,0x75,0x6C,0x74,0x75,0x72,0x65,0x3D,0x6E,0x65,0x75,0x74,0x72,0x61,0x6C,0x2C,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x4B,0x65,0x79,0x54,0x6F,0x6B,0x65,0x6E,0x3D,0x33,0x31,0x62,0x66,0x33,0x38,0x35,0x36,0x61,0x64,0x33,0x36,0x34,0x65,0x33,0x35,0x6,0xE,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x9,0x4,0x0,0x0,0x0,0xA,0x5,0x8,0x0,0x0,0x0,0x2C,0x4D,0x6F,0x6E,0x6F,0x54,0x65,0x73,0x74,0x73,0x2E,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x43,0x61,0x63,0x68,0x69,0x6E,0x67,0x2E,0x4F,0x75,0x74,0x70,0x75,0x74,0x43,0x61,0x63,0x68,0x65,0x54,0x65,0x73,0x74,0x0,0x0,0x0,0x0,0x6,0x0,0x0,0x0,0x4,0x9,0x0,0x0,0x0,0x2F,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x52,0x65,0x66,0x6C,0x65,0x63,0x74,0x69,0x6F,0x6E,0x2E,0x4D,0x65,0x6D,0x62,0x65,0x72,0x49,0x6E,0x66,0x6F,0x53,0x65,0x72,0x69,0x61,0x6C,0x69,0x7A,0x61,0x74,0x69,0x6F,0x6E,0x48,0x6F,0x6C,0x64,0x65,0x72,0x7,0x0,0x0,0x0,0x4,0x4E,0x61,0x6D,0x65,0xC,0x41,0x73,0x73,0x65,0x6D,0x62,0x6C,0x79,0x4E,0x61,0x6D,0x65,0x9,0x43,0x6C,0x61,0x73,0x73,0x4E,0x61,0x6D,0x65,0x9,0x53,0x69,0x67,0x6E,0x61,0x74,0x75,0x72,0x65,0xA,0x53,0x69,0x67,0x6E,0x61,0x74,0x75,0x72,0x65,0x32,0xA,0x4D,0x65,0x6D,0x62,0x65,0x72,0x54,0x79,0x70,0x65,0x10,0x47,0x65,0x6E,0x65,0x72,0x69,0x63,0x41,0x72,0x67,0x75,0x6D,0x65,0x6E,0x74,0x73,0x1,0x1,0x1,0x1,0x1,0x0,0x3,0x8,0xD,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x54,0x79,0x70,0x65,0x5B,0x5D,0x9,0x4,0x0,0x0,0x0,0x9,0xD,0x0,0x0,0x0,0x9,0xE,0x0,0x0,0x0,0x6,0x12,0x0,0x0,0x0,0x42,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x53,0x74,0x72,0x69,0x6E,0x67,0x20,0x44,0x75,0x6D,0x6D,0x79,0x42,0x61,0x64,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x28,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x43,0x6F,0x6E,0x74,0x65,0x78,0x74,0x29,0x6,0x13,0x0,0x0,0x0,0x42,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x53,0x74,0x72,0x69,0x6E,0x67,0x20,0x44,0x75,0x6D,0x6D,0x79,0x42,0x61,0x64,0x53,0x75,0x62,0x73,0x74,0x69,0x74,0x75,0x74,0x69,0x6F,0x6E,0x43,0x61,0x6C,0x6C,0x62,0x61,0x63,0x6B,0x28,0x53,0x79,0x73,0x74,0x65,0x6D,0x2E,0x57,0x65,0x62,0x2E,0x48,0x74,0x74,0x70,0x43,0x6F,0x6E,0x74,0x65,0x78,0x74,0x29,0x8,0x0,0x0,0x0,0xA,0xB,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; #endif static readonly object[] serializeObjects = { @@ -187,10 +186,12 @@ namespace MonoTests.System.Web.Caching SubstitutionResponseElement sre, sreBad; CreateElements (out mre, out fre, out sre, out sreBad); - // WriteSerializedBytes ("/tmp/bytes.txt", "memoryResponseElement", mre); - // WriteSerializedBytes ("/tmp/bytes.txt", "fileResponseElement", fre); - // WriteSerializedBytes ("/tmp/bytes.txt", "substitutionResponseElement", sre); - // WriteSerializedBytes ("/tmp/bytes.txt", "badSubstitutionResponseElement", sreBad); +#if false + WriteSerializedBytes ("/tmp/bytes.txt", "memoryResponseElement", mre); + WriteSerializedBytes ("/tmp/bytes.txt", "fileResponseElement", fre); + WriteSerializedBytes ("/tmp/bytes.txt", "substitutionResponseElement", sre); + WriteSerializedBytes ("/tmp/bytes.txt", "badSubstitutionResponseElement", sreBad); +#endif byte[] bytes = SerializeElement (mre); AssertExtensions.AreEqual (bytes, memoryResponseElement, "#B1"); @@ -310,4 +311,3 @@ namespace MonoTests.System.Web.Caching } } } -#endif diff --git a/mcs/class/System.Web/Test/System.Web.Caching/SqlCacheDependencyTest.cs b/mcs/class/System.Web/Test/System.Web.Caching/SqlCacheDependencyTest.cs index 264074366b..e26dafb8ce 100644 --- a/mcs/class/System.Web/Test/System.Web.Caching/SqlCacheDependencyTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Caching/SqlCacheDependencyTest.cs @@ -65,7 +65,6 @@ namespace MonoTests.System.Web.Caching //}, "#A3"); } -#if NET_4_0 [Test] public void CreateOutputCacheDependency () { @@ -90,7 +89,6 @@ namespace MonoTests.System.Web.Caching //sqc = SqlCacheDependency.CreateOutputCacheDependency ("Database:table; AnotherDatabase:table"); //Assert.IsTrue (sql is AggregateCacheDependency, "#B2"); } -#endif } } diff --git a/mcs/class/System.Web/Test/System.Web.Caching/SubstitutionResponseElementTest.cs b/mcs/class/System.Web/Test/System.Web.Caching/SubstitutionResponseElementTest.cs index e277b12f0c..64a32af27b 100644 --- a/mcs/class/System.Web/Test/System.Web.Caching/SubstitutionResponseElementTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Caching/SubstitutionResponseElementTest.cs @@ -28,7 +28,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 using System; using System.Web; using System.Web.Caching; @@ -61,4 +60,3 @@ namespace MonoTests.System.Web.Caching } } } -#endif \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.Compilation/BuildManagerTest.cs b/mcs/class/System.Web/Test/System.Web.Compilation/BuildManagerTest.cs index 7a748e634d..28de9a7623 100644 --- a/mcs/class/System.Web/Test/System.Web.Compilation/BuildManagerTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Compilation/BuildManagerTest.cs @@ -41,7 +41,6 @@ namespace MonoTests.System.Web.Compilation [Serializable] public class BuildManagerTest { -#if NET_4_0 [Test] [Ignore ("Pending investigation if it is indeed the correct test.")] public void GetGlobalAsaxType () @@ -59,6 +58,5 @@ namespace MonoTests.System.Web.Compilation Assert.AreEqual ("", BuildManager.TargetFramework.Profile, "#A1-3"); Assert.AreEqual (new Version (4, 0), BuildManager.TargetFramework.Version, "#A1-4"); } -#endif } } diff --git a/mcs/class/System.Web/Test/System.Web.Compilation/BuildProviderTest.cs b/mcs/class/System.Web/Test/System.Web.Compilation/BuildProviderTest.cs index fa8d77031c..852b3773c9 100644 --- a/mcs/class/System.Web/Test/System.Web.Compilation/BuildProviderTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Compilation/BuildProviderTest.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 using System; using System.CodeDom; using System.IO; @@ -78,4 +77,3 @@ namespace MonoTests.System.Web.Compilation { } } -#endif \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.Compilation/RouteUrlExpressionBuilderTest.cs b/mcs/class/System.Web/Test/System.Web.Compilation/RouteUrlExpressionBuilderTest.cs index a549dd5825..68a97a2e7e 100644 --- a/mcs/class/System.Web/Test/System.Web.Compilation/RouteUrlExpressionBuilderTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Compilation/RouteUrlExpressionBuilderTest.cs @@ -25,7 +25,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_4_0 using System; using System.CodeDom; using System.IO; @@ -286,4 +285,3 @@ namespace MonoTests.System.Web.Compilation } } } -#endif diff --git a/mcs/class/System.Web/Test/System.Web.Configuration/MachineKeySectionTest.cs b/mcs/class/System.Web/Test/System.Web.Configuration/MachineKeySectionTest.cs index 7b1b941dae..dd324ad038 100644 --- a/mcs/class/System.Web/Test/System.Web.Configuration/MachineKeySectionTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Configuration/MachineKeySectionTest.cs @@ -40,26 +40,16 @@ namespace MonoTests.System.Web.Configuration { public void DefaultValues () { MachineKeySection section = new MachineKeySection (); -#if NET_4_0 Assert.AreEqual (MachineKeyCompatibilityMode.Framework20SP1, section.CompatibilityMode, "CompatibilityMode"); -#endif Assert.AreEqual ("Auto", section.Decryption, "Decryption"); Assert.AreEqual ("AutoGenerate,IsolateApps", section.DecryptionKey, "DecryptionKey"); -#if NET_4_0 Assert.AreEqual (MachineKeyValidation.HMACSHA256, section.Validation, "Validation"); Assert.AreEqual ("HMACSHA256", section.ValidationAlgorithm, "ValidationAlgorithm"); -#else - Assert.AreEqual (MachineKeyValidation.SHA1, section.Validation, "Validation"); -#endif Assert.AreEqual ("AutoGenerate,IsolateApps", section.ValidationKey, "ValidationKey"); } [Test] -#if NET_4_0 [ExpectedException (typeof (NullReferenceException))] -#else - [ExpectedException (typeof (ConfigurationErrorsException))] -#endif public void Decryption_Null () { MachineKeySection section = new MachineKeySection (); @@ -73,7 +63,6 @@ namespace MonoTests.System.Web.Configuration { MachineKeySection section = new MachineKeySection (); section.Decryption = String.Empty; } -#if NET_4_0 [Test] public void Decryption_RC2 () { @@ -172,7 +161,6 @@ namespace MonoTests.System.Web.Configuration { Assert.AreEqual (MachineKeyValidation.Custom, section.Validation, "after"); Assert.AreEqual ("alg:UnexistingType", section.ValidationAlgorithm, "ValidationAlgorithm"); } -#endif } } diff --git a/mcs/class/System.Web/Test/System.Web.Configuration/MachineKeyValidationConverterTest.cs b/mcs/class/System.Web/Test/System.Web.Configuration/MachineKeyValidationConverterTest.cs index f99158367c..a9a605c61c 100644 --- a/mcs/class/System.Web/Test/System.Web.Configuration/MachineKeyValidationConverterTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Configuration/MachineKeyValidationConverterTest.cs @@ -77,7 +77,6 @@ namespace MonoTests.System.Web.Configuration { o = cv.ConvertFrom (null, null, "AES"); Assert.AreEqual ("AES", o.ToString (), "AES"); -#if NET_4_0 o = cv.ConvertFrom (null, null, "HMACSHA256"); Assert.AreEqual ("HMACSHA256", o.ToString (), "HMACSHA256"); @@ -86,10 +85,8 @@ namespace MonoTests.System.Web.Configuration { o = cv.ConvertFrom (null, null, "HMACSHA512"); Assert.AreEqual ("HMACSHA512", o.ToString (), "HMACSHA512"); -#endif } -#if NET_4_0 [Test] [ExpectedException (typeof (ArgumentException))] public void ConvertFrom_Custom () @@ -97,7 +94,6 @@ namespace MonoTests.System.Web.Configuration { MachineKeyValidationConverter cv = new MachineKeyValidationConverter (); cv.ConvertFrom (null, null, "Custom"); } -#endif [Test] [ExpectedException (typeof (ArgumentException))] @@ -126,14 +122,11 @@ namespace MonoTests.System.Web.Configuration { Assert.AreEqual ("MD5", cv.ConvertTo (null, null, MachineKeyValidation.MD5, typeof (string)), "A1"); Assert.AreEqual ("SHA1", cv.ConvertTo (null, null, MachineKeyValidation.SHA1, typeof (string)), "A2"); Assert.AreEqual ("3DES", cv.ConvertTo (null, null, MachineKeyValidation.TripleDES, typeof (string)), "A3"); -#if NET_4_0 Assert.AreEqual ("HMACSHA256", cv.ConvertTo (null, null, MachineKeyValidation.HMACSHA256, typeof (string)), "HMACSHA256"); Assert.AreEqual ("HMACSHA384", cv.ConvertTo (null, null, MachineKeyValidation.HMACSHA384, typeof (string)), "HMACSHA384"); Assert.AreEqual ("HMACSHA512", cv.ConvertTo (null, null, MachineKeyValidation.HMACSHA512, typeof (string)), "HMACSHA512"); -#endif } -#if NET_4_0 [Test] [ExpectedException (typeof (ArgumentException))] public void ConvertTo_Custom () @@ -141,14 +134,9 @@ namespace MonoTests.System.Web.Configuration { MachineKeyValidationConverter cv = new MachineKeyValidationConverter (); cv.ConvertTo (null, null, MachineKeyValidation.Custom, typeof (string)); } -#endif [Test] -#if NET_4_0 [ExpectedException (typeof (ArgumentException))] -#else - [ExpectedException (typeof (NullReferenceException))] -#endif public void ConvertTo_NullError () { MachineKeyValidationConverter cv = new MachineKeyValidationConverter (); @@ -157,11 +145,7 @@ namespace MonoTests.System.Web.Configuration { } [Test] -#if NET_4_0 [ExpectedException (typeof (ArgumentException))] -#else - [ExpectedException (typeof (FormatException))] -#endif public void ConvertTo_TypeError1 () { MachineKeyValidationConverter cv = new MachineKeyValidationConverter (); @@ -179,11 +163,7 @@ namespace MonoTests.System.Web.Configuration { } [Test] -#if NET_4_0 [ExpectedException (typeof (ArgumentException))] -#else - [ExpectedException (typeof (FormatException))] -#endif public void ConvertTo_TypeError3 () { MachineKeyValidationConverter cv = new MachineKeyValidationConverter (); diff --git a/mcs/class/System.Web/Test/System.Web.Security/MachineKeyTest.cs b/mcs/class/System.Web/Test/System.Web.Security/MachineKeyTest.cs index d00e0eb60d..06ee42a1a1 100644 --- a/mcs/class/System.Web/Test/System.Web.Security/MachineKeyTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Security/MachineKeyTest.cs @@ -28,7 +28,6 @@ using System.Security.Cryptography; -#if NET_4_0 using System; using System.Text; using System.Web.Security; @@ -204,4 +203,3 @@ namespace MonoTests.System.Web.Security #endif } } -#endif diff --git a/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlFormTest.cs b/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlFormTest.cs index 58b7881c24..b08edd3da7 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlFormTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlFormTest.cs @@ -200,11 +200,9 @@ namespace MonoTests.System.Web.UI.HtmlControls { // Indirect test for HttpRequest.QueryStringRaw, see // https://bugzilla.novell.com/show_bug.cgi?id=376352 -#if NET_4_0 Assert.AreEqual (" method=\"post\" action=\"?q=1&q2=2\"", attrs, "A1"); form.RenderingCompatibility = new Version (3, 5); attrs = form.RenderAttributes (); -#endif Assert.AreEqual (" name=\"aspnetForm\" method=\"post\" action=\"?q=1&q2=2\"", attrs, "A2"); } #endif @@ -218,11 +216,9 @@ namespace MonoTests.System.Web.UI.HtmlControls { form.Page = p; form.Action = "someactionfile.aspx"; string attrs = form.RenderAttributes (); -#if NET_4_0 Assert.AreEqual (" method=\"post\" action=\"someactionfile.aspx\"", attrs, "A1"); form.RenderingCompatibility = new Version (3, 5); attrs = form.RenderAttributes (); -#endif Assert.AreEqual (" name=\"aspnetForm\" method=\"post\" action=\"someactionfile.aspx\"", attrs, "A2"); } diff --git a/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlInputButtonTest.cs b/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlInputButtonTest.cs index a9e39053d6..5ae77e49dd 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlInputButtonTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.HtmlControls/HtmlInputButtonTest.cs @@ -157,13 +157,8 @@ namespace MonoTests.System.Web.UI.HtmlControls { [Test] public void OnClickAttributeWithSpecials () { -#if NET_4_0 string origHtml = "alert('<&');"; string origHtml2 = "alert('<&');"; -#else - string origHtml = "alert('<&');"; - string origHtml2 = "alert('<&');"; -#endif StringWriter sw = new StringWriter (); HtmlTextWriter tw = new HtmlTextWriter (sw); diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls.Adapters/MenuAdapterTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls.Adapters/MenuAdapterTest.cs index 804313f84a..fe1cb73ac5 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls.Adapters/MenuAdapterTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls.Adapters/MenuAdapterTest.cs @@ -57,9 +57,7 @@ namespace MonoTests.System.Web.UI.WebControls.Adapters { p = new Page (); c = new MyMenu (); -#if NET_4_0 c.RenderingMode = MenuRenderingMode.Table; -#endif a = new MyMenuAdapter (c); p.Controls.Add(c); sw = new StringWriter (); diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataBoundControlTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataBoundControlTest.cs index b312107569..dc358f382b 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataBoundControlTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataBoundControlTest.cs @@ -180,7 +180,6 @@ namespace MonoTests.System.Web.UI.WebControls p.DataSource = new Object(); Assert.AreEqual (true, p.ValidateDataSourceCalled); } -#if NET_4_0 [Test] public void SupportsDisabledAttribute () { @@ -194,6 +193,5 @@ namespace MonoTests.System.Web.UI.WebControls Assert.AreEqual (ver35, p.RenderingCompatibility, "#A2-1"); Assert.IsTrue (p.SupportsDisabledAttribute, "#A2-2"); } -#endif } } diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataListTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataListTest.cs index 82355fa455..8202d2c4ea 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataListTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/BaseDataListTest.cs @@ -802,7 +802,6 @@ namespace MonoTests.System.Web.UI.WebControls { // and junk Assert.IsFalse (BaseDataList.IsBindableType (this.GetType ()), "this"); } -#if NET_4_0 [Test] public void SupportsDisabledAttribute () { @@ -816,6 +815,5 @@ namespace MonoTests.System.Web.UI.WebControls { Assert.AreEqual (ver35, p.RenderingCompatibility, "#A2-1"); Assert.IsTrue (p.SupportsDisabledAttribute, "#A2-2"); } -#endif } } diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/BoundFieldTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/BoundFieldTest.cs index df66f3bca3..1b168a53f2 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/BoundFieldTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/BoundFieldTest.cs @@ -130,11 +130,7 @@ namespace MonoTests.System.Web.UI.WebControls [Test (Description="Bug 646505")] public void BoundField_Bug646505 () { -#if NET_4_0 string originalHtml = "
\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\n\t
  
Update Cancel
EditFalse
\n
\n"; -#else - string originalHtml = "
\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\n\t
  
Update Cancel
EditFalse
\n
\n"; -#endif WebTest t = new WebTest ("BoundField_Bug646505.aspx"); t.Run (); @@ -371,11 +367,7 @@ namespace MonoTests.System.Web.UI.WebControls Assert.IsTrue (bf.DoSupportsHtmlEncode, "#A1-3"); bf.DataFormatString = formatString; -#if NET_4_0 Assert.AreEqual ("<script>alert ('<test>');</script>", bf.DoFormatDataValue ("", true), "#A2"); -#else - Assert.AreEqual ("<script>alert ('<test>');</script>", bf.DoFormatDataValue ("", true), "#A2"); -#endif Assert.AreEqual (String.Format (formatString, ""), bf.DoFormatDataValue ("", false), "#A3"); bf.HtmlEncodeFormatString = false; @@ -383,11 +375,7 @@ namespace MonoTests.System.Web.UI.WebControls var ec = new EncodingTest (); bf.HtmlEncodeFormatString = true; -#if NET_4_0 Assert.AreEqual ("<script>alert ('<EncodingTest>&');</script>", bf.DoFormatDataValue (ec, true), "#A4"); -#else - Assert.AreEqual ("<script>alert ('<EncodingTest>&');</script>", bf.DoFormatDataValue (ec, true), "#A4"); -#endif } [Test] diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangePasswordTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangePasswordTest.cs index 56760e1022..4fc1f75f85 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangePasswordTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangePasswordTest.cs @@ -823,7 +823,6 @@ namespace MonoTests.System.Web.UI.WebControls RequiredFieldValidator rfv = cp.ChangePasswordTemplateContainer.FindControl ("text1required") as RequiredFieldValidator; Assert.IsNotNull (rfv, "#A2"); } -#if NET_4_0 [Test] public void RenderOuterTableForbiddenStyles () { @@ -890,7 +889,6 @@ namespace MonoTests.System.Web.UI.WebControls } } } -#endif [TestFixtureTearDown] public void TearDown () { diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxFieldTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxFieldTest.cs index 5645545eed..dc40bf1111 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxFieldTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxFieldTest.cs @@ -127,11 +127,7 @@ namespace MonoTests.System.Web.UI.WebControls [Test (Description="Bug 595568 #0")] public void CheckBoxField_Bug595568_0 () { -#if NET_4_0 string originalHtml = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
 
\r\n
"; -#else - string originalHtml = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
 
\r\n
"; -#endif WebTest t = new WebTest ("CheckBoxField_Bug595568_0.aspx"); string pageHtml = t.Run (); string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml); @@ -142,11 +138,7 @@ namespace MonoTests.System.Web.UI.WebControls [Test (Description="Bug 595568 #1")] public void CheckBoxField_Bug595568_1 () { -#if NET_4_0 string originalHtml = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
 
\r\n
"; -#else - string originalHtml = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
 
\r\n
"; -#endif WebTest t = new WebTest ("CheckBoxField_Bug595568_1.aspx"); string pageHtml = t.Run (); string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml); @@ -157,11 +149,7 @@ namespace MonoTests.System.Web.UI.WebControls [Test (Description="Bug 595568 #2")] public void CheckBoxField_Bug595568_2 () { -#if NET_4_0 string originalHtml = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
 
\r\n
"; -#else - string originalHtml = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
 
\r\n
"; -#endif WebTest t = new WebTest ("CheckBoxField_Bug595568_2.aspx"); string pageHtml = t.Run (); @@ -185,11 +173,7 @@ namespace MonoTests.System.Web.UI.WebControls [Test (Description="Bug 595568 #6")] public void CheckBoxField_Bug595568_6 () { -#if NET_4_0 string originalHtml = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
 
\r\n
"; -#else - string originalHtml = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
 
\r\n
"; -#endif WebTest t = new WebTest ("CheckBoxField_Bug595568_6.aspx"); string pageHtml = t.Run (); @@ -201,11 +185,7 @@ namespace MonoTests.System.Web.UI.WebControls [Test (Description="Bug 595568 #7")] public void CheckBoxField_Bug595568_7 () { -#if NET_4_0 string originalHtml = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
 
\r\n
"; -#else - string originalHtml = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
 
\r\n
"; -#endif WebTest t = new WebTest ("CheckBoxField_Bug595568_7.aspx"); string pageHtml = t.Run (); string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml); diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxListTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxListTest.cs index 1860f47b4b..afa86b3835 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxListTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxListTest.cs @@ -160,13 +160,8 @@ namespace MonoTests.System.Web.UI.WebControls { { WebTest t = new WebTest ("CheckBoxList_Bug377703_1.aspx"); t.Invoker = PageInvoker.CreateOnInit (CheckBoxList_Bug377703_1_OnInit); -#if NET_4_0 string origHtmlFirst = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; string origHtmlSecond = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; -#else - string origHtmlFirst = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; - string origHtmlSecond = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; -#endif string html = t.Run (); string listHtml = HtmlDiff.GetControlFromPageHtml (html); @@ -215,15 +210,9 @@ namespace MonoTests.System.Web.UI.WebControls { { WebTest t = new WebTest ("CheckBoxList_Bug377703_2.aspx"); t.Invoker = PageInvoker.CreateOnInit (CheckBoxList_Bug377703_2_OnInit); -#if NET_4_0 string origHtmlFirst = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; string origHtmlSecond = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; string origHtmlThird = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; -#else - string origHtmlFirst = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; - string origHtmlSecond = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; - string origHtmlThird = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; -#endif string html = t.Run (); string listHtml = HtmlDiff.GetControlFromPageHtml (html); @@ -276,11 +265,7 @@ namespace MonoTests.System.Web.UI.WebControls { { WebTest t = new WebTest ("CheckBoxList_Bug578770.aspx"); t.Invoker = PageInvoker.CreateOnInit (CheckBoxList_Bug578770_OnInit); -#if NET_4_0 string origHtml = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; -#else - string origHtml = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; -#endif string html = t.Run (); string listHtml = HtmlDiff.GetControlFromPageHtml (html); @@ -300,15 +285,9 @@ namespace MonoTests.System.Web.UI.WebControls { public void CheckBoxList_Bug600415 () { WebTest t = new WebTest ("CheckBoxList_Bug600415.aspx"); -#if NET_4_0 string origHtmlFirst = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; string origHtmlSecond = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; string origHtmlThird = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; -#else - string origHtmlFirst = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; - string origHtmlSecond = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; - string origHtmlThird = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
"; -#endif string html = t.Run (); string listHtml = HtmlDiff.GetControlFromPageHtml (html); @@ -386,13 +365,8 @@ namespace MonoTests.System.Web.UI.WebControls { [Test] public void RenderItem () { -#if NET_4_0 string origHtml1 = ""; string origHtml2 = ""; -#else - string origHtml1 = ""; - string origHtml2 = ""; -#endif CheckBoxListPoker c = new CheckBoxListPoker (); ListItem l1 = new ListItem ("item1", "value1"); ListItem l2 = new ListItem ("item2", "value2"); @@ -561,11 +535,7 @@ namespace MonoTests.System.Web.UI.WebControls { [Test] public void RepeatInfoRenderItem () { -#if NET_4_0 string origHtml = ""; -#else - string origHtml = ""; -#endif StringWriter sw = new StringWriter (); HtmlTextWriter tw = new HtmlTextWriter (sw); CheckBoxList c = new CheckBoxList (); @@ -640,13 +610,8 @@ namespace MonoTests.System.Web.UI.WebControls { [Category("NotDotNet")] // MS's implementation throws NRE's from these public void Render () { -#if NET_4_0 string origHtml1 = "\n\t\n\t\t\n\t\n
"; string origHtml2 = "\n\t\n\t\t\n\t\n
"; -#else - string origHtml1 = "\n\t\n\t\t\n\t\n
"; - string origHtml2 = "\n\t\n\t\t\n\t\n
"; -#endif CheckBoxList c; c = new CheckBoxList (); c.Items.Add ("foo"); @@ -666,19 +631,11 @@ namespace MonoTests.System.Web.UI.WebControls { CheckBoxList c = new CheckBoxList (); c.TabIndex = 5; c.Items.Add ("Item1"); -#if NET_4_0 string exp = @"
"; -#else - string exp = @" - - - -
"; -#endif Render (c, exp, "B1"); } @@ -690,19 +647,11 @@ namespace MonoTests.System.Web.UI.WebControls { CheckBoxList c = new CheckBoxList (); c.Enabled = false; c.Items.Add ("Item1"); -#if NET_4_0 string exp = @"
"; -#else - string exp = @" - - - -
"; -#endif Render (c, exp, "C1"); } class TestCheckBoxList : CheckBoxList diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxTest.cs index 2bcb4c0f9b..1cdc7cdd46 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxTest.cs @@ -186,11 +186,7 @@ namespace MonoTests.System.Web.UI.WebControls { c.InputAttributes.Add ("value", "value1"); c.Text = "Title"; c.Checked = true; -#if NET_4_0 string origHtml = ""; -#else - string origHtml = ""; -#endif string html = c.Render (); HtmlDiff.AssertAreEqual (origHtml, html, "#A1"); } diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridTest.cs new file mode 100644 index 0000000000..a957bc84b8 --- /dev/null +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridTest.cs @@ -0,0 +1,2255 @@ +// +// Tests for System.Web.UI.WebControls.DataGrid.cs +// +// Author: +// Jackson Harper (jackson@ximian.com) +// Gonzalo Paniagua Javier (gonzalo@ximian.com) +// +// +// Copyright (C) 2005 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using NUnit.Framework; +using AttributeCollection = System.ComponentModel.AttributeCollection; +using System; +using System.Drawing; +using System.IO; +using System.Globalization; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Collections; +using System.Data; +using System.ComponentModel; +using System.Diagnostics; +using System.Collections.Generic; +using MonoTests.SystemWeb.Framework; +using MonoTests.stand_alone.WebHarness; + +namespace MonoTests.System.Web.UI.WebControls { + + public class DataGridPoker : DataGrid { + + public DataGridPoker () + { + TrackViewState (); + } + + public string GetTagName () + { + return TagName; + } + + public void PrepareCH () + { + PrepareControlHierarchy (); + } + + public string Render () + { + StringWriter sw = new StringWriter (); + HtmlTextWriter tw = new HtmlTextWriter (sw); + + Render (tw); + return sw.ToString (); + } + + public StateBag GetViewState () + { + return ViewState; + } + + public new Style ControlStyle () + { + return CreateControlStyle (); + } + + public void DoCancelCommand (DataGridCommandEventArgs e) + { + OnCancelCommand (e); + } + + public void DoDeleteCommand (DataGridCommandEventArgs e) + { + OnDeleteCommand (e); + } + + public void DoEditCommand (DataGridCommandEventArgs e) + { + OnEditCommand (e); + } + + public void DoItemCommand (DataGridCommandEventArgs e) + { + OnItemCommand (e); + } + + public void DoUpdateCommand (DataGridCommandEventArgs e) + { + OnUpdateCommand (e); + } + + public void DoItemCreated (DataGridItemEventArgs e) + { + OnItemCreated (e); + } + + public void DoItemDataBound (DataGridItemEventArgs e) + { + OnItemDataBound (e); + } + + public void DoPageIndexChanged (DataGridPageChangedEventArgs e) + { + OnPageIndexChanged (e); + } + + public void DoSortCommand (DataGridSortCommandEventArgs e) + { + OnSortCommand (e); + } + + public void DoBubbleEvent (object source, EventArgs e) + { + OnBubbleEvent (source, e); + } + + public void TrackState () + { + TrackViewState (); + } + + public object SaveState () + { + return SaveViewState (); + } + + public ArrayList CreateColumns (PagedDataSource data_source, bool use_data_source) + { + return CreateColumnSet (data_source, use_data_source); + } + + public void CreateControls (bool use_data_source) + { + CreateControlHierarchy (use_data_source); + } + + public void InitPager (DataGridItem item, int columnSpan, + PagedDataSource pagedDataSource) + { + InitializePager (item, columnSpan, pagedDataSource); + } + } + + public class AmazingEnumerable : IEnumerable { + + private IList list; + public int CallCount; + + public AmazingEnumerable (IList list) + { + this.list = list; + } + + public IEnumerator GetEnumerator () + { + CallCount++; + return list.GetEnumerator (); + } + + } + + [TestFixture] + public class DataGridTest { + + [TestFixtureSetUp()] + public void FixtureSetup () + { + WebTest.CopyResource (GetType (), "DataGrid.aspx", "DataGrid.aspx"); + } + + [TestFixtureTearDown()] + public void FixtureTearDown () + { + WebTest.Unload (); + } + + [Test] + public void Defaults () + { + DataGridPoker p = new DataGridPoker (); + + Assert.AreEqual (DataGrid.CancelCommandName, "Cancel", "A1"); + Assert.AreEqual (DataGrid.DeleteCommandName, "Delete", "A2"); + Assert.AreEqual (DataGrid.EditCommandName, "Edit", "A3"); + Assert.AreEqual (DataGrid.NextPageCommandArgument, "Next", "A4"); + Assert.AreEqual (DataGrid.PageCommandName, "Page", "A5"); + Assert.AreEqual (DataGrid.PrevPageCommandArgument, "Prev", "A6"); + Assert.AreEqual (DataGrid.SelectCommandName, "Select", "A7"); + Assert.AreEqual (DataGrid.SortCommandName, "Sort", "A8"); + Assert.AreEqual (DataGrid.UpdateCommandName, "Update", "A9"); + + Assert.AreEqual (p.AllowCustomPaging, false, "A10"); + Assert.AreEqual (p.AllowPaging, false, "A11"); + Assert.AreEqual (p.AllowSorting, false, "A12"); + Assert.AreEqual (p.AutoGenerateColumns, true, "A13"); + Assert.AreEqual (p.BackImageUrl, String.Empty, "A14"); + Assert.AreEqual (p.CurrentPageIndex, 0, "A15"); + Assert.AreEqual (p.EditItemIndex, -1, "A16"); + Assert.AreEqual (p.PageCount, 0, "A17"); + Assert.AreEqual (p.PageSize, 10, "A18"); + Assert.AreEqual (p.SelectedIndex, -1, "A19"); + Assert.AreEqual (p.SelectedItem, null, "A20"); + Assert.AreEqual (p.ShowFooter, false, "A21"); + Assert.AreEqual (p.ShowHeader, true, "A22"); + Assert.AreEqual (p.VirtualItemCount, 0, "A23"); + } + + [Test] + public void TagName () + { + DataGridPoker p = new DataGridPoker (); + Assert.AreEqual (p.GetTagName (), "table", "A1"); + } + + [Test] + [ExpectedException (typeof (ArgumentNullException))] + public void NullBackImage () + { + DataGridPoker p = new DataGridPoker (); + + p.BackImageUrl = null; + Assert.AreEqual (p.BackImageUrl, String.Empty, "A1"); + } + + [Test] + public void CleanProperties () + { + DataGridPoker p = new DataGridPoker (); + + p.AllowCustomPaging = true; + Assert.IsTrue (p.AllowCustomPaging, "A1"); + p.AllowCustomPaging = false; + Assert.IsFalse (p.AllowCustomPaging, "A2"); + + p.AllowPaging = true; + Assert.IsTrue (p.AllowPaging, "A3"); + p.AllowPaging = false; + Assert.IsFalse (p.AllowPaging, "A4"); + + p.AllowSorting = true; + Assert.IsTrue (p.AllowSorting, "A5"); + p.AllowSorting = false; + Assert.IsFalse (p.AllowSorting, "A6"); + + p.AutoGenerateColumns = true; + Assert.IsTrue (p.AutoGenerateColumns, "A7"); + p.AutoGenerateColumns = false; + Assert.IsFalse (p.AutoGenerateColumns, "A8"); + + p.BackImageUrl = "foobar"; + Assert.AreEqual (p.BackImageUrl, "foobar", "A9"); + + p.CurrentPageIndex = 0; + Assert.AreEqual (p.CurrentPageIndex, 0, "A10"); + p.CurrentPageIndex = Int32.MaxValue; + Assert.AreEqual (p.CurrentPageIndex, Int32.MaxValue, "A11"); + + p.EditItemIndex = 0; + Assert.AreEqual (p.EditItemIndex, 0, "A12"); + p.EditItemIndex = -1; + Assert.AreEqual (p.EditItemIndex, -1, "A13"); + p.EditItemIndex = Int32.MaxValue; + Assert.AreEqual (p.EditItemIndex, Int32.MaxValue, "A14"); + + p.PageSize = 1; + Assert.AreEqual (p.PageSize, 1, "A15"); + p.PageSize = Int32.MaxValue; + + p.SelectedIndex = 0; + Assert.AreEqual (p.SelectedIndex, 0, "A16"); + p.SelectedIndex = -1; + Assert.AreEqual (p.SelectedIndex, -1, "A17"); + p.SelectedIndex = Int32.MaxValue; + Assert.AreEqual (p.SelectedIndex, Int32.MaxValue, "A18"); + + p.ShowFooter = true; + Assert.IsTrue (p.ShowFooter, "A19"); + p.ShowFooter = false; + Assert.IsFalse (p.ShowFooter, "A20"); + + p.ShowHeader = true; + Assert.IsTrue (p.ShowHeader, "A21"); + p.ShowHeader = false; + Assert.IsFalse (p.ShowHeader, "A22"); + + p.VirtualItemCount = 0; + Assert.AreEqual (p.VirtualItemCount, 0, "A23"); + p.VirtualItemCount = Int32.MaxValue; + Assert.AreEqual (p.VirtualItemCount, Int32.MaxValue, "A24"); + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void CurrentPageIndexTooLow () + { + DataGridPoker p = new DataGridPoker (); + p.CurrentPageIndex = -1; + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void EditItemIndexTooLow () + { + DataGridPoker p = new DataGridPoker (); + p.EditItemIndex = -2; + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void PageSizeTooLow () + { + DataGridPoker p = new DataGridPoker (); + p.PageSize = 0; + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void SelectedIndexTooLow () + { + DataGridPoker p = new DataGridPoker (); + p.SelectedIndex = -2; + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void VirtualItemCountTooLow () + { + DataGridPoker p = new DataGridPoker (); + p.VirtualItemCount = -1; + } + + [Test] + public void ViewState () + { + DataGridPoker p = new DataGridPoker (); + StateBag vs = p.GetViewState (); + + Assert.AreEqual (vs.Count, 0, "A1"); + + p.AllowCustomPaging = true; + Assert.AreEqual (vs.Count, 1, "A2"); + Assert.AreEqual (vs ["AllowCustomPaging"], true, "A3"); + p.AllowCustomPaging = false; + Assert.AreEqual (vs.Count, 1, "A4"); + Assert.AreEqual (vs ["AllowCustomPaging"], false, "A5"); + + p.AllowPaging = true; + Assert.AreEqual (vs.Count, 2, "A6"); + Assert.AreEqual (vs ["AllowPaging"], true, "A7"); + p.AllowPaging = false; + Assert.AreEqual (vs.Count, 2, "A8"); + Assert.AreEqual (vs ["AllowPaging"], false, "A9"); + + p.AllowSorting = true; + Assert.AreEqual (vs.Count, 3, "A10"); + Assert.AreEqual (vs ["AllowSorting"], true, "A11"); + p.AllowSorting = false; + Assert.AreEqual (vs.Count, 3, "A12"); + Assert.AreEqual (vs ["AllowSorting"], false, "A13"); + + p.AutoGenerateColumns = true; + Assert.AreEqual (vs.Count, 4, "A14"); + Assert.AreEqual (vs ["AutoGenerateColumns"], true, "A15"); + p.AutoGenerateColumns = false; + Assert.AreEqual (vs.Count, 4, "A16"); + Assert.AreEqual (vs ["AutoGenerateColumns"], false, "A17"); + + p.CurrentPageIndex = 1; + Assert.AreEqual (vs.Count, 5, "A18"); + Assert.AreEqual (vs ["CurrentPageIndex"], 1, "A19"); + + p.EditItemIndex = 1; + Assert.AreEqual (vs.Count, 6, "A20"); + Assert.AreEqual (vs ["EditItemIndex"], 1, "A20"); + + p.PageSize = 25; + Assert.AreEqual (vs.Count, 7, "A21"); + Assert.AreEqual (vs ["PageSize"], 25, "A22"); + + p.SelectedIndex = 25; + Assert.AreEqual (vs.Count, 8, "A23"); + Assert.AreEqual (vs ["SelectedIndex"], 25, "A24"); + + p.ShowFooter = false; + Assert.AreEqual (vs.Count, 9, "A25"); + Assert.AreEqual (vs ["ShowFooter"], false, "A26"); + p.ShowFooter = true; + Assert.AreEqual (vs ["ShowFooter"], true, "A27"); + + p.ShowHeader = false; + Assert.AreEqual (vs.Count, 10, "A28"); + Assert.AreEqual (vs ["ShowHeader"], false, "A29"); + p.ShowHeader = true; + Assert.AreEqual (vs ["ShowHeader"], true, "A30"); + + p.VirtualItemCount = 100; + Assert.AreEqual (vs.Count, 11, "A31"); + Assert.AreEqual (vs ["VirtualItemCount"], 100, "A32"); + } + + [Test] + public void SelectIndexOutOfRange () + { + DataGridPoker p = new DataGridPoker (); + + // No exception is thrown + p.SelectedIndex = 25; + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void SelectItemOutOfRange () + { + DataGridPoker p = new DataGridPoker (); + DataGridItem d; + + p.SelectedIndex = 25; + d = p.SelectedItem; + } + + [Test] + public void ControlStyle () + { + DataGridPoker p = new DataGridPoker (); + + Assert.AreEqual (p.ControlStyle ().GetType (), + typeof (TableStyle), "A1"); + + TableStyle t = (TableStyle) p.ControlStyle (); + Assert.AreEqual (t.GridLines, GridLines.Both, "A2"); + Assert.AreEqual (t.CellSpacing, 0, "A3"); + } + + [Test] + public void Styles () + { + DataGridPoker p = new DataGridPoker (); + StateBag vs = p.GetViewState (); + + p.BackImageUrl = "foobar url"; + + // The styles get stored in the view state + Assert.AreEqual (vs.Count, 0, "A1"); + Assert.IsNull (vs ["BackImageUrl"], "A2"); + Assert.IsNull (vs ["GridLines"], "A3"); + Assert.IsNull (vs ["CellSpacing"], "A4"); + } + + private bool cancel_command; + private bool delete_command; + private bool edit_command; + private bool item_command; + private bool update_command; + private bool item_created; + private bool item_data_bound; + private bool page_index_changed; + private bool sort_command; + private bool selected_changed; + + private int new_page_index; + + private void ResetEvents () + { + cancel_command = + delete_command = + edit_command = + item_command = + update_command = + item_created = + item_data_bound = + page_index_changed = + sort_command = + selected_changed = false; + + new_page_index = Int32.MinValue; + } + + private void CancelCommandHandler (object sender, DataGridCommandEventArgs e) + { + cancel_command = true; + } + + private void DeleteCommandHandler (object sender, DataGridCommandEventArgs e) + { + delete_command = true; + } + + private void EditCommandHandler (object sender, DataGridCommandEventArgs e) + { + edit_command = true; + } + + private void ItemCommandHandler (object sender, DataGridCommandEventArgs e) + { + item_command = true; + } + + private void UpdateCommandHandler (object sender, DataGridCommandEventArgs e) + { + update_command = true; + } + + private void ItemCreatedHandler (object sender, DataGridItemEventArgs e) + { + item_created = true; + } + + private void ItemDataBoundHandler (object sender, DataGridItemEventArgs e) + { + item_data_bound = true; + } + + private void PageIndexChangedHandler (object sender, DataGridPageChangedEventArgs e) + { + page_index_changed = true; + new_page_index = e.NewPageIndex; + } + + private void SortCommandHandler (object sender, DataGridSortCommandEventArgs e) + { + sort_command = true; + } + + private void SelectedIndexChangedHandler (object sender, EventArgs e) + { + selected_changed = true; + } + + [Test] + public void Events () + { + DataGridPoker p = new DataGridPoker (); + DataGridCommandEventArgs command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs (String.Empty, String.Empty)); + DataGridItemEventArgs item_args = new DataGridItemEventArgs (null); + DataGridPageChangedEventArgs page_args = new DataGridPageChangedEventArgs (null, 0); + DataGridSortCommandEventArgs sort_args = new DataGridSortCommandEventArgs (null, + command_args); + + ResetEvents (); + p.CancelCommand += new DataGridCommandEventHandler (CancelCommandHandler); + p.DoCancelCommand (command_args); + Assert.IsTrue (cancel_command, "A1"); + + ResetEvents (); + p.DeleteCommand += new DataGridCommandEventHandler (DeleteCommandHandler); + p.DoDeleteCommand (command_args); + Assert.IsTrue (delete_command, "A2"); + + ResetEvents (); + p.EditCommand += new DataGridCommandEventHandler (EditCommandHandler); + p.DoEditCommand (command_args); + Assert.IsTrue (edit_command, "A3"); + + ResetEvents (); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.DoItemCommand (command_args); + Assert.IsTrue (item_command, "A4"); + + ResetEvents (); + p.UpdateCommand += new DataGridCommandEventHandler (UpdateCommandHandler); + p.DoUpdateCommand (command_args); + Assert.IsTrue (update_command, "A5"); + + ResetEvents (); + p.ItemCreated += new DataGridItemEventHandler (ItemCreatedHandler); + p.DoItemCreated (item_args); + Assert.IsTrue (item_created, "A6"); + + ResetEvents (); + p.ItemDataBound += new DataGridItemEventHandler (ItemDataBoundHandler); + p.DoItemDataBound (item_args); + Assert.IsTrue (item_data_bound, "A7"); + + ResetEvents (); + p.PageIndexChanged += new DataGridPageChangedEventHandler (PageIndexChangedHandler); + p.DoPageIndexChanged (page_args); + Assert.IsTrue (page_index_changed, "A8"); + + ResetEvents (); + p.SortCommand += new DataGridSortCommandEventHandler (SortCommandHandler); + p.DoSortCommand (sort_args); + Assert.IsTrue (sort_command, "A9"); + } + + [Test] + public void BubbleEvent () + { + DataGridPoker p = new DataGridPoker (); + DataGridCommandEventArgs command_args; + + // + // Cancel + // + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("Cancel", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.CancelCommand += new DataGridCommandEventHandler (CancelCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (cancel_command, "A1"); + Assert.IsTrue (item_command, "#01"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("cancel", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.CancelCommand += new DataGridCommandEventHandler (CancelCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (cancel_command, "A2"); + Assert.IsTrue (item_command, "#02"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("CANCEL", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.CancelCommand += new DataGridCommandEventHandler (CancelCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (cancel_command, "A3"); + Assert.IsTrue (item_command, "#03"); + + // + // Delete + // + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("Delete", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.DeleteCommand += new DataGridCommandEventHandler (DeleteCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (delete_command, "A4"); + Assert.IsTrue (item_command, "#04"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("delete", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.DeleteCommand += new DataGridCommandEventHandler (DeleteCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (delete_command, "A5"); + Assert.IsTrue (item_command, "#05"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("DELETE", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.DeleteCommand += new DataGridCommandEventHandler (DeleteCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (delete_command, "A6"); + Assert.IsTrue (item_command, "#06"); + + // + // Edit + // + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("Edit", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.EditCommand += new DataGridCommandEventHandler (EditCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (edit_command, "A7"); + Assert.IsTrue (item_command, "#07"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("edit", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.EditCommand += new DataGridCommandEventHandler (EditCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (edit_command, "A8"); + Assert.IsTrue (item_command, "#08"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("EDIT", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.EditCommand += new DataGridCommandEventHandler (EditCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (edit_command, "A9"); + Assert.IsTrue (item_command, "#09"); + + // + // Item + // + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("Item", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (item_command, "A10"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("item", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (item_command, "A11"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("ITEM", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (item_command, "A12"); + + // + // Sort + // + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("Sort", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.SortCommand += new DataGridSortCommandEventHandler (SortCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (sort_command, "A13"); + Assert.IsTrue (item_command, "#10"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("sort", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.SortCommand += new DataGridSortCommandEventHandler (SortCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (sort_command, "A14"); + Assert.IsTrue (item_command, "#11"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("SORT", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.SortCommand += new DataGridSortCommandEventHandler (SortCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (sort_command, "A15"); + Assert.IsTrue (item_command, "#12"); + + // + // Update + // + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("Update", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.UpdateCommand += new DataGridCommandEventHandler (UpdateCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (update_command, "A16"); + Assert.IsTrue (item_command, "#13"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("update", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.UpdateCommand += new DataGridCommandEventHandler (UpdateCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (update_command, "A17"); + Assert.IsTrue (item_command, "#14"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (null, + null, new CommandEventArgs ("UPDATE", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.UpdateCommand += new DataGridCommandEventHandler (UpdateCommandHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (update_command, "A18"); + Assert.IsTrue (item_command, "#15"); + + // + // Select + // + DataGridItem item = new DataGridItem (0, 0, ListItemType.Item); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("Select", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.SelectedIndexChanged += new EventHandler (SelectedIndexChangedHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (selected_changed, "A19"); + Assert.IsTrue (item_command, "#16"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("select", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.SelectedIndexChanged += new EventHandler (SelectedIndexChangedHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (selected_changed, "A20"); + Assert.IsTrue (item_command, "#17"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("SELECT", String.Empty)); + p.ItemCommand += new DataGridCommandEventHandler (ItemCommandHandler); + p.SelectedIndexChanged += new EventHandler (SelectedIndexChangedHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (selected_changed, "A21"); + Assert.IsTrue (item_command, "#18"); + } + + [Test] + public void BubblePageCommand () + { + DataGridPoker p = new DataGridPoker (); + DataGridItem item = new DataGridItem (0, 0, ListItemType.Item); + DataGridCommandEventArgs command_args; + + + // + // Prev + // + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("Page", "Prev")); + p.CurrentPageIndex = 10; + p.PageIndexChanged += new DataGridPageChangedEventHandler (PageIndexChangedHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (page_index_changed, "A1"); + Assert.AreEqual (new_page_index, 9, "A2"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("page", "prev")); + p.CurrentPageIndex = 10; + p.PageIndexChanged += new DataGridPageChangedEventHandler (PageIndexChangedHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (page_index_changed, "A3"); + Assert.AreEqual (new_page_index, 9, "A4"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("PAGE", "PREV")); + p.CurrentPageIndex = 10; + p.PageIndexChanged += new DataGridPageChangedEventHandler (PageIndexChangedHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (page_index_changed, "A5"); + Assert.AreEqual (new_page_index, 9, "A6"); + + + // + // Next + // + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("Page", "Next")); + p.CurrentPageIndex = 10; + p.PageIndexChanged += new DataGridPageChangedEventHandler (PageIndexChangedHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (page_index_changed, "A5"); + Assert.AreEqual (new_page_index, 11, "A6"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("page", "next")); + p.CurrentPageIndex = 10; + p.PageIndexChanged += new DataGridPageChangedEventHandler (PageIndexChangedHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (page_index_changed, "A7"); + Assert.AreEqual (new_page_index, 11, "A8"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("PAGE", "NEXT")); + p.CurrentPageIndex = 10; + p.PageIndexChanged += new DataGridPageChangedEventHandler (PageIndexChangedHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (page_index_changed, "A9"); + Assert.AreEqual (new_page_index, 11, "A10"); + + + // + // Specific + // + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("Page", "25")); + p.CurrentPageIndex = 10; + p.PageIndexChanged += new DataGridPageChangedEventHandler (PageIndexChangedHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (page_index_changed, "A11"); + Assert.AreEqual (new_page_index, 24, "A12"); + + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("Page", "0")); + p.CurrentPageIndex = 10; + p.PageIndexChanged += new DataGridPageChangedEventHandler (PageIndexChangedHandler); + p.DoBubbleEvent (this, command_args); + Assert.IsTrue (page_index_changed, "A11"); + Assert.AreEqual (new_page_index, -1, "A12"); + } + + [Test] + [ExpectedException (typeof (FormatException))] + public void BadBubblePageArg () + { + DataGridPoker p = new DataGridPoker (); + DataGridItem item = new DataGridItem (0, 0, ListItemType.Item); + DataGridCommandEventArgs command_args; + + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("Page", "i am bad")); + + p.DoBubbleEvent (this, command_args); + } + + [Test] + [ExpectedException (typeof (InvalidCastException))] + public void BadBubblePageArg2 () + { + DataGridPoker p = new DataGridPoker (); + DataGridItem item = new DataGridItem (0, 0, ListItemType.Item); + DataGridCommandEventArgs command_args; + + ResetEvents (); + command_args = new DataGridCommandEventArgs (item, null, + new CommandEventArgs ("Page", new object ())); + + p.DoBubbleEvent (this, command_args); + } + + [Test] + public void SaveViewState () + { + DataGridPoker p = new DataGridPoker (); + + p.TrackState (); + + object [] vs = (object []) p.SaveState (); + Assert.AreEqual (vs.Length, 11, "A1"); + + // By default the viewstate is all null + for (int i = 0; i < vs.Length; i++) + Assert.IsNull (vs [i], "A2-" + i); + + // + // TODO: What goes in the [1] and [9] slots? + // + + p.AllowPaging = true; + vs = (object []) p.SaveState (); + Assert.IsNotNull (vs [0], "A3"); + + /* + This test doesn't work right now. It must be an issue + in the DataGridPagerStyle + + p.PagerStyle.Visible = true; + vs = (object []) p.SaveState (); + Assert.IsNotNull (vs [2], "A5"); + */ + + p.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; + vs = (object []) p.SaveState (); + Assert.IsNotNull (vs [3], "A6"); + + p.FooterStyle.HorizontalAlign = HorizontalAlign.Center; + vs = (object []) p.SaveState (); + Assert.IsNotNull (vs [4], "A7"); + + p.ItemStyle.HorizontalAlign = HorizontalAlign.Center; + vs = (object []) p.SaveState (); + Assert.IsNotNull (vs [5], "A8"); + + p.AlternatingItemStyle.HorizontalAlign = HorizontalAlign.Center; + vs = (object []) p.SaveState (); + Assert.IsNotNull (vs [6], "A9"); + + p.SelectedItemStyle.HorizontalAlign = HorizontalAlign.Center; + vs = (object []) p.SaveState (); + Assert.IsNotNull (vs [7], "A10"); + + p.EditItemStyle.HorizontalAlign = HorizontalAlign.Center; + vs = (object []) p.SaveState (); + Assert.IsNotNull (vs [8], "A11"); + + PagedDataSource source = new PagedDataSource (); + DataTable table = new DataTable (); + ArrayList columns; + + table.Columns.Add (new DataColumn ("one", typeof (string))); + table.Columns.Add (new DataColumn ("two", typeof (string))); + table.Columns.Add (new DataColumn ("three", typeof (string))); + source.DataSource = new DataView (table); + columns = p.CreateColumns (source, true); + + vs = (object []) p.SaveState (); + Assert.IsNull (vs [9], "A12"); + p.BackImageUrl = "foobar url"; + vs = (object []) p.SaveState (); + Assert.IsNotNull (vs [9], "A12"); + + Assert.IsNotNull (vs [10], "A12"); + Assert.AreEqual (vs [10].GetType (), typeof (object []), "A12"); + + object [] cols = (object []) vs [10]; + Assert.AreEqual (cols.Length, 3, "A13"); + } + + [Test] + public void CreateColumnSet () + { + DataGridPoker p = new DataGridPoker (); + PagedDataSource source = new PagedDataSource (); + DataTable table = new DataTable (); + ArrayList columns; + + table.Columns.Add (new DataColumn ("one", typeof (string))); + table.Columns.Add (new DataColumn ("two", typeof (string))); + table.Columns.Add (new DataColumn ("three", typeof (string))); + + source.DataSource = new DataView (table); + + columns = p.CreateColumns (source, true); + Assert.AreEqual (columns.Count, 3, "A1"); + Assert.AreEqual (((DataGridColumn) columns [0]).HeaderText, "one", "A2"); + Assert.AreEqual (((DataGridColumn) columns [1]).HeaderText, "two", "A3"); + Assert.AreEqual (((DataGridColumn) columns [2]).HeaderText, "three", "A4"); + + // AutoGenerated columns are not added to the ColumnsCollection + Assert.AreEqual (p.Columns.Count, 0, "A5"); + + // Without allowing data dinding, + columns = p.CreateColumns (source, false); + Assert.AreEqual (columns.Count, 3, "A6"); + Assert.AreEqual (((DataGridColumn) columns [0]).HeaderText, "one", "A7"); + Assert.AreEqual (((DataGridColumn) columns [1]).HeaderText, "two", "A8"); + Assert.AreEqual (((DataGridColumn) columns [2]).HeaderText, "three", "A9"); + + + // Mixing with already added columns + p = new DataGridPoker (); + DataGridColumn a = new ButtonColumn (); + DataGridColumn b = new ButtonColumn (); + + a.HeaderText = "A"; + b.HeaderText = "B"; + p.Columns.Add (a); + p.Columns.Add (b); + + columns = p.CreateColumns (source, true); + Assert.AreEqual (columns.Count, 5, "A6"); + Assert.AreEqual (((DataGridColumn) columns [0]).HeaderText, "A", "A10"); + Assert.AreEqual (((DataGridColumn) columns [1]).HeaderText, "B", "A11"); + Assert.AreEqual (((DataGridColumn) columns [2]).HeaderText, "one", "A12"); + Assert.AreEqual (((DataGridColumn) columns [3]).HeaderText, "two", "A13"); + Assert.AreEqual (((DataGridColumn) columns [4]).HeaderText, "three", "A14"); + + // Assigned properties of the newly created columns + BoundColumn one = (BoundColumn) columns [2]; + + Assert.AreEqual (one.HeaderText, "one", "A15"); + Assert.AreEqual (one.DataField, "one", "A16"); + Assert.AreEqual (one.DataFormatString, String.Empty, "A17"); + Assert.AreEqual (one.SortExpression, "one", "A18"); + Assert.AreEqual (one.HeaderImageUrl, String.Empty, "A19"); + Assert.AreEqual (one.FooterText, String.Empty, "A20"); + } + + [Test] + public void CreateColumnsBinding () + { + DataGridPoker p = new DataGridPoker (); + PagedDataSource source = new PagedDataSource (); + DataTable table = new DataTable (); + ArrayList columns; + + table.Columns.Add (new DataColumn ("one", typeof (string))); + table.Columns.Add (new DataColumn ("two", typeof (string))); + table.Columns.Add (new DataColumn ("three", typeof (string))); + + source.DataSource = new DataView (table); + + columns = p.CreateColumns (source, true); + Assert.AreEqual (columns.Count, 3, "A1"); + Assert.AreEqual (((DataGridColumn) columns [0]).HeaderText, "one", "A2"); + Assert.AreEqual (((DataGridColumn) columns [1]).HeaderText, "two", "A3"); + Assert.AreEqual (((DataGridColumn) columns [2]).HeaderText, "three", "A4"); + + table.Columns.Add (new DataColumn ("four", typeof (string))); + table.Columns.Add (new DataColumn ("five", typeof (string))); + table.Columns.Add (new DataColumn ("six", typeof (string))); + + // Just gets the old columns + columns = p.CreateColumns (source, false); + Assert.AreEqual (columns.Count, 3, "A5"); + Assert.AreEqual (((DataGridColumn) columns [0]).HeaderText, "one", "A6"); + Assert.AreEqual (((DataGridColumn) columns [1]).HeaderText, "two", "A7"); + Assert.AreEqual (((DataGridColumn) columns [2]).HeaderText, "three", "A8"); + + columns = p.CreateColumns (source, true); + Assert.AreEqual (columns.Count, 6, "A9"); + Assert.AreEqual (((DataGridColumn) columns [0]).HeaderText, "one", "A10"); + Assert.AreEqual (((DataGridColumn) columns [1]).HeaderText, "two", "A11"); + Assert.AreEqual (((DataGridColumn) columns [2]).HeaderText, "three", "A12"); + Assert.AreEqual (((DataGridColumn) columns [3]).HeaderText, "four", "A13"); + Assert.AreEqual (((DataGridColumn) columns [4]).HeaderText, "five", "A14"); + Assert.AreEqual (((DataGridColumn) columns [5]).HeaderText, "six", "A15"); + + // Assigned properties of the newly created columns + BoundColumn one = (BoundColumn) columns [0]; + + Assert.AreEqual (one.HeaderText, "one", "A16"); + Assert.AreEqual (one.DataField, "one", "A17"); + Assert.AreEqual (one.DataFormatString, String.Empty, "A18"); + Assert.AreEqual (one.SortExpression, "one", "A19"); + Assert.AreEqual (one.HeaderImageUrl, String.Empty, "A20"); + Assert.AreEqual (one.FooterText, String.Empty, "A21"); + } + + [Test] + public void CreateSimpleColumns () + { + DataGridPoker p = new DataGridPoker (); + PagedDataSource source = new PagedDataSource (); + ArrayList list = new ArrayList (); + ArrayList columns; + + list.Add ("One"); + list.Add ("Two"); + list.Add ("Three"); + + source.DataSource = list; + columns = p.CreateColumns (source, true); + Assert.AreEqual (1, columns.Count, "A1"); + Assert.AreEqual ("Item", ((DataGridColumn) columns [0]).HeaderText, "A2"); + + AmazingEnumerable amazing = new AmazingEnumerable (list); + + source.DataSource = amazing; + columns = p.CreateColumns (source, true); + Assert.AreEqual (1, columns.Count, "A3"); + + BoundColumn one = (BoundColumn) columns [0]; + + Assert.AreEqual ("Item", one.HeaderText, "A4"); + + // I guess this makes it bind to itself ? + Assert.AreEqual (BoundColumn.thisExpr, one.DataField, "A5"); + + Assert.AreEqual (String.Empty, one.DataFormatString, "A6"); + Assert.AreEqual ("Item", one.SortExpression, "A7"); + Assert.AreEqual (String.Empty, one.HeaderImageUrl, "A8"); + Assert.AreEqual (String.Empty, one.FooterText, "A9"); + Assert.AreEqual ("Item", one.HeaderText, "A10"); + + source.DataSource = new ArrayList (); + columns = p.CreateColumns (source, true); + Assert.AreEqual (0, columns.Count, "A11"); + } + + [Test] + public void DataBindingEnumerator () + { + DataGridPoker p = new DataGridPoker (); + PagedDataSource source = new PagedDataSource (); + ArrayList list = new ArrayList (); + ArrayList columns; + + list.Add ("One"); + list.Add ("Two"); + list.Add ("Three"); + + AmazingEnumerable amazing = new AmazingEnumerable (list); + source.DataSource = amazing; + columns = p.CreateColumns (source, true); + Assert.AreEqual (1, columns.Count, "A1"); + Assert.AreEqual ("Item", ((DataGridColumn) columns [0]).HeaderText, "A2"); + Assert.AreEqual (1, amazing.CallCount, "A3"); + Assert.AreEqual (0, p.DataKeys.Count, "A4"); + } + + class Custom : ICustomTypeDescriptor { + public AttributeCollection GetAttributes () + { + throw new Exception (); + } + + public string GetClassName() + { + throw new Exception (); + } + + public string GetComponentName() + { + throw new Exception (); + } + + public TypeConverter GetConverter() + { + throw new Exception (); + } + + public EventDescriptor GetDefaultEvent() + { + throw new Exception (); + } + + public PropertyDescriptor GetDefaultProperty() + { + throw new Exception (); + } + + public object GetEditor (Type editorBaseType) + { + throw new Exception (); + } + + public EventDescriptorCollection GetEvents () + { + throw new Exception (); + } + + public EventDescriptorCollection GetEvents (Attribute[] arr) + { + throw new Exception (); + } + + public int CallCount; + public PropertyDescriptorCollection GetProperties() + { + // MS calls this one + if (CallCount++ > 0) + throw new Exception ("This should not happen"); + PropertyDescriptorCollection coll = new PropertyDescriptorCollection (null); + coll.Add (new MyPropertyDescriptor ()); + return coll; + } + + public PropertyDescriptorCollection GetProperties (Attribute[] arr) + { + // We call this one + return GetProperties (); + } + + public object GetPropertyOwner (PropertyDescriptor pd) + { + throw new Exception (); + } + } + + class MyPropertyDescriptor : PropertyDescriptor { + int val; + + public MyPropertyDescriptor () : base ("CustomName", null) + { + } + + public override Type ComponentType { + get { return typeof (MyPropertyDescriptor); } + } + + public override bool IsReadOnly { + get { return true; } + } + + public override Type PropertyType { + get { return typeof (int); } + } + + public override object GetValue (object component) + { + return val++; + } + + public override void SetValue (object component, object value) + { + } + + public override void ResetValue (object component) + { + } + + public override bool CanResetValue (object component) + { + return false; + } + + public override bool ShouldSerializeValue (object component) + { + return false; + } + } + + class MyEnumerable : IEnumerable { + public object Item; + public IEnumerator GetEnumerator () + { + ArrayList list = new ArrayList (); + list.Add (Item); + return list.GetEnumerator (); + } + } + + [Test] + public void DataBindingCustomElement () + { + DataGridPoker p = new DataGridPoker (); + p.DataKeyField = "CustomName"; + PagedDataSource source = new PagedDataSource (); + MyEnumerable myenum = new MyEnumerable (); + myenum.Item = new Custom (); + source.DataSource = myenum; + ArrayList columns = p.CreateColumns (source, true); + Assert.AreEqual (1, columns.Count, "A1"); + Assert.AreEqual ("CustomName", ((DataGridColumn) columns [0]).HeaderText, "A2"); + Assert.AreEqual (0, p.DataKeys.Count, "A3"); + } + + public class data + { + private static ArrayList _data = new ArrayList (); + + static data () { + _data.Add (new DataItem (1, "heh1")); + _data.Add (new DataItem (2, "heh2")); + _data.Add (new DataItem (3, "heh3")); + _data.Add (new DataItem (4, "heh4")); + _data.Add (new DataItem (5, "heh5")); + _data.Add (new DataItem (6, "heh6")); + _data.Add (new DataItem (7, "heh7")); + _data.Add (new DataItem (8, "heh8")); + _data.Add (new DataItem (9, "heh9")); + _data.Add (new DataItem (10, "heh10")); + } + + public data () { + } + + public ArrayList GetAllItems () { + return _data; + } + + public ArrayList GetPagedItems (int startIndex, int maxRows) + { + ArrayList list = new ArrayList (); + if (startIndex < _data.Count - 1) { + int countToReturn = Math.Min (maxRows, _data.Count - startIndex); + for (int i = startIndex; i < startIndex + countToReturn; i++) { + list.Add (_data [i]); + } + } + + return list; + } + + public int GetCount () + { + return _data.Count; + } + + public void UpdateItem (int id, string name) { + foreach (DataItem i in _data) { + if (i.ID == id) { + i.Name = name; + return; + } + } + } + } + + public class DataItem + { + int _id = 0; + string _name = ""; + + public DataItem (int id, string name) { + _id = id; + _name = name; + } + + public int ID { + get { return _id; } + } + + public string Name { + get { return _name; } + set { _name = value; } + } + } + + public class DataSourceObject + { + public static List GetList (string sortExpression, int startRowIndex, int maximumRows) { + return GetList (); + } + + public static List GetList (int startRowIndex, int maximumRows) { + return GetList (); + } + + public static List GetList (string sortExpression) { + return GetList (); + } + + public static List GetList () { + List list = new List (); + list.Add ("Norway"); + list.Add ("Sweden"); + list.Add ("France"); + list.Add ("Italy"); + list.Add ("Israel"); + list.Add ("Russia"); + return list; + } + + public static int GetCount () { + return GetList ().Count; + } + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void DataSourceAndDataSourceID () + { + Page page = new Page (); + DataGridPoker dg = new DataGridPoker (); + + page.Controls.Add (dg); + + DataTable dt = new DataTable (); + dt.Columns.Add (new DataColumn ("something", typeof (Int32))); + DataRow dr = dt.NewRow (); + dt.Rows.Add (new object [] { 1 }); + DataView dv = new DataView (dt); + + dg.DataSource = dv; + + ObjectDataSource ds = new ObjectDataSource (); + ds.TypeName = typeof (DataSourceObject).AssemblyQualifiedName; + ds.SelectMethod = "GetList"; + ds.SortParameterName = "sortExpression"; + ds.ID = "Data"; + page.Controls.Add (ds); + + dg.DataSourceID = "Data"; + + dg.DataBind (); + } + + [Test] + public void DataBindingDataSourceID () + { + Page page = new Page (); + DataGridPoker dg = new DataGridPoker (); + page.Controls.Add (dg); + + ObjectDataSource ds = new ObjectDataSource (); + ds.TypeName = typeof (DataSourceObject).AssemblyQualifiedName; + ds.SelectMethod = "GetList"; + ds.SortParameterName = "sortExpression"; + ds.ID = "Data"; + page.Controls.Add (ds); + + dg.DataSourceID = "Data"; + dg.DataBind (); + + Assert.AreEqual (6, dg.Items.Count, "DataBindingDataSourceID"); + } + + [Test] + [NUnit.Framework.Category ("NunitWeb")] + public void DataBindingDataSourceIDAutomatic () + { + WebTest t = new WebTest (); + PageDelegates pd = new PageDelegates(); + pd.Load = DataSourceIDAutomatic_Load; + pd.PreRender = DataSourceIDAutomatic_PreRender; + t.Invoker = new PageInvoker (pd); + + t.Run (); + } + + public static void DataSourceIDAutomatic_Load (Page page) + { + DataGridPoker dg = new DataGridPoker (); + dg.ID = "DataGrid"; + page.Controls.Add (dg); + + ObjectDataSource ds = new ObjectDataSource (); + ds.TypeName = typeof (DataSourceObject).AssemblyQualifiedName; + ds.SelectMethod = "GetList"; + ds.SortParameterName = "sortExpression"; + ds.ID = "Data"; + page.Controls.Add (ds); + + dg.DataSourceID = "Data"; + } + + public static void DataSourceIDAutomatic_PreRender (Page page) + { + DataGrid dg = (DataGrid)page.FindControl ("DataGrid"); + + Assert.AreEqual (6, dg.Items.Count, "DataBindingDataSourceID"); + } + + [Test] + public void DataSourceIDBindingNoColumns () + { + Page page = new Page (); + DataGridPoker dg = new DataGridPoker (); + dg.ID = "DataGrid"; + dg.AutoGenerateColumns = false; + + page.Controls.Add (dg); + + ObjectDataSource ds = new ObjectDataSource (); + ds.TypeName = typeof (DataSourceObject).AssemblyQualifiedName; + ds.SelectMethod = "GetList"; + ds.SortParameterName = "sortExpression"; + ds.ID = "Data"; + page.Controls.Add (ds); + + dg.DataSourceID = "Data"; + dg.DataBind (); + + Assert.AreEqual (0, dg.Columns.Count, "Columns Count"); + Assert.AreEqual (0, dg.Items.Count, "Items Count"); + } + + [Test] + public void DataSourceIDBindingManualColumns () + { + Page page = new Page (); + DataGridPoker dg = new DataGridPoker (); + dg.ID = "DataGrid"; + dg.AutoGenerateColumns = false; + BoundColumn col = new BoundColumn(); + col.DataField = "something"; + dg.Columns.Add (col); + + page.Controls.Add (dg); + + DataTable dt = new DataTable (); + dt.Columns.Add (new DataColumn ("something", typeof (Int32))); + DataRow dr = dt.NewRow (); + dt.Rows.Add (new object [] { 1 }); + dt.Rows.Add (new object [] { 2 }); + dt.Rows.Add (new object [] { 3 }); + dt.Rows.Add (new object [] { 4 }); + dt.Rows.Add (new object [] { 5 }); + dt.Rows.Add (new object [] { 6 }); + + DataView dv = new DataView (dt); + + dg.DataSource = dv; + dg.DataBind (); + + Assert.AreEqual (1, dg.Columns.Count, "Columns Count"); + Assert.AreEqual (6, dg.Items.Count, "Items Count"); + Assert.AreEqual ("1", dg.Items[0].Cells[0].Text, "Cell content"); + } + + [Test] + [NUnit.Framework.Category ("NunitWeb")] + public void Paging () + { + WebTest t = new WebTest ("DataGrid.aspx"); + t.Invoker = PageInvoker.CreateOnInit (DataGrid_OnInit); + string html = t.Run (); + string gridHtml = HtmlDiff.GetControlFromPageHtml (html); + string expectedFirstPage = "\n \r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
IDName  IDNameComment
1heh1EditDelete1heh1Comment 1
2heh2EditDelete2heh2Comment 2
3heh3EditDelete3heh3Comment 3
4heh4EditDelete4heh4Comment 4
5heh5EditDelete5heh5Comment 5
       
Previous Next
"; + + HtmlDiff.AssertAreEqual (expectedFirstPage, gridHtml, "DataGrid initial Render"); + + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); +#if DOT_NET + fr.Controls ["__EVENTTARGET"].Value = "DataGrid1$ctl09$ctl01"; +#else + fr.Controls ["__EVENTTARGET"].Value = "DataGrid1$ctl08$ctl01"; +#endif + fr.Controls ["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + + html = t.Run (); + gridHtml = HtmlDiff.GetControlFromPageHtml (html); + string expectedSecondPage = "\n \r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
IDName  IDNameComment
6heh6EditDelete6heh6Comment 6
7heh7EditDelete7heh7Comment 7
8heh8EditDelete8heh8Comment 8
9heh9EditDelete9heh9Comment 9
10heh10EditDelete10heh10Comment 10
       
Previous Next
"; + HtmlDiff.AssertAreEqual (expectedSecondPage, gridHtml, "DataGrid Paging Next"); + + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); +#if DOT_NET + fr.Controls ["__EVENTTARGET"].Value = "DataGrid1$ctl09$ctl00"; +#else + fr.Controls ["__EVENTTARGET"].Value = "DataGrid1$ctl08$ctl00"; +#endif + fr.Controls ["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + + html = t.Run (); + gridHtml = HtmlDiff.GetControlFromPageHtml (html); + + HtmlDiff.AssertAreEqual (expectedFirstPage, gridHtml, "DataGrid Paging Previous"); + } + + [Test] + [NUnit.Framework.Category ("NunitWeb")] + public void EditUpdateDelete () + { + WebTest t = new WebTest ("DataGrid.aspx"); + t.Invoker = PageInvoker.CreateOnInit (DataGrid_OnInit); + string html = t.Run (); + string gridHtml = HtmlDiff.GetControlFromPageHtml (html); + string expectedFirstPage = "\n \r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
IDName  IDNameComment
1heh1EditDelete1heh1Comment 1
2heh2EditDelete2heh2Comment 2
3heh3EditDelete3heh3Comment 3
4heh4EditDelete4heh4Comment 4
5heh5EditDelete5heh5Comment 5
       
Previous Next
"; + + HtmlDiff.AssertAreEqual (expectedFirstPage, gridHtml, "DataGrid initial Render"); + + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); +#if DOT_NET + fr.Controls ["__EVENTTARGET"].Value = "DataGrid1$ctl03$ctl00"; +#else + fr.Controls ["__EVENTTARGET"].Value = "DataGrid1$ctl02$ctl00"; +#endif + fr.Controls ["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + + html = t.Run (); + gridHtml = HtmlDiff.GetControlFromPageHtml (html); + string expectedSecondPage = "\n \r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
IDName  IDNameComment
1Update CancelDelete1
2heh2EditDelete2heh2Comment 2
3heh3EditDelete3heh3Comment 3
4heh4EditDelete4heh4Comment 4
5heh5EditDelete5heh5Comment 5
       
Previous Next
"; + HtmlDiff.AssertAreEqual (expectedSecondPage, gridHtml, "DataGrid Edit"); + + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); +#if DOT_NET + fr.Controls ["__EVENTTARGET"].Value = "DataGrid1$ctl03$ctl01"; +#else + fr.Controls ["__EVENTTARGET"].Value = "DataGrid1$ctl02$ctl01"; +#endif + fr.Controls ["__EVENTARGUMENT"].Value = ""; +#if DOT_NET + fr.Controls.Add ("DataGrid1$ctl03$ctl00"); + fr.Controls ["DataGrid1$ctl03$ctl00"].Value = "New Value"; +#else + fr.Controls.Add ("DataGrid1$ctl02$ctl00"); + fr.Controls ["DataGrid1$ctl02$ctl00"].Value = "New Value"; +#endif + t.Request = fr; + + html = t.Run (); + gridHtml = HtmlDiff.GetControlFromPageHtml (html); + string expectedThirdPage = "\n \r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
IDName  IDNameComment
1New ValueEditDelete1New ValueComment 1
2heh2EditDelete2heh2Comment 2
3heh3EditDelete3heh3Comment 3
4heh4EditDelete4heh4Comment 4
5heh5EditDelete5heh5Comment 5
       
Previous Next
"; + + HtmlDiff.AssertAreEqual (expectedThirdPage, gridHtml, "DataGrid Update"); + + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); +#if DOT_NET + fr.Controls ["__EVENTTARGET"].Value = "DataGrid1$ctl04$ctl01"; +#else + fr.Controls ["__EVENTTARGET"].Value = "DataGrid1$ctl03$ctl01"; +#endif + fr.Controls ["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + + html = t.Run (); + gridHtml = HtmlDiff.GetControlFromPageHtml (html); + string expectedFourthPage = "\n \r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
IDName  IDNameComment
1New ValueEditDelete1New ValueComment 1
3heh3EditDelete3heh3Comment 3
4heh4EditDelete4heh4Comment 4
5heh5EditDelete5heh5Comment 5
6heh6EditDelete6heh6Comment 6
       
Previous Next
"; + + HtmlDiff.AssertAreEqual (expectedFourthPage, gridHtml, "DataGrid Delete"); + } + + [Test] + [NUnit.Framework.Category ("NunitWeb")] + public void SelectedIndex () + { + WebTest t = new WebTest ("DataGrid.aspx"); + t.Invoker = PageInvoker.CreateOnInit (DataGrid_OnInit); + string html = t.Run (); + string gridHtml = HtmlDiff.GetControlFromPageHtml (html); + string expectedFirstPage = "\n \r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
IDName  IDNameComment
1heh1EditDelete1heh1Comment 1
2heh2EditDelete2heh2Comment 2
3heh3EditDelete3heh3Comment 3
4heh4EditDelete4heh4Comment 4
5heh5EditDelete5heh5Comment 5
       
Previous Next
"; + + HtmlDiff.AssertAreEqual (expectedFirstPage, gridHtml, "DataGrid initial Render"); + + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls ["__EVENTTARGET"].Value = "Button1"; + fr.Controls ["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + + html = t.Run (); + gridHtml = HtmlDiff.GetControlFromPageHtml (html); + string expectedSecondPage = "\n \r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
IDName  IDNameComment
1heh1EditDelete1heh1Comment 1
2heh2EditDelete2heh2Comment 2
3heh3EditDelete3heh3Comment 3
4heh4EditDelete4heh4Comment 4
5heh5EditDelete5heh5Comment 5
       
Previous Next
"; + HtmlDiff.AssertAreEqual (expectedSecondPage, gridHtml, "DataGrid Selected 1"); + + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls ["__EVENTTARGET"].Value = "Button1"; + fr.Controls ["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + + html = t.Run (); + gridHtml = HtmlDiff.GetControlFromPageHtml (html); + string expectedThirdPage = "\n \r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
IDName  IDNameComment
1heh1EditDelete1heh1Comment 1
2heh2EditDelete2heh2Comment 2
3heh3EditDelete3heh3Comment 3
4heh4EditDelete4heh4Comment 4
5heh5EditDelete5heh5Comment 5
       
Previous Next
"; + + HtmlDiff.AssertAreEqual (expectedThirdPage, gridHtml, "DataGrid Selected 2"); + } + + public static void DataGrid_OnInit (Page p) + { + if (!p.IsPostBack) + MyDataSource.Init (); + DataGrid DataGrid1 = (DataGrid)p.FindControl ("DataGrid1"); + DataGrid1.PageIndexChanged += new DataGridPageChangedEventHandler (DataGrid1_PageIndexChanged); + DataGrid1.CancelCommand += new DataGridCommandEventHandler (DataGrid1_CancelCommand); + DataGrid1.DeleteCommand += new DataGridCommandEventHandler (DataGrid1_DeleteCommand); + DataGrid1.EditCommand += new DataGridCommandEventHandler (DataGrid1_EditCommand); + DataGrid1.UpdateCommand += new DataGridCommandEventHandler (DataGrid1_UpdateCommand); + DataGrid1.ItemCreated += new DataGridItemEventHandler (DataGrid1_ItemCreated); + } + + public static void DataGrid1_ItemCreated (object sender, DataGridItemEventArgs e) + { + if (e.Item.ItemType == ListItemType.Pager) { + e.Item.Cells [0].ColumnSpan = 4; + } + } + + public static void DataGrid1_PageIndexChanged (object source, DataGridPageChangedEventArgs e) + { + DataGrid DataGrid1 = (DataGrid) source; + DataGrid1.CurrentPageIndex = e.NewPageIndex; + DataGrid1.DataBind (); + } + + public static void DataGrid1_EditCommand (object source, DataGridCommandEventArgs e) + { + DataGrid DataGrid1 = (DataGrid) source; + DataGrid1.EditItemIndex = e.Item.ItemIndex; + DataGrid1.DataBind (); + } + + public static void DataGrid1_DeleteCommand (object source, DataGridCommandEventArgs e) + { + DataGrid DataGrid1 = (DataGrid) source; + MyDataSource ds = new MyDataSource (); + ds.DeleteItem (e.Item.DataSetIndex); + DataGrid1.DataBind (); + } + + public static void DataGrid1_UpdateCommand (object source, DataGridCommandEventArgs e) + { + DataGrid DataGrid1 = (DataGrid) source; + MyDataSource ds = new MyDataSource (); + TextBox edittedName = (TextBox) e.Item.Cells [1].Controls [0]; + ds.UpdateItem (e.Item.DataSetIndex, Int32.Parse (e.Item.Cells [0].Text), edittedName.Text); + DataGrid1.EditItemIndex = -1; + DataGrid1.DataBind (); + } + + public static void DataGrid1_CancelCommand (object source, DataGridCommandEventArgs e) + { + DataGrid DataGrid1 = (DataGrid) source; + DataGrid1.EditItemIndex = -1; + DataGrid1.DataBind (); + } + + public class MyDataSource + { + private static ArrayList _data; + + static MyDataSource () + { + Init (); + } + + public static void Init () + { + _data = new ArrayList (); + _data.Add (new MyDataItem (1, "heh1", "Comment 1")); + _data.Add (new MyDataItem (2, "heh2", "Comment 2")); + _data.Add (new MyDataItem (3, "heh3", "Comment 3")); + _data.Add (new MyDataItem (4, "heh4", "Comment 4")); + _data.Add (new MyDataItem (5, "heh5", "Comment 5")); + _data.Add (new MyDataItem (6, "heh6", "Comment 6")); + _data.Add (new MyDataItem (7, "heh7", "Comment 7")); + _data.Add (new MyDataItem (8, "heh8", "Comment 8")); + _data.Add (new MyDataItem (9, "heh9", "Comment 9")); + _data.Add (new MyDataItem (10, "heh10", "Comment 10")); + } + + public MyDataSource () + { + } + + public ArrayList GetAllItems () + { + return _data; + } + + public int GetCount () + { + return _data.Count; + } + + public void UpdateItem (int itemIndex, int id, string name) + { + if (itemIndex >= 0 && itemIndex < _data.Count) { + MyDataItem item = (MyDataItem) _data [itemIndex]; + item.Name = name; + return; + } + } + + public void DeleteItem (int p) + { + _data.RemoveAt (p); + } + } + + public class MyDataItem + { + int _id = 0; + string _name = ""; + string _comment = ""; + + public MyDataItem (int id, string name, string comment) + { + _id = id; + _name = name; + _comment = comment; + } + + public int ID { + get { return _id; } + } + + public string Name { + get { return _name; } + set { _name = value; } + } + + public string Comment { + get { return _comment; } + set { _comment = value; } + } + } + + + class MyTemplate : ITemplate { + string text; + public MyTemplate (string text) + { + this.text = text; + } + + public void InstantiateIn (Control control) + { + control.Controls.Add (new LiteralControl (text)); + } + } + + [Test] + public void OneTemplateColumn1 () + { + DataGridPoker p = new DataGridPoker (); + TemplateColumn tc = new TemplateColumn (); + tc.ItemTemplate = new MyTemplate ("hola"); + p.Columns.Add (tc); + ControlCollection controls = p.Controls; + p.CreateControls (true); + Assert.AreEqual (1, p.Columns.Count, "columns"); + Assert.AreEqual (0, controls.Count, "controls"); + string render = p.Render (); + // no items, even with a templated column. + // The table is not added if DataSource == null + Assert.IsTrue (-1 == render.IndexOf ("hola"), "template"); + } + + [Test] + public void OneTemplateColumn2 () + { + DataGridPoker p = new DataGridPoker (); + p.ShowFooter = true; + p.AutoGenerateColumns = false; + p.DataSource = new ArrayList (); + TemplateColumn tc = new TemplateColumn (); + tc.HeaderText = " "; + tc.FooterTemplate = new MyTemplate ("hola"); + p.Columns.Add (tc); + Assert.AreEqual (1, p.Columns.Count, "columns-1"); + Assert.AreEqual (0, p.Controls.Count, "controls-1"); + p.CreateControls (true); + // This time we have the table there. Thanks to the empty ArrayList + Assert.AreEqual (1, p.Columns.Count, "columns-2"); + Assert.AreEqual (1, p.Controls.Count, "controls-2"); + p.PrepareCH (); + Assert.AreEqual (1, p.Columns.Count, "columns-3"); + Assert.AreEqual (1, p.Controls.Count, "controls-3"); + } + + [Test] + public void OneTemplateColumn3 () + { + DataGridPoker p = new DataGridPoker (); + p.ShowFooter = true; + p.AutoGenerateColumns = false; + p.DataSource = new ArrayList (); + TemplateColumn tc = new TemplateColumn (); + tc.FooterTemplate = new MyTemplate ("hola"); + p.Columns.Add (tc); + p.DataBind (); + + StringWriter sw = new StringWriter (); + HtmlTextWriter tw = new HtmlTextWriter (sw); + Assert.AreEqual (1, p.Columns.Count, "columns"); + Assert.AreEqual (1, p.Controls.Count, "controls"); + + string render = p.Render (); + // no items, but we have a footer + Assert.IsTrue (-1 != render.IndexOf ("hola"), "template"); + } + + // This one throw nullref on MS and works with mono + /* + [Test] + [NUnit.Framework.CategoryAttribute ("NotDotNet")] + public void OneTemplateColumn4 () + { + DataGridPoker p = new DataGridPoker (); + TemplateColumn tc = new TemplateColumn (); + tc.ItemTemplate = new MyTemplate ("hola"); + p.Columns.Add (tc); + p.DataSource = new ArrayList (); + p.CreateControls (false); + Assert.AreEqual (1, p.Columns.Count, "columns"); + // Table added because useDataSource == false... + Assert.AreEqual (1, p.Controls.Count, "controls"); + string render = p.Render (); + // ... but no template rendered. + Assert.IsTrue (-1 == render.IndexOf ("hola"), "template"); + } + */ + + [Test] + public void CreateControls () + { + DataGridPoker p = new DataGridPoker (); + DataTable table = new DataTable (); + + table.Columns.Add (new DataColumn ("one", typeof (string))); + table.Columns.Add (new DataColumn ("two", typeof (string))); + table.Columns.Add (new DataColumn ("three", typeof (string))); + table.Rows.Add (new object [] { "1", "2", "3" }); + + p.DataSource = new DataView (table); + + p.CreateControls (true); + Assert.AreEqual (p.Controls.Count, 1, "A1"); + + ShowControlsRecursive (p.Controls [0], 1); + } + + [Test] + public void CreationEvents () + { + DataGridPoker p = new DataGridPoker (); + DataTable table = new DataTable (); + + table.Columns.Add (new DataColumn ("one", typeof (string))); + table.Columns.Add (new DataColumn ("two", typeof (string))); + table.Columns.Add (new DataColumn ("three", typeof (string))); + + p.DataSource = new DataView (table); + + p.ItemCreated += new DataGridItemEventHandler (ItemCreatedHandler); + p.ItemDataBound += new DataGridItemEventHandler (ItemDataBoundHandler); + + // No items added yet + ResetEvents (); + p.CreateControls (true); + Assert.IsTrue (item_created, "A1"); + Assert.IsTrue (item_data_bound, "A2"); + + table.Rows.Add (new object [] { "1", "2", "3" }); + + ResetEvents (); + p.CreateControls (true); + Assert.IsTrue (item_created, "A3"); + Assert.IsTrue (item_data_bound, "A4"); + + // no databinding + ResetEvents (); + p.CreateControls (false); + Assert.IsTrue (item_created, "A5"); + Assert.IsFalse (item_data_bound, "A6"); + } + + [Test] + public void InitializePager () + { + DataGridPoker p = new DataGridPoker (); + PagedDataSource paged = new PagedDataSource (); + DataTable table = new DataTable (); + DataGridItem item = new DataGridItem (-1, -1, ListItemType.Pager); + ArrayList columns; + LinkButton next; + LinkButton prev; + + table.Columns.Add (new DataColumn ("one", typeof (string))); + table.Columns.Add (new DataColumn ("two", typeof (string))); + table.Columns.Add (new DataColumn ("three", typeof (string))); + + for (int i = 0; i < 25; i++) + table.Rows.Add (new object [] { "1", "2", "3" }); + paged.DataSource = new DataView (table); + + columns = p.CreateColumns (paged, true); + p.InitPager (item, columns.Count, paged); + + // + // No where to go + // + + Assert.AreEqual (item.Controls.Count, 1, "A1"); + Assert.AreEqual (item.Controls [0].GetType (), typeof (TableCell), "A2"); + Assert.AreEqual (item.Controls [0].Controls.Count, 3, "A3"); + Assert.AreEqual (item.Controls [0].Controls [0].GetType (), typeof (Label), "A4"); + Assert.AreEqual (item.Controls [0].Controls [1].GetType (), + typeof (LiteralControl), "A5"); + Assert.AreEqual (item.Controls [0].Controls [2].GetType (), typeof (Label), "A6"); + Assert.AreEqual (((Label) item.Controls [0].Controls [0]).Text, "<", "A7"); + Assert.AreEqual (((LiteralControl) item.Controls [0].Controls [1]).Text, + " ", "A7"); + Assert.AreEqual (((Label) item.Controls [0].Controls [2]).Text, ">", "A8"); + + // + // Next + // + + item = new DataGridItem (-1, -1, ListItemType.Pager); + paged.PageSize = 5; + paged.VirtualCount = 25; + paged.AllowPaging = true; + p.InitPager (item, columns.Count, paged); + + Assert.AreEqual (item.Controls.Count, 1, "A9"); + Assert.AreEqual (item.Controls [0].GetType (), typeof (TableCell), "A10"); + Assert.AreEqual (item.Controls [0].Controls.Count, 3, "A11"); + Assert.AreEqual (item.Controls [0].Controls [0].GetType (), typeof (Label), "A12"); + Assert.AreEqual (item.Controls [0].Controls [1].GetType (), + typeof (LiteralControl), "A13"); + Assert.AreEqual (((Label) item.Controls [0].Controls [0]).Text, "<", "A14"); + Assert.AreEqual (((LiteralControl) item.Controls [0].Controls [1]).Text, + " ", "A16"); + + next = (LinkButton) item.Controls [0].Controls [2]; + Assert.AreEqual (next.Text, ">", "A17"); + Assert.AreEqual (next.CommandName, "Page", "A18"); + Assert.AreEqual (next.CommandArgument, "Next", "A19"); + + + // + // Both + // + + item = new DataGridItem (-1, -1, ListItemType.Pager); + paged.PageSize = 5; + paged.VirtualCount = 25; + paged.AllowPaging = true; + paged.CurrentPageIndex = 2; + p.InitPager (item, columns.Count, paged); + + Assert.AreEqual (item.Controls.Count, 1, "A20"); + Assert.AreEqual (item.Controls [0].GetType (), typeof (TableCell), "A21"); + Assert.AreEqual (item.Controls [0].Controls.Count, 3, "A22"); + Assert.AreEqual (item.Controls [0].Controls [1].GetType (), + typeof (LiteralControl), "A23"); + Assert.AreEqual (((LiteralControl) item.Controls [0].Controls [1]).Text, + " ", "A24"); + + // This is failing with an invalidcast right now. It's something related to + // the pager thinking that it's on the last page and rendering a label instead + next = (LinkButton) item.Controls [0].Controls [2]; + Assert.AreEqual (next.Text, ">", "A25"); + Assert.AreEqual (next.CommandName, "Page", "A26"); + Assert.AreEqual (next.CommandArgument, "Next", "A27"); + + prev = (LinkButton) item.Controls [0].Controls [0]; + Assert.AreEqual (prev.Text, "<", "A28"); + Assert.AreEqual (prev.CommandName, "Page", "A29"); + Assert.AreEqual (prev.CommandArgument, "Prev", "A30"); + + // + // Back only + // + + item = new DataGridItem (-1, -1, ListItemType.Pager); + paged.PageSize = 5; + paged.VirtualCount = 25; + paged.AllowPaging = true; + paged.CurrentPageIndex = 4; + p.InitPager (item, columns.Count, paged); + + Assert.AreEqual (item.Controls.Count, 1, "A31"); + Assert.AreEqual (item.Controls [0].GetType (), typeof (TableCell), "A32"); + Assert.AreEqual (item.Controls [0].Controls.Count, 3, "A33"); + Assert.AreEqual (item.Controls [0].Controls [1].GetType (), + typeof (LiteralControl), "A34"); + Assert.AreEqual (item.Controls [0].Controls [2].GetType (), typeof (Label), "A35"); + Assert.AreEqual (((LiteralControl) item.Controls [0].Controls [1]).Text, + " ", "A36"); + Assert.AreEqual (((Label) item.Controls [0].Controls [2]).Text, ">", "A37"); + + prev = (LinkButton) item.Controls [0].Controls [0]; + Assert.AreEqual (prev.Text, "<", "A38"); + Assert.AreEqual (prev.CommandName, "Page", "A39"); + Assert.AreEqual (prev.CommandArgument, "Prev", "A40"); + + } + + [Conditional ("VERBOSE_DATAGRID")] + private void ShowControlsRecursive (Control c, int depth) + { + for (int i = 0; i < depth; i++) + Console.Write ("-"); + + // StringWriter sw = new StringWriter (); + // HtmlTextWriter tw = new HtmlTextWriter (sw); + + // c.RenderControl (tw); + // Console.WriteLine (sw.ToString ()); + + Console.WriteLine (c); + + foreach (Control child in c.Controls) + ShowControlsRecursive (child, depth + 5); + } + + [Test] + public void Render () + { + DataGridPoker p = new DataGridPoker (); + + Assert.AreEqual (p.Render (), String.Empty, "A1"); + } + + Control FindByType (Control parent, Type type) + { + if (!parent.HasControls ()) + return null; + + foreach (Control c in parent.Controls) { + if (type.IsAssignableFrom (c.GetType ())) + return c; + + Control ret = FindByType (c, type); + if (ret != null) + return ret; + } + return null; + } + + // Header link + [Test] + public void SpecialLinkButton1 () + { + DataTable dt = new DataTable(); + dt.Columns.Add (new DataColumn("something", typeof(Int32))); + DataRow dr = dt.NewRow (); + dt.Rows.Add (new object [] { 1 }); + DataView dv = new DataView (dt); + DataGridPoker dg = new DataGridPoker (); + dg.AllowSorting = true; + dg.HeaderStyle.Font.Bold = true; + dg.HeaderStyle.ForeColor = Color.FromArgb (255,255,255,255); + dg.HeaderStyle.BackColor = Color.FromArgb (33,33,33,33); + dg.DataSource = dv; + dg.DataBind (); + LinkButton lb = (LinkButton) FindByType (dg.Controls [0], typeof (LinkButton)); + Assert.IsNotNull (lb, "lb"); + StringWriter sr = new StringWriter (); + HtmlTextWriter output = new HtmlTextWriter (sr); + // Nothing here... + Assert.AreEqual (Color.Empty, lb.ControlStyle.ForeColor, "fore"); + lb.RenderControl (output); + // Nothing here... + Assert.AreEqual (Color.Empty, lb.ControlStyle.ForeColor, "fore2"); + dg.Render (); + // Surprise! after rendering the datagrid, the linkbutton has the ForeColor from the datagrid + Assert.AreEqual (Color.FromArgb (255,255,255,255), lb.ControlStyle.ForeColor, "fore3"); + + // Extra. Items != empty + Assert.AreEqual (1, dg.Items.Count, "itemCount"); + } + + // value link in buttoncolumn + [Test] + public void SpecialLinkButton2 () + { + DataTable dt = new DataTable(); + dt.Columns.Add (new DataColumn("string_col", typeof(string))); + DataRow dr = dt.NewRow (); + dt.Rows.Add (new object [] { "Item 1" }); + DataView dv = new DataView (dt); + + DataGridPoker dg = new DataGridPoker (); + dg.DataSource = dv; + dg.AutoGenerateColumns = false; + dg.HeaderStyle.ForeColor = Color.FromArgb (255,255,255,255); + dg.HeaderStyle.BackColor = Color.FromArgb (33,33,33,33); + + ButtonColumn bc = new ButtonColumn (); + bc.HeaderText = "Some header"; + bc.DataTextField = "string_col"; + bc.CommandName = "lalala"; + dg.Columns.Add (bc); + + BoundColumn bound = new BoundColumn (); + bound.HeaderText = "The other column"; + bound.DataField = "string_col"; + dg.Columns.Add (bound); + + dg.DataBind (); + + LinkButton lb = (LinkButton) FindByType (dg.Controls [0], typeof (LinkButton)); + Assert.IsNotNull (lb, "lb"); + StringWriter sr = new StringWriter (); + HtmlTextWriter output = new HtmlTextWriter (sr); + Assert.AreEqual (Color.Empty, lb.ControlStyle.ForeColor, "fore"); + lb.RenderControl (output); + Assert.AreEqual (Color.Empty, lb.ControlStyle.ForeColor, "fore2"); + string str = dg.Render (); + Assert.IsTrue (-1 != str.IndexOf ("Item 1"), "item1"); + Assert.IsTrue (-1 != str.IndexOf ("Item 1"), "item1-2"); + } + } +} + diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridTest.cs.REMOVED.git-id b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridTest.cs.REMOVED.git-id deleted file mode 100644 index 79e2e1a6be..0000000000 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataGridTest.cs.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -1e1daa9a8a28a4f12bc766e426f50b17ce6bf6ae \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataKeyTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataKeyTest.cs index e34fa9b64f..9b34ea9568 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataKeyTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataKeyTest.cs @@ -67,7 +67,6 @@ namespace MonoTests.System.Web.UI.WebControls Assert.AreEqual (2, iDictionary.Count, "AllValuesReferringToKey#1"); Assert.AreEqual ("value1", iDictionary[1], "ValueReferringToKey#1"); } -#if NET_4_0 [Test] public void DataKey_Equals () { @@ -229,6 +228,5 @@ namespace MonoTests.System.Web.UI.WebControls Assert.IsFalse (key1.Equals (key2), "#A17-1"); Assert.IsFalse (key2.Equals (key1), "#A17-2"); } -#endif } } diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListItemTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListItemTest.cs index af110da16a..25684a24f8 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListItemTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListItemTest.cs @@ -241,17 +241,10 @@ namespace MonoTests.System.Web.UI.WebControls { [Test] public void Controls_Table () { -#if NET_4_0 string origHtml1 = "\n\tmono\n"; string origHtml2 = "\n\tmono\n"; string origHtml3 = "\n\t\n\t\t\n\t\n
mono
"; string origHtml4 = "\n\t\n\t\t\n\t\n
mono
"; -#else - string origHtml1 = "\n\tmono\n"; - string origHtml2 = "\n\tmono\n"; - string origHtml3 = "\n\t\n\t\t\n\t\n
mono
"; - string origHtml4 = "\n\t\n\t\t\n\t\n
mono
"; -#endif TestDataListItem dli = new TestDataListItem (0, ListItemType.Item); dli.Controls.Add (GetTable ("mono")); @@ -271,17 +264,10 @@ namespace MonoTests.System.Web.UI.WebControls { [Test] public void Controls_Table_Dual () { -#if NET_4_0 string origHtml1 = "\n\tmono\n"; string origHtml2 = "\n\tmono\n"; string origHtml3 = "\n\t\n\t\t\n\t\n
mono
\n\t\n\t\t\n\t\n
monkey
"; string origHtml4 = "\n\t\n\t\t\n\t\n
mono
\n\t\n\t\t\n\t\n
monkey
"; -#else - string origHtml1 = "\n\tmono\n"; - string origHtml2 = "\n\tmono\n"; - string origHtml3 = "\n\t\n\t\t\n\t\n
mono
\n\t\n\t\t\n\t\n
monkey
"; - string origHtml4 = "\n\t\n\t\t\n\t\n
mono
\n\t\n\t\t\n\t\n
monkey
"; -#endif TestDataListItem dli = new TestDataListItem (0, ListItemType.Item); dli.Controls.Add (GetTable ("mono")); dli.Controls.Add (GetTable ("monkey")); @@ -315,7 +301,6 @@ namespace MonoTests.System.Web.UI.WebControls { Assert.AreEqual ("mono", dli.Render (false, true), "Render-Empty-F-T"); Assert.AreEqual ("mono", dli.Render (false, false), "Render-Empty-F-F"); } -#if NET_4_0 [Test] public void SupportsDisabledAttribute () { @@ -329,6 +314,5 @@ namespace MonoTests.System.Web.UI.WebControls { Assert.AreEqual (ver35, p.RenderingCompatibility, "#A2-1"); Assert.IsTrue (p.SupportsDisabledAttribute, "#A2-2"); } -#endif } } diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListTest.cs index 54ae69e334..9e61762f00 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataListTest.cs @@ -322,7 +322,6 @@ namespace MonoTests.System.Web.UI.WebControls { Assert.AreEqual (0, dl.Attributes.Count, "Attributes.Count-2"); } -#if NET_4_0 [Test] public void RepeatLayout_Lists () { @@ -336,7 +335,6 @@ namespace MonoTests.System.Web.UI.WebControls { dl.RepeatLayout = RepeatLayout.UnorderedList; }, "#A2"); } -#endif [Test] public void CleanProperties () { diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataSourceControlTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataSourceControlTest.cs index af5e33c80e..e6a55f8f67 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataSourceControlTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DataSourceControlTest.cs @@ -76,11 +76,7 @@ namespace MonoTests.System.Web.UI.WebControls public void DataSourceControl_DefaultProperty () { PokerDataSource ds = new PokerDataSource (); -#if NET_4_0 Assert.AreEqual (String.Empty, ds.ClientID, "ClientID"); -#else - Assert.AreEqual (null, ds.ClientID, "ClientID"); -#endif Assert.IsNotNull (ds.Controls, "Controls#1"); Assert.AreEqual ( 0 , ds.Controls.Count , "Controls#2"); Assert.AreEqual (false, ds.Visible, "Visible"); diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewTest.cs.REMOVED.git-id b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewTest.cs.REMOVED.git-id index 8cbe197e30..0db1f6a047 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewTest.cs.REMOVED.git-id +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewTest.cs.REMOVED.git-id @@ -1 +1 @@ -5813d894d5739d2826a5f32486fa6c849c81cddc \ No newline at end of file +12a7ab9e97bc4ad43efdca1e7f12435ee44c417c \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/EditCommandColumnTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/EditCommandColumnTest.cs index 5b2987fb5e..85072013f6 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/EditCommandColumnTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/EditCommandColumnTest.cs @@ -121,11 +121,7 @@ namespace MonoTests.System.Web.UI.WebControls [Test] public void InitializeCell () { -#if NET_4_0 string origHtml = "
  onetwothree
Edit123
     
"; -#else - string origHtml = "
  onetwothree
Edit123
     
"; -#endif DataGridTest p = new DataGridTest (); DataTable table = new DataTable (); EditCommandColumn e; @@ -170,11 +166,7 @@ namespace MonoTests.System.Web.UI.WebControls [Test] public void ThisIsADGTest () { -#if NET_4_0 string origHtml = "
  onetwothree
Edit123
     
"; -#else - string origHtml = "
  onetwothree
Edit123
     
"; -#endif DataGridTest p = new DataGridTest (); DataTable table = new DataTable (); EditCommandColumn e; @@ -228,11 +220,7 @@ namespace MonoTests.System.Web.UI.WebControls [Test] public void InitializeEditCell () { -#if NET_4_0 string origHtml = "
  onetwothree
Update Cancel 
     
"; -#else - string origHtml = "
  onetwothree
Update Cancel 
     
"; -#endif DataGridTest p = new DataGridTest (); DataTable table = new DataTable (); EditCommandColumn e; diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs new file mode 100644 index 0000000000..33bb4b6d09 --- /dev/null +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs @@ -0,0 +1,2628 @@ +// +// Tests for System.Web.UI.WebControls.FormView.cs +// +// Author: +// Chris Toshok (toshok@ximian.com) +// + +// +// Copyright (C) 2005 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +using NUnit.Framework; +using System; +using System.Data; +using System.IO; +using System.Drawing; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Globalization; +using System.Web; +using System.Web.UI; +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; +using MonoTests.SystemWeb.Framework; +using MonoTests.stand_alone.WebHarness; +using System.Text.RegularExpressions; +using System.Reflection; +using System.Threading; + + + +namespace MonoTests.System.Web.UI.WebControls +{ + [TestFixture] + public class FormViewTest { + + public class DataSourceObject + { + public static List GetList (string sortExpression, int startRowIndex, int maximumRows) { + return GetList (); + } + + public static List GetList (int startRowIndex, int maximumRows) { + return GetList (); + } + + public static List GetList (string sortExpression) { + return GetList (); + } + + public static List GetList () { + List list = new List (); + list.Add ("Norway"); + list.Add ("Sweden"); + list.Add ("France"); + list.Add ("Italy"); + list.Add ("Israel"); + list.Add ("Russia"); + return list; + } + + public static int GetCount () { + return GetList ().Count; + } + } + + public class DS : ObjectDataSource + { + public static List GetList () + { + List list = new List (); + list.Add ("Norway"); + list.Add ("Sweden"); + list.Add ("France"); + list.Add ("Italy"); + list.Add ("Israel"); + list.Add ("Russia"); + return list; + } + + public void DoRaiseDataSourceChangedEvent (EventArgs e) + { + RaiseDataSourceChangedEvent (e); + } + } + + public class Poker : FormView { + public bool isInitializePager=false; + public bool ensureDataBound=false; + public bool controlHierarchy=false; + bool _onPageIndexChangingCalled = false; + bool _onPageIndexChangedCalled = false; + + public Poker () { + TrackViewState (); + } + + public object SaveState () { + return SaveViewState (); + } + + public void LoadState (object state) { + LoadViewState (state); + + } + + public HtmlTextWriterTag PokerTagKey + { + get { return base.TagKey; } + } + + public int DoCreateChildControls (IEnumerable source,bool dataBind) + { + return CreateChildControls (source, dataBind); + + } + + public Style DoCreateControlStyle () + { + return base.CreateControlStyle (); + } + + public DataSourceSelectArguments DoCreateDataSourceSelectArguments () + { + return CreateDataSourceSelectArguments (); + } + + public DataSourceView DoGetData () + { + return GetData (); + } + + public FormViewRow DoCreateRow (int itemIndex,DataControlRowType rowType,DataControlRowState rowState) + { + return CreateRow( itemIndex, rowType,rowState); + } + + public Table DoCreateTable () + { + return CreateTable (); + } + + protected override void EnsureDataBound () + { + base.EnsureDataBound (); + ensureDataBound = true; + } + + public void DoExtractRowValues (IOrderedDictionary filedValues, bool includeKeys) + { + base.ExtractRowValues (filedValues, includeKeys); + + } + + public bool IsRequiresDataBinding () + { + return base.RequiresDataBinding; + } + + protected override void InitializePager (FormViewRow row, PagedDataSource pageData) + { + base.InitializePager (row, pageData); + isInitializePager = true; + } + + public void DoInitializeRow (FormViewRow row) + { + InitializeRow (row); + } + public void DoLoadControlState (object savedState) + { + LoadControlState (savedState); + } + + public void DoLoadViewState (object savedState) + { + LoadViewState (savedState); + } + + public bool DoOnBubbleEvent (object source, EventArgs e) + { + return OnBubbleEvent (source, e); + } + + public void DoOnInit (EventArgs e) + { + OnInit (e); + } + + public void DoOnItemCommand (FormViewCommandEventArgs e) + { + OnItemCommand (e); + } + + public void DoOnItemCreated (EventArgs e) + { + OnItemCreated (e); + } + + public void DoOnItemDeleted (FormViewDeletedEventArgs e) + { + OnItemDeleted (e); + } + + public void DoOnItemDeleting (FormViewDeleteEventArgs e) + { + OnItemDeleting (e); + } + + public void DoOnItemInserted (FormViewInsertedEventArgs e) + { + OnItemInserted (e); + } + + public void DoOnItemInserting (FormViewInsertEventArgs e) + { + OnItemInserting (e); + } + + public void DoOnItemUpdated (FormViewUpdatedEventArgs e) + { + OnItemUpdated (e); + } + + public void DoOnItemUpdating (FormViewUpdateEventArgs e) + { + OnItemUpdating (e); + } + + public void DoOnModeChanged (EventArgs e ) + { + OnModeChanged (e); + } + + public void DoOnModeChanging (FormViewModeEventArgs e) + { + OnModeChanging (e); + } + + public void DoOnPageIndexChanged (EventArgs e) + { + OnPageIndexChanged (e); + } + + public void DoOnPageIndexChanging (FormViewPageEventArgs e) + { + OnPageIndexChanging (e); + } + + public void DoPerformDataBinding (IEnumerable data) + { + PerformDataBinding (data); + } + + protected internal override void PrepareControlHierarchy () + { + + base.PrepareControlHierarchy (); + controlHierarchy = true; + } + + public void DoRaisePostBackEvent (string eventArgument) + { + RaisePostBackEvent (eventArgument); + } + + public string Render () + { + + StringWriter sw = new StringWriter (); + HtmlTextWriter tw = new HtmlTextWriter (sw); + Render (tw); + return sw.ToString (); + + } + + + + public object DoSaveControlState () + { + return SaveControlState (); + } + + + + public void DoConfirmInitState () + { + base.ConfirmInitState (); + } + + public void DoOnPreRender (EventArgs e) + { + base.OnPreRender (e); + } + + public void DoOnDataBinding (EventArgs e) + { + base.OnDataBinding (e); + } + public void DoOnDataBound (EventArgs e) + { + base.OnDataBound (e); + } + + public bool OnPageIndexChangingCalled { + set { _onPageIndexChangingCalled = value; } + get { return _onPageIndexChangingCalled; } + } + + public bool OnPageIndexChangedCalled { + set { _onPageIndexChangedCalled = value; } + get { return _onPageIndexChangedCalled; } + } + + protected override void OnPageIndexChanging (FormViewPageEventArgs e) { + OnPageIndexChangingCalled = true; + base.OnPageIndexChanging (e); + } + + protected override void OnPageIndexChanged (EventArgs e) { + OnPageIndexChangedCalled = true; + base.OnPageIndexChanged (e); + } + + public bool GetRequiresDataBinding () { + return RequiresDataBinding; + } + public bool GetInitialized () { + return Initialized; + } + public string CallModifiedOuterTableStylePropertyName () + { + return ModifiedOuterTableStylePropertyName (); + } + } + + class Template : ITemplate + { + bool _instantiated; + + public bool Instantiated { + get { return _instantiated; } + } + +#region ITemplate Members + + public void InstantiateIn (Control container) { + _instantiated = true; + } + + #endregion + } + + + ArrayList myds = new ArrayList (); + [TestFixtureSetUp] + public void setup () + { + TestMyData.InitData(); + myds.Add ("Item1"); + myds.Add ("Item2"); + myds.Add ("Item3"); + myds.Add ("Item4"); + myds.Add ("Item5"); + myds.Add ("Item6"); + + WebTest.CopyResource (GetType (), "FormView.aspx", "FormView.aspx"); + WebTest.CopyResource (GetType (), "FormViewTest1.aspx", "FormViewTest1.aspx"); + WebTest.CopyResource (GetType (), "FormViewTest1_2.aspx", "FormViewTest1_2.aspx"); + WebTest.CopyResource (GetType (), "FormViewTest1_3.aspx", "FormViewTest1_3.aspx"); + WebTest.CopyResource (GetType (), "FormViewTest1_4.aspx", "FormViewTest1_4.aspx"); + WebTest.CopyResource (GetType (), "FormViewInsertEditDelete.aspx", "FormViewInsertEditDelete.aspx"); + WebTest.CopyResource (GetType (), "FormViewPagerVisibility.aspx", "FormViewPagerVisibility.aspx"); + } + + [Test] + public void Defaults () + { + Poker p = new Poker (); + Assert.IsFalse (p.AllowPaging, "A1"); + Assert.AreEqual ("", p.BackImageUrl, "A2"); + Assert.IsNull (p.BottomPagerRow, "A3"); + Assert.AreEqual ("", p.Caption, "A4"); + Assert.AreEqual (TableCaptionAlign.NotSet, p.CaptionAlign, "A5"); + Assert.AreEqual (-1, p.CellPadding, "A6"); + Assert.AreEqual (0, p.CellSpacing, "A7"); + Assert.AreEqual (FormViewMode.ReadOnly, p.CurrentMode, "A8"); + Assert.AreEqual (FormViewMode.ReadOnly, p.DefaultMode, "A9"); + Assert.IsNotNull (p.DataKeyNames, "A10"); + Assert.AreEqual (0, p.DataKeyNames.Length, "A10.1"); + Assert.IsNotNull (p.DataKey, "A11"); + Assert.AreEqual (0, p.DataKey.Values.Count, "A11.1"); + Assert.IsNull (p.EditItemTemplate, "A12"); + Assert.IsNotNull (p.EditRowStyle, "A13"); + Assert.IsNotNull (p.EmptyDataRowStyle, "A14"); + Assert.IsNull (p.EmptyDataTemplate, "A15"); + Assert.AreEqual ("", p.EmptyDataText, "A16"); + Assert.IsNull (p.FooterRow, "A17"); + Assert.IsNull (p.FooterTemplate, "A18"); + Assert.AreEqual ("", p.FooterText, "A19"); + Assert.IsNotNull (p.FooterStyle, "A20"); + Assert.AreEqual (GridLines.None, p.GridLines, "A21"); + Assert.IsNull (p.HeaderRow, "A22"); + Assert.IsNotNull (p.HeaderStyle, "A23"); + Assert.IsNull (p.HeaderTemplate, "A24"); + Assert.AreEqual ("", p.HeaderText, "A25"); + Assert.AreEqual (HorizontalAlign.NotSet, p.HorizontalAlign, "A26"); + Assert.IsNull (p.InsertItemTemplate, "A27"); + Assert.IsNotNull (p.InsertRowStyle, "A28"); + Assert.IsNull (p.ItemTemplate, "A29"); + Assert.AreEqual (0, p.PageCount, "A30"); + Assert.AreEqual (0, p.PageIndex, "A31"); + Assert.IsNull (p.PagerTemplate, "A32"); + Assert.IsNull (p.Row, "A33"); + Assert.IsNotNull (p.RowStyle, "A34"); + Assert.IsNull (p.SelectedValue, "A35"); + Assert.IsNull (p.TopPagerRow, "A36"); + Assert.IsNull (p.DataItem, "A37"); + Assert.AreEqual (0, p.DataItemCount, "A38"); + Assert.AreEqual (0, p.DataItemIndex, "A39"); + } + + [Test] + public void FormView_AssignToDefaultProperties () + { + Poker p = new Poker (); + MyTemplate customTemplate = new MyTemplate (); + TableItemStyle tableStyle = new TableItemStyle (); + p.AllowPaging = true; + Assert.AreEqual (true, p.AllowPaging, "A40"); + p.BackImageUrl = "image.jpg"; + Assert.AreEqual ("image.jpg", p.BackImageUrl, "A41"); + // ToDo: p.BottomPagerRow + p.Caption = "Employee Details"; + Assert.AreEqual ("Employee Details", p.Caption, "A42"); + p.CaptionAlign = TableCaptionAlign.Bottom; + Assert.AreEqual (TableCaptionAlign.Bottom, p.CaptionAlign, "A43"); + p.CaptionAlign = TableCaptionAlign.Left; + Assert.AreEqual (TableCaptionAlign.Left, p.CaptionAlign, "A44"); + p.CaptionAlign = TableCaptionAlign.NotSet; + Assert.AreEqual (TableCaptionAlign.NotSet, p.CaptionAlign, "A45"); + p.CaptionAlign = TableCaptionAlign.Right; + Assert.AreEqual (TableCaptionAlign.Right, p.CaptionAlign, "A46"); + p.CaptionAlign = TableCaptionAlign.Top; + Assert.AreEqual (TableCaptionAlign.Top, p.CaptionAlign, "A47"); + p.CellPadding = 10; + Assert.AreEqual (10, p.CellPadding, "A48"); + p.CellSpacing = 20; + Assert.AreEqual (20, p.CellSpacing, "A49"); + Assert.AreEqual (FormViewMode.ReadOnly, p.CurrentMode, "A52"); + p.DefaultMode = FormViewMode.Edit; + Assert.AreEqual (FormViewMode.Edit, p.DefaultMode, "A53"); + p.DefaultMode = FormViewMode.Insert; + Assert.AreEqual (FormViewMode.Insert, p.DefaultMode, "A54"); + p.DefaultMode = FormViewMode.ReadOnly; + Assert.AreEqual (FormViewMode.ReadOnly, p.DefaultMode, "A55"); + p.EditRowStyle.BackColor = Color.Red; + Assert.AreEqual (Color.Red, p.EditRowStyle.BackColor, "A56"); + p.EmptyDataRowStyle.ForeColor = Color.Purple; + Assert.AreEqual (Color.Purple, p.EmptyDataRowStyle.ForeColor, "A57"); + p.EmptyDataTemplate = customTemplate; + Assert.AreEqual (customTemplate, p.EmptyDataTemplate, "A58"); + p.EmptyDataText = "No data"; + Assert.AreEqual ("No data", p.EmptyDataText, "A59"); + p.EditItemTemplate = customTemplate; + Assert.AreEqual (customTemplate, p.EditItemTemplate, "A60"); + p.FooterTemplate = customTemplate; + Assert.AreEqual (customTemplate, p.FooterTemplate, "A61"); + p.FooterText = "Test Footer"; + Assert.AreEqual ("Test Footer", p.FooterText, "A62"); + p.FooterStyle.BorderStyle = BorderStyle.Double; + Assert.AreEqual (BorderStyle.Double, p.FooterStyle.BorderStyle, "A63"); + p.GridLines = GridLines.Both; + Assert.AreEqual (GridLines.Both, p.GridLines, "A64"); + p.GridLines = GridLines.Horizontal; + Assert.AreEqual (GridLines.Horizontal, p.GridLines, "A65"); + p.GridLines = GridLines.None; + Assert.AreEqual (GridLines.None, p.GridLines, "A66"); + p.GridLines = GridLines.Vertical; + Assert.AreEqual (GridLines.Vertical, p.GridLines, "A67"); + p.HeaderStyle.HorizontalAlign = HorizontalAlign.Left; + Assert.AreEqual (HorizontalAlign.Left, p.HeaderStyle.HorizontalAlign, "A68"); + p.HeaderTemplate = customTemplate; + Assert.AreEqual (customTemplate, p.HeaderTemplate, "A69"); + p.HeaderText = "Test Header"; + Assert.AreEqual ("Test Header", p.HeaderText, "A70"); + p.HorizontalAlign = HorizontalAlign.Center; + Assert.AreEqual (HorizontalAlign.Center, p.HorizontalAlign, "A71"); + p.HorizontalAlign = HorizontalAlign.Justify; + Assert.AreEqual (HorizontalAlign.Justify, p.HorizontalAlign, "A72"); + p.HorizontalAlign = HorizontalAlign.Left; + Assert.AreEqual (HorizontalAlign.Left, p.HorizontalAlign, "A73"); + p.HorizontalAlign = HorizontalAlign.NotSet; + Assert.AreEqual (HorizontalAlign.NotSet, p.HorizontalAlign, "A74"); + p.HorizontalAlign = HorizontalAlign.Right; + Assert.AreEqual (HorizontalAlign.Right, p.HorizontalAlign, "A75"); + p.InsertItemTemplate = customTemplate; + Assert.AreEqual (customTemplate, p.InsertItemTemplate, "A76"); + p.InsertRowStyle.BorderStyle = BorderStyle.Outset; + Assert.AreEqual (BorderStyle.Outset, p.InsertRowStyle.BorderStyle, "A77"); + p.ItemTemplate = customTemplate; + Assert.AreEqual (customTemplate, p.ItemTemplate, "A78"); + p.PagerSettings.FirstPageText = "PagerSettings Test"; + Assert.AreEqual ("PagerSettings Test", p.PagerSettings.FirstPageText, "A79"); + p.PagerStyle.BorderStyle = BorderStyle.Groove; + Assert.AreEqual (BorderStyle.Groove, p.PagerStyle.BorderStyle, "A80"); + p.PagerTemplate = customTemplate; + Assert.AreEqual (customTemplate, p.PagerTemplate, "A81"); + p.RowStyle.ForeColor = Color.Plum; + Assert.AreEqual (Color.Plum, p.RowStyle.ForeColor, "A82"); + } + + [Test] + public void FormView_PageIndex () + { + Poker p = new Poker (); + Assert.AreEqual (0, p.PageIndex, "#00"); + Assert.AreEqual (false, p.GetInitialized (), "#01"); + Assert.AreEqual (false, p.GetRequiresDataBinding(), "#02"); + p.PageIndex = 2; + Assert.AreEqual (2, p.PageIndex, "#03"); + Assert.AreEqual (false, p.GetRequiresDataBinding (), "#04"); + p.PageIndex = -1; + Assert.AreEqual (2, p.PageIndex, "#05"); + Assert.AreEqual (false, p.GetRequiresDataBinding (), "#06"); + } + + [Test] + [Category ("NunitWeb")] + public void FormView_PageIndex2 () + { + PageDelegates delegates = new PageDelegates (); + delegates.Load = FormView_PageIndex2_load; + delegates.LoadComplete = FormView_PageIndex2_loadComplete; + PageInvoker invoker = new PageInvoker (delegates); + WebTest test = new WebTest (invoker); + test.Run (); + } + + public static void FormView_PageIndex2_load (Page p) + { + Poker fv = new Poker (); + p.Form.Controls.Add (fv); + Assert.AreEqual (0, fv.PageIndex, "#00"); + Assert.AreEqual (false, fv.GetInitialized (), "#01"); + Assert.AreEqual (false, fv.GetRequiresDataBinding (), "#02"); + fv.PageIndex = 2; + Assert.AreEqual (2, fv.PageIndex, "#03"); + Assert.AreEqual (false, fv.GetRequiresDataBinding (), "#04"); + fv.PageIndex = -1; + Assert.AreEqual (2, fv.PageIndex, "#05"); + Assert.AreEqual (false, fv.GetRequiresDataBinding (), "#06"); + } + + public static void FormView_PageIndex2_loadComplete (Page p) + { + Poker fv = new Poker (); + p.Form.Controls.Add (fv); + Assert.AreEqual (0, fv.PageIndex, "#100"); + Assert.AreEqual (true, fv.GetInitialized (), "#101"); + Assert.AreEqual (true, fv.GetRequiresDataBinding (), "#102"); + fv.PageIndex = 2; + Assert.AreEqual (2, fv.PageIndex, "#103"); + Assert.AreEqual (true, fv.GetRequiresDataBinding (), "#104"); + fv.PageIndex = -1; + Assert.AreEqual (2, fv.PageIndex, "#105"); + Assert.AreEqual (true, fv.GetRequiresDataBinding (), "#106"); + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void FormView_PageIndex_Ex () + { + Poker p = new Poker (); + p.PageIndex = -2; + } + + [Test] + public void FormView_ItemsProperties () + { + Poker p = new Poker (); + p.Page = new Page (); + p.AllowPaging = true; + p.DataSource = myds; + p.DataBind (); + //Assert.AreEqual (typeof (FormViewPagerRow), (p.BottomPagerRow).GetType (), "BottomPagerRow1"); + Assert.AreEqual (0, p.BottomPagerRow.ItemIndex, "BottomPagerRow2"); + Assert.AreEqual (DataControlRowType.Pager, p.BottomPagerRow.RowType, "BottomPagerRow2"); + Assert.AreEqual ("Item1", p.DataItem, "DataItem"); + Assert.AreEqual (6, p.DataItemCount, "DataItemCount"); + Assert.AreEqual (0, p.DataItemIndex, "DataItemIndex"); + Assert.AreEqual (0, p.DataItemIndex, "DataItemIndex"); + string[] str = new string[] { "1", "2", "3", "4", "5", "6" }; + Assert.AreEqual (typeof (DataKey), p.DataKey.GetType (), "DataKey"); + p.DataKeyNames = str; + Assert.AreEqual (str, p.DataKeyNames, "DataKeyNames"); + p.ChangeMode (FormViewMode.Edit); + Assert.AreEqual (FormViewMode.Edit, p.CurrentMode, "CurrentModeEdit"); + p.ChangeMode (FormViewMode.Insert); + Assert.AreEqual (FormViewMode.Insert, p.CurrentMode, "CurrentModeInsert"); + + } + + [Test] + public void FormView_DefaultProtectedProperties () + { + Poker fv = new Poker (); + Assert.AreEqual (HtmlTextWriterTag.Table, fv.PokerTagKey, "TagKey"); + } + + // Protected methods + + [Test] + public void FormView_CreateChildControls () + { + Poker fv = new Poker (); + fv.DataSource = myds; + fv.Page = new Page (); + Assert.AreEqual (6, fv.DoCreateChildControls (myds, true), "CreateChildControlFromDS"); + myds.Add ("item7"); + Assert.AreEqual (7, fv.DoCreateChildControls (myds, false), "CreateChildControlFromViewState"); + myds.Remove ("item7"); + + } + + class MyEnumSource : IEnumerable + { + int _count; + + public MyEnumSource (int count) { + _count = count; + } + + #region IEnumerable Members + + public IEnumerator GetEnumerator () { + + for (int i = 0; i < _count; i++) + yield return i; + } + + #endregion + } + + [Test] + public void FormView_CreateChildControls2 () + { + Poker fv = new Poker (); + fv.Page = new Page (); + fv.DataSource = new MyEnumSource (20); + fv.DataBind (); + + Assert.AreEqual (20, fv.PageCount, "CreateChildControls#0"); + + Assert.AreEqual (0, fv.DoCreateChildControls (new MyEnumSource (0), true), "CreateChildControls#1"); + Assert.AreEqual (20, fv.DoCreateChildControls (new MyEnumSource (20), true), "CreateChildControls#2"); + + Assert.AreEqual (0, fv.DoCreateChildControls (new object [0], false), "CreateChildControls#3"); + Assert.AreEqual (5, fv.DoCreateChildControls (new object [5], false), "CreateChildControls#4"); + } + + [Test] + public void FormView_CreateDataSourceSelectArguments () + { + //Checks the default DataSourceSelectArgument object returned. + Poker fv = new Poker (); + DataSourceSelectArguments selectArgs = fv.DoCreateDataSourceSelectArguments (); + Assert.AreEqual (0, selectArgs.MaximumRows, "CreateDataSourceSelectArguments1"); + Assert.AreEqual (false, selectArgs.RetrieveTotalRowCount, "CreateDataSourceSelectArguments2"); + + } + + [Test] + public void FormView_CreateControlStyle () + { + Poker fv = new Poker (); + Style s = fv.DoCreateControlStyle (); + Assert.AreEqual (typeof (TableStyle), s.GetType (), "CreateControlStyle1"); + Assert.AreEqual (GridLines.None, ((TableStyle) s).GridLines, "CreateControlStyle2"); + Assert.AreEqual ("", ((TableStyle) s).BackImageUrl, "CreateControlStyle3"); + Assert.AreEqual (0, ((TableStyle) s).CellSpacing, "CreateControlStyle4"); + Assert.AreEqual (-1, ((TableStyle) s).CellPadding, "CreateControlStyle5"); + + } + + [Test] + public void FormView_InitializeRow () + { + //not implemented + } + + [Test] + public void FormView_InitializePager () + { + Poker fv = new Poker (); + Page page = new Page (); + page.Controls.Add (fv); + fv.AllowPaging = true; + fv.DataSource = myds; + Assert.AreEqual (false, fv.isInitializePager, "BeforeInitializePager"); + Assert.AreEqual (0, fv.PageCount, "BeforeInitializePagerPageCount"); + fv.DataBind (); + Assert.AreEqual (true, fv.isInitializePager, "AfterInitializePager"); + Assert.AreEqual (6, fv.PageCount, "AfterInitializePagerPageCount"); + } + + [Test] + public void FormView_CreateRow () + { + Poker fv = new Poker (); + fv.AllowPaging =true; + fv.DataSource = myds; + fv.Page = new Page (); + fv.DataBind (); + FormViewRow row = fv.DoCreateRow (2,DataControlRowType.DataRow ,DataControlRowState.Normal ); + Assert.AreEqual (2, row.ItemIndex, "CreatedRowItemIndex1"); + Assert.AreEqual (DataControlRowState.Normal , row.RowState, "CreatedRowState1"); + Assert.AreEqual (DataControlRowType.DataRow , row.RowType, "CreatedRowType1"); + row = fv.DoCreateRow (4, DataControlRowType.Footer, DataControlRowState.Edit); + Assert.AreEqual (4, row.ItemIndex, "CreatedRowItemIndex2"); + Assert.AreEqual (DataControlRowState.Edit , row.RowState, "CreatedRowState2"); + Assert.AreEqual (DataControlRowType.Footer , row.RowType, "CreatedRowType2"); + //FormViewPagerRow pagerRow = (FormViewPagerRow)fv.DoCreateRow (3, DataControlRowType.Pager , DataControlRowState.Insert); + //Assert.AreEqual (3, pagerRow.ItemIndex, "CreatedPageRowItemIndex"); + //Assert.AreEqual (DataControlRowState.Insert, pagerRow.RowState, "CreatedPageRowState"); + //Assert.AreEqual (DataControlRowType.Pager, pagerRow.RowType, "CreatedPageRowType"); + + } + + [Test] + public void FormView_CreateTable () + { + Poker fv = new Poker (); + Table tb = fv.DoCreateTable (); + fv.Page = new Page (); + Assert.AreEqual ("", tb.BackImageUrl , "CreateTable1"); + Assert.AreEqual (0, tb.Rows.Count, "CreateTable2"); + fv.DataSource = myds; + fv.DataBind (); + fv.ID = "TestFormView"; + tb = fv.DoCreateTable (); + Assert.AreEqual (-1, tb.CellPadding , "CreateTable3"); + + } + + [Test] + public void FormView_EnsureDataBound () + { + Poker fv = new Poker (); + fv.DataSource = myds; + fv.DoOnPreRender (EventArgs.Empty); + Assert.AreEqual (true, fv.ensureDataBound, "EnsureDataBound"); + + } + + [Test] + public void FormView_PerformDataBinding () + { + Poker fv = new Poker (); + fv.Page = new Page (); + Assert.AreEqual (0,fv.DataItemCount, "BeforePerformDataBinding"); + fv.DoPerformDataBinding (myds); + Assert.AreEqual (6, fv.DataItemCount, "AfterPerformDataBinding"); + } + + [Test] + public void FormView_ExtractRowValues () + { + Poker fv=new Poker (); + fv.ItemTemplate = new MyTemplate (); + fv.DataKeyNames = new string[] { "ID", "FName", "LName" }; + //IOrderedDictionary dict = (IOrderedDictionary) new OrderedDictionary (0x19); + //fv.DoExtractRowValues (dict, true); + //DataTable ds = CreateDataTable (); + //fv.DataSource = ds; + //fv.DataBind (); + //OrderedDictionary fieldsValues = new OrderedDictionary (); + //fv.DoExtractRowValues (fieldsValues, true); + //Assert.AreEqual (3, fieldsValues.Count, "ExtractRowValues1"); + //Assert.AreEqual (3, fieldsValues.Keys.Count, "ExtractRowValues2"); + //Assert.AreEqual (3, fieldsValues.Values.Count, "ExtractRowValues3"); + //Assert.AreEqual (true, fieldsValues.Contains ("ID"), "ExtractRowValues4"); + //IDictionaryEnumerator enumerator = fieldsValues.GetEnumerator (); + //enumerator.MoveNext (); + //Assert.AreEqual ("ID", enumerator.Key, "FieldValue1"); + //Assert.AreEqual ("1001", enumerator.Value, "FieldValue2"); + //enumerator.MoveNext (); + //Assert.AreEqual ("FName", enumerator.Key, "FieldValue3"); + //Assert.AreEqual ("Mahesh", enumerator.Value, "FieldValue4"); + //enumerator.MoveNext (); + //Assert.AreEqual ("LName", enumerator.Key, "FieldValue5"); + //Assert.AreEqual ("Chand", enumerator.Value, "FieldValue6"); + + } + + [Test] + public void FormView_PrepareControlHierarchy () + { + Poker fv = new Poker (); + fv.Page = new Page (); + fv.controlHierarchy = false; + fv.Render (); + Assert.AreEqual (0, fv.Controls.Count, "ControlHierarchy1"); + Assert.AreEqual (true, fv.controlHierarchy, "ControlHierarchy2"); + fv.AllowPaging = true; + fv.DataSource = myds; + fv.DataBind (); + fv.controlHierarchy = false; + fv.Render (); + Assert.AreEqual (1, fv.Controls.Count, "ControlHierarchy3"); + Assert.AreEqual (true, fv.controlHierarchy, "ControlHierarchy4"); + + + } + + //Public Methods + + [Test] + public void FormView_ChangeMode () + { + Poker fv = new Poker (); + Assert.AreEqual (FormViewMode.ReadOnly, fv.CurrentMode, "ChangeModeDefault"); + fv.ChangeMode (FormViewMode.Insert); + Assert.AreEqual (FormViewMode.Insert, fv.CurrentMode, "ChangeModeInsert"); + fv.ChangeMode (FormViewMode.Edit); + Assert.AreEqual (FormViewMode.Edit, fv.CurrentMode, "ChangeModeEdit"); + fv.ChangeMode (FormViewMode.ReadOnly); + Assert.AreEqual (FormViewMode.ReadOnly, fv.CurrentMode, "ChangeModeReadOnly"); + } + + [Test] + public void FormView_PageCount () { + Page p = new Page (); + + Poker fv = new Poker (); + p.Controls.Add (fv); + + ObjectDataSource data = new ObjectDataSource (); + data.TypeName = typeof (FormViewDataObject).AssemblyQualifiedName; + data.SelectMethod = "Select"; + p.Controls.Add (data); + + fv.DataSource = data; + + Assert.AreEqual (0, fv.PageCount, "PageCount before binding"); + + fv.DataBind (); + + Assert.AreEqual (3, fv.PageCount, "PageCount after binding"); + } + + [Test] + public void FormView_DataKey () + { + Page p = new Page (); + + Poker fv = new Poker (); + p.Controls.Add (fv); + + ObjectDataSource data = new ObjectDataSource (); + data.TypeName = typeof (FormViewDataObject).AssemblyQualifiedName; + data.SelectMethod = "Select"; + p.Controls.Add (data); + + fv.DataSource = data; + fv.DataKeyNames = new string [] { "ID", "FName" }; + + DataKey key1 = fv.DataKey; + + Assert.AreEqual (null, key1.Value, "DataKey.Value before binding"); + Assert.AreEqual (0, key1.Values.Count, "DataKey.Values count before binding"); + + fv.DataBind (); + + DataKey key2 = fv.DataKey; + DataKey key3 = fv.DataKey; + + Assert.IsFalse (Object.ReferenceEquals (key1, key2), "DataKey returns the same instans"); + Assert.IsTrue (Object.ReferenceEquals (key2, key3), "DataKey returns the same instans"); + + Assert.AreEqual (1001, key1.Value, "DataKey.Value after binding"); + Assert.AreEqual (2, key1.Values.Count, "DataKey.Values count after binding"); + Assert.AreEqual (1001, key1.Values [0], "DataKey.Values[0] after binding"); + Assert.AreEqual ("Mahesh", key1.Values [1], "DataKey.Values[1] after binding"); + + Poker copy = new Poker (); + object state = fv.DoSaveControlState (); + copy.DoLoadControlState (state); + + DataKey key4 = copy.DataKey; + + Assert.AreEqual (1001, key4.Value, "DataKey.Value from ViewState"); + Assert.AreEqual (2, key4.Values.Count, "DataKey.Values count from ViewState"); + Assert.AreEqual (1001, key4.Values [0], "DataKey.Values[0] from ViewState"); + Assert.AreEqual ("Mahesh", key4.Values [1], "DataKey.Values[1] from ViewState"); + } + + [Test] + public void FormView_DataBind () + { + Poker fv = new Poker (); + fv.AllowPaging = true; + fv.DataSource = myds; + fv.Page = new Page (); + Assert.AreEqual (0, fv.PageCount, "BeforeDataBind1"); + Assert.AreEqual (null, fv.DataItem, "BeforeDataBind2"); + fv.DataBind (); + Assert.AreEqual (6, fv.PageCount, "AfterDataBind1"); + Assert.AreEqual (6, fv.DataItemCount, "AfterDataBind2"); + Assert.AreEqual ("Item1", fv.DataItem, "AfterDataBind3"); + } + + private bool isDeleted = false; + + [Test] + public void FormView_DeleteItem () + { + Poker fv = new Poker (); + fv.Page = new Page (); + fv.DataSource = myds; + fv.DataBind (); + Assert.AreEqual (false, isDeleted, "BeforeDeleteItem"); + fv.ItemDeleting += new FormViewDeleteEventHandler (fv_DeleteingHandler); + fv.DeleteItem (); + Assert.AreEqual (true, isDeleted, "BeforeDeleteItem"); + + } + + public void fv_DeleteingHandler (Object sender, FormViewDeleteEventArgs e) + { + isDeleted = true; + } + + private bool insertItem = false; + + [Test] + public void FormView_InsertItem () + { + Poker fv = new Poker (); + fv.Page = new Page (); + fv.ChangeMode (FormViewMode.Insert); + fv.ItemInserting += new FormViewInsertEventHandler (insert_item); + Assert.AreEqual (false, insertItem, "BeforeInsertItem"); + fv.InsertItem (false); + Assert.AreEqual (true, insertItem, "AfterInsertItem"); + + } + + public void insert_item (object sender, FormViewInsertEventArgs e) + { + insertItem = true; + } + + private bool updateItem = false; + [Test] + public void FormView_UpdateItem () + { + Poker fv = new Poker (); + fv.Page = new Page (); + fv.DataSource = myds; + fv.DataBind (); + fv.ChangeMode (FormViewMode.Edit); + fv.ItemUpdating += new FormViewUpdateEventHandler (update_item); + Assert.AreEqual (false, updateItem, "BeforeUpdateItem"); + fv.UpdateItem (false); + Assert.AreEqual (true, updateItem, "AfterUpdateItem"); + + } + + public void update_item (object sender, FormViewUpdateEventArgs e) + { + updateItem = true; + } + + [Test] + public void FormView_IsBindableType () + { + bool isBindable = false; + Poker fv = new Poker (); + isBindable = fv.IsBindableType (typeof (Decimal)); + Assert.AreEqual (true, isBindable, "IsBindableTypeDecimal"); + isBindable = fv.IsBindableType (typeof (Int32)); + Assert.AreEqual (true, isBindable, "IsBindableTypeInt32"); + isBindable = fv.IsBindableType (typeof (String)); + Assert.AreEqual (true, isBindable, "IsBindableTypeString"); + isBindable = fv.IsBindableType (typeof (Boolean)); + Assert.AreEqual (true, isBindable, "IsBindableTypeBoolean"); + isBindable = fv.IsBindableType (typeof (DateTime)); + Assert.AreEqual (true, isBindable, "IsBindableTypeDateTime"); + isBindable = fv.IsBindableType (typeof (Byte)); + Assert.AreEqual (true, isBindable, "IsBindableTypeByte"); + isBindable = fv.IsBindableType (typeof (Guid)); + Assert.AreEqual (true, isBindable, "IsBindableTypeGuid"); + isBindable = fv.IsBindableType (typeof (MyTemplate)); + Assert.AreEqual (false, isBindable, "IsBindableTypeMyTemplate"); + } + + [Test] + public void FormView_ControlState () { + + Poker fv = new Poker (); + Poker copy = new Poker (); + string[] keys = new String[2]; + keys[0] = "key1"; + keys[1] = "key2"; + fv.DataKeyNames = keys; + fv.BackImageUrl = "photo.jpg"; + fv.DefaultMode = FormViewMode.Insert ; + fv.ChangeMode (FormViewMode.Edit); + object state = fv.DoSaveControlState (); + copy.DoLoadControlState (state); + Assert.AreEqual (2, copy.DataKeyNames.Length, "DataKeyNames.Length"); + Assert.AreEqual ("key1", copy.DataKeyNames[0], "ControlStateDataKeyValue"); + Assert.AreEqual ("key2", copy.DataKeyNames[1], "ControlStateDataKeyValue2"); + Assert.AreEqual (FormViewMode.Insert, copy.DefaultMode, "ControlStateDefaultMode"); + Assert.AreEqual (FormViewMode.Edit, copy.CurrentMode, "ControlStateCurrentMode"); + + } + + //ViewState + [Test] + public void FormView_ViewState () + { + Poker fv = new Poker (); + Poker copy = new Poker (); + fv.AllowPaging = true; + fv.HeaderText = "Testing"; + fv.CssClass = "style.css"; + object state = fv.SaveState (); + copy.LoadState (state); + Assert.AreEqual (true, copy.AllowPaging, "ViewStateAllowPaging"); + Assert.AreEqual ("Testing", copy.HeaderText, "ViewStateHeaderText"); + Assert.AreEqual ("style.css", copy.CssClass, "ViewStateCssClass"); + } + + //Events + private bool init; + private bool itemCommand; + private bool itemCreated; + private bool itemDeleted; + private bool itemDeleting; + private bool itemInserted; + private bool itemInserting; + private bool itemUpdated; + private bool itemUpdating; + private bool modeChanged; + private bool modeChanging; + private bool pageIndexChanged; + private bool pageIndexChanging; + private int newPageIndex; + + public void ResetEvents () + { + init = false; + itemCommand = false; + itemCreated = false; + itemDeleted = false; + itemDeleting = false; + itemInserted = false; + itemInserting = false; + itemUpdated = false; + itemUpdating = false; + modeChanged = false; + modeChanging = false; + pageIndexChanged = false; + pageIndexChanging = false; + } + + [Test] + public void FormView_BubbleEvent () + { + FormViewCommandEventArgs com; + Poker fv = new Poker (); + Page page = new Page (); + Button bt = new Button (); + fv.AllowPaging = true; + fv.DataSource = myds; + page.Controls.Add (fv); + fv.DataBind (); + ResetEvents (); + fv.ItemCommand += new FormViewCommandEventHandler (fv_ItemCommand); + fv.ItemDeleted += new FormViewDeletedEventHandler (fv_ItemDeleted); + //Delete + fv.ItemDeleting += new FormViewDeleteEventHandler (fv_ItemDeleting); + com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Delete", null)); + Assert.AreEqual (false, itemDeleting, "BeforeDeleteCommandBubbleEvent"); + Assert.AreEqual (false, itemCommand, "BeforeDeleteBubbleEvent"); + Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Delete"); + Assert.AreEqual (true, itemDeleting, "AfterDeleteBubbleEvent"); + Assert.AreEqual (true, itemCommand, "AfterDeleteCommandBubbleEvent"); + + + //Insert + itemCommand = false; + fv.ItemInserting += new FormViewInsertEventHandler (fv_ItemInserting); + fv.ChangeMode (FormViewMode.Insert); + com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Insert", null)); + Assert.AreEqual (false, itemCommand, "BeforeInsertCommandBubbleEvent"); + Assert.AreEqual (false, itemInserting, "BeforeInsertBubbleEvent"); + Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Insert"); + Assert.AreEqual (true, itemCommand, "AfterInsertCommandBubbleEvent"); + Assert.AreEqual (true, itemInserting, "AfterInsertBubbleEvent"); + + + //Update + itemCommand = false; + fv.ItemUpdating += new FormViewUpdateEventHandler (fv_ItemUpdating); + fv.ChangeMode (FormViewMode.Edit); + com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Update", null)); + Assert.AreEqual (false, itemUpdating, "BeforeUpdateEvent"); + Assert.AreEqual (false, itemCommand, "BeforeUpdateCommandEvent"); + Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Update"); + Assert.AreEqual (true, itemCommand, "AfterUpdateCommandBubbleEvent"); + Assert.AreEqual (true, itemUpdating, "AfterUpdateBubbleEvent"); + + + //Cancel + itemCommand = false; + fv.ModeChanging += new FormViewModeEventHandler (fv_ModeChanging); + com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Cancel", null)); + Assert.AreEqual (false, itemCommand, "BeforeCancelCommandBubbleEvent"); + Assert.AreEqual (false, modeChanging, "BeforeCancelBubbleEvent"); + Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Cancel"); + Assert.AreEqual (true, itemCommand, "AfterCancelCommandBubbleEvent"); + Assert.AreEqual (true, modeChanging, "AfterCancelBubbleEvent"); + + //Edit + itemCommand = false; + modeChanging = false; + com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Edit", null)); + Assert.AreEqual (false, itemCommand, "BeforeEditCommandBubbleEvent"); + Assert.AreEqual (false, modeChanging, "BeforeEditBubbleEvent"); + Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Edit"); + Assert.AreEqual (true, itemCommand, "AfterEditCommandBubbleEvent"); + Assert.AreEqual (true, modeChanging, "AfterEditBubbleEvent"); + + //New + itemCommand = false; + modeChanging = false; + com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("New", null)); + Assert.AreEqual (false, itemCommand, "BeforeNewCommandBubbleEvent"); + Assert.AreEqual (false, modeChanging, "BeforeNewBubbleEvent"); + Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - New"); + Assert.AreEqual (true, itemCommand, "AfterNewCommandBubbleEvent"); + Assert.AreEqual (true, modeChanging, "AfterNewBubbleEvent"); + + //Page Index default + itemCommand = false; + fv.PageIndexChanging += new FormViewPageEventHandler (fv_PageIndexChanging); + com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Page", null)); + Assert.AreEqual (false, itemCommand, "BeforePageCommandBubbleEvent"); + Assert.AreEqual (false, pageIndexChanging, "BeforePageBubbleEvent"); + Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Page Index default"); + Assert.AreEqual (true, itemCommand, "AfterPageCommandBubbleEvent"); + Assert.AreEqual (true, pageIndexChanging, "AfterPageBubbleEvent"); + Assert.AreEqual (-1, newPageIndex, "PageIndex"); + + //Next Page + itemCommand = false; + pageIndexChanging = false; + com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Page", "Next")); + Assert.AreEqual (false, itemCommand, "BeforeNextPageCommandBubbleEvent"); + Assert.AreEqual (false, pageIndexChanging, "BeforeNextPageBubbleEvent"); + Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Next Page"); + Assert.AreEqual (true, itemCommand, "AfterNextPageCommandBubbleEvent"); + Assert.AreEqual (true, pageIndexChanging, "AfterNextPageBubbleEvent"); + Assert.AreEqual (1, newPageIndex, "NextPageIndex"); + + //Prev Page + itemCommand = false; + pageIndexChanging = false; + com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Page", "Prev")); + Assert.AreEqual (false, itemCommand, "BeforePrevPageCommandBubbleEvent"); + Assert.AreEqual (false, pageIndexChanging, "BeforePrevPageBubbleEvent"); + Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Prev Page"); + Assert.AreEqual (true, itemCommand, "AfterPrevPageCommandBubbleEvent"); + Assert.AreEqual (true, pageIndexChanging, "AfterPrevPageBubbleEvent"); + Assert.AreEqual (-1, newPageIndex, "PrevPageIndex"); + + //First Page + itemCommand = false; + pageIndexChanging = false; + com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Page", "First")); + Assert.AreEqual (false, itemCommand, "BeforeFirstPageCommandBubbleEvent"); + Assert.AreEqual (false, pageIndexChanging, "BeforeFirstPageBubbleEvent"); + Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - First Page"); + Assert.AreEqual (true, itemCommand, "AfterFirstPageCommandBubbleEvent"); + Assert.AreEqual (true, pageIndexChanging, "AfterFirstPageBubbleEvent"); + Assert.AreEqual (0, newPageIndex, "FirstPageIndex"); + + //Last Page + itemCommand = false; + pageIndexChanging = false; + com = new FormViewCommandEventArgs (bt, new CommandEventArgs ("Page", "Last")); + Assert.AreEqual (false, itemCommand, "BeforeLastPageCommandBubbleEvent"); + Assert.AreEqual (false, pageIndexChanging, "BeforeLastPageBubbleEvent"); + Assert.IsTrue (fv.DoOnBubbleEvent (bt, com), "OnBubbleEvent - Last Page"); + Assert.AreEqual (true, itemCommand, "AfterLastPageCommandBubbleEvent"); + Assert.AreEqual (true, pageIndexChanging, "AfterLastPageBubbleEvent"); + Assert.AreEqual (5, newPageIndex, "FirstPageIndex"); + + } + + [Test] + [Category("NunitWeb")] + public void FormView_DataSourceChangedEvent () + { + WebTest t = new WebTest(); + PageDelegates pd = new PageDelegates (); + pd.Load = FormView_Init; + pd.PreRenderComplete = FormView_Load; + t.Invoker = new PageInvoker (pd); + t.Run (); + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = ""; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + t.Run (); + if (t.UserData == null) + Assert.Fail ("DataSourceChangedEvent#1"); + Assert.AreEqual ("Data_rebounded", t.UserData.ToString (), "DataSourceChangedEvent#2"); + } + + #region FormView_DataSourceChangedEvent + public static void FormView_Init(Page p) + { + Poker fv = new Poker (); + DS data = new DS (); + p.Controls.Add (fv); + p.Controls.Add (data); + data.TypeName = typeof (DS).AssemblyQualifiedName; + data.SelectMethod = "GetList"; + data.ID = "Data"; + fv.DataBinding += new EventHandler (data_DataBinding); + fv.DataSourceID = "Data"; + } + + public static void FormView_Load (Page p) + { + if (p.IsPostBack) { + DS data = (DS) p.FindControl ("Data") ; + if (data == null) + Assert.Fail ("Data soource control not created#1"); + data.DoRaiseDataSourceChangedEvent (new EventArgs ()); + } + } + + public static void data_DataBinding (object sender, EventArgs e) + { + if (((WebControl) sender).Page.IsPostBack) + WebTest.CurrentTest.UserData = "Data_rebounded"; + } + #endregion + + [Test] + public void FormView_Events () + { + ResetEvents (); + Poker fv = new Poker (); + fv.Page = new Page (); + fv.Init += new EventHandler (fv_Init); + fv.ItemCommand += new FormViewCommandEventHandler (fv_ItemCommand); + fv.ItemCreated += new EventHandler (fv_ItemCreated); + fv.ItemDeleted += new FormViewDeletedEventHandler (fv_ItemDeleted); + fv.ItemDeleting += new FormViewDeleteEventHandler (fv_ItemDeleting); + fv.ItemInserted += new FormViewInsertedEventHandler (fv_ItemInserted); + fv.ItemInserting += new FormViewInsertEventHandler (fv_ItemInserting); + fv.ItemUpdated += new FormViewUpdatedEventHandler (fv_ItemUpdated); + fv.ItemUpdating += new FormViewUpdateEventHandler (fv_ItemUpdating); + fv.ModeChanged += new EventHandler (fv_ModeChanged); + fv.ModeChanging += new FormViewModeEventHandler (fv_ModeChanging); + fv.PageIndexChanged += new EventHandler (fv_PageIndexChanged); + fv.PageIndexChanging += new FormViewPageEventHandler (fv_PageIndexChanging); + + Assert.AreEqual (false, init, "BeforeInit"); + fv.DoOnInit (new EventArgs ()); + Assert.AreEqual (true, init, "AfterInit"); + Assert.AreEqual (false, itemCommand, "BeforeItemCommandEvent"); + Button bt = new Button (); + fv.DoOnItemCommand (new FormViewCommandEventArgs (bt, new CommandEventArgs ("", null))); + Assert.AreEqual (true, itemCommand, "AfterItemCommandEvent"); + Assert.AreEqual (false, itemCreated, "BeforeItemCreatedEvent"); + fv.DoOnItemCreated (new EventArgs ()); + Assert.AreEqual (true, itemCreated, "AfterItemCreatedEvent"); + Assert.AreEqual (false, itemDeleted, "BeforeItemDeletedEvent"); + fv.DoOnItemDeleted (new FormViewDeletedEventArgs (3, new Exception ())); + Assert.AreEqual (true, itemDeleted, "AfterItemDeletedEvent"); + Assert.AreEqual (false, itemDeleting, "BeforeItemDeletingEvent"); + fv.DoOnItemDeleting (new FormViewDeleteEventArgs (1)); + Assert.AreEqual (true, itemDeleting, "AfterItemDeletingEvent"); + Assert.AreEqual (false, itemInserted, "BeforeItemInsertedEvent"); + fv.DoOnItemInserted (new FormViewInsertedEventArgs (2, new Exception ())); + Assert.AreEqual (true, itemInserted, "AfterItemInsetedEvent"); + Assert.AreEqual (false, itemInserting, "BeforeItemInsertingEvent"); + fv.DoOnItemInserting (new FormViewInsertEventArgs (bt)); + Assert.AreEqual (true, itemInserting, "AfterItemInsetingEvent"); + Assert.AreEqual (false, itemUpdated, "BeforeItemUpdatedEvent"); + fv.DoOnItemUpdated (new FormViewUpdatedEventArgs (1, new Exception ())); + Assert.AreEqual (true, itemUpdated, "AfterItemUpdatedEvent"); + Assert.AreEqual (false, itemUpdating, "BeforeItemUpdatingEvent"); + fv.DoOnItemUpdating (new FormViewUpdateEventArgs (bt)); + Assert.AreEqual (true, itemUpdating, "AfterItemUpdatingEvent"); + Assert.AreEqual (false, modeChanged, "BeforeModeChangedEvent"); + fv.DoOnModeChanged (new EventArgs ()); + Assert.AreEqual (true, modeChanged, "AfterModeChangedEvent"); + Assert.AreEqual (false, modeChanging, "BeforeModeChangingEvent"); + fv.DoOnModeChanging (new FormViewModeEventArgs (FormViewMode.Edit, true)); + Assert.AreEqual (true, modeChanging, "AfterModeChangingEvent"); + Assert.AreEqual (false, pageIndexChanged, "BeforePageIndexChangedEvent"); + fv.DoOnPageIndexChanged (new EventArgs ()); + Assert.AreEqual (true, pageIndexChanged, "AfterPageIndexChangedEvent"); + Assert.AreEqual (false, pageIndexChanging, "BeforePageIndexChangingEvent"); + fv.DoOnPageIndexChanging (new FormViewPageEventArgs (1)); + Assert.AreEqual (true, pageIndexChanging, "AfterPageIndexChangingEvent"); + } + private void fv_Init (object sender, EventArgs e) + { + init = true; + } + + private void fv_ItemCommand (object sender, FormViewCommandEventArgs e) + { + itemCommand = true; + } + + private void fv_ItemCreated (object sender, EventArgs e) + { + itemCreated = true; + } + + private void fv_ItemDeleted (object sender, FormViewDeletedEventArgs e) + { + itemDeleted = true; + } + + private void fv_ItemDeleting (object sender, FormViewDeleteEventArgs e) + { + itemDeleting = true; + } + + private void fv_ItemInserted (object sender, FormViewInsertedEventArgs e) + { + itemInserted = true; + } + + private void fv_ItemInserting (object sender, FormViewInsertEventArgs e) + { + itemInserting = true; + } + + private void fv_ItemUpdated (object sender, FormViewUpdatedEventArgs e) + { + itemUpdated = true; + } + + private void fv_ItemUpdating (object sender, FormViewUpdateEventArgs e) + { + itemUpdating = true; + } + + private void fv_ModeChanged (object sender, EventArgs e) + { + modeChanged = true; + } + + private void fv_ModeChanging (object sender, FormViewModeEventArgs e) + { + modeChanging = true; + } + + private void fv_PageIndexChanged (object sender, EventArgs e) + { + pageIndexChanged = true; + } + private void fv_PageIndexChanging (object sender, FormViewPageEventArgs e) + { + pageIndexChanging = true; + newPageIndex = e.NewPageIndex; + e.NewPageIndex = -1; + } + + //Exceptions + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void CellPaddingException () + { + Poker p = new Poker (); + p.CellPadding = -2; + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void CellSpacingException () + { + Poker p = new Poker (); + p.CellSpacing = -5; + } + + [Test] + [ExpectedException (typeof (ArgumentOutOfRangeException))] + public void PageIndexException () + { + Poker p = new Poker (); + p.PageIndex = -5; + } + + [Test] + [ExpectedException (typeof (HttpException))] + public void InsertItemException () + { + Poker p = new Poker (); + p.InsertItem (true); + } + + [Test] + [ExpectedException (typeof (HttpException))] + public void UpdateItemException () + { + Poker p = new Poker (); + p.UpdateItem (true); + } + + + [Test] + [Category ("NotDotNet")] //TODO + public void PageIndex () + { + ObjectDataSource ds = new ObjectDataSource (); + ds.ID = "ObjectDataSource1"; + ds.TypeName = "System.Guid"; + ds.SelectMethod = "ToByteArray"; + Page p = new Page (); + Poker f = new Poker (); + f.Page = p; + ds.Page = p; + p.Controls.Add (f); + p.Controls.Add (ds); + f.DataSourceID = "ObjectDataSource1"; + f.DoConfirmInitState (); + f.DoOnPreRender (EventArgs.Empty); + object cur = f.DataItem; + f.PageIndex = 1; + Assert.IsTrue (cur != f.DataItem, "#01"); + +CommandEventArgs cargs = new CommandEventArgs ("Page", "Prev"); + FormViewCommandEventArgs fvargs = new FormViewCommandEventArgs (f, cargs); + f.DoOnBubbleEvent (f, fvargs); + Assert.IsTrue (f.OnPageIndexChangingCalled, "#02"); + Assert.IsTrue (f.OnPageIndexChangedCalled, "#03"); + f.OnPageIndexChangingCalled = false; + f.OnPageIndexChangedCalled = false; + + f.DoOnBubbleEvent (f, fvargs); + Assert.IsTrue (f.OnPageIndexChangingCalled, "#04"); + Assert.IsFalse (f.OnPageIndexChangedCalled, "#05"); + f.OnPageIndexChangingCalled = false; + f.OnPageIndexChangedCalled = false; + + f.PageIndex = f.PageCount - 1; + cargs = new CommandEventArgs ("Page", "Next"); + fvargs = new FormViewCommandEventArgs (f, cargs); + f.DoOnBubbleEvent (f, fvargs); + Assert.IsTrue (f.OnPageIndexChangingCalled, "#06"); + Assert.IsFalse (f.OnPageIndexChangedCalled, "#07"); + f.OnPageIndexChangingCalled = false; + f.OnPageIndexChangedCalled = false; + } + + [Test] + public void PageCount () + { + ObjectDataSource ds = new ObjectDataSource (); + ds.ID = "ObjectDataSource1"; + ds.TypeName = "System.Guid"; + ds.SelectMethod = "ToByteArray"; + Page p = new Page (); + Poker f = new Poker (); + f.Page = p; + ds.Page = p; + p.Controls.Add (f); + p.Controls.Add (ds); + f.DataSourceID = "ObjectDataSource1"; + f.DoConfirmInitState (); + f.DoOnPreRender (EventArgs.Empty); + f.PageIndex = 1; + Assert.AreEqual (16, f.PageCount, "#01"); + } + + [Test] + public void InsertTemplate () { + ObjectDataSource ds = new ObjectDataSource (); + ds.ID = "ObjectDataSource1"; + ds.TypeName = "System.Collections.ArrayList"; + ds.SelectMethod = "ToArray"; + Page p = new Page (); + Poker f = new Poker (); + Template itemTemplate = new Template (); + Template emptyTemplate = new Template (); + Template insertTemplate = new Template (); + f.ItemTemplate = itemTemplate; + f.EmptyDataTemplate = emptyTemplate; + f.InsertItemTemplate = insertTemplate; + f.DefaultMode = FormViewMode.Insert; + f.Page = p; + ds.Page = p; + p.Controls.Add (f); + p.Controls.Add (ds); + f.DataSourceID = "ObjectDataSource1"; + f.DoConfirmInitState (); + f.DoOnPreRender (EventArgs.Empty); + + f.AllowPaging = true; + Assert.IsFalse(itemTemplate.Instantiated, "#01"); + Assert.IsFalse(emptyTemplate.Instantiated, "#02"); + Assert.IsTrue(insertTemplate.Instantiated, "#03"); + } + + [TestFixtureTearDown] + public void TearDown () + { + WebTest.Unload (); + } + + [Test] + [Category("NunitWeb")] + public void FormViewCssClass () + { + string res = new WebTest ("FormView.aspx").Run (); + Assert.IsTrue (Regex.IsMatch ( + res, ".*]*class=\"[^\"]*test1[^\"]*\"[^>]*>.*", + RegexOptions.IgnoreCase|RegexOptions.Singleline), + "check that is found. Actual: "+res); + Assert.IsFalse (Regex.IsMatch ( + res, ".*]*class=\"\"[^>]*>.*", + RegexOptions.IgnoreCase|RegexOptions.Singleline), + "check that
is not found. Actual: "+res); + } + + + + + [Test] + [Category ("NunitWeb")] + public void FormView_RenderSimpleTemplate() + { + string renderedPageHtml = new WebTest ("FormViewTest1.aspx").Run (); + string newHtmlValue = HtmlDiff.GetControlFromPageHtml (renderedPageHtml); + string origHtmlValue = "
\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
\n 1\n
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
123456
"; + + HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderSimpleTemplate"); + } + + [Test] + [Category ("NunitWeb")] + public void FormView_RenderFooterAndPager() + { + string renderedPageHtml = new WebTest ("FormViewTest1_2.aspx").Run (); + string newHtmlValue = HtmlDiff.GetControlFromPageHtml (renderedPageHtml); + string origHtmlValue = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
\n 1\n
\n Footer Template Test\n
\n \n \n \n \n
"; + HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "FormView_RenderFooterAndPager"); + } + + [Test] + [Category ("NunitWeb")] + public void FormView_RenderWithHeader() + { + string renderedPageHtml = new WebTest ("FormViewTest1_4.aspx").Run (); + string newHtmlValue = HtmlDiff.GetControlFromPageHtml (renderedPageHtml); + string origHtmlValue = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
Using Header Text property
Using Footer Text property
\n Next\n Prev\n Page Index: 0\n
"; + HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderingDefaultPaging"); + } + + + [Test] + [Category ("NunitWeb")] + public void FormView_Render () + { + string RenderedPageHtml = new WebTest ("FormViewTest1_3.aspx").Run (); + string newHtmlValue = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + string origHtmlValue = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
\n Header Template Test\n
\n 1\n
\n FormView Footer\n
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
123456
"; + HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderingDefaultPaging"); + } + + + [Test] + [Category ("NunitWeb")] + public void FormView_EditPostback () + { + WebTest t = new WebTest ("FormViewInsertEditDelete.aspx"); + string pageHTML = t.Run (); + string newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML); + string origHtml = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
\n 1001 \n Chand\n Mahesh \n Edit\n New\n Delete\n
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
123
"; + HtmlDiff.AssertAreEqual (origHtml, newHtml, "BeforeEditPostback"); + + //Edit button postback (change to edit mode - buttons "Update" and "Cancel" should appear. + + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "FormView1$EditButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + pageHTML = t.Run (); + newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML); + origHtml = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
\n Enter First Name:
\n Enter Last Name:
\n Update\n Cancel\n
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
123
"; + HtmlDiff.AssertAreEqual (origHtml, newHtml, "AfterEditPostback"); + + //Update record postback + + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls.Add ("FormView1$FNameEdit"); + fr.Controls.Add ("FormView1$LNameEdit"); + fr.Controls["__EVENTTARGET"].Value = "FormView1$UpdateButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + fr.Controls["FormView1$FNameEdit"].Value = "Merav"; + fr.Controls["FormView1$LNameEdit"].Value = "Test"; + t.Request = fr; + pageHTML = t.Run (); + newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML); + origHtml = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
\n 1001 \n Test\n Merav \n Edit\n New\n Delete\n
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
123
"; + HtmlDiff.AssertAreEqual (origHtml, newHtml, "AfterUpdatePostback"); + + //Postback to return to Edit mode + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "FormView1$EditButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + pageHTML = t.Run (); + newHtml = pageHTML.Substring (pageHTML.IndexOf ("start") + 5, pageHTML.IndexOf ("end") - pageHTML.IndexOf ("start") - 5); + Assert.AreEqual (true, pageHTML.Contains ("Merav"), "EditModePostback1"); + Assert.AreEqual (true, pageHTML.Contains ("CancelUpdateButton"), "EditModePostback2"); + + // Cancel edited record postback + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls.Add ("FormView1$FNameEdit"); + fr.Controls.Add ("FormView1$LNameEdit"); + fr.Controls["FormView1$FNameEdit"].Value = "EditFirstName"; + fr.Controls["FormView1$LNameEdit"].Value = "EditLastName"; + fr.Controls["__EVENTTARGET"].Value = "FormView1$CancelUpdateButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + pageHTML = t.Run (); + newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML); + origHtml = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
\n 1001 \n Test\n Merav \n Edit\n New\n Delete\n
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
123
"; + HtmlDiff.AssertAreEqual (origHtml, newHtml, "CancelEditedRecordPostback"); + } + + [Test (Description="Bug #578863")] + public void FormView_PagerSettings_Visibility () + { + string origHtml = "\r\n\t\r\n\t\t\r\n\t\r\n
\n 1\n\t
"; + WebTest t = new WebTest ("FormViewPagerVisibility.aspx"); + string pageHtml = t.Run (); + string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml); + + HtmlDiff.AssertAreEqual (origHtml, renderedHtml, "#A1"); + } + + [Test] + [Category ("NunitWeb")] + public void FormView_FireEvent_1 () + { + WebTest t = new WebTest ("FormViewInsertEditDelete.aspx"); + t.Invoker = PageInvoker.CreateOnInit (EditPostbackFireEvent_Init); + string html = t.Run (); + //Edit button postback (change to edit mode - buttons "Update" and "Cancel" should appear. + + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "FormView1$EditButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + html = t.Run (); + + ArrayList eventlist = t.UserData as ArrayList; + if (eventlist == null) + Assert.Fail ("User data does not been created fail"); + + Assert.AreEqual ("ItemCommand", eventlist[0], "#1"); + Assert.AreEqual ("ModeChanging", eventlist[1], "#2"); + Assert.AreEqual ("ModeChanged", eventlist[2], "#3"); + t.UserData = null; + + //Update record postback + + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls.Add ("FormView1$FNameEdit"); + fr.Controls.Add ("FormView1$LNameEdit"); + fr.Controls["__EVENTTARGET"].Value = "FormView1$UpdateButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + fr.Controls["FormView1$FNameEdit"].Value = "Merav"; + fr.Controls["FormView1$LNameEdit"].Value = "Test"; + t.Request = fr; + html = t.Run (); + + eventlist = t.UserData as ArrayList; + if (eventlist == null) + Assert.Fail ("User data does not been created fail"); + + Assert.AreEqual ("ItemCommand", eventlist[0], "#1"); + Assert.AreEqual ("ItemUpdating", eventlist[1], "#2"); + Assert.AreEqual ("ItemUpdated", eventlist[2], "#3"); + Assert.AreEqual ("ModeChanging", eventlist[3], "#4"); + Assert.AreEqual ("ModeChanged", eventlist[4], "#5"); + } + + #region FireEvents_1 + public static void EditPostbackFireEvent_Init (Page p) + { + + FormView d = p.FindControl ("FormView1") as FormView; + if (d != null) { + d.ModeChanged +=new EventHandler(d_ModeChanged); + d.ModeChanging+=new FormViewModeEventHandler(d_ModeChanging); + d.ItemCommand += new FormViewCommandEventHandler (d_ItemCommand); + d.ItemUpdating += new FormViewUpdateEventHandler (d_ItemUpdating); + d.ItemUpdated += new FormViewUpdatedEventHandler (d_ItemUpdated); + } + } + + static void d_ItemUpdated (object sender, FormViewUpdatedEventArgs e) + { + if (WebTest.CurrentTest.UserData == null) { + ArrayList list = new ArrayList (); + list.Add ("ItemUpdated"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("ItemUpdated"); + WebTest.CurrentTest.UserData = list; + } + } + + static void d_ItemUpdating (object sender, FormViewUpdateEventArgs e) + { + if (WebTest.CurrentTest.UserData == null) { + ArrayList list = new ArrayList (); + list.Add ("ItemUpdating"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("ItemUpdating"); + WebTest.CurrentTest.UserData = list; + } + } + + static void d_ItemCommand (object sender, FormViewCommandEventArgs e) + { + if (WebTest.CurrentTest.UserData == null) { + ArrayList list = new ArrayList (); + list.Add ("ItemCommand"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("ItemCommand"); + WebTest.CurrentTest.UserData = list; + } + } + + static void d_ModeChanging(object sender, FormViewModeEventArgs e) + { + if (WebTest.CurrentTest.UserData == null) + { + ArrayList list = new ArrayList (); + list.Add ("ModeChanging"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("ModeChanging"); + WebTest.CurrentTest.UserData = list; + } + } + + static void d_ModeChanged(object sender, EventArgs e) + { + if (WebTest.CurrentTest.UserData == null) + { + ArrayList list = new ArrayList (); + list.Add ("ModeChanged"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("ModeChanged"); + WebTest.CurrentTest.UserData = list; + } + } + #endregion + + [Test] + [Category ("NunitWeb")] + public void FormView_FireEvent_2 () + { + WebTest t = new WebTest ("FormViewInsertEditDelete.aspx"); + t.Invoker = PageInvoker.CreateOnInit (FireEvent_2_Init); + t.Run (); + + // Checking for itemcreated event fired. + ArrayList eventlist = t.UserData as ArrayList; + if (eventlist == null) + Assert.Fail ("User data does not been created fail"); + + Assert.AreEqual ("ItemCreated", eventlist[0], "#1"); + } + + #region FireEvent_2 + public static void FireEvent_2_Init (Page p) + { + FormView d = p.FindControl ("FormView1") as FormView; + if (d != null) { + d.ItemCreated += new EventHandler (d_ItemCreated); + } + } + + static void d_ItemCreated (object sender, EventArgs e) + { + if (WebTest.CurrentTest.UserData == null) { + ArrayList list = new ArrayList (); + list.Add ("ItemCreated"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("ItemCreated"); + WebTest.CurrentTest.UserData = list; + } + } + #endregion + + [Test] + [Category ("NunitWeb")] + public void FormView_FireEvent_3 () + { + WebTest t = new WebTest ("FormViewInsertEditDelete.aspx"); + t.Invoker = PageInvoker.CreateOnInit (FireEvent_3_Init); + t.Run (); + + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "FormView1$NewButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + t.Run (); + + //Insert new record + + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls.Add ("FormView1$IDInsert"); + fr.Controls.Add ("FormView1$FNameInsert"); + fr.Controls.Add ("FormView1$LNameInsert"); + fr.Controls["FormView1$IDInsert"].Value = "33"; + fr.Controls["FormView1$FNameInsert"].Value = "InsertFirstName"; + fr.Controls["FormView1$LNameInsert"].Value = "InsertLastName"; + fr.Controls["__EVENTTARGET"].Value = "FormView1$InsertButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + t.Run (); + + ArrayList eventlist = t.UserData as ArrayList; + if (eventlist == null) + Assert.Fail ("User data does not been created fail"); + + Assert.AreEqual ("ItemInserting", eventlist[0], "#1"); + Assert.AreEqual ("ItemInserted", eventlist[1], "#2"); + } + + #region FireEvent_3 + public static void FireEvent_3_Init (Page p) + { + FormView d = p.FindControl ("FormView1") as FormView; + if (d != null) { + d.ItemInserted += new FormViewInsertedEventHandler (d_ItemInserted); + d.ItemInserting += new FormViewInsertEventHandler (d_ItemInserting); + } + } + + static void d_ItemInserting (object sender, FormViewInsertEventArgs e) + { + if (WebTest.CurrentTest.UserData == null) { + ArrayList list = new ArrayList (); + list.Add ("ItemInserting"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("ItemInserting"); + WebTest.CurrentTest.UserData = list; + } + } + + static void d_ItemInserted (object sender, FormViewInsertedEventArgs e) + { + if (WebTest.CurrentTest.UserData == null) { + ArrayList list = new ArrayList (); + list.Add ("ItemInserted"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("ItemInserted"); + WebTest.CurrentTest.UserData = list; + } + } + #endregion + + [Test] + [Category ("NunitWeb")] + public void FormView_FireEvent_4 () + { + WebTest t = new WebTest ("FormViewInsertEditDelete.aspx"); + t.Invoker = PageInvoker.CreateOnInit (FireEvent_4_Init); + t.Run (); + + //Delete Item + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "FormView1$DeleteButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + t.Run (); + + ArrayList eventlist = t.UserData as ArrayList; + if (eventlist == null) + Assert.Fail ("User data does not been created fail"); + + Assert.AreEqual ("ItemDeleting", eventlist[0], "#1"); + Assert.AreEqual ("ItemDeleted", eventlist[1], "#2"); + + } + + #region FireEvent_4 + public static void FireEvent_4_Init (Page p) + { + FormView d = p.FindControl ("FormView1") as FormView; + if (d != null) { + d.ItemDeleting += new FormViewDeleteEventHandler (d_ItemDeleting); + d.ItemDeleted += new FormViewDeletedEventHandler (d_ItemDeleted); + } + } + + static void d_ItemDeleted (object sender, FormViewDeletedEventArgs e) + { + if (WebTest.CurrentTest.UserData == null) { + ArrayList list = new ArrayList (); + list.Add ("ItemDeleted"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("ItemDeleted"); + WebTest.CurrentTest.UserData = list; + } + } + + static void d_ItemDeleting (object sender, FormViewDeleteEventArgs e) + { + if (WebTest.CurrentTest.UserData == null) { + ArrayList list = new ArrayList (); + list.Add ("ItemDeleting"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("ItemDeleting"); + WebTest.CurrentTest.UserData = list; + } + } + #endregion + + [Test] + [Category ("NunitWeb")] + public void FormView_FireEvent_5 () + { + WebTest t = new WebTest ("FormViewInsertEditDelete.aspx"); + t.Invoker = PageInvoker.CreateOnInit (FireEvent_5_Init); + t.Run (); + + //Delete Item + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "FormView1"; + fr.Controls["__EVENTARGUMENT"].Value = "Page$2"; + t.Request = fr; + t.Run (); + + ArrayList eventlist = t.UserData as ArrayList; + if (eventlist == null) + Assert.Fail ("User data does not been created fail"); + + Assert.AreEqual ("PageIndexChanging", eventlist[0], "#1"); + Assert.AreEqual ("PageIndexChanged", eventlist[1], "#2"); + } + + #region FireEvent_5 + public static void FireEvent_5_Init (Page p) + { + FormView d = p.FindControl ("FormView1") as FormView; + if (d != null) { + d.PageIndexChanged+=new EventHandler(d_PageIndexChanged); + d.PageIndexChanging+=new FormViewPageEventHandler(d_PageIndexChanging); + } + } + + static void d_PageIndexChanging (object sender, FormViewPageEventArgs e) + { + if (WebTest.CurrentTest.UserData == null) { + ArrayList list = new ArrayList (); + list.Add ("PageIndexChanging"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("PageIndexChanging"); + WebTest.CurrentTest.UserData = list; + } + } + + static void d_PageIndexChanged (object sender, EventArgs e) + { + if (WebTest.CurrentTest.UserData == null) { + ArrayList list = new ArrayList (); + list.Add ("PageIndexChanged"); + WebTest.CurrentTest.UserData = list; + } + else { + ArrayList list = WebTest.CurrentTest.UserData as ArrayList; + if (list == null) + throw new NullReferenceException (); + list.Add ("PageIndexChanged"); + WebTest.CurrentTest.UserData = list; + } + } + #endregion + + [Test] + [Category ("NunitWeb")] + public void FormView_InsertPostback () + { + WebTest t = new WebTest ("FormViewInsertEditDelete.aspx"); + string pageHTML = t.Run (); + Assert.AreEqual (true, pageHTML.Contains ("1001"), "BeforeInsert1"); + Assert.AreEqual (true, pageHTML.Contains ("Mahesh"), "BeforeInsert2"); + Assert.AreEqual (true, pageHTML.Contains ("Chand"), "BeforeInsert3"); + Assert.AreEqual (false, pageHTML.Contains ("Page$4"), "BeforeInsert4"); + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "FormView1$NewButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + pageHTML = t.Run (); + string newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML); + string origHtml = "\r\n\t\r\n\t\t\r\n\t\r\n
\n Insert ID:\n
\n Insert First Name:\n \n
\n Insert Last Name: \n \n Insert\n Cancel\n
"; + HtmlDiff.AssertAreEqual (origHtml, newHtml, "InsertPostback"); + + //Insert new record + + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls.Add ("FormView1$IDInsert"); + fr.Controls.Add ("FormView1$FNameInsert"); + fr.Controls.Add ("FormView1$LNameInsert"); + fr.Controls["FormView1$IDInsert"].Value = "33"; + fr.Controls["FormView1$FNameInsert"].Value = "InsertFirstName"; + fr.Controls["FormView1$LNameInsert"].Value ="InsertLastName"; + fr.Controls["__EVENTTARGET"].Value = "FormView1$InsertButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + pageHTML = t.Run (); + Assert.AreEqual (true, pageHTML.Contains ("1001"), "AfterInsert1"); + Assert.AreEqual (true, pageHTML.Contains ("Mahesh"), "AfterInsert2"); + Assert.AreEqual (true, pageHTML.Contains ("Chand"), "AfterInsert3"); + Assert.AreEqual (true, pageHTML.Contains ("Page$4"), "AfterInsert4"); + + //Checking that the inserted record appears on page 4. + + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "FormView1"; + fr.Controls["__EVENTARGUMENT"].Value = "Page$4"; + t.Request = fr; + pageHTML = t.Run (); + Assert.AreEqual (true, pageHTML.Contains ("33"), "AfterInsert1"); + Assert.AreEqual (true, pageHTML.Contains ("InsertLastName"), "AfterInsert2"); + Assert.AreEqual (true, pageHTML.Contains ("InsertFirstName"), "AfterInsert3"); + + } + + [Test] + [Category ("NunitWeb")] + public void FormView_DeleteAndEmptyTemplatePostback () + { + WebTest t = new WebTest ("FormViewInsertEditDelete.aspx"); + string pageHTML = t.Run (); + + Assert.AreEqual (true, pageHTML.Contains ("1001"), "BeforeDelete1"); + Assert.AreEqual (true, pageHTML.Contains ("Mahesh"), "BeforeDelete2"); + Assert.AreEqual (true, pageHTML.Contains ("Chand"), "BeforeDelete3"); + Assert.AreEqual (true, pageHTML.Contains ("Page$3"), "BeforeDelete4"); + //Delete First Item + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "FormView1$DeleteButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + pageHTML = t.Run (); + Assert.AreEqual (true, pageHTML.Contains ("1002"), "AfterFirstDelete1"); + Assert.AreEqual (true, pageHTML.Contains ("Talmadge"), "AfterFirstDelete2"); + Assert.AreEqual (true, pageHTML.Contains ("Melanie"), "AfterFirstDelete3"); + Assert.AreEqual (true, pageHTML.Contains ("Page$2"), "AfterFirstDelete4"); + Assert.AreEqual (false, pageHTML.Contains ("Page$3"), "AfterFirstDelete5"); + + //Delete second item + + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "FormView1$DeleteButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + pageHTML = t.Run (); + Assert.AreEqual (true, pageHTML.Contains ("1003"), "AfterSecondDelete1"); + Assert.AreEqual (true, pageHTML.Contains ("Bansal"), "AfterSecondDelete2"); + Assert.AreEqual (true, pageHTML.Contains ("Vinay"), "AfterSecondDelete3"); + Assert.AreEqual (false, pageHTML.Contains ("Page$2"), "AfterSecondDelete4"); + + //Delete last item and checking that the EmptyDataTemplate appears. + + fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "FormView1$DeleteButton"; + fr.Controls["__EVENTARGUMENT"].Value = ""; + t.Request = fr; + pageHTML = t.Run (); + Assert.AreEqual (true, pageHTML.Contains ("FormView1_Label1"), "EmptyTemplateTest1"); + Assert.AreEqual (true, pageHTML.Contains ("The Database is empty"), "EmptyTemplateTest2"); + } + + [Test] + public void FormView_CurrentMode () { + FormView view = new FormView (); + view.DefaultMode = FormViewMode.Insert; + Assert.AreEqual (FormViewMode.Insert, view.CurrentMode, "FormView_CurrentMode#1"); + view.ChangeMode (FormViewMode.Edit); + Assert.AreEqual (FormViewMode.Edit, view.CurrentMode, "FormView_CurrentMode#2"); + } + + [Test] + public void FormView_CreateDataSourceSelectArguments2 () { + DataSourceView view; + Page p = new Page (); + + Poker dv = new Poker (); + p.Controls.Add (dv); + + ObjectDataSource data = new ObjectDataSource (); + data.TypeName = typeof (DataSourceObject).AssemblyQualifiedName; + data.SelectMethod = "GetList"; + data.SortParameterName = "sortExpression"; + DataSourceSelectArguments arg; + p.Controls.Add (data); + + dv.DataSource = data; + dv.DataBind (); + + arg = dv.DoCreateDataSourceSelectArguments (); + Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "Default"); + + dv.AllowPaging = true; + dv.PageIndex = 2; + arg = dv.DoCreateDataSourceSelectArguments (); + view = dv.DoGetData (); + Assert.IsFalse (view.CanPage); + Assert.IsTrue (view.CanRetrieveTotalRowCount); + Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "AllowPaging = true, CanPage = false, CanRetrieveTotalRowCount = true"); + + // make DataSourceView.CanPage = true + data.EnablePaging = true; + + arg = dv.DoCreateDataSourceSelectArguments (); + view = dv.DoGetData (); + Assert.IsTrue (view.CanPage); + Assert.IsFalse (view.CanRetrieveTotalRowCount); + Assert.IsTrue (arg.Equals (new DataSourceSelectArguments (2, -1)), "AllowPaging = true, CanPage = true, CanRetrieveTotalRowCount = false"); + + dv.AllowPaging = false; + arg = dv.DoCreateDataSourceSelectArguments (); + Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "AllowPaging = false, CanPage = true, CanRetrieveTotalRowCount = false"); + + // make DataSourceView.CanRetrieveTotalRowCount = true + data.SelectCountMethod = "GetCount"; + + arg = dv.DoCreateDataSourceSelectArguments (); + Assert.IsTrue (arg.Equals (DataSourceSelectArguments.Empty), "AllowPaging = false, CanPage = true, CanRetrieveTotalRowCount = true"); + + dv.AllowPaging = true; + arg = dv.DoCreateDataSourceSelectArguments (); + DataSourceSelectArguments arg1 = new DataSourceSelectArguments (2, 1); + arg1.RetrieveTotalRowCount = true; + view = dv.DoGetData (); + Assert.IsTrue (view.CanPage); + Assert.IsTrue (view.CanRetrieveTotalRowCount); + Assert.IsTrue (arg.Equals (arg1), "AllowPaging = true, CanPage = true, CanRetrieveTotalRowCount = true"); + } + + [Test] + public void FormView_GetPostBackOptions () { + FormView fv = new FormView (); + fv.Page = new Page (); + IButtonControl btn = new Button (); + btn.CausesValidation = false; + Assert.IsFalse (btn.CausesValidation); + Assert.AreEqual (String.Empty, btn.CommandName); + Assert.AreEqual (String.Empty, btn.CommandArgument); + Assert.AreEqual (String.Empty, btn.PostBackUrl); + Assert.AreEqual (String.Empty, btn.ValidationGroup); + PostBackOptions options = ((IPostBackContainer) fv).GetPostBackOptions (btn); + Assert.IsFalse (options.PerformValidation); + Assert.IsFalse (options.AutoPostBack); + Assert.IsFalse (options.TrackFocus); + Assert.IsTrue (options.ClientSubmit); + Assert.IsTrue (options.RequiresJavaScriptProtocol); + Assert.AreEqual ("$", options.Argument); + Assert.AreEqual (null, options.ActionUrl); + Assert.AreEqual (null, options.ValidationGroup); + Assert.IsTrue (object.ReferenceEquals (options.TargetControl, fv)); + + btn.ValidationGroup = "VG"; + btn.CommandName = "CMD"; + btn.CommandArgument = "ARG"; + btn.PostBackUrl = "Page.aspx"; + Assert.IsFalse (btn.CausesValidation); + Assert.AreEqual ("CMD", btn.CommandName); + Assert.AreEqual ("ARG", btn.CommandArgument); + Assert.AreEqual ("Page.aspx", btn.PostBackUrl); + Assert.AreEqual ("VG", btn.ValidationGroup); + options = ((IPostBackContainer) fv).GetPostBackOptions (btn); + Assert.IsFalse (options.PerformValidation); + Assert.IsFalse (options.AutoPostBack); + Assert.IsFalse (options.TrackFocus); + Assert.IsTrue (options.ClientSubmit); + Assert.IsTrue (options.RequiresJavaScriptProtocol); + Assert.AreEqual ("CMD$ARG", options.Argument); + Assert.AreEqual (null, options.ActionUrl); + Assert.AreEqual (null, options.ValidationGroup); + } + + [Test] + [ExpectedException (typeof (InvalidOperationException))] + public void FormView_GetPostBackOptions_CausesValidation () { + FormView fv = new FormView (); + fv.Page = new Page (); + IButtonControl btn = new Button (); + Assert.IsTrue (btn.CausesValidation); + Assert.AreEqual (String.Empty, btn.CommandName); + Assert.AreEqual (String.Empty, btn.CommandArgument); + Assert.AreEqual (String.Empty, btn.PostBackUrl); + Assert.AreEqual (String.Empty, btn.ValidationGroup); + PostBackOptions options = ((IPostBackContainer) fv).GetPostBackOptions (btn); + } + + [Test] + [ExpectedException (typeof (ArgumentNullException))] + public void FormView_GetPostBackOptions_Null_Argument () { + FormView fv = new FormView (); + fv.Page = new Page (); + PostBackOptions options = ((IPostBackContainer) fv).GetPostBackOptions (null); + } + + [Test] + [Category ("NunitWeb")] + public void FormView_RequiresDataBinding () { + PageDelegates delegates = new PageDelegates (); + delegates.LoadComplete = FormView_RequiresDataBinding_LoadComplete; + PageInvoker invoker = new PageInvoker (delegates); + WebTest t = new WebTest (invoker); + t.Run (); + } + + public static void FormView_RequiresDataBinding_LoadComplete (Page p) { + Poker view = new Poker (); + p.Form.Controls.Add (view); + + view.DataSource = new string [] { "A", "B", "C" }; + view.DataBind (); + + Assert.AreEqual (false, view.GetRequiresDataBinding ()); + + view.PagerTemplate = new CompiledTemplateBuilder (BuildTemplateMethod); + Assert.AreEqual (false, view.GetRequiresDataBinding (), "PagerTemplate was set"); + + view.EmptyDataTemplate = new CompiledTemplateBuilder (BuildTemplateMethod); + Assert.AreEqual (false, view.GetRequiresDataBinding (), "EmptyDataTemplate was set"); + + view.HeaderTemplate = new CompiledTemplateBuilder (BuildTemplateMethod); + Assert.AreEqual (false, view.GetRequiresDataBinding (), "HeaderTemplate was set"); + + view.FooterTemplate = new CompiledTemplateBuilder (BuildTemplateMethod); + Assert.AreEqual (false, view.GetRequiresDataBinding (), "FooterTemplate was set"); + + view.EditItemTemplate = new CompiledTemplateBuilder (BuildTemplateMethod); + Assert.AreEqual (false, view.GetRequiresDataBinding (), "EditItemTemplate was set"); + + view.InsertItemTemplate = new CompiledTemplateBuilder (BuildTemplateMethod); + Assert.AreEqual (false, view.GetRequiresDataBinding (), "InsertItemTemplate was set"); + + view.ItemTemplate = new CompiledTemplateBuilder (BuildTemplateMethod); + Assert.AreEqual (false, view.GetRequiresDataBinding (), "ItemTemplate was set"); + } + + public static void BuildTemplateMethod (Control c) { } + [Test] + public void ModifiedOuterTableStylePropertyName () + { + var fv = new Poker (); + string props; + + props = fv.CallModifiedOuterTableStylePropertyName (); + Assert.AreEqual (String.Empty, props, "#A1"); + + fv.BackImageUrl = "http://example.com/image.png"; + props = fv.CallModifiedOuterTableStylePropertyName (); + Assert.IsNotNull (props, "#A2-1"); + Assert.AreEqual ("BackImageUrl", props, "#A2-2"); + + fv = new Poker (); + fv.CellPadding = 10; + props = fv.CallModifiedOuterTableStylePropertyName (); + Assert.IsNotNull (props, "#A3-1"); + Assert.AreEqual ("CellPadding", props, "#A3-2"); + + fv = new Poker (); + fv.CellSpacing = 10; + props = fv.CallModifiedOuterTableStylePropertyName (); + Assert.IsNotNull (props, "#A4-1"); + Assert.AreEqual ("CellSpacing", props, "#A4-2"); + + fv = new Poker (); + fv.GridLines = GridLines.Both; + props = fv.CallModifiedOuterTableStylePropertyName (); + Assert.IsNotNull (props, "#A5-1"); + Assert.AreEqual ("GridLines", props, "#A5-2"); + + fv = new Poker (); + fv.HorizontalAlign = HorizontalAlign.Justify; + props = fv.CallModifiedOuterTableStylePropertyName (); + Assert.IsNotNull (props, "#A6-1"); + Assert.AreEqual ("HorizontalAlign", props, "#A6-2"); + + fv = new Poker (); + fv.Font.Bold = true; + props = fv.CallModifiedOuterTableStylePropertyName (); + Assert.IsNotNull (props, "#A6-1"); + Assert.AreEqual ("Font", props, "#A6-2"); + + // Just one property is reported at a time + fv = new Poker (); + fv.BackImageUrl = "http://example.com/image.png"; + fv.CellPadding = 10; + props = fv.CallModifiedOuterTableStylePropertyName (); + Assert.IsNotNull (props, "#B1-1"); + Assert.AreEqual ("BackImageUrl", props, "#B1-2"); + } + } + + public class TestMyData + { + static IList str; + //str.(new int[] { 1, 2, 3, 4, 5, 6 }); + + static TestMyData () + { + InitData (); + } + + public static void InitData() + { + str = new List (); + for (int i=1;i<7;i++) + str.Add (i); + } + public static IList GetMyList() + { + return str; + } + + public static int UpdateList(int index, int value) + { + str[index] = value; + return str[index]; + } + + public static int InsertList(int value) + { + str.Add(value); + return value; + } + + public static void DeleteList(int value) + { + str.Remove(value); + } + + } + + public class MyTemplate : ITemplate + { + + Label l = new Label (); +#region ITemplate Members + + public void InstantiateIn (Control container) + { + container.Controls.Add (l); + + } + + public void SetDataItem (object value) + { + l.Text = value.ToString (); + } + +#endregion + } + +public class FormViewDataObject + { + + public static DataTable ds = CreateDataTable(); + + public static DataTable Select() + { + + return ds; + + } + + + + public static DataTable Delete(string ID, string FName, string LName) + { + + DataRow dr = ds.Rows.Find(ID); + + if (dr != null) + { + + ds.Rows.Remove(dr); + + } + + return ds; + + } + + + + public static DataTable Insert(string ID, string FName, string LName) + { + + DataRow dr = ds.NewRow(); + dr["ID"] = ID; + dr["FName"] = FName; + dr["LName"] = LName; + ds.Rows.Add(dr); + return ds; + } + + + + public static DataTable Update(string ID, string FName, string LName) + { + DataRow dr = ds.Rows.Find(ID); + if (dr == null) + { + Label lbl = new Label(); + lbl.Text = "ID doesn't exist "; + return ds; + } + dr["FName"] = FName; + dr["LName"] = LName; + return ds; + + } + + + + public static DataTable CreateDataTable() + { + + DataTable aTable = new DataTable("A"); + DataColumn dtCol; + DataRow dtRow; + + // Create ID column and add to the DataTable. + + dtCol = new DataColumn(); + dtCol.DataType = Type.GetType("System.Int32"); + dtCol.ColumnName = "ID"; + dtCol.AutoIncrement = true; + dtCol.Caption = "ID"; + dtCol.ReadOnly = true; + dtCol.Unique = true; + aTable.Columns.Add(dtCol); + + + + // Create Name column and add to the table + + dtCol = new DataColumn(); + dtCol.DataType = Type.GetType("System.String"); + dtCol.ColumnName = "FName"; + dtCol.AutoIncrement = false; + dtCol.Caption = "First Name"; + dtCol.ReadOnly = false; + dtCol.Unique = false; + aTable.Columns.Add(dtCol); + + + + // Create Last Name column and add to the table. + + dtCol = new DataColumn(); + dtCol.DataType = Type.GetType("System.String"); + dtCol.ColumnName = "LName"; + dtCol.AutoIncrement = false; + dtCol.Caption = "Last Name"; + dtCol.ReadOnly = false; + dtCol.Unique = false; + aTable.Columns.Add(dtCol); + + + + // Create three rows to the table + + dtRow = aTable.NewRow(); + dtRow["ID"] = 1001; + dtRow["FName"] = "Mahesh"; + dtRow["LName"] = "Chand"; + aTable.Rows.Add(dtRow); + + dtRow = aTable.NewRow(); + dtRow["ID"] = 1002; + dtRow["FName"] = "Melanie"; + dtRow["LName"] = "Talmadge"; + aTable.Rows.Add(dtRow); + + dtRow = aTable.NewRow(); + dtRow["ID"] = 1003; + dtRow["FName"] = "Vinay"; + dtRow["LName"] = "Bansal"; + aTable.Rows.Add(dtRow); + + aTable.PrimaryKey = new DataColumn[] { aTable.Columns["ID"] }; + return aTable; + + } + } +} + + diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs.REMOVED.git-id b/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs.REMOVED.git-id deleted file mode 100644 index 7d7876dd97..0000000000 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -b4d8d304db7540d11f79acbf97c5c27983983838 \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/GridViewTest.cs.REMOVED.git-id b/mcs/class/System.Web/Test/System.Web.UI.WebControls/GridViewTest.cs.REMOVED.git-id index b16666e130..3f69945c6a 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/GridViewTest.cs.REMOVED.git-id +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/GridViewTest.cs.REMOVED.git-id @@ -1 +1 @@ -2f38ba4b556ad9983b3585b4831ef907f227fc94 \ No newline at end of file +7561fd84425b70a803d0918521917d5d9deb3e8c \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/HyperLinkTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/HyperLinkTest.cs index af0ffcd739..cdfe04bfb9 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/HyperLinkTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/HyperLinkTest.cs @@ -81,11 +81,7 @@ namespace MonoTests.System.Web.UI.WebControls { [Test] public void ImageUrlWithoutText () { -#if NET_4_0 string origHtml = "\"\""; -#else - string origHtml = ""; -#endif TestHyperLink hl = new TestHyperLink (); hl.ImageUrl = imageUrl; Assert.AreEqual (imageUrl, hl.ImageUrl, "ImageUrl"); @@ -101,11 +97,7 @@ namespace MonoTests.System.Web.UI.WebControls { [Test] public void ImageUrlWithoutText_ToolTip () { -#if NET_4_0 string origHtml = "\"\""; -#else - string origHtml = ""; -#endif TestHyperLink hl = new TestHyperLink (); hl.ImageUrl = imageUrl; hl.ToolTip = "Some message"; @@ -136,11 +128,7 @@ namespace MonoTests.System.Web.UI.WebControls { [Test] public void ImageUrl_NO_ResolveUrl () { -#if NET_4_0 string origHtml = "\"\""; -#else - string origHtml = ""; -#endif TestHyperLink hl = new TestHyperLink (); hl.ImageUrl = "~/ben.jpeg"; Assert.AreEqual ("~/ben.jpeg", hl.ImageUrl, "ImageUrl"); diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageButtonTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageButtonTest.cs index 0cb462e762..f15a00fe4d 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageButtonTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageButtonTest.cs @@ -237,11 +237,7 @@ namespace MonoTests.System.Web.UI.WebControls [Test] public void Text () { -#if NET_4_0 string origHtml = ""; -#else - string origHtml = ""; -#endif PokerImageButton b = new PokerImageButton (); b.Text = "MyText"; string html = b.Render (); diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageFieldTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageFieldTest.cs index 1f9e1bea4a..b413ce2f2e 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageFieldTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageFieldTest.cs @@ -299,11 +299,7 @@ namespace MonoTests.System.Web.UI.WebControls t.Invoker = new PageInvoker (pd); string htmlPage = t.Run (); -#if NET_4_0 string htmlOrigin = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
Data
\"Item:
\"Item:
\"Item:
\"Item:
\"Item:
\r\n
"; -#else - string htmlOrigin = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
Data
\"Item:
\"Item:
\"Item:
\"Item:
\"Item:
\r\n
"; -#endif string htmlControl = HtmlDiff.GetControlFromPageHtml (htmlPage); HtmlDiff.AssertAreEqual (htmlOrigin, htmlControl, "GetFormattedAlternateText"); } @@ -372,11 +368,7 @@ namespace MonoTests.System.Web.UI.WebControls pd.PreRender = _ConvertEmptyStringToNull; t.Invoker = new PageInvoker (pd); string htmlPage = t.Run (); -#if NET_4_0 string htmlOrigin = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
DataField
 
 
 
 
 
\r\n
"; -#else - string htmlOrigin = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
DataField
 
 
 
 
 
\r\n
"; -#endif string htmlControl = HtmlDiff.GetControlFromPageHtml (htmlPage); HtmlDiff.AssertAreEqual (htmlOrigin, htmlControl, "ConvertEmptyStringToNull"); } diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageMapTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageMapTest.cs index 64863d73e7..ff078412d9 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageMapTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageMapTest.cs @@ -133,11 +133,7 @@ namespace MonoTests.System.Web.UI.WebControls public void ImageMap_Defaults_Render () { PokerImageMap imageMap = new PokerImageMap (); -#if NET_4_0 string originalHtml = ""; -#else - string originalHtml = ""; -#endif string renderedHtml = imageMap.Render (); HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderDefault"); } @@ -154,11 +150,7 @@ namespace MonoTests.System.Web.UI.WebControls CircleHotSpot circle = new CircleHotSpot (); circle.NavigateUrl = "NavigateURL"; imageMap.HotSpots.Add (circle); -#if NET_4_0 string originalHtml = "\r\n\t\"\"\r\n"; -#else - string originalHtml = "\r\n\t\"\"\r\n"; -#endif string renderedHtml = imageMap.Render (); HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderNavigateTextAssigned"); } @@ -180,11 +172,7 @@ namespace MonoTests.System.Web.UI.WebControls circle.X = 30; circle.Y = 40; imageMap.HotSpots.Add (circle); -#if NET_4_0 string originalHtml = "\r\n\t\"Circle\"\r\n"; -#else - string originalHtml = "\r\n\t\"Circle\"\r\n"; -#endif string renderedHtml = imageMap.Render (); HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderNavigateCircleTextAssigned"); } @@ -216,11 +204,7 @@ namespace MonoTests.System.Web.UI.WebControls poly.TabIndex = 2; poly.Coordinates = "10,20,30,40,50,60,100,200"; imageMap.HotSpots.Add (poly); -#if NET_4_0 string originalHtml = "\r\n\t\"Rectangle\"\"Polygon\"\r\n"; -#else - string originalHtml = "\r\n\t\"Rectangle\"\"Polygon\"\r\n"; -#endif string renderedHtml = imageMap.Render (); HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderNavigateShapesTextAssigned"); } @@ -235,11 +219,7 @@ namespace MonoTests.System.Web.UI.WebControls imageMap.HotSpotMode = HotSpotMode.Inactive; imageMap.Target = "Target"; imageMap.HotSpots.Add (new CircleHotSpot ()); -#if NET_4_0 string originalHtml = "\r\n\t\"\"\r\n"; -#else - string originalHtml = "\r\n\t\"\"\r\n"; -#endif string renderedHtml = imageMap.Render (); HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderInaciveTextAssigned"); } @@ -256,11 +236,7 @@ namespace MonoTests.System.Web.UI.WebControls CircleHotSpot circle = new CircleHotSpot (); circle.NavigateUrl = "NavigateURL"; imageMap.HotSpots.Add (circle); -#if NET_4_0 string originalHtml = "\r\n\t\"\"\r\n"; -#else - string originalHtml = "\r\n\t\"\"\r\n"; -#endif string renderedHtml = imageMap.Render (); HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderDisabledTextAssigne"); } @@ -470,11 +446,7 @@ namespace MonoTests.System.Web.UI.WebControls { WebTest t = new WebTest (PageInvoker.CreateOnLoad (myPageLoad)); #region orig -#if NET_4_0 string strTarget = "\r\n\t\"\"\"\"\"\"\r\n"; -#else - string strTarget = "\r\n\t\"\"\"\"\"\"\r\n"; -#endif #endregion string RenderedPageHtml = t.Run (); string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); @@ -494,11 +466,7 @@ namespace MonoTests.System.Web.UI.WebControls fr.Controls["__EVENTARGUMENT"].Value = "0"; t.Request = fr; #region orig -#if NET_4_0 string strTarget = "\r\n\t\"\"\"\"\"\"\r\n"; -#else - string strTarget = "\r\n\t\"\"\"\"\"\"\r\n"; -#endif #endregion string RenderedPageHtml = t.Run (); string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageTest.cs index 3bc92fa124..2afd9e1b6a 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ImageTest.cs @@ -167,11 +167,7 @@ namespace MonoTests.System.Web.UI.WebControls { img.Enabled = false; string html = img.Render (); -#if NET_4_0 Assert.IsTrue (html.IndexOf (" class=\"aspNetDisabled\"") > 0, "#"); -#else - Assert.IsTrue (html.IndexOf (" disabled=\"") > 0, "#"); -#endif } [Test] @@ -196,21 +192,12 @@ namespace MonoTests.System.Web.UI.WebControls { s = i.Render (); Assert.IsTrue (i.Render ().IndexOf (" alt=\"alt\"") > 0, "alt"); i.AlternateText = String.Empty; -#if NET_4_0 s = i.Render (); Assert.IsTrue (s.IndexOf (" class=\"aspNetDisabled\"") < 0, "enabled"); i.Enabled = false; s = i.Render (); Assert.IsTrue (s.IndexOf (" class=\"aspNetDisabled\"") > 0, "disabled"); i.Enabled = true; -#else - s = i.Render (); - Assert.IsTrue (i.Render ().IndexOf (" disabled=\"disabled\"") < 0, "enabled"); - i.Enabled = false; - s = i.Render (); - Assert.IsTrue (i.Render ().IndexOf (" disabled=\"disabled\"") > 0, "disabled"); - i.Enabled = true; -#endif // note: align is in mixed-case in 1.x so we lower everything to test i.ImageAlign = ImageAlign.AbsBottom; diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/MasterPageTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/MasterPageTest.cs index bb97516436..02fc853705 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/MasterPageTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/MasterPageTest.cs @@ -73,7 +73,6 @@ namespace MonoTests.System.Web.UI.WebControls [TestFixture] public class MasterPageTest { -#if NET_4_0 class MyTemplate : ITemplate { public const string MyText = "|MyTemplate.InstantiateIn called|"; @@ -93,7 +92,6 @@ namespace MonoTests.System.Web.UI.WebControls container.Controls.Add (new LiteralControl (MyText)); } } -#endif [TestFixtureSetUp] public void CopyTestResources () { @@ -215,7 +213,6 @@ namespace MonoTests.System.Web.UI.WebControls if (PageRenderHtml.IndexOf ("FromMasterMethod") < 0) Assert.Fail ("MasterType TypeName test failed"); } -#if NET_4_0 [Test] public void InstantiateInContentPlaceHolder () { @@ -295,7 +292,6 @@ namespace MonoTests.System.Web.UI.WebControls return false; } -#endif public static void _RenderDefault (Page p) { p.Form.Controls.Add(new LiteralControl("Page dynamic text")); diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/MenuItemBindingTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/MenuItemBindingTest.cs index a9107f8585..7921e1e234 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/MenuItemBindingTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/MenuItemBindingTest.cs @@ -31,7 +31,6 @@ using System.Web.UI; using System.Web.UI.WebControls; using NUnit.Framework; -#if NET_4_0 namespace MonoTests.System.Web.UI.WebControls { [TestFixture] @@ -126,4 +125,3 @@ namespace MonoTests.System.Web.UI.WebControls } } } -#endif \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/MenuTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/MenuTest.cs new file mode 100644 index 0000000000..868e447a27 --- /dev/null +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/MenuTest.cs @@ -0,0 +1,1786 @@ +// +// Tests for System.Web.UI.WebControls.MenuTest.cs +// +// Author: +// Yoni Klein (yonik@mainsoft.com) +// +// +// Copyright (C) 2005 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + +using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.IO; +using System.Drawing; +using System.Threading; +using MyWebControl = System.Web.UI.WebControls; +using System.Collections; +using MonoTests.SystemWeb.Framework; +using MonoTests.stand_alone.WebHarness; +using System.Text.RegularExpressions; +using System.Reflection; +using System.Xml; + +using MonoTests.Common; + +namespace MonoTests.System.Web.UI.WebControls +{ + class MenuTable : Menu + { + public MenuTable () + { + RenderingMode = MenuRenderingMode.Table; + } + } + + class PokerMenu : Menu + { + public PokerMenu () + { + TrackViewState(); + } + public StateBag StateBag + { + get { return base.ViewState; } + } + public HtmlTextWriterTag OnTagKey() + { + return TagKey; + } + public void DoOnDataBind(EventArgs e) + { + OnDataBinding(e); + } + public void DoOnDataBound (EventArgs e) + { + OnDataBound(e); + } + public void DoCreateChildControls () + { + CreateChildControls (); + } + public void DoEnsureDataBound () + { + EnsureDataBound (); + } + public void DoLoadViewState (object state) + { + LoadViewState (state); + } + public object DoSaveViewState () + { + return SaveViewState (); + } + public void DoLoadControlState (object state) + { + LoadControlState (state); + } + public object DoSaveControlState () + { + return SaveControlState (); + } + public void DoOnMenuItemClick (MenuEventArgs e) + { + OnMenuItemClick(e); + } + public void DoOnInit(EventArgs e) + { + OnInit(e); + } + public void DoMenuItemDataBound (MenuEventArgs e) + { + OnMenuItemDataBound (e); + } + public void DoOnPreRender (EventArgs e) + { + base.OnPreRender(e); + } + public bool DoOnBubbleEvent(EventArgs e) + { + return base.OnBubbleEvent(this,e); + } + } + + [Serializable] + [TestFixture] + public class MenuTest + { + + [TestFixtureSetUp] + public void SetUp () + { + WebTest.CopyResource (GetType (), "menuclass.aspx", "menuclass.aspx"); + WebTest.CopyResource (GetType (), "PostBackMenuTest.aspx", "PostBackMenuTest.aspx"); + } + + [Test] + public void Menu_DefaultProperties () + { + PokerMenu p = new PokerMenu (); + Assert.AreEqual ("Click",PokerMenu.MenuItemClickCommandName,"Staic_MenuItemClickCommandName"); + Assert.AreEqual (0,p.Controls.Count,"ControlsCollection"); + Assert.AreEqual (0,p.DataBindings.Count,"DataBindings"); + Assert.AreEqual (500,p.DisappearAfter,"DisappearAfter"); + Assert.AreEqual (string.Empty, p.DynamicBottomSeparatorImageUrl, "DynamicBottomSeparatorImageUrl"); + Assert.IsTrue (p.DynamicEnableDefaultPopOutImage, "DynamicEnableDefaultPopOutImage"); + Assert.AreEqual (0, p.DynamicHorizontalOffset, "DynamicHorizontalOffset"); + Assert.IsNotNull (p.DynamicHoverStyle, "DynamicHoverStyle"); + Assert.AreEqual ("", p.DynamicItemFormatString, "DynamicItemFormatString"); + Assert.IsNull (p.DynamicItemTemplate, "DynamicItemTemplate"); + Assert.IsNotNull (p.DynamicMenuItemStyle, "DynamicMenuItemStyle"); + Assert.IsNotNull (p.DynamicMenuStyle, "DynamicMenuStyle"); + Assert.AreEqual (string.Empty,p.DynamicPopOutImageUrl,"DynamicPopOutImageUrl"); + Assert.IsNotNull (p.DynamicSelectedStyle, "DynamicSelectedStyle"); + Assert.AreEqual (string.Empty, p.DynamicTopSeparatorImageUrl, "DynamicTopSeparatorImageUrl"); + Assert.AreEqual (0, p.DynamicVerticalOffset, "DynamicVerticalOffset"); + Assert.AreEqual (0, p.Items.Count, "Items"); + Assert.AreEqual (false, p.ItemWrap, "ItemWrap"); + Assert.IsNotNull (p.LevelSelectedStyles, "LevelSelectedStyles"); + Assert.IsNotNull (p.LevelSubMenuStyles, "LevelSubMenuStyles"); + Assert.AreEqual (3, p.MaximumDynamicDisplayLevels, "MaximumDynamicDisplayLevels"); + Assert.AreEqual (Orientation.Vertical, p.Orientation, "Orientation"); + Assert.AreEqual ("/", p.PathSeparator.ToString(), "PathSeparator"); + Assert.AreEqual (string.Empty, p.ScrollDownImageUrl, "ScrollDownImageUrl"); + Assert.AreEqual (null, p.SelectedItem, "p.SelectedItem"); + Assert.AreEqual (string.Empty, p.StaticBottomSeparatorImageUrl, "StaticBottomSeparatorImageUrl"); + Assert.AreEqual (1, p.StaticDisplayLevels, "StaticDisplayLevels"); + Assert.AreEqual (true, p.StaticEnableDefaultPopOutImage, "StaticEnableDefaultPopOutImage"); + Assert.IsNotNull (p.StaticHoverStyle, "StaticHoverStyle"); + Assert.AreEqual ("", p.StaticItemFormatString, "StaticItemFormatString"); + Assert.AreEqual (null, p.StaticItemTemplate, "StaticItemTemplate"); + Assert.IsNotNull (p.StaticMenuItemStyle, "StaticMenuItemStyle"); + Assert.IsNotNull (p.StaticMenuStyle, "StaticMenuStyle"); + Assert.AreEqual ("", p.StaticPopOutImageUrl, "StaticPopOutImageUrl"); + Assert.IsNotNull (p.StaticSelectedStyle, "StaticSelectedStyle"); + Assert.IsTrue (p.StaticSubMenuIndent.IsEmpty, "StaticSubMenuIndent"); + Assert.AreEqual ("", p.StaticTopSeparatorImageUrl, "StaticTopSeparatorImageUrl"); + Assert.AreEqual ("", p.Target, "Target"); + Assert.IsNotNull (p.OnTagKey (), "TagKey"); + + } + + [Test] + public void Menu_DefaultProperties_2 () + { + PokerMenu p = new PokerMenu (); + Assert.AreEqual ("Skip Navigation Links", p.SkipLinkText, "SkipLinkText"); + Assert.AreEqual (string.Empty, p.SelectedValue, "SelectedValue"); + Assert.AreEqual ("Scroll up", p.ScrollUpText, "ScrollUpText"); + Assert.AreEqual ("Expand {0}", p.StaticPopOutImageTextFormatString, "StaticPopOutImageTextFormatString"); //not implemented + Assert.AreEqual ("Scroll down", p.ScrollDownText, "ScrollDownText"); + Assert.AreEqual ("Expand {0}", p.DynamicPopOutImageTextFormatString, "DynamicPopOutImageTextFormatString"); //not implemented + } + + + + [Test] + public void Menu_ChangeDefaultProperties () + { + PokerMenu p = new PokerMenu (); + Button B = new Button (); + p.Controls.Add (B); + Assert.AreEqual (1,p.Controls.Count, "ControlsCollection"); + + MenuItemBinding M = new MenuItemBinding (); + M.DataMember = "test"; + M.Depth = 0; + M.TextField = "title"; + M.NavigateUrl="url"; + Object C = p.DataBindings; + Assert.AreEqual (0, p.DataBindings.Count, "DataBindings#1"); + ((MenuItemBindingCollection)C).Add (M); + Assert.AreEqual (1,p.DataBindings.Count,"DataBindings#2"); + + p.DisappearAfter = 100; + Assert.AreEqual (100, p.DisappearAfter, "DisappearAfter"); + + p.DynamicBottomSeparatorImageUrl = "test.aspx"; + Assert.AreEqual ("test.aspx", p.DynamicBottomSeparatorImageUrl, "DynamicBottomSeparatorImageUrl"); + + p.DynamicEnableDefaultPopOutImage = false; + Assert.AreEqual (false,p.DynamicEnableDefaultPopOutImage, "DynamicEnableDefaultPopOutImage"); + + p.DynamicHorizontalOffset = 10; + Assert.AreEqual (10, p.DynamicHorizontalOffset, "DynamicHorizontalOffset"); + + p.DynamicHoverStyle.BackColor = Color.Red; + Assert.AreEqual (Color.Red ,p.DynamicHoverStyle.BackColor, "DynamicHoverStyle"); + + p.DynamicItemFormatString = "Mytest"; + Assert.AreEqual ("Mytest", p.DynamicItemFormatString, "DynamicItemFormatString"); + + MyWebControl.Image myImage = new MyWebControl.Image (); + myImage.ImageUrl = "myimage.jpg"; + ImageTemplate Template = new ImageTemplate (); + Template.MyImage = myImage; + // end create template image + p.DynamicItemTemplate = Template; + Assert.IsNotNull (p.DynamicItemTemplate, "RootNodeTemplate"); + Assert.AreEqual (typeof (ImageTemplate), p.DynamicItemTemplate.GetType (), "RootNodeTemplate#1"); + + p.DynamicMenuItemStyle.BackColor = Color.Red; + Assert.AreEqual (Color.Red, p.DynamicMenuItemStyle.BackColor, "DynamicMenuItemStyle"); + + p.DynamicMenuStyle.BackColor = Color.Red; + Assert.AreEqual (Color.Red,p.DynamicMenuStyle.BackColor, "DynamicMenuStyle"); + + p.DynamicPopOutImageUrl = "test"; + Assert.AreEqual ("test", p.DynamicPopOutImageUrl, "DynamicPopOutImageUrl"); + + p.DynamicSelectedStyle.BackColor = Color.Red; + Assert.AreEqual (Color.Red,p.DynamicSelectedStyle.BackColor, "DynamicSelectedStyle"); + + p.DynamicTopSeparatorImageUrl = "test"; + Assert.AreEqual ("test", p.DynamicTopSeparatorImageUrl, "DynamicTopSeparatorImageUrl"); + + p.DynamicVerticalOffset = 10; + Assert.AreEqual (10, p.DynamicVerticalOffset, "DynamicVerticalOffset"); + + MenuItem I = new MenuItem (); + I.NavigateUrl = "default.aspx"; + I.Text = "MyText"; + I.ToolTip = "Test"; + p.Items.Add (I); + Assert.AreEqual (1, p.Items.Count, "Items"); + + p.ItemWrap = true; + Assert.AreEqual (true, p.ItemWrap, "ItemWrap"); + + MenuItemStyle S = new MenuItemStyle (); + S.BackColor = Color.Red; + p.LevelSelectedStyles.Add (S); + Assert.AreEqual (1,p.LevelSelectedStyles.Count , "LevelSelectedStyles#1"); + Assert.AreEqual (true, p.LevelSelectedStyles.Contains (S), "LevelSelectedStyles#2"); + + SubMenuStyle SM = new SubMenuStyle (); + SM.BackColor = Color.Red; + p.LevelSubMenuStyles.Add (SM); + Assert.AreEqual(1, p.LevelSubMenuStyles.Count, "LevelSubMenuStyles#1"); + Assert.AreEqual (true, p.LevelSubMenuStyles.Contains (SM), "LevelSubMenuStyles#2"); + + p.MaximumDynamicDisplayLevels = 5; + Assert.AreEqual (5, p.MaximumDynamicDisplayLevels, "MaximumDynamicDisplayLevels"); + + p.Orientation = Orientation.Horizontal; + Assert.AreEqual (Orientation.Horizontal, p.Orientation, "Orientation"); + + p.PathSeparator = 'A'; + Assert.AreEqual ('A', p.PathSeparator, "PathSeparator"); + + p.ScrollDownImageUrl = "test"; + Assert.AreEqual ("test", p.ScrollDownImageUrl, "ScrollDownImageUrl"); + + p.ScrollDownText = "test"; + Assert.AreEqual ("test", p.ScrollDownText, "ScrollDownText"); + + // This properties will be checked in events part of tests + // Assert.AreEqual (0, p.SelectedItem, "p.SelectedItem"); + // Assert.AreEqual (string.Empty, p.SelectedValue, "SelectedValue"); + + p.SkipLinkText = "test"; + Assert.AreEqual ("test", p.SkipLinkText, "SkipLinkText"); + + p.StaticBottomSeparatorImageUrl = "test"; + Assert.AreEqual ("test", p.StaticBottomSeparatorImageUrl, "StaticBottomSeparatorImageUrl"); + + p.StaticDisplayLevels = 2; + Assert.AreEqual (2, p.StaticDisplayLevels, "StaticDisplayLevels"); + + p.StaticEnableDefaultPopOutImage = false; + Assert.AreEqual (false, p.StaticEnableDefaultPopOutImage, "StaticEnableDefaultPopOutImage"); + + p.StaticHoverStyle.BackColor = Color.Red; + Assert.AreEqual(Color.Red, p.StaticHoverStyle.BackColor, "StaticHoverStyle"); + + p.StaticItemFormatString = "test"; + Assert.AreEqual ("test", p.StaticItemFormatString, "StaticItemFormatString"); + + + p.StaticItemTemplate = Template; + Assert.IsNotNull (p.StaticItemTemplate, "StaticItemTemplate"); + + p.StaticMenuItemStyle.BackColor = Color.Red; + Assert.AreEqual(Color.Red,p.StaticMenuItemStyle.BackColor, "StaticMenuItemStyle"); + + p.StaticMenuStyle.BackColor = Color.Red; + Assert.AreEqual (Color.Red,p.StaticMenuStyle.BackColor, "StaticMenuStyle"); + + p.StaticPopOutImageUrl = "test"; + Assert.AreEqual ("test", p.StaticPopOutImageUrl, "StaticPopOutImageUrl"); + + p.StaticSelectedStyle.BackColor = Color.Red; + Assert.AreEqual(Color.Red,p.StaticSelectedStyle.BackColor, "StaticSelectedStyle"); + + p.StaticSubMenuIndent = 20; + Assert.AreEqual (Unit.Pixel (20), p.StaticSubMenuIndent, "StaticSubMenuIndent"); + + p.StaticTopSeparatorImageUrl = "test"; + Assert.AreEqual ("test", p.StaticTopSeparatorImageUrl, "StaticTopSeparatorImageUrl"); + + p.Target = "test"; + Assert.AreEqual ("test", p.Target, "Target"); + } + + [Test] + public void Menu_ChangeDefaultProperties_2 () + { + PokerMenu p = new PokerMenu (); + p.ScrollUpText = "test"; + Assert.AreEqual ("test", p.ScrollUpText, "ScrollUpText"); + p.DynamicPopOutImageTextFormatString = "test"; + Assert.AreEqual ("test", p.DynamicPopOutImageTextFormatString, "DynamicPopOutImageTextFormatString"); + p.StaticPopOutImageTextFormatString = "test"; + Assert.AreEqual ("test", p.StaticPopOutImageTextFormatString, "StaticPopOutImageTextFormatString"); + } + + [Test] + public void Menu_ControlState() + { + PokerMenu p = new PokerMenu (); + MenuItem I1 = new MenuItem (); + MenuItem I2 = new MenuItem (); + p.Items.Add (I1); + p.Items.Add (I2); + MenuEventArgs e = new MenuEventArgs (I1); + p.DoOnMenuItemClick (e); + object state = p.DoSaveControlState (); + p.DoLoadControlState (state); + e = new MenuEventArgs (I2); + p.DoOnMenuItemClick (e); + Console.WriteLine(); + } + + [Test] + public void Menu_FindItem () + { + PokerMenu p = new PokerMenu (); + MenuItem I = new MenuItem (); + string path = I.ValuePath; + p.Items.Add (I); + MenuItem V = new MenuItem (); + I.ChildItems.Add (V); + MenuItem copy = p.FindItem (path); + Assert.AreEqual (I, copy, "FindItem#1"); + path = V.ValuePath; + Assert.AreEqual (V, p.FindItem (path), "FindItem#2"); + } + + + // Set & Get DesignModeState dosn't tested + // Can't test on Page Load event + + + [Test] + [Category ("NunitWeb")] + public void Menu_RenderBeginTag () + { + new WebTest (PageInvoker.CreateOnLoad (_BeginTagRender)).Run (); + } + + public static void _BeginTagRender(Page p) + { + PokerMenu pm = new PokerMenu (); + pm.RenderingCompatibility = new Version (2, 0); + p.Form.Controls.Add (pm); + StringWriter sw = new StringWriter (); + HtmlTextWriter tw = new HtmlTextWriter (sw); + pm.RenderBeginTag (tw); + string RenderedControlHtml = sw.ToString(); + string OriginControlHtml = "\"Skip\r\n"; + HtmlDiff.AssertAreEqual(OriginControlHtml,RenderedControlHtml,"RenderBeginTag"); + } + [Test] + [Category ("NunitWeb")] + public void Menu_RenderBeginTag_List () + { + new WebTest (PageInvoker.CreateOnLoad (_BeginTagRender_List)).Run (); + } + + public static void _BeginTagRender_List (Page p) + { + PokerMenu pm = new PokerMenu (); + pm.RenderingCompatibility = new Version (4, 0); + pm.RenderingMode = MenuRenderingMode.List; + + p.Form.Controls.Add (pm); + StringWriter sw = new StringWriter (); + HtmlTextWriter tw = new HtmlTextWriter (sw); + pm.RenderBeginTag (tw); + string RenderedControlHtml = sw.ToString (); + string OriginControlHtml = "\"Skip
\r\n"; + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderBeginTag_List"); + } + [Test] + [Category ("NunitWeb")] + public void Menu_RenderEndTag () + { + new WebTest (PageInvoker.CreateOnLoad (_EndTagRender)).Run (); + } + public static void _EndTagRender (Page p) + { + PokerMenu pm = new PokerMenu (); + pm.RenderingCompatibility = new Version (2, 0); + p.Form.Controls.Add (pm); + StringWriter sw = new StringWriter (); + HtmlTextWriter tw = new HtmlTextWriter (sw); + pm.RenderBeginTag (tw); + pm.RenderEndTag (tw); + string RenderedControlHtml = sw.ToString (); + string OriginControlHtml = "\"Skip
\r\n\r\n
"; + HtmlDiff.AssertAreEqual(OriginControlHtml, RenderedControlHtml,"RenderEndTag"); + } + [Test] + [Category ("NunitWeb")] + public void Menu_RenderEndTag_List () + { + new WebTest (PageInvoker.CreateOnLoad (_EndTagRender_List)).Run (); + } + public static void _EndTagRender_List (Page p) + { + PokerMenu pm = new PokerMenu (); + pm.RenderingCompatibility = new Version (4, 0); + pm.RenderingMode = MenuRenderingMode.List; + + p.Form.Controls.Add (pm); + StringWriter sw = new StringWriter (); + HtmlTextWriter tw = new HtmlTextWriter (sw); + pm.RenderBeginTag (tw); + pm.RenderEndTag (tw); + string RenderedControlHtml = sw.ToString (); + string OriginControlHtml = "\"Skip
\r\n\r\n
"; + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderEndTag"); + } + [Test] + public void Menu_DataBind () { + Page p = new Page (); + Menu m = CreateMenu (); + m.DataBinding += new EventHandler (m_DataBinding); + m.DataBound += new EventHandler (m_DataBound); + p.Controls.Add (m); + + ResetTemplateBoundFlags (); + m.DataBind (); + } + + static void m_DataBinding (object sender, EventArgs e) { + Assert.AreEqual (true, _StaticTemplateCreated, "StaticTemplateCreated"); + Assert.AreEqual (true, _DynamicTemplateCreated, "DynamicTemplateCreated"); + } + + static void m_DataBound (object sender, EventArgs e) { + Assert.AreEqual (true, _StaticTemplateBound, "StaticTemplateBound"); + Assert.AreEqual (true, _DynamicTemplateBound, "DynamicTemplateBound"); + } + + private static void ResetTemplateBoundFlags() { + _StaticTemplateBound = false; + _DynamicTemplateBound = false; + _StaticTemplateCreated = false; + _DynamicTemplateCreated = false; + } + + static Menu CreateMenu () { + Menu m = new MenuTable (); + MenuItem rootItem = new MenuItem ("RootItem-Text", "RootItem-Value"); + m.Items.Add (rootItem); + rootItem.ChildItems.Add (new MenuItem ("Node1-Text", "Node1-Value")); + rootItem.ChildItems.Add (new MenuItem ("Node2-Text", "Node2-Value")); + m.StaticItemTemplate = new CompiledTemplateBuilder (_StaticItemTemplate); + m.DynamicItemTemplate = new CompiledTemplateBuilder (_DynamicItemTemplate); + return m; + } + + [Test] + [Category ("NunitWeb")] + public void Menu_DataBindByDataSourceID () { + PageDelegates pd = new PageDelegates (); + pd.Init = Menu_DataBindByDataSourceID_PageInit; + pd.PreRenderComplete = Menu_DataBindByDataSourceID_PagePreRenderComplete; + PageInvoker pi = new PageInvoker (pd); + new WebTest (pi).Run (); + } + + public static void Menu_DataBindByDataSourceID_PageInit (Page p) { + XmlDataSource xmlDs = new XmlDataSource (); + xmlDs.ID = "XmlDataSource"; + xmlDs.Data = ""; + p.Form.Controls.Add (xmlDs); + + Menu m = CreateMenu (); + m.RenderingMode = MenuRenderingMode.Table; + m.DataSourceID = "XmlDataSource"; + m.MenuItemDataBound += new MenuEventHandler (m_MenuItemDataBound); + p.Form.Controls.Add (m); + + ResetTemplateBoundFlags (); + _MenuItemBoundCount = 0; + _MenuItemCreatedCount = 0; + } + + public static void m_MenuItemDataBound (object sender, MenuEventArgs e) { + _MenuItemBoundCount++; + } + + [Test] + [Category ("NunitWeb")] + public void Menu_Templates () { + PageDelegates pd = new PageDelegates (); + pd.Init = Menu_Templates_PageInit; + pd.PreRenderComplete = Menu_Templates_PagePreRenderComplete; + PageInvoker pi = new PageInvoker (pd); + new WebTest (pi).Run (); + } + + public static void Menu_Templates_PageInit (Page p) { + Menu m = CreateMenu (); + p.Form.Controls.Add (m); + + ResetTemplateBoundFlags (); + } + + static bool _StaticTemplateBound; + static bool _DynamicTemplateBound; + + static bool _StaticTemplateCreated; + static bool _DynamicTemplateCreated; + + static int _MenuItemBoundCount; + static int _MenuItemCreatedCount; + + private static void CheckTemplateBoundFlags () { + Assert.AreEqual (true, _StaticTemplateCreated, "StaticTemplateCreated"); + Assert.AreEqual (true, _DynamicTemplateCreated, "DynamicTemplateCreated"); + Assert.AreEqual (true, _StaticTemplateBound, "StaticTemplateBound"); + Assert.AreEqual (true, _DynamicTemplateBound, "DynamicTemplateBound"); + } + + public static void Menu_Templates_PagePreRenderComplete (Page p) { + CheckTemplateBoundFlags (); + } + + public static void Menu_DataBindByDataSourceID_PagePreRenderComplete (Page p) { + CheckTemplateBoundFlags (); + Assert.AreEqual (6, _MenuItemBoundCount, "MenuItemBoundCount"); + Assert.AreEqual (6, _MenuItemCreatedCount, "MenuItemBoundCount"); + } + + private static void _StaticItemTemplate (Control container) { + _StaticTemplateCreated = true; + _MenuItemCreatedCount++; + Literal l = new Literal (); + container.Controls.Add (l); + container.DataBinding += new EventHandler (StaticTemplate_DataBinding); + } + + static void StaticTemplate_DataBinding (object sender, EventArgs e) { + _StaticTemplateBound = true; + } + + private static void _DynamicItemTemplate (Control container) { + _DynamicTemplateCreated = true; + _MenuItemCreatedCount++; + Literal l = new Literal (); + container.Controls.Add (l); + container.DataBinding += new EventHandler (DynamicTemplate_DataBinding); + } + + static void DynamicTemplate_DataBinding (object sender, EventArgs e) { + _DynamicTemplateBound = true; + } + + [Test] + public void Menu_ViewState() + { + PokerMenu b = new PokerMenu (); + PokerMenu copy = new PokerMenu (); + b.ToolTip = "mytest1"; + b.Target = "mytest2"; + b.BackColor = Color.Red; + b.BorderColor = Color.Red; + b.BorderStyle = BorderStyle.Dotted; + b.BorderWidth = 1; + b.ForeColor = Color.Red; + b.Height = 100; + b.MaximumDynamicDisplayLevels = 2; + b.Orientation = Orientation.Vertical; + b.PathSeparator = '-'; + b.ScrollDownImageUrl = "test"; + b.ScrollDownText = "test"; + b.ScrollUpImageUrl = "test"; + b.ScrollUpText = "test"; + b.SkipLinkText = "test"; + b.Visible = false; + b.Width = 100; + b.TabIndex = 1; + + object state = b.DoSaveViewState (); + copy.DoLoadViewState (state); + Assert.AreEqual ("mytest1", copy.ToolTip, "ViewState#1"); + Assert.AreEqual ("mytest2", copy.Target, "ViewState#2"); + Assert.AreEqual (Color.Red, copy.BackColor, "ViewState#3"); + Assert.AreEqual (Color.Red, copy.BorderColor , "ViewState#4"); + Assert.AreEqual (BorderStyle.Dotted, copy.BorderStyle, "ViewState#5"); + Assert.AreEqual (Unit.Pixel(1), copy.BorderWidth, "ViewState#6"); + + Assert.AreEqual (Color.Red, copy.ForeColor, "ViewState#8"); + Assert.AreEqual (Unit.Pixel(100), copy.Height, "ViewState#9"); + Assert.AreEqual (2, copy.MaximumDynamicDisplayLevels, "ViewState#10"); + Assert.AreEqual (Orientation.Vertical, copy.Orientation, "ViewState#11"); + Assert.AreEqual ('-', copy.PathSeparator, "ViewState#12"); + Assert.AreEqual ("test", copy.ScrollDownImageUrl, "ViewState#13"); + Assert.AreEqual ("test", copy.ScrollDownText, "ViewState#14"); + Assert.AreEqual ("test", copy.ScrollUpImageUrl, "ViewState#15"); + Assert.AreEqual ("test", copy.ScrollUpText, "ViewState#16"); + Assert.AreEqual ("test", copy.SkipLinkText, "ViewState#17"); + Assert.AreEqual (1, copy.TabIndex, "ViewState#18"); + Assert.AreEqual (false, copy.Visible, "ViewState#19"); + Assert.AreEqual (Unit.Pixel (100), copy.Width, "ViewState#20"); + + + } + + [Test] + public void Menu_ViewStateNotWorking() + { + PokerMenu b = new PokerMenu (); + PokerMenu copy = new PokerMenu (); + b.Font.Size = 10; + object state = b.DoSaveViewState (); + copy.DoLoadViewState (state); + Assert.AreEqual ("10pt", copy.Font.Size.ToString() , "ViewState#7"); + } + + [Test] + public void Menu_ViewStateItems () { + PokerMenu b = new PokerMenu (); + MenuItem R = new MenuItem ("root", "value-root"); + MenuItem N1 = new MenuItem ("node1", "value-node1"); + MenuItem N2 = new MenuItem ("node2", "value-node2"); + R.ChildItems.Add (N1); + R.ChildItems.Add (N2); + b.Items.Add (R); + PokerMenu copy = new PokerMenu (); + object state = b.DoSaveViewState (); + copy.DoLoadViewState (state); + Assert.AreEqual (1, copy.Items.Count, "ViewStateItems#1"); + Assert.AreEqual (2, copy.Items [0].ChildItems.Count, "ViewStateItems#2"); + Assert.AreEqual (0, copy.Items [0].ChildItems [0].ChildItems.Count, "ViewStateItems#3"); + Assert.AreEqual ("node1", copy.Items [0].ChildItems [0].Text, "ViewStateItems#4"); + Assert.AreEqual ("value-node1", copy.Items [0].ChildItems [0].Value, "ViewStateItems#5"); + Assert.AreEqual (false, copy.Items [0].ChildItems [0].DataBound, "ViewStateItems#6"); + Assert.AreEqual ("", copy.Items [0].ChildItems [0].DataPath, "ViewStateItems#7"); + } + + + [Test] + public void Menu_ViewStateDataBoundItems () { + PokerMenu b = new PokerMenu (); + SetDataBindings (b); + b.DataSource = CreateXmlDataSource (); + b.DataBind (); + PokerMenu copy = new PokerMenu (); + object state = b.DoSaveViewState (); + copy.DoLoadViewState (state); + CheckMenuItems (copy); + } + + private static void CheckMenuItems (Menu m) { + Assert.AreEqual (1, m.Items.Count, "CheckMenuItems#1"); + Assert.AreEqual (10, m.Items [0].ChildItems.Count, "CheckMenuItems#2"); + Assert.AreEqual (0, m.Items [0].ChildItems [0].ChildItems.Count, "CheckMenuItems#3"); + Assert.AreEqual (true, m.Items [0].ChildItems [0].DataBound, "CheckMenuItems#4"); + Assert.AreEqual ("/*[position()=1]/*[position()=1]", m.Items [0].ChildItems [0].DataPath, "CheckMenuItems#5"); + + Assert.AreEqual (false, m.Items [0].Enabled, "CheckMenuItems_Enabled#1"); + Assert.AreEqual (true, m.Items [0].ChildItems [0].Enabled, "CheckMenuItems_Enabled#2"); + Assert.AreEqual (false, m.Items [0].ChildItems [1].Enabled, "CheckMenuItems_Enabled#3"); + Assert.AreEqual (false, m.Items [0].ChildItems [2].Enabled, "CheckMenuItems_Enabled#4"); + Assert.AreEqual (true, m.Items [0].ChildItems [2].ChildItems [0].Enabled, "CheckMenuItems_Enabled#5"); + + Assert.AreEqual ("img#root", m.Items [0].ImageUrl, "CheckMenuItems_ImageUrl#1"); + Assert.AreEqual ("img#1", m.Items [0].ChildItems [0].ImageUrl, "CheckMenuItems_ImageUrl#2"); + Assert.AreEqual ("img#2", m.Items [0].ChildItems [1].ImageUrl, "CheckMenuItems_ImageUrl#3"); + Assert.AreEqual ("img#default", m.Items [0].ChildItems [2].ImageUrl, "CheckMenuItems_ImageUrl#4"); + Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].ImageUrl, "CheckMenuItems_ImageUrl#5"); + + Assert.AreEqual ("url#root", m.Items [0].NavigateUrl, "CheckMenuItems_NavigateUrl#1"); + Assert.AreEqual ("url#1", m.Items [0].ChildItems [0].NavigateUrl, "CheckMenuItems_NavigateUrl#2"); + Assert.AreEqual ("url#2", m.Items [0].ChildItems [1].NavigateUrl, "CheckMenuItems_NavigateUrl#3"); + Assert.AreEqual ("url#default", m.Items [0].ChildItems [2].NavigateUrl, "CheckMenuItems_NavigateUrl#4"); + Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].NavigateUrl, "CheckMenuItems_NavigateUrl#5"); + + Assert.AreEqual ("popoutimg#root", m.Items [0].PopOutImageUrl, "CheckMenuItems_PopOutImageUrl#1"); + Assert.AreEqual ("popoutimg#1", m.Items [0].ChildItems [0].PopOutImageUrl, "CheckMenuItems_PopOutImageUrl#2"); + Assert.AreEqual ("popoutimg#2", m.Items [0].ChildItems [1].PopOutImageUrl, "CheckMenuItems_PopOutImageUrl#3"); + Assert.AreEqual ("popoutimg#default", m.Items [0].ChildItems [2].PopOutImageUrl, "CheckMenuItems_PopOutImageUrl#4"); + Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].PopOutImageUrl, "CheckMenuItems_PopOutImageUrl#5"); + + Assert.AreEqual (false, m.Items [0].Selectable, "CheckMenuItems_Selectable#1"); + Assert.AreEqual (true, m.Items [0].ChildItems [0].Selectable, "CheckMenuItems_Selectable#2"); + Assert.AreEqual (false, m.Items [0].ChildItems [1].Selectable, "CheckMenuItems_Selectable#3"); + Assert.AreEqual (false, m.Items [0].ChildItems [2].Selectable, "CheckMenuItems_Selectable#4"); + Assert.AreEqual (true, m.Items [0].ChildItems [2].ChildItems [0].Selectable, "CheckMenuItems_Selectable#5"); + + Assert.AreEqual ("separatorimg#root", m.Items [0].SeparatorImageUrl, "CheckMenuItems_SeparatorImageUrl#1"); + Assert.AreEqual ("separatorimg#1", m.Items [0].ChildItems [0].SeparatorImageUrl, "CheckMenuItems_SeparatorImageUrl#2"); + Assert.AreEqual ("separatorimg#2", m.Items [0].ChildItems [1].SeparatorImageUrl, "CheckMenuItems_SeparatorImageUrl#3"); + Assert.AreEqual ("separatorimg#default", m.Items [0].ChildItems [2].SeparatorImageUrl, "CheckMenuItems_SeparatorImageUrl#4"); + Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].SeparatorImageUrl, "CheckMenuItems_SeparatorImageUrl#5"); + + Assert.AreEqual ("target#root", m.Items [0].Target, "CheckMenuItems_Target#1"); + Assert.AreEqual ("target#1", m.Items [0].ChildItems [0].Target, "CheckMenuItems_Target#2"); + Assert.AreEqual ("target#2", m.Items [0].ChildItems [1].Target, "CheckMenuItems_Target#3"); + Assert.AreEqual ("target#default", m.Items [0].ChildItems [2].Target, "CheckMenuItems_Target#4"); + Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].Target, "CheckMenuItems_Target#5"); + + Assert.AreEqual ("text#root", m.Items [0].Text, "CheckMenuItems_Text#1"); + Assert.AreEqual ("text#1", m.Items [0].ChildItems [0].Text, "CheckMenuItems_Text#2"); + Assert.AreEqual ("text#2", m.Items [0].ChildItems [1].Text, "CheckMenuItems_Text#3"); + Assert.AreEqual ("text#", m.Items [0].ChildItems [2].Text, "CheckMenuItems_Text#4"); + Assert.AreEqual ("subnode", m.Items [0].ChildItems [2].ChildItems [0].Text, "CheckMenuItems_Text#5"); + + Assert.AreEqual ("tooltip#root", m.Items [0].ToolTip, "CheckMenuItems_ToolTip#1"); + Assert.AreEqual ("tooltip#1", m.Items [0].ChildItems [0].ToolTip, "CheckMenuItems_ToolTip#2"); + Assert.AreEqual ("tooltip#2", m.Items [0].ChildItems [1].ToolTip, "CheckMenuItems_ToolTip#3"); + Assert.AreEqual ("tooltip#default", m.Items [0].ChildItems [2].ToolTip, "CheckMenuItems_ToolTip#4"); + Assert.AreEqual ("", m.Items [0].ChildItems [2].ChildItems [0].ToolTip, "CheckMenuItems_ToolTip#5"); + + Assert.AreEqual ("value#root", m.Items [0].Value, "CheckMenuItems_Value#1"); + Assert.AreEqual ("value#1", m.Items [0].ChildItems [0].Value, "CheckMenuItems_Value#2"); + Assert.AreEqual ("value#2", m.Items [0].ChildItems [1].Value, "CheckMenuItems_Value#3"); + Assert.AreEqual ("value#default", m.Items [0].ChildItems [2].Value, "CheckMenuItems_Value#4"); + Assert.AreEqual ("subnode", m.Items [0].ChildItems [2].ChildItems [0].Value, "CheckMenuItems_Value#5"); + + Assert.AreEqual ("text#extra1", m.Items [0].ChildItems [3].Text, "CheckMenuItems_Extra1#1"); + Assert.AreEqual ("text#extra1", m.Items [0].ChildItems [3].Value, "CheckMenuItems_Extra1#2"); + + Assert.AreEqual ("value#extra2", m.Items [0].ChildItems [4].Text, "CheckMenuItems_Extra2#1"); + Assert.AreEqual ("value#extra2", m.Items [0].ChildItems [4].Value, "CheckMenuItems_Extra2#2"); + + Assert.AreEqual ("text#extra3", m.Items [0].ChildItems [5].Text, "CheckMenuItems_Extra3#1"); + Assert.AreEqual ("", m.Items [0].ChildItems [5].Value, "CheckMenuItems_Extra3#2"); + Assert.AreEqual ("", m.Items [0].ChildItems [6].Text, "CheckMenuItems_Extra3#3"); + Assert.AreEqual ("value#extra3", m.Items [0].ChildItems [6].Value, "CheckMenuItems_Extra3#4"); + Assert.AreEqual ("", m.Items [0].ChildItems [7].Text, "CheckMenuItems_Extra3#5"); + Assert.AreEqual ("", m.Items [0].ChildItems [7].Value, "CheckMenuItems_Extra3#6"); + + Assert.AreEqual ("text#extra4", m.Items [0].ChildItems [8].Text, "CheckMenuItems_Extra4#1"); + Assert.AreEqual ("text#default", m.Items [0].ChildItems [8].Value, "CheckMenuItems_Extra4#2"); + + Assert.AreEqual ("value#default", m.Items [0].ChildItems [9].Text, "CheckMenuItems_Extra5#1"); + Assert.AreEqual ("value#extra5", m.Items [0].ChildItems [9].Value, "CheckMenuItems_Extra5#2"); + } + + void SetDataBindings (Menu menu) { + MenuItemBinding b = new MenuItemBinding (); + b.DataMember = "node"; + b.EnabledField = "enabled"; + b.Enabled = false; + b.ImageUrlField = "img"; + b.ImageUrl = "img#default"; + b.NavigateUrlField = "url"; + b.NavigateUrl = "url#default"; + b.PopOutImageUrlField = "popoutimg"; + b.PopOutImageUrl = "popoutimg#default"; + b.SelectableField = "selectable"; + b.Selectable = false; + b.SeparatorImageUrlField = "separatorimg"; + b.SeparatorImageUrl = "separatorimg#default"; + b.TargetField = "target"; + b.Target = "target#default"; + b.FormatString = "text#{0}"; + b.TextField = "text"; + b.Text = "text#default"; + b.ToolTipField = "tooltip"; + b.ToolTip = "tooltip#default"; + b.ValueField = "value"; + b.Value = "value#default"; + menu.DataBindings.Add (b); + + b = new MenuItemBinding (); + b.DataMember = "root"; + b.Enabled = false; + b.ImageUrl = "img#root"; + b.NavigateUrl = "url#root"; + b.PopOutImageUrl = "popoutimg#root"; + b.Selectable = false; + b.SeparatorImageUrl = "separatorimg#root"; + b.Target = "target#root"; + b.Text = "text#root"; + b.ToolTip = "tooltip#root"; + b.Value = "value#root"; + menu.DataBindings.Add (b); + + b = new MenuItemBinding (); + b.DataMember = "extra1"; + b.Text = "text#extra1"; + menu.DataBindings.Add (b); + + b = new MenuItemBinding (); + b.DataMember = "extra2"; + b.Value = "value#extra2"; + menu.DataBindings.Add (b); + + b = new MenuItemBinding (); + b.DataMember = "extra3"; + b.TextField = "text"; + b.ValueField = "value"; + menu.DataBindings.Add (b); + + b = new MenuItemBinding (); + b.DataMember = "extra4"; + b.TextField = "text"; + b.Text = "text#default"; + b.ValueField = "value"; + menu.DataBindings.Add (b); + + b = new MenuItemBinding (); + b.DataMember = "extra5"; + b.TextField = "text"; + b.Value = "value#default"; + b.ValueField = "value"; + menu.DataBindings.Add (b); + } + + XmlDataSource CreateXmlDataSource () { + XmlDataSource xmlDs = new XmlDataSource (); + xmlDs.ID = "XmlDataSource"; + xmlDs.Data = ""+ + "" + + "" + + "" + + "" + + ""+ + ""+ + "" + + "" + + "" + + "" + + "" + + ""; + return xmlDs; + } + + [Test] + public void Menu_DataBindings () { + Menu m = new MenuTable (); + SetDataBindings (m); + m.DataSource = CreateXmlDataSource (); + m.DataBind (); + CheckMenuItems (m); + } + + // Rendering Menu controll with some possible options, styles and items + + + [Test] + [Category ("NunitWeb")] + [Ignore ("NUNIT 2.4 issue - temporarily disabled")] + public void Menu_DefaultRender () + { + string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (_DefaultRender)).Run (); + string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + string OriginControlHtml = ""; + HtmlDiff.AssertAreEqual(OriginControlHtml, RenderedControlHtml,"RenderDefault"); + } + + // All this methods are delegates for running tests in host assembly. + + public static void _DefaultRender (Page p) + { + LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG); + LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG); + Menu menu = new MenuTable (); + p.Form.Controls.Add (lcb); + p.Form.Controls.Add (menu); + p.Form.Controls.Add (lce); + } + + [Test] + [Category ("NunitWeb")] + public void Menu_RenderStaticItems () { + string RenderedPageHtml, RenderedControlHtml, OriginControlHtml; + #region OriginControlHtml + OriginControlHtml = "\"Skip\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
one-black
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
two-black-1
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
three-black-1
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-1
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-2
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
three-black-2
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-3
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-4
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
two-black-2
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
three-black-3
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-5
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-6
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
three-black-4
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-7
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-8
"; + #endregion + RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItems_Vertical)).Run (); + RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Menu_RenderStaticItems_Vertical"); +#if !DOT_NET + // Throws NREX on .NET 4.0, most probably because the adapter's Control is null + RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItemsWithBaseAdapter_Vertical)).Run (); + RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Menu_RenderStaticItemsWithDefaultAdapter_Vertical"); +#endif + #region OriginControlHtml + OriginControlHtml = "\"Skip\r\n\t\r\n\t\t\r\n\t\r\n
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
one-black
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
two-black-1
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
three-black-1
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-1
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-2
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
three-black-2
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-3
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-4
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
two-black-2
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
three-black-3
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-5
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-6
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
three-black-4
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-7
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t
four-black-8
"; + #endregion + RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItems_Horizontal)).Run (); + RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Menu_RenderStaticItems_Horizontal"); +#if !DOT_NET + RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItemsWithBaseAdapter_Horizontal)).Run (); + RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Menu_RenderStaticItemsWithBaseAdapter_Horizontal"); +#endif + } + [Test] + [Category ("NunitWeb")] + [Ignore ("Disabled temporarily")] + public void Menu_RenderStaticItems_List () + { + string RenderedPageHtml, RenderedControlHtml, OriginControlHtml; + #region OriginControlHtml + OriginControlHtml = "\"Skip"; + #endregion + RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItems_Vertical_List)).Run (); + RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Menu_RenderStaticItems_Vertical"); +#if !DOT_NET + // Throws NREX on .NET 4.0, most probably because the adapter's Control is null + RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItemsWithBaseAdapter_Vertical)).Run (); + RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Menu_RenderStaticItemsWithDefaultAdapter_Vertical"); +#endif + #region OriginControlHtml + OriginControlHtml = "\"Skip"; + #endregion + RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItems_Horizontal_List)).Run (); + RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Menu_RenderStaticItems_Horizontal"); +#if !DOT_NET + RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItemsWithBaseAdapter_Horizontal)).Run (); + RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Menu_RenderStaticItemsWithBaseAdapter_Horizontal"); +#endif + } + class MyMenuAdapter : global::System.Web.UI.WebControls.Adapters.MenuAdapter + { + protected internal override void RenderItem (HtmlTextWriter writer, + MenuItem item, + int position) + { + writer.Write ("{"); + base.RenderItem (writer, item, position); + writer.Write ("}"); + } + } + + [Test] + [Category ("NunitWeb")] + [Category ("NotDotNet")] + public void Menu_RenderStaticItemsWithAdapter () + { + string RenderedPageHtml, RenderedControlHtml, OriginControlHtml; + RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItemsWithAdapter_Vertical)).Run (); + RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + #region OriginControlHtml + OriginControlHtml = @" + { + + + + } +
+ + + +
one-black
+ { + + + + }{ + + + + } +
+ + + +
two-black-1
+ { + + + + }{ + + + + } +
+ + + +
three-black-1
+ { + + }{ + + } +
+ + + +
four-black-1
+ + + +
four-black-2
+ + + +
three-black-2
+ { + + }{ + + } +
+ + + +
four-black-3
+ + + +
four-black-4
+ + + +
two-black-2
+ { + + + + }{ + + + + } +
+ + + +
three-black-3
+ { + + }{ + + } +
+ + + +
four-black-5
+ + + +
four-black-6
+ + + +
three-black-4
+ { + + }{ + + } +
+ + + +
four-black-7
+ + + +
four-black-8
"; + #endregion + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Menu_RenderStaticItemsWithAdapter_Vertical"); + RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItemsWithAdapter_Horizontal)).Run (); + RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); + #region OriginControlHtml + OriginControlHtml = @" + + {} + +
+ + + +
one-black
+ + {}{} + +
+ + + +
two-black-1
+ + {}{} + +
+ + + +
three-black-1
+ + {}{} + +
+ + + +
four-black-1
+ + + +
four-black-2
+ + + +
three-black-2
+ + {}{} + +
+ + + +
four-black-3
+ + + +
four-black-4
+ + + +
two-black-2
+ + {}{} + +
+ + + +
three-black-3
+ + {}{} + +
+ + + +
four-black-5
+ + + +
four-black-6
+ + + +
three-black-4
+ + {}{} + +
+ + + +
four-black-7
+ + + +
four-black-8
"; + #endregion + HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Menu_RenderStaticItemsWithAdapter_Horizontal"); + } + + public static void Menu_RenderStaticItems_Vertical (Page p) { + Menu m = CreateMenuForRenderTests (null); + m.StaticDisplayLevels = 4; + AddMenuToPage (p, m); + } + + public static void Menu_RenderStaticItems_Horizontal (Page p) { + Menu m = CreateMenuForRenderTests (null); + m.Orientation = Orientation.Horizontal; + m.StaticDisplayLevels = 4; + AddMenuToPage (p, m); + } + public static void Menu_RenderStaticItems_Vertical_List (Page p) + { + Menu m = CreateMenuForRenderTests (null, false); + m.RenderingCompatibility = new Version (4, 0); + m.RenderingMode = MenuRenderingMode.List; + m.StaticDisplayLevels = 4; + AddMenuToPage (p, m); + } + + public static void Menu_RenderStaticItems_Horizontal_List (Page p) + { + Menu m = CreateMenuForRenderTests (null, false); + m.Orientation = Orientation.Horizontal; + m.StaticDisplayLevels = 4; + m.RenderingCompatibility = new Version (4, 0); + m.RenderingMode = MenuRenderingMode.List; + AddMenuToPage (p, m); + } + public static void Menu_RenderStaticItemsWithBaseAdapter_Vertical (Page p) { + Menu m = CreateMenuForRenderTests (new MyWebControl.Adapters.MenuAdapter()); + m.StaticDisplayLevels = 4; + AddMenuToPage (p, m); + } + + public static void Menu_RenderStaticItemsWithBaseAdapter_Horizontal (Page p) { + Menu m = CreateMenuForRenderTests (new MyWebControl.Adapters.MenuAdapter()); + m.Orientation = Orientation.Horizontal; + m.StaticDisplayLevels = 4; + AddMenuToPage (p, m); + } + + public static void Menu_RenderStaticItemsWithAdapter_Vertical (Page p) { + Menu m = CreateMenuForRenderTests (new MyMenuAdapter()); + m.StaticDisplayLevels = 4; + AddMenuToPage (p, m); + } + + public static void Menu_RenderStaticItemsWithAdapter_Horizontal (Page p) { + Menu m = CreateMenuForRenderTests (new MyMenuAdapter()); + m.Orientation = Orientation.Horizontal; + m.StaticDisplayLevels = 4; + AddMenuToPage (p, m); + } + + private static void AddMenuToPage (Page p, Menu m) { + LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG); + LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG); + p.Form.Controls.Add (lcb); + p.Form.Controls.Add (m); + p.Form.Controls.Add (lce); + } + + class MyMenu : Menu + { + internal MyMenu (MyWebControl.Adapters.MenuAdapter adapter) : base () + { + menu_adapter = adapter; + } + + MyWebControl.Adapters.MenuAdapter menu_adapter; + protected override global::System.Web.UI.Adapters.ControlAdapter ResolveAdapter () + { + return menu_adapter; + } + } + + static Menu CreateMenuForRenderTests (MyWebControl.Adapters.MenuAdapter adapter) + { + return CreateMenuForRenderTests (adapter, true); + } + + static Menu CreateMenuForRenderTests (MyWebControl.Adapters.MenuAdapter adapter, bool compatibilityRendering) + { + Menu menu = new MyMenu (adapter); + if (compatibilityRendering) + menu.RenderingCompatibility = new Version (3, 5); + menu.ID = "Menu"; + MenuItem R, N1, N2, SN1, SN2, SN3, SN4; + R = new MenuItem ("one-black", "one-black-value"); + N1 = new MenuItem ("two-black-1", "two-black-1-value"); + N2 = new MenuItem ("two-black-2", "two-black-2-value"); + SN1 = new MenuItem ("three-black-1", "three-black-1-value"); + SN2 = new MenuItem ("three-black-2", "three-black-2-value"); + SN3 = new MenuItem ("three-black-3", "three-black-3-value"); + SN4 = new MenuItem ("three-black-4", "three-black-4-value"); + SN1.ChildItems.Add (new MenuItem ("four-black-1", "four-black-1-value")); + SN1.ChildItems.Add (new MenuItem ("four-black-2", "four-black-2-value")); + SN2.ChildItems.Add (new MenuItem ("four-black-3", "four-black-3-value")); + SN2.ChildItems.Add (new MenuItem ("four-black-4", "four-black-4-value")); + SN3.ChildItems.Add (new MenuItem ("four-black-5", "four-black-5-value")); + SN3.ChildItems.Add (new MenuItem ("four-black-6", "four-black-6-value")); + SN4.ChildItems.Add (new MenuItem ("four-black-7", "four-black-7-value")); + SN4.ChildItems.Add (new MenuItem ("four-black-8", "four-black-8-value")); + N1.ChildItems.Add (SN1); + N1.ChildItems.Add (SN2); + N2.ChildItems.Add (SN3); + N2.ChildItems.Add (SN4); + R.ChildItems.Add (N1); + R.ChildItems.Add (N2); + menu.Items.Add (R); + return menu; + } + + //Events Stuff + private bool OnDataBinding; + private bool OnDataBound; + private bool OnMenuItemClick; + private bool OnInit; + private bool OnMenuItemDataBound; + private bool OnPreRender; + + private void OnMenuItemDataBoundHandler(object sender, MenuEventArgs e) + { + OnMenuItemDataBound = true; + } + private void OnInitHandler (object sender, EventArgs e) + { + OnInit = true; + } + private void OnDataBindingHandler (object sender, EventArgs e) + { + OnDataBinding = true; + } + private void OnDataDataBoundHandler (object sender, EventArgs e) + { + OnDataBound = true; + } + private void OnMenuItemClickHandler (object sender, MenuEventArgs e) + { + OnMenuItemClick = true; + } + private void OnPreRenderHandler (object sender, EventArgs e) + { + OnPreRender = true; + } + private void ResetEvents () + { + OnMenuItemClick = false; + OnDataBinding = false; + OnDataBound = false; + OnInit = false; + OnPreRender = false; + } + [Test] + public void Menu_Events () + { + Page myPage = new Page (); + PokerMenu p = new PokerMenu (); + MenuItem I = new MenuItem (); + p.Items.Add (I); + myPage.Controls.Add(p); + + + p.Init += new EventHandler(OnInitHandler); + p.DataBinding += new EventHandler (OnDataBindingHandler); + p.DataBound += new EventHandler(OnDataDataBoundHandler); + p.MenuItemClick += new MenuEventHandler(OnMenuItemClickHandler); + p.MenuItemDataBound += new MenuEventHandler (OnMenuItemDataBoundHandler); + Assert.AreEqual (false, OnDataBinding, "BeforeOnDataBinding"); + p.DoOnDataBind (new EventArgs ()); + Assert.AreEqual (true, OnDataBinding, "AfterOnDataBinding"); + Assert.AreEqual (false, OnDataBound, "BeforeOnDataBound"); + p.DoOnDataBound (new EventArgs ()); + Assert.AreEqual (true, OnDataBound, "AfterOnDataBinding"); + MenuEventArgs e = new MenuEventArgs (I); + Assert.AreEqual (false, OnMenuItemClick, "BeforeMenuItemClick"); + p.DoOnMenuItemClick (e); + Assert.AreEqual (true, OnMenuItemClick, "AfterMenuItemClick"); + Assert.AreEqual (false, OnInit, "BeforeOnInit"); + p.DoOnInit (new EventArgs()); + Assert.AreEqual (true, OnInit, "AfterOnInit"); + Assert.AreEqual (false, OnMenuItemDataBound, "BeforeMenuItemDataBound"); + p.DoMenuItemDataBound(e); + Assert.AreEqual (true, OnMenuItemDataBound, "AfterMenuItemDataBound"); + } + [Test] + public void Menu_BubbleEvent () { + PokerMenu pm = new PokerMenu (); + MenuItem item = new MenuItem ("Root"); + pm.Items.Add (item); + pm.MenuItemClick += new MenuEventHandler (pm_MenuItemClick); + _MenuItemClick = false; + MenuEventArgs clickCommandArg = new MenuEventArgs (item, null, new CommandEventArgs (Menu.MenuItemClickCommandName, null)); + CommandEventArgs notClickCommandArg = new CommandEventArgs (Menu.MenuItemClickCommandName + "No", null); + Assert.AreEqual (true, pm.DoOnBubbleEvent (notClickCommandArg), "Bubble Event#1"); + Assert.AreEqual (false, _MenuItemClick, "MenuItemClick Bubbled"); + Assert.AreEqual (true, pm.DoOnBubbleEvent (clickCommandArg), "Bubble Event#2"); + Assert.AreEqual (true, _MenuItemClick, "MenuItemClick Bubbled"); + Assert.AreEqual (false, pm.DoOnBubbleEvent (new EventArgs ()), "Bubble Event#3"); + } + + bool _MenuItemClick; + + void pm_MenuItemClick (object sender, MenuEventArgs e) { + _MenuItemClick = true; + } + + [Test] + [Category ("NunitWeb")] + public void Menu_PreRenderEvent () + { + new WebTest (PageInvoker.CreateOnLoad (PreRenderEvent)).Run (); + } + public void PreRenderEvent (Page p) + { + PokerMenu pm = new PokerMenu (); + p.Controls.Add (pm); + pm.PreRender += new EventHandler (OnPreRenderHandler); + Assert.AreEqual (false, OnPreRender, "BeforePreRender"); + pm.DoOnPreRender (new EventArgs ()); + Assert.AreEqual (true, OnPreRender, "AfterPreRender"); + } + [TestFixtureTearDown] + public void TearDown () + { + WebTest.Unload (); + } + + // A simple Template class to wrap an image. + public class ImageTemplate : ITemplate + { + private MyWebControl.Image myImage; + public MyWebControl.Image MyImage + { + get + { + return myImage; + } + set + { + myImage = value; + } + } + public void InstantiateIn (Control container) + { + container.Controls.Add (MyImage); + } + } + [Test] + [Category ("NunitWeb")] +#if !DOT_NET + [Ignore ("Temporarily ignored on Mono until the Menu control is updated for 4.0")] +#endif + public void MenuClass () + { + string res = new WebTest ("menuclass.aspx").Run (); + string menua_pattern="]*class=\"[^\"]*menua[^\"]*\"[^>]*>"; + Assert.IsTrue (Regex.IsMatch (res, ".*"+menua_pattern+".*", + RegexOptions.IgnoreCase|RegexOptions.Singleline), + "check that is found"); + Assert.IsFalse (Regex.IsMatch (res, ".*"+menua_pattern+".*"+menua_pattern+".*", + RegexOptions.IgnoreCase|RegexOptions.Singleline), + "check that
is found only once"); + } + + [Test] + [Category ("NunitWeb")] + [Category ("NotDotNet")] // implementation specific + public void Menu_PostBack () + { + PageDelegates pd = new PageDelegates (); + pd.Init = Menu_SetTableMode; + WebTest t = new WebTest ("PostBackMenuTest.aspx"); + t.Invoker = new PageInvoker (pd); + + string str = t.Run (); + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "Menu1"; + fr.Controls ["__EVENTARGUMENT"].Value = "0_1"; + t.Request = fr; + pd.PreRender = _MenuItemsPost; + t.Invoker = new PageInvoker (pd); + t.Run (); + } + + public static void Menu_SetTableMode (Page p) + { + Menu m = p.Form.FindControl ("Menu1") as Menu; + Assert.IsNotNull (m, "Menu present"); + m.RenderingMode = MenuRenderingMode.Table; + } + + public static void _MenuItemsPost (Page p) + { + foreach (Control c in p.Form.Controls) { + Menu m = c as Menu; + if (m != null) { + Assert.AreEqual ("node2", m.SelectedValue, "MenuItemsPostBack"); + } + } + } + + [Test] + [Category ("NunitWeb")] + public void Menu_PostBackFireEvents_1 () + { + PageDelegates pd = new PageDelegates (); + pd.Init = Menu_SetTableMode; + WebTest t = new WebTest ("PostBackMenuTest.aspx"); + t.Invoker = new PageInvoker (pd); + + string str = t.Run (); + FormRequest fr = new FormRequest (t.Response, "form1"); + fr.Controls.Add ("__EVENTTARGET"); + fr.Controls.Add ("__EVENTARGUMENT"); + fr.Controls["__EVENTTARGET"].Value = "Menu1"; +#if DOT_NET + fr.Controls["__EVENTARGUMENT"].Value = "root"; // "0_1"; +#else + fr.Controls ["__EVENTARGUMENT"].Value = "0"; // "0_1"; +#endif + t.Request = fr; + str = t.Run (); + Assert.AreEqual ("MenuItemClick", t.UserData.ToString (), "PostBackEvent"); + } + + [Test] + [Category ("NunitWeb")] + public void Menu_PostBackFireEvents_2 () + { + WebTest t = new WebTest ("PostBackMenuTest.aspx"); + PageDelegates pd = new PageDelegates (); + pd.Init = PostBackFireEvents_Init ; + t.Invoker = new PageInvoker (pd); + t.Run (); + Assert.AreEqual ("MenuItemDataBound", t.UserData.ToString (), "MenuItemDataBound"); + } + + public static void PostBackFireEvents_Init (Page p) + { + Menu_SetTableMode (p); + Menu m = new MenuTable (); + m.MenuItemDataBound += new MenuEventHandler (MenuItemDataBound_Event); + m.DataSource = LoadXml (); + p.Controls.Add (m); + m.DataBind (); + } + + public static XmlDataSource LoadXml () + { + XmlDataSource ds = new XmlDataSource (); + ds.EnableCaching = false; + #region xml_doc + String xml_text = @" + + "; + #endregion + ds.Data = xml_text; + return ds; + } + + static void MenuItemDataBound_Event (object sender, MenuEventArgs e) + { + WebTest.CurrentTest.UserData = "MenuItemDataBound"; + } + + [Test] + public void MenuItemCollection1 () + { + Menu m = new MenuTable (); + fillMenu (m); + + ((IStateManager) m.Items).TrackViewState (); + m.Items [0].Text = "root"; + m.Items [0].ChildItems [0].Text = "node"; + m.Items [0].ChildItems [0].ChildItems [0].Text = "subnode"; + object state = ((IStateManager) m.Items).SaveViewState (); + + Menu copy = new MenuTable (); + fillMenu (copy); + ((IStateManager) copy.Items).TrackViewState (); + ((IStateManager) copy.Items).LoadViewState (state); + + Assert.AreEqual (1, copy.Items.Count); + Assert.AreEqual (2, copy.Items [0].ChildItems.Count); + Assert.AreEqual (1, copy.Items [0].ChildItems [0].ChildItems.Count); + + Assert.AreEqual ("root", copy.Items [0].Text); + Assert.AreEqual ("node", copy.Items [0].ChildItems [0].Text); + Assert.AreEqual ("subnode", copy.Items [0].ChildItems [0].ChildItems [0].Text); + } + + [Test] + public void MenuItemCollection2 () + { + Menu m = new MenuTable (); + fillMenu (m); + + ((IStateManager) m.Items).TrackViewState (); + m.Items [0].Text = "root"; + m.Items [0].ChildItems [0].Text = "node"; + m.Items [0].ChildItems [0].ChildItems [0].Text = "subnode"; + m.Items.Add (new MenuItem ("root 2")); + object state = ((IStateManager) m.Items).SaveViewState (); + + Menu copy = new MenuTable (); + fillMenu (copy); + ((IStateManager) copy.Items).TrackViewState (); + ((IStateManager) copy.Items).LoadViewState (state); + + Assert.AreEqual (2, copy.Items.Count); + Assert.AreEqual (2, copy.Items [0].ChildItems.Count); + Assert.AreEqual (1, copy.Items [0].ChildItems [0].ChildItems.Count); + + Assert.AreEqual ("root", copy.Items [0].Text); + Assert.AreEqual ("node", copy.Items [0].ChildItems [0].Text); + Assert.AreEqual ("subnode", copy.Items [0].ChildItems [0].ChildItems [0].Text); + Assert.AreEqual ("root 2", copy.Items [1].Text); + } + + [Test] + public void MenuItemCollection3 () + { + Menu m = new MenuTable (); + fillMenu (m); + m.Items.Add (new MenuItem ("root 2")); + + ((IStateManager) m.Items).TrackViewState (); + m.Items [0].Text = "root"; + m.Items [0].ChildItems [0].Text = "node"; + m.Items [0].ChildItems [0].ChildItems [0].Text = "subnode"; + m.Items.RemoveAt (1); + object state = ((IStateManager) m.Items).SaveViewState (); + + Menu copy = new MenuTable (); + fillMenu (copy); + copy.Items.Add (new MenuItem ("root 2")); + ((IStateManager) copy.Items).TrackViewState (); + ((IStateManager) copy.Items).LoadViewState (state); + + Assert.AreEqual (1, copy.Items.Count); + Assert.AreEqual (2, copy.Items [0].ChildItems.Count); + Assert.AreEqual (1, copy.Items [0].ChildItems [0].ChildItems.Count); + + Assert.AreEqual ("root", copy.Items [0].Text); + Assert.AreEqual ("node", copy.Items [0].ChildItems [0].Text); + Assert.AreEqual ("subnode", copy.Items [0].ChildItems [0].ChildItems [0].Text); + } + + [Test] + public void MenuItemCollection4 () + { + Menu m = new MenuTable (); + fillMenu (m); + m.Items.Add (new MenuItem ("root 2")); + m.Items [0].ChildItems.RemoveAt (1); + + ((IStateManager) m.Items).TrackViewState (); + m.Items [0].Text = "root"; + m.Items [0].ChildItems [0].Text = "node"; + m.Items [0].ChildItems [0].ChildItems [0].Text = "subnode"; + object state = ((IStateManager) m.Items).SaveViewState (); + + Menu copy = new MenuTable (); + fillMenu (copy); + copy.Items.Add (new MenuItem ("root 2")); + copy.Items [0].ChildItems.RemoveAt (1); + ((IStateManager) copy.Items).TrackViewState (); + ((IStateManager) copy.Items).LoadViewState (state); + + Assert.AreEqual (2, copy.Items.Count); + Assert.AreEqual (1, copy.Items [0].ChildItems.Count); + Assert.AreEqual (1, copy.Items [0].ChildItems [0].ChildItems.Count); + + Assert.AreEqual ("root", copy.Items [0].Text); + Assert.AreEqual ("node", copy.Items [0].ChildItems [0].Text); + Assert.AreEqual ("subnode", copy.Items [0].ChildItems [0].ChildItems [0].Text); + } + + [Test] + public void MenuItemCollection5 () + { + Menu m = new MenuTable (); + ((IStateManager) m.Items).TrackViewState (); + fillMenu (m); + + object state = ((IStateManager) m.Items).SaveViewState (); + + Menu copy = new MenuTable (); + ((IStateManager) copy.Items).TrackViewState (); + ((IStateManager) copy.Items).LoadViewState (state); + + Assert.AreEqual (1, copy.Items.Count); + Assert.AreEqual (2, copy.Items [0].ChildItems.Count); + Assert.AreEqual (1, copy.Items [0].ChildItems [0].ChildItems.Count); + } + + private static void fillMenu (Menu m) { + m.Items.Clear (); + m.Items.Add (new MenuItem ()); + m.Items [0].ChildItems.Add (new MenuItem ()); + m.Items [0].ChildItems.Add (new MenuItem ()); + m.Items [0].ChildItems [0].ChildItems.Add (new MenuItem ()); + } + + [Test] + public void MenuItem_TextValue1 () + { + MenuItem item = new MenuItem (); + item.Text = "TTT"; + Assert.AreEqual ("TTT", item.Value, "MenuItem_TextValue1#1"); + item.Value = ""; + Assert.AreEqual ("", item.Value, "MenuItem_TextValue1#2"); + item.Value = null; + Assert.AreEqual ("TTT", item.Value, "MenuItem_TextValue1#3"); + } + + [Test] + public void MenuItem_TextValue2 () + { + MenuItem item = new MenuItem (); + item.Value = "VVV"; + Assert.AreEqual ("VVV", item.Text, "MenuItem_TextValue2#1"); + item.Text = ""; + Assert.AreEqual ("", item.Text, "MenuItem_TextValue2#2"); + item.Text = null; + Assert.AreEqual ("VVV", item.Text, "MenuItem_TextValue2#3"); + } + [Test] + public void Menu_RenderingMode () + { + var m = new PokerMenu (); + + Assert.AreEqual (MenuRenderingMode.Default, m.RenderingMode, "#A1"); + + Array values = Enum.GetValues (typeof (MenuRenderingMode)); + int minValue = Int32.MaxValue, maxValue = Int32.MinValue; + + foreach (object v in values) { + int value = (int) v; + if (value < minValue) + minValue = value; + else if (value > maxValue) + maxValue = value; + } + + AssertExtensions.Throws (() => { + m.RenderingMode = (MenuRenderingMode) (minValue - 1); + }, "#A2-1"); + + AssertExtensions.Throws (() => { + m.RenderingMode = (MenuRenderingMode) (maxValue + 1); + }, "#A2-2"); + } + } +} diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/MenuTest.cs.REMOVED.git-id b/mcs/class/System.Web/Test/System.Web.UI.WebControls/MenuTest.cs.REMOVED.git-id deleted file mode 100644 index 7d1253c3cc..0000000000 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/MenuTest.cs.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -c4defa6b5dccd209fafc7eb2e185725645954dfe \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ObjectDataSourceTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ObjectDataSourceTest.cs index 05fa013c7a..9f0d0ea297 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ObjectDataSourceTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ObjectDataSourceTest.cs @@ -422,11 +422,7 @@ namespace MonoTests.System.Web.UI.WebControls string html = new WebTest (PageInvoker.CreateOnLoad ( new PageDelegate (EnablePaging))).Run (); string newHtml = HtmlDiff.GetControlFromPageHtml (html); -#if NET_4_0 string origHtml = "
\r\n\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
NameNumber
Number00
Number11
Number22
Number33
Number44
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
1234
\r\n"; -#else - string origHtml = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
NameNumber
Number00
Number11
Number22
Number33
Number44
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
1234
\r\n
"; -#endif HtmlDiff.AssertAreEqual (origHtml, newHtml, "EnablePaging"); } diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ObjectDataSourceViewTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ObjectDataSourceViewTest.cs index e6f461ffb8..7ae1839e3a 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ObjectDataSourceViewTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ObjectDataSourceViewTest.cs @@ -504,11 +504,7 @@ namespace MonoTests.System.Web.UI.WebControls { WebTest t = new WebTest (PageInvoker.CreateOnLoad (select)); string html = t.Run (); -#if NET_4_0 string origin = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
IDFNameLName
1001MaheshChand
\r\n
"; -#else - string origin = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
IDFNameLName
1001MaheshChand
\r\n
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "ObjectDataSourceViewSelect"); } @@ -552,11 +548,7 @@ namespace MonoTests.System.Web.UI.WebControls // Note : ObjectDataSource will return page counter 5 hard coded WebTest t = new WebTest (PageInvoker.CreateOnLoad (selectcount)); string html = t.Run (); -#if NET_4_0 string origin = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
IDFNameLName
1001MaheshChand
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
12345
\r\n
"; -#else - string origin = "
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
IDFNameLName
1001MaheshChand
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
12345
\r\n
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "ObjectDataSourceViewSelectCount"); } @@ -923,9 +915,7 @@ namespace MonoTests.System.Web.UI.WebControls evaluateCount = 0; } -#if NET_4_0 internal -#endif protected override object Evaluate (HttpContext context, Control control) { evaluateCount++; diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/RadioButtonListTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/RadioButtonListTest.cs index c78edd26fb..75fd9a334b 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/RadioButtonListTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/RadioButtonListTest.cs @@ -180,11 +180,7 @@ namespace MonoTests.System.Web.UI.WebControls { { string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Render_Load)).Run (); string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml); -#if NET_4_0 string OriginControlHtml = "\r\n\t\r\n\t\t\r\n\t\r\n
"; -#else - string OriginControlHtml = "\r\n\t\r\n\t\t\r\n\t\r\n
"; -#endif HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Render"); } diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/RepeatInfoTest.auto.2.0.cs.REMOVED.git-id b/mcs/class/System.Web/Test/System.Web.UI.WebControls/RepeatInfoTest.auto.2.0.cs.REMOVED.git-id deleted file mode 100644 index 08cbd8b45f..0000000000 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/RepeatInfoTest.auto.2.0.cs.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -89ac879c342baa7a97974db1e0b8727b06461a61 \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/RepeatInfoTest.auto.4.0.cs.REMOVED.git-id b/mcs/class/System.Web/Test/System.Web.UI.WebControls/RepeatInfoTest.auto.4.0.cs.REMOVED.git-id index 45e908f02f..ab76ce34a9 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/RepeatInfoTest.auto.4.0.cs.REMOVED.git-id +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/RepeatInfoTest.auto.4.0.cs.REMOVED.git-id @@ -1 +1 @@ -ecdf82387178897008415dae7f86bf9b30ebfa67 \ No newline at end of file +a3772412270d2034fc106168a237dd41420adfa9 \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/RepeatInfoTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/RepeatInfoTest.cs index 218d8d896d..cf59b7d81d 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/RepeatInfoTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/RepeatInfoTest.cs @@ -167,13 +167,8 @@ namespace MonoTests.System.Web.UI.WebControls { [Test] public void RenderRepeater_BaseControl () { -#if NET_4_0 string noid = "\n\t\n\t\t\n\t\n
0
"; string id_enabled = "\n\t\n\t\t\n\t\n
0
"; -#else - string noid = "\n\t\n\t\t\n\t\n
0
"; - string id_enabled = "\n\t\n\t\t\n\t\n
0
"; -#endif RenderRepeater_BaseControl (noid, "Table", new Table ()); RenderRepeater_BaseControl (noid, "DataList", new DataList ()); RenderRepeater_BaseControl (noid, "DataListItem", new DataListItem (0, ListItemType.Item)); diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/RouteParameterTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/RouteParameterTest.cs index dccaf32652..eec1e9bc2c 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/RouteParameterTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/RouteParameterTest.cs @@ -23,7 +23,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_4_0 using System; using System.Collections.Generic; using System.Data; @@ -177,4 +176,3 @@ namespace MonoTests.System.Web.UI.WebControls } } } -#endif \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/SqlDataSourceViewTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/SqlDataSourceViewTest.cs index 9d8d7ae6ca..e44c3db5d6 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/SqlDataSourceViewTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/SqlDataSourceViewTest.cs @@ -452,9 +452,7 @@ namespace MonoTests.System.Web.UI.WebControls evaluateCount = 0; } -#if NET_4_0 internal -#endif protected override object Evaluate (HttpContext context, Control control) { evaluateCount++; return String.Format ("{0}{1}", DefaultValue, evaluateCount); diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TableTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TableTest.cs index 46adf22e5a..1daefe5a3a 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TableTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TableTest.cs @@ -112,11 +112,7 @@ namespace MonoTests.System.Web.UI.WebControls { TestTable t = new TestTable (); t.Caption = "CaptionText"; string html = t.Render (); -#if NET_4_0 string orig = "\n\t\n
\n\t\tCaptionText\n\t
"; -#else - string orig = "\n\t\n
\n\t\tCaptionText\n\t
"; -#endif HtmlDiff.AssertAreEqual (orig, html, "Caption"); } @@ -127,11 +123,7 @@ namespace MonoTests.System.Web.UI.WebControls { t.Caption = "CaptionText"; t.CaptionAlign = TableCaptionAlign.Left; string html = t.Render (); -#if NET_4_0 string orig = "\n\t\n
\n\t\tCaptionText\n\t
"; -#else - string orig = "\n\t\n
\n\t\tCaptionText\n\t
"; -#endif HtmlDiff.AssertAreEqual (orig, html, "CaptionAlign"); } [Test] @@ -251,28 +243,16 @@ namespace MonoTests.System.Web.UI.WebControls { { TestTable t = new TestTable (); string s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\n
", s, "empty/default"); -#else - Assert.AreEqual ("\n\n
", s, "empty/default"); -#endif t.CellPadding = 1; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\n
", s, "CellPadding"); -#else - Assert.AreEqual ("\n\n
", s, "CellPadding"); -#endif t.CellPadding = -1; t.CellSpacing = 2; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\n
", s, "CellSpacing"); -#else - Assert.AreEqual ("\n\n
", s, "CellSpacing"); -#endif t.CellSpacing = -1; t.GridLines = GridLines.Horizontal; @@ -288,125 +268,61 @@ namespace MonoTests.System.Web.UI.WebControls { t.BorderWidth = new Unit (2); s = t.Render (); -#if NET_4_0 Assert.IsTrue ((s.IndexOf ("\"border-width:2px;border-style:solid;\"") > 0), "border=0/2"); -#else - Assert.IsTrue ((s.IndexOf ("border=\"0\"") > 0), "border=0/2"); -#endif t.GridLines = GridLines.Horizontal; s = t.Render (); -#if NET_4_0 Console.WriteLine (s); Assert.IsTrue ((s.IndexOf ("rules=\"rows\" style=\"border-width:2px;border-style:solid;\"") > 0), "2/GridLines.Horizontal"); -#else - Assert.IsTrue ((s.IndexOf ("rules=\"rows\" border=\"2\"") > 0), "2/GridLines.Horizontal"); -#endif t.GridLines = GridLines.Vertical; s = t.Render (); -#if NET_4_0 Assert.IsTrue ((s.IndexOf ("rules=\"cols\" style=\"border-width:2px;border-style:solid;\"") > 0), "2/GridLines.Vertical"); -#else - Assert.IsTrue ((s.IndexOf ("rules=\"cols\" border=\"2\"") > 0), "2/GridLines.Vertical"); -#endif t.GridLines = GridLines.Both; s = t.Render (); -#if NET_4_0 Assert.IsTrue ((s.IndexOf ("rules=\"all\" style=\"border-width:2px;border-style:solid;\"") > 0), "2/GridLines.Both"); -#else - Assert.IsTrue ((s.IndexOf ("rules=\"all\" border=\"2\"") > 0), "2/GridLines.Both"); -#endif t.GridLines = GridLines.None; t.BorderWidth = new Unit (); t.HorizontalAlign = HorizontalAlign.Left; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\n
", s.ToLower (), "HorizontalAlign.Left"); -#else - Assert.AreEqual ("\n\n
", s.ToLower (), "HorizontalAlign.Left"); -#endif t.HorizontalAlign = HorizontalAlign.Center; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\n
", s.ToLower (), "HorizontalAlign.Center"); -#else - Assert.AreEqual ("\n\n
", s.ToLower (), "HorizontalAlign.Center"); -#endif t.HorizontalAlign = HorizontalAlign.Right; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\n
", s.ToLower (), "HorizontalAlign.Right"); -#else - Assert.AreEqual ("\n\n
", s.ToLower (), "HorizontalAlign.Right"); -#endif t.HorizontalAlign = HorizontalAlign.Justify; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\n
", s.ToLower (), "HorizontalAlign.Justify"); -#else - Assert.AreEqual ("\n\n
", s.ToLower (), "HorizontalAlign.Justify"); -#endif t.HorizontalAlign = HorizontalAlign.NotSet; t.Caption = "mono"; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\t\n
\n\t\tmono\n\t
", s.ToLower (), "Caption"); -#else - Assert.AreEqual ("\n\t\n
\n\t\tmono\n\t
", s.ToLower (), "Caption"); -#endif t.CaptionAlign = TableCaptionAlign.Top; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\t\n
\n\t\tmono\n\t
", s.ToLower (), "Caption/Top"); -#else - Assert.AreEqual ("\n\t\n
\n\t\tmono\n\t
", s.ToLower (), "Caption/Top"); -#endif t.CaptionAlign = TableCaptionAlign.Bottom; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\t\n
\n\t\tmono\n\t
", s.ToLower (), "Caption/Bottom"); -#else - Assert.AreEqual ("\n\t\n
\n\t\tmono\n\t
", s.ToLower (), "Caption/Bottom"); -#endif t.CaptionAlign = TableCaptionAlign.Right; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\t\n
\n\t\tmono\n\t
", s.ToLower (), "Caption/Right"); -#else - Assert.AreEqual ("\n\t\n
\n\t\tmono\n\t
", s.ToLower (), "Caption/Right"); -#endif t.CaptionAlign = TableCaptionAlign.Left; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\t\n
\n\t\tmono\n\t
", s.ToLower (), "Caption/Left"); -#else - Assert.AreEqual ("\n\t\n
\n\t\tmono\n\t
", s.ToLower (), "Caption/Left"); -#endif t.Caption = null; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\n
", s, "CaptionAlign without Caption"); -#else - Assert.AreEqual ("\n\n
", s, "CaptionAlign without Caption"); -#endif t.CaptionAlign = TableCaptionAlign.NotSet; t.BackImageUrl = imageUrl; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\n
", s, "BackImageUrl"); -#else - Assert.AreEqual ("\n\n
", s, "BackImageUrl"); -#endif t.BackImageUrl = localImageUrl; s = t.Render (); -#if NET_4_0 Assert.AreEqual ("\n\n
", s, "BackImageUrl"); -#else - Assert.AreEqual ("\n\n
", s, "BackImageUrl"); -#endif t.BackImageUrl = String.Empty; } @@ -416,11 +332,7 @@ namespace MonoTests.System.Web.UI.WebControls { { WebTest t = new WebTest (PageInvoker.CreateOnLoad (RenderInAspxPage_OnLoad)); string res = t.Run (); -#if NET_4_0 Assert.IsTrue (res.IndexOf ("\n\t\n\n\t\n
"), Adjust (s), "tr-1"); -#else - Assert.AreEqual (Adjust ("\n\t\n\n\t\n
"), Adjust (s), "tr-1"); -#endif // change instance properties tr.HorizontalAlign = HorizontalAlign.Justify; s = t.Render (); -#if NET_4_0 Assert.AreEqual (Adjust ("\n\t\n\n\t\n
"), Adjust (s), "tr-1j"); -#else - Assert.AreEqual (Adjust ("\n\t\n\n\t\n
"), Adjust (s), "tr-1j"); -#endif // add it again (same instance) t.Rows.Add (tr); Assert.AreEqual (1, t.Rows.Count, "t1bis"); Assert.AreEqual (1, t.Controls.Count, "c1bis"); s = t.Render (); -#if NET_4_0 Assert.AreEqual (Adjust ("\n\t\n\n\t\n
"), Adjust (s), "tr-1bis"); -#else - Assert.AreEqual (Adjust ("\n\t\n\n\t\n
"), Adjust (s), "tr-1bis"); -#endif tr.HorizontalAlign = HorizontalAlign.NotSet; tr = new TableRow (); @@ -507,11 +407,7 @@ namespace MonoTests.System.Web.UI.WebControls { Assert.AreEqual (2, t.Rows.Count, "r2"); Assert.AreEqual (2, t.Controls.Count, "c2"); s = t.Render (); -#if NET_4_0 Assert.AreEqual (Adjust ("\n\t\n\n\t\n\n\t\n
"), Adjust (s), "tr-2"); -#else - Assert.AreEqual (Adjust ("\n\t\n\n\t\n\n\t\n
"), Adjust (s), "tr-2"); -#endif tr = new TableRow (); tr.VerticalAlign = VerticalAlign.Bottom; @@ -519,19 +415,11 @@ namespace MonoTests.System.Web.UI.WebControls { Assert.AreEqual (3, t.Rows.Count, "r3"); Assert.AreEqual (3, t.Controls.Count, "c3"); s = t.Render (); -#if NET_4_0 Assert.AreEqual (Adjust ("\n\t\n\n\t\n\n\t\n\n\t\n
"), Adjust (s), "tr-3"); -#else - Assert.AreEqual (Adjust ("\n\t\n\n\t\n\n\t\n\n\t\n
"), Adjust (s), "tr-3"); -#endif t.Caption = "caption"; s = t.Render (); -#if NET_4_0 Assert.AreEqual (Adjust ("\n\t\n\n\t\n\n\t\n\n\t\n
\n\t\tcaption\n\t
"), Adjust (s), "tr-2c"); -#else - Assert.AreEqual (Adjust ("\n\t\n\n\t\n\n\t\n\n\t\n
\n\t\tcaption\n\t
"), Adjust (s), "tr-2c"); -#endif } [Test] @@ -620,11 +508,7 @@ namespace MonoTests.System.Web.UI.WebControls { Table t = new Table (); t.RenderBeginTag (writer); string s = writer.InnerWriter.ToString (); -#if NET_4_0 Assert.AreEqual ("\n", s, "empty"); -#else - Assert.AreEqual ("
\n", s, "empty"); -#endif } [Test] @@ -635,11 +519,7 @@ namespace MonoTests.System.Web.UI.WebControls { t.CellPadding = 1; t.RenderBeginTag (writer); string s = writer.InnerWriter.ToString (); -#if NET_4_0 Assert.AreEqual ("
\n", s, "CellPadding"); -#else - Assert.AreEqual ("
\n", s, "CellPadding"); -#endif } [Test] @@ -650,11 +530,7 @@ namespace MonoTests.System.Web.UI.WebControls { t.Caption = "caption"; t.RenderBeginTag (writer); string s = writer.InnerWriter.ToString (); -#if NET_4_0 Assert.AreEqual ("
\n\t", s, "caption"); -#else - Assert.AreEqual ("
\n\t\tcaption\n\t
\n\t", s, "caption"); -#endif } [Test] @@ -666,11 +542,7 @@ namespace MonoTests.System.Web.UI.WebControls { t.CaptionAlign = TableCaptionAlign.Top; t.RenderBeginTag (writer); string s = writer.InnerWriter.ToString (); -#if NET_4_0 Assert.AreEqual ("
\n\t\tcaption\n\t
\n\t", s.ToLower (), "caption"); -#else - Assert.AreEqual ("
\n\t\tcaption\n\t
\n\t", s.ToLower (), "caption"); -#endif } [Test] @@ -681,11 +553,7 @@ namespace MonoTests.System.Web.UI.WebControls { t.Rows.Add (new TableRow ()); t.RenderBeginTag (writer); string s = writer.InnerWriter.ToString (); -#if NET_4_0 Assert.AreEqual ("
\n\t\tcaption\n\t
\n", s, "tr"); -#else - Assert.AreEqual ("
\n", s, "tr"); -#endif } [Test] diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TextBoxTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TextBoxTest.cs index a50d339cfa..88388e870f 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TextBoxTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TextBoxTest.cs @@ -105,11 +105,7 @@ namespace MonoTests.System.Web.UI.WebControls { Poker t = new Poker (); t.TextMode = TextBoxMode.MultiLine; t.Text = ""; -#if NET_4_0 string exp = ""; -#else - string exp = ""; -#endif HtmlDiff.AssertAreEqual(exp, t.Render (),"MultilineRenderEscape"); } @@ -164,11 +160,7 @@ namespace MonoTests.System.Web.UI.WebControls { t.ValidationGroup = "VG"; t.CausesValidation = true; t.TextMode = TextBoxMode.MultiLine; -#if NET_4_0 string exp = ""; -#else - string exp = ""; -#endif HtmlDiff.AssertAreEqual (exp, t.Render (),"ValidationRender"); } diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeNodeTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeNodeTest.cs index 2cf00c0f6f..6fae07cfcd 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeNodeTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeNodeTest.cs @@ -156,18 +156,7 @@ namespace MonoTests.System.Web.UI.WebControls { [Category ("NunitWeb")] public void TreeNode_NavigateUrl () { WebTest t = new WebTest (PageInvoker.CreateOnLoad (pageLoadNavigateUrl)); -#if NET_4_0 string strTarget = "\"Skip
\r\n\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
\"\"TreeNode1
\r\n"; -#else - string strTarget = -@"
- - - - -
TreeNode1
-
"; -#endif string str = HtmlDiff.GetControlFromPageHtml (t.Run ()); HtmlDiff.AssertAreEqual (strTarget, str, "PostbackNavigate"); } @@ -194,23 +183,7 @@ namespace MonoTests.System.Web.UI.WebControls { [Category ("NunitWeb")] public void TreeNode_Render () { WebTest t = new WebTest (PageInvoker.CreateOnLoad (pageLoadRender)); -#if NET_4_0 string strTarget = "\"Skip
\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
\"Collapse\"ImageToolTip\"text
\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t
\"\"childenode
\r\n
"; -#else - string strTarget = -@"
- - - - -
text
- - - - -
childenode
-
"; -#endif string str = HtmlDiff.GetControlFromPageHtml (t.Run ()); HtmlDiff.AssertAreEqual (strTarget, str, "Render"); } diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeViewTest.cs.REMOVED.git-id b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeViewTest.cs.REMOVED.git-id index 3d1b2c9a0e..d333eca7fe 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeViewTest.cs.REMOVED.git-id +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeViewTest.cs.REMOVED.git-id @@ -1 +1 @@ -c67c20264c7d0a6d74e50c2f11556b0f52f71846 \ No newline at end of file +26c5088ccf80d21e12be7aaaee864949746300b3 \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ValidationSummaryTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ValidationSummaryTest.cs index 7c5e7530fa..4f43e8e142 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ValidationSummaryTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ValidationSummaryTest.cs @@ -270,7 +270,6 @@ namespace MonoTests.System.Web.UI.WebControls StopValidationTest(); } -#if NET_4_0 [Test] public void SupportsDisabledAttribute () { @@ -284,6 +283,5 @@ namespace MonoTests.System.Web.UI.WebControls Assert.AreEqual (ver35, p.RenderingCompatibility, "#A2-1"); Assert.IsTrue (p.SupportsDisabledAttribute, "#A2-2"); } -#endif } } diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepBaseTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepBaseTest.cs index ceb2dad584..c91f3cbf40 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepBaseTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardStepBaseTest.cs @@ -215,11 +215,7 @@ namespace MonoTests.System.Web.UI.WebControls // This render test include Title property test string html = new WebTest (PageInvoker.CreateOnLoad ( new PageDelegate (Render_Test))).Run (); -#if NET_4_0 string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
my_title
my_title_2
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
123
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
"; -#else - string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
my_title
my_title_2
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
123
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "BaseRender"); if (html.IndexOf ("my_title") < 0) @@ -312,7 +308,7 @@ namespace MonoTests.System.Web.UI.WebControls [Category ("NunitWeb")] public void WizardStepBase_Theme () { - WebTest.CopyResource (GetType (), "WizardTest.skin", "App_Themes/Theme1/WizardTest.skin"); + WebTest.CopyResource (GetType (), "WizardTest.skin", "App_Themes/WizardStepBase/WizardTest.skin"); WebTest t = new WebTest (); PageDelegates pd = new PageDelegates (); pd.PreInit = set_properties; @@ -332,7 +328,7 @@ namespace MonoTests.System.Web.UI.WebControls public static void set_properties (Page p) { - p.Theme = "Theme1"; + p.Theme = "WizardStepBase"; } public static void theme (Page p) diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardTest.cs index 03a3921653..f81a3a88c4 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/WizardTest.cs @@ -300,7 +300,6 @@ namespace MonoTests.System.Web.UI.WebControls base.EnsureChildControls (); } } -#if NET_4_0 class TestHeaderSpan : WebControl { public TestHeaderSpan () @@ -360,7 +359,6 @@ namespace MonoTests.System.Web.UI.WebControls return ctl; } } -#endif [TestFixture] public class WizardTest { @@ -374,12 +372,10 @@ namespace MonoTests.System.Web.UI.WebControls Assert.AreEqual ("MoveNext", Wizard.MoveNextCommandName, "MoveNextCommandName"); Assert.AreEqual ("MovePrevious", Wizard.MovePreviousCommandName, "MovePreviousCommandName"); Assert.AreEqual ("Move", Wizard.MoveToCommandName, "MoveToCommandName"); -#if NET_4_0 Assert.AreEqual ("headerPlaceholder", Wizard.HeaderPlaceholderId, "HeaderPlaceHolderId"); Assert.AreEqual ("navigationPlaceholder", Wizard.NavigationPlaceholderId, "NavigationPlaceHolderId"); Assert.AreEqual ("sideBarPlaceholder", Wizard.SideBarPlaceholderId, "SidePlaceholderId"); Assert.AreEqual ("wizardStepPlaceholder", Wizard.WizardStepPlaceholderId, "WizardStepPlaceholderId"); -#endif // Protected Fields Assert.AreEqual ("CancelButton", PokerWizard.PokerCancelButtonID, "CancelButtonID"); Assert.AreEqual ("CustomFinishButton", PokerWizard.PokerCustomFinishButtonID, "CustomFinishButtonID"); @@ -539,11 +535,7 @@ namespace MonoTests.System.Web.UI.WebControls { WebTest t = new WebTest (PageInvoker.CreateOnPreInit (_CancelButtonPropertyRendering)); string html = t.Run (); -#if NET_4_0 string origin = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
Start
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
"; -#else - string origin = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
Start
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "CancelButtonPropertyRendering"); } @@ -585,11 +577,7 @@ namespace MonoTests.System.Web.UI.WebControls WebTest t = new WebTest (PageInvoker.CreateOnPreInit (_FinishButtonPropertyRendering)); string html = t.Run (); -#if NET_4_0 string origin = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
Finish
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
FinishCompleteButtonText
"; -#else - string origin = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
Finish
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
FinishCompleteButtonText
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "CancelButtonPropertyRendering"); } @@ -634,11 +622,7 @@ namespace MonoTests.System.Web.UI.WebControls { WebTest t = new WebTest (PageInvoker.CreateOnPreInit (_HeaderRendering)); string html = t.Run (); -#if NET_4_0 string origin = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
Finish
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
"; -#else - string origin = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
Finish
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "HeaderRendering"); } @@ -685,11 +669,7 @@ namespace MonoTests.System.Web.UI.WebControls { WebTest t = new WebTest (PageInvoker.CreateOnPreInit (_SideBarRendering)); string html = t.Run (); -#if NET_4_0 string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Step 1
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
"; -#else - string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Step 1
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "SideBarRendering"); } @@ -742,11 +722,7 @@ namespace MonoTests.System.Web.UI.WebControls { WebTest t = new WebTest (PageInvoker.CreateOnPreInit (_NavigationRendering)); string html = t.Run (); -#if NET_4_0 string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
step1
step2
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Start
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
"; -#else - string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
step1
step2
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Start
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "NavigationRendering"); } @@ -783,11 +759,7 @@ namespace MonoTests.System.Web.UI.WebControls { WebTest t = new WebTest (PageInvoker.CreateOnPreInit (_StartTypeRendering)); string html = t.Run (); -#if NET_4_0 string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
step1
step2
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Start
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
"; -#else - string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
step1
step2
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Start
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "StartTypeRendering"); } @@ -826,11 +798,7 @@ namespace MonoTests.System.Web.UI.WebControls { WebTest t = new WebTest (PageInvoker.CreateOnPreInit (_StartTemplateRendering)); string html = t.Run (); -#if NET_4_0 string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
step1
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Start
"; -#else - string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
step1
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Start
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "StartTemplateRendering"); } @@ -868,11 +836,7 @@ namespace MonoTests.System.Web.UI.WebControls { WebTest t = new WebTest (PageInvoker.CreateOnPreInit (_StepTypeRendering)); string html = t.Run (); -#if NET_4_0 string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
step1
step2
step3
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Step2
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
StepPreviousButtonText
"; -#else - string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
step1
step2
step3
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Step2
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
StepPreviousButtonText
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "StepRendering"); } @@ -924,11 +888,7 @@ namespace MonoTests.System.Web.UI.WebControls { WebTest t = new WebTest (PageInvoker.CreateOnPreInit (_StepNavigationTemplate)); string html = t.Run (); -#if NET_4_0 string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
step1
step2
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Step1
Test text
"; -#else - string origin = "\r\n\t\r\n\t\t\r\n\t\r\n
\"Skip\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
step1
step2
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
Step1
Test text
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origin, renderedHtml, "StepNavigationTemplateRendering"); } @@ -1443,11 +1403,7 @@ namespace MonoTests.System.Web.UI.WebControls { string html = new WebTest (PageInvoker.CreateOnPreInit ( new PageDelegate (WizardPreInit))).Run (); -#if NET_4_0 string origHtml = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
123
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
"; -#else - string origHtml = "\r\n\t\r\n\t\t\r\n\t\r\n\t\t\r\n\t\r\n
123
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
"; -#endif string renderedHtml = HtmlDiff.GetControlFromPageHtml (html); HtmlDiff.AssertAreEqual (origHtml, renderedHtml, "BaseRender"); } @@ -1530,7 +1486,6 @@ namespace MonoTests.System.Web.UI.WebControls Assert.Fail ("FinishButtonNotCreated"); Assert.AreEqual (-1, result.IndexOf ("Next"), "NextButtonCreatedOnLastPage"); } -#if NET_4_0 [Test] public void Wizard_LayoutTemplate () { @@ -1752,7 +1707,6 @@ namespace MonoTests.System.Web.UI.WebControls w.WizardSteps.Add (ws); } -#endif [Test] [Category ("NunitWeb")] public void Wizard_RenderTestCompleteItem () diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/XmlDataSourceTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/XmlDataSourceTest.cs index d5dfbac458..2d845ac32d 100644 --- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/XmlDataSourceTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/XmlDataSourceTest.cs @@ -462,7 +462,6 @@ namespace MonoTests.System.Web.UI.WebControls DSPoker p = new DSPoker (); p.GetXmlDocument (); } -#if NET_4_0 [Test] public void CacheKeyContext () { @@ -474,7 +473,6 @@ namespace MonoTests.System.Web.UI.WebControls xds.CacheKeyContext = "MyKey"; Assert.AreEqual ("MyKey", xds.CacheKeyContext, "#A1"); } -#endif [TestFixtureTearDown] public void TearDown () { diff --git a/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs b/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs index 5b1f33ff1e..604365e428 100644 --- a/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs @@ -44,9 +44,7 @@ using MonoTests.Common; using System.Web.UI.Adapters; -#if NET_4_0 using System.Web.Routing; -#endif namespace MonoTests.System.Web.UI { @@ -973,11 +971,7 @@ namespace MonoTests.System.Web.UI fr.Controls ["__EVENTTARGET"].Value = "container$children$lb"; fr.Controls ["__EVENTARGUMENT"].Value = String.Empty; t.Request = fr; -#if NET_4_0 string originalHtml = "Woot! I got clicked!
"; -#else - string originalHtml = @"Woot! I got clicked!
"; -#endif string pageHtml = t.Run (); string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml); @@ -998,7 +992,6 @@ namespace MonoTests.System.Web.UI WebTest.CopyResource (GetType (), "OverridenControlsPropertyAndPostBack_Bug594238.aspx", "OverridenControlsPropertyAndPostBack_Bug594238.aspx"); } -#if NET_4_0 [Test] public void GetRouteUrl_Object () { @@ -1116,7 +1109,6 @@ namespace MonoTests.System.Web.UI path = ctl.GetRouteUrl (String.Empty, (RouteValueDictionary) null); Assert.IsNull (path, "#A3-3"); } -#endif #region helpcalsses class ControlWithState : Control { diff --git a/mcs/class/System.Web/Test/System.Web.UI/DataKeyPropertyAttributeTest.cs b/mcs/class/System.Web/Test/System.Web.UI/DataKeyPropertyAttributeTest.cs index 6017b12618..73fc20a8b6 100644 --- a/mcs/class/System.Web/Test/System.Web.UI/DataKeyPropertyAttributeTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI/DataKeyPropertyAttributeTest.cs @@ -23,7 +23,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_4_0 using System; using System.Web.UI; @@ -60,4 +59,3 @@ namespace MonoTests.System.Web.UI } } } -#endif \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.UI/LosFormatterTest.cs b/mcs/class/System.Web/Test/System.Web.UI/LosFormatterTest.cs index 03e03728e1..359096352c 100644 --- a/mcs/class/System.Web/Test/System.Web.UI/LosFormatterTest.cs +++ b/mcs/class/System.Web/Test/System.Web.UI/LosFormatterTest.cs @@ -81,13 +81,8 @@ namespace MonoTests.System.Web.UI byte [] data = Convert.FromBase64String (expected); byte [] signed_data = Convert.FromBase64String (signed); Assert.IsTrue (BitConverter.ToString (signed_data).StartsWith (BitConverter.ToString (data)), "4 / same data"); -#if NET_4_0 // 32 bytes == 256 bits -> match HMACSHA256 as default Assert.AreEqual (32, signed_data.Length - data.Length, "signature length"); -#else - // 20 bytes == 160 bits -> match HMACSHA1 as default - Assert.AreEqual (20, signed_data.Length - data.Length, "signature length"); -#endif } [Test] @@ -114,13 +109,8 @@ namespace MonoTests.System.Web.UI byte [] data = Convert.FromBase64String (expected); byte [] signed_data = Convert.FromBase64String (signed); Assert.IsTrue (BitConverter.ToString (signed_data).StartsWith (BitConverter.ToString (data)), "5 / same data"); -#if NET_4_0 // 32 bytes == 256 bits -> match HMACSHA256 as default Assert.AreEqual (32, signed_data.Length - data.Length, "signature length"); -#else - // 20 bytes == 160 bits -> match HMACSHA1 as default - Assert.AreEqual (20, signed_data.Length - data.Length, "signature length"); -#endif LosFormatter lf6 = new LosFormatter (true, "string"); // bug #649551 signed = NoKeyRoundTrip (lf6, "true, plain"); Assert.AreNotEqual (expected, signed, "6"); @@ -171,7 +161,6 @@ namespace MonoTests.System.Web.UI Assert.AreNotEqual (r4, r5, "r4-r5"); } -#if NET_4_0 [Test] [ExpectedException (typeof (NotSupportedException))] public void Deserialize_Stream_NonSeekable () @@ -181,19 +170,6 @@ namespace MonoTests.System.Web.UI LosFormatter lf = new LosFormatter (); lf.Serialize (ns, s1); } -#else - [Test] // bug #411115 - public void Deserialize_Stream_NonSeekable () - { - string s1 = "Hello world"; - NonSeekableStream ns = new NonSeekableStream (); - LosFormatter lf = new LosFormatter (); - lf.Serialize (ns, s1); - ns.Reset (); - string s2 = lf.Deserialize (ns) as string; - Assert.AreEqual (s1, s2); - } -#endif [Test] // bug #324526 public void Serialize () { diff --git a/mcs/class/System.Web/Test/System.Web.Util/HttpEncoderTest.cs b/mcs/class/System.Web/Test/System.Web.Util/HttpEncoderTest.cs index 4975b430ee..4ea7ad9ab5 100644 --- a/mcs/class/System.Web/Test/System.Web.Util/HttpEncoderTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Util/HttpEncoderTest.cs @@ -23,7 +23,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_4_0 using System; using System.Collections.Generic; using System.IO; @@ -75,11 +74,7 @@ namespace MonoTests.System.Web.Util [TestFixture] public class HttpEncoderTest { -#if NET_4_0 const string notEncoded = "!()*-._"; -#else - const string notEncoded = "!'()*-._"; -#endif static char [] hexChars = "0123456789abcdef".ToCharArray (); [Test] @@ -412,4 +407,3 @@ namespace MonoTests.System.Web.Util #endregion } } -#endif \ No newline at end of file diff --git a/mcs/class/System.Web/Test/System.Web.Util/MachineKeySectionUtilsTest.cs b/mcs/class/System.Web/Test/System.Web.Util/MachineKeySectionUtilsTest.cs index b92554ec98..8a1a4ed673 100644 --- a/mcs/class/System.Web/Test/System.Web.Util/MachineKeySectionUtilsTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Util/MachineKeySectionUtilsTest.cs @@ -107,7 +107,6 @@ namespace MonoTests.System.Web.Util { section.Validation = MachineKeyValidation.SHA1; Encrypt_RoundTrip (section); } -#if NET_4_0 [Test] public void Encrypt_RoundTrip_HMACSHA256 () { @@ -139,7 +138,6 @@ namespace MonoTests.System.Web.Util { section.ValidationAlgorithm = "alg:HMACRIPEMD160"; EncryptSign_RoundTrip (section); } -#endif public void EncryptSign_RoundTrip (MachineKeySection section) { byte [] data = new byte [14]; @@ -196,7 +194,6 @@ namespace MonoTests.System.Web.Util { section.Validation = MachineKeyValidation.SHA1; EncryptSign_RoundTrip (section); } -#if NET_4_0 [Test] public void EncryptSign_RoundTrip_HMACSHA256 () { @@ -228,7 +225,6 @@ namespace MonoTests.System.Web.Util { section.ValidationAlgorithm = "alg:HMACRIPEMD160"; EncryptSign_RoundTrip (section); } -#endif public void Validation_RoundTrip (MachineKeySection section) { byte [] data = new byte [] { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 }; @@ -282,7 +278,6 @@ namespace MonoTests.System.Web.Util { Validation_RoundTrip (section); } -#if NET_4_0 [Test] public void Validation_RoundTrip_HMACSHA256 () { @@ -314,7 +309,6 @@ namespace MonoTests.System.Web.Util { section.ValidationAlgorithm = "alg:HMACRIPEMD160"; Validation_RoundTrip (section); } -#endif [Test] public void GetHexString () { diff --git a/mcs/class/System.Web/Test/System.Web.Util/RequestValidatorTest.cs b/mcs/class/System.Web/Test/System.Web.Util/RequestValidatorTest.cs index cbb24fab1d..b185d1290f 100644 --- a/mcs/class/System.Web/Test/System.Web.Util/RequestValidatorTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Util/RequestValidatorTest.cs @@ -24,7 +24,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_4_0 using System; using System.Collections.Generic; using System.Diagnostics; @@ -97,4 +96,3 @@ namespace MonoTests.System.Web.Util } } } -#endif diff --git a/mcs/class/System.Web/Test/System.Web/HttpApplicationTest.cs b/mcs/class/System.Web/Test/System.Web/HttpApplicationTest.cs index 64d8773abb..7d572081fc 100644 --- a/mcs/class/System.Web/Test/System.Web/HttpApplicationTest.cs +++ b/mcs/class/System.Web/Test/System.Web/HttpApplicationTest.cs @@ -37,7 +37,6 @@ namespace MonoTests.System.Web [TestFixture] public class HttpApplicationTest { -#if NET_4_0 [Test] public void GetOutputCacheProviderName () { @@ -45,6 +44,5 @@ namespace MonoTests.System.Web Assert.AreEqual ("AspNetInternalProvider", app.GetOutputCacheProviderName (null), "#A1"); } -#endif } } diff --git a/mcs/class/System.Web/Test/System.Web/HttpCookieTest.cs b/mcs/class/System.Web/Test/System.Web/HttpCookieTest.cs index f6eafc6d76..387406dcbd 100644 --- a/mcs/class/System.Web/Test/System.Web/HttpCookieTest.cs +++ b/mcs/class/System.Web/Test/System.Web/HttpCookieTest.cs @@ -357,40 +357,22 @@ namespace MonoTests.System.Web { Assert.AreEqual ("`~!@#$%^", cookie.Values.Get (0), "#G5"); Assert.AreEqual ("*()_+-", cookie.Values.GetKey (1), "#G6"); Assert.AreEqual ("\\][{}|'\";:,<.>/?", cookie.Values.Get (1), "#G7"); -#if NET_4_0 Assert.AreEqual ("%60%7e!%40%23%24%25%5e&*()_%2b-=%5c%5d%5b%7b%7d" + "%7c%27%22%3b%3a%2c%3c.%3e%2f%3f", cookie.Values.ToString (), "#G8"); -#else - Assert.AreEqual ("%60%7e!%40%23%24%25%5e&*()_%2b-=%5c%5d%5b%7b%7d" - + "%7c'%22%3b%3a%2c%3c.%3e%2f%3f", cookie.Values.ToString (), "#G8"); -#endif cookie = new HttpCookie ("funkycookie11", cookie.Values.ToString ()); Assert.AreEqual ("System.Web.HttpCookie", cookie.ToString (), "#H1"); -#if NET_4_0 Assert.AreEqual ("%60%7e!%40%23%24%25%5e&*()_%2b-=%5c%5d%5b%7b%7d" + "%7c%27%22%3b%3a%2c%3c.%3e%2f%3f", cookie.Value, "#H2"); -#else - Assert.AreEqual ("%60%7e!%40%23%24%25%5e&*()_%2b-=%5c%5d%5b%7b%7d" - + "%7c'%22%3b%3a%2c%3c.%3e%2f%3f", cookie.Value, "#H2"); -#endif Assert.AreEqual (2, cookie.Values.Count, "#H3"); Assert.IsNull (cookie.Values.GetKey (0), "#H4"); Assert.AreEqual ("%60%7e!%40%23%24%25%5e", cookie.Values.Get (0), "#H5"); Assert.AreEqual ("*()_%2b-", cookie.Values.GetKey (1), "#H6"); -#if NET_4_0 Assert.AreEqual ("%5c%5d%5b%7b%7d%7c%27%22%3b%3a%2c%3c.%3e%2f%3f", cookie.Values.Get (1), "#H7"); Assert.AreEqual ("%2560%257e!%2540%2523%2524%2525%255e&*()_%252b-=" + "%255c%255d%255b%257b%257d%257c%2527%2522%253b%253a%252c%253c.%2" + "53e%252f%253f", cookie.Values.ToString (), "#H8"); -#else - Assert.AreEqual ("%5c%5d%5b%7b%7d%7c'%22%3b%3a%2c%3c.%3e%2f%3f", - cookie.Values.Get (1), "#H7"); - Assert.AreEqual ("%2560%257e!%2540%2523%2524%2525%255e&*()_%252b-=" - + "%255c%255d%255b%257b%257d%257c'%2522%253b%253a%252c%253c.%2" - + "53e%252f%253f", cookie.Values.ToString (), "#H8"); -#endif cookie = new HttpCookie ("basic"); cookie.Values ["one"] = "hello world"; diff --git a/mcs/class/System.Web/Test/System.Web/HttpExceptionTest.cs b/mcs/class/System.Web/Test/System.Web/HttpExceptionTest.cs index 69a21a3bca..1d33f02fa8 100644 --- a/mcs/class/System.Web/Test/System.Web/HttpExceptionTest.cs +++ b/mcs/class/System.Web/Test/System.Web/HttpExceptionTest.cs @@ -11,13 +11,11 @@ namespace MonoTests.System.Web [TestFixture] public class HttpExceptionTest { -#if NET_4_0 [Test] public void WebEventCode () { var ex = new HttpException (); Assert.AreEqual (WebEventCodes.UndefinedEventCode, ex.WebEventCode); } -#endif } } diff --git a/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs b/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs index 9ee9ebe1a1..15d1f137a0 100644 --- a/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs +++ b/mcs/class/System.Web/Test/System.Web/HttpRequestTest.cs @@ -254,6 +254,30 @@ namespace MonoTests.System.Web { { HttpContext.Current.Request.MapPath ("Web.config", "something", false); } + + [Test] + [ExpectedException (typeof (PlatformNotSupportedException))] + public void ReadOnlyHeadersAdd () + { + var r = new HttpRequest ("file", "http://www.gnome.org", "key=value&key2=value%32second"); + r.Headers.Add ("a","a"); + } + + [Test] + [ExpectedException (typeof (PlatformNotSupportedException))] + public void ReadOnlyHeadersSet () + { + var r = new HttpRequest ("file", "http://www.gnome.org", "key=value&key2=value%32second"); + r.Headers.Set ("a","a"); + } + + [Test] + [ExpectedException (typeof (PlatformNotSupportedException))] + public void ReadOnlyHeadersRemove () + { + var r = new HttpRequest ("file", "http://www.gnome.org", "key=value&key2=value%32second"); + r.Headers.Remove ("a"); + } } [TestFixture] diff --git a/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs b/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs index 4dd13d12b4..2ce8621aec 100644 --- a/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs +++ b/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs @@ -33,10 +33,8 @@ using System.Configuration.Provider; using System.IO; using System.Text; using System.Web; -#if NET_4_0 using System.Web.Routing; using System.Web.Caching; -#endif using NUnit.Framework; @@ -634,7 +632,6 @@ namespace MonoTests.System.Web { var resp = new HttpResponse (null); Assert.IsNull (resp.Output, "#A1"); } -#if NET_4_0 [Test] public void RedirectPermanent () { @@ -733,7 +730,6 @@ namespace MonoTests.System.Web { context.Response.Write ((object) null); }, "#A3-5"); } -#endif } [TestFixture] diff --git a/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs b/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs index 3882f2e779..d320a54f1f 100644 --- a/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs +++ b/mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs @@ -48,26 +48,16 @@ namespace MonoTests.System.Web { Assert.AreEqual (String.Empty, HttpUtility.HtmlAttributeEncode (String.Empty), "#A2"); Assert.AreEqual ("<script>", HttpUtility.HtmlAttributeEncode ("