Merge pull request #2646 from ludovic-henry/fix-processwatch-dispose
authorAnkit Jain <radical@gmail.com>
Mon, 22 Feb 2016 18:26:24 +0000 (13:26 -0500)
committerAnkit Jain <radical@gmail.com>
Mon, 22 Feb 2016 18:26:24 +0000 (13:26 -0500)
[Microsoft.Build] Fix XS build error + Fix expected output newline from ProcessWrapper.OutputStreamChanged and ProcessWrapper.ErrorStreamChanged

229 files changed:
README.md
configure.ac
external/referencesource
mcs/class/Mainsoft.Web/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_GlobalResources/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_GlobalResources/GlobalResource.resx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/CreateRole.aspx.resx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/CreateUser.aspx.resx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/Default.aspx.resx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/EditUser.aspx.resx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/ManageRole.aspx.resx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/ManageUser.aspx.resx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/Util.Master.resx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.cs.bak [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.designer.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.designer.cs.bak [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Mainsoft.Web.AspnetConfig.csproj [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Properties/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Properties/AssemblyInfo.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Properties/AssemblyInfo.cs.bak [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/WEB-INF/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/WEB-INF/faces-config.xml [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/WEB-INF/web.xml [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Web.config [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Web.config.bak [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateRole.aspx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateRole.aspx.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateRole.aspx.designer.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateUser.aspx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateUser.aspx.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateUser.aspx.designer.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Default.aspx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Default.aspx.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Default.aspx.designer.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/EditUser.aspx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/EditUser.aspx.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/EditUser.aspx.designer.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Error.aspx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Error.aspx.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Error.aspx.designer.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/GridButton.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/GridCheckBox.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/HandlerFactoryConfiguration.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/HttpHandlersSectionHandler.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Mainsoft.Web.AspnetConfig.css [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageRole.aspx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageRole.aspx.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageRole.aspx.designer.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageUser.aspx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageUser.aspx.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageUser.aspx.designer.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/RolesDS.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/SecurError.aspx [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/SecurError.aspx.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/SecurError.aspx.designer.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/StrUtils.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/UrlUtils.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Util.Master [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Util.Master.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Util.Master.designer.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/makefile.build [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/nomd5 [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/resources/mainsoft.jpg [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/resources/untitled.bmp [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/AbstractAttributeMap.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/AspNetFacesContext.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseExternalContext.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseFacesPageHandlerFactory.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseFacesStateManager.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseFacesViewHandler.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseHttpServlet.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseStaticHttpServlet.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/IExtendedViewHandler.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/IncludeHelperServlet.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/OutputStreamWrapper.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/RequestParameterMap.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/RequestParameterValuesMap.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesContext.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesPageHandler.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesPageHandlerFactory.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesStateManager.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesViewHandler.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletIncludeUtils.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletResourceLoader.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.jvm.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/SessionWrapper.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.J2EE.csproj [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/CloudscapeProfileProvider.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileHelper.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileProvider.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Security/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Security/CloudscapeMembershipProvider.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Security/CloudscapeRoleProvider.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyApplicationsHelper.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyDBSchema.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyMembershipHelper.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyMembershipProvider.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyRoleProvider.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyRolesHelper.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Security/J2EEAuthenticationModule.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.Security/ServletAuthenticationModule.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ObjectInputStream.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ObjectOutputStream.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionIDManager.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateItemCollection.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateStoreProvider.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/SessionListener.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web/BaseHttpContext.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEConsts.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEUtils.cs [deleted file]
mcs/class/Mainsoft.Web/Mainsoft.Web/ServletHttpContext.cs [deleted file]
mcs/class/Mainsoft.Web/Properties/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Properties/AssemblyInfo.cs [deleted file]
mcs/class/Mainsoft.Web/Tests/Mainsoft.Web.Security/.gitattributes [deleted file]
mcs/class/Mainsoft.Web/Tests/Mainsoft.Web.Security/MembershipTests.cs [deleted file]
mcs/class/Mainsoft.Web/Tests/Tests.csproj [deleted file]
mcs/class/Mainsoft.Web/makefile.build [deleted file]
mcs/class/Mono.Debugger.Soft/Test/dtest.cs
mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs
mcs/class/System.Drawing/System.Drawing.Printing/PrintingServicesUnix.cs
mcs/class/System.Drawing/Test/System.Drawing.Printing/PrintingServicesUnixTest.cs
mcs/class/System.IO.Compression/SharpCompress/Writer/Zip/ZipCentralDirectoryEntry.cs
mcs/class/System.IO.Compression/SharpCompress/Writer/Zip/ZipWriter.cs
mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs
mcs/class/System.IO.Compression/ZipArchiveEntry.cs
mcs/class/System.ServiceModel/System.ServiceModel/WSDualHttpBinding.cs
mcs/class/System.Web.ApplicationServices/Makefile
mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices.dll.sources
mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices.txt [new file with mode: 0644]
mcs/class/System.Web.ApplicationServices/System.Web.Configuration/MembershipPasswordCompatibilityMode.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateStatus.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateUserException.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordException.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordFormat.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipProviderCollection.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipUserCollection.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipValidatePasswordEventHandler.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web.Security/ValidatePasswordEventArgs.cs [deleted file]
mcs/class/System.Web.ApplicationServices/System.Web/ApplicationServicesStrings.cs [new file with mode: 0644]
mcs/class/System.Web/System.Web.Profile/DefaultProfile.cs [deleted file]
mcs/class/System.Web/System.Web.Profile/ProfileAuthenticationOption.cs [deleted file]
mcs/class/System.Web/System.Web.Profile/ProfileInfo.cs [deleted file]
mcs/class/System.Web/System.Web.Profile/ProfileInfoCollection.cs [deleted file]
mcs/class/System.Web/System.Web.UI.WebControls/IPostBackContainer.cs [deleted file]
mcs/class/System.Web/System.Web.UI/ICheckBoxControl.cs [deleted file]
mcs/class/System.Web/System.Web.UI/IEditableTextControl.cs [deleted file]
mcs/class/System.Web/System.Web.UI/ITextControl.cs [deleted file]
mcs/class/System.Web/System.Web.dll.sources
mcs/class/WindowsBase/System.Windows.Threading/Dispatcher.cs
mcs/class/WindowsBase/System.Windows.Threading/DispatcherOperation.cs
mcs/class/corlib/System.Threading/EventWaitHandle.cs
mcs/class/corlib/System.Threading/NativeEventCalls.cs
mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs
mcs/class/corlib/System.Threading/Timer.cs
mcs/class/corlib/System.Threading/WaitHandle.cs
mcs/class/corlib/System/Environment.cs
mcs/class/corlib/System/TimeZoneInfo.cs
mcs/class/corlib/Test/System.Threading/AutoResetEventTest.cs
mcs/class/corlib/Test/System/TimeZoneInfoTest.cs
mcs/class/corlib/corlib.dll.sources
mcs/class/test-helpers/SocketResponder.cs
mcs/mcs/settings.cs
mcs/tools/mkbundle/mkbundle.cs
mono/dis/dump.c
mono/dis/get.c
mono/io-layer/processes.c
mono/metadata/appdomain.c
mono/metadata/assembly.c
mono/metadata/class-internals.h
mono/metadata/class.c
mono/metadata/class.h
mono/metadata/cominterop.c
mono/metadata/console-unix.c
mono/metadata/debug-helpers.c
mono/metadata/domain.c
mono/metadata/exception.c
mono/metadata/image.c
mono/metadata/marshal.c
mono/metadata/metadata.c
mono/metadata/method-builder.c
mono/metadata/mono-mlist.c
mono/metadata/mono-security.c
mono/metadata/object-internals.h
mono/metadata/object.c
mono/metadata/process.c
mono/metadata/security-manager.c
mono/metadata/sgen-mono.c
mono/metadata/socket-io.c
mono/metadata/threadpool-ms.c
mono/metadata/threads-types.h
mono/metadata/threads.c
mono/mini/aot-compiler.c
mono/mini/branch-opts.c
mono/mini/debugger-agent.c
mono/mini/decompose.c
mono/mini/driver.c
mono/mini/llvm-jit.cpp
mono/mini/local-propagation.c
mono/mini/method-to-ir.c
mono/mini/mini-amd64.c
mono/mini/mini-arm.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-ia64.c
mono/mini/mini-llvm.c
mono/mini/mini-mips.c
mono/mini/mini-ppc.c
mono/mini/mini-runtime.c
mono/mini/mini-s390x.c
mono/mini/mini-sparc.c
mono/mini/mini-x86.c
mono/mini/mini.c
mono/mini/mini.h
mono/profiler/mono-profiler-iomap.c
mono/tests/load-exceptions.cs
mono/utils/mono-error.c
msvc/mono.def
msvc/monosgen.def
scripts/dmcs.in

index 8305cb08b3f21e081b2f22c5be539246d941753c..7a7f3639f28ccefebc994e5d5f03cb0ae41f2ce1 100644 (file)
--- a/README.md
+++ b/README.md
@@ -181,7 +181,7 @@ while `mono-sgen` uses the Simple Generational GC.
 * `--with-gc=[included, boehm, none]` - Selects the default Boehm
 garbage collector engine to use.
 
-  * *included*: (*slighty modified Boehm GC*) This is the default
+  * *included*: (*slightly modified Boehm GC*) This is the default
 value for the Boehm GC, and it's the most feature complete, it will
 allow Mono to use typed allocations and support the debugger.
 
index bf6208e5dd7c381f327f974e0c79009ce4f5efcf..296c43c5431c2adda6b8741d09025b6c4c291b73 100644 (file)
@@ -2611,21 +2611,54 @@ if test "x$enable_llvm" = "xyes"; then
 
    if test "x$host_win32" = "xno"; then
 
+   # Should be something like '2.6' or '2.7svn'
+   llvm_version=`$LLVM_CONFIG --version`
+   llvm_api_version=`$LLVM_CONFIG --mono-api-version 2>/dev/null`
+   AC_MSG_CHECKING(LLVM version)
+   AC_MSG_RESULT($llvm_version $llvm_api_version)
+   if echo $llvm_version | grep -q 'mono'; then
+         if test "x$enable_llvm_version_check" == "xyes"; then
+                if test "$llvm_version" != "$expected_llvm_version"; then
+                       AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"])
+                fi
+         fi
+   else
+         AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
+   fi
+
    # The output of --cflags seems to include optimizations flags too
-   LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
-   LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
+   if test $llvm_api_version -gt 100; then
+         # The --cflags argument includes all kinds of warnings -pendantic etc.
+         LLVM_CFLAGS="-I$with_llvm/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
+         LLVM_CXXFLAGS="-I$with_llvm/include -std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
+   else
+         LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
+      LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
+   fi
    # LLVM is compiled with -fno-rtti, so we need this too, since our classes inherit
    # from LLVM classes.
    LLVM_CXXFLAGS="$LLVM_CXXFLAGS -fno-rtti -fexceptions"
    LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
    # This might include empty lines
    LLVM_SYSTEM_LIBS=`$LLVM_CONFIG --system-libs 2>/dev/null | grep -- -`
-   if test "x$host" != "x$target"; then
+   llvm_jit_supported=yes
+   if test $llvm_api_version -gt 100; then
+         # Based on llvm 3.9, only aot is currently supported
+         llvm_jit_supported=no
+   elif test "x$host" != "x$target"; then
+      # No need for jit libs
+         llvm_jit_supported=no
+   fi
+   if test $llvm_jit_supported = no; then
       # No need for jit libs
       LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter`
    else
       LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter jit mcjit $llvm_codegen`
    fi
+   if test "x$LLVM_LIBS" == "x"; then
+         echo "$LLVM_CONFIG --libs failed."
+         exit 1
+   fi
    LLVM_LIBS="$LLVM_LIBS $LLVM_LDFLAGS $LLVM_SYSTEM_LIBS"
    # The c++ standard library used by llvm doesn't show up in $LLVM_SYSTEM_LIBS so add it manually
    if echo $LLVM_CXXFLAGS | grep -q -- '-stdlib=libc++'; then
@@ -2636,21 +2669,6 @@ if test "x$enable_llvm" = "xyes"; then
 
    expected_llvm_version="3.4svn-mono-mono/e656cac"
 
-   # Should be something like '2.6' or '2.7svn'
-   llvm_version=`$LLVM_CONFIG --version`
-   llvm_api_version=`$LLVM_CONFIG --mono-api-version 2>/dev/null`
-   AC_MSG_CHECKING(LLVM version)
-   AC_MSG_RESULT($llvm_version)
-   if echo $llvm_version | grep -q 'mono'; then
-         if test "x$enable_llvm_version_check" == "xyes"; then
-                if test "$llvm_version" != "$expected_llvm_version"; then
-                       AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"])
-                fi
-         fi
-   else
-         AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
-   fi
-
    else
        LLVM_CFLAGS="-I$with_llvm/include -DNDEBUG -D__NO_CTYPE_INLINE -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
        LLVM_CXXFLAGS="$LLVM_CFLAGS -std=gnu++11 -fvisibility-inlines-hidden -fno-rtti -Woverloaded-virtual -Wcast-qual"
@@ -3020,6 +3038,7 @@ if test "x$host" != "x$target"; then
                arch_target=amd64;
                AC_DEFINE(TARGET_AMD64, 1, [...])
                AC_DEFINE(TARGET_PS4, 1, [...])
+               AC_DEFINE(DISABLE_HW_TRAPS, 1, [...])
                CPPFLAGS="$CPPFLAGS"
                # Can't use tls, since it depends on the runtime detection of tls offsets
                # in mono-compiler.h
index bf43bae316ec6216e79beb95b2ba25137d91908d..423e8998d55f168e2aa5da2c0e00ec6dd1356cbf 160000 (submodule)
@@ -1 +1 @@
-Subproject commit bf43bae316ec6216e79beb95b2ba25137d91908d
+Subproject commit 423e8998d55f168e2aa5da2c0e00ec6dd1356cbf
diff --git a/mcs/class/Mainsoft.Web/.gitattributes b/mcs/class/Mainsoft.Web/.gitattributes
deleted file mode 100644 (file)
index 6c272b9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/makefile.build -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/.gitattributes
deleted file mode 100644 (file)
index 96015fe..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/Web.config -crlf
-/Web.config.bak -crlf
-/makefile.build -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_GlobalResources/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_GlobalResources/.gitattributes
deleted file mode 100644 (file)
index 0642a18..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/GlobalResource.resx -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_GlobalResources/GlobalResource.resx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_GlobalResources/GlobalResource.resx
deleted file mode 100644 (file)
index 000b0f9..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<root>\r
-  <!-- \r
-    Microsoft ResX Schema \r
-    \r
-    Version 2.0\r
-    \r
-    The primary goals of this format is to allow a simple XML format \r
-    that is mostly human readable. The generation and parsing of the \r
-    various data types are done through the TypeConverter classes \r
-    associated with the data types.\r
-    \r
-    Example:\r
-    \r
-    ... ado.net/XML headers & schema ...\r
-    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
-    <resheader name="version">2.0</resheader>\r
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
-        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
-    </data>\r
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
-        <comment>This is a comment</comment>\r
-    </data>\r
-                \r
-    There are any number of "resheader" rows that contain simple \r
-    name/value pairs.\r
-    \r
-    Each data row contains a name, and value. The row also contains a \r
-    type or mimetype. Type corresponds to a .NET class that support \r
-    text/value conversion through the TypeConverter architecture. \r
-    Classes that don't support this are serialized and stored with the \r
-    mimetype set.\r
-    \r
-    The mimetype is used for serialized objects, and tells the \r
-    ResXResourceReader how to depersist the object. This is currently not \r
-    extensible. For a given mimetype the value must be set accordingly:\r
-    \r
-    Note - application/x-microsoft.net.object.binary.base64 is the format \r
-    that the ResXResourceWriter will generate, however the reader can \r
-    read any of the formats listed below.\r
-    \r
-    mimetype: application/x-microsoft.net.object.binary.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
-            : and then encoded with base64 encoding.\r
-    \r
-    mimetype: application/x-microsoft.net.object.soap.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
-            : and then encoded with base64 encoding.\r
-\r
-    mimetype: application/x-microsoft.net.object.bytearray.base64\r
-    value   : The object must be serialized into a byte array \r
-            : using a System.ComponentModel.TypeConverter\r
-            : and then encoded with base64 encoding.\r
-    -->\r
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
-    <xsd:element name="root" msdata:IsDataSet="true">\r
-      <xsd:complexType>\r
-        <xsd:choice maxOccurs="unbounded">\r
-          <xsd:element name="metadata">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" use="required" type="xsd:string" />\r
-              <xsd:attribute name="type" type="xsd:string" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="assembly">\r
-            <xsd:complexType>\r
-              <xsd:attribute name="alias" type="xsd:string" />\r
-              <xsd:attribute name="name" type="xsd:string" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="data">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="resheader">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-        </xsd:choice>\r
-      </xsd:complexType>\r
-    </xsd:element>\r
-  </xsd:schema>\r
-  <resheader name="resmimetype">\r
-    <value>text/microsoft-resx</value>\r
-  </resheader>\r
-  <resheader name="version">\r
-    <value>2.0</value>\r
-  </resheader>\r
-  <resheader name="reader">\r
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <resheader name="writer">\r
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <data name="SearchMessage" xml:space="preserve">\r
-    <value>Wildcard characters * and ? are permitted.</value>\r
-  </data>\r
-  <data name="WelcomeMessage" xml:space="preserve">\r
-    <value>Welcome to the Web Site Administration Tool \r
-</value>\r
-  </data>\r
-</root>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/.gitattributes
deleted file mode 100644 (file)
index 506c9f5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/CreateRole.aspx.resx -crlf
-/CreateUser.aspx.resx -crlf
-/Default.aspx.resx -crlf
-/EditUser.aspx.resx -crlf
-/ManageRole.aspx.resx -crlf
-/ManageUser.aspx.resx -crlf
-/Util.Master.resx -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/CreateRole.aspx.resx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/CreateRole.aspx.resx
deleted file mode 100644 (file)
index 3f10064..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<root>\r
-  <!-- \r
-    Microsoft ResX Schema \r
-    \r
-    Version 2.0\r
-    \r
-    The primary goals of this format is to allow a simple XML format \r
-    that is mostly human readable. The generation and parsing of the \r
-    various data types are done through the TypeConverter classes \r
-    associated with the data types.\r
-    \r
-    Example:\r
-    \r
-    ... ado.net/XML headers & schema ...\r
-    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
-    <resheader name="version">2.0</resheader>\r
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
-        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
-    </data>\r
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
-        <comment>This is a comment</comment>\r
-    </data>\r
-                \r
-    There are any number of "resheader" rows that contain simple \r
-    name/value pairs.\r
-    \r
-    Each data row contains a name, and value. The row also contains a \r
-    type or mimetype. Type corresponds to a .NET class that support \r
-    text/value conversion through the TypeConverter architecture. \r
-    Classes that don't support this are serialized and stored with the \r
-    mimetype set.\r
-    \r
-    The mimetype is used for serialized objects, and tells the \r
-    ResXResourceReader how to depersist the object. This is currently not \r
-    extensible. For a given mimetype the value must be set accordingly:\r
-    \r
-    Note - application/x-microsoft.net.object.binary.base64 is the format \r
-    that the ResXResourceWriter will generate, however the reader can \r
-    read any of the formats listed below.\r
-    \r
-    mimetype: application/x-microsoft.net.object.binary.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
-            : and then encoded with base64 encoding.\r
-    \r
-    mimetype: application/x-microsoft.net.object.soap.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
-            : and then encoded with base64 encoding.\r
-\r
-    mimetype: application/x-microsoft.net.object.bytearray.base64\r
-    value   : The object must be serialized into a byte array \r
-            : using a System.ComponentModel.TypeConverter\r
-            : and then encoded with base64 encoding.\r
-    -->\r
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
-    <xsd:element name="root" msdata:IsDataSet="true">\r
-      <xsd:complexType>\r
-        <xsd:choice maxOccurs="unbounded">\r
-          <xsd:element name="metadata">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" use="required" type="xsd:string" />\r
-              <xsd:attribute name="type" type="xsd:string" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="assembly">\r
-            <xsd:complexType>\r
-              <xsd:attribute name="alias" type="xsd:string" />\r
-              <xsd:attribute name="name" type="xsd:string" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="data">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="resheader">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-        </xsd:choice>\r
-      </xsd:complexType>\r
-    </xsd:element>\r
-  </xsd:schema>\r
-  <resheader name="resmimetype">\r
-    <value>text/microsoft-resx</value>\r
-  </resheader>\r
-  <resheader name="version">\r
-    <value>2.0</value>\r
-  </resheader>\r
-  <resheader name="reader">\r
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <resheader name="writer">\r
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <data name="CreateRoleText" xml:space="preserve">\r
-    <value>You can optionally add roles, or groups, that enable you to allow or deny groups of users access to specific folders in your Web site. For example, you might create roles such as "managers," "sales," or "members," each with different access to specific folders. </value>\r
-  </data>\r
-  <data name="newrolelabel" xml:space="preserve">\r
-    <value>Create New Role</value>\r
-  </data>\r
-  <data name="rolenamelabel" xml:space="preserve">\r
-    <value>New role name: </value>\r
-  </data>\r
-</root>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/CreateUser.aspx.resx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/CreateUser.aspx.resx
deleted file mode 100644 (file)
index 7a8893a..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<root>\r
-  <!-- \r
-    Microsoft ResX Schema \r
-    \r
-    Version 2.0\r
-    \r
-    The primary goals of this format is to allow a simple XML format \r
-    that is mostly human readable. The generation and parsing of the \r
-    various data types are done through the TypeConverter classes \r
-    associated with the data types.\r
-    \r
-    Example:\r
-    \r
-    ... ado.net/XML headers & schema ...\r
-    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
-    <resheader name="version">2.0</resheader>\r
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
-        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
-    </data>\r
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
-        <comment>This is a comment</comment>\r
-    </data>\r
-                \r
-    There are any number of "resheader" rows that contain simple \r
-    name/value pairs.\r
-    \r
-    Each data row contains a name, and value. The row also contains a \r
-    type or mimetype. Type corresponds to a .NET class that support \r
-    text/value conversion through the TypeConverter architecture. \r
-    Classes that don't support this are serialized and stored with the \r
-    mimetype set.\r
-    \r
-    The mimetype is used for serialized objects, and tells the \r
-    ResXResourceReader how to depersist the object. This is currently not \r
-    extensible. For a given mimetype the value must be set accordingly:\r
-    \r
-    Note - application/x-microsoft.net.object.binary.base64 is the format \r
-    that the ResXResourceWriter will generate, however the reader can \r
-    read any of the formats listed below.\r
-    \r
-    mimetype: application/x-microsoft.net.object.binary.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
-            : and then encoded with base64 encoding.\r
-    \r
-    mimetype: application/x-microsoft.net.object.soap.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
-            : and then encoded with base64 encoding.\r
-\r
-    mimetype: application/x-microsoft.net.object.bytearray.base64\r
-    value   : The object must be serialized into a byte array \r
-            : using a System.ComponentModel.TypeConverter\r
-            : and then encoded with base64 encoding.\r
-    -->\r
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
-    <xsd:element name="root" msdata:IsDataSet="true">\r
-      <xsd:complexType>\r
-        <xsd:choice maxOccurs="unbounded">\r
-          <xsd:element name="metadata">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" use="required" type="xsd:string" />\r
-              <xsd:attribute name="type" type="xsd:string" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="assembly">\r
-            <xsd:complexType>\r
-              <xsd:attribute name="alias" type="xsd:string" />\r
-              <xsd:attribute name="name" type="xsd:string" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="data">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="resheader">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-        </xsd:choice>\r
-      </xsd:complexType>\r
-    </xsd:element>\r
-  </xsd:schema>\r
-  <resheader name="resmimetype">\r
-    <value>text/microsoft-resx</value>\r
-  </resheader>\r
-  <resheader name="version">\r
-    <value>2.0</value>\r
-  </resheader>\r
-  <resheader name="reader">\r
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <resheader name="writer">\r
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <data name="ActiveUserLabel" xml:space="preserve">\r
-    <value>Active User</value>\r
-  </data>\r
-  <data name="CreateUserText" xml:space="preserve">\r
-    <value>Add a user by entering a user name, password, and e-mail address on this page.</value>\r
-  </data>\r
-</root>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/Default.aspx.resx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/Default.aspx.resx
deleted file mode 100644 (file)
index a3a3199..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<root>\r
-  <!-- \r
-    Microsoft ResX Schema \r
-    \r
-    Version 2.0\r
-    \r
-    The primary goals of this format is to allow a simple XML format \r
-    that is mostly human readable. The generation and parsing of the \r
-    various data types are done through the TypeConverter classes \r
-    associated with the data types.\r
-    \r
-    Example:\r
-    \r
-    ... ado.net/XML headers & schema ...\r
-    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
-    <resheader name="version">2.0</resheader>\r
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
-        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
-    </data>\r
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
-        <comment>This is a comment</comment>\r
-    </data>\r
-                \r
-    There are any number of "resheader" rows that contain simple \r
-    name/value pairs.\r
-    \r
-    Each data row contains a name, and value. The row also contains a \r
-    type or mimetype. Type corresponds to a .NET class that support \r
-    text/value conversion through the TypeConverter architecture. \r
-    Classes that don't support this are serialized and stored with the \r
-    mimetype set.\r
-    \r
-    The mimetype is used for serialized objects, and tells the \r
-    ResXResourceReader how to depersist the object. This is currently not \r
-    extensible. For a given mimetype the value must be set accordingly:\r
-    \r
-    Note - application/x-microsoft.net.object.binary.base64 is the format \r
-    that the ResXResourceWriter will generate, however the reader can \r
-    read any of the formats listed below.\r
-    \r
-    mimetype: application/x-microsoft.net.object.binary.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
-            : and then encoded with base64 encoding.\r
-    \r
-    mimetype: application/x-microsoft.net.object.soap.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
-            : and then encoded with base64 encoding.\r
-\r
-    mimetype: application/x-microsoft.net.object.bytearray.base64\r
-    value   : The object must be serialized into a byte array \r
-            : using a System.ComponentModel.TypeConverter\r
-            : and then encoded with base64 encoding.\r
-    -->\r
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
-    <xsd:element name="root" msdata:IsDataSet="true">\r
-      <xsd:complexType>\r
-        <xsd:choice maxOccurs="unbounded">\r
-          <xsd:element name="metadata">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" use="required" type="xsd:string" />\r
-              <xsd:attribute name="type" type="xsd:string" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="assembly">\r
-            <xsd:complexType>\r
-              <xsd:attribute name="alias" type="xsd:string" />\r
-              <xsd:attribute name="name" type="xsd:string" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="data">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="resheader">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-        </xsd:choice>\r
-      </xsd:complexType>\r
-    </xsd:element>\r
-  </xsd:schema>\r
-  <resheader name="resmimetype">\r
-    <value>text/microsoft-resx</value>\r
-  </resheader>\r
-  <resheader name="version">\r
-    <value>2.0</value>\r
-  </resheader>\r
-  <resheader name="reader">\r
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <resheader name="writer">\r
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <data name="EnterText" xml:space="preserve">\r
-    <value>You can use the Web Site Administration Tool to manage all the security settings for your application. You can set up users and passwords (authentication), create roles (groups of users), and create permissions (rules for controlling access to parts of your application).</value>\r
-  </data>\r
-</root>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/EditUser.aspx.resx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/EditUser.aspx.resx
deleted file mode 100644 (file)
index a33d331..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<root>\r
-  <!-- \r
-    Microsoft ResX Schema \r
-    \r
-    Version 2.0\r
-    \r
-    The primary goals of this format is to allow a simple XML format \r
-    that is mostly human readable. The generation and parsing of the \r
-    various data types are done through the TypeConverter classes \r
-    associated with the data types.\r
-    \r
-    Example:\r
-    \r
-    ... ado.net/XML headers & schema ...\r
-    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
-    <resheader name="version">2.0</resheader>\r
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
-        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
-    </data>\r
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
-        <comment>This is a comment</comment>\r
-    </data>\r
-                \r
-    There are any number of "resheader" rows that contain simple \r
-    name/value pairs.\r
-    \r
-    Each data row contains a name, and value. The row also contains a \r
-    type or mimetype. Type corresponds to a .NET class that support \r
-    text/value conversion through the TypeConverter architecture. \r
-    Classes that don't support this are serialized and stored with the \r
-    mimetype set.\r
-    \r
-    The mimetype is used for serialized objects, and tells the \r
-    ResXResourceReader how to depersist the object. This is currently not \r
-    extensible. For a given mimetype the value must be set accordingly:\r
-    \r
-    Note - application/x-microsoft.net.object.binary.base64 is the format \r
-    that the ResXResourceWriter will generate, however the reader can \r
-    read any of the formats listed below.\r
-    \r
-    mimetype: application/x-microsoft.net.object.binary.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
-            : and then encoded with base64 encoding.\r
-    \r
-    mimetype: application/x-microsoft.net.object.soap.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
-            : and then encoded with base64 encoding.\r
-\r
-    mimetype: application/x-microsoft.net.object.bytearray.base64\r
-    value   : The object must be serialized into a byte array \r
-            : using a System.ComponentModel.TypeConverter\r
-            : and then encoded with base64 encoding.\r
-    -->\r
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
-    <xsd:element name="root" msdata:IsDataSet="true">\r
-      <xsd:complexType>\r
-        <xsd:choice maxOccurs="unbounded">\r
-          <xsd:element name="metadata">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" use="required" type="xsd:string" />\r
-              <xsd:attribute name="type" type="xsd:string" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="assembly">\r
-            <xsd:complexType>\r
-              <xsd:attribute name="alias" type="xsd:string" />\r
-              <xsd:attribute name="name" type="xsd:string" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="data">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="resheader">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-        </xsd:choice>\r
-      </xsd:complexType>\r
-    </xsd:element>\r
-  </xsd:schema>\r
-  <resheader name="resmimetype">\r
-    <value>text/microsoft-resx</value>\r
-  </resheader>\r
-  <resheader name="version">\r
-    <value>2.0</value>\r
-  </resheader>\r
-  <resheader name="reader">\r
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <resheader name="writer">\r
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <data name="editUserText" xml:space="preserve">\r
-    <value>Use this page to edit user information and to specify what roles a user belongs in. </value>\r
-  </data>\r
-  <data name="Rolelbl" xml:space="preserve">\r
-    <value>Roles</value>\r
-  </data>\r
-  <data name="Successlbl" xml:space="preserve">\r
-    <value>You have successfully updated the user</value>\r
-  </data>\r
-  <data name="successUpdatelbl" xml:space="preserve">\r
-    <value>You have successfully updated the user </value>\r
-  </data>\r
-  <data name="Userlbl" xml:space="preserve">\r
-    <value>User</value>\r
-  </data>\r
-</root>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/ManageRole.aspx.resx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/ManageRole.aspx.resx
deleted file mode 100644 (file)
index 1975602..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<root>\r
-  <!-- \r
-    Microsoft ResX Schema \r
-    \r
-    Version 2.0\r
-    \r
-    The primary goals of this format is to allow a simple XML format \r
-    that is mostly human readable. The generation and parsing of the \r
-    various data types are done through the TypeConverter classes \r
-    associated with the data types.\r
-    \r
-    Example:\r
-    \r
-    ... ado.net/XML headers & schema ...\r
-    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
-    <resheader name="version">2.0</resheader>\r
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
-        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
-    </data>\r
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
-        <comment>This is a comment</comment>\r
-    </data>\r
-                \r
-    There are any number of "resheader" rows that contain simple \r
-    name/value pairs.\r
-    \r
-    Each data row contains a name, and value. The row also contains a \r
-    type or mimetype. Type corresponds to a .NET class that support \r
-    text/value conversion through the TypeConverter architecture. \r
-    Classes that don't support this are serialized and stored with the \r
-    mimetype set.\r
-    \r
-    The mimetype is used for serialized objects, and tells the \r
-    ResXResourceReader how to depersist the object. This is currently not \r
-    extensible. For a given mimetype the value must be set accordingly:\r
-    \r
-    Note - application/x-microsoft.net.object.binary.base64 is the format \r
-    that the ResXResourceWriter will generate, however the reader can \r
-    read any of the formats listed below.\r
-    \r
-    mimetype: application/x-microsoft.net.object.binary.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
-            : and then encoded with base64 encoding.\r
-    \r
-    mimetype: application/x-microsoft.net.object.soap.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
-            : and then encoded with base64 encoding.\r
-\r
-    mimetype: application/x-microsoft.net.object.bytearray.base64\r
-    value   : The object must be serialized into a byte array \r
-            : using a System.ComponentModel.TypeConverter\r
-            : and then encoded with base64 encoding.\r
-    -->\r
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
-    <xsd:element name="root" msdata:IsDataSet="true">\r
-      <xsd:complexType>\r
-        <xsd:choice maxOccurs="unbounded">\r
-          <xsd:element name="metadata">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" use="required" type="xsd:string" />\r
-              <xsd:attribute name="type" type="xsd:string" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="assembly">\r
-            <xsd:complexType>\r
-              <xsd:attribute name="alias" type="xsd:string" />\r
-              <xsd:attribute name="name" type="xsd:string" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="data">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="resheader">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-        </xsd:choice>\r
-      </xsd:complexType>\r
-    </xsd:element>\r
-  </xsd:schema>\r
-  <resheader name="resmimetype">\r
-    <value>text/microsoft-resx</value>\r
-  </resheader>\r
-  <resheader name="version">\r
-    <value>2.0</value>\r
-  </resheader>\r
-  <resheader name="reader">\r
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <resheader name="writer">\r
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <data name="menageRoleText" xml:space="preserve">\r
-    <value>Use this page to manage the members in the specified role. To add a user to the role, search for the user name and then select the User Is In Role check box for that user. </value>\r
-  </data>\r
-  <data name="roleNameLabel" xml:space="preserve">\r
-    <value>Role:</value>\r
-  </data>\r
-  <data name="searchBylbl" xml:space="preserve">\r
-    <value>Search by :</value>\r
-  </data>\r
-  <data name="searchUserlbl" xml:space="preserve">\r
-    <value>Search for Users</value>\r
-  </data>\r
-</root>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/ManageUser.aspx.resx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/ManageUser.aspx.resx
deleted file mode 100644 (file)
index 9be8054..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<root>\r
-  <!-- \r
-    Microsoft ResX Schema \r
-    \r
-    Version 2.0\r
-    \r
-    The primary goals of this format is to allow a simple XML format \r
-    that is mostly human readable. The generation and parsing of the \r
-    various data types are done through the TypeConverter classes \r
-    associated with the data types.\r
-    \r
-    Example:\r
-    \r
-    ... ado.net/XML headers & schema ...\r
-    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
-    <resheader name="version">2.0</resheader>\r
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
-        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
-    </data>\r
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
-        <comment>This is a comment</comment>\r
-    </data>\r
-                \r
-    There are any number of "resheader" rows that contain simple \r
-    name/value pairs.\r
-    \r
-    Each data row contains a name, and value. The row also contains a \r
-    type or mimetype. Type corresponds to a .NET class that support \r
-    text/value conversion through the TypeConverter architecture. \r
-    Classes that don't support this are serialized and stored with the \r
-    mimetype set.\r
-    \r
-    The mimetype is used for serialized objects, and tells the \r
-    ResXResourceReader how to depersist the object. This is currently not \r
-    extensible. For a given mimetype the value must be set accordingly:\r
-    \r
-    Note - application/x-microsoft.net.object.binary.base64 is the format \r
-    that the ResXResourceWriter will generate, however the reader can \r
-    read any of the formats listed below.\r
-    \r
-    mimetype: application/x-microsoft.net.object.binary.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
-            : and then encoded with base64 encoding.\r
-    \r
-    mimetype: application/x-microsoft.net.object.soap.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
-            : and then encoded with base64 encoding.\r
-\r
-    mimetype: application/x-microsoft.net.object.bytearray.base64\r
-    value   : The object must be serialized into a byte array \r
-            : using a System.ComponentModel.TypeConverter\r
-            : and then encoded with base64 encoding.\r
-    -->\r
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
-    <xsd:element name="root" msdata:IsDataSet="true">\r
-      <xsd:complexType>\r
-        <xsd:choice maxOccurs="unbounded">\r
-          <xsd:element name="metadata">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" use="required" type="xsd:string" />\r
-              <xsd:attribute name="type" type="xsd:string" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="assembly">\r
-            <xsd:complexType>\r
-              <xsd:attribute name="alias" type="xsd:string" />\r
-              <xsd:attribute name="name" type="xsd:string" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="data">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="resheader">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-        </xsd:choice>\r
-      </xsd:complexType>\r
-    </xsd:element>\r
-  </xsd:schema>\r
-  <resheader name="resmimetype">\r
-    <value>text/microsoft-resx</value>\r
-  </resheader>\r
-  <resheader name="version">\r
-    <value>2.0</value>\r
-  </resheader>\r
-  <resheader name="reader">\r
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <resheader name="writer">\r
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <data name="manageUserText" xml:space="preserve">\r
-    <value>Click Edit User to view or change the user's password or other properties. To assign roles to the selected user, select the appropriate check boxes on the right. To prevent users from logging in to your application while retaining their information in your database, set the status to inactive by clearing the check box. \r
-</value>\r
-  </data>\r
-  <data name="roleslbl" xml:space="preserve">\r
-    <value>Roles</value>\r
-  </data>\r
-  <data name="searchBylbl" xml:space="preserve">\r
-    <value>Search by :</value>\r
-  </data>\r
-  <data name="searchUserlbl" xml:space="preserve">\r
-    <value>Search for Users</value>\r
-  </data>\r
-</root>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/Util.Master.resx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/App_LocalResources/Util.Master.resx
deleted file mode 100644 (file)
index 5ea0895..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<root>\r
-  <!-- \r
-    Microsoft ResX Schema \r
-    \r
-    Version 2.0\r
-    \r
-    The primary goals of this format is to allow a simple XML format \r
-    that is mostly human readable. The generation and parsing of the \r
-    various data types are done through the TypeConverter classes \r
-    associated with the data types.\r
-    \r
-    Example:\r
-    \r
-    ... ado.net/XML headers & schema ...\r
-    <resheader name="resmimetype">text/microsoft-resx</resheader>\r
-    <resheader name="version">2.0</resheader>\r
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
-        <value>[base64 mime encoded serialized .NET Framework object]</value>\r
-    </data>\r
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
-        <comment>This is a comment</comment>\r
-    </data>\r
-                \r
-    There are any number of "resheader" rows that contain simple \r
-    name/value pairs.\r
-    \r
-    Each data row contains a name, and value. The row also contains a \r
-    type or mimetype. Type corresponds to a .NET class that support \r
-    text/value conversion through the TypeConverter architecture. \r
-    Classes that don't support this are serialized and stored with the \r
-    mimetype set.\r
-    \r
-    The mimetype is used for serialized objects, and tells the \r
-    ResXResourceReader how to depersist the object. This is currently not \r
-    extensible. For a given mimetype the value must be set accordingly:\r
-    \r
-    Note - application/x-microsoft.net.object.binary.base64 is the format \r
-    that the ResXResourceWriter will generate, however the reader can \r
-    read any of the formats listed below.\r
-    \r
-    mimetype: application/x-microsoft.net.object.binary.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
-            : and then encoded with base64 encoding.\r
-    \r
-    mimetype: application/x-microsoft.net.object.soap.base64\r
-    value   : The object must be serialized with \r
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
-            : and then encoded with base64 encoding.\r
-\r
-    mimetype: application/x-microsoft.net.object.bytearray.base64\r
-    value   : The object must be serialized into a byte array \r
-            : using a System.ComponentModel.TypeConverter\r
-            : and then encoded with base64 encoding.\r
-    -->\r
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
-    <xsd:element name="root" msdata:IsDataSet="true">\r
-      <xsd:complexType>\r
-        <xsd:choice maxOccurs="unbounded">\r
-          <xsd:element name="metadata">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" use="required" type="xsd:string" />\r
-              <xsd:attribute name="type" type="xsd:string" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="assembly">\r
-            <xsd:complexType>\r
-              <xsd:attribute name="alias" type="xsd:string" />\r
-              <xsd:attribute name="name" type="xsd:string" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="data">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
-              <xsd:attribute ref="xml:space" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-          <xsd:element name="resheader">\r
-            <xsd:complexType>\r
-              <xsd:sequence>\r
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
-              </xsd:sequence>\r
-              <xsd:attribute name="name" type="xsd:string" use="required" />\r
-            </xsd:complexType>\r
-          </xsd:element>\r
-        </xsd:choice>\r
-      </xsd:complexType>\r
-    </xsd:element>\r
-  </xsd:schema>\r
-  <resheader name="resmimetype">\r
-    <value>text/microsoft-resx</value>\r
-  </resheader>\r
-  <resheader name="version">\r
-    <value>2.0</value>\r
-  </resheader>\r
-  <resheader name="reader">\r
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-  <resheader name="writer">\r
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
-  </resheader>\r
-</root>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/.gitattributes
deleted file mode 100644 (file)
index 602d59b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/Searcher.ascx -crlf
-/Searcher.ascx.cs -crlf
-/Searcher.ascx.cs.bak -crlf
-/Searcher.ascx.designer.cs -crlf
-/Searcher.ascx.designer.cs.bak -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx
deleted file mode 100644 (file)
index 68daece..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<%@ Control Language="C#" AutoEventWireup="true" EnableTheming="false" CodeBehind="Searcher.ascx.cs" Inherits="Mainsoft.Web.AspnetConfig.Searcher" %>\r
-<%@ Register tagprefix="custom" namespace="Mainsoft.Web.AspnetConfig" Assembly="Mainsoft.Web.AspnetConfig"  %>\r
-\r
-<table width="100%" cellpadding="0" cellspacing="0">\r
-    <tr>\r
-    <td width="100%" class="controlheader">\r
-           Edit roles:\r
-    </td>\r
-    </tr>\r
-    <tr>\r
-        <td width= "100%" >\r
-            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"\r
-                ForeColor="#333333" GridLines="None" Width="100%">\r
-                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />\r
-                <Columns>\r
-                    <asp:TemplateField HeaderText="Edit roles">\r
-                        <ItemTemplate>\r
-                            <asp:CheckBox ID="CheckBox2" runat="server" AutoPostBack="True" Checked='<%# Bind("IsInRole") %>'\r
-                                OnCheckedChanged="Roles_Changed" Text='<%# Bind("Role") %>' />\r
-                        </ItemTemplate>\r
-                        <HeaderTemplate>\r
-                            Edit roles for user : <%# User %>\r
-                        </HeaderTemplate>\r
-                    </asp:TemplateField>\r
-                </Columns>\r
-                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />\r
-                <EditRowStyle BackColor="#999999" />\r
-                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />\r
-                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />\r
-                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />\r
-            </asp:GridView>\r
-        </td>        \r
-    </tr>\r
-</table>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.cs
deleted file mode 100644 (file)
index 8d846ca..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-    public partial class Searcher : System.Web.UI.UserControl\r
-    {\r
-        public string User\r
-        {\r
-            get { return ViewState["User"] == null ? String.Empty : (string)ViewState["User"];}\r
-            set { ViewState["User"] = value; }\r
-        }\r
-\r
-        protected void Page_Load(object sender, EventArgs e)\r
-        {\r
-\r
-        }\r
-\r
-        protected override void OnPreRender(EventArgs e)\r
-        {\r
-            if (User == String.Empty || (Membership.GetUser(User)==null))\r
-            {\r
-                GridView1.DataSource = null;\r
-            }\r
-            else\r
-            {\r
-                GridView1.DataSource = RolesDS.SelectUsersRole(User);\r
-            }\r
-            GridView1.DataBind();\r
-            base.OnPreRender(e);\r
-        }\r
-\r
-        protected void Roles_Changed(object sender, EventArgs e)\r
-        {\r
-            String user_name = (string)ViewState["User"];\r
-            if (((CheckBox)sender).Checked)\r
-            {\r
-                   try {\r
-                           Roles.AddUserToRole (user_name, ((CheckBox) sender).Text);\r
-                   }\r
-                   catch {\r
-                   }\r
-            }\r
-            else\r
-            {\r
-                   try {\r
-                           Roles.RemoveUserFromRole (user_name, ((CheckBox) sender).Text);\r
-                   }\r
-                   catch {\r
-                   }\r
-            }\r
-        }\r
-    }\r
-}
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.cs.bak b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.cs.bak
deleted file mode 100644 (file)
index 790c81d..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-\r
-namespace Mainsoft.Web.Administration\r
-{\r
-    public partial class Searcher : System.Web.UI.UserControl\r
-    {\r
-        public string User\r
-        {\r
-            get { return ViewState["User"] == null ? String.Empty : (string)ViewState["User"];}\r
-            set { ViewState["User"] = value; }\r
-        }\r
-\r
-        protected void Page_Load(object sender, EventArgs e)\r
-        {\r
-\r
-        }\r
-\r
-        protected override void OnPreRender(EventArgs e)\r
-        {\r
-            if (User == String.Empty || (Membership.GetUser(User)==null))\r
-            {\r
-                GridView1.DataSource = null;\r
-            }\r
-            else\r
-            {\r
-                GridView1.DataSource = RolesDS.SelectUsersRole(User);\r
-            }\r
-            GridView1.DataBind();\r
-            base.OnPreRender(e);\r
-        }\r
-\r
-        protected void Roles_Changed(object sender, EventArgs e)\r
-        {\r
-            String user_name = (string)ViewState["User"];\r
-            if (((CheckBox)sender).Checked)\r
-            {\r
-                   try {\r
-                           Roles.AddUserToRole (user_name, ((CheckBox) sender).Text);\r
-                   }\r
-                   catch {\r
-                   }\r
-            }\r
-            else\r
-            {\r
-                   try {\r
-                           Roles.RemoveUserFromRole (user_name, ((CheckBox) sender).Text);\r
-                   }\r
-                   catch {\r
-                   }\r
-            }\r
-        }\r
-    }\r
-}
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.designer.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.designer.cs
deleted file mode 100644 (file)
index 616d5c2..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:2.0.50727.42\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace Mainsoft.Web.AspnetConfig {\r
-    \r
-    public partial class Searcher {\r
-        protected System.Web.UI.WebControls.GridView GridView1;\r
-    }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.designer.cs.bak b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Controls/Searcher.ascx.designer.cs.bak
deleted file mode 100644 (file)
index a011c3e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:2.0.50727.42\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace Mainsoft.Web.Administration {\r
-    \r
-    public partial class Searcher {\r
-        protected System.Web.UI.WebControls.GridView GridView1;\r
-    }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Mainsoft.Web.AspnetConfig.csproj b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Mainsoft.Web.AspnetConfig.csproj
deleted file mode 100644 (file)
index 063df52..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <PropertyGroup>\r
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
-    <ProductVersion>8.0.50727</ProductVersion>\r
-    <SchemaVersion>2.0</SchemaVersion>\r
-    <ProjectGuid>{724CABEB-39E5-47A7-9F72-4B81FFC56760}</ProjectGuid>\r
-    <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
-    <OutputType>Library</OutputType>\r
-    <AppDesignerFolder>Properties</AppDesignerFolder>\r
-    <AssemblyName>Mainsoft.Web.AspnetConfig</AssemblyName>\r
-    <JDKName>1.6.0</JDKName>\r
-    <GHProjectType>3</GHProjectType>\r
-    <GHProjectKind>runtime</GHProjectKind>\r
-    <Version>2.0</Version>\r
-    <RootNamespace>Mainsoft.Web.AspnetConfig</RootNamespace>\r
-    <jarserver>ipa</jarserver>\r
-    <ApplicationServerType>tomcat</ApplicationServerType>\r
-    <FlatWebApp>true</FlatWebApp>\r
-    <DeployOnBuild>true</DeployOnBuild>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
-    <DebugSymbols>true</DebugSymbols>\r
-    <DebugType>full</DebugType>\r
-    <Optimize>false</Optimize>\r
-    <OutputPath>bin\</OutputPath>\r
-    <DefineConstants>TRACE;DEBUG;JAVA;TARGET_JVM</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <BaseAddress>285212672</BaseAddress>\r
-    <SkipValidation>True</SkipValidation>\r
-    <KeepIntermediate>False</KeepIntermediate>\r
-    <TargetPlatform>0</TargetPlatform>\r
-    <AdditionalClassPath>\r
-    </AdditionalClassPath>\r
-    <PreCompile>True</PreCompile>\r
-    <CompressionLevel>1</CompressionLevel>\r
-    <DeploymentMethod>1</DeploymentMethod>\r
-    <UseTestingPage>True</UseTestingPage>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
-    <DebugType>pdbonly</DebugType>\r
-    <Optimize>true</Optimize>\r
-    <OutputPath>bin\</OutputPath>\r
-    <DefineConstants>TRACE;JAVA;TARGET_JVM</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <BaseAddress>285212672</BaseAddress>\r
-    <SkipValidation>True</SkipValidation>\r
-    <KeepIntermediate>False</KeepIntermediate>\r
-    <TargetPlatform>0</TargetPlatform>\r
-    <AdditionalClassPath>\r
-    </AdditionalClassPath>\r
-    <PreCompile>true</PreCompile>\r
-    <CompressionLevel>1</CompressionLevel>\r
-    <DeploymentMethod>1</DeploymentMethod>\r
-    <UseTestingPage>True</UseTestingPage>\r
-  </PropertyGroup>\r
-  <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
-  <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
-       Other similar extension points exist, see Microsoft.Common.targets.\r
-  <Target Name="BeforeBuild">\r
-  </Target>\r
-  <Target Name="AfterBuild">\r
-  </Target>\r
-  -->\r
-  <ProjectExtensions>\r
-    <VisualStudio>\r
-      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">\r
-        <WebProjectProperties>\r
-          <UseIIS>True</UseIIS>\r
-          <AutoAssignPort>True</AutoAssignPort>\r
-          <DevelopmentServerPort>2274</DevelopmentServerPort>\r
-          <DevelopmentServerVPath>/</DevelopmentServerVPath>\r
-          <IISUrl>\r
-          </IISUrl>\r
-          <NTLMAuthentication>False</NTLMAuthentication>\r
-        </WebProjectProperties>\r
-      </FlavorProperties>\r
-      <UserProperties REFS-JarPath-mscorlib="..\..\..\..\..\..\lib\mscorlib.jar" REFS-JarPath-system="..\..\..\..\..\..\lib\System.jar" REFS-JarPath-system-data="..\..\..\..\..\..\lib\System.Data.jar" REFS-JarPath-system-web="..\..\..\..\..\..\lib\System.Web.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\lib\System.Xml.jar" REFS-JarPath-system-configuration="..\..\..\..\..\lib\System.Configuration.jar" REFS-JarPath-system-drawing="..\..\..\..\..\lib\System.Drawing.jar;..\..\..\..\..\lib\jai_imageio.jar;..\..\..\..\..\lib\jai_core.jar;..\..\..\..\..\lib\jai_codec.jar;..\..\..\..\..\lib\clibwrapper_jiio.jar;..\..\..\..\..\lib\mlibwrapper_jai.jar" REFS-JarPath-myfaces="" REFS-RefInfo-myfaces="repository:vmw:framework:2.0" />\r
-    </VisualStudio>\r
-  </ProjectExtensions>\r
-  <ItemGroup>\r
-    <Content Include="WEB-INF\web.xml" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <Reference Include="myfaces" />\r
-    <Reference Include="System" />\r
-    <Reference Include="System.configuration" />\r
-    <Reference Include="System.Data" />\r
-    <Reference Include="System.Drawing" />\r
-    <Reference Include="System.Web" />\r
-    <Reference Include="System.Xml" />\r
-    <Reference Include="J2SE.Helpers">\r
-      <Private>False</Private>\r
-      <HintPath>..\..\lib\J2SE.Helpers.dll</HintPath>\r
-    </Reference>\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <Compile Include="aspnetconfig\CreateRole.aspx.cs">\r
-      <DependentUpon>CreateRole.aspx</DependentUpon>\r
-      <SubType>ASPXCodeBehind</SubType>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\CreateRole.aspx.designer.cs">\r
-      <DependentUpon>CreateRole.aspx</DependentUpon>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\CreateUser.aspx.cs">\r
-      <DependentUpon>CreateUser.aspx</DependentUpon>\r
-      <SubType>ASPXCodeBehind</SubType>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\CreateUser.aspx.designer.cs">\r
-      <DependentUpon>CreateUser.aspx</DependentUpon>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\Default.aspx.cs">\r
-      <DependentUpon>Default.aspx</DependentUpon>\r
-      <SubType>ASPXCodeBehind</SubType>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\Default.aspx.designer.cs">\r
-      <DependentUpon>Default.aspx</DependentUpon>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\EditUser.aspx.cs">\r
-      <DependentUpon>EditUser.aspx</DependentUpon>\r
-      <SubType>ASPXCodeBehind</SubType>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\EditUser.aspx.designer.cs">\r
-      <DependentUpon>EditUser.aspx</DependentUpon>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\Error.aspx.cs">\r
-      <DependentUpon>Error.aspx</DependentUpon>\r
-      <SubType>ASPXCodeBehind</SubType>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\Error.aspx.designer.cs">\r
-      <DependentUpon>Error.aspx</DependentUpon>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\GridButton.cs" />\r
-    <Compile Include="aspnetconfig\GridCheckBox.cs" />\r
-    <Compile Include="aspnetconfig\HttpHandlersSectionHandler.cs" />\r
-    <Compile Include="aspnetconfig\ManageRole.aspx.cs">\r
-      <DependentUpon>ManageRole.aspx</DependentUpon>\r
-      <SubType>ASPXCodeBehind</SubType>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\ManageRole.aspx.designer.cs">\r
-      <DependentUpon>ManageRole.aspx</DependentUpon>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\ManageUser.aspx.cs">\r
-      <DependentUpon>ManageUser.aspx</DependentUpon>\r
-      <SubType>ASPXCodeBehind</SubType>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\ManageUser.aspx.designer.cs">\r
-      <DependentUpon>ManageUser.aspx</DependentUpon>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\RolesDS.cs" />\r
-    <Compile Include="aspnetconfig\SecurError.aspx.cs">\r
-      <DependentUpon>SecurError.aspx</DependentUpon>\r
-      <SubType>ASPXCodeBehind</SubType>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\SecurError.aspx.designer.cs">\r
-      <DependentUpon>SecurError.aspx</DependentUpon>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\StrUtils.cs" />\r
-    <Compile Include="aspnetconfig\UrlUtils.cs" />\r
-    <Compile Include="aspnetconfig\Util.Master.cs">\r
-      <DependentUpon>Util.Master</DependentUpon>\r
-      <SubType>ASPXCodeBehind</SubType>\r
-    </Compile>\r
-    <Compile Include="aspnetconfig\Util.Master.designer.cs">\r
-      <DependentUpon>Util.Master</DependentUpon>\r
-    </Compile>\r
-    <Compile Include="Controls\Searcher.ascx.cs">\r
-      <DependentUpon>Searcher.ascx</DependentUpon>\r
-      <SubType>ASPXCodeBehind</SubType>\r
-    </Compile>\r
-    <Compile Include="Controls\Searcher.ascx.designer.cs">\r
-      <DependentUpon>Searcher.ascx</DependentUpon>\r
-    </Compile>\r
-    <Compile Include="Properties\AssemblyInfo.cs" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <None Include="aspnetconfig\CreateRole.aspx" />\r
-    <None Include="aspnetconfig\CreateUser.aspx" />\r
-    <None Include="aspnetconfig\Default.aspx" />\r
-    <None Include="aspnetconfig\EditUser.aspx" />\r
-    <None Include="aspnetconfig\Error.aspx" />\r
-    <EmbeddedResource Include="aspnetconfig\Mainsoft.Web.AspnetConfig.css" />\r
-    <None Include="aspnetconfig\ManageRole.aspx" />\r
-    <None Include="aspnetconfig\ManageUser.aspx" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <None Include="aspnetconfig\SecurError.aspx" />\r
-    <Content Include="aspnetconfig\Util.Master" />\r
-    <Content Include="WEB-INF\faces-config.xml" />\r
-    <None Include="Controls\Searcher.ascx" />\r
-    <None Include="nomd5" />\r
-    <EmbeddedResource Include="resources\mainsoft.jpg" />\r
-    <EmbeddedResource Include="resources\untitled.bmp" />\r
-  </ItemGroup>\r
-  <PropertyGroup>\r
-    <PostBuildEvent>\r
-    </PostBuildEvent>\r
-  </PropertyGroup>\r
-</Project>\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Properties/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Properties/.gitattributes
deleted file mode 100644 (file)
index 40887b8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/AssemblyInfo.cs -crlf
-/AssemblyInfo.cs.bak -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Properties/AssemblyInfo.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Properties/AssemblyInfo.cs
deleted file mode 100644 (file)
index 7c3742f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-using System.Runtime.InteropServices;\r
-using System.Web.UI;\r
-\r
-// General Information about an assembly is controlled through the following \r
-// set of attributes. Change these attribute values to modify the information\r
-// associated with an assembly.\r
-[assembly: AssemblyTitle("Mainsoft.Web.AspnetConfig")]\r
-[assembly: AssemblyDescription("")]\r
-[assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("")]\r
-[assembly: AssemblyProduct("Mainsoft.Web.AspnetConfig")]\r
-[assembly: AssemblyCopyright("Copyright Â©  2006")]\r
-[assembly: AssemblyTrademark("")]\r
-[assembly: AssemblyCulture("")]\r
-\r
-// Setting ComVisible to false makes the types in this assembly not visible \r
-// to COM components.  If you need to access a type in this assembly from \r
-// COM, set the ComVisible attribute to true on that type.\r
-[assembly: ComVisible(false)]\r
-\r
-// The following GUID is for the ID of the typelib if this project is exposed to COM\r
-[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]\r
-\r
-// Version information for an assembly consists of the following four values:\r
-//\r
-//      Major Version\r
-//      Minor Version \r
-//      Build Number\r
-//      Revision\r
-//\r
-// You can specify all the values or you can default the Revision and Build Numbers \r
-// by using the '*' as shown below:\r
-[assembly: AssemblyVersion("1.0.0.0")]\r
-[assembly: AssemblyFileVersion("1.0.0.0")]\r
-[assembly: WebResource ("Mainsoft.Web.AspnetConfig.resources.mainsoft.jpg", "image/jpeg")]\r
-[assembly: WebResource ("Mainsoft.Web.AspnetConfig.resources.untitled.bmp", "image/jpeg")]\r
-[assembly: WebResource ("Mainsoft.Web.AspnetConfig.aspnetconfig.Mainsoft.Web.AspnetConfig.css", "text/css")]\r
-\r
-\r
-\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Properties/AssemblyInfo.cs.bak b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Properties/AssemblyInfo.cs.bak
deleted file mode 100644 (file)
index 5e2c3bb..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-using System.Runtime.InteropServices;\r
-using System.Web.UI;\r
-\r
-// General Information about an assembly is controlled through the following \r
-// set of attributes. Change these attribute values to modify the information\r
-// associated with an assembly.\r
-[assembly: AssemblyTitle("Mainsoft.Web.Administration")]\r
-[assembly: AssemblyDescription("")]\r
-[assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("")]\r
-[assembly: AssemblyProduct("Mainsoft.Web.Administration")]\r
-[assembly: AssemblyCopyright("Copyright Â©  2006")]\r
-[assembly: AssemblyTrademark("")]\r
-[assembly: AssemblyCulture("")]\r
-\r
-// Setting ComVisible to false makes the types in this assembly not visible \r
-// to COM components.  If you need to access a type in this assembly from \r
-// COM, set the ComVisible attribute to true on that type.\r
-[assembly: ComVisible(false)]\r
-\r
-// The following GUID is for the ID of the typelib if this project is exposed to COM\r
-[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]\r
-\r
-// Version information for an assembly consists of the following four values:\r
-//\r
-//      Major Version\r
-//      Minor Version \r
-//      Build Number\r
-//      Revision\r
-//\r
-// You can specify all the values or you can default the Revision and Build Numbers \r
-// by using the '*' as shown below:\r
-[assembly: AssemblyVersion("1.0.0.0")]\r
-[assembly: AssemblyFileVersion("1.0.0.0")]\r
-[assembly: WebResource ("Mainsoft.Web.Administration.resources.mainsoft.jpg", "image/jpeg")]\r
-[assembly: WebResource ("Mainsoft.Web.Administration.resources.untitled.bmp", "image/jpeg")]\r
-[assembly: WebResource ("Mainsoft.Web.Administration.aspnetconfig.Mainsoft.Web.Administration.css", "text/css")]\r
-\r
-\r
-\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/WEB-INF/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/WEB-INF/.gitattributes
deleted file mode 100644 (file)
index 5479009..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/faces-config.xml -crlf
-/web.xml -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/WEB-INF/faces-config.xml b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/WEB-INF/faces-config.xml
deleted file mode 100755 (executable)
index 7c89d00..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>\r
-<!DOCTYPE faces-config PUBLIC\r
-  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"\r
-  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">\r
-\r
-<faces-config>\r
-       <application>\r
-\r
-\r
-       <state-manager>Mainsoft.Web.Hosting.ServletFacesStateManager</state-manager>\r
-       <view-handler>Mainsoft.Web.Hosting.ServletFacesViewHandler</view-handler>\r
-\r
-       </application>\r
-</faces-config>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/WEB-INF/web.xml b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/WEB-INF/web.xml
deleted file mode 100644 (file)
index 73c9a92..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>\r
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"[]>\r
-<web-app>\r
-  <display-name>Visual MainWin application</display-name>\r
-  <description>Visual MainWin application.</description>\r
-  <context-param>\r
-    <param-name>EnableSessionPersistency</param-name>\r
-    <param-value>False</param-value>\r
-  </context-param>\r
-  <context-param>\r
-    <param-name>WebFileSystemAccess</param-name>\r
-    <param-value>Virtual</param-value>\r
-  </context-param>\r
-  <context-param>\r
-    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>\r
-    <param-value>client</param-value>\r
-  </context-param>\r
-  <context-param>\r
-    <param-name>javax.faces.application.CONFIG_FILES</param-name>\r
-    <param-value>/WEB-INF/faces-config.xml</param-value>\r
-  </context-param>\r
-  <context-param>\r
-    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>\r
-    <param-value>.aspx</param-value>\r
-  </context-param>\r
-  <listener>\r
-    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>\r
-  </listener>\r
-  <listener>\r
-    <listener-class>system.Web.GH.SessionListener</listener-class>\r
-  </listener>\r
-  <servlet>\r
-    <servlet-name>VmwIncludeHelperServlet</servlet-name>\r
-    <servlet-class>system.Web.GH.IncludeHelperServlet</servlet-class>\r
-  </servlet>\r
-  <servlet>\r
-    <servlet-name>VmwDynamicServlet</servlet-name>\r
-    <servlet-class>GhDynamicHttpServlet</servlet-class>\r
-  </servlet>\r
-  <servlet>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <servlet-class>GhStaticHttpServlet</servlet-class>\r
-  </servlet>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwDynamicServlet</servlet-name>\r
-    <url-pattern>*.aspx</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwDynamicServlet</servlet-name>\r
-    <url-pattern>*.asmx</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwDynamicServlet</servlet-name>\r
-    <url-pattern>*.ashx</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwDynamicServlet</servlet-name>\r
-    <url-pattern>*.invoke</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwDynamicServlet</servlet-name>\r
-    <url-pattern>*.soap</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwDynamicServlet</servlet-name>\r
-    <url-pattern>*.rem</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwDynamicServlet</servlet-name>\r
-    <url-pattern>*.axd</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwIncludeHelperServlet</servlet-name>\r
-    <url-pattern>/servletincludehelper</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.gif</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.jpeg</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.jpg</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.png</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.html</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.htm</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.bmp</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.css</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.js</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.vbs</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.inc</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.swf</url-pattern>\r
-  </servlet-mapping>\r
-  <servlet-mapping>\r
-    <servlet-name>VmwStaticServlet</servlet-name>\r
-    <url-pattern>*.htc</url-pattern>\r
-  </servlet-mapping>\r
-  <session-config>\r
-    <session-timeout>20</session-timeout>\r
-  </session-config>\r
-  <welcome-file-list>\r
-    <welcome-file>Default.aspx</welcome-file>\r
-  </welcome-file-list>\r
-</web-app>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Web.config b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Web.config
deleted file mode 100644 (file)
index aaa267b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0"?>\r
-\r
-<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">\r
-\r
-    <appSettings>\r
-      \r
-        <!-- \r
-                *****  Defaulf is False *****\r
-        <add key="allowRemoteConfiguration" value="False" />-->\r
-    </appSettings>\r
-    <connectionStrings/>\r
-  \r
-    <system.web>\r
-        <!-- \r
-            Set compilation debug="true" to insert debugging \r
-            symbols into the compiled page. Because this \r
-            affects performance, set this value to true only \r
-            during development.\r
-        -->\r
-        <roleManager enabled="true" />\r
-        <compilation defaultLanguage="c#" debug="true"/>\r
-        <!--\r
-            The <authentication> section enables configuration \r
-            of the security authentication mode used by \r
-            ASP.NET to identify an incoming user. \r
-        -->\r
-        <authentication mode="Forms" />\r
-        <!--\r
-            The <customErrors> section enables configuration \r
-            of what to do if/when an unhandled error occurs \r
-            during the execution of a request. Specifically, \r
-            it enables developers to configure html error pages \r
-            to be displayed in place of a error stack trace.\r
-\r
-        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">\r
-            <error statusCode="403" redirect="NoAccess.htm" />\r
-            <error statusCode="404" redirect="FileNotFound.htm" />\r
-        </customErrors>\r
-        -->\r
-    </system.web>\r
-</configuration>\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Web.config.bak b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/Web.config.bak
deleted file mode 100644 (file)
index bd9b8f5..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>\r
-\r
-<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">\r
-\r
-    <appSettings>\r
-      \r
-        <!-- \r
-                *****  Defaulf is False *****\r
-        <add key="allowRemoteConfiguration" value="False" />-->\r
-    </appSettings>\r
-    <connectionStrings/>\r
-  \r
-    <system.web>\r
-        <!-- \r
-            Set compilation debug="true" to insert debugging \r
-            symbols into the compiled page. Because this \r
-            affects performance, set this value to true only \r
-            during development.\r
-        -->\r
-        <roleManager enabled="true" />\r
-        <compilation defaultLanguage="c#" debug="true"/>\r
-        <!--\r
-            The <authentication> section enables configuration \r
-            of the security authentication mode used by \r
-            ASP.NET to identify an incoming user. \r
-        -->\r
-        <authentication mode="Forms" />\r
-        <!--\r
-            The <customErrors> section enables configuration \r
-            of what to do if/when an unhandled error occurs \r
-            during the execution of a request. Specifically, \r
-            it enables developers to configure html error pages \r
-            to be displayed in place of a error stack trace.\r
-\r
-        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">\r
-            <error statusCode="403" redirect="NoAccess.htm" />\r
-            <error statusCode="404" redirect="FileNotFound.htm" />\r
-        </customErrors>\r
-        -->\r
-\r
-      <siteMap>\r
-        <providers>\r
-          <add siteMapFile="web.sitemap" name="AspNetConfigXmlSiteMapProvider"\r
-              type="Mainsoft.Web.Administration.CustomXmlSiteMapProvider" />\r
-        </providers>\r
-      </siteMap>\r
-      \r
-    </system.web>\r
-</configuration>\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/.gitattributes
deleted file mode 100644 (file)
index 130d95b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/CreateRole.aspx -crlf
-/CreateRole.aspx.cs -crlf
-/CreateRole.aspx.designer.cs -crlf
-/CreateUser.aspx -crlf
-/CreateUser.aspx.cs -crlf
-/CreateUser.aspx.designer.cs -crlf
-/Default.aspx -crlf
-/Default.aspx.cs -crlf
-/Default.aspx.designer.cs -crlf
-/EditUser.aspx -crlf
-/EditUser.aspx.cs -crlf
-/EditUser.aspx.designer.cs -crlf
-/Error.aspx -crlf
-/Error.aspx.cs -crlf
-/Error.aspx.designer.cs -crlf
-/GridButton.cs -crlf
-/GridCheckBox.cs -crlf
-/Mainsoft.Web.AspnetConfig.css -crlf
-/ManageRole.aspx -crlf
-/ManageRole.aspx.cs -crlf
-/ManageRole.aspx.designer.cs -crlf
-/ManageUser.aspx -crlf
-/ManageUser.aspx.cs -crlf
-/ManageUser.aspx.designer.cs -crlf
-/RolesDS.cs -crlf
-/SecurError.aspx -crlf
-/SecurError.aspx.cs -crlf
-/SecurError.aspx.designer.cs -crlf
-/StrUtils.cs -crlf
-/Util.Master -crlf
-/Util.Master.cs -crlf
-/Util.Master.designer.cs -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateRole.aspx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateRole.aspx
deleted file mode 100644 (file)
index 85905e9..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-<%--\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>\r
-<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="CreateRole.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.CreateRole" %>\r
-<%@ Register TagPrefix="custom" Assembly="Mainsoft.Web.AspnetConfig" Namespace="Mainsoft.Web.AspnetConfig" %>\r
-<asp:Content ID="Content1" ContentPlaceHolderID="SiteMapLinks" runat="server">\r
-<td><a class="SiteMap" href="Default.aspx" title="Home page" runat="server">Home</a></td>\r
-<td> >> </td>\r
-<td style="color: #333333">Create\Manage roles</td>\r
-</asp:Content>\r
-\r
-<asp:Content ID="Main" ContentPlaceHolderID="Main" runat="server">\r
-    <asp:MultiView runat="server" ID="mv" ActiveViewIndex="0">\r
-    <asp:View runat="server" id="grid">\r
-    <table class="maintable">\r
-        <tr>\r
-            <td colspan="2" width="100%" style="height: 21px">\r
-                You can optionally add roles, or groups, that enable you to allow or deny groups of users access to specific folders in your Web site. For example, you might create roles such as "managers," "sales," or "members," each with different access to specific folders.  <br /> <br />\r
-            </td>\r
-        </tr>\r
-        <tr>\r
-            <td width= "100%" valign="top">\r
-                <table width="100%" class="innertable" >\r
-                    <tr>\r
-                        <td width="100%" class="controlheader">\r
-                            Create New Role\r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td>\r
-                            New role name:  &nbsp; &nbsp; \r
-                            <asp:TextBox ID="roleName_txb" runat="server" /> &nbsp; &nbsp;\r
-                            <asp:Button  ID="roleName_bt"  runat="server" Text="Add role" OnClick="roleName_bt_Click" />\r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td>\r
-                            <asp:Label ID="error_lb" runat="server" ForeColor="Red" />\r
-                            <br /> <br />\r
-                        </td>\r
-                    </tr>\r
-                </table>\r
-            </td> \r
-        </tr>\r
-        <tr>\r
-            <td width= "100%" valign="top" datakeynames="Role;">\r
-                <asp:GridView ID="Roles_gv" runat="server" CellPadding="4" DataSourceID="ObjectDataSource1" ForeColor="#333333" GridLines="None" Width="100%" AutoGenerateColumns="False" DataKeyNames="Role">\r
-                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />\r
-                    <Columns>\r
-                        <asp:BoundField DataField="Role" HeaderText="Role Name" >\r
-                            <HeaderStyle HorizontalAlign="Left" />\r
-                        </asp:BoundField>\r
-                        <asp:TemplateField HeaderText="Add\Remove Role">\r
-                            <ItemTemplate>\r
-                                <asp:HyperLink ID="HyperLink1" NavigateUrl='<%# string.Format("ManageRole.aspx?Role={0}", HttpUtility.UrlEncode((string)Eval("Role"))) %>'\r
-                                    Text="Manage" runat="server" />\r
-                            </ItemTemplate>\r
-                        </asp:TemplateField>\r
-                        <asp:TemplateField>\r
-                            <ItemTemplate>\r
-                                  <custom:GridButton ID="grid_btn" runat="server" User='<%# Bind("Role") %>' OnClick="gridbtn_click"  >Delete</custom:GridButton>\r
-                            </ItemTemplate>\r
-                        </asp:TemplateField>\r
-                    </Columns>\r
-                    <RowStyle BackColor="#EFF3FB" />\r
-                    <EditRowStyle BackColor="#2461BF" />\r
-                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />\r
-                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />\r
-                    <HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em"\r
-                        ForeColor="White" HorizontalAlign="Center" />\r
-                    <AlternatingRowStyle BackColor="White" />\r
-                </asp:GridView>\r
-                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"\r
-                    SelectMethod="Select" TypeName="Mainsoft.Web.AspnetConfig.RolesDS">\r
-                    <DeleteParameters>\r
-                        <asp:Parameter Name="Role" Type="String" />\r
-                    </DeleteParameters>\r
-                </asp:ObjectDataSource>\r
-            </td>\r
-        </tr>\r
-    </table>\r
-    </asp:View>\r
-    <asp:View runat="server" ID="yesno" >\r
-    <table class="innertable" width="60%">\r
-        <tr>\r
-            <td style="height: 80px" valign="top">\r
-                <br />\r
-                    <asp:Image runat="server" id="Img" /> &nbsp;\r
-                    Are you sure you want to delete the role: "<%= Role %>"?\r
-                <br />\r
-            </td>\r
-        </tr>\r
-        <tr>\r
-            <td align="right" style="background-color:inactivecaptiontext" >\r
-                <asp:Button ID="yes" runat="server" Text="Yes" style="width:50px" OnClick="Click_Yes" />\r
-                <asp:Button ID="no" runat="server" Text="No" style="width:50px" OnClick="Click_No" />\r
-            </td>\r
-        </tr>\r
-    </table>\r
-    </asp:View>\r
-    </asp:MultiView>\r
- </asp:Content>\r
-   
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateRole.aspx.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateRole.aspx.cs
deleted file mode 100644 (file)
index 46c4842..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-\r
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-using System.Threading;\r
-using System.Text;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-       public partial class CreateRole : System.Web.UI.Page\r
-       {\r
-               public string Role\r
-               {\r
-                       get { return ViewState["Role"] == null ? String.Empty : (string) ViewState["Role"]; }\r
-                       set { ViewState["Role"] = value; }\r
-               }\r
-\r
-\r
-               protected override void OnPreRender (EventArgs e)\r
-               {\r
-                       if (mv.ActiveViewIndex == 1) {\r
-                               ((Button) Master.FindControl ("Back")).Visible = false;\r
-                       }\r
-                       else {\r
-                               ((Button) Master.FindControl ("Back")).Visible = true;\r
-                       }\r
-\r
-                       base.OnPreRender (e);\r
-                       Roles_gv.DataBind ();\r
-               }\r
-\r
-               protected override void OnInit (EventArgs e)\r
-               {\r
-                       Img.ImageUrl = this.Page.ClientScript.GetWebResourceUrl (typeof (CreateRole), "Mainsoft.Web.AspnetConfig.resources.untitled.bmp");\r
-                       base.OnInit (e);\r
-               }\r
-\r
-               protected void Page_Load (object sender, EventArgs e)\r
-               {\r
-                       Button bt = Master.FindControl ("Back") as Button;\r
-                       if (bt != null) {\r
-                               bt.PostBackUrl = "Default.aspx";\r
-                       }\r
-               }\r
-\r
-               protected void gridbtn_click (object sender, EventArgs e)\r
-               {\r
-                       Role = ((GridButton) sender).User;\r
-                       mv.ActiveViewIndex = 1;\r
-               }\r
-\r
-               protected void roleName_bt_Click (object sender, EventArgs e)\r
-               {\r
-                       if (roleName_txb.Text != "") {\r
-                               try {\r
-                                       Roles.CreateRole (roleName_txb.Text);\r
-                                       error_lb.Text = "";\r
-                               }\r
-                               catch (Exception ex) {\r
-                                       error_lb.Text = ex.Message;\r
-                               }\r
-                               finally {\r
-                               }\r
-                       }\r
-                       else {\r
-                               error_lb.Text = "Role name cannot be empty!";\r
-                       }\r
-               }\r
-\r
-               protected void Click_No (object sender, EventArgs e)\r
-               {\r
-                       mv.ActiveViewIndex = 0;\r
-               }\r
-\r
-               protected void Click_Yes (object sender, EventArgs e)\r
-               {\r
-                       RolesDS.Delete (Role);\r
-                       mv.ActiveViewIndex = 0;\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateRole.aspx.designer.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateRole.aspx.designer.cs
deleted file mode 100644 (file)
index 059f968..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:2.0.50727.42\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace Mainsoft.Web.AspnetConfig {\r
-    \r
-    public partial class CreateRole {\r
-        protected System.Web.UI.WebControls.MultiView mv;\r
-        protected System.Web.UI.WebControls.View grid;\r
-        protected System.Web.UI.WebControls.TextBox roleName_txb;\r
-        protected System.Web.UI.WebControls.Button roleName_bt;\r
-        protected System.Web.UI.WebControls.Label error_lb;\r
-        protected System.Web.UI.WebControls.GridView Roles_gv;\r
-        protected System.Web.UI.WebControls.ObjectDataSource ObjectDataSource1;\r
-        protected System.Web.UI.WebControls.View yesno;\r
-        protected System.Web.UI.WebControls.Image Img;\r
-        protected System.Web.UI.WebControls.Button yes;\r
-        protected System.Web.UI.WebControls.Button no;\r
-    }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateUser.aspx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateUser.aspx
deleted file mode 100644 (file)
index c31608e..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-<%--\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>\r
-<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="CreateUser.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.CreateUser" %>\r
-<asp:Content ContentPlaceHolderID="SiteMapLinks" runat="server">\r
-<td><a class="SiteMap" href="Default.aspx" title="Home page" runat="server">Home</a></td>\r
-<td> >> </td>\r
-<td style="color: #333333">Create user</td>\r
-</asp:Content>\r
-<asp:Content runat="server" ID="main" ContentPlaceHolderID="Main">\r
-    <table style="border-right: thin solid; padding-right: 2px; border-top: thin solid; padding-left: 2px; padding-bottom: 2px; border-left: thin solid; padding-top: 2px; border-bottom: thin solid">\r
-        <tr>\r
-            <td colspan="2" width="100%" style="height: 21px">\r
-                <asp:Label ID="text_lbl" runat="server" Text="Add a user by entering a user name, password, and e-mail address on this page." />\r
-            </td>\r
-        </tr>\r
-        <tr>\r
-            <td width= "60%" valign="top">\r
-                    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" BackColor="#F7F6F3"\r
-                    BorderColor="#E6E2D8" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" LoginCreatedUser="false"\r
-                    Font-Size="0.8em" Width="353px" ContinueDestinationPageUrl="CreateUser.aspx" FinishDestinationPageUrl="CreateUser.aspx" EmailRegularExpression="\S+@\S+\.\S+">\r
-                    <WizardSteps>\r
-                        <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">\r
-                            <ContentTemplate>\r
-                                <table border="0" style="font-size: 100%; width: 353px; font-family: Verdana">\r
-                                    <tr>\r
-                                        <td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #5d7b9d;\r
-                                            text-align: left">\r
-                                            Sign Up for Your New Account</td>\r
-                                    </tr>\r
-                                    <tr>\r
-                                        <td align="right">\r
-                                            <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td>\r
-                                        <td>\r
-                                            <asp:TextBox ID="UserName" runat="server"></asp:TextBox>\r
-                                            <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"\r
-                                                ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>\r
-                                        </td>\r
-                                    </tr>\r
-                                    <tr>\r
-                                        <td align="right">\r
-                                            <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td>\r
-                                        <td>\r
-                                            <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>\r
-                                            <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"\r
-                                                ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>\r
-                                        </td>\r
-                                    </tr>\r
-                                    <tr>\r
-                                        <td align="right">\r
-                                            <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label></td>\r
-                                        <td>\r
-                                            <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>\r
-                                            <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"\r
-                                                ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."\r
-                                                ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>\r
-                                        </td>\r
-                                    </tr>\r
-                                    <tr>\r
-                                        <td align="right">\r
-                                            <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label></td>\r
-                                        <td>\r
-                                            <asp:TextBox ID="Email" runat="server"></asp:TextBox>\r
-                                            <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"\r
-                                                ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>\r
-                                        </td>\r
-                                    </tr>\r
-                                    <tr>\r
-                                        <td align="right">\r
-                                            <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label></td>\r
-                                        <td>\r
-                                            <asp:TextBox ID="Question" runat="server"></asp:TextBox>\r
-                                            <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"\r
-                                                ErrorMessage="Security question is required." ToolTip="Security question is required."\r
-                                                ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>\r
-                                        </td>\r
-                                    </tr>\r
-                                    <tr>\r
-                                        <td align="right">\r
-                                            <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label></td>\r
-                                        <td>\r
-                                            <asp:TextBox ID="Answer" runat="server"></asp:TextBox>\r
-                                            <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"\r
-                                                ErrorMessage="Security answer is required." ToolTip="Security answer is required."\r
-                                                ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>\r
-                                        </td>\r
-                                    </tr>\r
-                                    <tr>\r
-                                        <td align="center" colspan="2">\r
-                                            <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"\r
-                                                ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."\r
-                                                ValidationGroup="CreateUserWizard1"></asp:CompareValidator>\r
-                                        </td>\r
-                                    </tr>\r
-                                    <tr>\r
-                                        <td align="center" colspan="2">\r
-                                            <asp:RegularExpressionValidator ID="EmailRegExp" runat="server" ControlToValidate="Email"\r
-                                                Display="Dynamic" ErrorMessage="Please enter a different e-mail." ValidationExpression="\S+@\S+\.\S+"\r
-                                                ValidationGroup="CreateUserWizard1"></asp:RegularExpressionValidator>\r
-                                        </td>\r
-                                    </tr>\r
-                                    <tr>\r
-                                        <td align="center" colspan="2" style="color: red">\r
-                                            <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>\r
-                                        </td>\r
-                                    </tr>\r
-                                </table>\r
-                            </ContentTemplate>\r
-                        </asp:CreateUserWizardStep>\r
-                        <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">\r
-                            <ContentTemplate>\r
-                                <table border="0" style="font-size: 100%; width: 353px; font-family: Verdana">\r
-                                    <tr>\r
-                                        <td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #5d7b9d;\r
-                                            text-align: left">\r
-                                            Create User</td>\r
-                                    </tr>\r
-                                    <tr>\r
-                                        <td>\r
-                                            &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\r
-                                            <br />\r
-                                            &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\r
-                                            &nbsp;&nbsp; Complete.<br />\r
-                                            &nbsp; &nbsp; &nbsp;Your account has been successfully created.</td>\r
-                                    </tr>\r
-                                    <tr>\r
-                                        <td align="right" colspan="2">\r
-                                            <asp:Button ID="ContinueButton" runat="server" BackColor="#FFFBFF" BorderColor="#CCCCCC"\r
-                                                BorderStyle="Solid" BorderWidth="1px" CausesValidation="False" CommandName="Continue"\r
-                                                Font-Names="Verdana" ForeColor="#284775" Text="Continue" ValidationGroup="CreateUserWizard1" />\r
-                                        </td>\r
-                                    </tr>\r
-                                </table>\r
-                            </ContentTemplate>\r
-                        </asp:CompleteWizardStep>\r
-                    </WizardSteps>\r
-                    <SideBarStyle BackColor="#5D7B9D" BorderWidth="0px" Font-Size="0.9em" VerticalAlign="Top" />\r
-                    <TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />\r
-                    <SideBarButtonStyle BorderWidth="0px" Font-Names="Verdana" ForeColor="White" />\r
-                    <NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"\r
-                        BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />\r
-                    <HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em"\r
-                        ForeColor="White" HorizontalAlign="Center" />\r
-                    <CreateUserButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"\r
-                        BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />\r
-                    <ContinueButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"\r
-                        BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" />\r
-                    <StepStyle BorderWidth="0px" />\r
-                </asp:CreateUserWizard>\r
-            </td>\r
-            <td width= "60%" valign="top">\r
-                <table width="100%" style="background-color: #f7f6f3; border-right: #e6e2d8 1px solid; border-top: #e6e2d8 1px solid; border-left: #e6e2d8 1px solid; border-bottom: #e6e2d8 1px solid;" >\r
-                    <tr>\r
-                        <td width="100%" style="text-align: center; background-color: #5D7B9D; font-weight:bold; font-size:0.9em; color:White;text-align:center; height: 19px;">\r
-                           Roles\r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td valign="top">\r
-                            &nbsp;<asp:CheckBoxList ID="roles_lst" runat="server">\r
-                            </asp:CheckBoxList></td>\r
-                    </tr>\r
-                </table>\r
-            </td> \r
-        </tr>\r
-        <tr>\r
-            <td colspan="2">\r
-                Active User\r
-                <asp:CheckBox ID="active_chb" runat="server" Checked="true" Enabled="true" />                \r
-            </td>\r
-        </tr>\r
-    </table>\r
-</asp:Content>\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateUser.aspx.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateUser.aspx.cs
deleted file mode 100644 (file)
index b6a51d0..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-\r
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-       public partial class CreateUser : System.Web.UI.Page\r
-       {\r
-               protected override void OnPreRender (EventArgs e)\r
-               {\r
-                       roles_lst.DataBind ();\r
-                       base.OnPreRender (e);\r
-                       if (CreateUserWizard1.ActiveStepIndex != 0) {\r
-                               text_lbl.Visible = false;\r
-                               ((Button) Master.FindControl ("Back")).Visible = false;\r
-                               active_chb.Enabled = false;\r
-                       }\r
-               }\r
-\r
-               protected void Page_Load (object sender, EventArgs e)\r
-               {\r
-                       if (!IsPostBack) {\r
-                               roles_lst.DataValueField = "Role";\r
-                               roles_lst.DataSource = RolesDS.Select ();\r
-                       }\r
-                       CreateUserWizard1.CreatingUser += new LoginCancelEventHandler (CreateUserWizard1_CreatingUser);\r
-                       CreateUserWizard1.CreatedUser += new EventHandler (CreateUserWizard1_CreatedUser);\r
-                       Button bt = Master.FindControl ("Back") as Button;\r
-                       if (bt != null) {\r
-                               bt.PostBackUrl = "Default.aspx";\r
-                       }\r
-               }\r
-\r
-               public void CreateUserWizard1_CreatedUser (object sender, EventArgs e)\r
-               {\r
-                       MembershipUser user = Membership.GetUser (((CreateUserWizard) sender).UserName);\r
-                       roles_lst.Enabled = false;\r
-                       \r
-                       int i = 0;\r
-                       while (i < roles_lst.Items.Count) {\r
-                               if (roles_lst.Items[i].Selected) {\r
-                                       try {\r
-                                               Roles.AddUserToRole (((CreateUserWizard) sender).UserName, roles_lst.Items[i].Text);\r
-                                       }\r
-                                       catch (Exception ex) {\r
-                                               ((CreateUserWizard) sender).UnknownErrorMessage = ex.Message;\r
-                                       }\r
-                               }\r
-                               i++;\r
-                       }\r
-               }\r
-\r
-               public void CreateUserWizard1_CreatingUser (object sender, LoginCancelEventArgs e)\r
-               {\r
-                       ((CreateUserWizard) sender).DisableCreatedUser = !active_chb.Checked;\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateUser.aspx.designer.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/CreateUser.aspx.designer.cs
deleted file mode 100644 (file)
index ed80598..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:2.0.50727.42\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace Mainsoft.Web.AspnetConfig {\r
-    \r
-    public partial class CreateUser {\r
-        protected System.Web.UI.WebControls.Label text_lbl;\r
-        protected System.Web.UI.WebControls.CreateUserWizard CreateUserWizard1;\r
-        protected System.Web.UI.WebControls.CreateUserWizardStep CreateUserWizardStep1;\r
-        protected System.Web.UI.WebControls.CompleteWizardStep CompleteWizardStep1;\r
-        protected System.Web.UI.WebControls.CheckBoxList roles_lst;\r
-        protected System.Web.UI.WebControls.CheckBox active_chb;\r
-    }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Default.aspx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Default.aspx
deleted file mode 100644 (file)
index 37ef6b2..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<%--\r
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>\r
-<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="Default.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.Default" %>\r
-<asp:Content ContentPlaceHolderID="SiteMapLinks" runat="server">\r
-<td style="color: #333333">Home</td>\r
-</asp:Content>\r
-<asp:Content runat="server" ContentPlaceHolderID="Main">\r
-    <table>\r
-        <tr>\r
-            <td>\r
-                You can use the Web Site Administration Tool to manage all the security settings for your application. You can set up users and passwords (authentication), and create roles (groups of users). By default, user information is stored in a Cloudscape database in the Data folder of your Web project. If you want to store user information in a different database, you may configure a different provider in the web.config file.\r
-                <br /><br /><br />\r
-            </td>\r
-        </tr>\r
-        <tr>\r
-            <td>\r
-                <table class="innertable" width="70%" >\r
-                    <tr>\r
-                        <td class="controlheader">\r
-                            Users\r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td>\r
-                            <%= User_count %>\r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td>\r
-                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="CreateUser.aspx" OnLoad="UsersLinks_Load">Create user</asp:HyperLink>\r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td>\r
-                            <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="ManageUser.aspx"  OnLoad="UsersLinks_Load">Manage users</asp:HyperLink>\r
-                        </td>\r
-                    </tr>\r
-                </table> \r
-                <br /><br /><br />\r
-            </td>\r
-        </tr>\r
-        <tr>\r
-            <td>\r
-                <table class="innertable" width="70%">\r
-                    <tr>\r
-                        <td class="controlheader">\r
-                            Roles \r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td>\r
-                             <%= Roles_count %>\r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td>\r
-                            <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="CreateRole.aspx" OnLoad="HyperLink1_Load" >Create or manage roles</asp:HyperLink>\r
-                        </td>\r
-                    </tr>\r
-                </table>\r
-                <br /><br /><br />\r
-            </td>\r
-        </tr>\r
-    </table>\r
-</asp:Content>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Default.aspx.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Default.aspx.cs
deleted file mode 100644 (file)
index 4531e75..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-\r
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-       public partial class Default : System.Web.UI.Page\r
-       {\r
-               private bool IsPortalRoleProvider;\r
-               private bool IsPortalMembershipProvider;\r
-               protected override void OnInit (EventArgs e)\r
-               {\r
-                       try {\r
-                               IsPortalRoleProvider = (Roles.Provider).GetType ().ToString () == "Mainsoft.Web.Security.WPGroupsRoleProvider";\r
-                       }\r
-                       catch{\r
-                       }\r
-                       IsPortalMembershipProvider = (Membership.Provider).GetType().ToString () == "Mainsoft.Web.Security.WPMembershipProvider";\r
-               }\r
-\r
-               protected void Page_Load (object sender, EventArgs e)\r
-               {\r
-                       Button bt = Master.FindControl ("Back") as Button;\r
-                       if (bt != null) {\r
-                               bt.Enabled = false;\r
-                       }\r
-               }\r
-\r
-               public string User_count\r
-               {\r
-                       get\r
-                       {\r
-                               if (IsPortalMembershipProvider) {\r
-                                       return "You cannot create or manage users when WPMembershipProvider is configured as the default provider.";\r
-                               }\r
-                               else {\r
-                                       MembershipUserCollection user_collection = Membership.GetAllUsers ();\r
-                                       return "Created users :" + user_collection.Count.ToString ();\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public string Roles_count\r
-               {\r
-                       get\r
-                       {\r
-                               if (IsPortalRoleProvider) {\r
-                                       return @"You cannot create or manage roles when WPGroupsRoleProvider is configured as the default provider.";\r
-                               }\r
-                               else if (Roles.Enabled) {\r
-                                       string[] list = Roles.GetAllRoles ();\r
-                                       return "Existing roles :" + list.Length.ToString ();\r
-                               }\r
-                               else\r
-                                       return @"In order to create or manage roles, the roleManger key must be enabled. To enable roleManager, please modify your Web.config file as follows: <br />\r
-                                                       &nbsp; &lt;configuration xmlns=""http://schemas.microsoft.com/.NetConfiguration/v2.0""&gt; <br />\r
-                                                       &nbsp;&nbsp;    &lt;system.web&gt; <br />\r
-                                                       &nbsp;&nbsp;&nbsp;      &lt;roleManager enabled=""true"" /&gt; <br />\r
-                                                        &nbsp;&nbsp;    &lt/system.web&gt; <br />\r
-                                                       &nbsp; &lt;/configuration&gt;";\r
-                       }\r
-               }\r
-\r
-               protected void HyperLink1_Load (object sender, EventArgs e)\r
-               {\r
-                       if (!Roles.Enabled || IsPortalRoleProvider)\r
-                               ((HyperLink) sender).Visible = false;\r
-               }\r
-\r
-               protected void UsersLinks_Load (object sender, EventArgs e)\r
-               {\r
-                       if (IsPortalMembershipProvider) {\r
-                               ((HyperLink) sender).Visible = false;\r
-                       }\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Default.aspx.designer.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Default.aspx.designer.cs
deleted file mode 100644 (file)
index f1b438b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:2.0.50727.42\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace Mainsoft.Web.AspnetConfig {\r
-    \r
-    public partial class Default {\r
-        protected System.Web.UI.WebControls.HyperLink HyperLink1;\r
-        protected System.Web.UI.WebControls.HyperLink HyperLink2;\r
-        protected System.Web.UI.WebControls.HyperLink HyperLink3;\r
-    }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/EditUser.aspx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/EditUser.aspx
deleted file mode 100644 (file)
index adec8b8..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-<%--\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>\r
-<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="EditUser.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.EditUser" %>\r
-<%@ Register TagPrefix="custom" TagName="searcher" Src="~/Controls/Searcher.ascx" %>\r
-<asp:Content ContentPlaceHolderID="SiteMapLinks" runat="server">\r
-<td><a class="SiteMap" href="Default.aspx" title="Home page" runat="server">Home</a></td>\r
-<td> >> </td>\r
-<td style="color: #284E98"><a class="SiteMap" href="ManageUser.aspx" title="Manage user" runat="server">Manage user</a></td>\r
-<td> >> </td>\r
-<td style="color: #333333">Edit user</td>\r
-</asp:Content>\r
-<asp:Content runat="server" ID="main" ContentPlaceHolderID="Main">\r
-    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">\r
-        <asp:View ID="updateUser" runat="server" >\r
-        <div>\r
-        <table width="100%" class="maintable">\r
-            <tr>\r
-                <td colspan="2" width="100%" style="height: 21px">\r
-                    Use this page to edit user information and to specify what roles a user belongs in. \r
-                     <br /> <br /> <br /> \r
-                </td>\r
-            </tr>\r
-            <tr>\r
-                <td width="70%" class="innertable" align="left" valign="top">\r
-                    <table width="100%" cellpadding="0" cellspacing="0">\r
-                        <tr>\r
-                            <td width="100%" class="controlheader" colspan="3">\r
-                                User\r
-                            </td>\r
-                        </tr>\r
-                        <tr>\r
-                            <td>\r
-                                User ID:\r
-                            </td>\r
-                            <td>\r
-                                <asp:TextBox ID="userid_txb" runat="server" Enabled="false" />\r
-                            </td>\r
-                            <td>\r
-                                &nbsp;\r
-                            </td>\r
-                        </tr>\r
-                        <tr>\r
-                            <td>\r
-                               <span style="font-size: 20px; color: red">*</span> E-mail address: \r
-                            </td>\r
-                            <td>\r
-                                <asp:TextBox ID="email_txb" runat="server"></asp:TextBox>\r
-                            </td>\r
-                            <td>\r
-                                <asp:CheckBox ID="active_chb" runat="server" /> Active user\r
-                            </td>\r
-                        </tr>\r
-                        <tr>\r
-                            <td>\r
-                                Description:\r
-                            </td>\r
-                            <td>\r
-                                <asp:TextBox ID="desc_txb" runat="server">[not set]</asp:TextBox>\r
-                            </td>\r
-                            <td>\r
-                                <asp:Button ID="save_bt" runat="server" Text="Save" OnClick="save_bt_Click" />\r
-                            </td>\r
-                        </tr>\r
-                    </table>\r
-                </td>\r
-                <td class="innertable" valign="top" style="width: 82%" >\r
-                   <custom:searcher ID="srch" runat="server" />\r
-                </td>\r
-            </tr>\r
-            <tr>\r
-                <td colspan="2">\r
-                    (<span style="font-size: 20px; color: red">*</span>)Required field <br /><br />\r
-                    <asp:RequiredFieldValidator ID="required_email_validator" runat="server" ControlToValidate="email_txb" ErrorMessage="Email required" />\r
-                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="email_txb" ValidationExpression="\S+@\S+\.\S+" runat="server" ErrorMessage="Email format is invalid"></asp:RegularExpressionValidator>\r
-                </td>\r
-            </tr>\r
-        </table>\r
-        </div>\r
-        </asp:View>\r
-        <asp:View ID="successupdate" runat="server">\r
-            <div>\r
-            <table width="100%" class="maintable">\r
-            <tr>\r
-                <td width="100%" class="controlheader">\r
-                    User Management\r
-                </td>\r
-            </tr>\r
-            <tr>\r
-                <td width="100%" style="height: 100px" valign="top" align="left">\r
-                    You have successfully updated the user\r
-                    <asp:Label ID="name_lbl" runat="server" /> <br /> <br /> <br />\r
-                </td>\r
-            </tr>\r
-            <tr>\r
-                <td width="100%" align="right">\r
-                    <asp:Button ID="success_btn" runat="server" Text="OK" OnClick="success_btn_Click" />\r
-                </td>\r
-            </tr>\r
-            </table>\r
-            </div>\r
-        </asp:View>\r
-    </asp:MultiView>\r
-</asp:Content>\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/EditUser.aspx.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/EditUser.aspx.cs
deleted file mode 100644 (file)
index 7c0c39e..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-\r
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-       public partial class EditUser : System.Web.UI.Page\r
-       {\r
-               String user_name;\r
-               protected void Page_Load (object sender, EventArgs e)\r
-               {\r
-                       user_name = Request.QueryString["User"];\r
-                       srch.User = user_name;\r
-                       if (!IsPostBack) {\r
-                               FillUserData (user_name);\r
-                               name_lbl.Text = user_name;\r
-                       }\r
-\r
-                       Button bt = Master.FindControl ("Back") as Button;\r
-                       if (bt != null) {\r
-                               bt.PostBackUrl = "ManageUser.aspx";\r
-                       }\r
-               }\r
-\r
-               protected override void OnPreRender (EventArgs e)\r
-               {\r
-                       if (IsPostBack) {\r
-                               if (MultiView1.ActiveViewIndex == 1) {\r
-                                       ((Button) Master.FindControl ("Back")).Visible = false;\r
-                               }\r
-                               else {\r
-                                       ((Button) Master.FindControl ("Back")).Visible = true;\r
-                               }\r
-                       }\r
-                       base.OnPreRender (e);\r
-               }\r
-\r
-               void FillUserData (string user_name)\r
-               {\r
-                       MembershipUser user = Membership.GetUser (user_name);\r
-                       userid_txb.Text = user.UserName;\r
-                       email_txb.Text = user.Email;\r
-                       active_chb.Checked = user.IsApproved;\r
-                       desc_txb.Text = user.Comment;\r
-               }\r
-\r
-               protected void roles_lst_DataBound (object sender, EventArgs e)\r
-               {\r
-                       foreach (ListItem item in ((CheckBoxList) sender).Items) {\r
-                               item.Selected = Boolean.Parse (item.Value);\r
-                       }\r
-               }\r
-\r
-               protected void save_bt_Click (object sender, EventArgs e)\r
-               {\r
-                       MembershipUser user = Membership.GetUser (user_name);\r
-                       user.IsApproved = active_chb.Checked;\r
-                       user.Email = email_txb.Text;\r
-                       user.Comment = desc_txb.Text;\r
-                       Membership.UpdateUser (user);\r
-                       MultiView1.ActiveViewIndex = 1;\r
-               }\r
-\r
-               protected void success_btn_Click (object sender, EventArgs e)\r
-               {\r
-                       Server.Transfer ("ManageUser.aspx");\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/EditUser.aspx.designer.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/EditUser.aspx.designer.cs
deleted file mode 100644 (file)
index 56d3186..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:2.0.50727.42\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace Mainsoft.Web.AspnetConfig {\r
-    \r
-    public partial class EditUser {\r
-        protected System.Web.UI.WebControls.MultiView MultiView1;\r
-        protected System.Web.UI.WebControls.View updateUser;\r
-        protected System.Web.UI.WebControls.TextBox userid_txb;\r
-        protected System.Web.UI.WebControls.TextBox email_txb;\r
-        protected System.Web.UI.WebControls.CheckBox active_chb;\r
-        protected System.Web.UI.WebControls.TextBox desc_txb;\r
-        protected System.Web.UI.WebControls.Button save_bt;\r
-        protected Mainsoft.Web.AspnetConfig.Searcher srch;\r
-        protected System.Web.UI.WebControls.RequiredFieldValidator required_email_validator;\r
-        protected System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator1;\r
-        protected System.Web.UI.WebControls.View successupdate;\r
-        protected System.Web.UI.WebControls.Label name_lbl;\r
-        protected System.Web.UI.WebControls.Button success_btn;\r
-    }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Error.aspx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Error.aspx
deleted file mode 100644 (file)
index 6861f88..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<%--\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>\r
-\r
-<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Error.aspx.cs" Theme="" StylesheetTheme="" Inherits="Mainsoft.Web.AspnetConfig.Error" %>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-\r
-<html xmlns="http://www.w3.org/1999/xhtml" >\r
-<head runat="server">\r
-    <title>ASP.Net Web Application Administration</title>\r
-</head>\r
-<body>\r
-    <form id="form1" runat="server">\r
-    <div style="font-weight: bold; font-size: 20pt; color: red">\r
-        Error occured on this request ! Please try again !\r
-    </div>\r
-    <div>\r
-        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="Default.aspx">Administration utility home page</asp:HyperLink>\r
-    </div>\r
-    </form>\r
-</body>\r
-</html>\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Error.aspx.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Error.aspx.cs
deleted file mode 100644 (file)
index 26c4c27..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.WebControls.WebParts;\r
-using System.Web.UI.HtmlControls;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-       public partial class Error : System.Web.UI.Page\r
-       {\r
-               protected void Page_Load (object sender, EventArgs e)\r
-               {\r
-\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Error.aspx.designer.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Error.aspx.designer.cs
deleted file mode 100644 (file)
index cb5c3f6..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:2.0.50727.42\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace Mainsoft.Web.AspnetConfig {\r
-    \r
-    public partial class Error {\r
-        protected System.Web.UI.HtmlControls.HtmlForm form1;\r
-        protected System.Web.UI.WebControls.HyperLink HyperLink1;\r
-    }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/GridButton.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/GridButton.cs
deleted file mode 100644 (file)
index 9e81ae2..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-\r
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-using System.ComponentModel;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-       public class GridButton : LinkButton\r
-       {\r
-               [Bindable (true)]\r
-               public string User\r
-               {\r
-                       get { return ViewState["User"] == null ? String.Empty : (string) ViewState["User"]; }\r
-                       set { ViewState["User"] = value; }\r
-               }\r
-       }\r
-}
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/GridCheckBox.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/GridCheckBox.cs
deleted file mode 100644 (file)
index a4f6592..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-\r
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-using System.ComponentModel;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-       public class GridCheckBox : CheckBox\r
-       {\r
-               [Bindable (true)]\r
-               public string User\r
-               {\r
-                       get { return ViewState["User"] == null ? String.Empty : (string) ViewState["User"]; }\r
-                       set { ViewState["User"] = value; }\r
-               }\r
-\r
-               [Bindable (true)]\r
-               public string Role\r
-               {\r
-                       get { return ViewState["Role"] == null ? String.Empty : (string) ViewState["Role"]; }\r
-                       set { ViewState["Role"] = value; }\r
-               }\r
-\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/HandlerFactoryConfiguration.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/HandlerFactoryConfiguration.cs
deleted file mode 100644 (file)
index 353393a..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-//
-// System.Web.Configuration.HandlerFactoryConfiguration.cs
-//  
-//
-// Authors:
-//     Miguel de Icaza (miguel@novell.com)
-//     Gonzalo Paniagua Javier (gonzalo@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;
-using System.Collections;
-using System.Web.Util;
-using System.Text.RegularExpressions;
-
-namespace System.Web.Configuration {
-
-       class FileMatchingInfo {
-               public string MatchExact;
-               public string MatchExpr;
-
-               // If set, we can fast-path the patch with string.EndsWith (FMI.EndsWith)
-               public string EndsWith;
-               public Regex RegExp;
-               
-               public FileMatchingInfo (string s)
-               {
-                       MatchExpr = s;
-
-                       if (s[0] == '*' && (s.IndexOf ('*', 1) == -1))
-                               EndsWith = s.Substring (1);
-
-                       if (s.IndexOf ('*') == -1)
-                               MatchExact = "/" + s;
-
-                       if (MatchExpr != "*") {
-                               string expr = MatchExpr.Replace(".", "\\.").Replace("?", "\\?").Replace("*", ".*");
-                               if (expr.Length > 0 && expr [0] =='/')
-                                       expr = expr.Substring (1);
-
-                               expr += "\\z";
-                               RegExp = new Regex (expr);
-                       }
-               }
-       }
-       
-       class HttpHandler {
-               // If `null', we are the "*" match
-               public string OriginalVerb;
-               public string OriginalPath;
-               
-               public string [] Verbs;
-               public FileMatchingInfo [] files;
-
-               // To support lazy loading we keep the name around.
-               public string TypeName;
-               Type type;
-
-               object instance;
-               
-               public HttpHandler (string verb, string path, string typename, Type t)
-               {
-                       OriginalVerb = verb;
-                       OriginalPath = path;
-                       
-                       if (verb != "*")
-                               Verbs = verb.Split (',');
-                       string [] paths = path.Split (',');
-                       files = new FileMatchingInfo [paths.Length];
-
-                       int i = 0;
-                       foreach (string s in paths)
-                               files [i++] = new FileMatchingInfo (s);
-                       
-                       this.TypeName = typename;
-                       type = t;
-               }
-
-               //
-               // Loads the a type by name and verifies that it implements
-               // IHttpHandler or IHttpHandlerFactory
-               //
-               public static Type LoadType (string type_name)
-               {
-                       Type t;
-                       
-                       try {
-                               t = Type.GetType (type_name, true);
-                       } catch (Exception e) {
-                               throw new HttpException (String.Format ("Failed to load httpHandler type `{0}'", type_name));
-                       }
-
-                       if (typeof (IHttpHandler).IsAssignableFrom (t) ||
-                           typeof (IHttpHandlerFactory).IsAssignableFrom (t))
-                               return t;
-                       
-                       throw new HttpException (String.Format ("Type {0} does not implement IHttpHandler or IHttpHandlerFactory", type_name));
-               }
-
-               public bool PathMatches (string p)
-               {
-                       int slash = p.LastIndexOf ('/');
-                       string orig = p;
-                       if (slash != -1)
-                               p = p.Substring (slash);
-
-                       for (int j = files.Length; j > 0; ){
-                               j--;
-                               FileMatchingInfo fm = files [j];
-
-                               if (fm.MatchExact != null)
-                                       return fm.MatchExact.Length == p.Length && StrUtils.EndsWith (p, fm.MatchExact);
-                                       
-                               if (fm.EndsWith != null)
-                                       return StrUtils.EndsWith (p, fm.EndsWith);
-
-                               if (fm.MatchExpr == "*")
-                                       return true;
-
-                               /* convert to regexp */
-                               return fm.RegExp.IsMatch (orig);
-                       }
-                       return false;
-               }
-
-               // Loads the handler, possibly delay-loaded.
-               public object GetHandlerInstance ()
-               {
-                       IHttpHandler ihh = instance as IHttpHandler;
-                       
-                       if (instance == null || (ihh != null && !ihh.IsReusable)){
-                               if (type == null)
-                                       type = LoadType (TypeName);
-
-                               instance = Activator.CreateInstance (type);
-                       } 
-                       
-                       return instance;
-               }
-       }
-       
-       class HandlerFactoryConfiguration {
-               ArrayList handlers;
-               HandlerFactoryConfiguration parent;
-               int parent_items;
-
-               public HandlerFactoryConfiguration (HandlerFactoryConfiguration parent)
-               {
-                       this.parent = parent;
-
-                       if (parent != null) {
-                               handlers = new ArrayList (parent.handlers);
-                               parent_items = handlers.Count;
-                       } else {
-                               handlers = new ArrayList ();
-                       }
-               }
-
-               public void Clear ()
-               {
-                       handlers.Clear ();
-               }
-
-               public void Add (string verb, string path, string type_name, bool validate)
-               {
-                       Type type;
-
-                       if (validate){
-                               type = HttpHandler.LoadType (type_name);
-                               if (type == null)
-                                       throw new HttpException (String.Format ("Can not load {0}", type_name));
-                       } else
-                               type = null;
-                       
-                       handlers.Add (new HttpHandler (verb, path, type_name, type));
-               }
-
-               public bool Remove (string verb, string path)
-               {
-                       for (int i = handlers.Count - 1; i >= 0; i--) {
-                               HttpHandler handler = (HttpHandler) handlers [i];
-
-                               if (verb == handler.OriginalVerb && path == handler.OriginalPath){
-                                       handlers.RemoveAt (i);
-                                       return true;
-                               }
-                       }
-
-                       return false;
-               }
-
-               public object LocateHandler (string verb, string filepath)
-               {
-                       int start, end;
-                       int count = handlers.Count;
-                       for (int k = 0; k < 2; k++) {
-                               // First iteration searches for the mapping in the items added to this
-                               // instance. The second one searches through the parent items if any.
-                               start = (k == 0) ? parent_items : 0;
-                               end = (k == 0) ? count : parent_items;
-                               for (int i = start; i < end; i++) {
-                                       HttpHandler handler = (HttpHandler) handlers [i];
-
-                                       if (handler.Verbs == null){
-                                               if (handler.PathMatches (filepath))
-                                                       return handler.GetHandlerInstance ();
-                                               continue;
-                                       }
-
-                                       string [] verbs = handler.Verbs;
-                                       for (int j = verbs.Length; j > 0; ){
-                                               j--;
-                                               if (verbs [j] != verb)
-                                                       continue;
-                                               if (handler.PathMatches (filepath))
-                                                       return handler.GetHandlerInstance ();
-                                       }
-                               }
-                       }
-
-                       return null;
-               }
-       }
-}
-
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/HttpHandlersSectionHandler.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/HttpHandlersSectionHandler.cs
deleted file mode 100644 (file)
index 0d7aab8..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// System.Web.Configuration.HttpHandlersSectionHandler
-//
-// 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.
-//
-
-using System.Collections;
-using System.Configuration;
-using System.Xml;
-using System.Globalization;
-using System;
-
-namespace Mainsoft.Web.Configuration
-{
-       
-
-       internal class HandlersUtil
-       {
-               private HandlersUtil ()
-               {
-               }
-
-               static internal string ExtractAttributeValue (string attKey, XmlNode node)
-               {
-                       return ExtractAttributeValue (attKey, node, false);
-               }
-                       
-               static internal string ExtractAttributeValue (string attKey, XmlNode node, bool optional)
-               {
-                       return ExtractAttributeValue (attKey, node, optional, false);
-               }
-               
-               static internal string ExtractAttributeValue (string attKey, XmlNode node, bool optional,
-                                                             bool allowEmpty)
-               {
-                       if (node.Attributes == null) {
-                               if (optional)
-                                       return null;
-
-                               ThrowException ("Required attribute not found: " + attKey, node);
-                       }
-
-                       XmlNode att = node.Attributes.RemoveNamedItem (attKey);
-                       if (att == null) {
-                               if (optional)
-                                       return null;
-                               ThrowException ("Required attribute not found: " + attKey, node);
-                       }
-
-                       string value = att.Value;
-                       if (!allowEmpty && value == String.Empty) {
-                               string opt = optional ? "Optional" : "Required";
-                               ThrowException (opt + " attribute is empty: " + attKey, node);
-                       }
-
-                       return value;
-               }
-
-               static internal void ThrowException (string msg, XmlNode node)
-               {
-                       if (node != null && node.Name != String.Empty)
-                               msg = msg + " (node name: " + node.Name + ") ";
-                       throw new ConfigurationException (msg, node);
-               }
-       }
-}
-
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Mainsoft.Web.AspnetConfig.css b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Mainsoft.Web.AspnetConfig.css
deleted file mode 100644 (file)
index b211386..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-\r
-.appHeader\r
-{\r
-       background-image: url(Images/mainsoft.jpg); \r
-       background-repeat :no-repeat;\r
-       height: 139px; \r
-       width: 100%;\r
-       border-bottom: 1 solid #7daad4;\r
-       background-color:White;\r
-       width: 100%;\r
-       height: 133px;\r
-} \r
-\r
-.controlheader {\r
-       text-align: center; \r
-       background-color: #5D7B9D; \r
-       font-weight:bold; \r
-       font-size:0.9em; \r
-       color:White;\r
-       text-align:center; \r
-       height: 25px;\r
-}\r
-\r
-.maintable {\r
-       border-right: thin solid; \r
-       padding-right: 2px; \r
-       border-top: thin solid; \r
-       padding-left: 2px; \r
-       padding-bottom: 2px; \r
-       border-left: thin solid; \r
-       padding-top: 2px; \r
-       border-bottom: thin solid;\r
-       width: 100%;\r
-}\r
-\r
-.innertable\r
-{\r
-       background-color: #f7f6f3;\r
-       border-right: #e6e2d8 1px solid;\r
-       border-top: #e6e2d8 1px solid;\r
-       border-left: #e6e2d8 1px solid;\r
-       border-bottom: #e6e2d8 1px solid;\r
-}\r
-\r
-.h1{\r
-       font-size: 25px;\r
-       vertical-align: middle;\r
-       color: #6699ff;\r
-       text-align: center;\r
-}\r
-\r
-.bordredtable\r
-{\r
-       border-right: #6699ff 5px solid;\r
-       padding-right: 40px;\r
-       border-top: #6699ff 5px solid;\r
-       padding-left: 40px;\r
-       padding-bottom: 40px;\r
-       border-left: #6699ff 5px solid;\r
-       padding-top: 40px;\r
-       border-bottom: #6699ff 5px solid;\r
-       width: 90%;\r
-       height: 500px;\r
-       margin:5%;\r
-}\r
-\r
-\r
-BODY,TABLE,TR,TD\r
-{\r
-       font-family: Arial;\r
-       font-size: 11pt;\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageRole.aspx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageRole.aspx
deleted file mode 100644 (file)
index 68d6e2d..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<%--\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>\r
-<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="ManageRole.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.MenageRole" %>\r
-<%@ Register tagprefix="custom" namespace="Mainsoft.Web.AspnetConfig" Assembly="Mainsoft.Web.AspnetConfig"  %>\r
-<asp:Content ID="Content1" ContentPlaceHolderID="SiteMapLinks" runat="server">\r
-<td><a class="SiteMap" href="Default.aspx" title="Home page" runat="server">Home</a></td>\r
-<td> >> </td>\r
-<td style="color: #284E98;"><a class="SiteMap" href="CreateRole.aspx" title="Create\Manage roles" runat="server">Create\Manage roles</a></td>\r
-<td> >> </td>\r
-<td style="color: #333333">Manage roles</td>\r
-</asp:Content>\r
-\r
-<asp:Content runat="server" ID="main" ContentPlaceHolderID="Main">\r
-    <table class="maintable">\r
-        <tr>\r
-            <td colspan="2" width="100%" style="height: 21px">\r
-                Use this page to manage the members in the specified role. To add a user to the role, search for the user name and then select the User Is In Role check box for that user. \r
-                <br /> \r
-                Role:\r
-                <asp:Label   ID="role_lbl" runat="server" /> <br /> \r
-            </td>\r
-        </tr>\r
-       <tr>\r
-            <td width= "100%" valign="top">\r
-                <table width="100%" class="innertable" >\r
-                    <tr>\r
-                        <td width="100%" class="controlheader">\r
-                            Search for Users\r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td>\r
-                            Search for Users &nbsp; &nbsp; \r
-                            <asp:DropDownList ID="searchBy_dl" runat="server">\r
-                                <asp:ListItem Selected="True" Value="Name">User Name</asp:ListItem>\r
-                                <asp:ListItem Value="Mail">E-Mail</asp:ListItem> \r
-                            </asp:DropDownList> &nbsp; &nbsp;<asp:TextBox ID="user_txt" runat="server"></asp:TextBox>\r
-                            &nbsp;\r
-                            <asp:Button ID="searchUser_bt" runat="server" Text="Search" /> <br />\r
-                            Wildcard characters * and ? are permitted. <br /><br />\r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td width= "100%" valign="top" datakeynames="Role;">\r
-                            <asp:GridView ID="Roles_gv" runat="server" CellPadding="4" DataSourceID="ObjectDataSource1" ForeColor="#333333" GridLines="None" Width="100%" AutoGenerateColumns="False" AllowPaging="True" PageSize="5">\r
-                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />\r
-                                <Columns>\r
-                                    <asp:BoundField DataField="User" HeaderText="User Name" />\r
-                                    <asp:TemplateField HeaderText="User Is In Role">\r
-                                        <ItemTemplate>\r
-                                            <custom:GridCheckBox ID="Check" runat="server" AutoPostBack="true" Checked='<%# Bind("InRole") %>'\r
-                                             User='<%# Bind("User") %>' OnCheckedChanged="CheckBox_CheckedChanged" />\r
-                                        </ItemTemplate>\r
-                                    </asp:TemplateField>\r
-                                </Columns>\r
-                                <RowStyle BackColor="#EFF3FB" />\r
-                                <EditRowStyle BackColor="#2461BF" />\r
-                                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />\r
-                                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />\r
-                                <HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em"\r
-                                    ForeColor="White" HorizontalAlign="Left" />\r
-                                <AlternatingRowStyle BackColor="White" />\r
-                            </asp:GridView>\r
-                            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"\r
-                                SelectMethod="CreateManageRoleTable" TypeName="Mainsoft.Web.AspnetConfig.RolesDS">\r
-                                <DeleteParameters>\r
-                                    <asp:Parameter Name="Role" Type="String" />\r
-                                </DeleteParameters>\r
-                                <SelectParameters>\r
-                                    <asp:QueryStringParameter Name="role" QueryStringField="Role" Type="String" />\r
-                                    <asp:ControlParameter ControlID="user_txt" Name="searchtag" PropertyName="Text"\r
-                                        Type="String" DefaultValue="&quot;&quot;" />\r
-                                    <asp:ControlParameter ControlID="searchBy_dl" Name="searchby" PropertyName="SelectedValue"\r
-                                        Type="String" />\r
-                                </SelectParameters>\r
-                            </asp:ObjectDataSource>\r
-                        </td>\r
-                    </tr>\r
-                </table>\r
-            </td> \r
-        </tr>\r
-    </table>\r
-</asp:Content>
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageRole.aspx.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageRole.aspx.cs
deleted file mode 100644 (file)
index c642286..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->\r
-\r
-\r
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-       public partial class MenageRole : System.Web.UI.Page\r
-       {\r
-               String role;\r
-               protected void Page_Load (object sender, EventArgs e)\r
-               {\r
-                       role = Request.QueryString["Role"];\r
-                       if (!Roles.RoleExists (role)) {\r
-                               Server.Transfer ("Error.aspx");\r
-                       }\r
-                       role_lbl.Text = role;\r
-                       Button bt = Master.FindControl ("Back") as Button;\r
-                       if (bt != null) {\r
-                               bt.PostBackUrl = "CreateRole.aspx";\r
-                       }\r
-               }\r
-\r
-               protected override void OnPreRender (EventArgs e)\r
-               {\r
-                       Roles_gv.DataBind ();\r
-                       base.OnPreRender (e);\r
-               }\r
-\r
-               public void CheckBox_CheckedChanged (object sender, EventArgs e)\r
-               {\r
-                       string user = ((GridCheckBox) sender).User;\r
-                       if (((GridCheckBox) sender).Checked) {\r
-                               try {\r
-                                       Roles.AddUserToRole (user, role);\r
-                               }\r
-                               catch { \r
-                               }\r
-                       }\r
-                       else {\r
-                               try {\r
-                                       Roles.RemoveUserFromRole (user, role);\r
-                               }\r
-                               catch {\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageRole.aspx.designer.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageRole.aspx.designer.cs
deleted file mode 100644 (file)
index 08527bd..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:2.0.50727.42\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace Mainsoft.Web.AspnetConfig {\r
-    \r
-    public partial class MenageRole {\r
-        protected System.Web.UI.WebControls.Label role_lbl;\r
-        protected System.Web.UI.WebControls.DropDownList searchBy_dl;\r
-        protected System.Web.UI.WebControls.TextBox user_txt;\r
-        protected System.Web.UI.WebControls.Button searchUser_bt;\r
-        protected System.Web.UI.WebControls.GridView Roles_gv;\r
-        protected System.Web.UI.WebControls.ObjectDataSource ObjectDataSource1;\r
-    }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageUser.aspx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageUser.aspx
deleted file mode 100644 (file)
index e2a9f67..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-<%--\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>\r
-<%@ Page Language="C#" AutoEventWireup="true" EnableTheming="false" MasterPageFile="~/aspnetconfig/Util.Master" CodeBehind="ManageUser.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.ManageUser" %>\r
-<%@ Register tagprefix="custom" namespace="Mainsoft.Web.AspnetConfig" Assembly="Mainsoft.Web.AspnetConfig"  %>\r
-<%@ Register TagPrefix="custom" TagName="searcher" Src="~/Controls/Searcher.ascx" %>\r
-\r
-<asp:Content ContentPlaceHolderID="SiteMapLinks" runat="server">\r
-<td><a class="SiteMap" href="Default.aspx" title="Home page" runat="server">Home</a></td>\r
-<td> >> </td>\r
-<td style="color: #333333">Manage user</td>\r
-</asp:Content>\r
-<asp:Content runat="server" ID="main" ContentPlaceHolderID="Main">\r
-<asp:MultiView ID="mv" ActiveViewIndex="0" runat="server">\r
-<asp:View ID="manage" runat="server" >\r
-    <table class="maintable">\r
-       <tr>\r
-            <td colspan="2" width="100%" style="height: 21px">\r
-             Click Edit User to view or change the user's password or other properties. To assign roles to the selected user, select the appropriate check boxes on the right. To prevent users from logging in to your application while retaining their information in your database, set the status to inactive by clearing the check box. \r
-             <br /> <br /> <br /> \r
-            </td>\r
-       </tr>\r
-       <tr>\r
-            <td width= "100%" valign="top" style="height: 360px">\r
-                <table width="100%" class="innertable" >\r
-                    <tr>\r
-                        <td width="100%" colspan="2" class="controlheader">\r
-                            Search for Users\r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td colspan="2">\r
-                            Search by : &nbsp; &nbsp; \r
-                            <asp:DropDownList ID="searchBy_lbx" runat="server">\r
-                                <asp:ListItem Selected="True" Value="Name">User Name</asp:ListItem>\r
-                                <asp:ListItem Value="Mail">E-Mail</asp:ListItem> \r
-                            </asp:DropDownList> &nbsp; &nbsp;<asp:TextBox ID="user_txt" runat="server"></asp:TextBox>\r
-                            &nbsp;\r
-                            <asp:Button ID="searchUser_bt" runat="server" Text="Search" /> <br />\r
-                            Wildcard characters * and ? are permitted. <br /><br />\r
-                        </td>\r
-                    </tr>\r
-                    <tr>\r
-                        <td width= "70%" valign="top" > \r
-                            <asp:GridView ID="Roles_gv" runat="server" CellPadding="4" DataSourceID="ObjectDataSource1" ForeColor="#333333" GridLines="None" Width="100%" AutoGenerateColumns="False" AllowPaging="True" PageSize="5" DataKeyNames="User" >\r
-                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />\r
-                                <Columns>\r
-                                    <asp:TemplateField HeaderText="Active">\r
-                                        <ItemTemplate>\r
-                                            <custom:GridCheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Active") %>' AutoPostBack="true" \r
-                                             OnCheckedChanged="CheckBox_CheckedChanged" User='<%# Bind("User") %>' />\r
-                                        </ItemTemplate>\r
-                                        <HeaderStyle HorizontalAlign="Left" />\r
-                                    </asp:TemplateField>\r
-                                    <asp:BoundField DataField="User" HeaderText="User Name" >\r
-                                        <HeaderStyle HorizontalAlign="Left" />\r
-                                    </asp:BoundField>\r
-                                    <asp:TemplateField>\r
-                                        <ItemTemplate>\r
-                                            <asp:HyperLink NavigateUrl='<%# string.Format("EditUser.aspx?User={0}", HttpUtility.UrlEncode((string)Eval("User"))) %>'\r
-                                                Text="Edit User" runat="server" />\r
-                                        </ItemTemplate>\r
-                                    </asp:TemplateField>\r
-                                    <asp:TemplateField ShowHeader="False">\r
-                                    <ItemTemplate>\r
-                                          <custom:GridButton ID="GridButton1" runat="server" User='<%# Bind("User") %>' OnClick="Delete_Click" >Delete User</custom:GridButton>\r
-                                    </ItemTemplate>\r
-                                    </asp:TemplateField>\r
-                                    <asp:TemplateField>\r
-                                        <ItemTemplate>\r
-                                            <custom:GridButton ID="grid_btn" runat="server" User='<%# Bind("User") %>' OnClick="gridbtn_click" OnLoad="gridbtn_load">Edit roles</custom:GridButton>\r
-                                        </ItemTemplate>\r
-                                    </asp:TemplateField>\r
-                                </Columns>\r
-                                <RowStyle BackColor="#EFF3FB" />\r
-                                <EditRowStyle BackColor="#2461BF" />\r
-                                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />\r
-                                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />\r
-                                <HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em"\r
-                                    ForeColor="White" HorizontalAlign="Center" />\r
-                                <AlternatingRowStyle BackColor="White" />\r
-                            </asp:GridView>\r
-                            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="DeleteUser"\r
-                                SelectMethod="SelectUser" TypeName="Mainsoft.Web.AspnetConfig.RolesDS">\r
-                                <DeleteParameters>\r
-                                    <asp:Parameter Name="User" Type="String" />\r
-                                </DeleteParameters>\r
-                                <SelectParameters>\r
-                                    <asp:ControlParameter ControlID="user_txt" DefaultValue="&quot;&quot;" Name="searchtag"\r
-                                        PropertyName="Text" Type="String" />\r
-                                    <asp:ControlParameter ControlID="searchBy_lbx" DefaultValue="" Name="searchby" PropertyName="SelectedValue"\r
-                                        Type="String" />\r
-                                </SelectParameters>\r
-                            </asp:ObjectDataSource>\r
-                        </td>\r
-                        <td width="30%" valign="top">\r
-                            <custom:Searcher ID="srch" runat="server" />\r
-                        </td>\r
-                    </tr>\r
-                </table>\r
-                <br /><br />\r
-            </td> \r
-        </tr>\r
-        <tr>\r
-            <td colspan="2">\r
-                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="CreateUser.aspx">Create new user</asp:HyperLink>\r
-            </td>\r
-        </tr>\r
-    </table>\r
-    </asp:View>\r
-    <asp:View ID="quest" runat="server">\r
-    <table class="innertable" width="60%">\r
-        <tr>\r
-            <td style="height: 80px" valign="top">\r
-                <br />\r
-                <asp:Image runat="server" ID="Img" /> &nbsp;\r
-                Are you sure you want to delete the user: "<%= User_name %>"? <br />\r
-                All information for this user will be deleted, including the user name, the user's membership in roles, and any profile property values associated with this user. \r
-                <br /><br /><br />\r
-            </td>\r
-        </tr>\r
-        <tr>\r
-            <td align="right" style="background-color:inactivecaptiontext" >\r
-                <asp:Button ID="yes" runat="server" Text="Yes" style="width:50px" OnClick="Click_Yes" />\r
-                <asp:Button ID="no" runat="server" Text="No" style="width:50px" OnClick="Click_No" />\r
-            </td>\r
-        </tr>\r
-    </table>\r
-    </asp:View>\r
-    </asp:MultiView>\r
-</asp:Content>\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageUser.aspx.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageUser.aspx.cs
deleted file mode 100644 (file)
index 25a070c..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-\r
-\r
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-       public partial class ManageUser : System.Web.UI.Page\r
-       {\r
-               public string User_name\r
-               {\r
-                       get { return ViewState["User"] == null ? String.Empty : (string) ViewState["User"]; }\r
-                       set { ViewState["User"] = value; }\r
-               }\r
-\r
-               protected void Page_Load (object sender, EventArgs e)\r
-               {\r
-                       Button bt = Master.FindControl ("Back") as Button;\r
-                       if (bt != null) {\r
-                               bt.PostBackUrl = "Default.aspx";\r
-                       }\r
-               }\r
-\r
-               protected override void OnInit (EventArgs e)\r
-               {\r
-                       Img.ImageUrl = this.Page.ClientScript.GetWebResourceUrl (typeof (ManageUser), "Mainsoft.Web.AspnetConfig.resources.untitled.bmp");\r
-                       base.OnInit (e);\r
-               }\r
-\r
-               protected override void OnPreRender (EventArgs e)\r
-               {\r
-                       if (IsPostBack) {\r
-                               Roles_gv.DataBind ();\r
-                               if (mv.ActiveViewIndex == 1) {\r
-                                       ((Button) Master.FindControl ("Back")).Visible = false;\r
-                               }\r
-                               else {\r
-                                       ((Button) Master.FindControl ("Back")).Visible = true;\r
-                               }\r
-                       }\r
-                       base.OnPreRender (e);\r
-               }\r
-\r
-               public void CheckBox_CheckedChanged (object sender, EventArgs e)\r
-               {\r
-                       string user_name = ((GridCheckBox) sender).User;\r
-                       MembershipUser user = Membership.GetUser (user_name);\r
-                       if (((GridCheckBox) sender).Checked) {\r
-                               user.IsApproved = true;\r
-                               Membership.UpdateUser (user);\r
-                       }\r
-                       else {\r
-                               user.IsApproved = false;\r
-                               Membership.UpdateUser (user);\r
-                       }\r
-               }\r
-\r
-               protected void gridbtn_click (object sender, EventArgs e)\r
-               {\r
-                       srch.User = ((GridButton) sender).User;\r
-               }\r
-\r
-               protected void Roles_Changed (object sender, EventArgs e)\r
-               {\r
-                       String user_name = (string) ViewState["User_name"];\r
-                       if (((CheckBox) sender).Checked) {\r
-                               try {\r
-                                       Roles.AddUserToRole (user_name, ((CheckBox) sender).Text);\r
-                               }\r
-                               catch {\r
-                               }\r
-                       }\r
-                       else {\r
-                               try {\r
-                                       Roles.RemoveUserFromRole (user_name, ((CheckBox) sender).Text);\r
-                               }\r
-                               catch {\r
-                               }\r
-                       }\r
-               }\r
-               \r
-               protected void Click_No (object sender, EventArgs e)\r
-               {\r
-                       mv.ActiveViewIndex = 0;\r
-               }\r
-\r
-               protected void Click_Yes (object sender, EventArgs e)\r
-               {\r
-                       RolesDS.DeleteUser (User_name);\r
-                       //Roles_gv.DataBind ();\r
-                       mv.ActiveViewIndex = 0;\r
-               }\r
-\r
-               protected void Delete_Click (object sender, EventArgs e)\r
-               {\r
-                       User_name = ((GridButton) sender).User;\r
-                       mv.ActiveViewIndex = 1;\r
-               }\r
-\r
-               protected void gridbtn_load (object sender, EventArgs e)\r
-               {\r
-                       if (!Roles.Enabled) {\r
-                               ((GridButton)sender).Enabled = false;\r
-                       }\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageUser.aspx.designer.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/ManageUser.aspx.designer.cs
deleted file mode 100644 (file)
index 33dab35..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:2.0.50727.42\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace Mainsoft.Web.AspnetConfig {\r
-    \r
-    public partial class ManageUser {\r
-        protected System.Web.UI.WebControls.MultiView mv;\r
-        protected System.Web.UI.WebControls.View manage;\r
-        protected System.Web.UI.WebControls.DropDownList searchBy_lbx;\r
-        protected System.Web.UI.WebControls.TextBox user_txt;\r
-        protected System.Web.UI.WebControls.Button searchUser_bt;\r
-        protected System.Web.UI.WebControls.GridView Roles_gv;\r
-        protected System.Web.UI.WebControls.ObjectDataSource ObjectDataSource1;\r
-        protected Mainsoft.Web.AspnetConfig.Searcher srch;\r
-        protected System.Web.UI.WebControls.HyperLink HyperLink1;\r
-        protected System.Web.UI.WebControls.View quest;\r
-        protected System.Web.UI.WebControls.Image Img;\r
-        protected System.Web.UI.WebControls.Button yes;\r
-        protected System.Web.UI.WebControls.Button no;\r
-    }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/RolesDS.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/RolesDS.cs
deleted file mode 100644 (file)
index 4b5949a..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-// Mainsoft.Web.AspnetConfig - Site AspnetConfig utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-\r
-\r
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-using System.Text.RegularExpressions;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-    public class RolesDS\r
-    {\r
-        public static DataTable Select()\r
-        {\r
-            return CreateDataTable();\r
-        }\r
-\r
-        public static DataTable SelectUser()\r
-        {\r
-            return CreateUserDataTable();\r
-        }\r
-\r
-        public static DataTable SelectUser(string searchtag, string searchby)\r
-        {\r
-            return CreateUserDataTable(searchtag, searchby);\r
-        }\r
-\r
-        public static DataTable SelectUsersRole(string user)\r
-        {\r
-            return CreateUsersRoles(user);\r
-        }\r
-\r
-        public static DataTable CreateUsersRoles(string user)\r
-        {\r
-            DataTable aTable = new DataTable("A");\r
-            DataColumn dtCol;\r
-            DataColumn dtCol1;\r
-            DataRow dtRow;\r
-\r
-\r
-            // Create User Name column and add to the table\r
-            dtCol = new DataColumn();\r
-            dtCol.DataType = Type.GetType("System.String");\r
-            dtCol.ColumnName = "Role";\r
-            dtCol.AutoIncrement = false;\r
-            dtCol.ReadOnly = false;\r
-            dtCol.Unique = true;\r
-            aTable.Columns.Add(dtCol);\r
-\r
-            dtCol1 = new DataColumn();\r
-            dtCol1.DataType = Type.GetType("System.Boolean");\r
-            dtCol1.ColumnName = "IsInRole";\r
-            dtCol1.AutoIncrement = false;\r
-            dtCol1.ReadOnly = false;\r
-            dtCol1.Unique = false;\r
-            aTable.Columns.Add(dtCol1);\r
-\r
-           if (Roles.Enabled) {\r
-                   // Create rows to the table\r
-                   foreach (String role in Roles.GetAllRoles ()) {\r
-                           dtRow = aTable.NewRow ();\r
-                           dtRow["Role"] = role;\r
-                           dtRow["IsInRole"] = Roles.IsUserInRole (user, role);\r
-                           aTable.Rows.Add (dtRow);\r
-                   }\r
-           }\r
-            aTable.PrimaryKey = new DataColumn[] { aTable.Columns["Role"] };\r
-            return aTable;\r
-        }\r
-\r
-        public static DataTable Delete(string Role)\r
-        {\r
-            if (Roles.RoleExists(Role))\r
-            {\r
-                Roles.DeleteRole(Role,false);\r
-            }\r
-            return Select();\r
-        }\r
-\r
-        public static DataTable DeleteUser(string User)\r
-        {\r
-            Membership.DeleteUser(User, true);\r
-            return SelectUser();\r
-        }\r
-\r
-        public static DataTable CreateUserDataTable()\r
-        {\r
-            DataTable aTable = new DataTable("A");\r
-            DataColumn dtCol;\r
-            DataColumn dtCol1;\r
-            DataRow dtRow;\r
-\r
-            // Create User Name column and add to the table\r
-            dtCol = new DataColumn();\r
-            dtCol.DataType = Type.GetType("System.String");\r
-            dtCol.ColumnName = "User";\r
-            dtCol.AutoIncrement = false;\r
-            dtCol.ReadOnly = false;\r
-            dtCol.Unique = true;\r
-            aTable.Columns.Add(dtCol);\r
-\r
-            dtCol1 = new DataColumn();\r
-            dtCol1.DataType = Type.GetType("System.Boolean");\r
-            dtCol1.ColumnName = "Active";\r
-            dtCol1.AutoIncrement = false;\r
-            dtCol1.ReadOnly = false;\r
-            dtCol1.Unique = false;\r
-            aTable.Columns.Add(dtCol1);\r
-\r
-            // Create rows to the table\r
-            foreach (MembershipUser user in Membership.GetAllUsers())\r
-            {\r
-                dtRow = aTable.NewRow();\r
-                dtRow["User"] = user.UserName;\r
-                dtRow["Active"] = user.IsApproved;\r
-                aTable.Rows.Add(dtRow);\r
-            }\r
-\r
-            aTable.PrimaryKey = new DataColumn[] { aTable.Columns["User"] };\r
-            return aTable;\r
-        }\r
-\r
-        public static DataTable CreateUserDataTable(string searchtag, string searchby)\r
-        {\r
-            DataTable aTable = new DataTable("A");\r
-            DataColumn dtCol;\r
-            DataColumn dtCol1;\r
-            DataRow dtRow;\r
-\r
-            dtCol = new DataColumn();\r
-            dtCol.DataType = Type.GetType("System.String");\r
-            dtCol.ColumnName = "User";\r
-            dtCol.AutoIncrement = false;\r
-            dtCol.ReadOnly = false;\r
-            dtCol.Unique = true;\r
-            aTable.Columns.Add(dtCol);\r
-\r
-            dtCol1 = new DataColumn();\r
-            dtCol1.DataType = Type.GetType("System.Boolean");\r
-            dtCol1.ColumnName = "Active";\r
-            dtCol1.AutoIncrement = false;\r
-            dtCol1.ReadOnly = false;\r
-            dtCol1.Unique = false;\r
-            aTable.Columns.Add(dtCol1);\r
-\r
-            string text = searchtag;\r
-            text = text.Replace("*", "%");\r
-            text = text.Replace("?", "_");\r
-\r
-            if (text.Trim() == "\"\"")\r
-                text = "%";\r
-\r
-            if (searchby == "Name")\r
-            {\r
-                foreach (MembershipUser user in Membership.FindUsersByName(text))\r
-                {\r
-                    dtRow = aTable.NewRow();\r
-                    dtRow["User"] = user.UserName;\r
-                    dtRow["Active"] = user.IsApproved;\r
-                    aTable.Rows.Add(dtRow);\r
-                }\r
-            }\r
-            else // Mail\r
-            {\r
-                foreach (MembershipUser user in Membership.FindUsersByEmail(text))\r
-                {\r
-                    dtRow = aTable.NewRow();\r
-                    dtRow["User"] = user.UserName;\r
-                    dtRow["Active"] = user.IsApproved;\r
-                    aTable.Rows.Add(dtRow);\r
-                }\r
-            }\r
-            \r
-            aTable.PrimaryKey = new DataColumn[] { aTable.Columns["User"] };\r
-            return aTable;\r
-        }\r
-\r
-        public static DataTable CreateDataTable()\r
-        {\r
-            DataTable aTable = new DataTable("A");\r
-            DataColumn dtCol;\r
-            DataRow dtRow;\r
-\r
-            // Create Name column and add to the table\r
-            dtCol = new DataColumn();\r
-            dtCol.DataType = Type.GetType("System.String");\r
-            dtCol.ColumnName = "Role";\r
-            dtCol.AutoIncrement = false;\r
-            dtCol.Caption = "Role Name";\r
-            dtCol.ReadOnly = false;\r
-            dtCol.Unique = false;\r
-            aTable.Columns.Add(dtCol);\r
-\r
-           if (Roles.Enabled) {\r
-                   // Create rows to the table\r
-                   foreach (string str in Roles.GetAllRoles ()) {\r
-                           dtRow = aTable.NewRow ();\r
-                           dtRow["Role"] = str;\r
-                           aTable.Rows.Add (dtRow);\r
-                   }\r
-           }\r
-\r
-            aTable.PrimaryKey = new DataColumn[] { aTable.Columns["Role"] };\r
-            return aTable;\r
-        }\r
-\r
-        public static DataTable CreateManageRoleTable(string role, string searchtag, string searchby)\r
-        {\r
-            DataTable aTable = new DataTable("A");\r
-            DataColumn dtCol;\r
-            DataColumn dtCol1;\r
-            DataRow dtRow;\r
-\r
-            // Create UserName column and add to the table\r
-            dtCol = new DataColumn();\r
-            dtCol.DataType = Type.GetType("System.String");\r
-            dtCol.ColumnName = "User";\r
-            dtCol.AutoIncrement = false;\r
-            dtCol.Caption = "User Name";\r
-            dtCol.ReadOnly = false;\r
-            dtCol.Unique = true;\r
-            aTable.Columns.Add(dtCol);\r
-\r
-            // Create User in role bool column and add to the table\r
-            dtCol1 = new DataColumn();\r
-            dtCol1.DataType = Type.GetType("System.Boolean");\r
-            dtCol1.ColumnName = "InRole";\r
-            dtCol1.AutoIncrement = false;\r
-            dtCol1.Caption = "User Is In Role";\r
-            dtCol1.ReadOnly = false;\r
-            dtCol1.Unique = false;\r
-            aTable.Columns.Add(dtCol1);\r
-\r
-            string text = searchtag;\r
-            text = text.Replace("*", "%");\r
-            text = text.Replace("?", "_");\r
-\r
-            if (text.Trim() == "\"\"")\r
-                text = "%";\r
-\r
-            if (searchby == "Name")\r
-            {\r
-                foreach (MembershipUser user in Membership.FindUsersByName(text))\r
-                {\r
-                    dtRow = aTable.NewRow();\r
-                    dtRow["User"] = user.UserName;\r
-                   if (Roles.Enabled) {\r
-                           dtRow["InRole"] = Roles.IsUserInRole (user.UserName, role);\r
-                   }\r
-                   else {\r
-                           dtRow["InRole"] = false;\r
-                   }\r
-                    aTable.Rows.Add(dtRow);\r
-                }\r
-            }\r
-            else // Mail\r
-            {\r
-                foreach (MembershipUser user in Membership.FindUsersByEmail(text))\r
-                {\r
-                    dtRow = aTable.NewRow();\r
-                    dtRow["User"] = user.UserName;\r
-                   if (Roles.Enabled) {\r
-                           dtRow["InRole"] = Roles.IsUserInRole (user.UserName, role);\r
-                   }\r
-                   else {\r
-                           dtRow["InRole"] = false;\r
-                   }\r
-                    aTable.Rows.Add(dtRow);\r
-                }\r
-            }\r
-            aTable.PrimaryKey = new DataColumn[] { aTable.Columns["User"] };\r
-            return aTable;\r
-        }\r
-    }\r
-}\r
-\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/SecurError.aspx b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/SecurError.aspx
deleted file mode 100644 (file)
index 04d64d7..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<%--\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>\r
-<%@ Page Language="C#" AutoEventWireup="true" Theme="" StylesheetTheme="" CodeBehind="SecurError.aspx.cs" Inherits="Mainsoft.Web.AspnetConfig.SecurError" %>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-\r
-<html xmlns="http://www.w3.org/1999/xhtml" >\r
-<head runat="server">\r
-    <title>ASP.Net Web Application Administration</title>\r
-</head>\r
-<body>\r
-    <form id="form1" runat="server">\r
-    <div style="font-weight: bold; font-size: 11pt;">\r
-        By default, the Web Site Administration Tool may only be accessed locally. \r
-        To enable accessing it from a remote computer, open the Web.config file, add the key <br />\r
-        allowRemoteConfiguration to the appSettings section, and set its value to true: <br />\r
-        <pre>\r
-        &lt appSettings &gt \r
-              &lt/ add key="allowRemoteConfiguration" value="True" /&gt \r
-        &lt/ appSettings &gt\r
-        </pre>\r
-    </div>\r
-    </form>\r
-</body>\r
-</html>\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/SecurError.aspx.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/SecurError.aspx.cs
deleted file mode 100644 (file)
index 8b2a60b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.WebControls.WebParts;\r
-using System.Web.UI.HtmlControls;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-       public partial class SecurError : System.Web.UI.Page\r
-       {\r
-               protected void Page_Load (object sender, EventArgs e)\r
-               {\r
-\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/SecurError.aspx.designer.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/SecurError.aspx.designer.cs
deleted file mode 100644 (file)
index 8771cea..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:2.0.50727.42\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace Mainsoft.Web.AspnetConfig {\r
-    \r
-    public partial class SecurError {\r
-        protected System.Web.UI.HtmlControls.HtmlForm form1;\r
-    }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/StrUtils.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/StrUtils.cs
deleted file mode 100644 (file)
index debcf68..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-//\r
-// System.Web.Util.StrUtils\r
-//\r
-// Author(s):\r
-//  Gonzalo Paniagua Javier (gonzalo@ximian.com)\r
-//\r
-// (C) 2005 Novell, Inc, (http://www.novell.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Globalization;\r
-using System.Text;\r
-\r
-namespace Mainsoft.Web.Util\r
-{\r
-       internal sealed class StrUtils {\r
-               static CultureInfo invariant = CultureInfo.InvariantCulture;\r
-               private StrUtils () { }\r
-               \r
-               public static bool StartsWith (string str1, string str2)\r
-               {\r
-                       return StartsWith (str1, str2, false);\r
-               }\r
-\r
-               public static bool StartsWith (string str1, string str2, bool ignore_case)\r
-               {\r
-                       int l2 = str2.Length;\r
-                       if (l2 == 0)\r
-                               return true;\r
-\r
-                       int l1 = str1.Length;\r
-                       if (l2 > l1)\r
-                               return false;\r
-\r
-                       return (0 == String.Compare (str1, 0, str2, 0, l2, ignore_case, invariant));\r
-               }\r
-\r
-               public static bool EndsWith (string str1, string str2)\r
-               {\r
-                       return EndsWith (str1, str2, false);\r
-               }\r
-\r
-               public static bool EndsWith (string str1, string str2, bool ignore_case)\r
-               {\r
-                       int l2 = str2.Length;\r
-                       if (l2 == 0)\r
-                               return true;\r
-\r
-                       int l1 = str1.Length;\r
-                       if (l2 > l1)\r
-                               return false;\r
-\r
-                       return (0 == String.Compare (str1, l1 - l2, str2, 0, l2, ignore_case, invariant));\r
-               }\r
-\r
-               public static string EscapeQuotesAndBackslashes (string attributeValue)\r
-               {\r
-                       StringBuilder sb = null;\r
-                       for (int i = 0; i < attributeValue.Length; i++) {\r
-                               char ch = attributeValue [i];\r
-                               if (ch == '\'' || ch == '"' || ch == '\\') {\r
-                                       if (sb == null) {\r
-                                               sb = new StringBuilder ();\r
-                                               sb.Append (attributeValue.Substring (0, i));\r
-                                       }\r
-                                       sb.Append ('\\');\r
-                                       sb.Append (ch);\r
-                               }\r
-                               else {\r
-                                       if (sb != null)\r
-                                               sb.Append (ch);\r
-                               }\r
-                       }\r
-                       if (sb != null)\r
-                               return sb.ToString ();\r
-                       return attributeValue;\r
-               }\r
-       }\r
-}\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/UrlUtils.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/UrlUtils.cs
deleted file mode 100644 (file)
index f8aa0a2..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-//
-// System.Web.UrlUtils.cs 
-//
-// Authors:
-//     Gonzalo Paniagua (gonzalo@ximian.com)
-//      Jackson Harper   (jackson@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.Web.SessionState;
-using System.Web;
-using System;
-
-namespace Mainsoft.Web.Util {
-       
-       internal class UrlUtils {
-
-               // appRoot + SessionID + vpath
-               internal static string InsertSessionId (string id, string path)
-               {
-                       string dir = GetDirectory (path);
-                       if (!dir.EndsWith ("/"))
-                               dir += "/";
-
-                       string appvpath = HttpRuntime.AppDomainAppVirtualPath;
-                       if (!appvpath.EndsWith ("/"))
-                               appvpath += "/";
-
-                       if (path.StartsWith (appvpath))
-                               path = path.Substring (appvpath.Length);
-
-                       if (path [0] == '/')
-                               path = path.Length > 1 ? path.Substring (1) : "";
-
-                       return Canonic (appvpath + "(" + id + ")/" + path);
-               }
-#if false
-               internal static string GetSessionId (string path)
-               {
-                       string appvpath = HttpRuntime.AppDomainAppVirtualPath;
-                       if (path.Length <= appvpath.Length)
-                               return null;
-
-                       path = path.Substring (appvpath.Length);
-                       if (path.Length == 0 || path [0] != '/')
-                               path = '/' + path;
-
-                       int len = path.Length;
-                       if ((len < SessionId.IdLength + 3) || (path [1] != '(') ||
-                           (path [SessionId.IdLength + 2] != ')'))
-                               return null;
-
-                       return path.Substring (2, SessionId.IdLength);
-               }
-#endif
-               internal static string RemoveSessionId (string base_path, string file_path)
-               {
-                       // Caller did a GetSessionId first
-                       int idx = base_path.IndexOf ("/(");
-                       string dir = base_path.Substring (0, idx + 1);
-                       if (!dir.EndsWith ("/"))
-                               dir += "/";
-
-                       idx = base_path.IndexOf (")/");
-                       if (idx != -1 && base_path.Length > idx + 2) {
-                               string dir2 = base_path.Substring (idx + 2);
-                               if (!dir2.EndsWith ("/"))
-                                       dir2 += "/";
-
-                               dir += dir2;
-                       }
-
-                       return Canonic (dir + GetFile (file_path));
-               }
-
-               public static string Combine (string basePath, string relPath)
-               {
-                       if (relPath == null)
-                               throw new ArgumentNullException ("relPath");
-
-                       int rlength = relPath.Length;
-                       if (rlength == 0)
-                               return "";
-
-                       relPath = relPath.Replace ("\\", "/");
-                       if (IsRooted (relPath))
-                               return Canonic (relPath);
-
-                       char first = relPath [0];
-                       if (rlength < 3 || first == '~' || first == '/' || first == '\\') {
-                               if (basePath == null || (basePath.Length == 1 && basePath [0] == '/'))
-                                       basePath = String.Empty;
-
-                               string slash = (first == '/') ? "" : "/";
-                               if (first == '~') {
-                                       if (rlength == 1) {
-                                               relPath = "";
-                                       } else if (rlength > 1 && relPath [1] == '/') {
-                                               relPath = relPath.Substring (2);
-                                               slash = "/";
-                                       }
-
-                                       string appvpath = HttpRuntime.AppDomainAppVirtualPath;
-                                       if (appvpath.EndsWith ("/"))
-                                               slash = "";
-
-                                       return Canonic (appvpath + slash + relPath);
-                               }
-
-                               return Canonic (basePath + slash + relPath);
-                       }
-
-                       if (basePath == null || basePath == "" || basePath [0] == '~')
-                               basePath = HttpRuntime.AppDomainAppVirtualPath;
-
-                       if (basePath.Length <= 1)
-                               basePath = String.Empty;
-
-                       return Canonic (basePath + "/" + relPath);
-               }
-
-               static char [] path_sep = {'\\', '/'};
-               
-               internal static string Canonic (string path)
-               {
-                       string [] parts = path.Split (path_sep);
-                       int end = parts.Length;
-                       
-                       int dest = 0;
-                       
-                       for (int i = 0; i < end; i++) {
-                               string current = parts [i];
-                               if (current == "." )
-                                       continue;
-
-                               if (current == "..") {
-                                       if (dest == 0) {
-                                               if (i == 1) // see bug 52599
-                                                       continue;
-
-                                               throw new HttpException ("Invalid path.");
-                                       }
-
-                                       dest --;
-                                       continue;
-                               }
-
-                               parts [dest++] = current;
-                       }
-
-                       if (dest == 0)
-                               return "/";
-
-                       return String.Join ("/", parts, 0, dest);
-               }
-               
-               internal static string GetDirectory (string url)
-               {
-                       url = url.Replace('\\','/');
-                       int last = url.LastIndexOf ('/');
-
-                       if (last > 0) {
-                               return RemoveDoubleSlashes (url.Substring (0, last));
-                       }
-
-                       return "/";
-               }
-
-               internal static string RemoveDoubleSlashes (string input)
-               {
-                       // MS VirtualPathUtility removes duplicate '/'
-                       string str = input;
-                       string x;
-                       while ((x = str.Replace ("//", "/")) != str) {
-                               str = x;
-                       }
-
-                       return str;
-               }
-
-               internal static string GetFile (string url)
-               {
-                       url = url.Replace('\\','/');
-                       int last = url.LastIndexOf ('/');
-                       if (last >= 0) {
-                               if (url.Length == 1) // Empty file name instead of ArgumentOutOfRange
-                                       return "";
-                               return url.Substring (last+1);
-                       }
-
-                       throw new Exception (String.Format ("GetFile: `{0}' does not contain a /", url));
-               }
-               
-               internal static bool IsRooted (string path)
-               {
-                       if (path == null || path == "")
-                               return true;
-
-                       char c = path [0];
-                       if (c == '/' || c == '\\')
-                               return true;
-
-                       return false;
-               }
-
-               internal static bool IsRelativeUrl (string path)
-               {
-                       return (path [0] != '/' && path.IndexOf (':') == -1);
-               }
-
-                public static string ResolveVirtualPathFromAppAbsolute (string path)
-                {
-                        if (path [0] != '~') return path;
-                                
-                        if (path.Length == 1)
-                                return HttpRuntime.AppDomainAppVirtualPath;
-
-                        if (path [1] == '/' || path [1] == '\\') {
-                                string appPath = HttpRuntime.AppDomainAppVirtualPath;
-                                if (appPath.Length > 1) 
-                                        return appPath + "/" + path.Substring (2);
-                                return "/" + path.Substring (2);
-                        }
-                        return path;    
-                }
-
-                public static string ResolvePhysicalPathFromAppAbsolute (string path) 
-                {
-                        if (path [0] != '~') return path;
-
-                        if (path.Length == 1)
-                                return HttpRuntime.AppDomainAppPath;
-
-                        if (path [1] == '/' || path [1] == '\\') {
-                                string appPath = HttpRuntime.AppDomainAppPath;
-                                if (appPath.Length > 1)
-                                        return appPath + "/" + path.Substring (2);
-                                return "/" + path.Substring (2);
-                        }
-                        return path;
-                }
-       }
-}
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Util.Master b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Util.Master
deleted file mode 100644 (file)
index baf3a65..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-<%--\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// Authors:\r
-//  Klain Yoni <yonik@mainsoft.com>\r
-//\r
-// Mainsoft.Web.AspnetConfig - Site administration utility\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --%>\r
-<%@ Master Language="C#" AutoEventWireup="true" EnableTheming="false" CodeBehind="Util.master.cs" Inherits="Mainsoft.Web.AspnetConfig.Util" %>\r
-<%@ Register TagPrefix="Custom" Namespace="Mainsoft.Web.AspnetConfig" Assembly="Mainsoft.Web.AspnetConfig" %>\r
-\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-\r
-<html xmlns="http://www.w3.org/1999/xhtml" >\r
-<head id="Head1" runat="server">\r
-    <link href="<%= Page.ClientScript.GetWebResourceUrl (typeof(Util), "Mainsoft.Web.AspnetConfig.aspnetconfig.Mainsoft.Web.AspnetConfig.css") %>" rel="stylesheet" type="text/css" />\r
-    <title>ASP.Net Web Application Administration</title>\r
-    <style type="text/css">\r
-        A.SiteMap:visited { color: #507CD1; }\r
-    </style>\r
-</head>\r
-<body>\r
-    <form id="form1" runat="server">\r
-    <div>\r
-    <table width="100%">\r
-    <tr>\r
-        <td>\r
-            &nbsp;&nbsp;\r
-        </td>\r
-    </tr>\r
-    <tr>\r
-        <td class="h1">\r
-            Web Site Administration Tool\r
-        </td>\r
-    </tr>\r
-    <tr>\r
-        <td> \r
-        <table class="bordredtable">\r
-            <tr style="background-color:">\r
-                <td style="background-color: lightblue">\r
-                <table cellpadding="0" cellspacing="0">\r
-                    <tr>\r
-                        <td>Current page : &nbsp;</td>\r
-                        <td style="font-family: Verdana; font-size: 0.8em; color: #507CD1; font-weight:bold;">\r
-                            <table>\r
-                                <tr>\r
-                                    <asp:ContentPlaceHolder ID="SiteMapLinks" runat="server"></asp:ContentPlaceHolder>\r
-                                </tr>\r
-                            </table>\r
-                        </td>\r
-                    </tr>\r
-                </table>\r
-                </td>\r
-            </tr>\r
-            <tr>\r
-                <td width="100%" valign="top">\r
-                    <asp:ContentPlaceHolder ID="Main" runat="server">\r
-                    </asp:ContentPlaceHolder>\r
-                </td>\r
-            </tr>\r
-            <tr>\r
-                <td align="right">\r
-                    <asp:Button ID="Back" runat="server" Text="Back" />\r
-                    <%--style="padding-right: 1px; padding-left: 1px; font-weight: bold; padding-bottom: 1px; margin: 1px; color: yellow; padding-top: 1px; background-color: #6699ff"--%>\r
-                </td>\r
-            </tr>\r
-        </table>    \r
-        </td>\r
-    </tr>\r
-    </table>\r
-    </div>\r
-    </form>\r
-</body>\r
-</html>\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Util.Master.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Util.Master.cs
deleted file mode 100644 (file)
index cda1f01..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;\r
-using System.Resources;\r
-using System.Data;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Web;\r
-using System.Web.Security;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.UI.HtmlControls;\r
-\r
-namespace Mainsoft.Web.AspnetConfig\r
-{\r
-       public partial class Util : System.Web.UI.MasterPage\r
-       {\r
-               bool allowRemoteConfiguration  // Default is false\r
-               {\r
-                       get\r
-                       {\r
-                               if (System.Configuration.ConfigurationSettings.AppSettings["allowRemoteConfiguration"] != null) {\r
-                                       return bool.Parse (System.Configuration.ConfigurationSettings.AppSettings["allowRemoteConfiguration"]);\r
-                               }\r
-                               else {\r
-                                       return false;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public String Backurl\r
-               {\r
-                       get { return ViewState["BackUrl"] == null ? String.Empty : (string) ViewState["BackUrl"]; }\r
-                       set { ViewState["BackUrl"] = value; }\r
-               }\r
-\r
-               protected override void OnInit (EventArgs e)\r
-               {\r
-                       if (!(allowRemoteConfiguration || Request.IsLocal)) {\r
-                               Server.Transfer ("~/aspnetconfig/SecurError.aspx");\r
-                       }\r
-\r
-\r
-                       base.OnInit (e);\r
-               }\r
-\r
-               protected void Page_Load (object sender, EventArgs e)\r
-               {\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Util.Master.designer.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/aspnetconfig/Util.Master.designer.cs
deleted file mode 100644 (file)
index 5b69586..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:2.0.50727.42\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace Mainsoft.Web.AspnetConfig {\r
-    \r
-    public partial class Util {\r
-        protected System.Web.UI.HtmlControls.HtmlHead Head1;\r
-        protected System.Web.UI.HtmlControls.HtmlForm form1;\r
-        protected System.Web.UI.WebControls.ContentPlaceHolder SiteMapLinks;\r
-        protected System.Web.UI.WebControls.ContentPlaceHolder Main;\r
-        protected System.Web.UI.WebControls.Button Back;\r
-    }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/makefile.build b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/makefile.build
deleted file mode 100755 (executable)
index 8a930c5..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--Minimalistic buildfile -->\r
-<project name="Mainsoft.Web.AspnetConfig" default="all">\r
-<property name="ghroot"  value="${project::get-base-directory()}\..\..\..\..\.."/>\r
-  <!--Allways at the beginning-->\r
-  <include buildfile="${ghroot}\vsbuild\properties.xml" />\r
-\r
-  <!--MANDATORY SECTION-->\r
-\r
-  <!--Could be GH ANT .NET-->\r
-  <property name="projecttype" value=".NET2005"/>\r
-  <!--Could be RUNTIME TOOLS ... -->\r
-  <property name="rules" value="RUNTIME"/>\r
-\r
-  <property name="msbuild_file" value="Mainsoft.Web.AspnetConfig.csproj"/>\r
-  \r
-  <!--Fileset describing project output files. Uset by copy/delete rules in framework-->\r
-  <fileset id="output" basedir="${project::get-base-directory()}\bin" failonempty="true">\r
-       <include name="Mainsoft.Web.AspnetConfig.jar"/>\r
-       <include name="Mainsoft.Web.AspnetConfig.dll"/>\r
-  </fileset>\r
-\r
-  <!--END MANDATORY SECTION-->\r
-\r
- <!--OPTIONAL SECTION-->\r
-<!--\r
-  <target name="postbuild">\r
-          \r
-  </target>\r
--->\r
-  <!--\r
-  <property name="cvnsrc" value="svn://svn.myrealbox.com/source/trunk/mcs/<cvn_folder>"/>\r
-  <target name="prebuild">\r
-  Put something there if you need\r
-  </target>\r
-  -->\r
-  <!--END OPTIONAL SECTION-->\r
-\r
-\r
-  <!--Allways at the end-->\r
-  <include buildfile="${ghroot}\vsbuild\framework.xml" />\r
-</project>\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/nomd5 b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/nomd5
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/resources/mainsoft.jpg b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/resources/mainsoft.jpg
deleted file mode 100644 (file)
index 3bf0698..0000000
Binary files a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/resources/mainsoft.jpg and /dev/null differ
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/resources/untitled.bmp b/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/resources/untitled.bmp
deleted file mode 100644 (file)
index e92ef9f..0000000
Binary files a/mcs/class/Mainsoft.Web/Mainsoft.Web.AspnetConfig/resources/untitled.bmp and /dev/null differ
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/.gitattributes
deleted file mode 100644 (file)
index 2932b7b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/AbstractAttributeMap.cs -crlf
-/AspNetFacesContext.cs -crlf
-/BaseExternalContext.cs -crlf
-/BaseFacesPageHandlerFactory.cs -crlf
-/BaseFacesStateManager.cs -crlf
-/BaseFacesViewHandler.cs -crlf
-/IExtendedViewHandler.cs -crlf
-/OutputStreamWrapper.cs -crlf
-/RequestParameterMap.cs -crlf
-/RequestParameterValuesMap.cs -crlf
-/ServletFacesContext.cs -crlf
-/ServletFacesPageHandler.cs -crlf
-/ServletFacesPageHandlerFactory.cs -crlf
-/ServletFacesStateManager.cs -crlf
-/ServletFacesViewHandler.cs -crlf
-/ServletIncludeUtils.cs -crlf
-/ServletResourceLoader.cs -crlf
-/SessionWrapper.cs -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/AbstractAttributeMap.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/AbstractAttributeMap.cs
deleted file mode 100644 (file)
index 475b14d..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-//\r
-// Mainsoft.Web.Hosting.AbstractAttributeMap.cs\r
-//\r
-// Authors:\r
-//     Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-// (C) 2008 Mainsoft Co. (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using java.util;\r
-using System;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       partial class BaseExternalContext\r
-       {\r
-               public abstract class AbstractAttributeMap : AbstractMap\r
-               {\r
-                       private Set _keySet;\r
-                       private Collection _values;\r
-                       private Set _entrySet;\r
-\r
-                       public override void clear () {\r
-                               List names = new ArrayList ();\r
-                               for (Enumeration e = getAttributeNames (); e.hasMoreElements (); ) {\r
-                                       names.add (e.nextElement ());\r
-                               }\r
-\r
-                               for (Iterator it = names.iterator (); it.hasNext (); ) {\r
-                                       removeAttribute ((String) it.next ());\r
-                               }\r
-                       }\r
-\r
-                       public override bool containsKey (Object key) {\r
-                               return getAttribute (key.ToString ()) != null;\r
-                       }\r
-\r
-                       public override bool containsValue (Object findValue) {\r
-                               if (findValue == null) {\r
-                                       return false;\r
-                               }\r
-\r
-                               for (Enumeration e = getAttributeNames (); e.hasMoreElements (); ) {\r
-                                       Object value = getAttribute ((String) e.nextElement ());\r
-                                       if (findValue.Equals (value)) {\r
-                                               return true;\r
-                                       }\r
-                               }\r
-\r
-                               return false;\r
-                       }\r
-\r
-                       public override Set entrySet () {\r
-                               return (_entrySet != null) ? _entrySet : (_entrySet = new EntrySet (this));\r
-                       }\r
-\r
-                       public override Object get (Object key) {\r
-                               return getAttribute (key.ToString ());\r
-                       }\r
-\r
-                       public override bool isEmpty () {\r
-                               return !getAttributeNames ().hasMoreElements ();\r
-                       }\r
-\r
-                       public override Set keySet () {\r
-                               return (_keySet != null) ? _keySet : (_keySet = new KeySet (this));\r
-                       }\r
-\r
-                       public override Object put (Object key, Object value) {\r
-                               String key_ = key.ToString ();\r
-                               Object retval = getAttribute (key_);\r
-                               setAttribute (key_, value);\r
-                               return retval;\r
-                       }\r
-\r
-                       public override void putAll (Map t) {\r
-                               for (Iterator it = t.entrySet ().iterator (); it.hasNext (); ) {\r
-                                       Map.Entry entry = (Map.Entry) it.next ();\r
-                                       setAttribute (entry.getKey ().ToString (), entry.getValue ());\r
-                               }\r
-                       }\r
-\r
-                       public override Object remove (Object key) {\r
-                               String key_ = key.ToString ();\r
-                               Object retval = getAttribute (key_);\r
-                               removeAttribute (key_);\r
-                               return retval;\r
-                       }\r
-\r
-                       public override int size () {\r
-                               int size = 0;\r
-                               for (Enumeration e = getAttributeNames (); e.hasMoreElements (); ) {\r
-                                       size++;\r
-                                       e.nextElement ();\r
-                               }\r
-                               return size;\r
-                       }\r
-\r
-                       public override Collection values () {\r
-                               return (_values != null) ? _values : (_values = new Values (this));\r
-                       }\r
-\r
-\r
-                       abstract protected Object getAttribute (string key);\r
-\r
-                       abstract protected void setAttribute (string key, Object value);\r
-\r
-                       abstract protected void removeAttribute (string key);\r
-\r
-                       abstract protected Enumeration getAttributeNames ();\r
-\r
-\r
-                       private class KeySet : AbstractSet\r
-                       {\r
-                               protected readonly AbstractAttributeMap _owner;\r
-                               public KeySet (AbstractAttributeMap owner) {\r
-                                       _owner = owner;\r
-                               }\r
-\r
-                               public override Iterator iterator () {\r
-                                       return new KeyIterator (_owner);\r
-                               }\r
-\r
-                               public override bool isEmpty () {\r
-                                       return _owner.isEmpty ();\r
-                               }\r
-\r
-                               public override int size () {\r
-                                       return _owner.size ();\r
-                               }\r
-\r
-                               public override bool contains (Object o) {\r
-                                       return _owner.containsKey (o);\r
-                               }\r
-\r
-                               public override bool remove (Object o) {\r
-                                       return _owner.remove (o) != null;\r
-                               }\r
-\r
-                               public override void clear () {\r
-                                       _owner.clear ();\r
-                               }\r
-                       }\r
-\r
-                       private class KeyIterator : Iterator\r
-                       {\r
-                               protected readonly AbstractAttributeMap _owner;\r
-                               protected readonly Enumeration _e;\r
-\r
-                               public KeyIterator (AbstractAttributeMap owner) {\r
-                                       _owner = owner;\r
-                                       _e = _owner.getAttributeNames ();\r
-                               }\r
-\r
-                               protected Object _currentKey;\r
-\r
-                               public virtual void remove () {\r
-                                       // remove() may cause ConcurrentModificationException.\r
-                                       // We could throw an exception here, but not throwing an exception\r
-                                       //   allows one call to remove() to succeed\r
-                                       if (_currentKey == null) {\r
-                                               throw new NoSuchElementException (\r
-                                                       "You must call next() at least once");\r
-                                       }\r
-                                       _owner.remove (_currentKey);\r
-                               }\r
-\r
-                               public bool hasNext () {\r
-                                       return _e.hasMoreElements ();\r
-                               }\r
-\r
-                               public virtual Object next () {\r
-                                       return _currentKey = _e.nextElement ();\r
-                               }\r
-                       }\r
-\r
-                       private class Values : KeySet\r
-                       {\r
-\r
-                               public Values (AbstractAttributeMap owner)\r
-                                       : base (owner) {\r
-                               }\r
-\r
-                               public override Iterator iterator () {\r
-                                       return new ValuesIterator (_owner);\r
-                               }\r
-\r
-                               public override bool contains (Object o) {\r
-                                       return _owner.containsValue (o);\r
-                               }\r
-\r
-                               public override bool remove (Object o) {\r
-                                       if (o == null) {\r
-                                               return false;\r
-                                       }\r
-\r
-                                       for (Iterator it = iterator (); it.hasNext (); ) {\r
-                                               if (o.Equals (it.next ())) {\r
-                                                       it.remove ();\r
-                                                       return true;\r
-                                               }\r
-                                       }\r
-\r
-                                       return false;\r
-                               }\r
-                       }\r
-\r
-                       private class ValuesIterator : KeyIterator\r
-                       {\r
-                               public ValuesIterator (AbstractAttributeMap owner)\r
-                                       : base (owner) { }\r
-                               public override Object next () {\r
-                                       base.next ();\r
-                                       return _owner.get (_currentKey);\r
-                               }\r
-                       }\r
-\r
-                       private class EntrySet : KeySet\r
-                       {\r
-                               public EntrySet (AbstractAttributeMap owner) : base (owner) { }\r
-\r
-                               public override Iterator iterator () {\r
-                                       return new EntryIterator (_owner);\r
-                               }\r
-\r
-                               public override bool contains (Object o) {\r
-                                       if (!(o is Map.Entry)) {\r
-                                               return false;\r
-                                       }\r
-\r
-                                       Map.Entry entry = (Map.Entry) o;\r
-                                       Object key = entry.getKey ();\r
-                                       Object value = entry.getValue ();\r
-                                       if (key == null || value == null) {\r
-                                               return false;\r
-                                       }\r
-\r
-                                       return value.Equals (_owner.get (key));\r
-                               }\r
-\r
-                               public override bool remove (Object o) {\r
-                                       if (!(o is Map.Entry)) {\r
-                                               return false;\r
-                                       }\r
-\r
-                                       Map.Entry entry = (Map.Entry) o;\r
-                                       Object key = entry.getKey ();\r
-                                       Object value = entry.getValue ();\r
-                                       if (key == null || value == null\r
-                                               || !value.Equals (_owner.get (key))) {\r
-                                               return false;\r
-                                       }\r
-\r
-                                       return _owner.remove (((Map.Entry) o).getKey ()) != null;\r
-                               }\r
-                       }\r
-\r
-                       /**\r
-                        * Not very efficient since it generates a new instance of <code>Entry</code>\r
-                        * for each element and still internaly uses the <code>KeyIterator</code>.\r
-                        * It is more efficient to use the <code>KeyIterator</code> directly.\r
-                        */\r
-                       private class EntryIterator : KeyIterator\r
-                       {\r
-                               public EntryIterator (AbstractAttributeMap owner) : base (owner) { }\r
-                               public override Object next () {\r
-                                       base.next ();\r
-                                       // Must create new Entry every time--value of the entry must stay\r
-                                       // linked to the same attribute name\r
-                                       return new EntrySetEntry (_currentKey);\r
-                               }\r
-                       }\r
-\r
-                       private class EntrySetEntry : Map.Entry\r
-                       {\r
-                               readonly AbstractAttributeMap _owner;\r
-\r
-                               public EntrySetEntry (AbstractAttributeMap owner) {\r
-                                       _owner = owner;\r
-                               }\r
-\r
-                               private readonly Object _currentKey;\r
-\r
-                               public EntrySetEntry (Object currentKey) {\r
-                                       _currentKey = currentKey;\r
-                               }\r
-\r
-                               public Object getKey () {\r
-                                       return _currentKey;\r
-                               }\r
-\r
-                               public Object getValue () {\r
-                                       return _owner.get (_currentKey);\r
-                               }\r
-\r
-                               public Object setValue (Object value) {\r
-                                       return _owner.put (_currentKey, value);\r
-                               }\r
-\r
-                               public int hashCode () {\r
-                                       return _currentKey == null ? 0 : _currentKey.GetHashCode ();\r
-                               }\r
-\r
-                               public bool equals (Object obj) {\r
-                                       if (!(obj is EntrySetEntry))\r
-                                               return false;\r
-                                       return _currentKey != null && _currentKey.Equals (obj);\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-}
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/AspNetFacesContext.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/AspNetFacesContext.cs
deleted file mode 100644 (file)
index 5474dd0..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using javax.faces.context;\r
-using System.Web;\r
-using System.Web.UI;\r
-using javax.servlet;\r
-using javax.faces.lifecycle;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public abstract class AspNetFacesContext : FacesContext\r
-       {\r
-               readonly FacesContext _oldFacesContex;\r
-               readonly FacesContext _facesContex;\r
-               readonly HttpContext _httpContext;\r
-               readonly ExternalContext _externalContext;\r
-\r
-               public HttpContext Context {\r
-                       get { return _httpContext; }\r
-               }\r
-\r
-               protected AspNetFacesContext (FacesContext wrappedFacesContex, ExternalContext externalContext, HttpContext httpContext, FacesContext oldFacesContex) {\r
-                       _facesContex = wrappedFacesContex;\r
-                       _httpContext = httpContext;\r
-                       _oldFacesContex = oldFacesContex;\r
-                       _externalContext = externalContext;\r
-                       setCurrentInstance (this);\r
-               }\r
-\r
-               public bool IsProcessingInclude () {\r
-                       if (_oldFacesContex == null)\r
-                               return false;\r
-\r
-                       if (getViewRoot ().getChildCount () == 0)\r
-                               throw new InvalidOperationException ();\r
-\r
-                       Page page = (Page) getViewRoot ().getChildren ().get (0);\r
-                       return !page.IsPostBack;\r
-               }\r
-\r
-               public override void addMessage (string __p1, javax.faces.application.FacesMessage __p2) {\r
-                       _facesContex.addMessage (__p1, __p2);\r
-               }\r
-\r
-               public override javax.faces.application.Application getApplication () {\r
-                       return _facesContex.getApplication ();\r
-               }\r
-\r
-               public override java.util.Iterator getClientIdsWithMessages () {\r
-                       return _facesContex.getClientIdsWithMessages ();\r
-               }\r
-\r
-               public override ExternalContext getExternalContext () {\r
-                       return _externalContext;\r
-               }\r
-\r
-               public override javax.faces.application.FacesMessage.Severity getMaximumSeverity () {\r
-                       return _facesContex.getMaximumSeverity ();\r
-               }\r
-\r
-               public override java.util.Iterator getMessages (string __p1) {\r
-                       return _facesContex.getMessages (__p1);\r
-               }\r
-\r
-               public override java.util.Iterator getMessages () {\r
-                       return _facesContex.getMessages ();\r
-               }\r
-\r
-               public override javax.faces.render.RenderKit getRenderKit () {\r
-                       return _facesContex.getRenderKit ();\r
-               }\r
-\r
-               public override bool getRenderResponse () {\r
-                       return _facesContex.getRenderResponse ();\r
-               }\r
-\r
-               public override bool getResponseComplete () {\r
-                       return _facesContex.getResponseComplete ();\r
-               }\r
-\r
-               public override ResponseStream getResponseStream () {\r
-                       return _facesContex.getResponseStream ();\r
-               }\r
-\r
-               public override ResponseWriter getResponseWriter () {\r
-                       return _facesContex.getResponseWriter ();\r
-               }\r
-\r
-               public override javax.faces.component.UIViewRoot getViewRoot () {\r
-                       return _facesContex.getViewRoot ();\r
-               }\r
-\r
-               public override void release () {\r
-                       _facesContex.release ();\r
-                       FacesContext.setCurrentInstance (_oldFacesContex);\r
-               }\r
-\r
-               public override void renderResponse () {\r
-                       _facesContex.renderResponse ();\r
-               }\r
-\r
-               public override void responseComplete () {\r
-                       _facesContex.responseComplete ();\r
-               }\r
-\r
-               public override void setResponseStream (ResponseStream __p1) {\r
-                       _facesContex.setResponseStream (__p1);\r
-               }\r
-\r
-               public override void setResponseWriter (ResponseWriter __p1) {\r
-                       _facesContex.setResponseWriter (__p1);\r
-               }\r
-\r
-               public override void setViewRoot (javax.faces.component.UIViewRoot __p1) {\r
-                       _facesContex.setViewRoot (__p1);\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseExternalContext.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseExternalContext.cs
deleted file mode 100644 (file)
index 515f011..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-//\r
-// Mainsoft.Web.Hosting.BaseExternalContext.cs\r
-//\r
-// Authors:\r
-//     Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-// (C) 2008 Mainsoft Co. (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using javax.faces.context;\r
-using System.Web;\r
-using java.util;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public abstract partial class BaseExternalContext : ExternalContext\r
-       {\r
-               readonly HttpContext _httpContext;\r
-               readonly string _executionFilePath;\r
-\r
-               private Map _requestParameterMap;\r
-               private Map _requestParameterValuesMap;\r
-\r
-               protected BaseExternalContext (HttpContext httpContext, string executionFilePath) {\r
-                       _httpContext = httpContext;\r
-                       _executionFilePath = executionFilePath;\r
-               }\r
-\r
-               protected HttpContext Context {\r
-                       get { return _httpContext; }\r
-               }\r
-\r
-               public override Map getRequestParameterMap () {\r
-                       return _requestParameterMap ?? (_requestParameterMap = new RequestParameterMap (Context.Request.Form));\r
-               }\r
-\r
-               public override Iterator getRequestParameterNames () {\r
-                       return new IEnumeratorIteratorImpl (Context.Request.Form.Keys.GetEnumerator ());\r
-               }\r
-\r
-               public override Map getRequestParameterValuesMap () {\r
-                       return _requestParameterValuesMap ?? (_requestParameterValuesMap = new RequestParameterValuesMap (Context.Request.Form));\r
-               }\r
-\r
-               public override string getRequestPathInfo () {\r
-                       return _executionFilePath.Substring (getRequestContextPath ().Length);\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseFacesPageHandlerFactory.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseFacesPageHandlerFactory.cs
deleted file mode 100644 (file)
index c26eca7..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//\r
-// (C) 2007 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Author: Igor Zelmanovich <igorz@mainsoft.com>\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Web;\r
-using javax.faces.context;\r
-using javax.faces.lifecycle;\r
-using javax.servlet;\r
-using javax.faces;\r
-using javax.faces.webapp;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public abstract class BaseFacesPageHandlerFactory : IHttpHandlerFactory\r
-       {\r
-               public abstract IHttpHandler GetHandler (HttpContext context, string requestType, string url, string pathTranslated);\r
-\r
-               public virtual void ReleaseHandler (IHttpHandler handler) {\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseFacesStateManager.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseFacesStateManager.cs
deleted file mode 100644 (file)
index 09004e3..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using javax.faces.application;\r
-using javax.faces.component;\r
-using javax.faces.context;\r
-using System.Diagnostics;\r
-using System.Web.UI;\r
-using javax.faces.render;\r
-using javax.faces;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public abstract class BaseFacesStateManager : StateManager\r
-       {\r
-               protected static readonly string VIEWSTATE = "__VIEWSTATE";\r
-               protected static readonly RenderKitFactory RenderKitFactory = (RenderKitFactory) FactoryFinder.getFactory (FactoryFinder.RENDER_KIT_FACTORY);\r
-\r
-               public override StateManager.SerializedView saveSerializedView (FacesContext facesContext) {\r
-                       Object treeStruct = getTreeStructureToSave (facesContext);\r
-                       Object compStates = getComponentStateToSave (facesContext);\r
-                       SerializedView serializedView = new SerializedView (this, treeStruct, compStates);\r
-                       return serializedView;\r
-               }\r
-\r
-               protected override sealed Object getTreeStructureToSave (FacesContext facesContext) {\r
-                       return String.Empty;\r
-               }\r
-\r
-               public override UIViewRoot restoreView (FacesContext facesContext,\r
-                                                                                                                                String viewId,\r
-                                                                                                                               String renderKitId) {\r
-\r
-                       UIViewRoot uiViewRoot = restoreTreeStructure (facesContext, viewId, renderKitId);\r
-                       Page page = (Page) uiViewRoot.getChildren ().get (0);\r
-                       if (page.IsPostBack || page.IsCallback)\r
-                               restoreComponentState (facesContext, uiViewRoot, renderKitId);\r
-                       else\r
-                               facesContext.renderResponse ();\r
-                       return uiViewRoot;\r
-               }\r
-\r
-               protected override sealed UIViewRoot restoreTreeStructure (FacesContext facesContext, string viewId, string renderKitId) {\r
-                       return facesContext.getApplication ().getViewHandler ().createView (facesContext, viewId);\r
-               }\r
-\r
-               protected override Object getComponentStateToSave (FacesContext facesContext) {\r
-                       Trace.WriteLine ("Entering getComponentStateToSave");\r
-\r
-                       UIViewRoot viewRoot = facesContext.getViewRoot ();\r
-                       if (viewRoot.isTransient ()) {\r
-                               return null;\r
-                       }\r
-\r
-                       Object serializedComponentStates = ((UIComponent) viewRoot.getChildren ().get (0)).processSaveState (facesContext);\r
-                       //Locale is a state attribute of UIViewRoot and need not be saved explicitly\r
-                       Trace.WriteLine ("Exiting getComponentStateToSave");\r
-                       return serializedComponentStates;\r
-               }\r
-\r
-               protected void SaveStateInClient (FacesContext facesContext, StateManager.SerializedView serializedView) {\r
-                       //UIViewRoot uiViewRoot = facesContext.getViewRoot ();\r
-                       ////save state in response (client-side: full state; server-side: sequence)\r
-                       //RenderKit renderKit = RenderKitFactory.getRenderKit (facesContext, uiViewRoot.getRenderKitId ());\r
-                       //// not us.\r
-                       //renderKit.getResponseStateManager ().writeState (facesContext, serializedView);\r
-\r
-                       java.io.ByteArrayOutputStream bytearrayoutputstream = new java.io.ByteArrayOutputStream ();\r
-                       java.io.ObjectOutputStream objectoutputstream = new java.io.ObjectOutputStream (bytearrayoutputstream);\r
-\r
-                       //ignore tree structure\r
-                       //objectoutputstream.writeObject (serializedView.getStructure ());\r
-                       objectoutputstream.writeObject (serializedView.getState ());\r
-                       objectoutputstream.close ();\r
-                       bytearrayoutputstream.close ();\r
-\r
-                       string s = \r
-@"<div>\r
-       <input type=""hidden"" name=""" + VIEWSTATE + "\" id=\"" + VIEWSTATE + "\" value=\"" +\r
-                               Convert.ToBase64String ((byte []) vmw.common.TypeUtils.ToByteArray (bytearrayoutputstream.toByteArray ())) + @""" />\r
-</div>";\r
-                       facesContext.getResponseWriter ().write (s);\r
-               }\r
-\r
-               protected object GetStateFromClient (FacesContext facesContext, String viewId, String renderKitId) {\r
-                       //RenderKit renderKit = RenderKitFactory.getRenderKit (facesContext, renderKitId);\r
-                       //ResponseStateManager responseStateManager = renderKit.getResponseStateManager ();\r
-                       //responseStateManager.getTreeStructureToRestore (facesContext, viewId); //ignore result. Must call for compatibility with sun implementation.\r
-                       //return responseStateManager.getComponentStateToRestore (facesContext);\r
-\r
-                       java.util.Map map = facesContext.getExternalContext ().getRequestParameterMap ();\r
-                       string s1 = (string) map.get (VIEWSTATE);\r
-\r
-                       byte [] buffer = Convert.FromBase64String (s1);\r
-                       java.io.ByteArrayInputStream bytearrayinputstream = new java.io.ByteArrayInputStream (vmw.common.TypeUtils.ToSByteArray (buffer));\r
-                       java.io.ObjectInputStream inputStream = new java.io.ObjectInputStream (bytearrayinputstream);\r
-                       //ignore tree structure\r
-                       //inputStream.readObject ();\r
-                       object state = inputStream.readObject ();\r
-                       inputStream.close ();\r
-                       bytearrayinputstream.close ();\r
-\r
-                       return state;\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseFacesViewHandler.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseFacesViewHandler.cs
deleted file mode 100644 (file)
index c0e9532..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using javax.faces.application;\r
-using java.util;\r
-using javax.faces.context;\r
-using javax.faces.component;\r
-using javax.faces.render;\r
-using System.Web.UI;\r
-using System.Web;\r
-using System.Diagnostics;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public abstract class BaseFacesViewHandler : ViewHandler, IExtendedViewHandler\r
-       {\r
-               readonly ViewHandler _viewHandler;\r
-               public static readonly string NAMESPACE = "__NAMESPACE";\r
-\r
-               public BaseFacesViewHandler (ViewHandler viewHandler) {\r
-                       _viewHandler = viewHandler;\r
-               }\r
-\r
-               public override string getActionURL (FacesContext facesContext, string viewId) {\r
-                       return _viewHandler.getActionURL (facesContext, viewId);\r
-               }\r
-\r
-               public override Locale calculateLocale (FacesContext facesContext) {\r
-                       return _viewHandler.calculateLocale (facesContext);\r
-               }\r
-\r
-               public override String calculateRenderKitId (FacesContext facesContext) {\r
-                       return _viewHandler.calculateRenderKitId (facesContext);\r
-               }\r
-\r
-               public override UIViewRoot createView (FacesContext facesContext, String viewId) {\r
-\r
-                       // create instance of Page by viewId\r
-                       StringBuilder sb = new StringBuilder ();\r
-                       sb.Append (facesContext.getExternalContext ().getRequestContextPath ());\r
-                       sb.Append (viewId);\r
-                       IHttpHandler page = PageParser.GetCompiledPageInstance (sb.ToString (), null, ((AspNetFacesContext) facesContext).Context);\r
-\r
-                       HttpContext context = ((AspNetFacesContext) facesContext).Context;\r
-                       page.ProcessRequest (context);\r
-                       \r
-                       UIViewRoot uiViewRoot = _viewHandler.createView (facesContext, viewId);\r
-                       uiViewRoot.getChildren ().add (0, (UIComponent) page);\r
-                       \r
-                       Trace.WriteLine ("Created view " + viewId);\r
-                       return uiViewRoot;\r
-               }\r
-\r
-               public override String getResourceURL (FacesContext facesContext, String path) {\r
-                       return _viewHandler.getResourceURL (facesContext, path);\r
-               }\r
-\r
-               public override void renderView (FacesContext facesContext, UIViewRoot viewToRender) {\r
-                       if (viewToRender == null)\r
-                               throw new ArgumentNullException ("viewToRender", "viewToRender must not be null");\r
-                       ((UIComponent) viewToRender.getChildren ().get (0)).encodeChildren (facesContext);\r
-               }\r
-\r
-\r
-               public override UIViewRoot restoreView (FacesContext facesContext, String viewId) {\r
-                       return _viewHandler.restoreView (facesContext, viewId);\r
-               }\r
-\r
-               public override void writeState (FacesContext facesContext) {\r
-                       StateManager manager = facesContext.getApplication ().getStateManager ();\r
-                       StateManager.SerializedView serializedView = manager.saveSerializedView (facesContext);\r
-                       manager.writeState (facesContext, serializedView);\r
-               }\r
-\r
-               public virtual string EncodeNamespace (FacesContext facesContext, string value) {\r
-                       return value;\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseHttpServlet.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseHttpServlet.cs
deleted file mode 100644 (file)
index 18d0c7c..0000000
+++ /dev/null
@@ -1,396 +0,0 @@
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using System.Configuration;
-using System.Web;
-using System.Web.Configuration;
-using System.Threading;
-using System.Web.Hosting;
-using System.IO;
-
-using javax.servlet;
-using javax.servlet.http;
-using vmw.common;
-using java.util;
-using vmw.@internal;
-using java.lang.reflect;
-using java.net;
-using System.Globalization;
-using System.Diagnostics;
-using javax.faces;
-using javax.faces.context;
-using javax.faces.lifecycle;
-using javax.faces.webapp;
-using javax.faces.render;
-
-namespace Mainsoft.Web.Hosting
-{
-       public interface IJDBCDriverDeregisterer
-       {
-               void DeregisterDriver (java.sql.Driver driver);
-       }
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// </summary>
-       public class BaseHttpServlet : HttpServlet, IJDBCDriverDeregisterer
-       {
-               bool _appVirDirInited = false;
-
-               static FacesContextFactory _facesContextFactory;
-               static Lifecycle _lifecycle;
-               static RenderKitFactory _renderKitFactory;
-
-               public BaseHttpServlet()
-               {
-               }
-
-               public static RenderKitFactory RenderKitFactory {
-                       get { return _renderKitFactory; }
-               }
-
-               public static FacesContextFactory FacesContextFactory {
-                       get { return _facesContextFactory; }
-               }
-
-               public static Lifecycle Lifecycle {
-                       get { return _lifecycle; }
-               }
-
-               override public void init(ServletConfig config)
-               {
-                       base.init(config);
-                       InitRuntime (config, this);
-               }
-
-               public static void InitRuntime (ServletConfig config, object evidence) {
-
-                       ServletContext context = config.getServletContext ();
-
-                       if (context.getAttribute (J2EEConsts.APP_DOMAIN) != null)
-                               return;
-
-                       _facesContextFactory = (FacesContextFactory) FactoryFinder.getFactory (FactoryFinder.FACES_CONTEXT_FACTORY);
-                       //TODO: null-check for Weblogic, that tries to initialize Servlet before ContextListener
-
-                       //Javadoc says: Lifecycle instance is shared across multiple simultaneous requests, it must be implemented in a thread-safe manner.
-                       //So we can acquire it here once:
-                       LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory (FactoryFinder.LIFECYCLE_FACTORY);
-                       _lifecycle = lifecycleFactory.getLifecycle (context.getInitParameter (FacesServlet.LIFECYCLE_ID_ATTR) ?? LifecycleFactory.DEFAULT_LIFECYCLE);
-
-                       _renderKitFactory = (RenderKitFactory) FactoryFinder.getFactory (FactoryFinder.RENDER_KIT_FACTORY);
-
-                       AppDomain servletDomain = createServletDomain (config);
-                       vmw.@internal.EnvironmentUtils.setAppDomain (servletDomain);
-
-                       try {
-                               //GH Infromation Initizalization
-                               long currentTime = java.lang.System.currentTimeMillis ();
-                               servletDomain.SetData (".domainId", currentTime.ToString ("x"));
-                               currentTime = ~currentTime;
-                               servletDomain.SetData (".appId", currentTime.ToString ("x"));
-                               servletDomain.SetData (".appName", servletDomain.SetupInformation.ApplicationName);
-
-                               servletDomain.SetData (J2EEConsts.CLASS_LOADER, java.lang.Thread.currentThread ().getContextClassLoader ());
-                               //servletDomain.SetData (J2EEConsts.CLASS_LOADER, vmw.common.TypeUtils.ToClass (evidence).getClassLoader ());
-                               //servletDomain.SetData(J2EEConsts.SERVLET_CONFIG, config);
-                               servletDomain.SetData (J2EEConsts.RESOURCE_LOADER, new ServletResourceLoader (context));
-
-                               lock (evidence) {
-                                       if (context.getAttribute (J2EEConsts.APP_DOMAIN) == null)
-                                               context.setAttribute (J2EEConsts.APP_DOMAIN, servletDomain);
-                               }
-                               //config.getServletContext ().setAttribute (J2EEConsts.CURRENT_SERVLET, this);
-                       }
-                       finally {
-                               vmw.@internal.EnvironmentUtils.cleanTLS ();
-                               vmw.@internal.EnvironmentUtils.clearAppDomain ();
-                       }
-               }
-
-               protected override void service (HttpServletRequest req, HttpServletResponse resp)
-               {
-                       const string assemblies = "/assemblies";
-                       const string getping = "getping";
-                       const string setping = "setping";
-            const string version = "2.2";
-                       string servletPath = req.getServletPath ();
-
-                       if (String.CompareOrdinal (assemblies, 0, servletPath, 0, assemblies.Length) == 0) {
-                               if (servletPath.Length == assemblies.Length ||
-                                               servletPath [assemblies.Length] == '/') {
-                                       string requestURI = req.getRequestURI ();
-                                       bool getp = requestURI.EndsWith (getping, StringComparison.Ordinal);
-                                       if (!getp && requestURI.EndsWith (setping, StringComparison.Ordinal)) {
-                        getServletContext().setAttribute(getping, version);
-                                               getp = true;
-                                       }
-
-                                       if (getp) {
-                                               string ping = (string) getServletContext ().getAttribute (getping);
-                                               if (ping == null)
-                                                       ping = "0";
-                                               resp.getOutputStream ().print (ping);
-                                               return;
-                                       }
-                               }
-                       }
-                       resp.setContentType ("text/html");
-
-                       try 
-                       {
-                               // Very important - to update Virtual Path!!!
-                               AppDomain servletDomain = (AppDomain)this.getServletContext().getAttribute(J2EEConsts.APP_DOMAIN);
-                               if (!_appVirDirInited) {
-                                       string appVPath = req.getContextPath ();
-                                       if (appVPath == null || appVPath.Length == 0)
-                                               appVPath = "/";
-                                       servletDomain.SetData (IAppDomainConfig.APP_VIRT_DIR, appVPath);
-                                       servletDomain.SetData (".hostingVirtualPath", req.getContextPath ());
-                                       _appVirDirInited = true;
-                               }
-
-                               // Put to the TLS current AppDomain of the servlet, so anyone can use it.
-                               vmw.@internal.EnvironmentUtils.setAppDomain(servletDomain);
-
-                               // put request to the TLS
-                               //Thread.SetData(_servletRequestSlot, req);
-                               //// put response to the TLS
-                               //Thread.SetData(_servletResponseSlot, resp);
-                               //// put the servlet object to the TLS
-                               //Thread.SetData(_servletSlot, this);
-
-                               resp.setHeader("X-Powered-By", "ASP.NET");
-                               resp.setHeader("X-AspNet-Version", "1.1.4322");
-
-                               HttpWorkerRequest gwr = new ServletWorkerRequest (this, req, resp);
-                               CultureInfo culture = (CultureInfo) vmw.@internal.EnvironmentUtils.getCultureInfoFromLocale (req.getLocale ());
-                               Thread currentTread = Thread.CurrentThread;
-                               currentTread.CurrentCulture = culture;
-                               currentTread.CurrentUICulture = culture;
-                               HttpRuntime.ProcessRequest(gwr);
-                       }
-                       finally 
-                       {
-                               HttpContext.Current = null;
-                               //Thread.SetData(_servletRequestSlot, null);
-                               //Thread.SetData(_servletResponseSlot, null);
-                               //Thread.SetData(_servletSlot, null);
-                               vmw.@internal.EnvironmentUtils.clearAppDomain();
-                       }
-               }
-
-               override public void destroy()
-               {
-                       base.destroy();
-                       DestroyRuntime (getServletContext (), this);
-               }
-
-               public static void DestroyRuntime (ServletContext context, IJDBCDriverDeregisterer evidence) {
-                       AppDomain servletDomain = (AppDomain) context.getAttribute (J2EEConsts.APP_DOMAIN);
-                       if (servletDomain == null)
-                               return;
-
-                       try {
-                               vmw.@internal.EnvironmentUtils.setAppDomain (servletDomain);
-                               Debug.WriteLine ("Destroy of GhHttpServlet");
-                               HttpRuntime.Close ();
-                               vmw.@internal.EnvironmentUtils.cleanAllBeforeServletDestroy (evidence);
-                               context.removeAttribute (J2EEConsts.APP_DOMAIN);
-                               try {
-                                       FactoryFinder.releaseFactories ();
-                               }
-                               catch (FacesException) { }
-
-                               java.lang.ClassLoader appClassLoader = vmw.common.TypeUtils.ToClass (evidence).getClassLoader ();
-
-                               IJDBCDriverDeregisterer dereg = evidence;
-
-                               java.util.Enumeration en = java.sql.DriverManager.getDrivers ();
-                               while (en.hasMoreElements ()) {
-                                       Object o = en.nextElement ();
-                                       if (vmw.common.TypeUtils.ToClass (o).getClassLoader () == appClassLoader)
-                                               dereg.DeregisterDriver ((java.sql.Driver) o);
-                               }
-
-                               java.lang.Thread.currentThread ().setContextClassLoader (null);
-                       }
-                       catch (Exception e) {
-                               Debug.WriteLine (String.Format ("ERROR in Servlet Destroy {0},{1}", e.GetType (), e.Message));
-                               Debug.WriteLine (e.StackTrace);
-                       }
-                       finally {
-                               vmw.@internal.EnvironmentUtils.clearAppDomain ();
-                       }
-               }
-
-               private static AppDomain createServletDomain(ServletConfig config)
-               {
-                               string rootPath = J2EEUtils.GetApplicationRealPath(config.getServletContext ());
-                               AppDomainSetup domainSetup = new AppDomainSetup();
-                               string name = config.getServletName();//.getServletContextName();
-                               if (name == null)
-                                       name = "GH Application";
-                               domainSetup.ApplicationName = name;
-                               domainSetup.ConfigurationFile = Path.Combine (rootPath, "Web.config");
-                               domainSetup.PrivateBinPath = Path.Combine (rootPath, "WEB-INF/lib");
-
-                               AppDomain servletDomain = AppDomain.CreateDomain(name, null, domainSetup);
-
-
-
-
-
-                               //servletDomain.SetData(IAppDomainConfig.APP_PHYS_DIR, J2EEUtils.GetApplicationPhysicalPath(config));
-                               //servletDomain.SetData(IAppDomainConfig.WEB_APP_DIR, rootPath);
-
-                               servletDomain.SetData(IAppDomainConfig.APP_PHYS_DIR, J2EEUtils.GetApplicationPhysicalPath(config.getServletContext ()));
-                               servletDomain.SetData(IAppDomainConfig.WEB_APP_DIR, rootPath);
-                               servletDomain.SetData(IAppDomainConfig.SERVLET_CONFIG, config);
-
-                               //Set DataDirectory substitution string (http://blogs.msdn.com/dataaccess/archive/2005/10/28/486273.aspx)
-                               string dataDirectory = config.getServletContext ().getInitParameter ("DataDirectory");
-                               if (dataDirectory == null)
-                                       dataDirectory = "App_Data";
-
-                               if (!Path.IsPathRooted (dataDirectory)) {
-                                       java.io.InputStream inputStream = config.getServletContext ().getResourceAsStream ("/WEB-INF/classes/appData.properties");
-                                       string root;
-                                       if (inputStream != null) {
-                                               try {
-                                                       Properties props = new Properties ();
-                                                       props.load (inputStream);
-                                                       root = props.getProperty ("root.folder");
-                                               }
-                                               finally {
-                                                       inputStream.close ();
-                                               }
-                                       }
-                                       else
-                                               root = config.getServletContext ().getRealPath ("/");
-
-                                       if (root == null)
-                                               root = String.Empty;
-
-                                       dataDirectory = Path.Combine (root, dataDirectory);
-                               }
-
-                               if (dataDirectory [dataDirectory.Length - 1] != Path.DirectorySeparatorChar)
-                                       dataDirectory += Path.DirectorySeparatorChar;
-
-                               servletDomain.SetData ("DataDirectory", dataDirectory);
-
-                               if (config.getServletContext ().getRealPath ("/") == null)
-                                       servletDomain.SetData(".appStartTime", DateTime.UtcNow);
-
-                               // The BaseDir is the full path to the physical dir of the app
-                               // and allows the application to modify files in the case of
-                               // open deployment.
-                               string webApp_baseDir = config.getServletContext().getRealPath("");
-                               if (webApp_baseDir == null || webApp_baseDir == "")
-                                       webApp_baseDir = rootPath;
-                               servletDomain.SetData(IAppDomainConfig.APP_BASE_DIR , webApp_baseDir);
-                               Debug.WriteLine("Initialization of webapp " + webApp_baseDir);
-                               //servletDomain.SetData(".hostingVirtualPath", "/");
-                               //servletDomain.SetData(".hostingInstallDir", "/");
-                               return servletDomain;
-               }
-
-               #region IJDBCDriverDeregisterer Members
-
-               public void DeregisterDriver (java.sql.Driver driver) {
-                       java.sql.DriverManager.deregisterDriver (driver);
-               }
-
-               #endregion
-       }
-}
-
-namespace System.Web.GH
-{
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// </summary>
-       public class BaseHttpServlet : Mainsoft.Web.Hosting.BaseHttpServlet
-       {
-       }
-
-}
-
-namespace System.Web.J2EE
-{
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// </summary>
-       public class BaseHttpServlet : Mainsoft.Web.Hosting.BaseHttpServlet
-       {
-       }
-
-}
-
-public class GhDynamicHttpServlet : System.Web.GH.BaseHttpServlet
-{
-}
-
-public class GhStaticHttpServlet : System.Web.GH.BaseStaticHttpServlet
-{ 
-}
-
-public class GhHttpServlet : System.Web.GH.BaseHttpServlet
-{
-       GhStaticHttpServlet staticServlet;
-
-       public GhHttpServlet () {
-               staticServlet = new GhStaticHttpServlet ();
-       }
-
-       override public void init (ServletConfig config) {
-               base.init (config);
-               staticServlet.init (config);
-       }
-
-       override protected void service (HttpServletRequest req, HttpServletResponse resp) {
-               string pathInfo = req.getRequestURI ();
-               string contextPath = req.getContextPath ();
-               if (pathInfo.Equals (contextPath) ||
-                       ((pathInfo.Length - contextPath.Length) == 1) &&
-                       pathInfo [pathInfo.Length - 1] == '/' && pathInfo.StartsWith (contextPath))
-                       pathInfo = contextPath + req.getServletPath ();
-               if (pathInfo.EndsWith (".aspx") ||
-                       pathInfo.EndsWith (".asmx") ||
-                       pathInfo.EndsWith (".invoke")) {
-                       base.service (req, resp);
-               }
-               else {
-                       staticServlet.service (req, resp);
-               }
-       }
-
-       override public void destroy () {
-               staticServlet.destroy ();
-               base.destroy ();
-       }
-}
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseStaticHttpServlet.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseStaticHttpServlet.cs
deleted file mode 100644 (file)
index d6ebfd7..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Configuration;
-using System.Web;
-using System.Threading;
-
-using javax.servlet;
-using javax.servlet.http;
-using vmw.common;
-using System.Diagnostics;
-
-namespace Mainsoft.Web.Hosting
-{
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// </summary>
-       public class BaseStaticHttpServlet : HttpServlet
-       {
-               public BaseStaticHttpServlet()
-               {
-               }
-
-               override public void init(ServletConfig config)
-               {
-                       base.init(config);
-                       AppDir = config.getServletContext ().getInitParameter (IAppDomainConfig.APP_DIR_NAME);
-                       if (AppDir != null) {
-                               AppDir = AppDir.Replace('\\', '/');
-                               if (AppDir[AppDir.Length - 1] != '/')
-                                       AppDir += '/';
-                       }
-               }
-
-               override protected void service(HttpServletRequest req, HttpServletResponse resp)
-               {
-                       resp.setHeader("X-Powered-By", "ASP.NET");
-                       resp.setHeader("X-AspNet-Version", "1.1.4322");
-
-                       String filename = getServletContext().getRealPath(req.getServletPath());
-                       ServletOutputStream hos;
-                       try {
-                               hos = resp.getOutputStream();
-                       }
-                       catch (java.lang.IllegalStateException e)
-                       {
-                               string mimeType = getServletContext().getMimeType(filename);
-                               if (mimeType == null || mimeType.StartsWith("text")) {
-                                       sendFileUsingWriter(resp, filename);
-                                       return;
-                               }
-                               else
-                                       throw e;
-                       }
-                       try 
-                       {
-                               string mimeType = this.getServletContext().getMimeType(filename);
-                               if (mimeType == null)
-                                       mimeType = "text/plain";
-                               
-                               resp.setContentType(mimeType);
-
-                               FileStream fis = null;
-                               try {
-                                       fis = new FileStream(filename,FileMode.Open,FileAccess.Read);
-                                       byte[] buf = new byte[4 * 1024];  // 4K buffer
-                                       int bytesRead;
-                                       while ((bytesRead = fis.Read(buf,0,buf.Length)) != -1 &&
-                                                  bytesRead != 0) {
-                                               hos.write(TypeUtils.ToSByteArray(buf), 0, bytesRead);
-                                       }
-                               }
-                               finally {
-                                       if (fis != null) fis.Close();
-                               }
-                       }
-                       catch (System.IO.FileNotFoundException e) 
-                       {
-                               resp.setStatus(404,"Object Not Found.");
-                               HttpException myExp = new HttpException (404, "File '" + filename + "' not found.");
-                               hos.print(((HttpException) myExp).GetHtmlErrorMessage ());
-                               hos.flush();
-                       }
-                       catch(Exception e) 
-                       {
-                               Trace.WriteLine (String.Format ("ERROR in Static File Reading {0},{1}", e.GetType (), e.Message));
-                               resp.setStatus(500);
-                               HttpException myExp = new HttpException ("Exception in Reading static file", e);
-                               hos.print(((HttpException) myExp).GetHtmlErrorMessage ());
-                               hos.flush();
-                       }
-               }
-
-               void sendFileUsingWriter(HttpServletResponse resp, string filename)
-               {
-                       java.io.PrintWriter writer = resp.getWriter();
-                       try 
-                       {
-                               resp.setContentType(this.getServletContext().getMimeType(filename));
-                               StreamReader fis = null;
-                               char[] buf = new char[4 * 1024];  // 4K buffer
-                               try {
-                                       fis = new StreamReader(filename);
-                                       int charsRead;
-                                       while ((charsRead = fis.Read(buf,0,buf.Length)) != -1 &&
-                                               charsRead != 0) {
-                                               writer.write(buf, 0, charsRead);
-                                       }
-                               }
-                               finally {
-                                       if (fis != null) fis.Close();
-                               }
-                       }
-                       catch (System.IO.FileNotFoundException e) 
-                       {
-                               resp.setStatus(404,"Object Not Found.");
-                               HttpException myExp = new HttpException (404, "File '" + filename + "' not found.");
-                               writer.print(((HttpException) myExp).GetHtmlErrorMessage ());
-                               writer.flush();
-                       }
-                       catch(Exception e) 
-                       {
-                               Trace.WriteLine (String.Format ("ERROR in Static File Reading {0},{1}", e.GetType (), e.Message));
-                               resp.setStatus(500);
-                               HttpException myExp = new HttpException ("Exception in Reading static file", e);
-                               writer.print(((HttpException) myExp).GetHtmlErrorMessage ());
-                               writer.flush();
-                       }
-               }
-
-               override public void destroy()
-               {
-                       base.destroy();
-               }
-
-               private string AppDir;
-       }
-}
-
-namespace System.Web.J2EE
-{
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// </summary>
-       public class BaseStaticHttpServlet : Mainsoft.Web.Hosting.BaseStaticHttpServlet
-       {
-       }
-
-}
-
-
-namespace System.Web.GH
-{
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// </summary>
-       public class BaseStaticHttpServlet : Mainsoft.Web.Hosting.BaseStaticHttpServlet
-       {
-       }
-
-}
-
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/IExtendedViewHandler.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/IExtendedViewHandler.cs
deleted file mode 100644 (file)
index bb76590..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using javax.faces.context;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public interface IExtendedViewHandler\r
-       {\r
-               string EncodeNamespace (FacesContext facesContext, string value);\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/IncludeHelperServlet.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/IncludeHelperServlet.cs
deleted file mode 100644 (file)
index a2e47e1..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// Mainsoft.Web.Hosting.IncludeHelperServlet
-//
-// Authors:
-//     Eyal Alaluf (eyala@mainsoft.com)
-//
-// (C) 2006 Mainsoft Co. (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Web.UI;
-using java.io;
-using javax.servlet;
-using javax.servlet.http;
-
-namespace Mainsoft.Web.Hosting
-{
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// </summary>
-       public class IncludeHelperServlet : HttpServlet
-       {
-               public IncludeHelperServlet()
-               {
-               }
-
-               override protected void service(HttpServletRequest req, HttpServletResponse resp)
-               {
-                       string servletPath = ServletIncludeUtils.getServletPath(req);
-                       TextWriter writer = (TextWriter)ServletIncludeUtils.getTextWriter(req);
-                       RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(servletPath);
-                       HttpServletResponseWrapper wrapper = new AspxResponseWrapper(resp, writer);
-                       dispatcher.include(req, wrapper);
-               }
-
-               sealed class AspxResponseWrapper : HttpServletResponseWrapper 
-               {
-                       public AspxResponseWrapper(HttpServletResponse resp, TextWriter writer) : base (resp)
-                       {
-                               jwriter = new PrintWriter(new JavaWriterFromTextWriter(writer));
-                       }
-
-                       public override PrintWriter getWriter()
-                       {
-                               return jwriter;
-                       }
-
-                       readonly PrintWriter jwriter;
-               }
-
-               sealed class JavaWriterFromTextWriter : Writer
-               {
-                       public JavaWriterFromTextWriter(TextWriter writer)
-                       {
-                               this.writer = writer;
-                       }
-
-                       public override void flush()
-                       {
-                               writer.Flush ();
-                       }
-
-                       public override void write(char[] buffer, int offset, int count)
-                       {
-                               writer.Write(buffer, offset, count);
-                       }
-
-                       public override void write(String s)
-                       {
-                               writer.Write(s);
-                       }
-
-                       public override void write(string s, int start, int count)
-                       {
-                               if (start == 0 && count == s.Length)
-                                       writer.Write(s);
-                               else
-                                       writer.Write(s.Substring(start, count));
-                       }
-
-                       public override void close()
-                       {
-                               // Ignore close as we don't own here the writer.
-                       }
-
-                       readonly TextWriter writer;
-               }
-       }
-}
-
-namespace System.Web.GH
-{
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// </summary>
-       public class IncludeHelperServlet : Mainsoft.Web.Hosting.IncludeHelperServlet
-       {
-       }
-
-}
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/OutputStreamWrapper.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/OutputStreamWrapper.cs
deleted file mode 100644 (file)
index 878f771..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-//\r
-// Mainsoft.Web.Hosting.OutputStreamWrapper\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-// (C) 2006 Mainsoft\r
-//\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Web;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-\r
-using java.io;\r
-using vmw.common;\r
-\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       /// <summary>\r
-       /// \r
-       /// </summary>\r
-       public sealed class OutputStreamWrapper : java.io.Writer\r
-       {\r
-               enum OutputMode\r
-               {\r
-                       CharWriter,\r
-                       ByteStream,\r
-               }\r
-\r
-               readonly PrintWriter _printWriter;\r
-               readonly OutputStream _outputStream;\r
-               readonly OutputMode _outputMode;\r
-\r
-               private byte [] _bytebuffer;\r
-               private char [] _charBuffer;\r
-               //sbyte [] _oneByte = new sbyte [1];\r
-\r
-               Encoding _encoding = null;\r
-\r
-               /// <summary>\r
-               /// Ctor from writer\r
-               /// </summary>\r
-               /// <param name="writer"></param>\r
-               public OutputStreamWrapper (PrintWriter writer)\r
-               {\r
-                       _printWriter = writer;\r
-                       _outputMode = OutputMode.CharWriter;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Ctor from stream\r
-               /// </summary>\r
-               /// <param name="outputStream"></param>\r
-               public OutputStreamWrapper (OutputStream outputStream)\r
-               {\r
-                       _outputStream = outputStream;\r
-                       _outputMode = OutputMode.ByteStream;\r
-               }\r
-\r
-               /// <summary>\r
-               /// \r
-               /// </summary>\r
-               public override void close ()\r
-               {\r
-                       // BUGBUG\r
-                       // on WPS, closing the writer causes\r
-                       // any portlets rendered after us to be not shown...\r
-                       //_writer.close();\r
-               }\r
-\r
-               /// <summary>\r
-               /// Flushes servers stream\r
-               /// </summary>\r
-               public override void flush ()\r
-               {\r
-                       if (_outputMode == OutputMode.CharWriter)\r
-                               _printWriter.flush ();\r
-                       else\r
-                               _outputStream.flush();\r
-               }\r
-\r
-               /// <summary>\r
-               /// Writes char array\r
-               /// </summary>\r
-               /// <param name="chars"></param>\r
-               /// <param name="index"></param>\r
-               /// <param name="count"></param>\r
-               public override void write (char [] chars, int index, int count)\r
-               {\r
-                       if (_outputMode == OutputMode.CharWriter) {\r
-                               _printWriter.write (chars, index, count);\r
-                       }\r
-                       else {\r
-                               int length = Encoding.GetMaxByteCount (count);\r
-                               byte [] bytebuffer = GetByteBuffer (length);\r
-                               int realLength = Encoding.GetBytes (chars, index, count, bytebuffer, 0);\r
-\r
-                               _outputStream.write (TypeUtils.ToSByteArray (bytebuffer), 0, realLength);\r
-                       }\r
-                               \r
-               }\r
-\r
-               /// <summary>\r
-               /// Writes byte array\r
-               /// </summary>\r
-               /// <param name="sbytes"></param>\r
-               /// <param name="index"></param>\r
-               /// <param name="count"></param>\r
-               public void write (sbyte [] sbytes, int index, int count)\r
-               {\r
-                       if (_outputMode == OutputMode.ByteStream)\r
-                               _outputStream.write (sbytes, index, count);\r
-                       else {\r
-                               int length = Encoding.GetMaxCharCount (count);\r
-                               char [] charbuffer = GetCharBuffer (length);\r
-                               int realLength = Encoding.GetChars ((byte []) TypeUtils.ToByteArray (sbytes), index, count, charbuffer, 0);\r
-\r
-                               _printWriter.write (charbuffer, 0, realLength);\r
-                       }\r
-               }\r
-\r
-               private char [] GetCharBuffer (int length)\r
-               {\r
-                       // We will reuse the buffer if its size is < 32K\r
-                       if (_charBuffer != null && _charBuffer.Length >= length)\r
-                               return _charBuffer;\r
-\r
-                       if (length > 32 * 1024)\r
-                               return new char [length];\r
-\r
-                       if (length < 1024)\r
-                               length = 1024;\r
-\r
-                       _charBuffer = new char [length];\r
-                       return _charBuffer;\r
-               }\r
-\r
-               private byte [] GetByteBuffer (int length)\r
-               {\r
-                       // We will reuse the buffer if its size is < 32K\r
-                       if (_bytebuffer != null && _bytebuffer.Length >= length)\r
-                               return _bytebuffer;\r
-\r
-                       if (length > 32 * 1024)\r
-                               return new byte [length];\r
-\r
-                       if (length < 1024)\r
-                               length = 1024;\r
-\r
-                       _bytebuffer = new byte [length];\r
-                       return _bytebuffer;\r
-               }\r
-               \r
-               private Encoding Encoding\r
-               {\r
-                       get\r
-                       {\r
-                               if (_encoding == null) {\r
-                                       HttpContext current = HttpContext.Current;\r
-                                       _encoding = (current != null) ? current.Response.ContentEncoding : Encoding.UTF8;\r
-                               }\r
-                               return _encoding;\r
-                       }\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/RequestParameterMap.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/RequestParameterMap.cs
deleted file mode 100644 (file)
index 51a975e..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-//\r
-// Mainsoft.Web.Hosting.RequestParameterMap.cs\r
-//\r
-// Authors:\r
-//     Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-// (C) 2008 Mainsoft Co. (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using java.util;\r
-using System.Collections.Specialized;\r
-using System.Collections;\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       partial class BaseExternalContext\r
-       {\r
-               abstract class BaseRequestParameterMap : AbstractAttributeMap\r
-               {\r
-                       readonly NameValueCollection _form;\r
-\r
-                       protected BaseRequestParameterMap (NameValueCollection form) {\r
-                               _form = form;\r
-                       }\r
-\r
-                       protected NameValueCollection Form {\r
-                               get { return _form; }\r
-                       }\r
-\r
-                       protected override void setAttribute (String key, Object value) {\r
-                               throw new NotSupportedException (\r
-                                       "Cannot set Request Parameter");\r
-                       }\r
-\r
-                       protected override void removeAttribute (String key) {\r
-                               throw new NotSupportedException (\r
-                                       "Cannot remove Request Parameter");\r
-                       }\r
-\r
-                       protected override Enumeration getAttributeNames () {\r
-                               return new EnumerationImpl (_form.Keys.GetEnumerator ());\r
-                       }\r
-\r
-                       sealed class EnumerationImpl : Enumeration\r
-                       {\r
-                               readonly IEnumerator _en;\r
-                               public EnumerationImpl (IEnumerator en) {\r
-                                       _en = en;\r
-                               }\r
-\r
-                               #region Enumeration Members\r
-\r
-                               public bool hasMoreElements () {\r
-                                       return _en.MoveNext ();\r
-                               }\r
-\r
-                               public object nextElement () {\r
-                                       return _en.Current;\r
-                               }\r
-\r
-                               #endregion\r
-                       }\r
-               }\r
-\r
-               sealed class RequestParameterMap : BaseRequestParameterMap\r
-               {\r
-                       public RequestParameterMap (NameValueCollection form)\r
-                               : base (form) {\r
-                       }\r
-\r
-                       protected override Object getAttribute (String key) {\r
-                               return Form [key];\r
-                       }\r
-               }\r
-\r
-               sealed class IEnumeratorIteratorImpl : Iterator\r
-               {\r
-                       readonly private IEnumerator _en;\r
-\r
-                       public IEnumeratorIteratorImpl (IEnumerator en) {\r
-                               _en = en;\r
-                       }\r
-\r
-                       public bool hasNext () {\r
-                               return _en.MoveNext ();\r
-                       }\r
-\r
-                       public Object next () {\r
-                               return _en.Current;\r
-                       }\r
-\r
-                       public void remove () {\r
-                               throw new NotSupportedException (GetType ().Name + " UnsupportedOperationException");\r
-                       }\r
-               }\r
-       }\r
-}
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/RequestParameterValuesMap.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/RequestParameterValuesMap.cs
deleted file mode 100644 (file)
index e9fa9b4..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//\r
-// Mainsoft.Web.Hosting.RequestParameterValuesMap.cs\r
-//\r
-// Authors:\r
-//     Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-// (C) 2008 Mainsoft Co. (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using java.util;\r
-using System.Collections.Specialized;\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       partial class BaseExternalContext\r
-       {\r
-               sealed class RequestParameterValuesMap : BaseRequestParameterMap\r
-               {\r
-                       public RequestParameterValuesMap (NameValueCollection form)\r
-                               : base (form) {\r
-                       }\r
-\r
-                       protected override Object getAttribute (String key) {\r
-                               return Form.GetValues (key);\r
-                       }\r
-               }\r
-       }\r
-}
\ No newline at end of file
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesContext.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesContext.cs
deleted file mode 100644 (file)
index ef2ebc0..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using javax.faces.context;\r
-using System.Web;\r
-using System.Web.UI;\r
-using javax.servlet;\r
-using javax.faces.lifecycle;\r
-using javax.faces.application;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public class ServletFacesContext : AspNetFacesContext\r
-       {\r
-               protected ServletFacesContext (FacesContext wrappedFacesContext, ExternalContext externalContext, HttpContext httpContext, FacesContext oldFacesContext)\r
-                       : base (wrappedFacesContext, externalContext, httpContext, oldFacesContext) {\r
-               }\r
-\r
-               public static ServletFacesContext GetFacesContext (FacesContextFactory facesContextFactory,\r
-                                                                                                                                       ServletContext servletContext,\r
-                                                                                                                                       ServletRequest servletRequest,\r
-                                                                                                                                       ServletResponse servletResponse,\r
-                                                                                                                                       Lifecycle lifecycle,\r
-                                                                                                                                       HttpContext httpContext,\r
-                                                                                                                                       string executionFilePath) {\r
-                       FacesContext oldFacesContex = FacesContext.getCurrentInstance ();\r
-                       FacesContext wrappedFacesContex = facesContextFactory.getFacesContext (servletContext, servletRequest, servletResponse, lifecycle);\r
-                       ExternalContext externalContext = new ServletExternalContext (wrappedFacesContex.getExternalContext (), httpContext, executionFilePath);\r
-                       ServletFacesContext context = new ServletFacesContext (wrappedFacesContex, externalContext, httpContext, oldFacesContex);\r
-                       return context;\r
-               }\r
-\r
-       }\r
-               #region ServletExternalContext\r
-\r
-               public class ServletExternalContext : BaseExternalContext\r
-               {\r
-                       readonly ExternalContext _externalContext;\r
-\r
-                       public ServletExternalContext (ExternalContext externalContext, HttpContext httpContext, string executionFilePath)\r
-                               : base (httpContext, executionFilePath) {\r
-                               _externalContext = externalContext;\r
-                       }\r
-\r
-                       public override void dispatch (string __p1) {\r
-                               _externalContext.dispatch (__p1);\r
-                       }\r
-\r
-                       public override string encodeActionURL (string __p1) {\r
-                               return _externalContext.encodeActionURL (__p1);\r
-                       }\r
-\r
-                       public override string encodeNamespace (string __p1) {\r
-                               return _externalContext.encodeNamespace (__p1);\r
-                       }\r
-\r
-                       public override string encodeResourceURL (string __p1) {\r
-                               return _externalContext.encodeResourceURL (__p1);\r
-                       }\r
-\r
-                       public override java.util.Map getApplicationMap () {\r
-                               return _externalContext.getApplicationMap ();\r
-                       }\r
-\r
-                       public override string getAuthType () {\r
-                               return _externalContext.getAuthType ();\r
-                       }\r
-\r
-                       public override object getContext () {\r
-                               return _externalContext.getContext ();\r
-                       }\r
-\r
-                       public override string getInitParameter (string __p1) {\r
-                               return _externalContext.getInitParameter (__p1);\r
-                       }\r
-\r
-                       public override java.util.Map getInitParameterMap () {\r
-                               return _externalContext.getInitParameterMap ();\r
-                       }\r
-\r
-                       public override string getRemoteUser () {\r
-                               return _externalContext.getRemoteUser ();\r
-                       }\r
-\r
-                       public override object getRequest () {\r
-                               return _externalContext.getRequest ();\r
-                       }\r
-\r
-                       public override string getRequestContextPath () {\r
-                               return _externalContext.getRequestContextPath ();\r
-                       }\r
-\r
-                       public override java.util.Map getRequestCookieMap () {\r
-                               return _externalContext.getRequestCookieMap ();\r
-                       }\r
-\r
-                       public override java.util.Map getRequestHeaderMap () {\r
-                               return _externalContext.getRequestHeaderMap ();\r
-                       }\r
-\r
-                       public override java.util.Map getRequestHeaderValuesMap () {\r
-                               return _externalContext.getRequestHeaderValuesMap ();\r
-                       }\r
-\r
-                       public override java.util.Locale getRequestLocale () {\r
-                               return _externalContext.getRequestLocale ();\r
-                       }\r
-\r
-                       public override java.util.Iterator getRequestLocales () {\r
-                               return _externalContext.getRequestLocales ();\r
-                       }\r
-\r
-                       public override java.util.Map getRequestMap () {\r
-                               return _externalContext.getRequestMap ();\r
-                       }\r
-\r
-                       public override string getRequestServletPath () {\r
-                               return _externalContext.getRequestServletPath ();\r
-                       }\r
-\r
-                       public override java.net.URL getResource (string __p1) {\r
-                               return _externalContext.getResource (__p1);\r
-                       }\r
-\r
-                       public override java.io.InputStream getResourceAsStream (string __p1) {\r
-                               return _externalContext.getResourceAsStream (__p1);\r
-                       }\r
-\r
-                       public override java.util.Set getResourcePaths (string __p1) {\r
-                               return _externalContext.getResourcePaths (__p1);\r
-                       }\r
-\r
-                       public override object getResponse () {\r
-                               return _externalContext.getResponse ();\r
-                       }\r
-\r
-                       public override object getSession (bool __p1) {\r
-                               return _externalContext.getSession (__p1);\r
-                       }\r
-\r
-                       public override java.util.Map getSessionMap () {\r
-                               return _externalContext.getSessionMap ();\r
-                       }\r
-\r
-                       public override java.security.Principal getUserPrincipal () {\r
-                               return _externalContext.getUserPrincipal ();\r
-                       }\r
-\r
-                       public override bool isUserInRole (string __p1) {\r
-                               return _externalContext.isUserInRole (__p1);\r
-                       }\r
-\r
-                       public override void log (string __p1, Exception __p2) {\r
-                               _externalContext.log (__p1, __p2);\r
-                       }\r
-\r
-                       public override void log (string __p1) {\r
-                               _externalContext.log (__p1);\r
-                       }\r
-\r
-                       public override void redirect (string __p1) {\r
-                               _externalContext.redirect (__p1);\r
-                       }\r
-               }\r
-\r
-               #endregion\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesPageHandler.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesPageHandler.cs
deleted file mode 100644 (file)
index fc9a5c7..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Web;\r
-using javax.faces.component;\r
-using System.Web.UI;\r
-using javax.faces.context;\r
-using javax.faces.lifecycle;\r
-using javax.faces;\r
-using javax.servlet;\r
-using javax.faces.webapp;\r
-using javax.servlet.http;\r
-using vmw.common;\r
-using System.Diagnostics;\r
-using javax.faces.render;\r
-using System.IO;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public abstract class BaseFacesPageHandler\r
-       {\r
-               static protected void SetupResponseWriter (AspNetFacesContext facesContext, string contentType, string characterEncoding) {\r
-                       RenderKit renderKit = BaseHttpServlet.RenderKitFactory.getRenderKit (facesContext, facesContext.getViewRoot ().getRenderKitId ());\r
-                       ResponseWriter writer = renderKit.createResponseWriter (new AspNetResponseWriter (facesContext.Context.Response.Output), contentType, characterEncoding);\r
-                       facesContext.setResponseWriter (writer);\r
-               }\r
-\r
-               #region AspNetResponseWriter\r
-               private sealed class AspNetResponseWriter : java.io.Writer\r
-               {\r
-                       readonly TextWriter _writer;\r
-                       public AspNetResponseWriter (TextWriter writer) {\r
-                               _writer = writer;\r
-                       }\r
-                       public override void close () {\r
-                               _writer.Close ();\r
-                       }\r
-\r
-                       public override void flush () {\r
-                               _writer.Flush ();\r
-                       }\r
-\r
-                       public override void write (char [] __p1, int __p2, int __p3) {\r
-                               _writer.Write (__p1, __p2, __p3);\r
-                       }\r
-\r
-                       public override void write (int __p1) {\r
-                               _writer.Write ((char) __p1);\r
-                       }\r
-\r
-                       public override void write (char [] __p1) {\r
-                               _writer.Write (__p1);\r
-                       }\r
-\r
-                       public override void write (string __p1) {\r
-                               _writer.Write (__p1);\r
-                       }\r
-\r
-                       public override void write (string __p1, int __p2, int __p3) {\r
-                               _writer.Write (__p1, __p2, __p3);\r
-                       }\r
-               }\r
-               #endregion\r
-       }\r
-\r
-       public class ServletFacesPageHandler : BaseFacesPageHandler, IHttpHandler, IServiceProvider\r
-       {\r
-               readonly FacesContextFactory _facesContextFactory;\r
-               readonly Lifecycle _lifecycle;\r
-               readonly string _executionFilePath;\r
-               readonly Type _pageType;\r
-               Page _page;\r
-\r
-               public bool IsReusable {\r
-                       get { return false; }\r
-               }\r
-\r
-               public ServletFacesPageHandler (string executionFilePath, Type pageType, FacesContextFactory facesContextFactory, Lifecycle lifecycle) {\r
-                       _facesContextFactory = facesContextFactory;\r
-                       _lifecycle = lifecycle;\r
-                       _executionFilePath = executionFilePath;\r
-                       _pageType = pageType;\r
-               }\r
-\r
-               protected virtual ServletFacesContext GetFacesContext (FacesContextFactory facesContextFactory,\r
-                                                                                                                                       ServletContext servletContext,\r
-                                                                                                                                       ServletRequest servletRequest,\r
-                                                                                                                                       ServletResponse servletResponse,\r
-                                                                                                                                       Lifecycle lifecycle,\r
-                                                                                                                                       HttpContext httpContext,\r
-                                                                                                                                       string executionFilePath) {\r
-                       return ServletFacesContext.GetFacesContext (facesContextFactory, servletContext, servletRequest, servletResponse, lifecycle, httpContext, executionFilePath);\r
-               }\r
-\r
-               public void ProcessRequest (HttpContext context) {\r
-                       ServletWorkerRequest wr = (ServletWorkerRequest) ((IServiceProvider) context).GetService (typeof (HttpWorkerRequest));\r
-                       ServletContext servletContext = wr.GetContext ();\r
-                       HttpServletRequest request = wr.ServletRequest;\r
-                       HttpServletResponse response = wr.ServletResponse;\r
-\r
-                       ServletFacesContext facesContext = GetFacesContext (_facesContextFactory, servletContext, request, response, _lifecycle, context, _executionFilePath);\r
-                       try {\r
-                               try {\r
-                                       try {\r
-                                               Trace.WriteLine ("FacesPageHandler: before execute");\r
-                                               _lifecycle.execute (facesContext);\r
-                                               Trace.WriteLine ("FacesPageHandler: after execute");\r
-                                       }\r
-                                       finally {\r
-                                               UIViewRoot viewRoot = facesContext.getViewRoot ();\r
-                                               if (viewRoot != null && viewRoot.getChildCount () > 0)\r
-                                                       _page = (Page) viewRoot.getChildren ().get (0);\r
-                                       }\r
-                                       Trace.WriteLine ("FacesPageHandler: before render");\r
-                                       SetupResponseWriter (facesContext, response.getContentType (), response.getCharacterEncoding ());\r
-                                       _lifecycle.render (facesContext);\r
-                                       Trace.WriteLine ("FacesPageHandler: after render");\r
-                               }\r
-                               catch (FacesException fex) {\r
-                                       Exception inner = fex.InnerException;\r
-                                       if (inner != null)\r
-                                               TypeUtils.Throw (inner);\r
-                                       throw;\r
-                               }\r
-                       }\r
-                       finally {\r
-                               facesContext.release ();\r
-                       }\r
-               }\r
-\r
-               public object GetService (Type serviceType) {\r
-                       if (serviceType == typeof (Type))\r
-                               return _pageType;\r
-                       if (serviceType == typeof (Page))\r
-                               return _page;\r
-                       return null;\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesPageHandlerFactory.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesPageHandlerFactory.cs
deleted file mode 100644 (file)
index af1398c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-using System.Web;\r
-using System.Web.Compilation;\r
-using System.Web.UI;\r
-using javax.faces.component;\r
-using javax.servlet;\r
-using javax.faces.context;\r
-using javax.faces.lifecycle;\r
-using javax.servlet.http;\r
-using System;\r
-using javax.faces.webapp;\r
-using javax.faces;\r
-using System.Web.J2EE;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public sealed class ServletFacesPageHandlerFactory : BaseFacesPageHandlerFactory\r
-       {\r
-               public override IHttpHandler GetHandler (HttpContext context, string requestType, string url, string path) {\r
-                       Type pageType = PageMapper.GetObjectType (context, url);\r
-                       IHttpHandler handler = new ServletFacesPageHandler (url, pageType, BaseHttpServlet.FacesContextFactory, BaseHttpServlet.Lifecycle);\r
-                       return SessionWrapper.WrapHandler (handler);\r
-               }\r
-       }\r
-}\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesStateManager.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesStateManager.cs
deleted file mode 100644 (file)
index 1da99bd..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Web.UI;\r
-\r
-using javax.faces;\r
-using javax.faces.application;\r
-using javax.faces.render;\r
-using javax.faces.component;\r
-using javax.faces.context;\r
-using System.Web.Hosting;\r
-using System.Web;\r
-using java.util;\r
-using System.Diagnostics;\r
-using javax.servlet.http;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public sealed class ServletFacesStateManager : BaseFacesStateManager\r
-       {\r
-               public override void writeState (FacesContext facesContext, StateManager.SerializedView serializedView) {\r
-                       Trace.WriteLine ("Entering writeState");\r
-\r
-                       if (serializedView != null) {\r
-                               if (isSavingStateInClient (facesContext)) {\r
-                                       SaveStateInClient (facesContext, serializedView);\r
-                               }\r
-                               else {\r
-                                       HttpSession session = (HttpSession) facesContext.getExternalContext ().getSession (true);\r
-                                       string key = ((IExtendedViewHandler) facesContext.getApplication ().getViewHandler ()).EncodeNamespace (facesContext, VIEWSTATE);\r
-                                       session.setAttribute (key, serializedView);\r
-                               }\r
-                       }\r
-\r
-                       Trace.WriteLine ("Exiting writeState");\r
-               }\r
-\r
-               protected override void restoreComponentState (FacesContext facesContext,\r
-                                                                                                 javax.faces.component.UIViewRoot uiViewRoot,\r
-                                                                                                 String renderKitId) {\r
-\r
-                       Trace.WriteLine ("Entering restoreComponentState");\r
-\r
-                       Object serializedComponentStates;\r
-                       if (isSavingStateInClient (facesContext)) {\r
-                               serializedComponentStates = GetStateFromClient (facesContext, uiViewRoot.getViewId(), renderKitId);\r
-                       }\r
-                       else {\r
-                               HttpSession session = (HttpSession) facesContext.getExternalContext ().getSession (false);\r
-                               if (session == null)\r
-                                       serializedComponentStates = null;\r
-                               else {\r
-                                       string key = ((IExtendedViewHandler) facesContext.getApplication ().getViewHandler ()).EncodeNamespace (facesContext, VIEWSTATE);\r
-                                       SerializedView serializedView = session.getAttribute (key) as SerializedView;\r
-                                       if (serializedView == null)\r
-                                               serializedComponentStates = null;\r
-                                       else\r
-                                               serializedComponentStates = serializedView.getState ();\r
-                               }\r
-                       }\r
-                       ((UIComponent) uiViewRoot.getChildren ().get (0)).processRestoreState (facesContext, serializedComponentStates);\r
-\r
-                       Trace.WriteLine ("Exiting restoreComponentState");\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesViewHandler.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletFacesViewHandler.cs
deleted file mode 100644 (file)
index 596577f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using javax.faces.application;\r
-using javax.servlet.http;\r
-using java.util;\r
-using javax.faces.context;\r
-using javax.faces.component;\r
-using java.lang;\r
-using javax.faces.render;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public class ServletFacesViewHandler : BaseFacesViewHandler\r
-       {\r
-               public ServletFacesViewHandler (ViewHandler viewHandler)\r
-                       : base (viewHandler) {\r
-               }\r
-\r
-               public override string getActionURL (FacesContext facesContext, string viewId) {\r
-                       if (viewId.Length > 0 && viewId [0] == '/') {\r
-                               return facesContext.getExternalContext ().getRequestContextPath () + viewId;\r
-                       }\r
-                       else {\r
-                               return viewId;\r
-                       }\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletIncludeUtils.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletIncludeUtils.cs
deleted file mode 100644 (file)
index d7cc5c5..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using javax.servlet;\r
-using System.Web;\r
-using javax.servlet.http;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public class ServletIncludeUtils\r
-       {\r
-               public static void includeServlet (String servletPath, Object writer, Object aspPage, Object [] servletParams) {\r
-                       // Need to define logic for resolving the servletPath. Share code with portlet createRenderUrl.\r
-                       HttpContext context = HttpContext.Current;\r
-                       HttpWorkerRequest wr = (HttpWorkerRequest) ((IServiceProvider) context).GetService (typeof (HttpWorkerRequest));\r
-                       RequestDispatcher dispatcher = ((ServletContext) ((IServiceProvider) wr).GetService (typeof (ServletContext))).getRequestDispatcher (SERVLET_INCLUDE_HELPER_PATH);\r
-                       ServletResponse response = (ServletResponse) ((IServiceProvider) wr).GetService (typeof (ServletResponse));\r
-                       ServletRequest request = (ServletRequest) ((IServiceProvider) wr).GetService (typeof (ServletRequest));\r
-\r
-                       // Setup params for the include call.\r
-                       String oldServletPath = (String) setAttribute (request, SERVLET_PATH_ATTRIBUTE_NAME, servletPath);\r
-                       Object oldAspPage = setAttribute (request, ASPPAGE_ATTRIBUTE_NAME, aspPage);\r
-                       Object [] oldServletParams = (Object []) setAttribute (request, SERVLET_PARAMS_ATTRIBUTE_NAME, servletParams);\r
-                       Object oldWriter = setAttribute (request, TEXT_WRITER_ATTRIBUTE_NAME, writer);\r
-\r
-                       // Do the include call.\r
-                       dispatcher.include (request, response);\r
-\r
-                       // Restore previous attribute values after the call.\r
-                       request.setAttribute (SERVLET_PATH_ATTRIBUTE_NAME, oldServletPath);\r
-                       request.setAttribute (ASPPAGE_ATTRIBUTE_NAME, oldAspPage);\r
-                       request.setAttribute (SERVLET_PARAMS_ATTRIBUTE_NAME, oldServletParams);\r
-                       request.setAttribute (TEXT_WRITER_ATTRIBUTE_NAME, oldWriter);\r
-               }\r
-\r
-               public static String getServletPath (ServletRequest request) {\r
-                       return (String) request.getAttribute (SERVLET_PATH_ATTRIBUTE_NAME);\r
-               }\r
-               public static Object getAspPage (ServletRequest request) {\r
-                       return request.getAttribute (ASPPAGE_ATTRIBUTE_NAME);\r
-               }\r
-               public static Object [] getServletParams (ServletRequest request) {\r
-                       return (Object []) request.getAttribute (SERVLET_PARAMS_ATTRIBUTE_NAME);\r
-               }\r
-               public static Object getTextWriter (ServletRequest request) {\r
-                       return request.getAttribute (TEXT_WRITER_ATTRIBUTE_NAME);\r
-               }\r
-\r
-               private static Object setAttribute (ServletRequest request, String attrname, Object newval) {\r
-                       Object oldval = request.getAttribute (attrname);\r
-                       request.setAttribute (attrname, newval);\r
-                       return oldval;\r
-               }\r
-\r
-               public static readonly String SERVLET_INCLUDE_HELPER_PATH = "/servletincludehelper";\r
-               public static readonly String ASPPAGE_ATTRIBUTE_NAME = "vmw.servlet.include.asppage";\r
-               public static readonly String SERVLET_PATH_ATTRIBUTE_NAME = "vmw.servlet.include.servlet.path";\r
-               public static readonly String SERVLET_PARAMS_ATTRIBUTE_NAME = "vmw.servlet.include.servlet.params";\r
-               public static readonly String TEXT_WRITER_ATTRIBUTE_NAME = "vmw.servlet.include.text.writer";\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletResourceLoader.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletResourceLoader.cs
deleted file mode 100644 (file)
index 82d4a90..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using vmw.@internal.io;\r
-using javax.servlet;\r
-using java.io;\r
-using java.net;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       class ServletResourceLoader : IResourceLoader\r
-       {\r
-               ServletContext _context;\r
-\r
-               public ServletResourceLoader (ServletContext context) {\r
-                       _context = context;\r
-               }\r
-\r
-               public URL getResource (String resourceName) {\r
-                       if (resourceName == null)\r
-                               throw new ArgumentNullException ("resourceName");\r
-\r
-                       if (!resourceName.StartsWith ("/"))\r
-                               resourceName = "/" + resourceName;\r
-\r
-                       return _context.getResource (resourceName);\r
-               }\r
-\r
-               public InputStream getResourceAsStream (String resourceName) {\r
-                       if (resourceName == null)\r
-                               throw new ArgumentNullException ("resourceName");\r
-\r
-                       if (!resourceName.StartsWith ("/"))\r
-                               resourceName = "/" + resourceName;\r
-\r
-                       return _context.getResourceAsStream (resourceName);\r
-               }\r
-\r
-               public java.util.Set getResourcePaths (String path) {\r
-                       if (path == null)\r
-                               throw new ArgumentNullException ("path");\r
-\r
-                       if (!path.StartsWith ("/"))\r
-                               path = "/" + path;\r
-\r
-                       return _context.getResourcePaths (path);\r
-               }\r
-       }\r
-\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.cs
deleted file mode 100644 (file)
index 6cff989..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using javax.servlet.http;
-using java.security;
-using javax.servlet;
-
-namespace Mainsoft.Web.Hosting
-{
-       public sealed class ServletWorkerRequest : BaseWorkerRequest
-       {
-               readonly HttpServlet _HttpServlet;
-               readonly HttpServletRequest _HttpServletRequest;
-               readonly HttpServletResponse _HttpServletResponse;
-               OutputStreamWrapper _outputStream;
-
-               public ServletWorkerRequest (HttpServlet servlet, HttpServletRequest req, HttpServletResponse resp)
-                       : base (req.getContextPath(), req.getServletPath (), req.getRequestURI ()) {
-
-                       _HttpServlet = servlet;
-                       _HttpServletRequest = req;
-                       _HttpServletResponse = resp;
-
-               }
-
-               static readonly Type typeOfHttpServletRequest = typeof (HttpServletRequest);
-               static readonly Type typeOfHttpServletResponse = typeof (HttpServletResponse);
-               static readonly Type typeOfHttpServlet = typeof (HttpServlet);
-               static readonly Type typeOfHttpSession = typeof (HttpSession);
-               static readonly Type typeOfServletContext = typeof (ServletContext);
-               static readonly Type typeOfServletConfig = typeof (ServletConfig);
-               public override object GetService (Type serviceType) {
-                       if (serviceType == typeOfHttpServlet ||
-                               serviceType == typeOfServletConfig)
-                               return _HttpServlet;
-                       if (serviceType == typeOfHttpServletRequest)
-                               return _HttpServletRequest;
-                       if (serviceType == typeOfHttpServletResponse)
-                               return _HttpServletResponse;
-                       if (serviceType == typeOfHttpSession)
-                               return GetSession (false);
-                       if (serviceType == typeOfServletContext)
-                               return _HttpServlet.getServletContext ();
-                       return base.GetService (serviceType);
-               }
-
-               public HttpServlet Servlet {
-                       get {
-                               return _HttpServlet;
-                       }
-               }
-
-               public HttpServletRequest ServletRequest {
-                       get {
-                               return _HttpServletRequest;
-                       }
-               }
-
-               public HttpServletResponse ServletResponse {
-                       get {
-                               return _HttpServletResponse;
-                       }
-               }
-
-               public override string GetHttpVerbName () {
-                       return _HttpServletRequest.getMethod ();
-               }
-
-               public override string GetHttpVersion () {
-                       return _HttpServletRequest.getProtocol ();
-               }
-
-               public override string GetLocalAddress () {
-                       return _HttpServletRequest.getLocalAddr ();
-               }
-
-               public override int GetLocalPort () {
-                       return _HttpServletRequest.getServerPort ();
-               }
-
-               public override string GetPathInfo () {
-                       return base.GetPathInfo () ?? String.Empty;
-               }
-
-               public override string GetQueryString () {
-                       return _HttpServletRequest.getQueryString ();
-               }
-
-               public override string GetRemoteAddress () {
-                       return _HttpServletRequest.getRemoteAddr ();
-               }
-
-               public override string GetRemoteName () {
-                       return _HttpServletRequest.getRemoteHost ();
-               }
-
-
-               public override int GetRemotePort () {
-                       try {
-                               return _HttpServletRequest.getRemotePort ();
-                       }
-                       catch (Exception e) {
-                               // if servlet API is 2.3 and below - there is no method getRemotePort 
-                               // in ServletRequest interface... should be described as limitation.
-                               return 0;
-                       }
-               }
-
-               public override string GetProtocol () {
-                       return _HttpServletRequest.getScheme ();
-               }
-
-               public override string GetServerName () {
-                       return _HttpServletRequest.getServerName ();
-               }
-
-               public override bool IsSecure () {
-                       return _HttpServletRequest.isSecure ();
-               }
-
-               public override void SendStatus (int statusCode, string statusDescription) {
-                       // setStatus(int, string) is deprecated
-                       _HttpServletResponse.setStatus (statusCode/*, statusDescription*/);
-               }
-
-               public override void SendUnknownResponseHeader (string name, string value) {
-                       if (HeadersSent ())
-                               return;
-
-                       _HttpServletResponse.addHeader (name, value);
-               }
-
-               public override bool HeadersSent () {
-                       return _HttpServletResponse.isCommitted ();
-               }
-
-               public override void SendCalculatedContentLength (int contentLength) {
-                       _HttpServletResponse.setContentLength (contentLength);
-               }
-
-               public override string GetAuthType () {
-                       return _HttpServletRequest.getAuthType ();
-               }
-
-               protected override int getContentLength () {
-                       return _HttpServletRequest.getContentLength ();
-               }
-
-               protected override string getContentType () {
-                       return _HttpServletRequest.getContentType ();
-               }
-
-               public override string GetRemoteUser () {
-                       return _HttpServletRequest.getRemoteUser ();
-               }
-
-               protected override java.util.Enumeration getHeaderNames () {
-                       return _HttpServletRequest.getHeaderNames ();
-               }
-
-               protected override string getHeader (string name) {
-                       return _HttpServletRequest.getHeader (name);
-               }
-
-               protected override java.io.InputStream getInputStream () {
-                       return _HttpServletRequest.getInputStream ();
-               }
-
-               public override javax.servlet.ServletContext GetContext () {
-                       return _HttpServlet.getServletContext ();
-               }
-
-               protected override OutputStreamWrapper CreateOutputStream (bool binary) {
-                       return _outputStream ?? (_outputStream = binary ?
-                               new OutputStreamWrapper (_HttpServletResponse.getOutputStream ()) :
-                               new OutputStreamWrapper (_HttpServletResponse.getWriter ()));
-               }
-
-               public override HttpSession GetSession (bool create) {
-                       return _HttpServletRequest.getSession (create);
-               }
-
-               public override bool IsRequestedSessionIdValid () {
-                       return _HttpServletRequest.isRequestedSessionIdValid ();
-               }
-               public override string GetRequestedSessionId () {
-                       return _HttpServletRequest.getRequestedSessionId ();
-               }
-
-               public override bool IsUserInRole (string name) {
-                       return _HttpServletRequest.isUserInRole (name);
-               }
-
-               public override Principal GetUserPrincipal () {
-                       return _HttpServletRequest.getUserPrincipal ();
-               }
-
-               public override BaseHttpContext CreateContext (System.Web.HttpContext context) {
-                       return new ServletHttpContext (context);
-               }
-       }
-}
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.jvm.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/ServletWorkerRequest.jvm.cs
deleted file mode 100644 (file)
index 60037a3..0000000
+++ /dev/null
@@ -1,430 +0,0 @@
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Text;
-using System.Runtime.InteropServices;
-using System.Web.Util;
-using System.Web.J2EE;
-using System.Collections;
-using System.Web;
-using javax.servlet;
-using javax.servlet.http;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Web.Hosting;
-using vmw.common;
-using InputStream=java.io.InputStream;
-using java.security;
-
-namespace Mainsoft.Web.Hosting {
-       [MonoTODO("Implement security demands on the path usage functions (and review)")]
-       [ComVisible (false)]
-       public abstract class BaseWorkerRequest : HttpWorkerRequest, IHttpExtendedWorkerRequest, IServiceProvider
-       {
-               OutputStreamWrapper _OutputStream;
-
-               readonly string _contextPath;
-               readonly string _requestUri;
-               readonly string _pathInfo;
-
-               static readonly StringDictionary _srvVarsToHeaderMap;
-
-               private string [][] unknownHeaders;
-               string _rawUrl;
-
-               private HttpWorkerRequest.EndOfSendNotification _endOfSendCallback;
-               private object _endOfSendArgs;
-
-               enum KnownServerVariable {
-                       AUTH_TYPE,
-                       CONTENT_LENGTH,
-                       CONTENT_TYPE,
-                       QUERY_STRING,
-                       REMOTE_ADDR,
-                       REMOTE_HOST,
-                       REMOTE_USER,
-                       REQUEST_METHOD,
-                       REQUEST_URI,
-                       SCRIPT_NAME,
-                       SERVER_NAME,
-                       SERVER_PORT,
-                       SERVER_PROTOCOL,
-                       SERVER_SOFTWARE,
-                       PATH_INFO
-               };
-
-               static readonly Hashtable KnownServerVariableMap;
-
-               static BaseWorkerRequest() {
-                       _srvVarsToHeaderMap = new StringDictionary();
-                       _srvVarsToHeaderMap.Add("HTTP_ACCEPT", "Accept");
-                       _srvVarsToHeaderMap.Add("HTTP_REFERER", "Referer");
-                       _srvVarsToHeaderMap.Add("HTTP_ACCEPT_LANGUAGE", "Accept-Language");
-                       _srvVarsToHeaderMap.Add("HTTP_ACCEPT_ENCODING", "Accept-Encoding");
-                       _srvVarsToHeaderMap.Add("HTTP_CONNECTION", "Connection");
-                       _srvVarsToHeaderMap.Add("HTTP_HOST", "Host");
-                       _srvVarsToHeaderMap.Add("HTTP_USER_AGENT", "User-Agent");
-                       _srvVarsToHeaderMap.Add("HTTP_SOAPACTION", "SOAPAction");
-
-                       string[] knownServerVariableNames = Enum.GetNames(typeof(KnownServerVariable));
-                       KnownServerVariableMap = CollectionsUtil.CreateCaseInsensitiveHashtable(knownServerVariableNames.Length);
-                       for (int i = 0; i < knownServerVariableNames.Length; i++)
-                               KnownServerVariableMap[knownServerVariableNames[i]] = (KnownServerVariable)i;
-               }
-
-               public BaseWorkerRequest (string contextPath, string servletPath, string requestURI) {
-
-
-                       _contextPath = contextPath;
-
-                       //string contextPath = req.getContextPath();
-                       //string servletPath = req.getServletPath ();
-                       //string requestURI = req.getRequestURI ();
-                       // servletPath - Returns the part of this request's URL that calls the servlet.
-                       //              so it contains default page.
-                       // requestURI - Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
-                       //              so it contains what the user passed.
-                       //
-                       // the one containing more information wins.
-                       if (contextPath.Length + servletPath.Length > requestURI.Length)
-                               requestURI = contextPath + servletPath;
-                       else { 
-                               int contextPos = requestURI.IndexOf(contextPath, StringComparison.Ordinal);
-                               if (contextPos > 0)
-                                       requestURI = requestURI.Substring (contextPos);
-                       }
-
-                       _requestUri = Uri.UnescapeDataString(requestURI);
-                       const int dotInvokeLength = 7; //".invoke".Length
-                       if (_requestUri.Length > dotInvokeLength &&
-                               String.CompareOrdinal(".invoke", 0, _requestUri, 
-                               _requestUri.Length - dotInvokeLength, dotInvokeLength) == 0) {
-
-                               _requestUri = _requestUri.Substring(0, _requestUri.Length - dotInvokeLength);
-                               
-                               int paramNameStart = _requestUri.LastIndexOf('/');
-                               _pathInfo = _requestUri.Substring(paramNameStart, _requestUri.Length - paramNameStart);
-                       }
-
-                       const int aspnetconfigLength = 12; //"aspnetconfig".Length
-                       int endingSlash = _requestUri [_requestUri.Length - 1] == '/' ? 1 : 0;
-                       if (_requestUri.Length > aspnetconfigLength &&
-                               String.CompareOrdinal ("aspnetconfig", 0, _requestUri,
-                               _requestUri.Length - aspnetconfigLength - endingSlash, aspnetconfigLength) == 0) {
-
-                               if (endingSlash == 0)
-                                       _requestUri += "/";
-                               _requestUri += "Default.aspx";
-                       }
-               }
-
-               static readonly Type typeOfWriter = typeof (java.io.Writer);
-               public virtual object GetService (Type serviceType)
-               {
-                       if (serviceType == typeOfWriter)
-                               return CreateOutputStream (false);
-                       return null;
-               }
-               
-               [MonoTODO("Implement security")]
-               public override string MachineInstallDirectory {
-                       get {
-                               return ".";
-                       }
-               }
-
-               public override string MachineConfigPath {
-                       get { return "."; }
-               }
-
-               public override void EndOfRequest () {
-                       if (_endOfSendCallback != null)
-                               _endOfSendCallback(this, _endOfSendArgs);
-                       _OutputStream = null;
-               }
-
-               public override void FlushResponse (bool finalFlush) {
-                       //kostat
-                       //IPortletActionResponse resp =_HttpServletResponse as IPortletActionResponse;
-                       //if (_OutputStream == null || resp != null && resp.isRedirected())
-                       //      return;
-                       if (_OutputStream == null)
-                               return;
-
-                       _OutputStream.flush();
-                       if (finalFlush)
-                               _OutputStream.close();
-               }
-
-               public override string GetAppPath () {
-                       return _contextPath;
-               }
-
-               public override string GetFilePath () {
-                       string uri = GetUriPath();
-                       string pathInfo = GetPathInfo();
-                       if (pathInfo != null && pathInfo.Length > 0)
-                               uri = uri.Substring (0, uri.Length - pathInfo.Length);
-
-                       return uri;
-               }
-
-               public override string GetFilePathTranslated () {
-                       string page = GetFilePath ();
-
-                       if (Path.DirectorySeparatorChar != '/')
-                               page = page.Replace ('/', Path.DirectorySeparatorChar);
-
-                       if (page [0] == Path.DirectorySeparatorChar)
-                               page = page.Substring (1);
-                       
-                       return Path.Combine (GetAppPathTranslated (), page);
-               }
-
-               public override string GetPathInfo () {
-                       return _pathInfo;
-               }               
-
-               public override string GetRawUrl () {
-                       if (_rawUrl == null) {
-                               StringBuilder builder = new StringBuilder();
-                               builder.Append(GetUriPath());
-                               string pathInfo = GetPathInfo();
-                               string query = GetQueryString();
-                               if (query != null && query.Length > 0) {
-                                       builder.Append('?');
-                                       builder.Append(query);
-                               }
-
-                               _rawUrl = builder.ToString();
-                       }
-
-                       return _rawUrl;
-               }
-
-               public override string GetServerVariable(string name) {
-                       // FIXME: We need to make a proper mapping between the standard server
-                       // variables and java equivalent. probably we have to have a configuration file 
-                       // which associates between the two. Pay a special attention on GetUnknownRequestHeader/s
-                       // while implementing. Ensure that system web "common" code correctly calls each method.
-
-                       string headerName = _srvVarsToHeaderMap[name];
-
-                       if (headerName != null)
-                               return getHeader( headerName );
-
-                       object knownVariable = KnownServerVariableMap[name];
-                       if (knownVariable != null)
-                               return GetKnownServerVariable((KnownServerVariable)knownVariable);
-
-                       return getHeader( name );
-               }
-
-               public abstract string GetAuthType ();
-               protected abstract int getContentLength ();
-               protected abstract string getContentType ();
-               public abstract string GetRemoteUser ();
-               protected abstract string getHeader (string name);
-               protected abstract java.util.Enumeration getHeaderNames ();
-               protected abstract InputStream getInputStream ();
-               public abstract ServletContext GetContext ();
-               protected abstract OutputStreamWrapper CreateOutputStream (bool binary);
-
-               public abstract HttpSession GetSession (bool create);
-               public abstract bool IsRequestedSessionIdValid ();
-               public abstract string GetRequestedSessionId ();
-               public abstract bool IsUserInRole (string name);
-               public abstract Principal GetUserPrincipal ();
-
-               string GetKnownServerVariable(KnownServerVariable index) {
-                       switch (index) {
-                               case KnownServerVariable.AUTH_TYPE : return GetAuthType();
-                               case KnownServerVariable.CONTENT_LENGTH : return Convert.ToString(getContentLength());
-                               case KnownServerVariable.CONTENT_TYPE : return getContentType();
-                               case KnownServerVariable.QUERY_STRING : return GetQueryString();
-                               case KnownServerVariable.REMOTE_ADDR : return GetRemoteAddress();
-                               case KnownServerVariable.REMOTE_HOST : return GetRemoteName();
-                               case KnownServerVariable.REMOTE_USER : return GetRemoteUser();
-                               case KnownServerVariable.REQUEST_METHOD : return GetHttpVerbName ();
-                               case KnownServerVariable.REQUEST_URI : return GetUriPath();
-                               case KnownServerVariable.SCRIPT_NAME : return GetFilePath ();
-                               case KnownServerVariable.SERVER_NAME : return GetServerName();
-                               case KnownServerVariable.SERVER_PORT : return Convert.ToString(GetLocalPort());
-                               case KnownServerVariable.SERVER_PROTOCOL : return GetHttpVersion ();
-                               case KnownServerVariable.SERVER_SOFTWARE : return GetContext().getServerInfo();
-                               case KnownServerVariable.PATH_INFO : return GetPathInfo();
-                               default: throw new IndexOutOfRangeException("index");
-                       }
-               }
-
-               public override string GetUriPath() {
-                       return _requestUri;
-               }
-
-               public override IntPtr GetUserToken() {
-                       return IntPtr.Zero;
-               }
-
-               public override string GetAppPathTranslated () {
-                       return J2EEUtils.GetApplicationRealPath (GetContext ());
-               }
-
-               public override string MapPath (string virtualPath) {
-                       if (virtualPath == null)
-                               throw new ArgumentNullException ("virtualPath");
-
-                       ServletContext context = GetContext ();
-
-                       string contextPath = GetAppPath ();
-                       if ((virtualPath.Length > contextPath.Length && virtualPath [contextPath.Length] != '/') ||
-                               string.Compare (contextPath, 0, virtualPath, 0, contextPath.Length, StringComparison.OrdinalIgnoreCase) != 0) {
-
-                               for (int appVirtualPathIndex = 0; appVirtualPathIndex > 0 && virtualPath.Length > appVirtualPathIndex; ) {
-                                       appVirtualPathIndex = virtualPath.IndexOf ('/', appVirtualPathIndex + 1);
-                                       string crossContextPath = appVirtualPathIndex > 0 ?
-                                               virtualPath.Remove (appVirtualPathIndex) : virtualPath;
-                                       ServletContext other = context.getContext (crossContextPath);
-                                       if (other != null) {
-                                               string appVirtualPath = appVirtualPathIndex > 0 ?
-                                                       virtualPath.Substring (appVirtualPathIndex) : String.Empty;
-                                               return other.getRealPath (appVirtualPath);
-                                       }
-                               }
-
-                               throw new HttpException (
-                                       String.Format ("MapPath: Mapping across applications is not allowed. ApplicationPath is '{0}', VirtualPath is '{1}'.",
-                                       contextPath, virtualPath));
-                       }
-
-                       string thisAppVirtualPath = virtualPath.Length > contextPath.Length ? virtualPath.Substring (contextPath.Length) : String.Empty;
-                       return J2EEUtils.GetApplicationRealPath (context, thisAppVirtualPath);
-
-               }
-
-               public override void SendResponseFromFile (IntPtr handle, long offset, long length) {
-                       throw new NotSupportedException();
-               }
-
-               public override void SendResponseFromFile (string filename, long offset, long length) {
-                       using (FileStream fs = File.OpenRead (filename)) {
-                               byte [] buffer = new byte [4 * 1024];
-
-                               if (offset != 0)
-                                       fs.Position = offset;
-
-                               long remain = length;
-                               int n;
-                               while (remain > 0 && (n = fs.Read (buffer, 0, (int) Math.Min (remain, buffer.Length))) != 0){
-                                       remain -= n;
-                                       SendResponseFromMemory(buffer, n);
-                               }
-                       }
-               }
-
-               //kostat
-               //private OutputStreamWrapper CreateOutputStream (bool binary)
-               //{
-               //    IPortletActionResponse resp = _HttpServletResponse as IPortletActionResponse;
-               //    if (resp != null)
-               //        return null; // no output stream while processAction
-
-               //    if (_OutputStream != null)
-               //        return _OutputStream;
-
-               //    if (_HttpServletResponse != null) {
-               //        if (binary)
-               //            _OutputStream = new OutputStreamWrapper (_HttpServletResponse.getOutputStream ());
-               //        else
-               //            _OutputStream = new OutputStreamWrapper (_HttpServletResponse.getWriter ());
-               //    }
-
-               //    return _OutputStream;
-               //}
-
-               public override void SendResponseFromMemory (byte [] data, int length) {
-                       _OutputStream = CreateOutputStream (true);
-
-                       if (_OutputStream == null)
-                               return;
-
-                       sbyte [] sdata = vmw.common.TypeUtils.ToSByteArray(data);
-                       _OutputStream.write(sdata, 0 , length);
-               }
-
-               public override void SendKnownResponseHeader (int index, string value) {
-                       SendUnknownResponseHeader (GetKnownResponseHeaderName (index), value);
-               }
-
-               public override string GetKnownRequestHeader (int index) {      
-                       return GetUnknownRequestHeader(GetKnownRequestHeaderName (index));
-               }
-
-               public override string GetUnknownRequestHeader (string name) {
-                       return getHeader(name);
-               }
-
-               public override string [][] GetUnknownRequestHeaders () {
-                       if (unknownHeaders == null) {
-                               ArrayList pairs = new ArrayList ();
-                               for (java.util.Enumeration he = getHeaderNames(); he.hasMoreElements() ;) {
-                                       string key = (string) he.nextElement();
-                                       int index = HttpWorkerRequest.GetKnownRequestHeaderIndex (key);
-                                       if (index != -1)
-                                               continue;
-                                       pairs.Add (new string [] {key, getHeader(key)});
-                               }
-                               
-                               if (pairs.Count != 0) {
-                                       unknownHeaders = new string [pairs.Count][];
-                                       for (int i = 0; i < pairs.Count; i++)
-                                               unknownHeaders [i] = (string []) pairs [i];
-                               }
-                       }
-                       if (unknownHeaders == null) unknownHeaders = new string [0][];
-
-                       return unknownHeaders;
-               }
-
-               public override int ReadEntityBody (byte [] buffer, int size) {
-                       if (buffer == null || size == 0)
-                               return 0;
-                       sbyte [] sbuffer = vmw.common.TypeUtils.ToSByteArray(buffer);
-                       InputStream inp = getInputStream();
-                       if (inp == null)
-                               return 0;
-                       int r = inp.read (sbuffer, 0, size);
-                       return r < 0 ? 0 : r;
-               }
-
-               public override void SetEndOfSendNotification(System.Web.HttpWorkerRequest.EndOfSendNotification callback, object extraData) {
-                       _endOfSendCallback = callback;
-                       _endOfSendArgs = extraData;
-               }
-
-               public abstract BaseHttpContext CreateContext (HttpContext context);
-       }
-}
-
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/SessionWrapper.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/SessionWrapper.cs
deleted file mode 100644 (file)
index 5af48a4..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Web;\r
-using System.Web.J2EE;\r
-using System.Web.SessionState;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public static class SessionWrapper\r
-       {\r
-               static readonly Type IRequiresSessionStateType = typeof (IRequiresSessionState);\r
-               static readonly Type IReadOnlySessionStateType = typeof (IReadOnlySessionState);\r
-\r
-               public static IHttpHandler WrapHandler (IHttpHandler handler) {\r
-                       Type type = (Type) ((IServiceProvider) handler).GetService (typeof (Type));\r
-\r
-                       if (IRequiresSessionStateType.IsAssignableFrom (type))\r
-                               return IReadOnlySessionStateType.IsAssignableFrom (type) ?\r
-                                       (handler is IHttpExtendedHandler ? (IHttpHandler) new ReadOnlySessionWrapperExtendedHandler ((IHttpExtendedHandler) handler) : new ReadOnlySessionWrapperHandler (handler)) :\r
-                                       (handler is IHttpExtendedHandler ? new SessionWrapperExtendedHandler ((IHttpExtendedHandler) handler) : new SessionWrapperHandler (handler));\r
-                       return handler;\r
-               }\r
-\r
-               #region SessionWrappers\r
-\r
-               class SessionWrapperHandler : IHttpHandler, IRequiresSessionState, IServiceProvider\r
-               {\r
-                       protected readonly IHttpHandler _handler;\r
-\r
-                       public SessionWrapperHandler (IHttpHandler handler) {\r
-                               _handler = handler;\r
-                       }\r
-\r
-                       public bool IsReusable {\r
-                               get { return _handler.IsReusable; }\r
-                       }\r
-\r
-                       public void ProcessRequest (HttpContext context) {\r
-                               _handler.ProcessRequest (context);\r
-                       }\r
-\r
-                       public object GetService (Type serviceType) {\r
-                               return ((IServiceProvider) _handler).GetService (serviceType);\r
-                       }\r
-               }\r
-\r
-               sealed class ReadOnlySessionWrapperHandler : SessionWrapperHandler, IReadOnlySessionState\r
-               {\r
-                       public ReadOnlySessionWrapperHandler (IHttpHandler handler) : base (handler) { }\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region ExtendedSessionWrappers\r
-\r
-               class SessionWrapperExtendedHandler : SessionWrapperHandler, IHttpExtendedHandler\r
-               {\r
-                       public SessionWrapperExtendedHandler (IHttpExtendedHandler handler)\r
-                               : base (handler) {\r
-                       }\r
-\r
-                       public bool IsCompleted {\r
-                               get { return ((IHttpExtendedHandler) _handler).IsCompleted; }\r
-                       }\r
-               }\r
-\r
-               sealed class ReadOnlySessionWrapperExtendedHandler : SessionWrapperExtendedHandler, IReadOnlySessionState\r
-               {\r
-                       public ReadOnlySessionWrapperExtendedHandler (IHttpExtendedHandler handler) : base (handler) { }\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.J2EE.csproj b/mcs/class/Mainsoft.Web/Mainsoft.Web.J2EE.csproj
deleted file mode 100644 (file)
index daf6b86..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <PropertyGroup>\r
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
-    <ProductVersion>8.0.50727</ProductVersion>\r
-    <SchemaVersion>2.0</SchemaVersion>\r
-    <ProjectGuid>{77DE6DDE-B8D4-4710-ADB3-4D5C3F4058C8}</ProjectGuid>\r
-    <OutputType>Library</OutputType>\r
-    <AppDesignerFolder>Properties</AppDesignerFolder>\r
-    <AssemblyName>Mainsoft.Web</AssemblyName>\r
-    <JDKName>1.4.2</JDKName>\r
-    <GHProjectType>1</GHProjectType>\r
-    <Version>2.0</Version>\r
-    <RootNamespace>Mainsoft.Web</RootNamespace>\r
-    <jarserver>iap2</jarserver>\r
-    <StartupObject>\r
-    </StartupObject>\r
-    <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
-    <OutputPath>bin\Release_Java\</OutputPath>\r
-    <DefineConstants>JAVA;NET_2_0</DefineConstants>\r
-    <BaseAddress>285212672</BaseAddress>\r
-    <Optimize>true</Optimize>\r
-    <DebugType>pdbonly</DebugType>\r
-    <PlatformTarget>AnyCPU</PlatformTarget>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <SkipValidation>false</SkipValidation>\r
-    <KeepIntermediate>false</KeepIntermediate>\r
-    <GHProjectType>1</GHProjectType>\r
-    <PreCompile>false</PreCompile>\r
-    <AdditionalClassPath>\r
-    </AdditionalClassPath>\r
-    <ApplicationServerType>\r
-    </ApplicationServerType>\r
-    <Version>2.0</Version>\r
-    <JDKName>1.4.2</JDKName>\r
-    <jarserver>iap2</jarserver>\r
-    <TargetPlatform>0</TargetPlatform>\r
-    <DocumentationFile>bin\Release_Java\Mainsoft.Web.XML</DocumentationFile>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
-    <DebugSymbols>true</DebugSymbols>\r
-    <OutputPath>bin\Debug_Java\</OutputPath>\r
-    <DefineConstants>TRACE;DEBUG;JAVA;NET_2_0</DefineConstants>\r
-    <BaseAddress>285212672</BaseAddress>\r
-    <DebugType>full</DebugType>\r
-    <PlatformTarget>AnyCPU</PlatformTarget>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <SkipValidation>True</SkipValidation>\r
-    <KeepIntermediate>False</KeepIntermediate>\r
-    <GHProjectType>1</GHProjectType>\r
-    <PreCompile>false</PreCompile>\r
-    <AdditionalClassPath>\r
-    </AdditionalClassPath>\r
-    <ApplicationServerType>\r
-    </ApplicationServerType>\r
-    <Version>2.0</Version>\r
-    <JDKName>1.4.2</JDKName>\r
-    <jarserver>iap2</jarserver>\r
-    <TargetPlatform>0</TargetPlatform>\r
-    <DocumentationFile>bin\Debug_Java\Mainsoft.Web.XML</DocumentationFile>\r
-  </PropertyGroup>\r
-  <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
-  <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
-       Other similar extension points exist, see Microsoft.Common.targets.\r
-  <Target Name="BeforeBuild">\r
-  </Target>\r
-  <Target Name="AfterBuild">\r
-  </Target>\r
-  -->\r
-  <ProjectExtensions>\r
-    <VisualStudio>\r
-      <UserProperties REFS-RefInfo-myfaces="repository:vmw:framework:2.0" REFS-JarPath-myfaces="" REFS-JarPath-JavaEE="" REFS-RefInfo-rt="repository:jre:sun:1.4.2" REFS-JarPath-rt="" REFS-JarPath-mscorlib="..\lib\mscorlib.jar" REFS-JarPath-system="..\lib\System.jar" REFS-JarPath-system-data="..\lib\System.Data.jar" REFS-JarPath-system-xml="..\lib\System.Xml.jar" REFS-JarPath-system-configuration="..\lib\System.Configuration.jar" REFS-JarPath-system-web="..\lib\System.Web.jar" REFS-JarPath-j2se-helpers="..\lib\J2SE.Helpers.jar" REFS-JarPath-j2ee-helpers="..\lib\J2EE.Helpers.jar" REFS-RefInfo-javaee="repository:JavaEE:tomcat:1.3" />\r
-    </VisualStudio>\r
-  </ProjectExtensions>\r
-  <ItemGroup>\r
-    <Reference Include="J2SE.Helpers">\r
-      <HintPath>..\lib\J2SE.Helpers.dll</HintPath>\r
-      <Private>False</Private>\r
-    </Reference>\r
-    <Reference Include="JavaEE, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />\r
-    <Reference Include="myfaces, Version=1.6.65535.65535, Culture=neutral, processorArchitecture=MSIL" />\r
-    <Reference Include="rt, Version=1.4.2.65535, Culture=neutral, processorArchitecture=MSIL" />\r
-    <Reference Include="System" />\r
-    <Reference Include="System.Configuration" />\r
-    <Reference Include="System.Data" />\r
-    <Reference Include="System.Web" />\r
-    <Reference Include="System.Xml" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
-      <Link>MonoTODOAttribute.cs</Link>\r
-    </Compile>\r
-    <Compile Include="Mainsoft.Web.Hosting\AbstractAttributeMap.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\BaseExternalContext.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\BaseFacesPageHandlerFactory.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\AspNetFacesContext.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\BaseFacesStateManager.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\BaseFacesViewHandler.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\IExtendedViewHandler.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\RequestParameterMap.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\RequestParameterValuesMap.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\ServletFacesContext.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\ServletFacesStateManager.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\ServletFacesViewHandler.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\BaseHttpServlet.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\BaseStaticHttpServlet.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\ServletFacesPageHandler.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\IncludeHelperServlet.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\OutputStreamWrapper.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\ServletFacesPageHandlerFactory.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\ServletIncludeUtils.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\ServletResourceLoader.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\ServletWorkerRequest.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\ServletWorkerRequest.jvm.cs" />\r
-    <Compile Include="Mainsoft.Web.Hosting\SessionWrapper.cs" />\r
-    <Compile Include="Mainsoft.Web.Profile\CloudscapeProfileProvider.cs" />\r
-    <Compile Include="Mainsoft.Web.Profile\DerbyProfileHelper.cs" />\r
-    <Compile Include="Mainsoft.Web.Profile\DerbyProfileProvider.cs" />\r
-    <Compile Include="Mainsoft.Web.Security\CloudscapeMembershipProvider.cs" />\r
-    <Compile Include="Mainsoft.Web.Security\CloudscapeRoleProvider.cs" />\r
-    <Compile Include="Mainsoft.Web.Security\DerbyApplicationsHelper.cs" />\r
-    <Compile Include="Mainsoft.Web.Security\DerbyMembershipHelper.cs" />\r
-    <Compile Include="Mainsoft.Web.Security\DerbyMembershipProvider.cs" />\r
-    <Compile Include="Mainsoft.Web.Security\DerbyRoleProvider.cs" />\r
-    <Compile Include="Mainsoft.Web.Security\DerbyRolesHelper.cs" />\r
-    <Compile Include="Mainsoft.Web.Security\DerbyDBSchema.cs" />\r
-    <Compile Include="Mainsoft.Web.Security\ServletAuthenticationModule.cs" />\r
-    <Compile Include="Mainsoft.Web.SessionState\ServletSessionStateItemCollection.cs" />\r
-    <Compile Include="Mainsoft.Web.SessionState\ObjectInputStream.cs" />\r
-    <Compile Include="Mainsoft.Web.SessionState\ObjectOutputStream.cs" />\r
-    <Compile Include="Mainsoft.Web.SessionState\ServletSessionIDManager.cs" />\r
-    <Compile Include="Mainsoft.Web.SessionState\ServletSessionStateStoreProvider.cs" />\r
-    <Compile Include="Mainsoft.Web.SessionState\SessionListener.cs" />\r
-    <Compile Include="Mainsoft.Web\BaseHttpContext.cs" />\r
-    <Compile Include="Mainsoft.Web\J2EEConsts.cs" />\r
-    <Compile Include="Mainsoft.Web\J2EEUtils.cs" />\r
-    <Compile Include="Mainsoft.Web\ServletHttpContext.cs" />\r
-    <Compile Include="Properties\AssemblyInfo.cs" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <ProjectReference Include="..\System.Web\System.Web.Phantom\System.Web.Phantom.csproj">\r
-      <Project>{FBFDAD51-74B6-4660-81C0-9C8B6C8D3B47}</Project>\r
-      <Name>System.Web.Phantom</Name>\r
-      <Private>False</Private>\r
-    </ProjectReference>\r
-  </ItemGroup>\r
-</Project>\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/.gitattributes
deleted file mode 100644 (file)
index 4f3bf36..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/CloudscapeProfileProvider.cs -crlf
-/DerbyProfileHelper.cs -crlf
-/DerbyProfileProvider.cs -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/CloudscapeProfileProvider.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/CloudscapeProfileProvider.cs
deleted file mode 100644 (file)
index 34eac6e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//\r
-// Mainsoft.Web.Profile.CloudscapeProfileProvider\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-// (C) 2006 Mainsoft\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections.Specialized;\r
-using System.Text;\r
-\r
-namespace Mainsoft.Web.Profile\r
-{\r
-       /// <summary>\r
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
-       /// </summary>\r
-       [Obsolete]\r
-       public class CloudscapeProfileProvider : DerbyProfileProvider\r
-       {\r
-               public override void Initialize (string name, NameValueCollection config)\r
-               {\r
-                       if (string.IsNullOrEmpty (name))\r
-                               name = "CloudscapeProfileProvider";\r
-\r
-                       base.Initialize (name, config);\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileHelper.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileHelper.cs
deleted file mode 100644 (file)
index f67a38b..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-//\r
-// Mainsoft.Web.Profile.DerbyProfileHelper\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-// (C) 2006 Mainsoft\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Web.Security;\r
-using System.Web.Configuration;\r
-using System.Data;\r
-using System.Data.OleDb;\r
-using System.Data.Common;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-\r
-using Mainsoft.Web.Security;\r
-\r
-namespace Mainsoft.Web.Profile\r
-{\r
-       class DerbyProfileHelper\r
-       {\r
-               private static OleDbParameter AddParameter (OleDbCommand command, string paramName, object paramValue)\r
-               {\r
-                       OleDbParameter prm = new OleDbParameter (paramName, paramValue);\r
-                       command.Parameters.Add (prm);\r
-                       return prm;\r
-               }\r
-\r
-               public static int Profile_DeleteInactiveProfiles(DbConnection connection, string applicationName, int profileAuthOptions, DateTime inactiveSinceDate)\r
-               {\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 0;\r
-\r
-                       string queryDelete = @"DELETE FROM aspnet_Profile WHERE UserId IN ( " +\r
-                               "SELECT UserId FROM aspnet_Users WHERE ApplicationId = ? AND LastActivityDate <= ? " + \r
-                               GetProfileAuthOptions (profileAuthOptions) + ")";\r
-                       OleDbCommand cmdDelete = new OleDbCommand (queryDelete, (OleDbConnection) connection);\r
-                       AddParameter (cmdDelete, "ApplicationId", appId);\r
-                       AddParameter (cmdDelete, "LastActivityDate", inactiveSinceDate);\r
-\r
-                       return cmdDelete.ExecuteNonQuery ();\r
-               }\r
-\r
-               public static int Profile_DeleteProfiles(DbConnection connection, string applicationName, string [] userNames)\r
-               {\r
-                       int deletedUsers = 0;\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 0;\r
-\r
-                       OleDbTransaction trans = (OleDbTransaction) connection.BeginTransaction ();\r
-                       try {\r
-                               foreach (string username in userNames) {\r
-                                       string userId = GetUserId (connection, trans, appId, username);\r
-                                       if (userId == null)\r
-                                               continue;\r
-\r
-                                       string queryDelete = "DELETE FROM aspnet_Profile WHERE UserId = ?";\r
-                                       OleDbCommand cmdDelete = new OleDbCommand (queryDelete, (OleDbConnection) connection);\r
-                                       cmdDelete.Transaction = trans;\r
-                                       AddParameter (cmdDelete, "UserId", userId);\r
-                                       cmdDelete.Transaction = trans;\r
-                                       deletedUsers += cmdDelete.ExecuteNonQuery ();\r
-                               }\r
-                               trans.Commit ();\r
-                               return deletedUsers;\r
-                       }\r
-                       catch (Exception e) {\r
-                               trans.Rollback ();\r
-                               throw e;\r
-                       }\r
-               }\r
-\r
-               public static int Profile_GetNumberOfInactiveProfiles (DbConnection connection, string applicationName, int profileAuthOptions, DateTime inactiveSinceDate)\r
-               {\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 0;\r
-\r
-                       string querySelect = @"SELECT COUNT(*) FROM aspnet_Users usr, aspnet_Profile prf WHERE ApplicationId = ? " +\r
-                               "AND usr.UserId = prf.UserId AND LastActivityDate <= ? " + GetProfileAuthOptions(profileAuthOptions);\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "ApplicationId", appId);\r
-                       AddParameter (cmdSelect, "LastActivityDate", inactiveSinceDate);\r
-\r
-                       using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       return reader.GetInt32 (0);\r
-                       }\r
-                       return 0;\r
-               }\r
-\r
-               public static int Profile_GetInactiveProfiles (DbConnection connection, string applicationName, int profileAuthOptions, int pageIndex, int pageSize, string userNameToMatch, DateTime inactiveSinceDate, out DbDataReader reader)\r
-               {\r
-                       reader = null;\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return -1;\r
-\r
-                       string querySelect = @"SELECT usr.UserName, usr.IsAnonymous, usr.LastActivityDate, prf.LastUpdatedDate, " +\r
-                               "LENGTH(prf.PropertyNames) + LENGTH(prf.PropertyValuesString) + LENGTH(prf.PropertyValuesBinary)" +\r
-                               "FROM aspnet_Users usr, aspnet_Profile prf WHERE usr.ApplicationId = ? AND usr.UserId = prf.UserId " +\r
-                               "AND usr.LastActivityDate <= ? " + GetProfileAuthOptions (profileAuthOptions) +\r
-                               (string.IsNullOrEmpty(userNameToMatch) ? "" : " AND usr.LoweredUserName LIKE ?");\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "ApplicationId", appId);\r
-                       AddParameter (cmdSelect, "LastActivityDate", inactiveSinceDate);\r
-                       if (!string.IsNullOrEmpty (userNameToMatch))\r
-                               AddParameter (cmdSelect, "LoweredUserName", userNameToMatch.ToLowerInvariant());\r
-                       reader = cmdSelect.ExecuteReader ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Profile_GetProfiles (DbConnection connection, string applicationName, int profileAuthOptions, int pageIndex, int pageSize, string userNameToMatch, out DbDataReader reader)\r
-               {\r
-                       reader = null;\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return -1;\r
-\r
-                       string querySelect = @"SELECT usr.UserName, usr.IsAnonymous, usr.LastActivityDate, prf.LastUpdatedDate, " +\r
-                               "LENGTH(prf.PropertyNames) + LENGTH(prf.PropertyValuesString) + LENGTH(prf.PropertyValuesBinary)" +\r
-                               "FROM aspnet_Users usr, aspnet_Profile prf WHERE ApplicationId = ? AND usr.UserId = prf.UserId " +\r
-                               GetProfileAuthOptions (profileAuthOptions) +\r
-                               (string.IsNullOrEmpty (userNameToMatch) ? "" : " AND usr.LoweredUserName LIKE ?");\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "ApplicationId", appId);\r
-                       if (!string.IsNullOrEmpty (userNameToMatch))\r
-                               AddParameter (cmdSelect, "LoweredUserName", userNameToMatch.ToLowerInvariant ());\r
-                       reader = cmdSelect.ExecuteReader ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Profile_GetProperties (DbConnection connection, string applicationName, string username, DateTime currentTimeUtc, out DbDataReader reader)\r
-               {\r
-                       reader = null;\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return -1;\r
-\r
-                       string userId = GetUserId (connection, null, appId, username);\r
-                       if (userId == null)\r
-                               return -1;\r
-\r
-                       string queryUpdUser = @"UPDATE aspnet_Users SET LastActivityDate = ? WHERE UserId = ?";\r
-                       OleDbCommand cmdUpdUser = new OleDbCommand (queryUpdUser, (OleDbConnection) connection);\r
-                       AddParameter (cmdUpdUser, "LastActivityDate", currentTimeUtc);\r
-                       AddParameter (cmdUpdUser, "UserId", userId);\r
-                       cmdUpdUser.ExecuteNonQuery ();\r
-\r
-                       string querySelect = @"SELECT PropertyNames, PropertyValuesString, PropertyValuesBinary FROM aspnet_Profile WHERE UserId = ?";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "UserId", userId);\r
-                       reader = cmdSelect.ExecuteReader ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Profile_SetProperties (DbConnection connection, string applicationName, string propertyNames, string propertyValuesString, byte [] propertyValuesBinary, string username, bool isUserAnonymous, DateTime currentTimeUtc)\r
-               {\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null) {\r
-                               object newAppId = DerbyApplicationsHelper.Applications_CreateApplication (connection, applicationName);\r
-                               appId = newAppId as string;\r
-                               if (appId == null)\r
-                                       return -1;\r
-                       }\r
-\r
-                       OleDbTransaction trans = (OleDbTransaction) connection.BeginTransaction ();\r
-                       try {\r
-                               string userId = GetUserId (connection, trans, appId, username);\r
-                               if (userId == null) {\r
-                                       object newUserId = null;\r
-                                       DerbyMembershipHelper.Users_CreateUser (connection, trans, appId, username, true, currentTimeUtc, ref newUserId);\r
-                                       userId = newUserId as string;\r
-                                       if (userId == null) {\r
-                                               trans.Rollback ();\r
-                                               return -1;\r
-                                       }\r
-                               }\r
-\r
-                               string queryUpdUser = @"UPDATE aspnet_Users SET LastActivityDate=? WHERE UserId = ?";\r
-                               OleDbCommand cmdUpdUser = new OleDbCommand (queryUpdUser, (OleDbConnection) connection);\r
-                               cmdUpdUser.Transaction = trans;\r
-                               AddParameter (cmdUpdUser, "LastActivityDate", currentTimeUtc);\r
-                               AddParameter (cmdUpdUser, "UserId", userId);\r
-                               cmdUpdUser.ExecuteNonQuery ();\r
-\r
-                               string querySelect = @"SELECT * FROM aspnet_Profile WHERE UserId = ?";\r
-                               OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                               cmdSelect.Transaction = trans;\r
-                               AddParameter (cmdSelect, "UserId", userId);\r
-                               bool userHasRecords = false;\r
-                               using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {\r
-                                       userHasRecords = reader.HasRows;\r
-                               }\r
-\r
-                               if (userHasRecords) {\r
-                                       string queryUpdate = @"UPDATE aspnet_Profile SET PropertyNames = ?, PropertyValuesString = ?, " +\r
-                                               "PropertyValuesBinary = ?, LastUpdatedDate = ? WHERE  UserId = ?";\r
-                                       OleDbCommand cmdUpdate = new OleDbCommand (queryUpdate, (OleDbConnection) connection);\r
-                                       cmdUpdate.Transaction = trans;\r
-                                       AddParameter (cmdUpdate, "PropertyNames", propertyNames);\r
-                                       AddParameter (cmdUpdate, "PropertyValuesString", propertyValuesString);\r
-                                       AddParameter (cmdUpdate, "PropertyValuesBinary", propertyValuesBinary);\r
-                                       AddParameter (cmdUpdate, "LastUpdatedDate", currentTimeUtc);\r
-                                       AddParameter (cmdUpdate, "UserId", userId);\r
-                                       cmdUpdate.ExecuteNonQuery ();\r
-                               }\r
-                               else {\r
-                                       string queryInsert = @"INSERT INTO aspnet_Profile(UserId, PropertyNames, PropertyValuesString, " +\r
-                                               "PropertyValuesBinary, LastUpdatedDate) VALUES (?, ?, ?, ?, ?)";\r
-                                       OleDbCommand cmdInsert = new OleDbCommand (queryInsert, (OleDbConnection) connection);\r
-                                       cmdInsert.Transaction = trans;\r
-                                       AddParameter (cmdInsert, "UserId", userId);\r
-                                       AddParameter (cmdInsert, "PropertyNames", propertyNames);\r
-                                       AddParameter (cmdInsert, "PropertyValuesString", propertyValuesString);\r
-                                       AddParameter (cmdInsert, "PropertyValuesBinary", propertyValuesBinary);\r
-                                       AddParameter (cmdInsert, "LastUpdatedDate", currentTimeUtc);\r
-                                       cmdInsert.ExecuteNonQuery ();\r
-                               }\r
-                               trans.Commit ();\r
-                       }\r
-                       catch (Exception e) {\r
-                               trans.Rollback ();\r
-                               throw e;\r
-                       }\r
-                       return 0;\r
-               }\r
-\r
-               private static string GetUserId (DbConnection connection, DbTransaction trans, string applicationId, string username)\r
-               {\r
-                       if (username == null)\r
-                               return null;\r
-\r
-                       string selectQuery = "SELECT UserId FROM aspnet_Users WHERE LoweredUserName = ? AND ApplicationId = ?";\r
-\r
-                       OleDbCommand selectCmd = new OleDbCommand (selectQuery, (OleDbConnection) connection);\r
-                       if (trans != null)\r
-                               selectCmd.Transaction = (OleDbTransaction) trans;\r
-\r
-                       AddParameter (selectCmd, "LoweredUserName", username.ToLowerInvariant ());\r
-                       AddParameter (selectCmd, "ApplicationId", applicationId);\r
-                       using (OleDbDataReader reader = selectCmd.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       return reader.GetString (0);\r
-                       }\r
-\r
-                       return null;\r
-               }\r
-               \r
-               private static string GetProfileAuthOptions (int profileAuthOptions)\r
-               {\r
-                       switch (profileAuthOptions) {\r
-                               case 1:\r
-                                       return "AND IsAnonymous = 0";\r
-\r
-                               case 2:\r
-                                       return "AND IsAnonymous = 1";\r
-                       }\r
-                       return string.Empty;\r
-               }\r
-       }\r
-}\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileProvider.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Profile/DerbyProfileProvider.cs
deleted file mode 100644 (file)
index 95a4a89..0000000
+++ /dev/null
@@ -1,471 +0,0 @@
-//\r
-// Mainsoft.Web.Profile.DerbyProfileProvider\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-// (C) 2006 Mainsoft\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Data.OleDb;\r
-using System.Data.Common;\r
-using System.Collections;\r
-using System.Configuration;\r
-using System.Globalization;\r
-using System.Web.Profile;\r
-using System.Web.Configuration;\r
-using System.Collections.Specialized;\r
-using System.Text;\r
-using System.IO;\r
-\r
-using Mainsoft.Web.Security;\r
-using System.Configuration.Provider;\r
-\r
-namespace Mainsoft.Web.Profile\r
-{\r
-       /// <summary>\r
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
-       /// <para>Manages storage of profile information for an ASP.NET application in a Derby database.</para>\r
-       /// </summary>\r
-       public class DerbyProfileProvider : ProfileProvider\r
-       {\r
-               ConnectionStringSettings _connectionString;\r
-               string _applicationName = string.Empty;\r
-               bool _schemaChecked = false;\r
-               DerbyUnloadManager.DerbyShutDownPolicy _shutDownPolicy = DerbyUnloadManager.DerbyShutDownPolicy.Default;\r
-\r
-               public DerbyProfileProvider ()\r
-               {\r
-               }\r
-\r
-               public override string ApplicationName\r
-               {\r
-                       get { return _applicationName; }\r
-                       set { _applicationName = value; }\r
-               }\r
-\r
-               DbConnection CreateConnection ()\r
-               {\r
-                       if (!_schemaChecked) {\r
-                               DerbyDBSchema.CheckSchema (_connectionString.ConnectionString);\r
-                               _schemaChecked = true;\r
-\r
-                               DerbyUnloadManager.RegisterUnloadHandler (_connectionString.ConnectionString, _shutDownPolicy);\r
-                       }\r
-\r
-                       OleDbConnection connection = new OleDbConnection (_connectionString.ConnectionString);\r
-                       connection.Open ();\r
-                       return connection;\r
-               }\r
-               \r
-               public override int DeleteInactiveProfiles (ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate)\r
-               {\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               return DerbyProfileHelper.Profile_DeleteInactiveProfiles (connection, ApplicationName, (int) authenticationOption, userInactiveSinceDate);\r
-                       }\r
-               }\r
-\r
-               public override int DeleteProfiles (ProfileInfoCollection profiles)\r
-               {\r
-                       if (profiles == null)\r
-                               throw new ArgumentNullException ("profiles");\r
-                       if (profiles.Count == 0)\r
-                               throw new ArgumentException ("profiles");\r
-\r
-                       string [] usernames = new string [profiles.Count];\r
-\r
-                       int i = 0;\r
-                       foreach (ProfileInfo pi in profiles) {\r
-                               if (pi.UserName == null)\r
-                                       throw new ArgumentNullException ("element in profiles collection is null");\r
-\r
-                               if (pi.UserName.Length == 0 || pi.UserName.Length > 256 || pi.UserName.IndexOf (",") != -1)\r
-                                       throw new ArgumentException ("element in profiles collection in illegal format");\r
-\r
-                               usernames [i++] = pi.UserName;\r
-                       }\r
-\r
-                       return DeleteProfilesInternal (usernames);\r
-               }\r
-\r
-               public override int DeleteProfiles (string [] usernames)\r
-               {\r
-                       if (usernames == null)\r
-                               throw new ArgumentNullException ("usernames");\r
-\r
-                       Hashtable users = new Hashtable ();\r
-                       foreach (string username in usernames) {\r
-                               if (username == null)\r
-                                       throw new ArgumentNullException ("element in usernames array is null");\r
-\r
-                               if (username.Length == 0 || username.Length > 256 || username.IndexOf (",") != -1)\r
-                                       throw new ArgumentException ("element in usernames array in illegal format");\r
-\r
-                               if (users.ContainsKey (username))\r
-                                       throw new ArgumentException ("duplicate element in usernames array");\r
-\r
-                               users.Add (username, username);\r
-                       }\r
-\r
-                       return DeleteProfilesInternal (usernames);\r
-               }\r
-\r
-               private int DeleteProfilesInternal (string[] usernames)\r
-               {\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               return DerbyProfileHelper.Profile_DeleteProfiles (connection, ApplicationName, usernames);\r
-                       }\r
-               }\r
-\r
-               public override ProfileInfoCollection FindInactiveProfilesByUserName (ProfileAuthenticationOption authenticationOption,\r
-                                                                                         string usernameToMatch,\r
-                                                                                         DateTime userInactiveSinceDate,\r
-                                                                                         int pageIndex,\r
-                                                                                         int pageSize,\r
-                                                                                         out int totalRecords)\r
-               {\r
-                       CheckParam ("usernameToMatch", usernameToMatch, 256);\r
-                       if (pageIndex < 0)\r
-                               throw new ArgumentException ("pageIndex is less than zero");\r
-                       if (pageSize < 1)\r
-                               throw new ArgumentException ("pageIndex is less than one");\r
-                       if (pageIndex * pageSize + pageSize - 1 > Int32.MaxValue)\r
-                               throw new ArgumentException ("pageIndex and pageSize are too large");\r
-\r
-                       DbDataReader reader = null;\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               totalRecords = DerbyProfileHelper.Profile_GetInactiveProfiles (connection, ApplicationName, (int) authenticationOption, pageIndex, pageSize, usernameToMatch, userInactiveSinceDate, out reader);\r
-\r
-                               using (reader) {\r
-                                       return BuildProfileInfoCollection (reader, pageIndex, pageSize, out totalRecords);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public override ProfileInfoCollection FindProfilesByUserName (ProfileAuthenticationOption authenticationOption,\r
-                                                                                         string usernameToMatch,\r
-                                                                                         int pageIndex,\r
-                                                                                         int pageSize,\r
-                                                                                         out int totalRecords)\r
-               {\r
-                       CheckParam ("usernameToMatch", usernameToMatch, 256);\r
-                       if (pageIndex < 0)\r
-                               throw new ArgumentException ("pageIndex is less than zero");\r
-                       if (pageSize < 1)\r
-                               throw new ArgumentException ("pageIndex is less than one");\r
-                       if (pageIndex * pageSize + pageSize - 1 > Int32.MaxValue)\r
-                               throw new ArgumentException ("pageIndex and pageSize are too large");\r
-\r
-                       DbDataReader reader = null;\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               totalRecords = DerbyProfileHelper.Profile_GetProfiles (connection, ApplicationName, (int) authenticationOption, pageIndex, pageSize, usernameToMatch, out reader);\r
-\r
-                               using (reader) {\r
-                                       return BuildProfileInfoCollection (reader, pageIndex, pageSize, out totalRecords);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public override ProfileInfoCollection GetAllInactiveProfiles (ProfileAuthenticationOption authenticationOption,\r
-                                                                                     DateTime userInactiveSinceDate,\r
-                                                                                     int pageIndex,\r
-                                                                                     int pageSize,\r
-                                                                                     out int totalRecords)\r
-               {\r
-                       if (pageIndex < 0)\r
-                               throw new ArgumentException ("pageIndex is less than zero");\r
-                       if (pageSize < 1)\r
-                               throw new ArgumentException ("pageIndex is less than one");\r
-                       if (pageIndex * pageSize + pageSize - 1 > Int32.MaxValue)\r
-                               throw new ArgumentException ("pageIndex and pageSize are too large");\r
-\r
-                       DbDataReader reader = null;\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               totalRecords = DerbyProfileHelper.Profile_GetInactiveProfiles (\r
-                                       connection, ApplicationName, (int) authenticationOption, \r
-                                       pageIndex, pageSize, null, userInactiveSinceDate, out reader);\r
-\r
-                               using (reader) {\r
-                                       return BuildProfileInfoCollection (reader, pageIndex, pageSize, out totalRecords);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public override ProfileInfoCollection GetAllProfiles (ProfileAuthenticationOption authenticationOption,\r
-                                                                                     int pageIndex,\r
-                                                                                     int pageSize,\r
-                                                                                     out int totalRecords)\r
-               {\r
-                       if (pageIndex < 0)\r
-                               throw new ArgumentException ("pageIndex is less than zero");\r
-                       if (pageSize < 1)\r
-                               throw new ArgumentException ("pageIndex is less than one");\r
-                       if (pageIndex * pageSize + pageSize - 1 > Int32.MaxValue)\r
-                               throw new ArgumentException ("pageIndex and pageSize are too large");\r
-\r
-                       DbDataReader reader = null;\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               totalRecords = DerbyProfileHelper.Profile_GetProfiles (\r
-                                       connection, ApplicationName, (int) authenticationOption, \r
-                                       pageIndex, pageSize, null, out reader);\r
-\r
-                               using (reader) {\r
-                                       return BuildProfileInfoCollection (reader, pageIndex, pageSize, out totalRecords);\r
-                               }\r
-                       }\r
-               }\r
-\r
-               public override int GetNumberOfInactiveProfiles (ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate)\r
-               {\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               return DerbyProfileHelper.Profile_GetNumberOfInactiveProfiles (\r
-                                       connection, ApplicationName, (int) authenticationOption, userInactiveSinceDate);\r
-                       }\r
-               }\r
-\r
-               public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext sc, SettingsPropertyCollection properties)\r
-               {\r
-                       SettingsPropertyValueCollection settings = new SettingsPropertyValueCollection ();\r
-\r
-                       if (properties.Count == 0)\r
-                               return settings;\r
-\r
-                       foreach (SettingsProperty property in properties) {\r
-                               if (property.SerializeAs == SettingsSerializeAs.ProviderSpecific)\r
-                                       if (property.PropertyType.IsPrimitive || property.PropertyType == typeof (String))\r
-                                               property.SerializeAs = SettingsSerializeAs.String;\r
-                                       else\r
-                                               property.SerializeAs = SettingsSerializeAs.Xml;\r
-\r
-                               settings.Add (new SettingsPropertyValue (property));\r
-                       }\r
-\r
-                       string username = (string) sc ["UserName"];\r
-\r
-                       DbDataReader reader;\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               DerbyProfileHelper.Profile_GetProperties (connection, ApplicationName, username, DateTime.UtcNow, out reader);\r
-                               if (reader != null) {\r
-                                       using (reader) {\r
-                                               if (reader.Read ()) {\r
-                                                       string allnames = reader.GetString (0);\r
-                                                       string allvalues = reader.GetString (1);\r
-                                                       int binaryLen = (int) reader.GetBytes (2, 0, null, 0, 0);\r
-                                                       byte [] binaryvalues = new byte [binaryLen];\r
-                                                       reader.GetBytes (2, 0, binaryvalues, 0, binaryLen);\r
-\r
-                                                       DecodeProfileData (allnames, allvalues, binaryvalues, settings);\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-                       return settings;\r
-               }\r
-\r
-               public override void SetPropertyValues (SettingsContext sc, SettingsPropertyValueCollection properties)\r
-               {\r
-                       string username = (string) sc ["UserName"];\r
-                       bool authenticated = (bool) sc ["IsAuthenticated"];\r
-\r
-                       string names = String.Empty;\r
-                       string values = String.Empty;\r
-                       byte [] buf = null;\r
-\r
-                       EncodeProfileData (ref names, ref values, ref buf, properties, authenticated);\r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                                       DerbyProfileHelper.Profile_SetProperties (\r
-                                       connection, _applicationName, names, values, \r
-                                       buf, username, authenticated, DateTime.UtcNow);\r
-                       }\r
-               }\r
-\r
-               public override void Initialize (string name, NameValueCollection config)\r
-               {\r
-                       if (config == null)\r
-                               throw new ArgumentNullException ("config");\r
-\r
-                       if (string.IsNullOrEmpty (name))\r
-                               name = "DerbyProfileProvider";\r
-\r
-                       if (string.IsNullOrEmpty (config ["description"])) {\r
-                               config.Remove ("description");\r
-                               config.Add ("description", "Derby profile provider");\r
-                       }\r
-                       base.Initialize (name, config);\r
-\r
-                       _applicationName = GetStringConfigValue (config, "applicationName", "/");\r
-\r
-                       ProfileSection profileSection = (ProfileSection) WebConfigurationManager.GetSection ("system.web/profile");\r
-                       string connectionStringName = config ["connectionStringName"];\r
-                       _connectionString = WebConfigurationManager.ConnectionStrings [connectionStringName];\r
-                       if (_connectionString == null)\r
-                               throw new ProviderException (String.Format ("The connection name '{0}' was not found in the applications configuration or the connection string is empty.", connectionStringName));\r
-\r
-                       string shutdown = config ["shutdown"];\r
-                       if (!String.IsNullOrEmpty (shutdown))\r
-                               _shutDownPolicy = (DerbyUnloadManager.DerbyShutDownPolicy) Enum.Parse (typeof (DerbyUnloadManager.DerbyShutDownPolicy), shutdown, true);\r
-               }\r
-\r
-               private ProfileInfoCollection BuildProfileInfoCollection (DbDataReader reader, int pageIndex, int pageSize, out int totalRecords)\r
-               {\r
-                       int num_read = 0;\r
-                       int num_added = 0;\r
-                       int num_to_skip = pageIndex * pageSize;\r
-                       ProfileInfoCollection pic = new ProfileInfoCollection ();\r
-\r
-                       while (reader.Read ()) {\r
-                               if (num_read >= num_to_skip && num_added < pageSize) {\r
-                                       ProfileInfo pi = ReadProfileInfo (reader);\r
-                                       if (pi != null) {\r
-                                               pic.Add (pi);\r
-                                               num_added++;\r
-                                       }\r
-                               }\r
-                               num_read++;\r
-                       }\r
-                       totalRecords = num_read;\r
-                       return pic;\r
-               }\r
-\r
-               private ProfileInfo ReadProfileInfo (DbDataReader reader)\r
-               {\r
-                       string username = reader.GetString (0);\r
-                       bool anonymous = reader.GetInt32 (1) > 0;\r
-                       DateTime lastUpdate = reader.GetDateTime (2);\r
-                       DateTime lastActivity = reader.GetDateTime (3);\r
-                       int size = reader.GetInt32 (4);\r
-\r
-                       return new ProfileInfo (username, anonymous, lastActivity, lastUpdate, size);\r
-               }\r
-\r
-               // Helper methods\r
-               private void DecodeProfileData (string allnames, string values, byte [] buf, SettingsPropertyValueCollection properties)\r
-               {\r
-                       if (allnames == null || values == null || buf == null || properties == null)\r
-                               return;\r
-\r
-                       string [] names = allnames.Split (':');\r
-                       for (int i = 0; i < names.Length; i += 4) {\r
-                               string name = names [i];\r
-                               SettingsPropertyValue pp = properties [name];\r
-\r
-                               if (pp == null)\r
-                                       continue;\r
-\r
-                               int pos = Int32.Parse (names [i + 2], CultureInfo.InvariantCulture);\r
-                               int len = Int32.Parse (names [i + 3], CultureInfo.InvariantCulture);\r
-\r
-                               if (len == -1 && !pp.Property.PropertyType.IsValueType) {\r
-                                       pp.PropertyValue = null;\r
-                                       pp.IsDirty = false;\r
-                                       pp.Deserialized = true;\r
-                               }\r
-                               else if (names [i + 1] == "S" && pos >= 0 && len > 0 && values.Length >= pos + len) {\r
-                                       pp.SerializedValue = values.Substring (pos, len);\r
-                               }\r
-                               else if (names [i + 1] == "B" && pos >= 0 && len > 0 && buf.Length >= pos + len) {\r
-                                       byte [] buf2 = new byte [len];\r
-                                       Buffer.BlockCopy (buf, pos, buf2, 0, len);\r
-                                       pp.SerializedValue = buf2;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               private void EncodeProfileData (ref string allNames, ref string allValues, ref byte [] buf, SettingsPropertyValueCollection properties, bool userIsAuthenticated)\r
-               {\r
-                       StringBuilder names = new StringBuilder ();\r
-                       StringBuilder values = new StringBuilder ();\r
-                       MemoryStream stream = new MemoryStream ();\r
-\r
-                       try {\r
-                               foreach (SettingsPropertyValue pp in properties) {\r
-                                       if (!userIsAuthenticated && !(bool) pp.Property.Attributes ["AllowAnonymous"])\r
-                                               continue;\r
-\r
-                                       if (!pp.IsDirty && pp.UsingDefaultValue)\r
-                                               continue;\r
-\r
-                                       int len = 0, pos = 0;\r
-                                       string propValue = null;\r
-\r
-                                       if (pp.Deserialized && pp.PropertyValue == null)\r
-                                               len = -1;\r
-                                       else {\r
-                                               object sVal = pp.SerializedValue;\r
-\r
-                                               if (sVal == null)\r
-                                                       len = -1;\r
-                                               else if (sVal is string) {\r
-                                                       propValue = (string) sVal;\r
-                                                       len = propValue.Length;\r
-                                                       pos = values.Length;\r
-                                               }\r
-                                               else {\r
-                                                       byte [] b2 = (byte []) sVal;\r
-                                                       pos = (int) stream.Position;\r
-                                                       stream.Write (b2, 0, b2.Length);\r
-                                                       stream.Position = pos + b2.Length;\r
-                                                       len = b2.Length;\r
-                                               }\r
-                                       }\r
-\r
-                                       names.Append (pp.Name + ":" + ((propValue != null) ? "S" : "B") + ":" + pos.ToString (CultureInfo.InvariantCulture) + ":" + len.ToString (CultureInfo.InvariantCulture) + ":");\r
-\r
-                                       if (propValue != null)\r
-                                               values.Append (propValue);\r
-                               }\r
-\r
-                               buf = stream.ToArray ();\r
-                       }\r
-                       finally {\r
-                               if (stream != null)\r
-                                       stream.Close ();\r
-                       }\r
-\r
-                       allNames = names.ToString ();\r
-                       allValues = values.ToString ();\r
-               }\r
-\r
-               string GetStringConfigValue (NameValueCollection config, string name, string def)\r
-               {\r
-                       string rv = def;\r
-                       string val = config [name];\r
-                       if (val != null)\r
-                               rv = val;\r
-                       return rv;\r
-               }\r
-\r
-               void CheckParam (string pName, string p, int length)\r
-               {\r
-                       if (p == null)\r
-                               throw new ArgumentNullException (pName);\r
-                       if (p.Length == 0 || p.Length > length || p.IndexOf (",") != -1)\r
-                               throw new ArgumentException (String.Format ("invalid format for {0}", pName));\r
-               }\r
-               \r
-\r
-       }\r
-}\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/.gitattributes
deleted file mode 100644 (file)
index dc336de..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/CloudscapeMembershipProvider.cs -crlf
-/CloudscapeRoleProvider.cs -crlf
-/DerbyApplicationsHelper.cs -crlf
-/DerbyMembershipHelper.cs -crlf
-/DerbyMembershipProvider.cs -crlf
-/DerbyRoleProvider.cs -crlf
-/DerbyRolesHelper.cs -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/CloudscapeMembershipProvider.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/CloudscapeMembershipProvider.cs
deleted file mode 100644 (file)
index f5957cd..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//\r
-// Mainsoft.Web.Security.CloudscapeMembershipProvider\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-// (C) 2006 Mainsoft\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections.Specialized;\r
-using System.Text;\r
-\r
-namespace Mainsoft.Web.Security\r
-{\r
-       /// <summary>\r
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
-       /// </summary>\r
-       [Obsolete]\r
-       public class CloudscapeMembershipProvider : DerbyMembershipProvider\r
-       {\r
-               public override void Initialize (string name, NameValueCollection config)\r
-               {\r
-                       if (string.IsNullOrEmpty (name))\r
-                               name = "CloudscapeMembershipProvider";\r
-\r
-                       base.Initialize (name, config);\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/CloudscapeRoleProvider.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/CloudscapeRoleProvider.cs
deleted file mode 100644 (file)
index 8e0fb05..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-//\r
-// Mainsoft.Web.Security.CloudscapeRoleProvider\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-// (C) 2006 Mainsoft\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections.Specialized;\r
-using System.Text;\r
-\r
-namespace Mainsoft.Web.Security\r
-{\r
-       /// <summary>\r
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
-       /// </summary>\r
-       [Obsolete]\r
-       public class CloudscapeRoleProvider : DerbyRoleProvider\r
-       {\r
-               public override void Initialize (string name, NameValueCollection config)\r
-               {\r
-                       if (string.IsNullOrEmpty (name))\r
-                               name = "CloudscapeRoleProvider";\r
-\r
-                       base.Initialize (name, config);\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyApplicationsHelper.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyApplicationsHelper.cs
deleted file mode 100644 (file)
index 28cf3e6..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-//\r
-// Mainsoft.Web.Security.DerbyApplicationsHelper\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-// (C) 2006 Mainsoft\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Web.Security;\r
-using System.Data;\r
-using System.Data.OleDb;\r
-using System.Data.Common;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-\r
-namespace Mainsoft.Web.Security\r
-{\r
-       static class DerbyApplicationsHelper\r
-       {\r
-               private static OleDbParameter AddParameter (OleDbCommand command, string paramName, object paramValue)\r
-               {\r
-                       OleDbParameter prm = new OleDbParameter (paramName, paramValue);\r
-                       command.Parameters.Add (prm);\r
-                       return prm;\r
-               }\r
-\r
-               public static object Applications_CreateApplication (DbConnection connection, string applicationName)\r
-               {\r
-                       string selectQuery = "SELECT ApplicationId FROM aspnet_Applications WHERE LoweredApplicationName = ?";\r
-                       string insertQuery = "INSERT INTO aspnet_Applications (ApplicationId, ApplicationName, LoweredApplicationName) VALUES  (?, ?, ?)";\r
-\r
-                       OleDbCommand selectCmd = new OleDbCommand (selectQuery, (OleDbConnection) connection);\r
-                       AddParameter (selectCmd, "LoweredApplicationName", applicationName.ToLowerInvariant ());\r
-\r
-                       using (OleDbDataReader reader = selectCmd.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       return reader.GetString (0);\r
-                       }\r
-\r
-                       string applicationId = Guid.NewGuid ().ToString ();\r
-                       OleDbCommand insertCmd = new OleDbCommand (insertQuery, (OleDbConnection) connection);\r
-                       AddParameter (insertCmd, "ApplicationId", applicationId);\r
-                       AddParameter (insertCmd, "ApplicationName", applicationName);\r
-                       AddParameter (insertCmd, "LoweredApplicationName", applicationName.ToLowerInvariant ());\r
-                       insertCmd.ExecuteNonQuery ();\r
-\r
-                       return applicationId;\r
-               }\r
-\r
-               public static string GetApplicationId (DbConnection connection, string applicationName)\r
-               {\r
-                       string selectQuery = "SELECT ApplicationId FROM aspnet_Applications WHERE LoweredApplicationName = ?";\r
-\r
-                       OleDbCommand selectCmd = new OleDbCommand (selectQuery, (OleDbConnection) connection);\r
-                       AddParameter (selectCmd, "LoweredApplicationName", applicationName.ToLowerInvariant ());\r
-                       using (OleDbDataReader reader = selectCmd.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       return reader.GetString (0);\r
-                       }\r
-\r
-                       return null;\r
-               }\r
-       }\r
-}\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyDBSchema.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyDBSchema.cs
deleted file mode 100644 (file)
index 3866f8c..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-//
-// Mainsoft.Web.Security.DerbyDBSchema
-//
-// Authors:
-//     Vladimir Krasnov (vladimirk@mainsoft.com)
-//
-// (C) 2006 Mainsoft
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Data;
-using System.Data.OleDb;
-using System.Collections.Generic;
-using System.Text;
-using System.Configuration.Provider;
-using System.Diagnostics;
-using Mainsoft.Web.Hosting;
-
-namespace Mainsoft.Web.Security
-{
-       internal class DerbyDBSchema
-       {
-               const string _currentSchemaVersion = "1.0";
-               static readonly object _lock = new object ();
-
-               #region schema string array
-               static string [] schemaElements = new string [] {
-                       // Applications table
-                       @"CREATE TABLE aspnet_Applications (
-                               ApplicationId                           char(36)            NOT NULL PRIMARY KEY,
-                               ApplicationName                         varchar(256)        NOT NULL UNIQUE,
-                               LoweredApplicationName                  varchar(256)        NOT NULL UNIQUE,
-                               Description                             varchar(256)
-                       )",
-                       @"CREATE INDEX aspnet_App_Idx ON aspnet_Applications(LoweredApplicationName)",
-
-                       // Users table
-                       @"CREATE TABLE aspnet_Users (
-                               ApplicationId                           char(36)            NOT NULL,
-                               UserId                                  char(36)            NOT NULL PRIMARY KEY,
-                               UserName                                varchar(256)        NOT NULL,
-                               LoweredUserName                         varchar(256)        NOT NULL,
-                               MobileAlias                             varchar(16)         DEFAULT NULL,
-                               IsAnonymous                             int                 NOT NULL DEFAULT 0,
-                               LastActivityDate                        timestamp           NOT NULL,
-
-                               CONSTRAINT Users_AppId_PK FOREIGN KEY (ApplicationId) REFERENCES aspnet_Applications(ApplicationId)
-                       )",
-                       @"CREATE UNIQUE INDEX aspnet_Usr_Idx ON aspnet_Users(ApplicationId, LoweredUserName)",
-                       @"CREATE INDEX aspnet_Usr_Idx2 ON aspnet_Users(ApplicationId, LastActivityDate)",
-
-                       // Membership table
-                       @"CREATE TABLE aspnet_Membership (
-                               ApplicationId                           char(36)            NOT NULL,
-                               UserId                                  char(36)            NOT NULL PRIMARY KEY, 
-                               Password                                varchar(128)        NOT NULL,
-                               PasswordFormat                          int                 NOT NULL DEFAULT 0,
-                               PasswordSalt                            varchar(128)        NOT NULL,
-                               MobilePIN                               varchar(16),
-                               Email                                   varchar(256),
-                               LoweredEmail                            varchar(256),
-                               PasswordQuestion                        varchar(256),
-                               PasswordAnswer                          varchar(128),
-                               IsApproved                              int                 NOT NULL,
-                               IsLockedOut                             int                 NOT NULL,
-                               CreateDate                              timestamp           NOT NULL,
-                               LastLoginDate                           timestamp           NOT NULL,
-                               LastPasswordChangedDate                 timestamp           NOT NULL,
-                               LastLockoutDate                         timestamp           NOT NULL,
-                               FailedPasswordAttemptCount              int                 NOT NULL,
-                               FailedPwdAttemptWindowStart             timestamp           NOT NULL,
-                               FailedPwdAnswerAttemptCount             int                 NOT NULL,
-                               FailedPwdAnswerAttWindowStart           timestamp           NOT NULL,
-                               Comment                                 varchar(256), 
-
-                               CONSTRAINT Member_AppId_PK FOREIGN KEY (ApplicationId) REFERENCES aspnet_Applications(ApplicationId),
-                               CONSTRAINT UserId_PK FOREIGN KEY (UserId) REFERENCES aspnet_Users(UserId)
-                       )",
-                       @"CREATE INDEX aspnet_Mbr_idx ON aspnet_Membership(ApplicationId, LoweredEmail)",
-
-                       // Roles table
-                       @"CREATE TABLE aspnet_Roles (
-                               ApplicationId                           char(36)            NOT NULL,
-                               RoleId                                  char(36)            NOT NULL PRIMARY KEY,
-                               RoleName                                varchar(256)        NOT NULL,
-                               LoweredRoleName                         varchar(256)        NOT NULL,
-                               Description                             varchar(256),
-
-                               CONSTRAINT Roles_AppId_PK FOREIGN KEY (ApplicationId) REFERENCES aspnet_Applications(ApplicationId)
-                       )",
-                       @"CREATE UNIQUE INDEX aspnet_Rls_idx ON aspnet_Roles(ApplicationId, LoweredRoleName)",
-
-                       // UsersInRoles table
-                       @"CREATE TABLE aspnet_UsersInRoles (
-                               UserId                                  char(36)            NOT NULL, 
-                               RoleId                                  char(36)            NOT NULL,
-
-                               CONSTRAINT RoleId_UserId_PK FOREIGN KEY (UserId) REFERENCES aspnet_Users (UserId),
-                               CONSTRAINT UserId_RoleId_PK FOREIGN KEY (RoleId) REFERENCES aspnet_Roles (RoleId)
-                       )",
-                       @"ALTER TABLE aspnet_UsersInRoles ADD PRIMARY KEY (UserId, RoleId)",
-                       @"CREATE INDEX aspnet_UsrRls_idx ON aspnet_UsersInRoles(RoleId)",
-
-                       // Profile table
-                       @"CREATE TABLE aspnet_Profile (
-                               UserId                                  char(36)            NOT NULL PRIMARY KEY,
-                               PropertyNames                           long varchar        NOT NULL,
-                               PropertyValuesString                    long varchar        NOT NULL,
-                               PropertyValuesBinary                    blob                NOT NULL,
-                               LastUpdatedDate                         timestamp           NOT NULL,
-
-                               CONSTRAINT Profile_UserId_PK FOREIGN KEY (UserId) REFERENCES aspnet_Users (UserId)
-                       )",
-
-                       // Pathes table
-                       //@"CREATE TABLE aspnet_Paths (
-                       //      ApplicationId                           char(36)            NOT NULL,
-                       //      PathId                                  char(36)            NOT NULL PRIMARY KEY,
-                       //      Path                                    varchar(256)        NOT NULL,
-                       //      LoweredPath                             varchar(256)        NOT NULL,
-                       //
-                       //      CONSTRAINT Paths_AppId_FK FOREIGN KEY (ApplicationId) REFERENCES aspnet_Applications(ApplicationId)
-                       //)",
-                       //@"CREATE UNIQUE INDEX aspnet_Pth_idx ON aspnet_Paths(ApplicationId, LoweredPath)",
-
-                       // Personalization tables
-                       //@"CREATE TABLE aspnet_PersonalizationAllUsers (
-                       //      PathId                                  char(36)            NOT NULL PRIMARY KEY,
-                       //      PageSettings                            blob                NOT NULL,
-                       //      LastUpdatedDate                         timestamp           NOT NULL,
-                       //
-                       //      CONSTRAINT PrsUsr_PathId_PK FOREIGN KEY (PathId) REFERENCES aspnet_Paths (PathId)
-                       //)",
-                       //@"CREATE TABLE aspnet_PersonalizationPerUser (
-                       //      Id                                      char(36)            NOT NULL PRIMARY KEY,
-                       //      PathId                                  char(36)            NOT NULL,
-                       //      UserId                                  char(36)            NOT NULL,
-                       //      PageSettings                            blob                NOT NULL,
-                       //      LastUpdatedDate                         timestamp           NOT NULL,
-                       //
-                       //      CONSTRAINT PrsPUser_PathId_FK FOREIGN KEY (PathId) REFERENCES aspnet_Paths (PathId),
-                       //      CONSTRAINT PrsPUser_UserId_FK FOREIGN KEY (UserId) REFERENCES aspnet_Users (UserId)
-                       //)",
-                       //@"CREATE UNIQUE INDEX PrsPUser_idx1 ON aspnet_PersonalizationPerUser(PathId,UserId)",
-                       //@"CREATE UNIQUE INDEX PrsPUser_idx2 ON aspnet_PersonalizationPerUser(UserId,PathId)"
-
-                       // Version table
-                       @"CREATE TABLE aspnet_Version (
-                               SchemaVersion                           varchar(10)             NOT NULL
-                       )",
-                       @"CREATE INDEX aspnet_Version_Idx ON aspnet_Version(SchemaVersion)",
-                       @"INSERT INTO aspnet_Version VALUES ('1.0')"
-               };
-               #endregion
-
-               public static void CheckSchema (string connectionString) {
-                       string schemaVersion = GetSchemaVersion (connectionString);
-                       if (schemaVersion != null) {
-                               if (string.CompareOrdinal (schemaVersion, _currentSchemaVersion) == 0)
-                                       return;
-                       }
-                       else {
-                               lock (_lock) {
-                                       schemaVersion = GetSchemaVersion (connectionString);
-                                       if (schemaVersion == null) {
-                                               InitializeSchema (connectionString);
-                                               return;
-                                       }
-                               }
-                       }
-
-                       throw new ProviderException (String.Format ("Incorrect aspnetdb schema version: found '{0}', expected '{1}'.", schemaVersion, _currentSchemaVersion));
-               }
-
-               static string GetSchemaVersion (string connectionString)
-               {
-                       OleDbConnection connection = new OleDbConnection (connectionString);
-
-                       connection.Open ();
-
-                       using (connection) {
-                               OleDbCommand cmd = new OleDbCommand ("SELECT SchemaVersion FROM aspnet_Version", connection);
-
-                               try {
-                                       using (OleDbDataReader reader = cmd.ExecuteReader ()) {
-                                               if (reader.Read ())
-                                                       return reader.GetString (0);
-                                       }
-                               }
-                               catch { }
-
-                               return null;
-                       }
-               }
-
-               static void InitializeSchema (string connectionString)
-               {
-                       OleDbConnection connection = new OleDbConnection ();
-                       connection.ConnectionString = connectionString;
-
-                       connection.Open ();
-
-                       using (connection) {
-                               for (int i = 0; i < schemaElements.Length; i++) {
-                                       OleDbCommand cmd = new OleDbCommand (schemaElements [i], connection);
-                                       cmd.ExecuteNonQuery ();
-                               }
-                       }
-               }
-       }
-
-       internal class DerbyUnloadManager
-       {
-               public enum DerbyShutDownPolicy
-               {
-                       Default,
-                       Never,
-                       Database,
-                       System
-               }
-
-               readonly string _connectionString;
-               readonly DerbyShutDownPolicy _policy;
-
-               DerbyUnloadManager (string connectionString, DerbyShutDownPolicy policy) {
-                       _connectionString = connectionString;
-                       _policy = policy;
-               }
-
-               public static void RegisterUnloadHandler (string connectionString, DerbyShutDownPolicy policy) {
-                       if (policy == DerbyShutDownPolicy.Never)
-                               return;
-
-                       if (connectionString.IndexOf("org.apache.derby.jdbc.EmbeddedDriver", StringComparison.Ordinal) < 0)
-                               return;
-
-                       DerbyUnloadManager derbyMan = new DerbyUnloadManager (connectionString, policy);
-                       AppDomain.CurrentDomain.DomainUnload += new EventHandler (derbyMan.UnloadHandler);
-               }
-
-               public void UnloadHandler (object sender, EventArgs e)
-               {
-                       string shutUrl;
-
-                       switch (_policy) {
-                       case DerbyShutDownPolicy.Never:
-                               return;
-                       case DerbyShutDownPolicy.Database:
-                               shutUrl = GetConnectionProperty (_connectionString, "JdbcURL");
-                               break;
-                       case DerbyShutDownPolicy.System:
-                               shutUrl = "JdbcURL=jdbc:derby:";
-                               break;
-                       default:
-                       case DerbyShutDownPolicy.Default:
-                               java.lang.ClassLoader contextLoader = (java.lang.ClassLoader) AppDomain.CurrentDomain.GetData (J2EEConsts.CLASS_LOADER);
-                               java.lang.Class klass = contextLoader.loadClass ("org.apache.derby.jdbc.EmbeddedDriver");
-                               if (klass == null)
-                                       return;
-
-                               shutUrl = (klass.getClassLoader () == contextLoader) ?
-                                       "JdbcURL=jdbc:derby:" : GetConnectionProperty (_connectionString, "JdbcURL");
-
-                               break;
-                       }
-
-                       const string shuttingConnection = "JdbcDriverClassName=org.apache.derby.jdbc.EmbeddedDriver;{0};shutdown=true";
-
-                       if (!String.IsNullOrEmpty (shutUrl)) {
-                               try {
-                                       new OleDbConnection (String.Format (shuttingConnection, shutUrl)).Open ();
-                               }
-                               catch (Exception ex) {
-                                       Trace.Write (ex.ToString ());
-                               }
-                       }
-               }
-
-               static string GetConnectionProperty (string connectionString, string name) {
-                       if (String.IsNullOrEmpty (connectionString))
-                               return null;
-
-                       string [] parts = connectionString.Split (';');
-                       foreach (string part in parts)
-                               if (part.StartsWith (name, StringComparison.OrdinalIgnoreCase))
-                                       return part;
-
-                       return null;
-               }
-       }
-}
-
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyMembershipHelper.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyMembershipHelper.cs
deleted file mode 100644 (file)
index 7a8e5b3..0000000
+++ /dev/null
@@ -1,739 +0,0 @@
-//\r
-// Mainsoft.Web.Security.DerbyMembershipHelper\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-// (C) 2006 Mainsoft\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Web.Security;\r
-using System.Data;\r
-using System.Data.OleDb;\r
-using System.Data.Common;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-\r
-namespace Mainsoft.Web.Security\r
-{\r
-       static class DerbyMembershipHelper\r
-       {\r
-               static readonly DateTime DefaultDateTime = new DateTime (1754, 1, 1).ToUniversalTime ();\r
-\r
-               private static OleDbParameter AddParameter (OleDbCommand command, string paramName, object paramValue)\r
-               {\r
-                       OleDbParameter prm = new OleDbParameter (paramName, paramValue);\r
-                       command.Parameters.Add (prm);\r
-                       return prm;\r
-               }\r
-\r
-               public static int Membership_ChangePasswordQuestionAndAnswer (DbConnection connection, string applicationName, string username, string newPwdQuestion, string newPwdAnswer)\r
-               {\r
-                       string updateQuery = "UPDATE aspnet_Membership SET PasswordQuestion = ?, PasswordAnswer = ? WHERE UserId = ?";\r
-\r
-                       string userId = GetUserId (connection, applicationName, username);\r
-                       if (userId == null)\r
-                               return 1; // user not found\r
-\r
-                       OleDbCommand updateCmd = new OleDbCommand (updateQuery, (OleDbConnection) connection);\r
-                       AddParameter (updateCmd, "PasswordQuestion", newPwdQuestion);\r
-                       AddParameter (updateCmd, "PasswordAnswer", newPwdAnswer);\r
-                       AddParameter (updateCmd, "UserId", userId);\r
-                       updateCmd.ExecuteNonQuery ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_CreateUser (DbConnection connection, string applicationName, string username, string password, string passwordSalt, string email, string pwdQuestion, string pwdAnswer, bool isApproved, DateTime currentTimeUtc, DateTime createDate, bool uniqueEmail, int passwordFormat, ref object userId)\r
-               {\r
-                       string applicationId = (string) DerbyApplicationsHelper.Applications_CreateApplication (connection, applicationName);\r
-                       string newUserId = (string) userId;\r
-\r
-                       OleDbTransaction trans = (OleDbTransaction) connection.BeginTransaction ();\r
-\r
-                       try {\r
-                               int returnValue = Users_CreateUser (connection, trans, applicationId, username, false, createDate, ref userId);\r
-                               if (returnValue == 1) {\r
-                                       // the user exists in users table, this can occure when user\r
-                                       // does not have membership information, but has other information\r
-                                       // like roles, etc.\r
-                                       if (userId != null && newUserId != null && newUserId != (string) userId) {\r
-                                               trans.Rollback ();\r
-                                               return 9; // wrong userid provided\r
-                                       }\r
-                               }\r
-                               else if (returnValue == 2) {\r
-                                       // another user with provided id already exists\r
-                                       trans.Rollback ();\r
-                                       return 10; // wrong userid provided\r
-                               }\r
-                               newUserId = (string) userId;\r
-\r
-                               string selectQueryMbrUserId = "SELECT UserId FROM aspnet_Membership WHERE UserId = ?";\r
-                               OleDbCommand selectCmdMbrUserId = new OleDbCommand (selectQueryMbrUserId, (OleDbConnection) connection);\r
-                               selectCmdMbrUserId.Transaction = trans;\r
-                               AddParameter (selectCmdMbrUserId, "UserId", newUserId);\r
-                               using (OleDbDataReader reader = selectCmdMbrUserId.ExecuteReader ()) {\r
-                                       if (reader.Read ()) {\r
-                                               trans.Rollback ();\r
-                                               return 2; // user with such userId already exists\r
-                                       }\r
-                               }\r
-\r
-                               if (uniqueEmail) {\r
-                                       string queryMbrEmail = "SELECT * FROM  aspnet_Membership WHERE ApplicationId = ? AND LoweredEmail = ?";\r
-                                       OleDbCommand cmdMbrEmail = new OleDbCommand (queryMbrEmail, (OleDbConnection) connection);\r
-                                       cmdMbrEmail.Transaction = trans;\r
-                                       AddParameter (cmdMbrEmail, "ApplicationId", applicationId);\r
-                                       AddParameter (cmdMbrEmail, "LoweredEmail", email.ToLowerInvariant ());\r
-                                       using (OleDbDataReader reader = cmdMbrEmail.ExecuteReader ()) {\r
-                                               if (reader.Read ()) {\r
-                                                       trans.Rollback ();\r
-                                                       return 3; // user with such email already exists\r
-                                               }\r
-                                       }\r
-                               }\r
-\r
-                               if (returnValue == 1) {\r
-                                       // if user was not created, but found existing and correct\r
-                                       // update it's activity (membership create) time.\r
-                                       string queryUpdActivity = "UPDATE aspnet_Users SET LastActivityDate = ? WHERE UserId = ?";\r
-                                       OleDbCommand cmdUpdActivity = new OleDbCommand (queryUpdActivity, (OleDbConnection) connection);\r
-                                       cmdUpdActivity.Transaction = trans;\r
-                                       AddParameter (cmdUpdActivity, "LastActivityDate", createDate);\r
-                                       AddParameter (cmdUpdActivity, "UserId", newUserId);\r
-                                       cmdUpdActivity.ExecuteNonQuery ();\r
-                               }\r
-\r
-                               string queryInsertMbr = "INSERT INTO aspnet_Membership (ApplicationId, UserId, Password, PasswordFormat, PasswordSalt, Email, " +\r
-                                       "LoweredEmail, PasswordQuestion, PasswordAnswer, IsApproved, IsLockedOut, CreateDate, LastLoginDate, " +\r
-                                       "LastPasswordChangedDate, LastLockoutDate, FailedPasswordAttemptCount, FailedPwdAttemptWindowStart, " +\r
-                                       "FailedPwdAnswerAttemptCount, FailedPwdAnswerAttWindowStart) " +\r
-                                       "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";\r
-                               OleDbCommand cmdInsertMbr = new OleDbCommand (queryInsertMbr, (OleDbConnection) connection);\r
-                               cmdInsertMbr.Transaction = trans;\r
-                               AddParameter (cmdInsertMbr, "ApplicationId", applicationId);\r
-                               AddParameter (cmdInsertMbr, "UserId", newUserId);\r
-                               AddParameter (cmdInsertMbr, "Password", password);\r
-                               AddParameter (cmdInsertMbr, "PasswordFormat", passwordFormat);\r
-                               AddParameter (cmdInsertMbr, "PasswordSalt", passwordSalt);\r
-                               AddParameter (cmdInsertMbr, "Email", email);\r
-                               AddParameter (cmdInsertMbr, "LoweredEmail", email != null ? email.ToLowerInvariant () : null);\r
-                               AddParameter (cmdInsertMbr, "PasswordQuestion", pwdQuestion);\r
-                               AddParameter (cmdInsertMbr, "PasswordAnswer", pwdAnswer);\r
-                               AddParameter (cmdInsertMbr, "IsApproved", isApproved);\r
-                               AddParameter (cmdInsertMbr, "IsLockedOut", 0);\r
-                               AddParameter (cmdInsertMbr, "CreateDate", createDate);\r
-                               AddParameter (cmdInsertMbr, "LastLoginDate", DefaultDateTime);\r
-                               AddParameter (cmdInsertMbr, "LastPasswordChangedDate", createDate);\r
-                               AddParameter (cmdInsertMbr, "LastLockoutDate", DefaultDateTime);\r
-                               AddParameter (cmdInsertMbr, "FailedPasswordAttemptCount", 0);\r
-                               AddParameter (cmdInsertMbr, "FailedPwdAttemptWindowStart", DefaultDateTime);\r
-                               AddParameter (cmdInsertMbr, "FailedPwdAnswerAttemptCount", 0);\r
-                               AddParameter (cmdInsertMbr, "FailedPwdAnswerAttWindowStart", DefaultDateTime);\r
-                               cmdInsertMbr.ExecuteNonQuery ();\r
-\r
-                               trans.Commit ();\r
-                       }\r
-                       catch (Exception e) {\r
-                               trans.Rollback ();\r
-                               throw e;\r
-                       }\r
-\r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_FindUsersByEmail (DbConnection connection, string applicationName, string emailToMatch, int pageIndex, int pageSize, out DbDataReader reader)\r
-               {\r
-                       string querySelect = "SELECT usr.UserName, mbr.UserId, mbr.Email, mbr.PasswordQuestion, mbr.Comment, mbr.IsApproved, " +\r
-                               "mbr.IsLockedOut, mbr.CreateDate, mbr.LastLoginDate, usr.LastActivityDate, mbr.LastPasswordChangedDate, mbr.LastLockoutDate " +\r
-                               "FROM aspnet_Membership mbr, aspnet_Users usr " +\r
-                               "WHERE usr.UserId = mbr.UserId AND mbr.LoweredEmail LIKE ? ORDER BY usr.LoweredUserName";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "LoweredEmail", emailToMatch.ToLowerInvariant ());\r
-                       reader = cmdSelect.ExecuteReader ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_FindUsersByName (DbConnection connection, string applicationName, string userNameToMatch, int pageIndex, int pageSize, out DbDataReader reader)\r
-               {\r
-                       string querySelect = "SELECT usr.UserName, mbr.UserId, mbr.Email, mbr.PasswordQuestion, mbr.Comment, mbr.IsApproved, " +\r
-                               "mbr.IsLockedOut, mbr.CreateDate, mbr.LastLoginDate, usr.LastActivityDate, mbr.LastPasswordChangedDate, mbr.LastLockoutDate " +\r
-                               "FROM aspnet_Membership mbr, aspnet_Users usr " +\r
-                               "WHERE usr.UserId = mbr.UserId AND usr.LoweredUserName LIKE ? ORDER BY usr.LoweredUserName";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "LoweredUserName", userNameToMatch.ToLowerInvariant ());\r
-                       reader = cmdSelect.ExecuteReader ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_GetAllUsers (DbConnection connection, string applicationName, int pageIndex, int pageSize, out DbDataReader reader)\r
-               {\r
-                       string querySelect = "SELECT usr.UserName, mbr.UserId, mbr.Email, mbr.PasswordQuestion, mbr.Comment, mbr.IsApproved, " +\r
-                               "mbr.IsLockedOut, mbr.CreateDate, mbr.LastLoginDate, usr.LastActivityDate, mbr.LastPasswordChangedDate, mbr.LastLockoutDate " + \r
-                               "FROM aspnet_Membership mbr, aspnet_Users usr " +\r
-                               "WHERE usr.UserId = mbr.UserId ORDER BY usr.LoweredUserName";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       reader = cmdSelect.ExecuteReader ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_GetNumberOfUsersOnline (DbConnection connection, string applicationName, int minutesSinceLastInActive, DateTime currentTimeUtc)\r
-               {\r
-                       string queryUsersActive = "SELECT COUNT(*) FROM aspnet_Users usr, aspnet_Applications app, aspnet_Membership mbr " +\r
-                               "WHERE usr.ApplicationId = app.ApplicationId AND usr.LastActivityDate > ? AND " +\r
-                               "app.LoweredApplicationName = ? AND usr.UserId = mbr.UserId";\r
-\r
-\r
-                       OleDbCommand cmdUsersActive = new OleDbCommand (queryUsersActive, (OleDbConnection) connection);\r
-                       AddParameter (cmdUsersActive, "LastActivityDate", currentTimeUtc.AddMinutes (-minutesSinceLastInActive));\r
-                       AddParameter (cmdUsersActive, "LoweredApplicationName", applicationName.ToLowerInvariant ());\r
-                       using (OleDbDataReader reader = cmdUsersActive.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       return reader.GetInt32 (0);\r
-                       }\r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_GetPassword (DbConnection connection, string applicationName, string username, string passwordAnswer, int maxInvalidPasswordAttempts, int passwordAttemptWindow, DateTime currentTimeUtc, out string password)\r
-               {\r
-                       string querySelect = "SELECT usr.UserId, mbr.Password, mbr.PasswordAnswer, mbr.IsLockedOut, " +\r
-                               "mbr.LastLockoutDate, mbr.FailedPwdAnswerAttemptCount, mbr.FailedPwdAnswerAttWindowStart " +\r
-                               "FROM aspnet_Applications app, aspnet_Users usr, aspnet_Membership mbr " +\r
-                               "WHERE app.LoweredApplicationName = ? AND usr.ApplicationId = app.ApplicationId " +\r
-                               "AND usr.UserId = mbr.UserId AND usr.LoweredUserName = ?";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "LoweredApplicationName", applicationName.ToLowerInvariant ());\r
-                       AddParameter (cmdSelect, "LoweredUserName", username.ToLowerInvariant ());\r
-\r
-                       password = null;\r
-                       string dbUserId = null;\r
-                       string dbPassword = null;\r
-                       string dbPasswordAns = null;\r
-                       bool dbLockedOut = false;\r
-                       DateTime dbLastLockoutDate;\r
-                       int dbFailedPasswordAnswerAttemptCount = 0;\r
-                       DateTime dbFailedPasswordAnswerAttemptWindowStart;\r
-\r
-                       using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {\r
-                               if (reader.Read ()) {\r
-                                       dbUserId = reader.GetString (0);\r
-                                       dbPassword = reader.GetString (1);\r
-                                       dbPasswordAns = reader.GetString (2);\r
-                                       dbLockedOut = reader.GetInt32 (3) > 0;\r
-                                       dbLastLockoutDate = reader.GetDateTime (4);\r
-                                       dbFailedPasswordAnswerAttemptCount = reader.GetInt32 (5);\r
-                                       dbFailedPasswordAnswerAttemptWindowStart = reader.GetDateTime (6);\r
-                               }\r
-                               else {\r
-                                       return 1; // user not found\r
-                               }\r
-                       }\r
-\r
-                       if (dbLockedOut)\r
-                               return 2; // locked out\r
-\r
-                       if (dbPasswordAns != passwordAnswer) {\r
-                               if (currentTimeUtc > dbFailedPasswordAnswerAttemptWindowStart.AddMinutes (passwordAttemptWindow)) {\r
-                                       dbFailedPasswordAnswerAttemptWindowStart = currentTimeUtc;\r
-                                       dbFailedPasswordAnswerAttemptCount = 1;\r
-                               }\r
-                               else {\r
-                                       dbFailedPasswordAnswerAttemptWindowStart = currentTimeUtc;\r
-                                       dbFailedPasswordAnswerAttemptCount++;\r
-                               }\r
-\r
-                               if (dbFailedPasswordAnswerAttemptCount > maxInvalidPasswordAttempts) {\r
-                                       dbLockedOut = true;\r
-                                       dbLastLockoutDate = currentTimeUtc;\r
-                               }\r
-                               return 3; // wrong password answer\r
-                       }\r
-                       else {\r
-                               dbFailedPasswordAnswerAttemptCount = 0;\r
-                               dbFailedPasswordAnswerAttemptWindowStart = DefaultDateTime;\r
-                               password = dbPassword;\r
-                       }\r
-\r
-                       string queryUpdate = "UPDATE aspnet_Membership SET IsLockedOut = ?, LastLockoutDate = ?, " +\r
-                               "FailedPwdAnswerAttemptCount = ?, FailedPwdAnswerAttWindowStart = ? " +\r
-                               "WHERE UserId = ?";\r
-                       OleDbCommand cmdUpdate = new OleDbCommand (queryUpdate, (OleDbConnection) connection);\r
-                       AddParameter (cmdUpdate, "IsLockedOut", dbLockedOut);\r
-                       AddParameter (cmdUpdate, "LastLockoutDate", dbLastLockoutDate);\r
-                       AddParameter (cmdUpdate, "FailedPwdAnswerAttemptCount", dbFailedPasswordAnswerAttemptCount);\r
-                       AddParameter (cmdUpdate, "FailedPwdAnswerAttWindowStart", dbFailedPasswordAnswerAttemptWindowStart);\r
-                       AddParameter (cmdUpdate, "UserId", dbUserId);\r
-                       cmdUpdate.ExecuteNonQuery ();\r
-                       \r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_GetPasswordWithFormat (DbConnection connection, string applicationName, string username, bool updateLastActivity, DateTime currentTimeUtc, out DbDataReader reader)\r
-               {\r
-                       string querySelect = "SELECT usr.UserId, mbr.IsLockedOut, mbr.IsApproved, mbr.Password, mbr.PasswordFormat, mbr.PasswordSalt, " +\r
-                               "mbr.FailedPasswordAttemptCount, mbr.FailedPwdAnswerAttemptCount, mbr.LastLoginDate, usr.LastActivityDate " +\r
-                               "FROM aspnet_Applications app, aspnet_Users usr, aspnet_Membership mbr " +\r
-                               "WHERE app.LoweredApplicationName = ? AND usr.ApplicationId = app.ApplicationId " +\r
-                               "AND usr.UserId = mbr.UserId AND usr.LoweredUserName = ?";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "LoweredApplicationName", applicationName.ToLowerInvariant ());\r
-                       AddParameter (cmdSelect, "LoweredUserName", username.ToLowerInvariant ());\r
-                       reader = cmdSelect.ExecuteReader ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_GetUserByEmail (DbConnection connection, string applicationName, string email, out string username)\r
-               {\r
-                       string querySelect = "SELECT usr.UserName FROM aspnet_Applications app, aspnet_Users usr, aspnet_Membership mbr " +\r
-                               "WHERE app.LoweredApplicationName = ? AND usr.ApplicationId = app.ApplicationId AND " +\r
-                               "usr.UserId = mbr.UserId AND mbr.LoweredEmail " + (email == null ? "IS NULL" : "= ?");\r
-\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "LoweredApplicationName", applicationName.ToLowerInvariant ());\r
-                       if (email != null)\r
-                               AddParameter (cmdSelect, "LoweredEmail", email.ToLowerInvariant ());\r
-\r
-                       username = null;\r
-                       using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {\r
-                               if (reader.Read ()) {\r
-                                       username = reader.GetString (0);\r
-                                       if (reader.Read ())\r
-                                               return 2; // more that one user found with this email\r
-                               }\r
-                               else\r
-                                       return 1; // no users found\r
-                               return 0;\r
-                       }\r
-               }\r
-\r
-               public static int Membership_GetUserByName (DbConnection connection, string applicationName, string username, bool updateLastActivity, DateTime currentTimeUtc, out DbDataReader reader)\r
-               {\r
-                       reader = null;\r
-                       object userId = GetUserId (connection, applicationName, username);\r
-                       if (userId == null)\r
-                               return 1; // user not found\r
-\r
-                       if (updateLastActivity) {\r
-                               string queryUpdate = "UPDATE aspnet_Users SET LastActivityDate = ? WHERE UserId = ?";\r
-                               OleDbCommand cmdUpdate = new OleDbCommand (queryUpdate, (OleDbConnection) connection);\r
-                               AddParameter (cmdUpdate, "LastActivityDate", currentTimeUtc);\r
-                               AddParameter (cmdUpdate, "UserId", userId);\r
-                               int records = cmdUpdate.ExecuteNonQuery ();\r
-                               if (records == 0)\r
-                                       return -1; // unknown error\r
-                       }\r
-\r
-                       return Membership_GetUserByUserId (connection, userId, updateLastActivity, currentTimeUtc, out reader);\r
-               }\r
-\r
-               public static int Membership_GetUserByUserId (DbConnection connection, object userId, bool updateLastActivity, DateTime currentTimeUtc, out DbDataReader reader)\r
-               {\r
-                       reader = null;\r
-                       if (updateLastActivity) {\r
-                               string queryUpdate = "UPDATE aspnet_Users SET LastActivityDate = ? WHERE UserId = ?";\r
-                               OleDbCommand cmdUpdate = new OleDbCommand (queryUpdate, (OleDbConnection) connection);\r
-                               AddParameter (cmdUpdate, "LastActivityDate", currentTimeUtc);\r
-                               AddParameter (cmdUpdate, "UserId", userId);\r
-                               int recordsAffected = cmdUpdate.ExecuteNonQuery ();\r
-                               if (recordsAffected == 0)\r
-                                       return 1; // user not found\r
-                       }\r
-\r
-                       string querySelect = "SELECT usr.UserName, mbr.UserId, mbr.Email, mbr.PasswordQuestion, mbr.Comment, mbr.IsApproved, " + \r
-                               "mbr.IsLockedOut, mbr.CreateDate, mbr.LastLoginDate, usr.LastActivityDate, mbr.LastPasswordChangedDate, mbr.LastLockoutDate " +\r
-                               "FROM aspnet_Users usr, aspnet_Membership mbr " +\r
-                               "WHERE usr.UserId = ? AND usr.UserId = mbr.UserId";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "UserId", userId);\r
-                       reader = cmdSelect.ExecuteReader ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_ResetPassword (DbConnection connection, string applicationName, string username, string newPassword, string passwordAnswer, int passwordFormat, string passwordSalt, int maxInvalidPasswordAttempts, int passwordAttemptWindow, DateTime currentTimeUtc)\r
-               {\r
-                       string querySelect = "SELECT usr.UserId, mbr.Password, mbr.PasswordAnswer, mbr.IsLockedOut, " +\r
-                               "mbr.LastLockoutDate, mbr.FailedPwdAnswerAttemptCount, mbr.FailedPwdAnswerAttWindowStart " +\r
-                               "FROM aspnet_Applications app, aspnet_Users usr, aspnet_Membership mbr " +\r
-                               "WHERE app.LoweredApplicationName = ? AND usr.ApplicationId = app.ApplicationId " +\r
-                               "AND usr.UserId = mbr.UserId AND usr.LoweredUserName = ?";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "LoweredApplicationName", applicationName.ToLowerInvariant ());\r
-                       AddParameter (cmdSelect, "LoweredUserName", username.ToLowerInvariant ());\r
-\r
-                       string dbUserId = null;\r
-                       string dbPassword = null;\r
-                       string dbPasswordAns = null;\r
-                       bool dbLockedOut = false;\r
-                       DateTime dbLastLockoutDate;\r
-                       int dbFailedPasswordAnswerAttemptCount = 0;\r
-                       DateTime dbFailedPasswordAnswerAttemptWindowStart;\r
-\r
-                       using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {\r
-                               if (reader.Read ()) {\r
-                                       dbUserId = reader.GetString (0);\r
-                                       dbPassword = reader.GetString (1);\r
-                                       dbPasswordAns = reader.GetString (2);\r
-                                       dbLockedOut = reader.GetInt32 (3) > 0;\r
-                                       dbLastLockoutDate = reader.GetDateTime (4);\r
-                                       dbFailedPasswordAnswerAttemptCount = reader.GetInt32 (5);\r
-                                       dbFailedPasswordAnswerAttemptWindowStart = reader.GetDateTime (6);\r
-                               }\r
-                               else {\r
-                                       return 1; // user not found\r
-                               }\r
-                       }\r
-\r
-                       if (dbLockedOut)\r
-                               return 2; // locked out\r
-\r
-                       if (dbPasswordAns != passwordAnswer) {\r
-                               if (currentTimeUtc > dbFailedPasswordAnswerAttemptWindowStart.AddMinutes (passwordAttemptWindow)) {\r
-                                       dbFailedPasswordAnswerAttemptWindowStart = currentTimeUtc;\r
-                                       dbFailedPasswordAnswerAttemptCount = 1;\r
-                               }\r
-                               else {\r
-                                       dbFailedPasswordAnswerAttemptWindowStart = currentTimeUtc;\r
-                                       dbFailedPasswordAnswerAttemptCount++;\r
-                               }\r
-\r
-                               if (dbFailedPasswordAnswerAttemptCount > maxInvalidPasswordAttempts) {\r
-                                       dbLockedOut = true;\r
-                                       dbLastLockoutDate = currentTimeUtc;\r
-                               }\r
-                               return 3; // passwrod answer is wrong\r
-                       }\r
-                       else {\r
-                               dbFailedPasswordAnswerAttemptCount = 0;\r
-                               dbFailedPasswordAnswerAttemptWindowStart = DefaultDateTime;\r
-                       }\r
-\r
-                       return Membership_SetPasswordUserId (connection, dbUserId, newPassword, passwordSalt, passwordFormat, currentTimeUtc);\r
-               }\r
-\r
-               public static int Membership_SetPassword (DbConnection connection, string applicationName, string username, string newPassword, int passwordFormat, string passwordSalt, DateTime currentTimeUtc)\r
-               {\r
-                       string userId = GetUserId (connection, applicationName, username);\r
-                       if (userId == null)\r
-                               return 1; // user not found\r
-\r
-                       return Membership_SetPasswordUserId (connection, userId, newPassword, passwordSalt, passwordFormat, currentTimeUtc);\r
-               }\r
-\r
-               private static int Membership_SetPasswordUserId (DbConnection connection, string userId, string newPassword, string passwordSalt, int passwordFormat, DateTime currentTimeUtc)\r
-               {\r
-                       string queryUpdate = "UPDATE aspnet_Membership SET Password = ?, PasswordFormat = ?, PasswordSalt = ?, " +\r
-                               "LastPasswordChangedDate = ? WHERE UserId = ?";\r
-                       OleDbCommand cmdUpdate = new OleDbCommand (queryUpdate, (OleDbConnection) connection);\r
-                       AddParameter (cmdUpdate, "Password", newPassword);\r
-                       AddParameter (cmdUpdate, "PasswordFormat", passwordFormat);\r
-                       AddParameter (cmdUpdate, "PasswordSalt", passwordSalt);\r
-                       AddParameter (cmdUpdate, "LastPasswordChangedDate", currentTimeUtc);\r
-                       AddParameter (cmdUpdate, "UserId", userId);\r
-                       \r
-                       cmdUpdate.ExecuteNonQuery ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_UnlockUser (DbConnection connection, string applicationName, string username)\r
-               {\r
-                       string userId = GetUserId (connection, applicationName, username);\r
-                       if (userId == null)\r
-                               return 1; // user not found\r
-\r
-                       string queryUnlock = "UPDATE aspnet_Membership SET IsLockedOut = 0, " +\r
-                               "FailedPasswordAttemptCount = 0, FailedPwdAttemptWindowStart = ?, " +\r
-                               "FailedPwdAnswerAttemptCount = 0, FailedPwdAnswerAttWindowStart = ?, " +\r
-                               "LastLockoutDate = ? WHERE UserId = ?";\r
-                       OleDbCommand cmdUnlock = new OleDbCommand (queryUnlock, (OleDbConnection) connection);\r
-                       AddParameter (cmdUnlock, "FailedPwdAttemptWindowStart", DefaultDateTime);\r
-                       AddParameter (cmdUnlock, "FailedPwdAnswerAttWindowStart", DefaultDateTime);\r
-                       AddParameter (cmdUnlock, "LastLockoutDate", DefaultDateTime);\r
-                       AddParameter (cmdUnlock, "UserId", userId);\r
-\r
-                       cmdUnlock.ExecuteNonQuery ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_UpdateUser (DbConnection connection, string applicationName, string username, string email, string comment, bool isApproved, bool uniqueEmail, DateTime lastLoginDate, DateTime lastActivityDate, DateTime currentTimeUtc)\r
-               {\r
-                       string userId = GetUserId (connection, applicationName, username);\r
-                       if (userId == null)\r
-                               return 1; // user not found\r
-\r
-                       if (uniqueEmail) {\r
-                               string queryUniqueMail = "SELECT * FROM aspnet_Membership WHERE ApplicationId = ? " +\r
-                                       "AND UserId <> ? AND LoweredEmail = ?";\r
-                               OleDbCommand cmdUniqueMail = new OleDbCommand (queryUniqueMail, (OleDbConnection) connection);\r
-                               AddParameter (cmdUniqueMail, "ApplicationId", email);\r
-                               AddParameter (cmdUniqueMail, "UserId", userId);\r
-                               using (OleDbDataReader reader = cmdUniqueMail.ExecuteReader ()) {\r
-                                       if (reader.Read ())\r
-                                               return 2; // duplicate email\r
-                               }\r
-                       }\r
-                       string queryUpdateUser = "UPDATE aspnet_Users SET LastActivityDate = ? WHERE UserId = ?";\r
-                       OleDbCommand cmdUpdateUser = new OleDbCommand (queryUpdateUser, (OleDbConnection) connection);\r
-                       AddParameter (cmdUpdateUser, "LastActivityDate", lastActivityDate);\r
-                       AddParameter (cmdUpdateUser, "UserId", userId);\r
-                       cmdUpdateUser.ExecuteNonQuery ();\r
-\r
-                       string queryUpdateMember = "UPDATE aspnet_Membership SET Email = ?, LoweredEmail = ?, Comment = ?, " +\r
-                               "IsApproved = ?, LastLoginDate = ? WHERE UserId = ?";\r
-                       OleDbCommand cmdUpdateMember = new OleDbCommand (queryUpdateMember, (OleDbConnection) connection);\r
-                       AddParameter (cmdUpdateMember, "Email", email);\r
-                       AddParameter (cmdUpdateMember, "LoweredEmail", email.ToLowerInvariant ());\r
-                       AddParameter (cmdUpdateMember, "Comment", comment);\r
-                       AddParameter (cmdUpdateMember, "IsApproved", isApproved);\r
-                       AddParameter (cmdUpdateMember, "LastLoginDate", lastLoginDate);\r
-                       AddParameter (cmdUpdateMember, "UserId", userId);\r
-                       cmdUpdateMember.ExecuteNonQuery ();\r
-\r
-                       return 0;\r
-               }\r
-\r
-               public static int Membership_UpdateUserInfo (DbConnection connection, string applicationName, string username, bool isPasswordCorrect, bool updateLastLoginActivityDate, int maxInvalidPasswordAttempts, int passwordAttemptWindow, DateTime currentTimeUtc, DateTime lastLoginDate, DateTime lastActivityDate)\r
-               {\r
-                       string querySelect = "SELECT usr.UserId, mbr.IsApproved, mbr.IsLockedOut, mbr.LastLockoutDate, " +\r
-                                                       "mbr.FailedPasswordAttemptCount, mbr.FailedPwdAttemptWindowStart " +\r
-                                                       "FROM aspnet_Applications app, aspnet_Users usr, aspnet_Membership mbr " +\r
-                                                       "WHERE app.LoweredApplicationName = ? AND usr.ApplicationId = app.ApplicationId " +\r
-                                                       "AND usr.UserId = mbr.UserId AND usr.LoweredUserName = ?";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "LoweredApplicationName", applicationName.ToLowerInvariant ());\r
-                       AddParameter (cmdSelect, "LoweredUserName", username.ToLowerInvariant ());\r
-\r
-                       string dbUserId = string.Empty;\r
-                       bool dbIsApproved = false;\r
-                       bool dbLockedOut = false;\r
-                       DateTime dbLastLockoutDate;\r
-                       int dbFailedPasswordAttemptCount = 0;\r
-                       DateTime dbFailedPasswordAttemptWindowStart;\r
-\r
-                       using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {\r
-                               if (reader.Read ()) {\r
-                                       dbUserId = reader.GetString (0);\r
-                                       dbIsApproved = reader.GetInt32 (1) > 0;\r
-                                       dbLockedOut = reader.GetInt32 (2) > 0;\r
-                                       dbLastLockoutDate = reader.GetDateTime (3);\r
-                                       dbFailedPasswordAttemptCount = reader.GetInt32 (4);\r
-                                       dbFailedPasswordAttemptWindowStart = reader.GetDateTime (5);\r
-                               }\r
-                               else {\r
-                                       return 1; // user not found\r
-                               }\r
-                       }\r
-\r
-                       if (dbLockedOut)\r
-                               return 2; // locked out\r
-\r
-                       if (!isPasswordCorrect) {\r
-                               if (currentTimeUtc > dbFailedPasswordAttemptWindowStart.AddMinutes (passwordAttemptWindow)) {\r
-                                       dbFailedPasswordAttemptWindowStart = currentTimeUtc;\r
-                                       dbFailedPasswordAttemptCount = 1;\r
-                               }\r
-                               else {\r
-                                       dbFailedPasswordAttemptWindowStart = currentTimeUtc;\r
-                                       dbFailedPasswordAttemptCount++;\r
-                               }\r
-\r
-                               if (dbFailedPasswordAttemptCount > maxInvalidPasswordAttempts) {\r
-                                       dbLockedOut = true;\r
-                                       dbLastLockoutDate = currentTimeUtc;\r
-                               }\r
-                       }\r
-                       else {\r
-                               dbFailedPasswordAttemptCount = 0;\r
-                               dbFailedPasswordAttemptWindowStart = DefaultDateTime;\r
-                       }\r
-\r
-                       if (updateLastLoginActivityDate) {\r
-                               string queryUpdUserActivity = "UPDATE aspnet_Users SET LastActivityDate = ? WHERE UserId = ?";\r
-                               OleDbCommand cmdUpdUserActivity = new OleDbCommand (queryUpdUserActivity, (OleDbConnection) connection);\r
-                               AddParameter (cmdUpdUserActivity, "LastActivityDate", currentTimeUtc);\r
-                               AddParameter (cmdUpdUserActivity, "UserId", dbUserId);\r
-                               cmdUpdUserActivity.ExecuteNonQuery ();\r
-\r
-                               string queryUpdMemberActivity = "UPDATE aspnet_Membership SET LastLoginDate = ? WHERE UserId = ?";\r
-                               OleDbCommand cmdUpdMemberActivity = new OleDbCommand (queryUpdMemberActivity, (OleDbConnection) connection);\r
-                               AddParameter (cmdUpdMemberActivity, "LastLoginDate", currentTimeUtc);\r
-                               AddParameter (cmdUpdMemberActivity, "UserId", dbUserId);\r
-                               cmdUpdMemberActivity.ExecuteNonQuery ();\r
-                       }\r
-\r
-                       string queryUpdate = "UPDATE aspnet_Membership SET IsLockedOut = ?, LastLockoutDate = ?, " +\r
-                               "FailedPasswordAttemptCount = ?, FailedPwdAttemptWindowStart = ? " +\r
-                               "WHERE UserId = ?";\r
-                       OleDbCommand cmdUpdate = new OleDbCommand (queryUpdate, (OleDbConnection) connection);\r
-                       AddParameter (cmdUpdate, "IsLockedOut", dbLockedOut);\r
-                       AddParameter (cmdUpdate, "LastLockoutDate", dbLastLockoutDate);\r
-                       AddParameter (cmdUpdate, "FailedPasswordAttemptCount", dbFailedPasswordAttemptCount);\r
-                       AddParameter (cmdUpdate, "FailedPwdAttemptWindowStart", dbFailedPasswordAttemptWindowStart);\r
-                       AddParameter (cmdUpdate, "UserId", dbUserId);\r
-                       cmdUpdate.ExecuteNonQuery ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Users_CreateUser (DbConnection connection, DbTransaction trans, string applicationId, string username, bool isAnonymous, DateTime lastActivityDate, ref object userId)\r
-               {\r
-                       string selectQuery = "SELECT UserId FROM aspnet_Users WHERE LoweredUserName = ? AND ApplicationId = ?";\r
-                       OleDbCommand selectCmd = new OleDbCommand (selectQuery, (OleDbConnection) connection);\r
-                       AddParameter (selectCmd, "LoweredUserName", username.ToLowerInvariant ());\r
-                       AddParameter (selectCmd, "ApplicationId", applicationId);\r
-                       if (trans != null)\r
-                               selectCmd.Transaction = (OleDbTransaction) trans;\r
-\r
-                       string existingUserId = null;\r
-                       using (OleDbDataReader reader = selectCmd.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       existingUserId = reader.GetString (0);\r
-                       }\r
-\r
-                       if (existingUserId != null && existingUserId.Length > 0) {\r
-                               userId = existingUserId;\r
-                               return 1; // user with such username and appid already exists\r
-                       }\r
-\r
-                       if (userId != null) {\r
-                               string querySelectUserId = "SELECT UserId FROM aspnet_Users WHERE UserId = ?";\r
-                               OleDbCommand cmdSelectUserId = new OleDbCommand (querySelectUserId, (OleDbConnection) connection);\r
-                               AddParameter (cmdSelectUserId, "UserId", userId);\r
-                               if (trans != null)\r
-                                       cmdSelectUserId.Transaction = (OleDbTransaction) trans;\r
-\r
-                               using (OleDbDataReader reader = cmdSelectUserId.ExecuteReader ()) {\r
-                                       if (reader.Read ())\r
-                                               return 2; // user with such userId already exists\r
-                               }\r
-                       }\r
-\r
-                       if (userId == null)\r
-                               userId = Guid.NewGuid ().ToString ();\r
-\r
-                       string insertQuery = "INSERT INTO aspnet_Users (ApplicationId, UserId, UserName, LoweredUserName, IsAnonymous, LastActivityDate) VALUES (?, ?, ?, ?, ?, ?)";\r
-                       OleDbCommand insertCmd = new OleDbCommand (insertQuery, (OleDbConnection) connection);\r
-                       AddParameter (insertCmd, "ApplicationId", applicationId);\r
-                       AddParameter (insertCmd, "UserId", userId);\r
-                       AddParameter (insertCmd, "UserName", username);\r
-                       AddParameter (insertCmd, "LoweredUserName", username.ToLowerInvariant ());\r
-                       AddParameter (insertCmd, "IsAnonymous", isAnonymous);\r
-                       AddParameter (insertCmd, "LastActivityDate", lastActivityDate);\r
-                       if (trans != null)\r
-                               insertCmd.Transaction = (OleDbTransaction) trans;\r
-\r
-                       insertCmd.ExecuteNonQuery ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int Users_DeleteUser (DbConnection connection, string applicationName, string username, int tablesToDeleteFrom, ref int numTablesDeletedFrom)\r
-               {\r
-                       string userId = GetUserId (connection, applicationName, username);\r
-                       if (userId == null)\r
-                               return 1; // user not found\r
-\r
-                       numTablesDeletedFrom = 0;\r
-                       OleDbTransaction trans = (OleDbTransaction) connection.BeginTransaction ();\r
-\r
-                       try {\r
-                               if ((tablesToDeleteFrom & 1) == 1) {\r
-                                       string queryDelete = "DELETE FROM aspnet_Membership WHERE UserId = ?";\r
-                                       OleDbCommand cmdDelete = new OleDbCommand (queryDelete, (OleDbConnection) connection);\r
-                                       AddParameter (cmdDelete, "UserId", userId);\r
-                                       cmdDelete.Transaction = trans;\r
-                                       cmdDelete.ExecuteNonQuery ();\r
-\r
-                                       numTablesDeletedFrom++;\r
-                               }\r
-\r
-                               if ((tablesToDeleteFrom & 2) == 2) {\r
-                                       string queryDelete = "DELETE FROM aspnet_UsersInRoles WHERE UserId = ?";\r
-                                       OleDbCommand cmdDelete = new OleDbCommand (queryDelete, (OleDbConnection) connection);\r
-                                       AddParameter (cmdDelete, "UserId", userId);\r
-                                       cmdDelete.Transaction = trans;\r
-                                       cmdDelete.ExecuteNonQuery ();\r
-\r
-                                       numTablesDeletedFrom++;\r
-                               }\r
-\r
-                               if ((tablesToDeleteFrom & 4) == 4) {\r
-                                       string queryDelete = "DELETE FROM aspnet_Profile WHERE UserId = ?";\r
-                                       OleDbCommand cmdDelete = new OleDbCommand (queryDelete, (OleDbConnection) connection);\r
-                                       AddParameter (cmdDelete, "UserId", userId);\r
-                                       cmdDelete.Transaction = trans;\r
-                                       cmdDelete.ExecuteNonQuery ();\r
-\r
-                                       numTablesDeletedFrom++;\r
-                               }\r
-\r
-                               // this table was removed  from schema\r
-                               //if ((tablesToDeleteFrom & 8) == 8) {\r
-                               //    string queryDelete = "DELETE FROM aspnet_PersonalizationPerUser WHERE UserId = ?";\r
-                               //    OleDbCommand cmdDelete = new OleDbCommand (queryDelete, (OleDbConnection) connection);\r
-                               //    AddParameter (cmdDelete, "UserId", userId);\r
-                               //    cmdDelete.Transaction = trans;\r
-                               //    cmdDelete.ExecuteNonQuery ();\r
-\r
-                               //    numTablesDeletedFrom++;\r
-                               //}\r
-\r
-                               if ((tablesToDeleteFrom & 15) == 15) {\r
-                                       string queryDelete = "DELETE FROM aspnet_Users WHERE UserId = ?";\r
-                                       OleDbCommand cmdDelete = new OleDbCommand (queryDelete, (OleDbConnection) connection);\r
-                                       AddParameter (cmdDelete, "UserId", userId);\r
-                                       cmdDelete.Transaction = trans;\r
-                                       cmdDelete.ExecuteNonQuery ();\r
-\r
-                                       numTablesDeletedFrom++;\r
-                               }\r
-\r
-                               trans.Commit ();\r
-                       }\r
-                       catch (Exception e) {\r
-                               trans.Rollback ();\r
-                               throw e;\r
-                       }\r
-\r
-                       return 0;\r
-               }\r
-\r
-               private static string GetUserId (DbConnection connection, string applicationName, string username)\r
-               {\r
-                       string selectQuery = "SELECT usr.UserId FROM aspnet_Membership mbr, aspnet_Users usr, aspnet_Applications app WHERE " +\r
-                               "usr.LoweredUserName = ? AND app.LoweredApplicationName = ? " +\r
-                               "AND usr.ApplicationId = app.ApplicationId " +\r
-                               "AND usr.UserId = mbr.UserId";\r
-\r
-                       OleDbCommand selectCmd = new OleDbCommand (selectQuery, (OleDbConnection) connection);\r
-                       AddParameter (selectCmd, "LoweredUserName", username.ToLowerInvariant ());\r
-                       AddParameter (selectCmd, "PasswordAnswer", applicationName.ToLowerInvariant ());\r
-\r
-                       using (OleDbDataReader reader = selectCmd.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       return reader.GetString (0);\r
-                       }\r
-\r
-                       return null; // user not found\r
-               }\r
-       }\r
-}\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyMembershipProvider.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyMembershipProvider.cs
deleted file mode 100644 (file)
index 0c575a6..0000000
+++ /dev/null
@@ -1,1002 +0,0 @@
-//\r
-// Mainsoft.Web.Security.DerbyMembershipProvider\r
-//\r
-// Authors:\r
-//     Ben Maurer (bmaurer@users.sourceforge.net)\r
-//     Chris Toshok (toshok@ximian.com)\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Configuration;
-using System.Configuration.Provider;
-using System.Data;\r
-using System.Data.OleDb;
-using System.Data.Common;
-using System.Text;
-using System.Web.Configuration;\r
-using System.Security;
-using System.Security.Cryptography;\r
-using System.Web;\r
-using System.Web.Security;\r
-\r
-namespace Mainsoft.Web.Security {
-       /// <summary>\r
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
-       /// <para>Manages storage of membership information for an ASP.NET application in a Derby database.</para>\r
-       /// </summary>
-       public class DerbyMembershipProvider : MembershipProvider
-       {
-               const int SALT_BYTES = 16;
-
-               bool enablePasswordReset;
-               bool enablePasswordRetrieval;
-               int maxInvalidPasswordAttempts;
-               MembershipPasswordFormat passwordFormat;
-               bool requiresQuestionAndAnswer;
-               bool requiresUniqueEmail;
-               int minRequiredNonAlphanumericCharacters;
-               int minRequiredPasswordLength;
-               int passwordAttemptWindow;
-               string passwordStrengthRegularExpression;
-               TimeSpan userIsOnlineTimeWindow;
-               ConnectionStringSettings connectionString;
-               bool schemaChecked = false;
-               DerbyUnloadManager.DerbyShutDownPolicy shutDownPolicy = DerbyUnloadManager.DerbyShutDownPolicy.Default;
-
-               string applicationName;
-
-               DbConnection CreateConnection ()
-               {\r
-                       if (!schemaChecked) {\r
-                               DerbyDBSchema.CheckSchema (connectionString.ConnectionString);\r
-                               schemaChecked = true;\r
-\r
-                               DerbyUnloadManager.RegisterUnloadHandler (connectionString.ConnectionString, shutDownPolicy);\r
-                       }\r
-\r
-                       OleDbConnection connection = new OleDbConnection (connectionString.ConnectionString);
-                       connection.Open ();
-                       return connection;
-               }
-
-               void CheckParam (string pName, string p, int length)
-               {
-                       if (p == null)
-                               throw new ArgumentNullException (pName);
-                       if (p.Length == 0 || p.Length > length || p.IndexOf (",") != -1)
-                               throw new ArgumentException (String.Format ("invalid format for {0}", pName));
-               }
-
-               public override bool ChangePassword (string username, string oldPwd, string newPwd)\r
-               {\r
-                       if (username != null) username = username.Trim ();\r
-                       if (oldPwd != null) oldPwd = oldPwd.Trim ();\r
-                       if (newPwd != null) newPwd = newPwd.Trim ();\r
-\r
-                       CheckParam ("username", username, 256);\r
-                       CheckParam ("oldPwd", oldPwd, 128);\r
-                       CheckParam ("newPwd", newPwd, 128);\r
-\r
-                       if (!CheckPassword (newPwd))\r
-                               throw new ArgumentException (string.Format (\r
-                                               "New Password invalid. New Password length minimum: {0}. Non-alphanumeric characters required: {1}.",\r
-                                               MinRequiredPasswordLength,\r
-                                               MinRequiredNonAlphanumericCharacters));\r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               PasswordInfo pi = ValidateUsingPassword (username, oldPwd);\r
-\r
-                               if (pi != null) {\r
-                                       EmitValidatingPassword (username, newPwd, false);\r
-                                       string db_password = EncodePassword (newPwd, pi.PasswordFormat, pi.PasswordSalt);\r
-\r
-                                       int st = DerbyMembershipHelper.Membership_SetPassword (connection, ApplicationName, username, db_password, (int) pi.PasswordFormat, pi.PasswordSalt, DateTime.UtcNow);\r
-\r
-                                       if (st == 0)\r
-                                               return true;\r
-                               }\r
-                               return false;\r
-                       }\r
-               }
-
-               public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
-               {
-                       if (username != null) username = username.Trim ();
-                       if (newPwdQuestion != null) newPwdQuestion = newPwdQuestion.Trim ();
-                       if (newPwdAnswer != null) newPwdAnswer = newPwdAnswer.Trim ();
-
-                       CheckParam ("username", username, 256);
-                       if (RequiresQuestionAndAnswer)
-                               CheckParam ("newPwdQuestion", newPwdQuestion, 128);
-                       if (RequiresQuestionAndAnswer)
-                               CheckParam ("newPwdAnswer", newPwdAnswer, 128);
-
-                       using (DbConnection connection = CreateConnection ()) {
-                               PasswordInfo pi = ValidateUsingPassword (username, password);
-
-                               if (pi != null) {
-                                       string db_passwordAnswer = EncodePassword (newPwdAnswer, pi.PasswordFormat, pi.PasswordSalt);\r
-\r
-                                       int st = DerbyMembershipHelper.Membership_ChangePasswordQuestionAndAnswer (connection, ApplicationName, username, newPwdQuestion, db_passwordAnswer);
-
-                                       if (st == 0)
-                                               return true;
-                               }
-                               return false;
-                       }
-               }
-
-               public override MembershipUser CreateUser (string username,
-                                                          string password,
-                                                          string email,
-                                                          string pwdQuestion,
-                                                          string pwdAnswer,
-                                                          bool isApproved,
-                                                          object providerUserKey,
-                                                          out MembershipCreateStatus status)
-               {
-                       if (username != null) username = username.Trim ();
-                       if (password != null) password = password.Trim ();
-                       if (email != null) email = email.Trim ();
-                       if (pwdQuestion != null) pwdQuestion = pwdQuestion.Trim ();
-                       if (pwdAnswer != null) pwdAnswer = pwdAnswer.Trim ();
-
-                       /* some initial validation */
-                       if (username == null || username.Length == 0 || username.Length > 256 || username.IndexOf (",") != -1) {
-                               status = MembershipCreateStatus.InvalidUserName;
-                               return null;
-                       }
-                       if (password == null || password.Length == 0 || password.Length > 128) {
-                               status = MembershipCreateStatus.InvalidPassword;
-                               return null;
-                       }
-
-                       if (!CheckPassword (password)) {
-                               status = MembershipCreateStatus.InvalidPassword;
-                               return null;
-                       }
-                       EmitValidatingPassword (username, password, true);
-
-                       if (RequiresUniqueEmail && (email == null || email.Length == 0)) {
-                               status = MembershipCreateStatus.InvalidEmail;
-                               return null;
-                       }
-                       if (RequiresQuestionAndAnswer &&
-                               (pwdQuestion == null ||
-                                pwdQuestion.Length == 0 || pwdQuestion.Length > 256)) {
-                               status = MembershipCreateStatus.InvalidQuestion;
-                               return null;
-                       }
-                       if (RequiresQuestionAndAnswer &&
-                               (pwdAnswer == null ||
-                                pwdAnswer.Length == 0 || pwdAnswer.Length > 128)) {
-                               status = MembershipCreateStatus.InvalidAnswer;
-                               return null;
-                       }
-                       if (providerUserKey != null && !(providerUserKey is Guid)) {
-                               status = MembershipCreateStatus.InvalidProviderUserKey;
-                               return null;
-                       }\r
-\r
-                       /* encode our password/answer using the
-                        * "passwordFormat" configuration option */
-                       string passwordSalt = "";
-
-                       RandomNumberGenerator rng = RandomNumberGenerator.Create ();
-                       byte [] salt = new byte [SALT_BYTES];
-                       rng.GetBytes (salt);
-                       passwordSalt = Convert.ToBase64String (salt);
-
-                       password = EncodePassword (password, PasswordFormat, passwordSalt);
-                       if (RequiresQuestionAndAnswer)
-                               pwdAnswer = EncodePassword (pwdAnswer, PasswordFormat, passwordSalt);
-
-                       /* make sure the hashed/encrypted password and
-                        * answer are still under 128 characters. */
-                       if (password.Length > 128) {
-                               status = MembershipCreateStatus.InvalidPassword;
-                               return null;
-                       }
-
-                       if (RequiresQuestionAndAnswer) {
-                               if (pwdAnswer.Length > 128) {
-                                       status = MembershipCreateStatus.InvalidAnswer;
-                                       return null;
-                               }
-                       }
-                       status = MembershipCreateStatus.Success;
-
-                       using (DbConnection connection = CreateConnection ()) {
-                               try {\r
-\r
-                                       object helperUserKey = providerUserKey != null ? providerUserKey.ToString () : null;\r
-                                       DateTime Now = DateTime.UtcNow;\r
-                                       int st = DerbyMembershipHelper.Membership_CreateUser (connection, ApplicationName, username, password, passwordSalt, email,\r
-                                               pwdQuestion, pwdAnswer, isApproved, Now, Now, RequiresUniqueEmail, (int) PasswordFormat, ref helperUserKey);\r
-\r
-                                       providerUserKey = new Guid ((string) helperUserKey);\r
-                                       if (st == 0)\r
-                                               return GetUser (providerUserKey, false);
-                                       else if (st == 2)
-                                           status = MembershipCreateStatus.DuplicateUserName;
-                                       else if (st == 3)
-                                           status = MembershipCreateStatus.DuplicateEmail;
-                                       else if (st == 9)\r
-                                               status = MembershipCreateStatus.InvalidProviderUserKey;
-                                       else if (st == 10)
-                                           status = MembershipCreateStatus.DuplicateProviderUserKey;
-                                       else
-                                           status = MembershipCreateStatus.ProviderError;\r
-\r
-                                       return null;
-                               }
-                               catch (Exception) {\r
-                                       status = MembershipCreateStatus.ProviderError;
-                                       return null;
-                               }
-                       }
-               }
-
-               private bool CheckPassword (string password)
-               {
-                       if (password.Length < MinRequiredPasswordLength)
-                               return false;
-
-                       if (MinRequiredNonAlphanumericCharacters > 0) {
-                               int nonAlphanumeric = 0;
-                               for (int i = 0; i < password.Length; i++) {
-                                       if (!Char.IsLetterOrDigit (password [i]))
-                                               nonAlphanumeric++;
-                               }
-                               return nonAlphanumeric >= MinRequiredNonAlphanumericCharacters;
-                       }
-                       return true;
-               }
-
-               public override bool DeleteUser (string username, bool deleteAllRelatedData)
-               {
-                       CheckParam ("username", username, 256);
-
-                       DeleteUserTableMask deleteBitmask = DeleteUserTableMask.MembershipUsers;
-
-                       if (deleteAllRelatedData)
-                               deleteBitmask |=
-                                       DeleteUserTableMask.Profiles |
-                                       DeleteUserTableMask.UsersInRoles |
-                                       DeleteUserTableMask.WebPartStateUser;\r
-                       
-                       int num = 0;
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               int st = DerbyMembershipHelper.Users_DeleteUser (connection, ApplicationName, username, (int) deleteBitmask, ref num);\r
-\r
-                               if (num == 0)
-                                       return false;
-
-                               if (st == 0)
-                                       return true;
-
-                               return false;
-                       }
-               }
-
-               public virtual string GeneratePassword ()
-               {
-                       return Membership.GeneratePassword (MinRequiredPasswordLength, MinRequiredNonAlphanumericCharacters);
-               }
-
-               public override MembershipUserCollection FindUsersByEmail (string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
-               {
-                       CheckParam ("emailToMatch", emailToMatch, 256);
-
-                       if (pageIndex < 0)
-                               throw new ArgumentException ("pageIndex must be >= 0");
-                       if (pageSize < 0)
-                               throw new ArgumentException ("pageSize must be >= 0");
-                       if (pageIndex * pageSize + pageSize - 1 > Int32.MaxValue)
-                               throw new ArgumentException ("pageIndex and pageSize are too large");\r
-\r
-                       totalRecords = 0;
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               DbDataReader reader = null;\r
-\r
-                               DerbyMembershipHelper.Membership_FindUsersByEmail (connection, ApplicationName, emailToMatch, pageSize, pageIndex, out reader);\r
-                               if (reader == null)\r
-                                       return null;\r
-
-                               using (reader) {\r
-                                       return BuildMembershipUserCollection (reader, pageIndex, pageSize, out totalRecords);
-                               }\r
-                       }
-               }
-
-               public override MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
-               {
-                       CheckParam ("nameToMatch", nameToMatch, 256);
-
-                       if (pageIndex < 0)
-                               throw new ArgumentException ("pageIndex must be >= 0");
-                       if (pageSize < 0)
-                               throw new ArgumentException ("pageSize must be >= 0");
-                       if (pageIndex * pageSize + pageSize - 1 > Int32.MaxValue)
-                               throw new ArgumentException ("pageIndex and pageSize are too large");\r
-\r
-                       totalRecords = 0;
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               DbDataReader reader = null;\r
-\r
-                               DerbyMembershipHelper.Membership_FindUsersByName (connection, ApplicationName, nameToMatch, pageSize, pageIndex, out reader);\r
-                               if (reader == null)\r
-                                       return null;\r
-\r
-                               using (reader) {\r
-                                       return BuildMembershipUserCollection (reader, pageIndex, pageSize, out totalRecords);\r
-                               }\r
-                       }
-               }
-
-               public override MembershipUserCollection GetAllUsers (int pageIndex, int pageSize, out int totalRecords)
-               {
-                       if (pageIndex < 0)
-                               throw new ArgumentException ("pageIndex must be >= 0");
-                       if (pageSize < 0)
-                               throw new ArgumentException ("pageSize must be >= 0");
-                       if (pageIndex * pageSize + pageSize - 1 > Int32.MaxValue)
-                               throw new ArgumentException ("pageIndex and pageSize are too large");
-
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               DbDataReader reader = null;\r
-                               totalRecords = DerbyMembershipHelper.Membership_GetAllUsers (connection, ApplicationName, pageIndex, pageSize, out reader);\r
-                               return BuildMembershipUserCollection (reader, pageIndex, pageSize, out totalRecords);\r
-                       }
-               }\r
-\r
-               MembershipUserCollection BuildMembershipUserCollection (DbDataReader reader, int pageIndex, int pageSize, out int totalRecords)
-               {\r
-                       int num_read = 0;\r
-                       int num_added = 0;\r
-                       int num_to_skip = pageIndex * pageSize;\r
-                       MembershipUserCollection users = new MembershipUserCollection ();\r
-                       try {\r
-                               while (reader.Read ()) {\r
-                                       if (num_read >= num_to_skip) {\r
-                                               if (num_added < pageSize) {\r
-                                                       users.Add (GetUserFromReader (reader));\r
-                                                       num_added++;\r
-                                               }\r
-                                       }\r
-                                       num_read++;\r
-                               }\r
-                               totalRecords = num_read;\r
-                               return users;\r
-                       }\r
-                       catch (Exception) {\r
-                               totalRecords = 0;\r
-                               return null; /* should we let the exception through? */\r
-                       }
-                       finally {
-                               if (reader != null)
-                                       reader.Close ();
-                       }
-               }
-
-               public override int GetNumberOfUsersOnline ()
-               {
-                       using (DbConnection connection = CreateConnection ()) {
-                               return DerbyMembershipHelper.Membership_GetNumberOfUsersOnline (connection, ApplicationName, userIsOnlineTimeWindow.Minutes, DateTime.UtcNow);\r
-                       }
-               }
-
-               public override string GetPassword (string username, string answer)
-               {
-                       if (!EnablePasswordRetrieval)
-                               throw new NotSupportedException ("this provider has not been configured to allow the retrieval of passwords");
-
-                       CheckParam ("username", username, 256);
-                       if (RequiresQuestionAndAnswer)
-                               CheckParam ("answer", answer, 128);
-
-                       PasswordInfo pi = GetPasswordInfo (username);
-                       if (pi == null)
-                               throw new ProviderException ("An error occurred while retrieving the password from the database");
-
-                       string user_answer = EncodePassword (answer, pi.PasswordFormat, pi.PasswordSalt);
-                       string password = null;
-
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               int st = DerbyMembershipHelper.Membership_GetPassword (connection, ApplicationName, username, user_answer, MaxInvalidPasswordAttempts, PasswordAttemptWindow, DateTime.UtcNow, out password);\r
-\r
-                               if (st == 1)\r
-                                       throw new ProviderException ("User specified by username is not found in the membership database");\r
-\r
-                               if (st == 2)\r
-                                       throw new MembershipPasswordException ("The membership user identified by username is locked out");\r
-                               
-                               if (st == 3)\r
-                                       throw new MembershipPasswordException ("Password Answer is invalid");
-
-                               return DecodePassword (password, pi.PasswordFormat);
-                       }
-               }\r
-\r
-               MembershipUser GetUserFromReader (DbDataReader reader)\r
-               {\r
-                       return new MembershipUser (\r
-                               this.Name,                                          /* XXX is this right?  */\r
-                               reader.GetString (0),                               /* name */\r
-                               new Guid (reader.GetString (1)),                    /* providerUserKey */\r
-                               reader.IsDBNull (2) ? null : reader.GetString (2),  /* email */\r
-                               reader.IsDBNull (3) ? null : reader.GetString (3),  /* passwordQuestion */\r
-                               reader.IsDBNull (4) ? null : reader.GetString (4),  /* comment */\r
-                               reader.GetInt32 (5) > 0,                            /* isApproved */\r
-                               reader.GetInt32 (6) > 0,                            /* isLockedOut */\r
-                               reader.GetDateTime (7).ToLocalTime (),              /* creationDate */\r
-                               reader.GetDateTime (8).ToLocalTime (),              /* lastLoginDate */\r
-                               reader.GetDateTime (9).ToLocalTime (),              /* lastActivityDate */\r
-                               reader.GetDateTime (10).ToLocalTime (),             /* lastPasswordChangedDate */\r
-                               reader.GetDateTime (11).ToLocalTime ()              /* lastLockoutDate */);\r
-               }
-
-               public override MembershipUser GetUser (string username, bool userIsOnline)
-               {
-                       if (username.Length == 0)
-                               return null;
-
-                       CheckParam ("username", username, 256);\r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               DbDataReader reader = null;\r
-                               int st = DerbyMembershipHelper.Membership_GetUserByName (connection, ApplicationName, username, userIsOnline, DateTime.UtcNow, out reader);\r
-                               using (reader) {\r
-                                       if (st == 0 && reader != null) {\r
-                                               MembershipUser u = GetUserFromReader (reader);\r
-                                               return u;\r
-                                       }\r
-                               }\r
-                       }\r
-                       return null;\r
-               }
-
-               public override MembershipUser GetUser (object providerUserKey, bool userIsOnline)
-               {\r
-                       if (providerUserKey == null)\r
-                               throw new ArgumentNullException ("providerUserKey");\r
-\r
-                       if (!(providerUserKey is Guid))\r
-                               throw new ArgumentException ("providerUserKey is not of type Guid", "providerUserKey");\r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               DbDataReader reader = null;\r
-                               int st = DerbyMembershipHelper.Membership_GetUserByUserId (connection, providerUserKey.ToString (), userIsOnline, DateTime.UtcNow, out reader);\r
-                               using (reader) {\r
-                                       if (st == 0 && reader != null) {\r
-                                               MembershipUser u = GetUserFromReader (reader);\r
-                                               return u;\r
-                                       }\r
-                               }\r
-                       }\r
-                       return null;
-               }
-
-               public override string GetUserNameByEmail (string email)
-               {
-                       CheckParam ("email", email, 256);\r
-\r
-                       string username = null;
-
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               int st = DerbyMembershipHelper.Membership_GetUserByEmail (connection, ApplicationName, email, out username);\r
-\r
-                               if (st == 1)\r
-                                       return null;\r
-                               \r
-                               if (st == 2 && RequiresUniqueEmail)\r
-                                       throw new ProviderException ("More than one user with the same e-mail address exists in the database and RequiresUniqueEmail is true");\r
-                       }\r
-                       return username;
-               }
-
-               bool GetBoolConfigValue (NameValueCollection config, string name, bool def)
-               {
-                       bool rv = def;
-                       string val = config [name];
-                       if (val != null) {
-                               try { rv = Boolean.Parse (val); }
-                               catch (Exception e) {
-                                       throw new ProviderException (String.Format ("{0} must be true or false", name), e);
-                               }
-                       }
-                       return rv;
-               }
-
-               int GetIntConfigValue (NameValueCollection config, string name, int def)
-               {
-                       int rv = def;
-                       string val = config [name];
-                       if (val != null) {
-                               try { rv = Int32.Parse (val); }
-                               catch (Exception e) {
-                                       throw new ProviderException (String.Format ("{0} must be an integer", name), e);
-                               }
-                       }
-                       return rv;
-               }
-
-               int GetEnumConfigValue (NameValueCollection config, string name, Type enumType, int def)
-               {
-                       int rv = def;
-                       string val = config [name];
-                       if (val != null) {
-                               try { rv = (int) Enum.Parse (enumType, val); }
-                               catch (Exception e) {
-                                       throw new ProviderException (String.Format ("{0} must be one of the following values: {1}", name, String.Join (",", Enum.GetNames (enumType))), e);
-                               }
-                       }
-                       return rv;
-               }
-
-               string GetStringConfigValue (NameValueCollection config, string name, string def)
-               {
-                       string rv = def;
-                       string val = config [name];
-                       if (val != null)
-                               rv = val;
-                       return rv;
-               }
-
-               void EmitValidatingPassword (string username, string password, bool isNewUser)
-               {
-                       ValidatePasswordEventArgs args = new ValidatePasswordEventArgs (username, password, isNewUser);
-                       OnValidatingPassword (args);
-
-                       /* if we're canceled.. */
-                       if (args.Cancel) {
-                               if (args.FailureInformation == null)
-                                       throw new ProviderException ("Password validation canceled");
-                               else
-                                       throw args.FailureInformation;
-                       }
-               }
-
-               public override void Initialize (string name, NameValueCollection config)
-               {
-                       if (config == null)
-                               throw new ArgumentNullException ("config");
-
-                       base.Initialize (name, config);
-
-                       applicationName = GetStringConfigValue (config, "applicationName", "/");
-                       enablePasswordReset = GetBoolConfigValue (config, "enablePasswordReset", true);
-                       enablePasswordRetrieval = GetBoolConfigValue (config, "enablePasswordRetrieval", false);
-                       requiresQuestionAndAnswer = GetBoolConfigValue (config, "requiresQuestionAndAnswer", true);
-                       requiresUniqueEmail = GetBoolConfigValue (config, "requiresUniqueEmail", false);
-                       passwordFormat = (MembershipPasswordFormat) GetEnumConfigValue (config, "passwordFormat", typeof (MembershipPasswordFormat),
-                                                                                          (int) MembershipPasswordFormat.Hashed);
-                       maxInvalidPasswordAttempts = GetIntConfigValue (config, "maxInvalidPasswordAttempts", 5);
-                       minRequiredPasswordLength = GetIntConfigValue (config, "minRequiredPasswordLength", 7);
-                       minRequiredNonAlphanumericCharacters = GetIntConfigValue (config, "minRequiredNonAlphanumericCharacters", 1);
-                       passwordAttemptWindow = GetIntConfigValue (config, "passwordAttemptWindow", 10);
-                       passwordStrengthRegularExpression = GetStringConfigValue (config, "passwordStrengthRegularExpression", "");
-
-                       MembershipSection section = (MembershipSection) WebConfigurationManager.GetSection ("system.web/membership");
-
-                       userIsOnlineTimeWindow = section.UserIsOnlineTimeWindow;
-
-                       /* we can't support password retrieval with hashed passwords */
-                       if (passwordFormat == MembershipPasswordFormat.Hashed && enablePasswordRetrieval)
-                               throw new ProviderException ("password retrieval cannot be used with hashed passwords");
-
-                       string connectionStringName = config ["connectionStringName"];
-
-                       if (applicationName.Length > 256)
-                               throw new ProviderException ("The ApplicationName attribute must be 256 characters long or less.");
-                       if (connectionStringName == null || connectionStringName.Length == 0)
-                               throw new ProviderException ("The ConnectionStringName attribute must be present and non-zero length.");
-
-                       connectionString = WebConfigurationManager.ConnectionStrings [connectionStringName];\r
-                       if (connectionString == null)\r
-                               throw new ProviderException (String.Format ("The connection name '{0}' was not found in the applications configuration or the connection string is empty.", connectionStringName));\r
-\r
-                       if (connectionString == null)\r
-                               throw new ProviderException (String.Format ("The connection name '{0}' was not found in the applications configuration or the connection string is empty.", connectionStringName));\r
-\r
-                       string shutdown = config ["shutdown"];\r
-                       if (!String.IsNullOrEmpty (shutdown))\r
-                               shutDownPolicy = (DerbyUnloadManager.DerbyShutDownPolicy) Enum.Parse (typeof (DerbyUnloadManager.DerbyShutDownPolicy), shutdown, true);\r
-               }
-
-               public override string ResetPassword (string username, string answer)
-               {
-                       if (!EnablePasswordReset)
-                               throw new NotSupportedException ("this provider has not been configured to allow the resetting of passwords");
-
-                       CheckParam ("username", username, 256);
-
-                       if (RequiresQuestionAndAnswer)
-                               CheckParam ("answer", answer, 128);
-
-                       using (DbConnection connection = CreateConnection ()) {
-                               PasswordInfo pi = GetPasswordInfo (username);
-                               if (pi == null)
-                                       throw new ProviderException (username + "is not found in the membership database");
-
-                               string newPassword = GeneratePassword ();
-                               EmitValidatingPassword (username, newPassword, false);
-
-                               string db_password = EncodePassword (newPassword, pi.PasswordFormat, pi.PasswordSalt);
-                               string db_answer = EncodePassword (answer, pi.PasswordFormat, pi.PasswordSalt);\r
-\r
-                               int st = DerbyMembershipHelper.Membership_ResetPassword (connection, ApplicationName, username, db_password, db_answer, (int) pi.PasswordFormat, pi.PasswordSalt, MaxInvalidPasswordAttempts, PasswordAttemptWindow, DateTime.UtcNow);
-
-                               if (st == 0)
-                                       return newPassword;
-                               else if (st == 1)\r
-                                       throw new ProviderException (username + " is not found in the membership database");\r
-                               else if (st == 2)\r
-                                       throw new MembershipPasswordException ("The user account is currently locked out");\r
-                               else if (st == 3)
-                                       throw new MembershipPasswordException ("Password Answer is invalid");
-                               else
-                                       throw new ProviderException ("Failed to reset password");
-                       }
-               }
-
-               public override void UpdateUser (MembershipUser user)
-               {
-                       if (user == null)
-                               throw new ArgumentNullException ("user");
-
-                       if (user.UserName == null)
-                               throw new ArgumentNullException ("user.UserName");
-
-                       if (RequiresUniqueEmail && user.Email == null)
-                               throw new ArgumentNullException ("user.Email");
-
-                       CheckParam ("user.UserName", user.UserName, 256);
-
-                       if (user.Email.Length > 256 || (RequiresUniqueEmail && user.Email.Length == 0))
-                               throw new ArgumentException ("invalid format for user.Email");
-
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               int st = DerbyMembershipHelper.Membership_UpdateUser (connection, ApplicationName, user.UserName, user.Email, user.Comment, user.IsApproved, RequiresUniqueEmail, user.LastLoginDate, DateTime.UtcNow, DateTime.UtcNow);
-
-                               if (st == 1)
-                                       throw new ProviderException ("The UserName property of user was not found in the database.");
-                               if (st == 2)
-                                       throw new ProviderException ("The Email property of user was equal to an existing e-mail address in the database and RequiresUniqueEmail is set to true.");
-                               if (st != 0)
-                                       throw new ProviderException ("Failed to update user");
-                       }
-               }
-
-               public override bool ValidateUser (string username, string password)
-               {
-                       if (username.Length == 0)
-                               return false;
-
-                       CheckParam ("username", username, 256);
-                       EmitValidatingPassword (username, password, false);
-
-                       PasswordInfo pi = ValidateUsingPassword (username, password);
-                       if (pi != null) {
-                               pi.LastLoginDate = DateTime.UtcNow;
-                               UpdateUserInfo (username, pi, true, true);
-                               return true;
-                       }
-                       return false;
-               }
-
-               public override bool UnlockUser (string username)
-               {
-                       CheckParam ("username", username, 256);
-
-                       using (DbConnection connection = CreateConnection ()) {
-                               try {\r
-                                       int st = DerbyMembershipHelper.Membership_UnlockUser (connection, ApplicationName, username);
-
-                                       if (st == 0)
-                                               return true;
-                               }
-                               catch (Exception e) {
-                                       throw new ProviderException ("Failed to unlock user", e);
-                               }
-                       }
-                       return false;
-               }
-
-               void UpdateUserInfo (string username, PasswordInfo pi, bool isPasswordCorrect, bool updateLoginActivity)
-               {
-                       CheckParam ("username", username, 256);
-
-                       using (DbConnection connection = CreateConnection ()) {
-                               try {\r
-                                       int st = DerbyMembershipHelper.Membership_UpdateUserInfo (connection, ApplicationName, username, isPasswordCorrect, updateLoginActivity,\r
-                                               MaxInvalidPasswordAttempts, PasswordAttemptWindow, DateTime.UtcNow, pi.LastLoginDate, pi.LastActivityDate);
-
-                                       if (st == 0)
-                                               return;
-                               }
-                               catch (Exception e) {
-                                       throw new ProviderException ("Failed to update Membership table", e);
-                               }
-
-                       }
-               }
-
-               PasswordInfo ValidateUsingPassword (string username, string password)
-               {
-                       MembershipUser user = GetUser (username, true);
-                       if (user == null)
-                               return null;
-
-                       if (!user.IsApproved || user.IsLockedOut)
-                               return null;
-
-                       PasswordInfo pi = GetPasswordInfo (username);
-
-                       if (pi == null)
-                               return null;
-
-                       /* do the actual validation */
-                       string user_password = EncodePassword (password, pi.PasswordFormat, pi.PasswordSalt);
-
-                       if (user_password != pi.Password) {
-                               UpdateUserInfo (username, pi, false, false);
-                               return null;
-                       }
-
-                       return pi;
-               }\r
-\r
-               private PasswordInfo GetPasswordInfo (string username)\r
-               {\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               DbDataReader reader = null;\r
-                               DerbyMembershipHelper.Membership_GetPasswordWithFormat (connection, ApplicationName, username, false, DateTime.UtcNow, out reader);\r
-\r
-                               PasswordInfo pi = null;\r
-                               if (reader == null)\r
-                                       return null;\r
-\r
-                               using (reader) {\r
-                                       if (reader.Read ()) {\r
-                                               int isLockedOut = reader.GetInt32 (1);\r
-                                               if (isLockedOut > 0)\r
-                                                       return null;\r
-\r
-                                               pi = new PasswordInfo (\r
-                                                       reader.GetString (3),\r
-                                                       (MembershipPasswordFormat) reader.GetInt32 (4),\r
-                                                       reader.GetString (5),\r
-                                                       reader.GetInt32 (6),\r
-                                                       reader.GetInt32 (7),\r
-                                                       reader.GetInt32 (2) > 0,\r
-                                                       reader.GetDateTime (8),\r
-                                                       reader.GetDateTime (9));\r
-                                       }\r
-                               }\r
-                               return pi;\r
-                       }\r
-               }\r
-\r
-               private string EncodePassword (string password, MembershipPasswordFormat passwordFormat, string salt)\r
-               {\r
-                       byte [] password_bytes;\r
-                       byte [] salt_bytes;\r
-\r
-                       switch (passwordFormat) {\r
-                               case MembershipPasswordFormat.Clear:\r
-                                       return password;\r
-                               case MembershipPasswordFormat.Hashed:\r
-                                       password_bytes = Encoding.Unicode.GetBytes (password);\r
-                                       salt_bytes = Convert.FromBase64String (salt);\r
-\r
-                                       byte [] hashBytes = new byte [salt_bytes.Length + password_bytes.Length];\r
-\r
-                                       Buffer.BlockCopy (salt_bytes, 0, hashBytes, 0, salt_bytes.Length);\r
-                                       Buffer.BlockCopy (password_bytes, 0, hashBytes, salt_bytes.Length, password_bytes.Length);\r
-\r
-                                       MembershipSection section = (MembershipSection) WebConfigurationManager.GetSection ("system.web/membership");\r
-                                       string alg_type = section.HashAlgorithmType;\r
-                                       if (alg_type == "") {\r
-                                               MachineKeySection keysection = (MachineKeySection) WebConfigurationManager.GetSection ("system.web/machineKey");\r
-                                               alg_type = keysection.Validation.ToString ();\r
-                                       }\r
-                                       using (HashAlgorithm hash = HashAlgorithm.Create (alg_type)) {\r
-                                               hash.TransformFinalBlock (hashBytes, 0, hashBytes.Length);\r
-                                               return Convert.ToBase64String (hash.Hash);\r
-                                       }\r
-                               case MembershipPasswordFormat.Encrypted:\r
-                                       password_bytes = Encoding.Unicode.GetBytes (password);\r
-                                       salt_bytes = Convert.FromBase64String (salt);\r
-\r
-                                       byte [] buf = new byte [password_bytes.Length + salt_bytes.Length];\r
-\r
-                                       Array.Copy (salt_bytes, 0, buf, 0, salt_bytes.Length);\r
-                                       Array.Copy (password_bytes, 0, buf, salt_bytes.Length, password_bytes.Length);\r
-\r
-                                       return Convert.ToBase64String (EncryptPassword (buf));\r
-                               default:\r
-                                       /* not reached.. */\r
-                                       return null;\r
-                       }\r
-               }\r
-\r
-               private string DecodePassword (string password, MembershipPasswordFormat passwordFormat)\r
-               {\r
-                       switch (passwordFormat) {\r
-                               case MembershipPasswordFormat.Clear:\r
-                                       return password;\r
-                               case MembershipPasswordFormat.Hashed:\r
-                                       throw new ProviderException ("Hashed passwords cannot be decoded.");\r
-                               case MembershipPasswordFormat.Encrypted:\r
-                                       return Encoding.Unicode.GetString (DecryptPassword (Convert.FromBase64String (password)));\r
-                               default:\r
-                                       /* not reached.. */\r
-                                       return null;\r
-                       }\r
-               }
-
-               public override string ApplicationName
-               {
-                       get { return applicationName; }
-                       set { applicationName = value; }
-               }
-
-               public override bool EnablePasswordReset
-               {
-                       get { return enablePasswordReset; }
-               }
-
-               public override bool EnablePasswordRetrieval
-               {
-                       get { return enablePasswordRetrieval; }
-               }
-
-               public override MembershipPasswordFormat PasswordFormat
-               {
-                       get { return passwordFormat; }
-               }
-
-               public override bool RequiresQuestionAndAnswer
-               {
-                       get { return requiresQuestionAndAnswer; }
-               }
-
-               public override bool RequiresUniqueEmail
-               {
-                       get { return requiresUniqueEmail; }
-               }
-
-               public override int MaxInvalidPasswordAttempts
-               {
-                       get { return maxInvalidPasswordAttempts; }
-               }
-
-               public override int MinRequiredNonAlphanumericCharacters
-               {
-                       get { return minRequiredNonAlphanumericCharacters; }
-               }
-
-               public override int MinRequiredPasswordLength
-               {
-                       get { return minRequiredPasswordLength; }
-               }
-
-               public override int PasswordAttemptWindow
-               {
-                       get { return passwordAttemptWindow; }
-               }
-
-               public override string PasswordStrengthRegularExpression
-               {
-                       get { return passwordStrengthRegularExpression; }
-               }
-
-               [Flags]
-               private enum DeleteUserTableMask
-               {
-                       MembershipUsers = 1,
-                       UsersInRoles = 2,
-                       Profiles = 4,
-                       WebPartStateUser = 8
-               }
-
-               private sealed class PasswordInfo
-               {
-                       private string _password;
-                       private MembershipPasswordFormat _passwordFormat;
-                       private string _passwordSalt;
-                       private int _failedPasswordAttemptCount;
-                       private int _failedPasswordAnswerAttemptCount;
-                       private bool _isApproved;
-                       private DateTime _lastLoginDate;
-                       private DateTime _lastActivityDate;
-
-                       internal PasswordInfo (
-                               string password,
-                               MembershipPasswordFormat passwordFormat,
-                               string passwordSalt,
-                               int failedPasswordAttemptCount,
-                               int failedPasswordAnswerAttemptCount,
-                               bool isApproved,
-                               DateTime lastLoginDate,
-                               DateTime lastActivityDate)
-                       {
-                               _password = password;
-                               _passwordFormat = passwordFormat;
-                               _passwordSalt = passwordSalt;
-                               _failedPasswordAttemptCount = failedPasswordAttemptCount;
-                               _failedPasswordAnswerAttemptCount = failedPasswordAnswerAttemptCount;
-                               _isApproved = isApproved;
-                               _lastLoginDate = lastLoginDate;
-                               _lastActivityDate = lastActivityDate;
-                       }
-
-                       public string Password
-                       {
-                               get { return _password; }
-                               set { _password = value; }
-                       }
-                       public MembershipPasswordFormat PasswordFormat
-                       {
-                               get { return _passwordFormat; }
-                               set { _passwordFormat = value; }
-                       }
-                       public string PasswordSalt
-                       {
-                               get { return _passwordSalt; }
-                               set { _passwordSalt = value; }
-                       }
-                       public int FailedPasswordAttemptCount
-                       {
-                               get { return _failedPasswordAttemptCount; }
-                               set { _failedPasswordAttemptCount = value; }
-                       }
-                       public int FailedPasswordAnswerAttemptCount
-                       {
-                               get { return _failedPasswordAnswerAttemptCount; }
-                               set { _failedPasswordAnswerAttemptCount = value; }
-                       }
-                       public bool IsApproved
-                       {
-                               get { return _isApproved; }
-                               set { _isApproved = value; }
-                       }
-                       public DateTime LastLoginDate
-                       {
-                               get { return _lastLoginDate; }
-                               set { _lastLoginDate = value; }
-                       }
-                       public DateTime LastActivityDate
-                       {
-                               get { return _lastActivityDate; }
-                               set { _lastActivityDate = value; }
-                       }
-               }
-       }
-}\r
-
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyRoleProvider.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyRoleProvider.cs
deleted file mode 100644 (file)
index 0f488be..0000000
+++ /dev/null
@@ -1,374 +0,0 @@
-//\r
-// Mainsoft.Web.Security.DerbyRoleProvider\r
-//\r
-// Authors:\r
-//     Ben Maurer (bmaurer@users.sourceforge.net)\r
-//     Chris Toshok (toshok@ximian.com)\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Collections.Specialized;\r
-using System.Data;\r
-using System.Data.OleDb;\r
-using System.Data.Common;\r
-using System.Configuration;\r
-using System.Configuration.Provider;\r
-using System.Web.Configuration;\r
-using System.Web.Security;\r
-\r
-namespace Mainsoft.Web.Security\r
-{\r
-       /// <summary>\r
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
-       /// <para>Manages storage of role membership information for an ASP.NET application in a Derby database.</para>\r
-       /// </summary>\r
-       public class DerbyRoleProvider : RoleProvider\r
-       {\r
-               ConnectionStringSettings connectionString;\r
-               string applicationName;\r
-               bool schemaChecked = false;\r
-               DerbyUnloadManager.DerbyShutDownPolicy shutDownPolicy = DerbyUnloadManager.DerbyShutDownPolicy.Default;\r
-\r
-               DbConnection CreateConnection ()\r
-               {\r
-                       if (!schemaChecked) {\r
-                               DerbyDBSchema.CheckSchema (connectionString.ConnectionString);\r
-                               schemaChecked = true;\r
-\r
-                               DerbyUnloadManager.RegisterUnloadHandler (connectionString.ConnectionString, shutDownPolicy);\r
-                       }\r
-\r
-                       OleDbConnection connection = new OleDbConnection (connectionString.ConnectionString);\r
-                       connection.Open ();\r
-                       return connection;\r
-               }\r
-\r
-               public override void AddUsersToRoles (string [] usernames, string [] rolenames)\r
-               {\r
-                       Hashtable h = new Hashtable ();\r
-\r
-                       foreach (string u in usernames) {\r
-                               if (u == null)\r
-                                       throw new ArgumentNullException ("null element in usernames array");\r
-                               if (h.ContainsKey (u))\r
-                                       throw new ArgumentException ("duplicate element in usernames array");\r
-                               if (u.Length == 0 || u.Length > 256 || u.IndexOf (",") != -1)\r
-                                       throw new ArgumentException ("element in usernames array in illegal format");\r
-                               h.Add (u, u);\r
-                       }\r
-\r
-                       h = new Hashtable ();\r
-                       foreach (string r in rolenames) {\r
-                               if (r == null)\r
-                                       throw new ArgumentNullException ("null element in rolenames array");\r
-                               if (h.ContainsKey (r))\r
-                                       throw new ArgumentException ("duplicate element in rolenames array");\r
-                               if (r.Length == 0 || r.Length > 256 || r.IndexOf (",") != -1)\r
-                                       throw new ArgumentException ("element in rolenames array in illegal format");\r
-                               h.Add (r, r);\r
-                       } \r
-                       \r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               int returnValue = DerbyRolesHelper.UsersInRoles_AddUsersToRoles (connection, ApplicationName, usernames, rolenames, DateTime.UtcNow);\r
-\r
-                               if (returnValue == 0)\r
-                                       return;\r
-                               else if (returnValue == 2)\r
-                                       throw new ProviderException ("One or more of the specified role names was not found.");\r
-                               else if (returnValue == 3)\r
-                                       throw new ProviderException ("One or more of the specified user names is already associated with one or more of the specified role names.");\r
-                               else\r
-                                       throw new ProviderException ("Failed to create new user/role association.");\r
-                       }\r
-               }\r
-\r
-               public override void CreateRole (string rolename)\r
-               {\r
-                       if (rolename == null)\r
-                               throw new ArgumentNullException ("rolename");\r
-\r
-                       if (rolename.Length == 0 || rolename.Length > 256 || rolename.IndexOf (",") != -1)\r
-                               throw new ArgumentException ("rolename is in invalid format");\r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               int returnValue = DerbyRolesHelper.Roles_CreateRole (connection, ApplicationName, rolename);\r
-                               \r
-                               if (returnValue == 2)\r
-                                       throw new ProviderException (rolename + " already exists in the database");\r
-                               else\r
-                                       return;\r
-                       }\r
-               }\r
-\r
-               public override bool DeleteRole (string rolename, bool throwOnPopulatedRole)\r
-               {\r
-                       if (rolename == null)\r
-                               throw new ArgumentNullException ("rolename");\r
-\r
-                       if (rolename.Length == 0 || rolename.Length > 256 || rolename.IndexOf (",") != -1)\r
-                               throw new ArgumentException ("rolename is in invalid format");\r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               int returnValue = DerbyRolesHelper.Roles_DeleteRole (connection, ApplicationName, rolename, throwOnPopulatedRole);\r
-\r
-                               if (returnValue == 0)\r
-                                       return true;\r
-                               if (returnValue == 2)\r
-                                       return false; //role does not exist\r
-                               else if (returnValue == 3 && throwOnPopulatedRole)\r
-                                       throw new ProviderException (rolename + " is not empty");\r
-                               else\r
-                                       return false;\r
-                       }\r
-               }\r
-\r
-               public override string [] FindUsersInRole (string roleName, string usernameToMatch)\r
-               {\r
-                       if (roleName == null)\r
-                               throw new ArgumentNullException ("roleName");\r
-                       if (usernameToMatch == null)\r
-                               throw new ArgumentNullException ("usernameToMatch");\r
-                       if (roleName.Length == 0 || roleName.Length > 256 || roleName.IndexOf (",") != -1)\r
-                               throw new ArgumentException ("roleName is in invalid format");\r
-                       if (usernameToMatch.Length == 0 || usernameToMatch.Length > 256)\r
-                               throw new ArgumentException ("usernameToMatch is in invalid format");\r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               DbDataReader reader;\r
-                               ArrayList userList = new ArrayList ();\r
-                               int returnValue = DerbyRolesHelper.UsersInRoles_FindUsersInRole (connection, applicationName, roleName, usernameToMatch, out reader);\r
-\r
-                               if (returnValue == 2)\r
-                                       throw new ProviderException ("The role '" + roleName + "' was not found.");\r
-\r
-                               using (reader) {\r
-                                       if (reader == null)\r
-                                               return new string [] { };\r
-\r
-                                       while (reader.Read ())\r
-                                               userList.Add (reader.GetString (0));\r
-                               }\r
-                               return (string []) userList.ToArray (typeof (string));\r
-                       }\r
-               }\r
-\r
-               public override string [] GetAllRoles ()\r
-               {\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               DbDataReader reader;\r
-                               ArrayList roleList = new ArrayList ();\r
-                               DerbyRolesHelper.Roles_GetAllRoles (connection, applicationName, out reader);\r
-                               using (reader) {\r
-                                       if (reader == null)\r
-                                               return new string [] { };\r
-\r
-                                       while (reader.Read ())\r
-                                               roleList.Add (reader.GetString (0));\r
-                               }\r
-                               return (string []) roleList.ToArray (typeof (string));\r
-                       }\r
-               }\r
-\r
-               public override string [] GetRolesForUser (string username)\r
-               {\r
-                       if (username == null)\r
-                               throw new ArgumentNullException ("rolename");\r
-\r
-                       if (username.Length == 0 || username.Length > 256 || username.IndexOf (",") != -1)\r
-                               throw new ArgumentException ("username is in invalid format");\r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               DbDataReader reader;\r
-                               ArrayList roleList = new ArrayList ();\r
-                               int returnValue = DerbyRolesHelper.UsersInRoles_GetRolesForUser (connection, applicationName, username, out reader);\r
-\r
-                               if (returnValue == 2)\r
-                                       throw new ProviderException ("username was not found in the database");\r
-\r
-                               using (reader) {\r
-                                       if (reader == null)\r
-                                               return new string [] { };\r
-\r
-                                       while (reader.Read ())\r
-                                               roleList.Add (reader.GetString (0));\r
-                               }\r
-                               return (string []) roleList.ToArray (typeof (string));\r
-                       }\r
-               }\r
-\r
-               public override string [] GetUsersInRole (string rolename)\r
-               {\r
-                       if (rolename == null)\r
-                               throw new ArgumentNullException ("rolename");\r
-\r
-                       if (rolename.Length == 0 || rolename.Length > 256 || rolename.IndexOf (",") != -1)\r
-                               throw new ArgumentException ("rolename is in invalid format");\r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               DbDataReader reader;\r
-                               ArrayList roleList = new ArrayList ();\r
-                               int returnValue = DerbyRolesHelper.UsersInRoles_GetUsersInRoles (connection, applicationName, rolename, out reader);\r
-\r
-                               if (returnValue == 2)\r
-                                       throw new ProviderException ("The role '" + rolename + "' was not found.");\r
-\r
-                               using (reader) {\r
-                                       if (reader == null)\r
-                                               return new string [] { };\r
-\r
-                                       while (reader.Read ())\r
-                                               roleList.Add (reader.GetString (0));\r
-                               }\r
-                               return (string []) roleList.ToArray (typeof (string));\r
-                       }\r
-               }\r
-\r
-               string GetStringConfigValue (NameValueCollection config, string name, string def)\r
-               {\r
-                       string rv = def;\r
-                       string val = config [name];\r
-                       if (val != null)\r
-                               rv = val;\r
-                       return rv;\r
-               }\r
-\r
-               public override void Initialize (string name, NameValueCollection config)\r
-               {\r
-                       if (config == null)\r
-                               throw new ArgumentNullException ("config");\r
-\r
-                       base.Initialize (name, config);\r
-\r
-                       applicationName = config ["applicationName"];\r
-                       string connectionStringName = config ["connectionStringName"];\r
-\r
-                       if (applicationName.Length > 256)\r
-                               throw new ProviderException ("The ApplicationName attribute must be 256 characters long or less.");\r
-                       if (connectionStringName == null || connectionStringName.Length == 0)\r
-                               throw new ProviderException ("The ConnectionStringName attribute must be present and non-zero length.");\r
-\r
-                       // XXX check connectionStringName and commandTimeout\r
-\r
-                       connectionString = WebConfigurationManager.ConnectionStrings [connectionStringName];\r
-                       if (connectionString == null)\r
-                               throw new ProviderException (String.Format("The connection name '{0}' was not found in the applications configuration or the connection string is empty.", connectionStringName));\r
-\r
-                       string shutdown = config ["shutdown"];\r
-                       if (!String.IsNullOrEmpty (shutdown))\r
-                               shutDownPolicy = (DerbyUnloadManager.DerbyShutDownPolicy) Enum.Parse (typeof (DerbyUnloadManager.DerbyShutDownPolicy), shutdown, true);\r
-               }\r
-\r
-               public override bool IsUserInRole (string username, string rolename)\r
-               {\r
-                       if (username == null)\r
-                               throw new ArgumentNullException ("rolename");\r
-                       if (username.Length == 0 || username.Length > 256 || username.IndexOf (",") != -1)\r
-                               throw new ArgumentException ("username is in invalid format");\r
-                       if (rolename == null)\r
-                               throw new ArgumentNullException ("rolename");\r
-                       if (rolename.Length == 0 || rolename.Length > 256 || rolename.IndexOf (",") != -1)\r
-                               throw new ArgumentException ("rolename is in invalid format");\r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               int returnValue = DerbyRolesHelper.UsersInRoles_IsUserInRole (connection, ApplicationName, username, rolename);\r
-\r
-                               if (returnValue == 4)\r
-                                       return true;\r
-\r
-                               return false;\r
-                       }\r
-               }\r
-\r
-               public override void RemoveUsersFromRoles (string [] usernames, string [] rolenames)\r
-               {\r
-                       Hashtable h = new Hashtable ();\r
-\r
-                       foreach (string u in usernames) {\r
-                               if (u == null)\r
-                                       throw new ArgumentNullException ("null element in usernames array");\r
-                               if (h.ContainsKey (u))\r
-                                       throw new ArgumentException ("duplicate element in usernames array");\r
-                               if (u.Length == 0 || u.Length > 256 || u.IndexOf (",") != -1)\r
-                                       throw new ArgumentException ("element in usernames array in illegal format");\r
-                               h.Add (u, u);\r
-                       }\r
-\r
-                       h = new Hashtable ();\r
-                       foreach (string r in rolenames) {\r
-                               if (r == null)\r
-                                       throw new ArgumentNullException ("null element in rolenames array");\r
-                               if (h.ContainsKey (r))\r
-                                       throw new ArgumentException ("duplicate element in rolenames array");\r
-                               if (r.Length == 0 || r.Length > 256 || r.IndexOf (",") != -1)\r
-                                       throw new ArgumentException ("element in rolenames array in illegal format");\r
-                               h.Add (r, r);\r
-                       } \r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               int returnValue = DerbyRolesHelper.UsersInRoles_RemoveUsersFromRoles (connection, ApplicationName, usernames, rolenames);\r
-\r
-                               if (returnValue == 0)\r
-                                       return;\r
-                               else if (returnValue == 2)\r
-                                       throw new ProviderException ("One or more of the specified user names was not found.");\r
-                               else if (returnValue == 3)\r
-                                       throw new ProviderException ("One or more of the specified role names was not found.");\r
-                               else if (returnValue == 4)\r
-                                       throw new ProviderException ("One or more of the specified user names is not associated with one or more of the specified role names.");\r
-                               else\r
-                                       throw new ProviderException ("Failed to remove users from roles");\r
-                       }\r
-               }\r
-\r
-               public override bool RoleExists (string rolename)\r
-               {\r
-                       if (rolename == null)\r
-                               throw new ArgumentNullException ("rolename");\r
-\r
-                       if (rolename.Length == 0 || rolename.Length > 256 || rolename.IndexOf (",") != -1)\r
-                               throw new ArgumentException ("rolename is in invalid format");\r
-\r
-                       using (DbConnection connection = CreateConnection ()) {\r
-                               int returnValue = DerbyRolesHelper.Roles_RoleExists (connection, ApplicationName, rolename);\r
-\r
-                               if (returnValue == 2)\r
-                                       return true;\r
-\r
-                               return false;\r
-                       }\r
-               }\r
-\r
-               public override string ApplicationName\r
-               {\r
-                       get { return applicationName; }\r
-                       set\r
-                       {\r
-                               applicationName = value;\r
-                       }\r
-               }\r
-       }\r
-}\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyRolesHelper.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyRolesHelper.cs
deleted file mode 100644 (file)
index 04c6ccb..0000000
+++ /dev/null
@@ -1,428 +0,0 @@
-//\r
-// Mainsoft.Web.Security.DerbyRolesHelper\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-// (C) 2006 Mainsoft\r
-//\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Web.Security;\r
-using System.Data;\r
-using System.Data.OleDb;\r
-using System.Data.Common;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-\r
-namespace Mainsoft.Web.Security\r
-{\r
-       static class DerbyRolesHelper\r
-       {\r
-               private static OleDbParameter AddParameter (OleDbCommand command, string paramName, object paramValue)\r
-               {\r
-                       OleDbParameter prm = new OleDbParameter (paramName, paramValue);\r
-                       command.Parameters.Add (prm);\r
-                       return prm;\r
-               }\r
-\r
-               public static int Roles_CreateRole (DbConnection connection, string applicationName, string rolename)\r
-               {\r
-                       string appId = (string) DerbyApplicationsHelper.Applications_CreateApplication (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 1;\r
-\r
-                       string querySelect = "SELECT RoleName FROM aspnet_Roles WHERE ApplicationId = ? AND LoweredRoleName = ?";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "ApplicationId", appId);\r
-                       AddParameter (cmdSelect, "LoweredRoleName", rolename.ToLowerInvariant ());\r
-\r
-                       using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       return 2; // role already exists\r
-                       }\r
-\r
-                       string queryInsert = "INSERT INTO aspnet_Roles (ApplicationId, RoleId, RoleName, LoweredRoleName) VALUES (?, ?, ?, ?)";\r
-                       OleDbCommand cmdInsert = new OleDbCommand (queryInsert, (OleDbConnection) connection);\r
-                       AddParameter (cmdInsert, "ApplicationId", appId);\r
-                       AddParameter (cmdInsert, "RoleId", Guid.NewGuid ().ToString ());\r
-                       AddParameter (cmdInsert, "RoleName", rolename);\r
-                       AddParameter (cmdInsert, "LoweredRoleName", rolename.ToLowerInvariant ());\r
-                       cmdInsert.ExecuteNonQuery ();\r
-\r
-                       return 0;\r
-               }\r
-\r
-               public static int Roles_DeleteRole (DbConnection connection, string applicationName, string rolename, bool deleteOnlyIfRoleIsEmpty)\r
-               {\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 1;\r
-\r
-                       string roleId = GetRoleId (connection, appId, rolename);\r
-                       if (roleId == null)\r
-                               return 2;\r
-\r
-                       if (deleteOnlyIfRoleIsEmpty) {\r
-                               string querySelect = "SELECT RoleId FROM aspnet_UsersInRoles WHERE RoleId = ?";\r
-                               OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                               AddParameter (cmdSelect, "RoleId", roleId);\r
-                               using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {\r
-                                       if (reader.Read ())\r
-                                               // role is not empty\r
-                                               return 3;\r
-                               }\r
-                       }\r
-\r
-                       string queryDelUsers = "DELETE FROM aspnet_UsersInRoles WHERE RoleId = ?";\r
-                       OleDbCommand cmdDelUsers = new OleDbCommand (queryDelUsers, (OleDbConnection) connection);\r
-                       AddParameter (cmdDelUsers, "RoleId", roleId);\r
-                       cmdDelUsers.ExecuteNonQuery ();\r
-\r
-                       string queryDelRole = "DELETE FROM aspnet_Roles WHERE ApplicationId = ? AND RoleId = ? ";\r
-                       OleDbCommand cmdDelRole = new OleDbCommand (queryDelRole, (OleDbConnection) connection);\r
-                       AddParameter (cmdDelRole, "ApplicationId", appId);\r
-                       AddParameter (cmdDelRole, "RoleId", roleId);\r
-                       cmdDelRole.ExecuteNonQuery ();\r
-\r
-                       return 0;\r
-               }\r
-\r
-               public static int Roles_GetAllRoles (DbConnection connection, string applicationName, out DbDataReader reader)\r
-               {\r
-                       reader = null;\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 1;\r
-\r
-                       string querySelect = "SELECT RoleName FROM aspnet_Roles WHERE ApplicationId = ? ORDER BY RoleName";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "ApplicationId", appId);\r
-                       reader = cmdSelect.ExecuteReader ();\r
-\r
-                       return 0;\r
-               }\r
-\r
-               public static int Roles_RoleExists (DbConnection connection, string applicationName, string rolename)\r
-               {\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 1;\r
-\r
-                       string querySelect = "SELECT RoleName FROM aspnet_Roles WHERE ApplicationId = ? AND LoweredRoleName = ?";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "ApplicationId", appId);\r
-                       AddParameter (cmdSelect, "LoweredRoleName", rolename.ToLowerInvariant ());\r
-\r
-                       using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       return 2;\r
-                       }\r
-                       return 0;\r
-               }\r
-\r
-               public static int UsersInRoles_AddUsersToRoles (DbConnection connection, string applicationName, string [] userNames, string [] roleNames, DateTime currentTimeUtc)\r
-               {\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 1;\r
-\r
-                       string [] userIds = new string [userNames.Length];\r
-                       string [] loweredUsernames = new string [userNames.Length];\r
-                       string [] roleIds = new string [roleNames.Length];\r
-\r
-                       string querySelUsers = "SELECT UserId, LoweredUserName FROM aspnet_Users WHERE ApplicationId = ? AND LoweredUserName in " + GetPrms (userNames.Length);\r
-                       OleDbCommand cmdSelUsers = new OleDbCommand (querySelUsers, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelUsers, "ApplicationId", appId);\r
-                       for (int i = 0; i < userNames.Length; i++)\r
-                               AddParameter (cmdSelUsers, "LoweredUserName", userNames [i].ToLowerInvariant ());\r
-\r
-                       int userIndex = 0;\r
-                       using (OleDbDataReader reader = cmdSelUsers.ExecuteReader ()) {\r
-                               while (reader.Read ()) {\r
-                                       userIds [userIndex] = reader.GetString (0);\r
-                                       loweredUsernames [userIndex] = reader.GetString (1);\r
-                                       userIndex++;\r
-                               }\r
-                       }\r
-\r
-                       if (userNames.Length != userIndex) {\r
-                               // find not existing users and create them\r
-                               for (int j = 0; j < userNames.Length; j++)\r
-                                       if (Array.IndexOf (loweredUsernames, userNames [j].ToLowerInvariant ()) < 0) {\r
-                                               string newUserId = Guid.NewGuid ().ToString ();\r
-                                               string queryAddUser = "INSERT INTO aspnet_Users (ApplicationId, UserId, UserName, " +\r
-                                                       "LoweredUserName, IsAnonymous, LastActivityDate) VALUES (?, ?, ?, ?, ?, ?)";\r
-                                               OleDbCommand cmdAddUser = new OleDbCommand (queryAddUser, (OleDbConnection) connection);\r
-                                               AddParameter (cmdAddUser, "ApplicationId", appId);\r
-                                               AddParameter (cmdAddUser, "UserId", newUserId);\r
-                                               AddParameter (cmdAddUser, "UserName", userNames [j]);\r
-                                               AddParameter (cmdAddUser, "LoweredUserName", userNames [j].ToLowerInvariant ());\r
-                                               AddParameter (cmdAddUser, "IsAnonymous", 0);\r
-                                               AddParameter (cmdAddUser, "LastActivityDate", DateTime.UtcNow);\r
-                                               cmdAddUser.ExecuteNonQuery ();\r
-\r
-                                               userIds [userIndex++] = newUserId;\r
-                                       }\r
-                       }\r
-\r
-\r
-                       string querySelRoles = "SELECT RoleId FROM aspnet_Roles WHERE ApplicationId = ? AND LoweredRoleName in " + GetPrms (roleNames.Length);\r
-                       OleDbCommand cmdSelRoles = new OleDbCommand (querySelRoles, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelRoles, "ApplicationId", appId);\r
-                       for (int i = 0; i < roleNames.Length; i++)\r
-                               AddParameter (cmdSelRoles, "LoweredRoleName", roleNames [i].ToLowerInvariant ());\r
-\r
-                       using (OleDbDataReader reader = cmdSelRoles.ExecuteReader ()) {\r
-                               int i = 0;\r
-                               while (reader.Read ())\r
-                                       roleIds [i++] = reader.GetString (0);\r
-\r
-                               if (roleNames.Length != i)\r
-                                       return 2; // one or more roles not found\r
-                       }\r
-\r
-                       string querySelCount = "SELECT COUNT(*) FROM aspnet_UsersInRoles WHERE UserId in " + GetPrms (userNames.Length) + " AND RoleId in " + GetPrms (roleNames.Length);\r
-                       OleDbCommand cmdSelCount = new OleDbCommand (querySelCount, (OleDbConnection) connection);\r
-                       foreach (string userId in userIds)\r
-                               AddParameter (cmdSelCount, "UserId", userId);\r
-                       foreach (string roleId in roleIds)\r
-                               AddParameter (cmdSelCount, "RoleId", roleId);\r
-                       using (OleDbDataReader reader = cmdSelCount.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       if (reader.GetInt32 (0) > 0)\r
-                                               return 3;\r
-                       }\r
-\r
-                       string valuesExp = string.Empty;\r
-                       int pairs = userNames.Length * roleNames.Length;\r
-                       for (int i = 0; i < pairs; i++)\r
-                               valuesExp += "(?, ?),";\r
-\r
-                       string queryInsert = "INSERT INTO aspnet_UsersInRoles (UserId, RoleId) VALUES " + valuesExp.Trim (',');\r
-                       OleDbCommand cmdInsert = new OleDbCommand (queryInsert, (OleDbConnection) connection);\r
-                       foreach (string roleId in roleIds)\r
-                               foreach (string userId in userIds) {\r
-                                       AddParameter (cmdInsert, "UserId", userId);\r
-                                       AddParameter (cmdInsert, "RoleId", roleId);\r
-                               }\r
-\r
-                       cmdInsert.ExecuteNonQuery ();\r
-                       return 0;\r
-               }\r
-\r
-               public static int UsersInRoles_FindUsersInRole (DbConnection connection, string applicationName, string rolename, string userNameToMatch, out DbDataReader reader)\r
-               {\r
-                       reader = null;\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 1;\r
-\r
-                       string roleId = GetRoleId (connection, appId, rolename);\r
-                       if (roleId == null)\r
-                               return 2;\r
-\r
-                       string querySelect = "SELECT usr.UserName FROM aspnet_Users usr, aspnet_UsersInRoles uir " +\r
-                               "WHERE usr.UserId = uir.UserId AND usr.ApplicationId = ? AND uir.RoleId = ? AND LoweredUserName LIKE ? " +\r
-                               "ORDER BY usr.UserName";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "ApplicationId", appId);\r
-                       AddParameter (cmdSelect, "RoleId", roleId);\r
-                       AddParameter (cmdSelect, "LoweredUserName", "%" + userNameToMatch.ToLowerInvariant() + "%");\r
-                       reader = cmdSelect.ExecuteReader ();\r
-\r
-                       return 0;\r
-               }\r
-\r
-               public static int UsersInRoles_GetRolesForUser (DbConnection connection, string applicationName, string username, out DbDataReader reader)\r
-               {\r
-                       reader = null;\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 1;\r
-\r
-                       string userId = GetUserId (connection, appId, username);\r
-                       if (userId == null)\r
-                               return 2;\r
-\r
-                       string querySelect = "SELECT rol.RoleName FROM aspnet_Roles rol, aspnet_UsersInRoles uir " +\r
-                               "WHERE rol.RoleId = uir.RoleId AND rol.ApplicationId = ? AND uir.UserId = ? ORDER BY rol.RoleName";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "ApplicationId", appId);\r
-                       AddParameter (cmdSelect, "UserId", userId);\r
-                       reader = cmdSelect.ExecuteReader ();\r
-\r
-                       return 0;\r
-               }\r
-\r
-               public static int UsersInRoles_GetUsersInRoles (DbConnection connection, string applicationName, string rolename, out DbDataReader reader)\r
-               {\r
-                       reader = null;\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 1;\r
-\r
-                       string roleId = GetRoleId (connection, appId, rolename);\r
-                       if (roleId == null)\r
-                               return 2;\r
-\r
-                       string querySelect = "SELECT usr.UserName FROM aspnet_Users usr, aspnet_UsersInRoles uir " +\r
-                               "WHERE usr.UserId = uir.UserId AND usr.ApplicationId = ? AND uir.RoleId = ? ORDER BY usr.UserName";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "ApplicationId", appId);\r
-                       AddParameter (cmdSelect, "RoleId", roleId);\r
-                       reader = cmdSelect.ExecuteReader ();\r
-\r
-                       return 0;\r
-               }\r
-\r
-               public static int UsersInRoles_IsUserInRole (DbConnection connection, string applicationName, string username, string rolename)\r
-               {\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 1;\r
-\r
-                       string userId = GetUserId (connection, appId, username);\r
-                       if (userId == null)\r
-                               return 2;\r
-\r
-                       string roleId = GetRoleId (connection, appId, rolename);\r
-                       if (roleId == null)\r
-                               return 3;\r
-\r
-                       string querySelect = "SELECT UserId FROM aspnet_UsersInRoles WHERE UserId = ? AND RoleId = ?";\r
-                       OleDbCommand cmdSelect = new OleDbCommand (querySelect, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelect, "UserId", userId);\r
-                       AddParameter (cmdSelect, "RoleId", roleId);\r
-                       using (OleDbDataReader reader = cmdSelect.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       return 4;\r
-                       }\r
-                       return 0;\r
-               }\r
-\r
-               public static int UsersInRoles_RemoveUsersFromRoles (DbConnection connection, string applicationName, string [] userNames, string [] roleNames)\r
-               {\r
-                       string appId = DerbyApplicationsHelper.GetApplicationId (connection, applicationName);\r
-                       if (appId == null)\r
-                               return 1;\r
-\r
-                       string [] userIds = new string [userNames.Length];\r
-                       string [] roleIds = new string [roleNames.Length];\r
-\r
-                       string querySelUsers = "SELECT UserId FROM aspnet_Users WHERE ApplicationId = ? AND LoweredUserName in " + GetPrms (userNames.Length);\r
-                       OleDbCommand cmdSelUsers = new OleDbCommand (querySelUsers, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelUsers, "ApplicationId", appId);\r
-                       for (int i = 0; i < userNames.Length; i++)\r
-                               AddParameter (cmdSelUsers, "LoweredUserName", userNames [i].ToLowerInvariant ());\r
-\r
-                       using (OleDbDataReader reader = cmdSelUsers.ExecuteReader ()) {\r
-                               int i = 0;\r
-                               while (reader.Read ())\r
-                                       userIds [i++] = reader.GetString (0);\r
-\r
-                               if (userNames.Length != i)\r
-                                       return 2; // one or more users not found\r
-                       }\r
-\r
-                       string querySelRoles = "SELECT RoleId FROM aspnet_Roles WHERE ApplicationId = ? AND LoweredRoleName in " + GetPrms (roleNames.Length);\r
-                       OleDbCommand cmdSelRoles = new OleDbCommand (querySelRoles, (OleDbConnection) connection);\r
-                       AddParameter (cmdSelRoles, "ApplicationId", appId);\r
-                       for (int i = 0; i < roleNames.Length; i++)\r
-                               AddParameter (cmdSelRoles, "LoweredRoleName", roleNames [i].ToLowerInvariant ());\r
-\r
-                       using (OleDbDataReader reader = cmdSelRoles.ExecuteReader ()) {\r
-                               int i = 0;\r
-                               while (reader.Read ())\r
-                                       roleIds [i++] = reader.GetString (0);\r
-\r
-                               if (roleNames.Length != i)\r
-                                       return 3; // one or more roles not found\r
-                       }\r
-\r
-                       string querySelCount = "SELECT COUNT(*) FROM aspnet_UsersInRoles WHERE UserId in " + GetPrms (userNames.Length) + " AND RoleId in " + GetPrms (roleNames.Length);\r
-                       OleDbCommand cmdSelCount = new OleDbCommand (querySelCount, (OleDbConnection) connection);\r
-                       foreach (string userId in userIds)\r
-                               AddParameter (cmdSelCount, "UserId", userId);\r
-                       foreach (string roleId in roleIds)\r
-                               AddParameter (cmdSelCount, "RoleId", roleId);\r
-                       using (OleDbDataReader reader = cmdSelCount.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       if (userNames.Length * roleNames.Length > reader.GetInt32 (0))\r
-                                               return 4;\r
-                       }\r
-\r
-                       string queryDelete = "DELETE FROM aspnet_UsersInRoles WHERE UserId in " + GetPrms (userNames.Length) + " AND RoleId in " + GetPrms (roleNames.Length);\r
-                       OleDbCommand cmdDelete = new OleDbCommand (queryDelete, (OleDbConnection) connection);\r
-                       foreach (string userId in userIds)\r
-                               AddParameter (cmdDelete, "UserId", userId);\r
-                       foreach (string roleId in roleIds)\r
-                               AddParameter (cmdDelete, "RoleId", roleId);\r
-                       cmdDelete.ExecuteNonQuery ();\r
-\r
-                       return 0;\r
-               }\r
-\r
-               private static string GetRoleId (DbConnection connection, string applicationId, string rolename)\r
-               {\r
-                       string selectQuery = "SELECT RoleId FROM aspnet_Roles WHERE LoweredRoleName = ? AND ApplicationId = ?";\r
-\r
-                       OleDbCommand selectCmd = new OleDbCommand (selectQuery, (OleDbConnection) connection);\r
-                       AddParameter (selectCmd, "LoweredRoleName", rolename.ToLowerInvariant ());\r
-                       AddParameter (selectCmd, "ApplicationId", applicationId);\r
-                       using (OleDbDataReader reader = selectCmd.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       return reader.GetString (0);\r
-                       }\r
-\r
-                       return null;\r
-               }\r
-\r
-               private static string GetUserId (DbConnection connection, string applicationId, string username)\r
-               {\r
-                       string selectQuery = "SELECT UserId FROM aspnet_Users WHERE LoweredUserName = ? AND ApplicationId = ?";\r
-\r
-                       OleDbCommand selectCmd = new OleDbCommand (selectQuery, (OleDbConnection) connection);\r
-                       AddParameter (selectCmd, "LoweredUserName", username.ToLowerInvariant ());\r
-                       AddParameter (selectCmd, "ApplicationId", applicationId);\r
-                       using (OleDbDataReader reader = selectCmd.ExecuteReader ()) {\r
-                               if (reader.Read ())\r
-                                       return reader.GetString (0);\r
-                       }\r
-\r
-                       return null;\r
-               }\r
-\r
-               private static string GetPrms (int n)\r
-               {\r
-                       string exp = string.Empty;\r
-                       for (int i = 0; i < n; i++)\r
-                               exp += "?,";\r
-\r
-                       exp = "(" + exp.Trim (',') + ")";\r
-                       return exp;\r
-               }\r
-       }\r
-}\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/J2EEAuthenticationModule.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/J2EEAuthenticationModule.cs
deleted file mode 100644 (file)
index 0e840e6..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// Mainsoft.Web.Security.J2EEAuthenticationModule
-//
-// Authors:
-//     Eyal Alaluf (eyala@mainsoft.com)
-//
-// (C) 2006 Mainsoft Co. (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Security.Principal;
-using System.Text;
-using System.Web;
-using System.Web.Configuration;
-using System.Web.Util;
-using javax.servlet;
-using javax.servlet.http;
-
-namespace Mainsoft.Web.Security
-{
-       public sealed class J2EEAuthenticationModule : IHttpModule
-       {
-               public void Dispose ()
-               {
-               }
-
-               public void Init (HttpApplication app)
-               {
-                       app.AuthenticateRequest += new EventHandler (OnAuthenticateRequest);
-               }
-
-               void OnAuthenticateRequest (object sender, EventArgs args)
-               {
-                       HttpApplication app = (HttpApplication) sender;
-                       HttpServletRequest req = app.Context.Request.ServletWorkerRequest.ServletRequest;
-                       if (req.getRemoteUser() != null)
-                               app.Context.User = new J2EEPrincipal(req);
-               }
-       }
-
-       internal class J2EEPrincipal : IPrincipal
-       {
-               HttpServletRequest _request;
-               IIdentity _identity;
-
-               public J2EEPrincipal(HttpServletRequest req)
-               {
-                       _request = req;
-                       string authType = req.getAuthType();
-                       if (authType == null)
-                               authType = "";
-                       _identity = new GenericIdentity(req.getRemoteUser(), authType);
-               }
-
-               public bool IsInRole(string role)
-               {
-                       return _request.isUserInRole(role);
-               }
-
-               public IIdentity Identity { get { return _identity; } }
-       }
-}
-
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/ServletAuthenticationModule.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/ServletAuthenticationModule.cs
deleted file mode 100644 (file)
index 99f7755..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// System.Web.Security.ServletAuthenticationModule
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF 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.Principal;
-using System.Text;
-using System.Web;
-using System.Web.Configuration;
-using System.Web.Util;
-using javax.servlet;
-using javax.servlet.http;
-using Mainsoft.Web.Hosting;
-
-namespace Mainsoft.Web.Security
-{
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// <para>Sets the identity of the user for an ASP.NET Java EE application.</para>
-       /// </summary>
-       public sealed class SevletAuthenticationModule : IHttpModule
-       {
-               public void Dispose () {
-               }
-
-               public void Init (HttpApplication app) {
-                       app.AuthenticateRequest += new EventHandler (OnAuthenticateRequest);
-               }
-
-               void OnAuthenticateRequest (object sender, EventArgs args) {
-                       HttpApplication app = (HttpApplication) sender;
-                       BaseWorkerRequest req = J2EEUtils.GetWorkerRequest (app.Context);
-                       if (req.GetRemoteUser () != null)
-                               app.Context.User = new ServletPrincipal (req);
-               }
-       }
-
-       public sealed class ServletPrincipal : IPrincipal
-       {
-               readonly BaseWorkerRequest _request;
-               readonly IIdentity _identity;
-
-               internal ServletPrincipal (BaseWorkerRequest req) {
-                       _request = req;
-                       string authType = req.GetAuthType ();
-                       if (authType == null)
-                               authType = String.Empty;
-                       _identity = new GenericIdentity (req.GetRemoteUser (), authType);
-               }
-
-               public bool IsInRole (string role) {
-                       return _request.IsUserInRole (role);
-               }
-
-               public IIdentity Identity { get { return _identity; } }
-
-               public java.security.Principal Principal { get { return _request.GetUserPrincipal (); } }
-       }
-}
-
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/.gitattributes
deleted file mode 100644 (file)
index 8b7ecf7..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/ObjectInputStream.cs -crlf
-/ObjectOutputStream.cs -crlf
-/ServletSessionIDManager.cs -crlf
-/ServletSessionStateItemCollection.cs -crlf
-/ServletSessionStateStoreProvider.cs -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ObjectInputStream.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ObjectInputStream.cs
deleted file mode 100644 (file)
index e638100..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-//\r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov <vladimirk@mainsoft.com>\r
-//     Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using java.io;\r
-\r
-namespace Mainsoft.Web.SessionState\r
-{\r
-       /// <summary>\r
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
-       /// </summary>\r
-       public sealed partial class ServletSessionStateStoreProvider\r
-       {\r
-               sealed class ObjectInputStream : System.IO.Stream, ObjectInput\r
-               {\r
-                       readonly ObjectInput _javaObjectInput;\r
-\r
-                       public ObjectInputStream (ObjectInput stream) {\r
-                               _javaObjectInput = stream;\r
-                       }\r
-\r
-                       public override bool CanRead {\r
-                               get {\r
-                                       return true;\r
-                               }\r
-                       }\r
-\r
-                       public override bool CanWrite {\r
-                               get {\r
-                                       return false;\r
-                               }\r
-                       }\r
-\r
-                       public override bool CanSeek {\r
-                               get {\r
-                                       return true;\r
-                               }\r
-                       }\r
-\r
-                       public override long Length {\r
-                               get {\r
-                                       throw new NotSupportedException ();\r
-                               }\r
-                       }\r
-\r
-                       public override long Position {\r
-                               get {\r
-                                       throw new NotSupportedException ();\r
-                               }\r
-                               set {\r
-                                       throw new NotSupportedException ();\r
-                               }\r
-                       }\r
-\r
-                       public override void Flush () {\r
-                               throw new NotSupportedException ();\r
-                       }\r
-\r
-                       public override long Seek (long offset, System.IO.SeekOrigin origin) {\r
-                               if (origin == System.IO.SeekOrigin.Current)\r
-                                       return _javaObjectInput.skip (offset);\r
-\r
-                               throw new NotSupportedException ();\r
-                       }\r
-\r
-                       public override void SetLength (long value) {\r
-                               throw new NotSupportedException ();\r
-                       }\r
-\r
-                       public override int Read (byte [] buffer, int offset, int count) {\r
-                               int rv = _javaObjectInput.read (vmw.common.TypeUtils.ToSByteArray (buffer), offset, count);\r
-                               return rv > 0 ? rv : 0;\r
-                       }\r
-\r
-                       public override void Write (byte [] buffer, int offset, int count) {\r
-                               throw new NotSupportedException ();\r
-                       }\r
-\r
-                       public override int ReadByte () {\r
-                               return _javaObjectInput.read ();\r
-                       }\r
-\r
-                       public override void Close () {\r
-                               _javaObjectInput.close ();\r
-                       }\r
-\r
-                       #region ObjectInput Members\r
-\r
-                       public int available () {\r
-                               return _javaObjectInput.available ();\r
-                       }\r
-\r
-                       public void close () {\r
-                               _javaObjectInput.close ();\r
-                       }\r
-\r
-                       public int read (sbyte [] __p1, int __p2, int __p3) {\r
-                               return _javaObjectInput.read (__p1, __p2, __p3);\r
-                       }\r
-\r
-                       public int read (sbyte [] __p1) {\r
-                               return _javaObjectInput.read (__p1);\r
-                       }\r
-\r
-                       public int read () {\r
-                               return _javaObjectInput.read ();\r
-                       }\r
-\r
-                       public object readObject () {\r
-                               return _javaObjectInput.readObject ();\r
-                       }\r
-\r
-                       public long skip (long __p1) {\r
-                               return _javaObjectInput.skip (__p1);\r
-                       }\r
-\r
-                       #endregion\r
-\r
-                       #region DataInput Members\r
-\r
-                       public bool readBoolean () {\r
-                               return _javaObjectInput.readBoolean ();\r
-                       }\r
-\r
-                       public sbyte readByte () {\r
-                               return _javaObjectInput.readByte ();\r
-                       }\r
-\r
-                       public char readChar () {\r
-                               return _javaObjectInput.readChar ();\r
-                       }\r
-\r
-                       public double readDouble () {\r
-                               return _javaObjectInput.readDouble ();\r
-                       }\r
-\r
-                       public float readFloat () {\r
-                               return _javaObjectInput.readFloat ();\r
-                       }\r
-\r
-                       public void readFully (sbyte [] __p1, int __p2, int __p3) {\r
-                               _javaObjectInput.readFully (__p1, __p2, __p3);\r
-                       }\r
-\r
-                       public void readFully (sbyte [] __p1) {\r
-                               _javaObjectInput.readFully (__p1);\r
-                       }\r
-\r
-                       public int readInt () {\r
-                               return _javaObjectInput.readInt ();\r
-                       }\r
-\r
-                       public string readLine () {\r
-                               return _javaObjectInput.readLine ();\r
-                       }\r
-\r
-                       public long readLong () {\r
-                               return _javaObjectInput.readLong ();\r
-                       }\r
-\r
-                       public short readShort () {\r
-                               return _javaObjectInput.readShort ();\r
-                       }\r
-\r
-                       public string readUTF () {\r
-                               return _javaObjectInput.readUTF ();\r
-                       }\r
-\r
-                       public int readUnsignedByte () {\r
-                               return _javaObjectInput.readUnsignedByte ();\r
-                       }\r
-\r
-                       public int readUnsignedShort () {\r
-                               return _javaObjectInput.readUnsignedShort ();\r
-                       }\r
-\r
-                       public int skipBytes (int __p1) {\r
-                               return _javaObjectInput.skipBytes (__p1);\r
-                       }\r
-\r
-                       #endregion\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ObjectOutputStream.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ObjectOutputStream.cs
deleted file mode 100644 (file)
index b0e08ea..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-//\r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov <vladimirk@mainsoft.com>\r
-//     Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using java.io;\r
-\r
-namespace Mainsoft.Web.SessionState\r
-{\r
-       public sealed partial class ServletSessionStateStoreProvider\r
-       {\r
-               sealed class ObjectOutputStream : System.IO.Stream, ObjectOutput\r
-               {\r
-                       readonly ObjectOutput _javaObjectOutput;\r
-\r
-                       public ObjectOutputStream (ObjectOutput stream) {\r
-                               _javaObjectOutput = stream;\r
-                       }\r
-\r
-                       public override bool CanRead {\r
-                               get {\r
-                                       return false;\r
-                               }\r
-                       }\r
-\r
-                       public override bool CanSeek {\r
-                               get {\r
-                                       return false;\r
-                               }\r
-                       }\r
-\r
-                       public override bool CanWrite {\r
-                               get {\r
-                                       return true;\r
-                               }\r
-                       }\r
-\r
-                       public override void Close () {\r
-                               _javaObjectOutput.close ();\r
-                       }\r
-\r
-                       public override void Flush () {\r
-                               _javaObjectOutput.flush ();\r
-                       }\r
-\r
-                       public override long Length {\r
-                               get {\r
-                                       throw new NotSupportedException ();\r
-                               }\r
-                       }\r
-\r
-                       public override long Position {\r
-                               get {\r
-                                       throw new NotSupportedException ();\r
-                               }\r
-                               set {\r
-                                       throw new NotSupportedException ();\r
-                               }\r
-                       }\r
-\r
-                       public override long Seek (long offset, System.IO.SeekOrigin origin) {\r
-                               throw new NotSupportedException ();\r
-                       }\r
-\r
-                       public override void SetLength (long value) {\r
-                               throw new NotSupportedException ();\r
-                       }\r
-\r
-                       public override int Read (byte [] buffer, int offset, int count) {\r
-                               throw new NotSupportedException ();\r
-                       }\r
-\r
-                       public override void Write (byte [] buffer, int offset, int count) {\r
-                               _javaObjectOutput.write (vmw.common.TypeUtils.ToSByteArray (buffer), offset, count);\r
-                       }\r
-\r
-                       public override void WriteByte (byte value) {\r
-                               _javaObjectOutput.write (value);\r
-                       }\r
-\r
-                       public ObjectOutput NativeStream {\r
-                               get { return _javaObjectOutput; }\r
-                       }\r
-\r
-                       #region ObjectOutput Members\r
-\r
-                       public void close () {\r
-                               _javaObjectOutput.close ();\r
-                       }\r
-\r
-                       public void flush () {\r
-                               _javaObjectOutput.flush ();\r
-                       }\r
-\r
-                       public void write (sbyte [] __p1, int __p2, int __p3) {\r
-                               _javaObjectOutput.write (__p1, __p2, __p3);\r
-                       }\r
-\r
-                       public void write (sbyte [] __p1) {\r
-                               _javaObjectOutput.write (__p1);\r
-                       }\r
-\r
-                       public void write (int __p1) {\r
-                               _javaObjectOutput.write (__p1);\r
-                       }\r
-\r
-                       public void writeObject (object __p1) {\r
-                               _javaObjectOutput.writeObject (__p1);\r
-                       }\r
-\r
-                       #endregion\r
-\r
-                       #region DataOutput Members\r
-\r
-\r
-                       public void writeBoolean (bool __p1) {\r
-                               _javaObjectOutput.writeBoolean (__p1);\r
-                       }\r
-\r
-                       public void writeByte (int __p1) {\r
-                               _javaObjectOutput.writeByte (__p1);\r
-                       }\r
-\r
-                       public void writeBytes (string __p1) {\r
-                               _javaObjectOutput.writeBytes (__p1);\r
-                       }\r
-\r
-                       public void writeChar (int __p1) {\r
-                               _javaObjectOutput.writeChar (__p1);\r
-                       }\r
-\r
-                       public void writeChars (string __p1) {\r
-                               _javaObjectOutput.writeChars (__p1);\r
-                       }\r
-\r
-                       public void writeDouble (double __p1) {\r
-                               _javaObjectOutput.writeDouble (__p1);\r
-                       }\r
-\r
-                       public void writeFloat (float __p1) {\r
-                               _javaObjectOutput.writeFloat (__p1);\r
-                       }\r
-\r
-                       public void writeInt (int __p1) {\r
-                               _javaObjectOutput.writeInt (__p1);\r
-                       }\r
-\r
-                       public void writeLong (long __p1) {\r
-                               _javaObjectOutput.writeLong (__p1);\r
-                       }\r
-\r
-                       public void writeShort (int __p1) {\r
-                               _javaObjectOutput.writeShort (__p1);\r
-                       }\r
-\r
-                       public void writeUTF (string __p1) {\r
-                               _javaObjectOutput.writeUTF (__p1);\r
-                       }\r
-\r
-                       #endregion\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionIDManager.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionIDManager.cs
deleted file mode 100755 (executable)
index 4aaf38d..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-//\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Author: Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Web;\r
-using System.Web.SessionState;\r
-using javax.servlet.http;\r
-using Mainsoft.Web.Hosting;\r
-\r
-namespace Mainsoft.Web.SessionState\r
-{\r
-       /// <summary>\r
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
-       /// </summary>\r
-       public sealed class ServletSessionIDManager : ISessionIDManager\r
-       {\r
-               #region ISessionIDManager Members\r
-\r
-               public string CreateSessionID (HttpContext context) {\r
-                       return ServletSessionStateStoreProvider.GetSession (context, true).getId ();\r
-               }\r
-\r
-               public string GetSessionID (HttpContext context) {\r
-                       BaseWorkerRequest request = J2EEUtils.GetWorkerRequest (context);\r
-                       return request.IsRequestedSessionIdValid () ? request.GetRequestedSessionId () : null;\r
-               }\r
-\r
-               public void Initialize () {\r
-               }\r
-\r
-               public bool InitializeRequest (HttpContext context, bool suppressAutoDetectRedirect, out bool supportSessionIDReissue) {\r
-                       supportSessionIDReissue = true;\r
-                       return false;\r
-               }\r
-\r
-               public void RemoveSessionID (HttpContext context) {\r
-                       ServletSessionStateStoreProvider.GetSession (context, false).invalidate ();\r
-               }\r
-\r
-               public void SaveSessionID (HttpContext context, string id, out bool redirected, out bool cookieAdded) {\r
-                       redirected = false;\r
-                       cookieAdded = false;\r
-               }\r
-\r
-               public bool Validate (string id) {\r
-                       return true;\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateItemCollection.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateItemCollection.cs
deleted file mode 100755 (executable)
index eeb1a71..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-//\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Author: Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Web.SessionState;\r
-using System.Web;\r
-using System.Threading;\r
-\r
-using javax.servlet;\r
-using javax.servlet.http;\r
-using System.Diagnostics;\r
-using Mainsoft.Web.Hosting;\r
-\r
-namespace Mainsoft.Web.SessionState\r
-{\r
-       /// <summary>\r
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
-       /// </summary>\r
-       public sealed partial class ServletSessionStateStoreProvider\r
-       {\r
-               sealed class ServletSessionStateItemCollection : ISessionStateItemCollection, java.io.Externalizable\r
-               {\r
-                       SessionStateItemCollection _items;\r
-                       HttpStaticObjectsCollection _staticObjects;\r
-                       bool _needSessionPersistence;\r
-\r
-                       public ServletSessionStateItemCollection () {} // For Java deserialization\r
-\r
-                       public ServletSessionStateItemCollection (HttpContext context)\r
-                               : this () {\r
-\r
-                               _items = new SessionStateItemCollection ();\r
-                               _staticObjects = new HttpStaticObjectsCollection ();\r
-\r
-                               if (context != null) {\r
-                                       ServletContext servletContext = J2EEUtils.GetWorkerRequest (context).GetContext ();\r
-                                       string sessionPersistance = servletContext.getInitParameter (J2EEConsts.Enable_Session_Persistency);\r
-                                       if (sessionPersistance != null) {\r
-                                               try {\r
-                                                       _needSessionPersistence = Boolean.Parse (sessionPersistance);\r
-                                               }\r
-                                               catch (Exception) {\r
-                                                       _needSessionPersistence = false;\r
-                                                       Debug.WriteLine ("EnableSessionPersistency init param's value is invalid. the value is " + sessionPersistance);\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-                       public HttpStaticObjectsCollection StaticObjects {\r
-                               get { return _staticObjects; }\r
-                       }\r
-                       #region ISessionStateItemCollection Members\r
-\r
-                       public void Clear () {\r
-                               _items.Clear ();\r
-                       }\r
-\r
-                       public bool Dirty {\r
-                               get {\r
-                                       return _items.Dirty;\r
-                               }\r
-                               set {\r
-                                       _items.Dirty = value;\r
-                               }\r
-                       }\r
-\r
-                       public System.Collections.Specialized.NameObjectCollectionBase.KeysCollection Keys {\r
-                               get { return _items.Keys; }\r
-                       }\r
-\r
-                       public void Remove (string name) {\r
-                               _items.Remove (name);\r
-                       }\r
-\r
-                       public void RemoveAt (int index) {\r
-                               _items.RemoveAt (index);\r
-                       }\r
-\r
-                       public object this [int index] {\r
-                               get {\r
-                                       return _items [index];\r
-                               }\r
-                               set {\r
-                                       _items [index] = value;\r
-                               }\r
-                       }\r
-\r
-                       public object this [string name] {\r
-                               get {\r
-                                       return _items [name];\r
-                               }\r
-                               set {\r
-                                       _items [name] = value;\r
-                               }\r
-                       }\r
-\r
-                       #endregion\r
-\r
-                       #region ICollection Members\r
-\r
-                       public void CopyTo (Array array, int index) {\r
-                               ((ICollection) _items).CopyTo (array, index);\r
-                       }\r
-\r
-                       public int Count {\r
-                               get { return ((ICollection) _items).Count; }\r
-                       }\r
-\r
-                       public bool IsSynchronized {\r
-                               get { return ((ICollection) _items).IsSynchronized; }\r
-                       }\r
-\r
-                       public object SyncRoot {\r
-                               get { return ((ICollection) _items).SyncRoot; }\r
-                       }\r
-\r
-                       #endregion\r
-\r
-                       #region IEnumerable Members\r
-\r
-                       public System.Collections.IEnumerator GetEnumerator () {\r
-                               return ((IEnumerable) _items).GetEnumerator ();\r
-                       }\r
-\r
-                       #endregion\r
-\r
-                       #region Externalizable Members\r
-\r
-                       public void readExternal (java.io.ObjectInput input) {\r
-                               lock (this) {\r
-                                       _needSessionPersistence = input.readBoolean ();\r
-                                       if (!_needSessionPersistence) { //nothing has been written \r
-                                               if (_items == null)\r
-                                                       _items = new SessionStateItemCollection ();\r
-                                               if (_staticObjects == null)\r
-                                                       _staticObjects = new HttpStaticObjectsCollection ();\r
-                                               return;\r
-                                       }\r
-\r
-                                       ObjectInputStream ms = new ObjectInputStream (input);\r
-                                       System.IO.BinaryReader br = new System.IO.BinaryReader (ms);\r
-                                       _items = SessionStateItemCollection.Deserialize (br);\r
-                                       _staticObjects = HttpStaticObjectsCollection.Deserialize (br);\r
-                               }\r
-                       }\r
-\r
-                       public void writeExternal (java.io.ObjectOutput output) {\r
-                               lock (this) {\r
-                                       output.writeBoolean (_needSessionPersistence);\r
-                                       if (!_needSessionPersistence)\r
-                                               //indicates that there is nothing to serialize for this object\r
-                                               return;\r
-\r
-                                       ObjectOutputStream ms = new ObjectOutputStream (output);\r
-                                       System.IO.BinaryWriter bw = new System.IO.BinaryWriter (ms);\r
-                                       _items.Serialize (bw);\r
-                                       _staticObjects.Serialize (bw);\r
-                               }\r
-                       }\r
-\r
-                       #endregion\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateStoreProvider.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/ServletSessionStateStoreProvider.cs
deleted file mode 100755 (executable)
index a898317..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-//\r
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Author: Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Web.SessionState;\r
-using System.Web;\r
-using System.Web.Hosting;\r
-using javax.servlet;\r
-using javax.servlet.http;\r
-using Mainsoft.Web.Hosting;\r
-\r
-namespace Mainsoft.Web.SessionState\r
-{\r
-       /// <summary>\r
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
-       /// <para>Manages session state information using Java EE session API.</para>\r
-       /// </summary>\r
-       public sealed partial class ServletSessionStateStoreProvider : SessionStateStoreProviderBase\r
-       {\r
-               const int MAX_MINUTES_TIMEOUT = int.MaxValue / 60;\r
-               #region Public Interface\r
-\r
-               public override SessionStateStoreData CreateNewStoreData (HttpContext context, int timeout) {\r
-\r
-                       // we ignore this timeout and use web.xml settings.\r
-                       //must set now as this can be a last chance for ro item\r
-                       //GetSession (context, false).setMaxInactiveInterval (timeout * 60);\r
-                       int javaTimeoutInSeconds = GetSession (context, false).getMaxInactiveInterval ();                       \r
-                       timeout = GetIntervalInMinutes (javaTimeoutInSeconds);\r
-                       ServletSessionStateItemCollection sessionState = new ServletSessionStateItemCollection (context);\r
-                       return new SessionStateStoreData (\r
-                               sessionState,\r
-                               sessionState.StaticObjects,\r
-                               timeout);\r
-               }\r
-\r
-               public override void CreateUninitializedItem (HttpContext context, string id, int timeout) {\r
-               }\r
-\r
-               public override void Dispose () {\r
-                       \r
-               }\r
-\r
-               public override void EndRequest (HttpContext context) {\r
-               }\r
-\r
-               public override SessionStateStoreData GetItem (HttpContext context, string id, out bool locked, out TimeSpan lockAge, out object lockId, out SessionStateActions actions) {\r
-                       locked = false;\r
-                       lockAge = TimeSpan.Zero;\r
-                       lockId = null;\r
-                       actions = SessionStateActions.None;\r
-                       if (id == null)\r
-                               return null;\r
-                       HttpSession session = GetSession (context, false, false);\r
-                       if (session == null)\r
-                               return null;\r
-                       ServletSessionStateItemCollection sessionState = session.getAttribute (J2EEConsts.SESSION_STATE) as ServletSessionStateItemCollection;\r
-                       if (sessionState == null) //was not set\r
-                               sessionState = new ServletSessionStateItemCollection (context);\r
-                       return new SessionStateStoreData (\r
-                               sessionState,\r
-                               sessionState.StaticObjects,\r
-                               GetIntervalInMinutes(session.getMaxInactiveInterval ()));\r
-               }\r
-\r
-               public override SessionStateStoreData GetItemExclusive (HttpContext context, string id, out bool locked, out TimeSpan lockAge, out object lockId, out SessionStateActions actions) {\r
-                       return GetItem (context, id, out locked, out lockAge, out lockId, out actions);\r
-               }\r
-\r
-               public override void InitializeRequest (HttpContext context) {\r
-               }\r
-\r
-               public override void ReleaseItemExclusive (HttpContext context, string id, object lockId) {\r
-               }\r
-\r
-               public override void RemoveItem (HttpContext context, string id, object lockId, SessionStateStoreData item) {\r
-                       GetSession (context, false).invalidate ();\r
-               }\r
-\r
-               public override void ResetItemTimeout (HttpContext context, string id) {\r
-                       if (context == null)\r
-                               throw new ArgumentNullException ("context");\r
-                       HttpSession session = GetSession (context, false);\r
-                       int current = session.getMaxInactiveInterval ();\r
-                       int requested = context.Session.Timeout * 60;\r
-                       if (current != requested)\r
-                               session.setMaxInactiveInterval (requested);\r
-               }\r
-\r
-               public override void SetAndReleaseItemExclusive (HttpContext context, string id, SessionStateStoreData item, object lockId, bool newItem) {\r
-                       if (id == null)\r
-                               return;\r
-\r
-                       if (item.Items.Dirty)\r
-                               GetSession(context, false).setAttribute (J2EEConsts.SESSION_STATE, item.Items);\r
-\r
-                       ReleaseItemExclusive (context, id, lockId);\r
-               }\r
-\r
-               public override bool SetItemExpireCallback (SessionStateItemExpireCallback expireCallback) {\r
-                       return true; //we call session.invalidate so our session listener will call Session_OnEnd\r
-               }\r
-\r
-               #endregion\r
-\r
-               #region helpers\r
-\r
-               internal static HttpSessionStateContainer CreateContainer (HttpSession session) {\r
-                       ServletSessionStateItemCollection sessionState = session.getAttribute (J2EEConsts.SESSION_STATE) as ServletSessionStateItemCollection;\r
-                       if (sessionState == null) //was not set\r
-                               sessionState = new ServletSessionStateItemCollection (null);\r
-\r
-                       return new HttpSessionStateContainer (session.getId (),\r
-                               sessionState, sessionState.StaticObjects,\r
-                               GetIntervalInMinutes (session.getMaxInactiveInterval ()),\r
-                               session.isNew (),\r
-                               HttpCookieMode.AutoDetect, SessionStateMode.Custom,\r
-                               true);\r
-               }\r
-\r
-               internal static HttpSession GetSession (HttpContext context, bool create) {\r
-                       return GetSession (context, create, true);\r
-               }\r
-\r
-               internal static HttpSession GetSession (HttpContext context, bool create, bool throwOnError) {\r
-                       HttpSession session = J2EEUtils.GetWorkerRequest (context).GetSession (create);\r
-                       if (session == null && throwOnError)\r
-                               throw new HttpException ("Session is not established");\r
-\r
-                       return session;\r
-               }\r
-\r
-               static int GetIntervalInMinutes (int seconds)\r
-               {\r
-                       if (seconds == -1)\r
-                               return MAX_MINUTES_TIMEOUT;\r
-                       return (int) Math.Ceiling ((double) seconds / 60);              \r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/SessionListener.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.SessionState/SessionListener.cs
deleted file mode 100644 (file)
index 89a540e..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Web.SessionState;
-using System.Reflection;
-using javax.servlet.http;
-using Mainsoft.Web.Hosting;
-using System.Diagnostics;
-
-namespace Mainsoft.Web.SessionState
-{
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// </summary>
-       public class SessionListener : javax.servlet.http.HttpSessionListener
-       {
-
-               public void sessionCreated (HttpSessionEvent se) {
-               }
-
-               public void sessionDestroyed (HttpSessionEvent se) {
-                       bool setDomain = vmw.@internal.EnvironmentUtils.getAppDomain () == null;
-                       if (setDomain) {
-                               AppDomain servletDomain = (AppDomain) se.getSession ().getServletContext ().getAttribute (J2EEConsts.APP_DOMAIN);
-                               if (servletDomain == null)
-                                       return;
-                               vmw.@internal.EnvironmentUtils.setAppDomain (servletDomain);
-                       }
-                       try {
-                               HttpSessionStateContainer container =
-                                       ServletSessionStateStoreProvider.CreateContainer (se.getSession ());
-
-                               SessionStateUtility.RaiseSessionEnd (container, this, EventArgs.Empty);
-                       }
-                       catch (Exception e) {
-                               Debug.WriteLine (e.Message);
-                               Debug.WriteLine (e.StackTrace);
-                       }
-                       finally {
-                               if (setDomain) {
-                                       vmw.@internal.EnvironmentUtils.clearAppDomain ();
-                               }
-                       }
-               }
-       }
-}
-
-namespace System.Web.GH
-{
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// </summary>
-       public class SessionListener : Mainsoft.Web.SessionState.SessionListener
-       {
-       }
-}
-
-namespace System.Web.J2EE
-{
-       /// <summary>
-       /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>
-       /// </summary>
-       public class SessionListener : Mainsoft.Web.SessionState.SessionListener
-       {
-       }
-}
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web/.gitattributes b/mcs/class/Mainsoft.Web/Mainsoft.Web/.gitattributes
deleted file mode 100644 (file)
index 6adf0e5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/BaseHttpContext.cs -crlf
-/J2EEConsts.cs -crlf
-/J2EEUtils.cs -crlf
-/ServletHttpContext.cs -crlf
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web/BaseHttpContext.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web/BaseHttpContext.cs
deleted file mode 100644 (file)
index 72285bd..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-//\r
-// (C) 2007 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Author: Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections.Generic;\r
-\r
-using System.Text;\r
-using System.Configuration;\r
-using System.Web;\r
-using Mainsoft.Web.Hosting;\r
-using javax.faces.lifecycle;\r
-\r
-namespace Mainsoft.Web\r
-{\r
-       /// <summary>\r
-       /// BaseHttpContext contains all of the per-request state information related to the processing of a single request, \r
-       /// and the rendering of the corresponding response.\r
-       /// </summary>\r
-       public abstract class BaseHttpContext\r
-       {\r
-               protected readonly HttpContext _context;\r
-               static readonly object _contextKey = new object ();\r
-\r
-               protected BaseHttpContext (HttpContext context) {\r
-                       _context = context;\r
-                       context.Items [_contextKey] = this;\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets the Mainsoft.Web.BaseHttpContext object for the current request.\r
-               /// </summary>\r
-               /// <param name="context"></param>\r
-               /// <returns></returns>\r
-               public static BaseHttpContext GetCurrent(HttpContext context) {\r
-                       if (context == null)\r
-                               throw new ArgumentNullException ("context");\r
-\r
-                       BaseHttpContext baseContext = (BaseHttpContext) context.Items [_contextKey];\r
-                       return baseContext ?? GetWorker (context).CreateContext (context);\r
-               }\r
-\r
-               /// <summary>\r
-               /// Returns the javax.faces.lifecycle.Lifecycle instance.\r
-               /// </summary>\r
-               public Lifecycle Lifecycle {\r
-                       get { return BaseHttpServlet.Lifecycle; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Returns the Mainsoft.Web.Hosting.BaseWorkerRequest object for the current request.\r
-               /// </summary>\r
-               protected BaseWorkerRequest Worker {\r
-                       get { return GetWorker (_context); }\r
-               }\r
-\r
-               static BaseWorkerRequest GetWorker (HttpContext context) {\r
-                       return (BaseWorkerRequest) ((IServiceProvider) context).GetService (typeof (HttpWorkerRequest));\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEConsts.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEConsts.cs
deleted file mode 100755 (executable)
index e30122d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//\r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-\r
-namespace Mainsoft.Web.Hosting\r
-{\r
-       public static class J2EEConsts\r
-       {\r
-               public const string SESSION_STATE = "GH_SESSION_STATE";\r
-\r
-               public const string CLASS_LOADER = "GH_ContextClassLoader";\r
-               public const string SERVLET_CONFIG = "GH_ServletConfig";\r
-               public const string RESOURCE_LOADER = "GH_ResourceLoader";\r
-\r
-               public const string APP_DOMAIN = "AppDomain";\r
-\r
-               public const string Enable_Session_Persistency = "EnableSessionPersistency";\r
-\r
-               //Used to save assemblies.xml file per application.\r
-               public const string ASSEMBLIES_FILE = "AssembliesXml";\r
-\r
-               //Used to save FileList.xml file per application.\r
-               public const string FILE_LIST_FILE = "FileListXml";\r
-\r
-               public const string MAP_PATH_CACHE = "MapPathCache";\r
-\r
-               //Used to save servlet request of current Servlet.\r
-               public const string SERVLET_REQUEST = "GH_ServletRequest";\r
-               //Used to save servlet response of current Servlet.\r
-               public const string SERVLET_RESPONSE = "GH_ServletResponse";\r
-               //Used to save current Servlet.\r
-               public const string CURRENT_SERVLET = "GH_Servlet";\r
-\r
-               public const string DESERIALIZER_CONST = "GH_DeserializeWorkAround";\r
-               //Used to control file system access in web app context\r
-               public const string FILESYSTEM_ACCESS = "WebFileSystemAccess";\r
-               public const string ACCESS_FULL = "Full";\r
-               public const string ACCESS_VIRTUAL = "Virtual";\r
-\r
-               public const string ACTION_URL_PREFIX = "ActionURL:";\r
-               public const string RENDER_URL_PREFIX = "RenderURL:";\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEUtils.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web/J2EEUtils.cs
deleted file mode 100755 (executable)
index 7895ea4..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-//\r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Web.Util;\r
-using System.IO;\r
-using vmw.@internal.io;\r
-using vmw.common;\r
-\r
-using javax.servlet;\r
-using System.Web;\r
-using Mainsoft.Web.Hosting;\r
-using System.Diagnostics;\r
-\r
-namespace Mainsoft.Web\r
-{\r
-       internal static class J2EEUtils\r
-       {\r
-               //public static string GetInitParameterByHierarchy(ServletConfig config, string name)\r
-               //{\r
-               //    if (config == null)\r
-               //        throw new ArgumentNullException("config");\r
-\r
-               //    string value = config.getInitParameter(name);\r
-               //    if (value != null)\r
-               //        return value;\r
-\r
-               //    return config.getServletContext().getInitParameter(name);\r
-               //}\r
-\r
-               public static string GetApplicationRealPath (ServletContext context) {\r
-                       return GetApplicationRealPath (context, "/");\r
-               }\r
-\r
-               public static string GetApplicationRealPath (ServletContext context, string appVirtualPath)\r
-               {\r
-                       string realFs = context.getInitParameter (J2EEConsts.FILESYSTEM_ACCESS);\r
-                       if (realFs == null || realFs == J2EEConsts.ACCESS_FULL) {\r
-                               try {\r
-                                       string realPath = context.getRealPath (appVirtualPath);\r
-                                       if (!String.IsNullOrEmpty (realPath)) {\r
-                                               if (!String.IsNullOrEmpty (appVirtualPath) &&\r
-                                                       appVirtualPath [appVirtualPath.Length - 1] == '/')\r
-                                                       if (realPath [realPath.Length - 1] != Path.DirectorySeparatorChar)\r
-                                                               realPath += Path.DirectorySeparatorChar;\r
-\r
-                                               return realPath;\r
-                                       }\r
-                               }\r
-                               catch (Exception e) {\r
-                                       Trace.WriteLine (e.ToString());\r
-                               }\r
-                       }\r
-                       return IAppDomainConfig.WAR_ROOT_SYMBOL + appVirtualPath;\r
-               }\r
-\r
-               public static string GetApplicationPhysicalPath (ServletContext context) {\r
-                       string path = String.Empty;\r
-\r
-                       string appDir = context.getInitParameter(IAppDomainConfig.APP_DIR_NAME);\r
-                       if (appDir != null) {\r
-                               try {\r
-                                       if (Directory.Exists(appDir))\r
-                                               path = appDir;\r
-                               }\r
-                               catch (Exception e) {\r
-                                       Trace.WriteLine (e.Message + appDir + "is invalid or unaccessible." +\r
-                                               " If " + appDir + " really exists, check your security permissions");\r
-                               }\r
-                       }\r
-                       if (path.Length == 0)\r
-                               path = GetApplicationRealPath (context);\r
-\r
-                       return path;\r
-               }\r
-\r
-               static internal BaseWorkerRequest GetWorkerRequest (HttpContext context) {\r
-                       IServiceProvider sp = (IServiceProvider) context;\r
-                       return (BaseWorkerRequest) sp.GetService (typeof (HttpWorkerRequest));\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web/ServletHttpContext.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web/ServletHttpContext.cs
deleted file mode 100644 (file)
index c084e99..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-//\r
-// (C) 2007 Mainsoft Corporation (http://www.mainsoft.com)\r
-// Author: Konstantin Triger <kostat@mainsoft.com>\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-//\r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-//\r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Web;\r
-using Mainsoft.Web.Hosting;\r
-using javax.servlet;\r
-using javax.servlet.http;\r
-\r
-namespace Mainsoft.Web\r
-{\r
-       /// <summary>\r
-       /// ServletHttpContext contains all of the per-request state information related to the processing of a single request, \r
-       /// and the rendering of the corresponding response.\r
-       /// </summary>\r
-       public sealed class ServletHttpContext : BaseHttpContext\r
-       {\r
-               internal ServletHttpContext (HttpContext context)\r
-                       : base (context) {\r
-               }\r
-\r
-               /// <summary>\r
-               /// Gets the Mainsoft.Web.ServletHttpContext object for the current sevlet request.\r
-               /// </summary>\r
-               /// <param name="context"></param>\r
-               /// <returns></returns>\r
-               public static new ServletHttpContext GetCurrent (HttpContext context) {\r
-                       return BaseHttpContext.GetCurrent (context) as ServletHttpContext;\r
-               }\r
-\r
-               private new ServletWorkerRequest Worker {\r
-                       get { return (ServletWorkerRequest) base.Worker; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Returns the current javax.servlet.http.HttpServlet object.\r
-               /// </summary>\r
-               public HttpServlet Servlet {\r
-                       get { return Worker.Servlet; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Returns the current javax.servlet.http.HttpServletRequest object.\r
-               /// </summary>\r
-               public HttpServletRequest ServletRequest {\r
-                       get { return Worker.ServletRequest; }\r
-               }\r
-\r
-\r
-               /// <summary>\r
-               /// Returns the current javax.servlet.http.HttpServletResponse object.\r
-               /// </summary>\r
-               public HttpServletResponse ServletResponse {\r
-                       get { return Worker.ServletResponse; }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Returns the javax.servlet.ServletConfig object for the current sevlet.\r
-               /// </summary>\r
-               public ServletConfig ServletConfig {\r
-                       get { return Servlet.getServletConfig (); }\r
-               }\r
-\r
-               /// <summary>\r
-               /// Returns the javax.servlet.ServletContext object for the current application.\r
-               /// </summary>\r
-               public ServletContext ServletContext {\r
-                       get { return Servlet.getServletContext (); }\r
-               }\r
-\r
-\r
-               /// <summary>\r
-               /// Returns the current servlet name.\r
-               /// </summary>\r
-               public string ServletName {\r
-                       get {\r
-                               return Servlet.getServletName ();\r
-                       }\r
-               }\r
-       }\r
-}\r
diff --git a/mcs/class/Mainsoft.Web/Properties/.gitattributes b/mcs/class/Mainsoft.Web/Properties/.gitattributes
deleted file mode 100644 (file)
index f7d8287..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/AssemblyInfo.cs -crlf
diff --git a/mcs/class/Mainsoft.Web/Properties/AssemblyInfo.cs b/mcs/class/Mainsoft.Web/Properties/AssemblyInfo.cs
deleted file mode 100644 (file)
index 7480e50..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-using System.Runtime.InteropServices;\r
-\r
-// General Information about an assembly is controlled through the following \r
-// set of attributes. Change these attribute values to modify the information\r
-// associated with an assembly.\r
-[assembly: AssemblyTitle ("DerbyProvider")]\r
-[assembly: AssemblyDescription ("")]\r
-[assembly: AssemblyConfiguration ("")]\r
-[assembly: AssemblyCompany ("")]\r
-[assembly: AssemblyProduct ("DerbyProvider")]\r
-[assembly: AssemblyCopyright ("Copyright Â© Mainsoft 2006")]\r
-[assembly: AssemblyTrademark ("")]\r
-[assembly: AssemblyCulture ("")]\r
-\r
-// Setting ComVisible to false makes the types in this assembly not visible \r
-// to COM components.  If you need to access a type in this assembly from \r
-// COM, set the ComVisible attribute to true on that type.\r
-[assembly: ComVisible (false)]\r
-\r
-// The following GUID is for the ID of the typelib if this project is exposed to COM\r
-[assembly: Guid ("0e5958a7-422c-47c2-b0fd-698a50cf1e1f")]\r
-\r
-// Version information for an assembly consists of the following four values:\r
-//\r
-//      Major Version\r
-//      Minor Version \r
-//      Build Number\r
-//      Revision\r
-//\r
-[assembly: AssemblyVersion ("1.0.0.0")]\r
-[assembly: AssemblyFileVersion ("1.0.0.0")]\r
diff --git a/mcs/class/Mainsoft.Web/Tests/Mainsoft.Web.Security/.gitattributes b/mcs/class/Mainsoft.Web/Tests/Mainsoft.Web.Security/.gitattributes
deleted file mode 100644 (file)
index 10219de..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/MembershipTests.cs -crlf
diff --git a/mcs/class/Mainsoft.Web/Tests/Mainsoft.Web.Security/MembershipTests.cs b/mcs/class/Mainsoft.Web/Tests/Mainsoft.Web.Security/MembershipTests.cs
deleted file mode 100644 (file)
index b86fd8c..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-//\r
-// Mainsoft.Web.Security.Tests.DerbyMembershipProviderTests\r
-//\r
-// Authors:\r
-//     Vladimir Krasnov (vladimirk@mainsoft.com)\r
-//\r
-// (C) 2006 Mainsoft\r
-//\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.IO;\r
-using System.Web;\r
-using System.Web.UI;\r
-using System.Web.UI.WebControls;\r
-using System.Web.Configuration;\r
-using System.Web.Security;\r
-using System.Data;\r
-using System.Data.OleDb;\r
-using System.Data.Common;\r
-using System.Collections.Generic;\r
-using System.Collections.Specialized;\r
-using System.Text;\r
-using Mainsoft.Web.Security;\r
-using NUnit.Framework;\r
\r
-\r
-namespace Mainsoft.Web.Security.Tests\r
-{\r
-       [TestFixture] \r
-       public class DerbyMembershipProviderTests\r
-       {\r
-               public void Init ()\r
-               {\r
-                       InitDB ();\r
-               }\r
-               public void InitDB ()\r
-               {\r
-                       if (Directory.Exists ("AspDB"))\r
-                               Directory.Delete ("AspDB", true);\r
-               }\r
-               public void Finish ()\r
-               {\r
-                       ReleaseDB ();\r
-               }\r
-\r
-               public void ReleaseDB ()\r
-               {\r
-               }\r
-               private MembershipProvider CreateMembershipProvider ()\r
-               {\r
-                       NameValueCollection nvc = new NameValueCollection ();\r
-                       nvc.Add ("applicationName", "testapp");\r
-                       nvc.Add ("connectionStringName", "derby");\r
-                       nvc.Add ("requiresUniqueEmail", "false");\r
-                       nvc.Add ("enablePasswordRetrieval", "true");\r
-                       nvc.Add ("passwordFormat", "Clear");\r
-\r
-                       WebConfigurationManager.ConnectionStrings.Add (new System.Configuration.ConnectionStringSettings ("derby", "JdbcDriverClassName=org.apache.derby.jdbc.EmbeddedDriver;JdbcURL=jdbc:derby:AspDB;create=true", "System.Data.OleDb"));\r
-                       DerbyMembershipProvider p = new DerbyMembershipProvider ();\r
-                       p.Initialize ("DerbyMembershipProvider", nvc);\r
-\r
-                       return p;\r
-               }\r
-\r
-               [Test] \r
-               public void CreateUserTest ()\r
-               {\r
-                       MembershipProvider p = CreateMembershipProvider ();\r
-                       MembershipCreateStatus st;\r
-                       MembershipUser u = p.CreateUser("username", "123123!", "username@email.com", "q", "a", true, null, out st);\r
-                       Assert.IsNotNull (u);\r
-                       Assert.AreEqual ("username", u.UserName);\r
-               }\r
-\r
-               [Test] \r
-               public void ChangePasswordTest ()\r
-               {\r
-                       MembershipProvider p = CreateMembershipProvider ();\r
-                       MembershipCreateStatus st;\r
-                       MembershipUser u = p.CreateUser("userpwd", "123123!", "username2@email.com", "q", "a", true, null, out st);\r
-                       bool b = p.ChangePassword ("userpwd", "123123!", "123123!123");\r
-                       Assert.IsTrue (b);\r
-\r
-                       b = p.ChangePassword ("userpwd", "123123!", "123123!123");\r
-                       Assert.IsFalse (b);\r
-               }\r
-\r
-               [Test] \r
-               public void ChangePasswordQuestionAndAnswerTest ()\r
-               {\r
-                       MembershipProvider p = CreateMembershipProvider ();\r
-                       MembershipCreateStatus st;\r
-                       MembershipUser u = p.CreateUser("userpwd2", "123123!", "username3@email.com", "q", "a", true, null, out st);\r
-\r
-                       bool b = p.ChangePasswordQuestionAndAnswer ("userpwd2", "123123!", "q2", "a2");\r
-                       Assert.IsTrue (b);\r
-                       b = p.ChangePasswordQuestionAndAnswer ("userpwd2", "123123!123", "q2", "a2");\r
-                       Assert.IsFalse (b);\r
-               }\r
-\r
-               [Test] \r
-               public void DeleteUserTest ()\r
-               {\r
-                       MembershipProvider p = CreateMembershipProvider ();\r
-                       MembershipCreateStatus st;\r
-                       p.CreateUser ("user3", "123123!", "username4@email.com", "q", "a", true, null, out st);\r
-\r
-                       bool b = p.DeleteUser ("user3", true);\r
-                       Assert.IsTrue (b);\r
-\r
-                       MembershipUser u = p.GetUser ("user2", false);\r
-                       Assert.IsNotNull (u);\r
-               }\r
-\r
-               [Test] \r
-               public void GetUserNameByEmailTest ()\r
-               {\r
-                       MembershipProvider p = CreateMembershipProvider ();\r
-                       string u = p.GetUserNameByEmail ("username@email.com");\r
-                       Assert.AreEqual ("username", u);\r
-               }\r
-\r
-               [Test] \r
-               public void ValidateUserTest ()\r
-               {\r
-                       MembershipProvider p = CreateMembershipProvider ();\r
-                       bool b = p.ValidateUser ("username", "123");\r
-                       Assert.IsFalse (b);\r
-                       b = p.ValidateUser ("username", "123");\r
-                       Assert.IsFalse (b);\r
-                       b = p.ValidateUser ("username", "123");\r
-                       Assert.IsFalse (b);\r
-                       b = p.ValidateUser ("username", "123");\r
-                       Assert.IsFalse (b);\r
-                       b = p.ValidateUser ("username", "123");\r
-                       Assert.IsFalse (b);\r
-                       b = p.ValidateUser ("username", "123");\r
-                       Assert.IsFalse (b);\r
-                       b = p.ValidateUser ("username", "123");\r
-                       Assert.IsFalse (b);\r
-                       b = p.ValidateUser ("username", "123");\r
-                       Assert.IsFalse (b);\r
-                       b = p.UnlockUser ("username");\r
-                       Assert.IsFalse (b);\r
-               }\r
-\r
-               [Test] \r
-               public void UpdateUserTest ()\r
-               {\r
-                       MembershipProvider p = CreateMembershipProvider ();\r
-                       MembershipCreateStatus st;\r
-                       MembershipUser u = p.CreateUser ("user5", "123123!", "user5@email.com", "q", "a", true, null, out st);\r
-                       \r
-                       u.Comment = "comment2";\r
-                       u.Email = "email2";\r
-                       u.IsApproved = false;\r
-               \r
-                       p.UpdateUser (u);\r
-                       MembershipUser u2 = p.GetUser (u.ProviderUserKey, false);\r
-\r
-                       Assert.AreEqual (u.Comment, u2.Comment);\r
-                       Assert.AreEqual (u.Email, u2.Email);\r
-                       Assert.AreEqual (u.IsApproved, u2.IsApproved);\r
-               }\r
-\r
-               [Test] \r
-               public void GetPasswordTest ()\r
-               {\r
-                       MembershipProvider p = CreateMembershipProvider ();\r
-                       MembershipCreateStatus st;\r
-                       p.CreateUser ("user7", "123123!", "user5@email.com", "q", "a", true, null, out st);\r
-                       string pass = p.GetPassword ("user7", "a");\r
-                       Assert.AreEqual ("123123!", pass);\r
-               }\r
-\r
-               [Test] \r
-               public void FindUsersByName ()\r
-               {\r
-                       MembershipProvider p = CreateMembershipProvider ();\r
-                       MembershipCreateStatus st;\r
-                       p.CreateUser ("user_a", "123123!", "user_a@email.com", "q", "a", true, null, out st);\r
-                       p.CreateUser ("user_b", "123123!", "user_b@email.com", "q", "a", true, null, out st);\r
-                       p.CreateUser ("user_c", "123123!", "user_c@email.com", "q", "a", true, null, out st);\r
-                       p.CreateUser ("user_d", "123123!", "user_d@email.com", "q", "a", true, null, out st);\r
-                       p.CreateUser ("user_e", "123123!", "user_e@email.com", "q", "a", true, null, out st);\r
-                       int tr = 0;\r
-                       MembershipUserCollection u = p.FindUsersByName ("%user_%", 0, 10, out tr);\r
-                       Assert.AreEqual (5, tr);\r
-                       Assert.AreEqual (5, u.Count);\r
-               }\r
-\r
-               [Test] \r
-               public void FindUsersByEmail ()\r
-               {\r
-                       MembershipProvider p = CreateMembershipProvider ();\r
-                       MembershipCreateStatus st;\r
-                       p.CreateUser ("user_7a", "123123!", "user_7a@email.com", "q", "a", true, null, out st);\r
-                       p.CreateUser ("user_7b", "123123!", "user_7b@email.com", "q", "a", true, null, out st);\r
-                       p.CreateUser ("user_7c", "123123!", "user_7c@email.com", "q", "a", true, null, out st);\r
-                       p.CreateUser ("user_7d", "123123!", "user_7d@email.com", "q", "a", true, null, out st);\r
-                       p.CreateUser ("user_7e", "123123!", "user_7e@email.com", "q", "a", true, null, out st);\r
-                       int tr = 0;\r
-                       MembershipUserCollection u = p.FindUsersByEmail ("%user_7%", 0, 10, out tr);\r
-                       Assert.AreEqual (5, tr);\r
-                       Assert.AreEqual (5, u.Count);\r
-               }\r
-       }\r
-}\r
-\r
diff --git a/mcs/class/Mainsoft.Web/Tests/Tests.csproj b/mcs/class/Mainsoft.Web/Tests/Tests.csproj
deleted file mode 100644 (file)
index 6bed1c9..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <PropertyGroup>\r
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
-    <ProductVersion>8.0.50727</ProductVersion>\r
-    <SchemaVersion>2.0</SchemaVersion>\r
-    <ProjectGuid>{7626DB27-F1CD-4787-8520-95F330A39FDC}</ProjectGuid>\r
-    <OutputType>Library</OutputType>\r
-    <AppDesignerFolder>Properties</AppDesignerFolder>\r
-    <AssemblyName>Tests</AssemblyName>\r
-    <JDKName>1.5.0_05</JDKName>\r
-    <GHProjectType>1</GHProjectType>\r
-    <Version>2.0</Version>\r
-    <RootNamespace>Tests</RootNamespace>\r
-    <jarserver>iap2</jarserver>\r
-    <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
-    <DebugSymbols>true</DebugSymbols>\r
-    <DebugType>full</DebugType>\r
-    <Optimize>false</Optimize>\r
-    <OutputPath>bin\Debug_Java\</OutputPath>\r
-    <DefineConstants>DEBUG;TRACE;JAVA</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <BaseAddress>285212672</BaseAddress>\r
-    <SkipValidation>false</SkipValidation>\r
-    <KeepIntermediate>false</KeepIntermediate>\r
-    <TargetPlatform>0</TargetPlatform>\r
-    <AdditionalClassPath>\r
-    </AdditionalClassPath>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
-    <DebugType>pdbonly</DebugType>\r
-    <Optimize>true</Optimize>\r
-    <OutputPath>bin\Release_Java\</OutputPath>\r
-    <DefineConstants>TRACE;JAVA</DefineConstants>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <WarningLevel>4</WarningLevel>\r
-    <BaseAddress>285212672</BaseAddress>\r
-    <SkipValidation>false</SkipValidation>\r
-    <KeepIntermediate>false</KeepIntermediate>\r
-    <TargetPlatform>0</TargetPlatform>\r
-    <AdditionalClassPath>\r
-    </AdditionalClassPath>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
-    <DebugSymbols>true</DebugSymbols>\r
-    <OutputPath>bin\Debug_Java20\</OutputPath>\r
-    <DefineConstants>TRACE;DEBUG;JAVA;NET_2_0</DefineConstants>\r
-    <BaseAddress>285212672</BaseAddress>\r
-    <DebugType>full</DebugType>\r
-    <PlatformTarget>AnyCPU</PlatformTarget>\r
-    <ErrorReport>prompt</ErrorReport>\r
-    <SkipValidation>false</SkipValidation>\r
-    <KeepIntermediate>false</KeepIntermediate>\r
-    <GHProjectType>1</GHProjectType>\r
-    <PreCompile>false</PreCompile>\r
-    <AdditionalClassPath>\r
-    </AdditionalClassPath>\r
-    <ApplicationServerType>\r
-    </ApplicationServerType>\r
-    <Version>2.0</Version>\r
-    <JDKName>1.5.0_05</JDKName>\r
-    <jarserver>iap2</jarserver>\r
-    <TargetPlatform>0</TargetPlatform>\r
-  </PropertyGroup>\r
-  <ItemGroup>\r
-    <Reference Include="Mainsoft.Web, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">\r
-      <SpecificVersion>False</SpecificVersion>\r
-      <HintPath>..\bin\Debug_Java20\Mainsoft.Web.dll</HintPath>\r
-      <Private>True</Private>\r
-    </Reference>\r
-    <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">\r
-      <SpecificVersion>False</SpecificVersion>\r
-      <HintPath>..\..\..\nunit20\nunit-console\bin\Debug_Java20\nunit.framework.dll</HintPath>\r
-      <Private>True</Private>\r
-    </Reference>\r
-    <Reference Include="rt, Version=0.0.0.0, Culture=neutral">\r
-      <Private>False</Private>\r
-    </Reference>\r
-    <Reference Include="System" />\r
-    <Reference Include="System.Configuration">\r
-      <Private>False</Private>\r
-    </Reference>\r
-    <Reference Include="System.Data" />\r
-    <Reference Include="System.Web">\r
-      <Private>False</Private>\r
-    </Reference>\r
-    <Reference Include="System.Xml" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <Compile Include="Mainsoft.Web.Security\MembershipTests.cs" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <Folder Include="Properties\" />\r
-  </ItemGroup>\r
-  <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
-  <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
-       Other similar extension points exist, see Microsoft.Common.targets.\r
-  <Target Name="BeforeBuild">\r
-  </Target>\r
-  <Target Name="AfterBuild">\r
-  </Target>\r
-  -->\r
-  <ProjectExtensions>\r
-    <VisualStudio>\r
-      <UserProperties REFS-JarPath-mainsoft-web="..\bin\Debug_Java20\Mainsoft.Web.jar" REFS-JarPath-nunit-framework="..\..\..\nunit20\nunit-console\bin\Debug_Java20\nunit.framework.jar" REFS-JarPath-system-web="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.Web.jar" REFS-JarPath-system-configuration="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.Configuration.jar" REFS-JarPath-rt="..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\jre5\lib\rt.jar" REFS-JarPath-system-xml="..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.Xml.jar" REFS-JarPath-system-data="..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.Data.jar" REFS-JarPath-system="..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.jar" REFS-JarPath-mscorlib="..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\mscorlib.jar" />\r
-    </VisualStudio>\r
-  </ProjectExtensions>\r
-</Project>
diff --git a/mcs/class/Mainsoft.Web/makefile.build b/mcs/class/Mainsoft.Web/makefile.build
deleted file mode 100755 (executable)
index c7db3b3..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<!--Minimalistic buildfile -->\r
-<project name="Mainsoft.Web" default="all">\r
-<property name="ghroot"  value="${project::get-base-directory()}\..\..\..\.."/>\r
-  <!--Allways at the beginning-->\r
-  <include buildfile="${ghroot}\vsbuild\properties.xml" />\r
-\r
-  <!--MANDATORY SECTION-->\r
-\r
-  <!--Could be GH ANT .NET-->\r
-  <property name="projecttype" value=".NET2005"/>\r
-  <!--Could be RUNTIME TOOLS ... -->\r
-  <property name="rules" value="RUNTIME"/>\r
-\r
-  <property name="msbuild_file" value="Mainsoft.Web.J2EE.csproj"/>\r
-  <property name="override_config" value="${ghconfiguration}"/>\r
-  \r
-  <!--Fileset describing project output files. Uset by copy/delete rules in framework-->\r
-  <fileset id="output" basedir="${project::get-base-directory()}\bin" failonempty="true">\r
-       <include name="${ghconfiguration}\Mainsoft.Web.jar"/>\r
-       <include name="${ghconfiguration}\Mainsoft.Web.dll"/>\r
-       <include name="${ghconfiguration}\Mainsoft.Web.XML"/>\r
-  </fileset>\r
-\r
-  <!--END MANDATORY SECTION-->\r
-\r
- <!--OPTIONAL SECTION-->\r
-<!--\r
-  <target name="postbuild">\r
-          \r
-  </target>\r
--->\r
-  <!--\r
-  <property name="cvnsrc" value="svn://svn.myrealbox.com/source/trunk/mcs/<cvn_folder>"/>\r
-  <target name="prebuild">\r
-  Put something there if you need\r
-  </target>\r
-  -->\r
-  <!--END OPTIONAL SECTION-->\r
-\r
-\r
-  <!--Allways at the end-->\r
-  <include buildfile="${ghroot}\vsbuild\framework.xml" />\r
-</project>\r
index c54baffecf94c174e38e13a24b9b26f32ded1c05..086c6f5f9aa92214c1c9e00bf2ee9d8b98968484 100644 (file)
@@ -3620,12 +3620,15 @@ public class DebuggerTests
                Assert.AreEqual (ThreadState.WaitSleepJoin, thread.ThreadState, "#6");
 
                frames = thread.GetFrames ();
-               Assert.AreEqual (4, frames.Length, "#7");
-               Assert.AreEqual ("WaitOne_internal", frames [0].Method.Name, "#8");
-               Assert.AreEqual ("WaitOne", frames [1].Method.Name, "#8.1");
-               Assert.AreEqual ("wait_one", frames [2].Method.Name, "#9");
-               Assert.AreEqual ("Main", frames [3].Method.Name, "#10");
-
+               Assert.AreEqual (8, frames.Length, "#7");
+               Assert.AreEqual ("WaitOne_internal", frames [0].Method.Name, "#8.0");
+               Assert.AreEqual ("WaitOneNative", frames [1].Method.Name, "#8.1");
+               Assert.AreEqual ("InternalWaitOne", frames [2].Method.Name, "#8.2");
+               Assert.AreEqual ("WaitOne", frames [3].Method.Name, "#8.3");
+               Assert.AreEqual ("WaitOne", frames [4].Method.Name, "#8.4");
+               Assert.AreEqual ("WaitOne", frames [5].Method.Name, "#8.5");
+               Assert.AreEqual ("wait_one", frames [6].Method.Name, "#8.6");
+               Assert.AreEqual ("Main", frames [7].Method.Name, "#8.7");
 
                var frame = frames [0];
                Assert.IsTrue (frame.IsNativeTransition, "#11.1");
@@ -3634,12 +3637,12 @@ public class DebuggerTests
                        Assert.Fail ("Known limitation - can't get info from m2n frames");
                } catch (AbsentInformationException) {}
 
-               frame = frames [1];
+               frame = frames [3];
                Assert.IsFalse (frame.IsNativeTransition, "#12.1");
                var wait_one_this = frame.GetThis ();
                Assert.IsNotNull (wait_one_this, "#12.2");
 
-               frame = frames [2];
+               frame = frames [6];
                var locals = frame.GetVisibleVariables ();
                Assert.AreEqual (1, locals.Count, "#13.1");
 
index d3671c0bf9fa234bfa28f40eea84dfbffe3f4c6f..23ccc8316eb33e91380eb63a3c1a931c42ee7715 100644 (file)
@@ -128,12 +128,25 @@ namespace Mono.Security.X509 {
 
                        string filename = Path.Combine (_storePath, GetUniqueName (certificate));
                        if (!File.Exists (filename)) {
-                               using (FileStream fs = File.Create (filename)) {
-                                       byte[] data = certificate.RawData;
-                                       fs.Write (data, 0, data.Length);
-                                       fs.Close ();
+                               filename = Path.Combine (_storePath, GetUniqueNameWithSerial (certificate));
+                               if (!File.Exists (filename)) {
+                                       using (FileStream fs = File.Create (filename)) {
+                                               byte[] data = certificate.RawData;
+                                               fs.Write (data, 0, data.Length);
+                                               fs.Close ();
+                                       }
+                                       ClearCertificates ();   // We have modified the store on disk.  So forget the old state.
+                               }
+                       } else {
+                               string newfilename = Path.Combine (_storePath, GetUniqueNameWithSerial (certificate));
+                               if (GetUniqueNameWithSerial (LoadCertificate (filename)) != GetUniqueNameWithSerial (certificate)) {
+                                       using (FileStream fs = File.Create (newfilename)) {
+                                               byte[] data = certificate.RawData;
+                                               fs.Write (data, 0, data.Length);
+                                               fs.Close ();
+                                       }
+                                       ClearCertificates ();   // We have modified the store on disk.  So forget the old state.
                                }
-                               ClearCertificates ();   // We have modified the store on disk.  So forget the old state.
                        }
 #if !NET_2_1
                        // Try to save privateKey if available..
@@ -164,10 +177,16 @@ namespace Mono.Security.X509 {
 
                public void Remove (X509Certificate certificate) 
                {
-                       string filename = Path.Combine (_storePath, GetUniqueName (certificate));
+                       string filename = Path.Combine (_storePath, GetUniqueNameWithSerial (certificate));
                        if (File.Exists (filename)) {
                                File.Delete (filename);
                                ClearCertificates ();   // We have modified the store on disk.  So forget the old state.
+                       } else {
+                               filename = Path.Combine (_storePath, GetUniqueName (certificate));
+                               if (File.Exists (filename)) {
+                                       File.Delete (filename);
+                                       ClearCertificates ();   // We have modified the store on disk.  So forget the old state.
+                               }
                        }
                }
 
@@ -182,10 +201,15 @@ namespace Mono.Security.X509 {
 
                // private stuff
 
-               private string GetUniqueName (X509Certificate certificate) 
+               private string GetUniqueNameWithSerial (X509Certificate certificate)
+               {
+                       return GetUniqueName (certificate, certificate.SerialNumber);
+               }
+
+               private string GetUniqueName (X509Certificate certificate, byte[] serial = null) 
                {
                        string method;
-                       byte[] name = GetUniqueName (certificate.Extensions);
+                       byte[] name = GetUniqueName (certificate.Extensions, serial);
                        if (name == null) {
                                method = "tbp"; // thumbprint
                                name = certificate.Hash;
@@ -208,7 +232,7 @@ namespace Mono.Security.X509 {
                        return GetUniqueName (method, name, ".crl");
                }
 
-               private byte[] GetUniqueName (X509ExtensionCollection extensions) 
+               private byte[] GetUniqueName (X509ExtensionCollection extensions, byte[] serial = null
                {
                        // We prefer Subject Key Identifier as the unique name
                        // as it will provide faster lookups
@@ -217,7 +241,14 @@ namespace Mono.Security.X509 {
                                return null;
 
                        SubjectKeyIdentifierExtension ski = new SubjectKeyIdentifierExtension (ext);
-                       return ski.Identifier;
+                       if (serial == null) {
+                               return ski.Identifier;
+                       } else {
+                               byte[] uniqueWithSerial = new byte[ski.Identifier.Length + serial.Length];
+                               System.Buffer.BlockCopy (ski.Identifier, 0, uniqueWithSerial, 0, ski.Identifier.Length );
+                               System.Buffer.BlockCopy (serial, 0, uniqueWithSerial, ski.Identifier.Length, serial.Length );
+                               return uniqueWithSerial;
+                       }
                }
 
                private string GetUniqueName (string method, byte[] name, string fileExtension) 
index 8e172ad3a4d57b404fd04d6528d289f3c0ccdf57..e9e90c3e8347d0c498f1d997071962524dcdc54b 100644 (file)
@@ -299,6 +299,9 @@ namespace System.Drawing.Printing
                        CUPS_OPTIONS cups_options;
                        string option_name, option_value;
                        int cups_size = Marshal.SizeOf(typeof(CUPS_OPTIONS));
+
+                       LoadOptionList (ppd, "PageSize", paper_names, out defsize);
+                       LoadOptionList (ppd, "InputSlot", paper_sources, out defsource);
                        
                        for (int j = 0; j < numOptions; j++)
                        {
@@ -306,6 +309,8 @@ namespace System.Drawing.Printing
                                option_name = Marshal.PtrToStringAnsi(cups_options.name);
                                option_value = Marshal.PtrToStringAnsi(cups_options.val);
 
+                               if (option_name == "PageSize") defsize = option_value;
+                               else if (option_name == "InputSlot") defsource = option_value;
                                #if PrintDebug
                                Console.WriteLine("{0} = {1}", option_name, option_value);
                                #endif
@@ -314,9 +319,6 @@ namespace System.Drawing.Printing
 
                                options = (IntPtr) ((long)options + cups_size);
                        }
-                       
-                       LoadOptionList (ppd, "PageSize", paper_names, out defsize);
-                       LoadOptionList (ppd, "InputSlot", paper_sources, out defsource);
                }
                
                /// <summary>
index 4cc01193e823796921dfa8f850634882091301f2..e569716599975814af62d64efa7a1a75dc292d59 100644 (file)
@@ -99,7 +99,6 @@ namespace MonoTests.System.Drawing.Printing {
                                optionPtr = (IntPtr)((long)optionPtr + cupsOptionSize);
                        }
                        cupsFreeDests (1, destPtr);
-
                        return options;
                }
 
@@ -115,8 +114,9 @@ namespace MonoTests.System.Drawing.Printing {
                        var settings = new PrinterSettings () { PrinterName = PrinterSettings.InstalledPrinters [0] };
                        Assert.AreEqual (options ["PageSize"], settings.DefaultPageSettings.PaperSize.PaperName,
                                "Bug #602934 (https://bugzilla.novell.com/show_bug.cgi?id=602934) not fixed (PaperSize)");
-                       Assert.AreEqual (options ["Resolution"], string.Format ("{0}dpi", settings.DefaultPageSettings.PrinterResolution.X),
-                               "Bug #602934 (https://bugzilla.novell.com/show_bug.cgi?id=602934) not fixed (Resolution)");
+                       if (options.ContainsKey("Resolution"))
+                               Assert.AreEqual (options ["Resolution"], string.Format ("{0}dpi", settings.DefaultPageSettings.PrinterResolution.X),
+                                       "Bug #602934 (https://bugzilla.novell.com/show_bug.cgi?id=602934) not fixed (Resolution)");
                }
 
                #endregion
index da5d94f4104783dab29d78f2c3df0b4fb4be8ab4..5060897cb9abf3b3fa7ceb7419e65d548f5e1def 100644 (file)
@@ -22,7 +22,7 @@ namespace SharpCompress.Writer.Zip
             byte[] encodedFilename = Encoding.UTF8.GetBytes(FileName);
             byte[] encodedComment = Encoding.UTF8.GetBytes(Comment);
 
-            outputStream.Write(new byte[] {80, 75, 1, 2, 0x3F, 0, 0x0A, 0}, 0, 8);
+            outputStream.Write(new byte[] {80, 75, 1, 2, 0x14, 0, 0x0A, 0}, 0, 8);
             HeaderFlags flags = HeaderFlags.UTF8;
             if (!outputStream.CanSeek)
             {
index 70a2eb7d8c4f103c144008895004176361d72d19..846d78c8e4f20264f1172846ef292c69a45ad28f 100644 (file)
@@ -142,7 +142,7 @@ namespace SharpCompress.Writer.Zip
             byte[] encodedFilename = encoding.GetBytes(filename);
 
             OutputStream.Write(BitConverter.GetBytes(ZipHeaderFactory.ENTRY_HEADER_BYTES), 0, 4);
-            OutputStream.Write(new byte[] {63, 0}, 0, 2); //version
+            OutputStream.Write(new byte[] {20, 0}, 0, 2); //version
             HeaderFlags flags = encoding == Encoding.UTF8 ? HeaderFlags.UTF8 : (HeaderFlags)0;
             if (!OutputStream.CanSeek)
             {
index eacf2f6b3dda7072ae5ae8d495dc2e19c5f3895c..36903c675b4858391d77cc4354732ce4a12a8501 100644 (file)
@@ -114,6 +114,51 @@ namespace MonoTests.System.IO.Compression
                        File.Delete ("test.zip");
                }
 
+               [Test]
+               public void ZipOpenAndReopenEntry()
+               {
+                       try {
+                               File.Copy("archive.zip", "test.zip", overwrite: true);
+                               using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
+                                       ZipArchiveMode.Update))
+                               {
+                                       var entry = archive.GetEntry("foo.txt");
+                                       Assert.IsNotNull(entry);
+
+                                       var stream = entry.Open();
+
+                                       try {
+                                               stream = entry.Open();
+                                       } catch (global::System.IO.IOException ex) {
+                                               return;
+                                       }
+
+                                       Assert.Fail();
+                               }
+                       } finally {
+                               File.Delete ("test.zip");
+                       }
+               }
+
+
+               [Test]
+               public void ZipOpenCloseAndReopenEntry()
+               {
+                       File.Copy("archive.zip", "test.zip", overwrite: true);
+                       using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
+                               ZipArchiveMode.Update))
+                       {
+                               var entry = archive.GetEntry("foo.txt");
+                               Assert.IsNotNull(entry);
+
+                               var stream = entry.Open();
+                               stream.Dispose();
+                               stream = entry.Open();
+                       }
+
+                       File.Delete ("test.zip");
+               }
+
                [Test]
                public void ZipGetEntryDeleteReadMode()
                {
index cd783b8eb0c84b33b3f5a7492afb2496b28afde6..0bc69786418acd9e49b53a51b51dc7fe2dce320c 100644 (file)
@@ -29,10 +29,96 @@ using SharpCompress.Archive;
 
 namespace System.IO.Compression
 {
+       internal class ZipArchiveEntryStream : Stream, IDisposable
+       {
+               private readonly ZipArchiveEntry entry;
+               private readonly Stream stream;
+
+               public override bool CanRead {
+                       get { 
+                               return stream.CanRead;
+                       }
+               }
+
+               public override bool CanSeek {
+                       get {
+                               return stream.CanSeek;
+                       }
+               }
+
+               public override bool CanWrite {
+                       get {
+                               return stream.CanWrite;
+                       }
+               }
+
+               public override long Length {
+                       get {
+                               return stream.Length;
+                       }
+               }
+
+               public override long Position {
+                       get {
+                               return stream.Position;
+                       }
+                       set {
+                               stream.Position = value;
+                       }
+               }
+
+               public ZipArchiveEntryStream(ZipArchiveEntry entry, Stream stream)
+               {
+                       this.entry = entry;
+                       this.stream = stream;
+               }
+
+               public override void Flush ()
+               {
+                       stream.Flush();
+               }
+
+               public override long Seek (long offset, SeekOrigin origin)
+               {
+                       return stream.Seek(offset, origin);
+               }
+
+               public override void SetLength (long value)
+               {
+                       stream.SetLength(value);
+               }
+
+               public override int Read (byte[] buffer, int offset, int count)
+               {
+                       return stream.Read(buffer, offset, count);
+               }
+
+               public override void Write (byte[] buffer, int offset, int count)
+               {
+                       stream.Write(buffer, offset, count);
+               }
+
+               public new void Dispose()
+               {
+                       Dispose(true);
+                       GC.SuppressFinalize(this);
+                       base.Dispose();
+               }
+
+               protected override void Dispose(bool disposing)
+               {
+                       if (disposing) 
+                       {
+                               entry.openStream = null;
+                               stream.Dispose();
+                       }
+               }
+       }
+
        public class ZipArchiveEntry
        {
                readonly SharpCompress.Archive.Zip.ZipArchiveEntry entry;
-               private Stream openStream;
+               internal ZipArchiveEntryStream openStream;
                private bool wasDeleted;
 
                internal ZipArchiveEntry(ZipArchive     archive, SharpCompress.Archive.Zip.ZipArchiveEntry entry)
@@ -112,7 +198,7 @@ namespace System.IO.Compression
                        if (Archive.Mode == ZipArchiveMode.Create && openStream != null)
                                throw new IOException("The archive for this entry was opened with the Create mode, and this entry has already been written to.");
 
-                       openStream = entry.OpenEntryStream();
+                       openStream = new ZipArchiveEntryStream(this, entry.OpenEntryStream());
 
                        return openStream;
                }
index a531b34cf61ecc9e8bae4294d843b151b299830f..789a602e9df5bc0a9f30c1e7764ad1f9f4978ec5 100644 (file)
@@ -58,7 +58,12 @@ namespace System.ServiceModel
                {
                }
 
-               protected WSDualHttpBinding (WSDualHttpSecurityMode securityMode)
+               public WSDualHttpBinding(string configName)
+                       : this (WSDualHttpSecurityMode.Message)
+               {
+               }
+
+               public WSDualHttpBinding (WSDualHttpSecurityMode securityMode)
                {
                        security = new WSDualHttpSecurity (securityMode);
                }
index d7389f43e0d2a98ff28798be97789ff3e3da1969..cfd5e146ec09a907a8e1e27e2f67220f4254587d 100644 (file)
@@ -6,7 +6,9 @@ LIBRARY = System.Web.ApplicationServices.dll
 LIB_REFS = System System.Configuration
 LIB_MCS_FLAGS = -d:SYSTEM_WEB_APPLICATIONSERVICES
 
-EXTRA_DISTFILES = $(RESOURCE_FILES)
+RESOURCE_STRINGS = ./System.Web.ApplicationServices.txt
+
+EXTRA_DISTFILES = $(RESOURCE_FILES) $(RESOURCE_STRINGS)
 
 VALID_PROFILE := $(filter 4, $(FRAMEWORK_VERSION_MAJOR))
 ifndef VALID_PROFILE
index ce75cae57d678c31d6cb27c7ac2b37a6b7a0effa..de8e66df804be586ceba5072bb9657a576034994 100644 (file)
@@ -3,19 +3,21 @@ Assembly/AssemblyInfo.cs
 ../../build/common/Locale.cs
 ../../build/common/MonoTODOAttribute.cs
 
-System.Web.Configuration/MembershipPasswordCompatibilityMode.cs
+../../../external/referencesource/System.Web.ApplicationServices/Configuration/MembershipPasswordCompatibilityMode.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/IMembershipAdapter.cs
 System.Web.Security/IMembershipHelper.cs
 
 System.Web.UI/KeyedList.cs
 System.Web.UI/KeyedListEnumerator.cs
-System.Web.Security/MembershipCreateStatus.cs
-System.Web.Security/MembershipCreateUserException.cs
-System.Web.Security/MembershipPasswordException.cs
-System.Web.Security/MembershipPasswordFormat.cs
-System.Web.Security/MembershipProviderCollection.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipCreateStatus.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipCreateUserException.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipPasswordException.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipPasswordFormat.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipProviderCollection.cs
 System.Web.Security/MembershipProvider.cs
-System.Web.Security/MembershipUserCollection.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipUserCollection.cs
 System.Web.Security/MembershipUser.cs
-System.Web.Security/MembershipValidatePasswordEventHandler.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/MembershipValidatePasswordEventHandler.cs
 System.Web.Security/RoleProvider.cs
-System.Web.Security/ValidatePasswordEventArgs.cs
+../../../external/referencesource/System.Web.ApplicationServices/Security/ValidatePasswordEventArgs.cs
+System.Web/ApplicationServicesStrings.cs
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices.txt b/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices.txt
new file mode 100644 (file)
index 0000000..26d1f17
--- /dev/null
@@ -0,0 +1,21 @@
+Can_not_use_encrypted_passwords_with_autogen_keys=You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.
+CustomLoader_ForbiddenByHost=The host forbids the use of custom loaders.
+CustomLoader_MustImplementICustomLoader=The provided type '{0}' must implement the ICustomLoader interface.
+CustomLoader_NoAttributeFound=The assembly '{0}' did not contain an assembly-level CustomLoaderAttribute.
+CustomLoader_NotInFullTrust=Custom loaders can only be used by fully-trusted applications.
+Membership_DuplicateEmail=The E-mail address is already in use.
+Membership_DuplicateProviderUserKey=The provider user key is already in use.
+Membership_DuplicateUserName=The username is already in use.
+Membership_InvalidAnswer=The password-answer supplied is invalid.
+Membership_InvalidEmail=The E-mail supplied is invalid.
+Membership_InvalidPassword=The password supplied is invalid.  Passwords must conform to the password strength requirements configured for the default provider.
+Membership_InvalidProviderUserKey=The provider user key supplied is invalid. It must be of type System.Guid.
+Membership_InvalidQuestion=The password-question supplied is invalid.  Note that the current provider configuration requires a valid password question and answer.  As a result, a CreateUser overload that accepts question and answer parameters must also be used.
+Membership_InvalidUserName=The username supplied is invalid.
+Membership_no_error=No Error.
+Membership_provider_name_invalid=The membership provider name specified is invalid.
+Membership_UserRejected=The user was rejected.
+Parameter_can_not_be_empty=The parameter '{0}' must not be empty.
+Platform_not_supported=This member is not supported on this platfom.
+Provider_Error=The Provider encountered an unknown error.
+Provider_must_implement_type=Provider must implement the class '{0}'.
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Configuration/MembershipPasswordCompatibilityMode.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Configuration/MembershipPasswordCompatibilityMode.cs
deleted file mode 100644 (file)
index 367108c..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Web.Security.MembershipPasswordCompatibilityMode
-//
-// Authors:
-//    Marek Habersack <mhabersack@novell.com>
-//
-// 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.Configuration
-{
-       public enum MembershipPasswordCompatibilityMode
-       {
-               Framework20,
-               Framework40
-       }
-}
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateStatus.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateStatus.cs
deleted file mode 100644 (file)
index 71fddb4..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Web.Security.MembershipCreateStatus
-//
-// Authors:
-//     Ben Maurer (bmaurer@users.sourceforge.net)
-//
-// (C) 2003 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.
-//
-using System.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       public enum MembershipCreateStatus
-       {
-               Success,
-               InvalidUserName,
-               InvalidPassword,
-               InvalidQuestion,
-               InvalidAnswer,
-               InvalidEmail,
-               DuplicateUserName,
-               DuplicateEmail,
-               UserRejected,
-               InvalidProviderUserKey,
-               DuplicateProviderUserKey,
-               ProviderError
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateUserException.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipCreateUserException.cs
deleted file mode 100644 (file)
index a5f9e31..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.Web.Security.MembershipCreateUserException
-//
-// 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;
-using System.Runtime.Serialization;
-using System.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       [Serializable]
-       public class MembershipCreateUserException : Exception
-       {
-               MembershipCreateStatus statusCode;
-               
-               public MembershipCreateUserException ()
-               {
-               }
-               
-               public MembershipCreateUserException (string message): base (message)
-               {
-               }
-               
-               public MembershipCreateUserException (string message, Exception innerException): base (message, innerException)
-               {
-               }
-               
-               protected MembershipCreateUserException (SerializationInfo info, StreamingContext context): base (info, context)
-               {
-                       info.AddValue ("statusCode", statusCode);
-               }
-               
-               public MembershipCreateUserException (MembershipCreateStatus statusCode) : base (statusCode.ToString ())
-               {
-                       this.statusCode = statusCode;
-               }
-               
-               public override void GetObjectData (SerializationInfo info, StreamingContext ctx)
-               {
-                       base.GetObjectData (info, ctx);
-                       statusCode = (MembershipCreateStatus) info.GetValue ("statusCode", typeof(MembershipCreateStatus));
-               }
-               
-               public MembershipCreateStatus StatusCode {
-                       get { return statusCode; }
-               }
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordException.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordException.cs
deleted file mode 100644 (file)
index 5bf60eb..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Web.Security.MembershipPasswordException
-//
-// 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;
-using System.Runtime.Serialization;
-using System.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       [Serializable]
-       public class MembershipPasswordException : Exception
-       {
-               public MembershipPasswordException () : base () {}
-               public MembershipPasswordException (string message) : base (message) {}
-               public MembershipPasswordException (string message, Exception innerException) : base (message, innerException) {}
-               
-               protected MembershipPasswordException (SerializationInfo info, StreamingContext context): base (info, context)
-               {
-               }
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordFormat.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipPasswordFormat.cs
deleted file mode 100644 (file)
index 2948618..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Web.Security.MembershipPasswordFormat
-//
-// 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.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       public enum MembershipPasswordFormat
-       {
-               Clear = 0, 
-               Hashed = 1,
-               Encrypted = 2
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipProviderCollection.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipProviderCollection.cs
deleted file mode 100644 (file)
index be25a05..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.Web.Security.MembershipProviderCollection
-//
-// Authors:
-//     Ben Maurer (bmaurer@users.sourceforge.net)
-//     Sebastien Pouliot  <sebastien@ximian.com>
-//
-// (C) 2003 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.
-//
-using System.Configuration.Provider;
-using System.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       public sealed class MembershipProviderCollection : ProviderCollection
-       {
-               public override void Add (ProviderBase provider)
-               {
-                       if (provider == null)
-                               throw new ArgumentNullException ("provider");
-
-                       if (provider is MembershipProvider)
-                               base.Add (provider);
-                       else {
-                               throw new ArgumentException ("provider", Locale.GetText (
-                                       "Wrong type, expected {0}.", "MembershipProvider"));
-                       }
-               }
-               
-               public void CopyTo (MembershipProvider[] array, int index)
-               {
-                       base.CopyTo (array, index);
-               }
-               
-               public new MembershipProvider this [string name] {
-                       get { return (MembershipProvider) base [name]; }
-               }
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipUserCollection.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipUserCollection.cs
deleted file mode 100644 (file)
index bbb689f..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// System.Web.Security.MembershipUserCollection
-//
-// Authors:
-//     Ben Maurer (bmaurer@users.sourceforge.net)
-//
-// (C) 2003 Ben Maurer
-// 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.Collections;
-using System.Runtime.CompilerServices;
-using System.Web.UI;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       [Serializable]
-       public sealed class MembershipUserCollection : ICollection
-       {
-               public MembershipUserCollection ()
-               {
-               }
-               
-               public void Add (MembershipUser user)
-               {
-                       if (user == null)
-                               throw new ArgumentNullException ("user");
-
-                       CheckNotReadOnly ();
-                       store.Add (user.UserName, user);
-               }
-               
-               public void Clear ()
-               {
-                       CheckNotReadOnly ();
-                       store.Clear ();
-               }
-               
-               void ICollection.CopyTo (Array array, int index)
-               {
-                       store.Values.CopyTo (array, index);
-               }
-               
-               public void CopyTo (MembershipUser[] array, int index)
-               {
-                       store.Values.CopyTo (array, index);
-               }
-               
-               public IEnumerator GetEnumerator ()
-               {
-                       return ((IEnumerable) store).GetEnumerator ();
-               }
-               
-               public void Remove (string name)
-               {
-                       CheckNotReadOnly ();
-                       store.Remove (name);
-               }
-               
-               public void SetReadOnly ()
-               {
-                       readOnly = true;
-               }
-               
-               public int Count {
-                       get { return store.Count; }
-               }
-               
-               public bool IsSynchronized {
-                       get { return false; }
-               }
-               
-               public MembershipUser this [string name] {
-                       get { return (MembershipUser) store [name]; }
-               }
-               
-               public object SyncRoot {
-                       get { return this; }
-               }
-               
-               void CheckNotReadOnly ()
-               {
-                       if (readOnly)
-                               throw new NotSupportedException ();
-               }
-               
-               KeyedList store = new KeyedList ();
-               bool readOnly = false;
-       }
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipValidatePasswordEventHandler.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/MembershipValidatePasswordEventHandler.cs
deleted file mode 100644 (file)
index 1c47511..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Web.Security.MembershipValidatePasswordEventHandler
-//
-// Authors:
-//     Lluis Sanchez Gual (lluis@novell.com)
-//
-// (C) 2005 Novell, inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       public delegate void MembershipValidatePasswordEventHandler (object sender, ValidatePasswordEventArgs e);
-}
-
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.Security/ValidatePasswordEventArgs.cs b/mcs/class/System.Web.ApplicationServices/System.Web.Security/ValidatePasswordEventArgs.cs
deleted file mode 100644 (file)
index ea18903..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// System.Web.Security.ValidatePasswordEventArgs
-//
-// Authors:
-//     Lluis Sanchez Gual (lluis@novell.com)
-//
-// (C) 2005 Novell, inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Web.Security
-{
-       [TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-       public sealed class ValidatePasswordEventArgs: EventArgs
-       {
-               bool cancel;
-               Exception exception;
-               bool isNewUser;
-               string userName;
-               string password;
-               
-               public ValidatePasswordEventArgs (string userName, string password, bool isNewUser)
-               {
-                       this.isNewUser = isNewUser;
-                       this.userName = userName;
-                       this.password = password;
-               }
-               
-               public bool Cancel {
-                       get { return cancel; }
-                       set { cancel = value; }
-               }
-               
-               public Exception FailureInformation {
-                       get { return exception; }
-                       set { exception = value; }
-               }
-               
-               public bool IsNewUser {
-                       get { return isNewUser; }
-               }
-               
-               public string UserName {
-                       get { return userName; }
-               }
-               
-               public string Password {
-                       get { return password; }
-               }
-       }
-}
-
diff --git a/mcs/class/System.Web.ApplicationServices/System.Web/ApplicationServicesStrings.cs b/mcs/class/System.Web.ApplicationServices/System.Web/ApplicationServicesStrings.cs
new file mode 100644 (file)
index 0000000..61fda8a
--- /dev/null
@@ -0,0 +1,29 @@
+namespace System.Web
+{
+    internal class ApplicationServicesStrings
+    {
+      internal const string Can_not_use_encrypted_passwords_with_autogen_keys = "You must specify a non-autogenerated machine key to store passwords in the encrypted format. Either specify a different passwordFormat, or change the machineKey configuration to use a non-autogenerated decryption key.";
+      internal const string CustomLoader_ForbiddenByHost = "The host forbids the use of custom loaders.";
+      internal const string CustomLoader_MustImplementICustomLoader = "The provided type '{0}' must implement the ICustomLoader interface.";
+      internal const string CustomLoader_NoAttributeFound = "The assembly '{0}' did not contain an assembly-level CustomLoaderAttribute.";
+      internal const string CustomLoader_NotInFullTrust = "Custom loaders can only be used by fully-trusted applications (<trust level=\"Full\" />).";
+      internal const string Membership_DuplicateEmail = "The E-mail address is already in use.";
+      internal const string Membership_DuplicateProviderUserKey = "The provider user key is already in use.";
+      internal const string Membership_DuplicateUserName = "The username is already in use.";
+      internal const string Membership_InvalidAnswer = "The password-answer supplied is invalid.";
+      internal const string Membership_InvalidEmail = "The E-mail supplied is invalid.";
+      internal const string Membership_InvalidPassword = "The password supplied is invalid.  Passwords must conform to the password strength requirements configured for the default provider.";
+      internal const string Membership_InvalidProviderUserKey = "The provider user key supplied is invalid. It must be of type System.Guid.";
+      internal const string Membership_InvalidQuestion = "The password-question supplied is invalid.  Note that the current provider configuration requires a valid password question and answer.  As a result, a CreateUser overload that accepts question and answer parameters must also be used.";
+      internal const string Membership_InvalidUserName = "The username supplied is invalid.";
+      internal const string Membership_no_error = "No Error.";
+      internal const string Membership_provider_name_invalid = "The membership provider name specified is invalid.";
+      internal const string Membership_UserRejected = "The user was rejected.";
+      internal const string Parameter_can_not_be_empty = "The parameter '{0}' must not be empty.";
+      internal const string Platform_not_supported = "This member is not supported on the .NET Framework Client Profile.";
+      internal const string Provider_Error = "The Provider encountered an unknown error.";
+      internal const string Provider_must_implement_type = "Provider must implement the class '{0}'.";
+    }
+}
+
+
diff --git a/mcs/class/System.Web/System.Web.Profile/DefaultProfile.cs b/mcs/class/System.Web/System.Web.Profile/DefaultProfile.cs
deleted file mode 100644 (file)
index 4a4250f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Web.UI.WebControls.DefaultProfile.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;
-using System.Configuration;
-
-namespace System.Web.Profile
-{
-       public class DefaultProfile : ProfileBase
-       {
-               [MonoTODO("Currently does nothing")]
-               public DefaultProfile ()
-               {
-               }
-       }
-
-}
-
diff --git a/mcs/class/System.Web/System.Web.Profile/ProfileAuthenticationOption.cs b/mcs/class/System.Web/System.Web.Profile/ProfileAuthenticationOption.cs
deleted file mode 100644 (file)
index 7899453..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Web.Profile.ProfileAuthenticationOption.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.Profile
-{
-        public enum ProfileAuthenticationOption
-        {
-                Anonymous = 0,
-                Authenticated = 1,
-                All = 2
-        }
-}
diff --git a/mcs/class/System.Web/System.Web.Profile/ProfileInfo.cs b/mcs/class/System.Web/System.Web.Profile/ProfileInfo.cs
deleted file mode 100644 (file)
index b347281..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.Web.Profile.ProfileInfo.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
-{
-       [Serializable]
-       public class ProfileInfo
-       {
-               string user_name;
-               bool is_anonymous;
-               DateTime last_activity_date;
-               DateTime last_updated_date;
-               int size;
-
-               protected ProfileInfo ()
-               {
-               }
-
-               public ProfileInfo (string username, 
-                                   bool isAnonymous, 
-                                   DateTime lastActivityDate, 
-                                   DateTime lastUpdatedDate, 
-                                   int size)
-               {
-                       user_name = username;
-                       is_anonymous = isAnonymous;
-                       last_activity_date = lastActivityDate;
-                       last_updated_date = lastUpdatedDate;
-                       this.size = size;
-               }
-
-               public virtual bool IsAnonymous
-               {
-                       get {
-                               return is_anonymous;
-                       }
-               }
-
-               public virtual DateTime LastActivityDate
-               {
-                       get {
-                               return last_activity_date;
-                       }
-               }
-
-               public virtual DateTime LastUpdatedDate {
-                       get {
-                               return last_updated_date;
-                       }
-               }
-
-               public virtual int Size {
-                       get {
-                               return size;
-                       }
-               }
-
-               public virtual string UserName {
-                       get {
-                               return user_name;
-                       }
-               }
-       }
-
-}
diff --git a/mcs/class/System.Web/System.Web.Profile/ProfileInfoCollection.cs b/mcs/class/System.Web/System.Web.Profile/ProfileInfoCollection.cs
deleted file mode 100644 (file)
index 545c235..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// System.Web.Profile.ProfileInfoCollection.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;
-using System.Collections;
-
-namespace System.Web.Profile
-{
-       [Serializable]
-       public sealed class ProfileInfoCollection : ICollection, IEnumerable
-       {
-               public ProfileInfoCollection()
-               {
-                       list = new ArrayList ();
-               }
-
-               public void Add (ProfileInfo profileInfo)
-               {
-                       if (readOnly)
-                               throw new NotSupportedException ();
-
-                       list.Add (profileInfo);
-               }
-
-               public void Clear ()
-               {
-                       if (readOnly)
-                               throw new NotSupportedException ();
-
-                       list.Clear ();
-               }
-
-               public void CopyTo (System.Array array, int index)
-               {
-                       list.CopyTo (array, index);
-               }
-
-               public void CopyTo (ProfileInfo[ ] array, int index)
-               {
-                       list.CopyTo (array, index);
-               }
-
-               public IEnumerator GetEnumerator ()
-               {
-                       return list.GetEnumerator ();
-               }
-
-               public void Remove (string name)
-               {
-                       if (readOnly)
-                               throw new NotSupportedException ();
-
-                       for (int i = 0; i < list.Count; i ++) {
-                               ProfileInfo info = (ProfileInfo)list[i];
-                               if (info.UserName == name) {
-                                       list.Remove (i);
-                                       break;
-                               }
-                       }
-               }
-
-               public void SetReadOnly ()
-               {
-                       readOnly = true;
-               }
-
-               public int Count {
-                       get {
-                               return list.Count;
-                       }
-               }
-
-               public bool IsSynchronized {
-                       get {
-                               return false;
-                       }
-               }
-
-               public object SyncRoot {
-                       get {
-                               return this;
-                       }
-               }
-
-               public ProfileInfo this [string name] {
-                       get {
-                               for (int i = 0; i < list.Count; i ++) {
-                                       ProfileInfo info = (ProfileInfo)list[i];
-                                       if (info.UserName == name) {
-                                               return info;
-                                       }
-                               }
-
-                               return null;
-                       }
-               }
-
-               ArrayList list;
-               bool readOnly;
-       }
-
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/IPostBackContainer.cs b/mcs/class/System.Web/System.Web.UI.WebControls/IPostBackContainer.cs
deleted file mode 100644 (file)
index c00250c..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Web.UI.WebControls.IPostBackContainer.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.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
-       public interface IPostBackContainer
-       {
-               PostBackOptions GetPostBackOptions (IButtonControl control);
-       }
-}
-
-
diff --git a/mcs/class/System.Web/System.Web.UI/ICheckBoxControl.cs b/mcs/class/System.Web/System.Web.UI/ICheckBoxControl.cs
deleted file mode 100644 (file)
index 006804c..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Web.UI.ICheckBoxControl.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 interface ICheckBoxControl
-       {
-               bool Checked { get; set; }
-               event EventHandler CheckedChanged;
-       }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI/IEditableTextControl.cs b/mcs/class/System.Web/System.Web.UI/IEditableTextControl.cs
deleted file mode 100644 (file)
index 5ce8580..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Web.UI.IEditableTextControl.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 interface IEditableTextControl: ITextControl
-       {
-               event EventHandler TextChanged;
-       }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI/ITextControl.cs b/mcs/class/System.Web/System.Web.UI/ITextControl.cs
deleted file mode 100644 (file)
index f305916..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Web.UI.ITextControl.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 interface ITextControl
-       {
-               string Text { get; set; }
-       }
-}
index 908e44292fe15f5def0e3214fe65985b84a6e100..09fe382000b5e9f1ace1e571617c279f1fea9ef6 100644 (file)
@@ -410,16 +410,15 @@ System.Web/ProcessModelInfo.cs
 System.Web/ProcessShutdownReason.cs
 System.Web/ProcessStatus.cs
 System.Web.Profile/CustomProviderDataAttribute.cs
-System.Web.Profile/DefaultProfile.cs
-System.Web.Profile/ProfileAuthenticationOption.cs
+../../../external/referencesource/System.Web/Profile/DefaultHttpProfile.cs
+../../../external/referencesource/System.Web/Profile/ProfileAuthenticationOptions.cs
 System.Web.Profile/ProfileAutoSaveEventArgs.cs
 System.Web.Profile/ProfileAutoSaveEventHandler.cs
 System.Web.Profile/ProfileBase.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
+../../../external/referencesource/System.Web/Profile/ProfileInfo.cs
 System.Web.Profile/ProfileManager.cs
 System.Web.Profile/ProfileMigrateEventArgs.cs
 System.Web.Profile/ProfileMigrateEventHandler.cs
@@ -620,7 +619,7 @@ System.Web.UI/HtmlTextWriter.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
+../../../external/referencesource/System.Web/UI/WebControls/ICheckBoxControl.cs
 ../../../external/referencesource/System.Web/UI/IControlBuilderAccessor.cs
 ../../../external/referencesource/System.Web/UI/IControlDesignerAccessor.cs
 ../../../external/referencesource/System.Web/UI/IDataBindingsAccessor.cs
@@ -628,7 +627,7 @@ System.Web.UI/ICheckBoxControl.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
+../../../external/referencesource/System.Web/UI/WebControls/IEditableTextControl.cs
 ../../../external/referencesource/System.Web/UI/IExpressionsAccessor.cs
 ../../../external/referencesource/System.Web/UI/IFilterResolutionService.cs
 System.Web.UI/IgnoreUnknownContentAttribute.cs
@@ -653,7 +652,7 @@ System.Web.UI/IScriptManager.cs
 ../../../external/referencesource/System.Web/UI/IScriptResourceMapping.cs
 System.Web.UI/ITagNameToTypeMapper.cs
 ../../../external/referencesource/System.Web/UI/ITemplate.cs
-System.Web.UI/ITextControl.cs
+../../../external/referencesource/System.Web/UI/WebControls/ITextControl.cs
 ../../../external/referencesource/System.Web/UI/IThemeResolutionService.cs
 ../../../external/referencesource/System.Web/UI/IUrlResolutionService.cs
 ../../../external/referencesource/System.Web/UI/IUserControlDesignerAccessor.cs
@@ -953,7 +952,7 @@ System.Web.UI.WebControls/ImageMap.cs
 ../../../external/referencesource/System.Web/UI/WebControls/ImageMapEventHandler.cs
 System.Web.UI.WebControls/IMenuRenderer.cs
 ../../../external/referencesource/System.Web/UI/WebControls/IPersistedSelector.cs
-System.Web.UI.WebControls/IPostBackContainer.cs
+../../../external/referencesource/System.Web/UI/WebControls/IPostBackContainer.cs
 ../../../external/referencesource/System.Web/UI/WebControls/IRepeatInfoUser.cs
 System.Web.UI.WebControls/LabelControlBuilder.cs
 System.Web.UI.WebControls/Label.cs
@@ -1264,6 +1263,7 @@ System.Web.UI/FileLevelMasterPageControlBuilder.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
+../../../external/referencesource/System.Web/UI/WebControls/IRenderOuterTableControl.cs
 System.Web.UI.WebControls/IRenderOuterTable.cs
 System.Web.UI.WebControls/MenuListRenderer.cs
 ../../../external/referencesource/System.Web/UI/WebControls/MenuRenderingMode.cs
@@ -1420,7 +1420,6 @@ ReferenceSources/SR.cs
 ../../../external/referencesource/System.Web/Util/GCUtil.cs
 ../../../external/referencesource/System.Web/Util/SimpleRecyclingCache.cs
 ../../../external/referencesource/System.Web/Util/VersionUtil.cs
-
 ../../../external/referencesource/System.Web/Util/AppVerifierErrorCode.cs
 ../../../external/referencesource/System.Web/Util/DateTimeUtil.cs
 ../../../external/referencesource/System.Web/Util/hresults.cs
@@ -1430,4 +1429,23 @@ ReferenceSources/SR.cs
 ../../../external/referencesource/System.Web/Util/RegexUtil.cs
 ../../../external/referencesource/System.Web/Util/ObjectSet.cs
 ../../../external/referencesource/System.Web/Util/ParseHttpDate.cs
+../../../external/referencesource/System.Web/IntraPartitionAPIs/xsp/PerfCounterEnum.cs
+../../../external/referencesource/System.Web/misc/InvariantComparer.cs
+
+../../../external/referencesource/System.Web/ModelBinding/DictionaryHelpers.cs
+../../../external/referencesource/System.Web/ModelBinding/ValueProviderResult.cs
+../../../external/referencesource/System.Web/ModelBinding/ModelState.cs
+../../../external/referencesource/System.Web/ModelBinding/ModelStateDictionary.cs
+../../../external/referencesource/System.Web/ModelBinding/ModelBindingExecutionContext.cs
 
+../../../external/referencesource/System.Web/ModelBinding/IValueProvider.cs
+../../../external/referencesource/System.Web/ModelBinding/IValueProviderSource.cs
+../../../external/referencesource/System.Web/ModelBinding/IUnvalidatedValueProviderSource.cs
+../../../external/referencesource/System.Web/UI/IUpdatePanel.cs
+../../../external/referencesource/System.Web/Configuration/IServerConfig2.cs
+../../../external/referencesource/System.Web/UI/WebControls/IBorderPaddingControl.cs
+../../../external/referencesource/System.Web/UI/WebControls/IEditableTextControl.cs
+../../../external/referencesource/System.Web/UI/WebControls/IWizardSideBarListControl.cs
+../../../external/referencesource/System.Web/UI/WebControls/WizardSideBarListControlItemEventArgs.cs
+../../../external/referencesource/System.Web/UI/WebControls/WizardSideBarListControlItem.cs
+../../../external/referencesource/System.Web/Security/Cryptography/ICryptoService.cs
index a28f7a29d0d3801f1b811d81e3dd1533a2c84a17..1eeb9c9a368866973e0da7f87009a0a1036ebf01 100644 (file)
@@ -1,22 +1,22 @@
 // TODO:
-//    DispatcherObject returned by BeginInvoke must allow:
-//       * Waiting until delegate is invoked.
-//       See: BeginInvoke documentation for details
+//     DispatcherObject returned by BeginInvoke must allow:
+//        * Waiting until delegate is invoked.
+//        See: BeginInvoke documentation for details
 //
-//    Implement the "Invoke" methods, they are currently not working.
+//     Implement the "Invoke" methods, they are currently not working.
 //
-//    Add support for disabling the dispatcher and resuming it.
-//    Add support for Waiting for new tasks to be pushed, so that we dont busy loop.
-//    Add support for aborting an operation (emit the hook.operationaborted too) 
+//     Add support for disabling the dispatcher and resuming it.
+//     Add support for Waiting for new tasks to be pushed, so that we dont busy loop.
+//     Add support for aborting an operation (emit the hook.operationaborted too) 
 //
 // Very confusing information about Shutdown: it states that shutdown is
 // not over, until all events are unwinded, and also states that all events
 // are aborted at that point.  See 'Dispatcher.InvokeShutdown' docs,
 //
 // Testing reveals that 
-//     -> InvokeShutdown() stops processing, even if events are available,
-//        there is no "unwinding" of events, even of higher priority events,
-//        they are just ignored.
+//      -> InvokeShutdown() stops processing, even if events are available,
+//             there is no "unwinding" of events, even of higher priority events,
+//             they are just ignored.
 //
 // The documentation for the Dispatcher family is poorly written, complete
 // sections are cut-and-pasted that add no value and the important pieces
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 // Copyright (c) 2006 Novell, Inc. (http://www.novell.com)
+// Copyright (c) 2016 Quamotion (http://quamotion.mobi)
 //
 // Authors:
 //     Miguel de Icaza (miguel@novell.com)
+//     Frederik Carlier (frederik.carlier@quamotion.mobi)
 //
 using System;
 using System.Collections;
@@ -181,6 +183,21 @@ namespace System.Windows.Threading {
                        return op;
                }
 
+               public DispatcherOperation InvokeAsync (Action callback)
+               {
+                       return this.BeginInvoke(callback);
+               }
+
+               public DispatcherOperation InvokeAsync (Action callback, DispatcherPriority priority)
+               {
+                       return this.BeginInvoke(callback, priority);
+               }
+
+               public DispatcherOperation InvokeAsync (Action callback, DispatcherPriority priority, CancellationToken cancellationToken)
+               {
+                       return this.BeginInvoke(callback, priority);
+               }
+
                public object Invoke (Delegate method, params object[] args)
                {
                        throw new NotImplementedException ();
@@ -521,32 +538,33 @@ namespace System.Windows.Threading {
 
                public void Enqueue (object obj)
                {
-                        if (size == array.Length)
-                                Grow ();
-                        array[tail] = obj;
-                        tail = (tail+1) % array.Length;
-                        size++;
+                       if (size == array.Length)
+                                       Grow ();
+                       array[tail] = obj;
+                       tail = (tail+1) % array.Length;
+                       size++;
                }
 
                public object Dequeue ()
-                {
-                        if (size < 1)
-                                throw new InvalidOperationException ();
-                        object result = array[head];
-                        array [head] = null;
-                        head = (head + 1) % array.Length;
-                        size--;
-                        return result;
-                }
-
-               void Grow () {
-                        int newc = array.Length * 2;
-                        object[] new_contents = new object[newc];
-                        array.CopyTo (new_contents, 0);
-                        array = new_contents;
-                        head = 0;
-                        tail = head + size;
-                }
+               {
+                       if (size < 1)
+                                       throw new InvalidOperationException ();
+                       object result = array[head];
+                       array [head] = null;
+                       head = (head + 1) % array.Length;
+                       size--;
+                       return result;
+               }
+
+               void Grow () 
+               {
+                       int newc = array.Length * 2;
+                       object[] new_contents = new object[newc];
+                       array.CopyTo (new_contents, 0);
+                       array = new_contents;
+                       head = 0;
+                       tail = head + size;
+               }
 
                public int Count {
                        get {
index 5c06c41ac2639922498a73828fd9acc353137067..36299db37d296d090cb5477c6a20fb8ee3745f46 100644 (file)
@@ -29,6 +29,7 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using System.Security;
 using System.Threading;
+using System.Threading.Tasks;
 
 namespace System.Windows.Threading {
 
@@ -90,6 +91,12 @@ namespace System.Windows.Threading {
                        throw new NotImplementedException ();
                }
 
+               public Task Task {
+                       get {
+                               throw new NotImplementedException();
+                       }
+               }
+
                public DispatcherOperationStatus Status {
                        get {
                                return status;
index 7d1668ca8381ba4009a12f9a5d06f987cad8776f..fba21dc3ce56b3a51a69c083fef85fc8fa16763c 100644 (file)
@@ -195,7 +195,7 @@ namespace System.Threading
                        lock (this) {
                                CheckDisposed ();
                        
-                               return (NativeEventCalls.ResetEvent_internal (Handle));
+                               return NativeEventCalls.ResetEvent (SafeWaitHandle);
                        }
                }
                
@@ -204,9 +204,23 @@ namespace System.Threading
                        lock (this) {
                                CheckDisposed ();
                        
-                               return (NativeEventCalls.SetEvent_internal (Handle));
+                               return NativeEventCalls.SetEvent (SafeWaitHandle);
                        }
                }
+
+               internal void CheckDisposed ()
+               {
+                       if (disposed)
+                               throw new ObjectDisposedException (GetType ().FullName);
+               }
+
+               bool disposed;
+               protected override void Dispose(bool explicitDisposing)
+               {
+                       base.Dispose (explicitDisposing);
+                       disposed = true;
+               }
+
 #if !NET_2_1
                public void SetAccessControl (EventWaitHandleSecurity eventSecurity)
                {
index 3a0c12361268f373c363f583bdfdb9b8eb6ebf96..b0320579bfa227ec3a8058fe50ab22774d6fbf6d 100644 (file)
@@ -33,6 +33,7 @@
 
 using System;
 using System.Runtime.CompilerServices;
+using Microsoft.Win32.SafeHandles;
 
 #if !MOBILE
 using System.Security.AccessControl;
@@ -46,11 +47,35 @@ namespace System.Threading
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public static extern IntPtr CreateEvent_internal(bool manual,bool initial,string name, out bool created);
 
+               public static bool SetEvent (SafeWaitHandle handle)
+               {
+                       bool release = false;
+                       try {
+                               handle.DangerousAddRef (ref release);
+                               return SetEvent_internal (handle.DangerousGetHandle ());
+                       } finally {
+                               if (release)
+                                       handle.DangerousRelease ();
+                       }
+               }
+
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               public static extern bool SetEvent_internal(IntPtr handle);
+               static extern bool SetEvent_internal(IntPtr handle);
+
+               public static bool ResetEvent (SafeWaitHandle handle)
+               {
+                       bool release = false;
+                       try {
+                               handle.DangerousAddRef (ref release);
+                               return ResetEvent_internal (handle.DangerousGetHandle ());
+                       } finally {
+                               if (release)
+                                       handle.DangerousRelease ();
+                       }
+               }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               public static extern bool ResetEvent_internal(IntPtr handle);
+               static extern bool ResetEvent_internal(IntPtr handle);
        
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public static extern void CloseEvent_internal (IntPtr handle);
index 1c8f4768d318aeb2ebb6f2eee416da7676e5fa15..960ecf6e7b857595371308d71456e4c2fe0dad93 100644 (file)
@@ -84,7 +84,7 @@ namespace System.Threading
                                lock (this) {
                                        _unregistered = true;
                                        if (_callsInProcess == 0 && _finalEvent != null)
-                                               NativeEventCalls.SetEvent_internal (_finalEvent.Handle);
+                                               NativeEventCalls.SetEvent (_finalEvent.SafeWaitHandle);
                                }
                        } catch (ObjectDisposedException) {
                                // Can happen if we called Unregister before we had time to execute Wait
@@ -108,7 +108,7 @@ namespace System.Threading
                        {
                                _callsInProcess--;
                                if (_unregistered && _callsInProcess == 0 && _finalEvent != null)
-                                       NativeEventCalls.SetEvent_internal (_finalEvent.Handle);
+                                       NativeEventCalls.SetEvent (_finalEvent.SafeWaitHandle);
                        }
                }
 
index 9efb484e3d85b6ec614f57c271d15f35eb8e96ff..d1546a8bfcaa80632664c766dd64e69f70977b22 100644 (file)
@@ -166,7 +166,7 @@ namespace System.Threading
                        if (notifyObject == null)
                                throw new ArgumentNullException ("notifyObject");
                        Dispose ();
-                       NativeEventCalls.SetEvent_internal (notifyObject.Handle);
+                       NativeEventCalls.SetEvent (notifyObject.SafeWaitHandle);
                        return true;
                }
 
index 5558efad52f46159fe85716d319e60902ec26eaa..019647bc0bd85170bb18b74ae176517b3f1b1ad9 100644 (file)
@@ -39,404 +39,100 @@ using System.Runtime.ConstrainedExecution;
 
 namespace System.Threading
 {
-       [ComVisible (true)]
        [StructLayout (LayoutKind.Sequential)]
-       public abstract class WaitHandle
+       public abstract partial class WaitHandle
                : MarshalByRefObject, IDisposable
        {
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private static extern bool WaitAll_internal(WaitHandle[] handles, int ms, bool exitContext);
-               
-               static void CheckArray (WaitHandle [] handles, bool waitAll)
-               {
-                       if (handles == null)
-                               throw new ArgumentNullException ("waitHandles");
-
-                       int length = handles.Length;
-                       if (length > 64)
-                               throw new NotSupportedException ("Too many handles");
-
-                       if (handles.Length == 0) {
-                               // MS throws different exceptions from the different methods.
-                               if (waitAll)
-                                       throw new ArgumentNullException ("waitHandles");
-                               else
-                                       throw new ArgumentException ();
-                       }
-
-#if false
-                       //
-                       // Although we should thrown an exception if this is an STA thread,
-                       // Mono does not know anything about STA threads, and just makes
-                       // things like Paint.NET not even possible to work.
-                       //
-                       // See bug #78455 for the bug this is supposed to fix. 
-                       // 
-                       if (waitAll && length > 1 && IsSTAThread)
-                               throw new NotSupportedException ("WaitAll for multiple handles is not allowed on an STA thread.");
-#endif
-                       foreach (WaitHandle w in handles) {
-                               if (w == null)
-                                       throw new ArgumentNullException ("waitHandles", "null handle");
-
-                               if (w.safe_wait_handle == null)
-                                       throw new ArgumentException ("null element found", "waitHandle");
-
-                       }
-               }
-#if false
-               // usage of property is commented - see above
-               static bool IsSTAThread {
-                       get {
-                               bool isSTA = Thread.CurrentThread.ApartmentState ==
-                                       ApartmentState.STA;
-
-                               // FIXME: remove this check after Thread.ApartmentState
-                               // has been properly implemented.
-                               if (!isSTA) {
-                                       Assembly asm = Assembly.GetEntryAssembly ();
-                                       if (asm != null)
-                                               isSTA = asm.EntryPoint.GetCustomAttributes (typeof (STAThreadAttribute), false).Length > 0;
-                               }
-
-                               return isSTA;
-                       }
-               }
-#endif
-               public static bool WaitAll(WaitHandle[] waitHandles)
-               {
-                       CheckArray (waitHandles, true);
-                       return(WaitAll_internal(waitHandles, Timeout.Infinite, false));
-               }
-
-               public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
-               {
-                       CheckArray (waitHandles, true);
-                       // check negative - except for -1 (which is Timeout.Infinite)
-                       if (millisecondsTimeout < Timeout.Infinite)
-                               throw new ArgumentOutOfRangeException ("millisecondsTimeout");
-
-                       try {
-                               if (exitContext) {
-#if MONOTOUCH
-                                       throw new NotSupportedException ("exitContext == true is not supported");
-#else
-                                       SynchronizationAttribute.ExitContext ();
-#endif
-                               }
-                               return(WaitAll_internal(waitHandles, millisecondsTimeout, false));
-                       }
-                       finally {
-                               if (exitContext) SynchronizationAttribute.EnterContext ();
-                       }
-               }
+               protected static readonly IntPtr InvalidHandle = (IntPtr) (-1);
 
-               public static bool WaitAll(WaitHandle[] waitHandles,
-                                          TimeSpan timeout,
-                                          bool exitContext)
+               static int WaitMultiple(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext, bool WaitAll)
                {
-                       CheckArray (waitHandles, true);
-                       long ms = (long) timeout.TotalMilliseconds;
-                       
-                       if (ms < -1 || ms > Int32.MaxValue)
-                               throw new ArgumentOutOfRangeException ("timeout");
-
-                       try {
-                               if (exitContext) {
 #if MONOTOUCH
-                                       throw new NotSupportedException ("exitContext == true is not supported");
-#else
-                                       SynchronizationAttribute.ExitContext ();
+                       if (exitContext)
+                               throw new NotSupportedException ("exitContext == true is not supported");
 #endif
-                               }
-                               return (WaitAll_internal (waitHandles, (int) ms, exitContext));
-                       }
-                       finally {
-                               if (exitContext) SynchronizationAttribute.EnterContext ();
-                       }
-               }
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private static extern int WaitAny_internal(WaitHandle[] handles, int ms, bool exitContext);
-
-               // LAMESPEC: Doesn't specify how to signal failures
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-               public static int WaitAny(WaitHandle[] waitHandles)
-               {
-                       CheckArray (waitHandles, false);
-                       return(WaitAny_internal(waitHandles, Timeout.Infinite, false));
-               }
-
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-               public static int WaitAny(WaitHandle[] waitHandles,
-                                         int millisecondsTimeout,
-                                         bool exitContext)
-               {
-                       CheckArray (waitHandles, false);
-                       // check negative - except for -1 (which is Timeout.Infinite)
-                       if (millisecondsTimeout < Timeout.Infinite)
-                               throw new ArgumentOutOfRangeException ("millisecondsTimeout");
+                       int release_last = -1;
 
                        try {
-                               if (exitContext) {
-#if MONOTOUCH
-                                       throw new NotSupportedException ("exitContext == true is not supported");
-#else
+                               if (exitContext)
                                        SynchronizationAttribute.ExitContext ();
-#endif
-                               }
-                               return(WaitAny_internal(waitHandles, millisecondsTimeout, exitContext));
-                       }
-                       finally {
-                               if (exitContext) SynchronizationAttribute.EnterContext ();
-                       }
-               }
-
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-               public static int WaitAny(WaitHandle[] waitHandles, TimeSpan timeout)
-               {
-                       return WaitAny (waitHandles, timeout, false);
-               }
-
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-               public static int WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout)
-               {
-                       return WaitAny (waitHandles, millisecondsTimeout, false);
-               }
 
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-               public static int WaitAny(WaitHandle[] waitHandles,
-                                         TimeSpan timeout, bool exitContext)
-               {
-                       CheckArray (waitHandles, false);
-                       long ms = (long) timeout.TotalMilliseconds;
-                       
-                       if (ms < -1 || ms > Int32.MaxValue)
-                               throw new ArgumentOutOfRangeException ("timeout");
-
-                       try {
-                               if (exitContext) {
-#if MONOTOUCH
-                                       throw new NotSupportedException ("exitContext == true is not supported");
-#else
-                                       SynchronizationAttribute.ExitContext ();
-#endif
+                               for (int i = 0; i < waitHandles.Length; ++i) {
+                                       try {
+                                       } finally {
+                                               /* we have to put it in a finally block, to avoid having a ThreadAbortException
+                                                * between the return from DangerousAddRef and the assignement to release_last */
+                                               bool release = false;
+                                               waitHandles [i].SafeWaitHandle.DangerousAddRef (ref release);
+                                               release_last = i;
+                                       }
                                }
-                               return (WaitAny_internal(waitHandles, (int) ms, exitContext));
-                       }
-                       finally {
-                               if (exitContext) SynchronizationAttribute.EnterContext ();
-                       }
-               }
-
-               protected WaitHandle()
-               {
-                       // FIXME
-               }
-
-               public virtual void Close ()
-               {
-                       Dispose(true);
-               }
-
-               public void Dispose ()
-               {
-                       Close ();
-               }
-
-               public const int WaitTimeout = 258;
 
-               //
-               // In 2.0 we use SafeWaitHandles instead of IntPtrs
-               //
-               SafeWaitHandle safe_wait_handle;
-
-               [Obsolete ("In the profiles > 2.x, use SafeHandle instead of Handle")]
-               public virtual IntPtr Handle {
-                       get {
-                               return safe_wait_handle.DangerousGetHandle ();
-                       }
-
-                       [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
-                       [SecurityPermission (SecurityAction.InheritanceDemand, UnmanagedCode = true)]
-                       set {
-                               if (value == InvalidHandle)
-                                       safe_wait_handle = new SafeWaitHandle (InvalidHandle, false);
+                               if (WaitAll)
+                                       return WaitAll_internal (waitHandles, millisecondsTimeout, exitContext);
                                else
-                                       safe_wait_handle = new SafeWaitHandle (value, true);
-                       }
-               }
-               
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private extern bool WaitOne_internal(IntPtr handle, int ms, bool exitContext);
-
-               protected virtual void Dispose (bool explicitDisposing)
-               {
-                       if (!disposed){
-
-                               //
-                               // This is only the case if the handle was never properly initialized
-                               // most likely a bug in the derived class
-                               //
-                               if (safe_wait_handle == null)
-                                       return;
-
-                               lock (this){
-                                       if (disposed)
-                                               return;
-
-                                       disposed = true;
-                                       if (safe_wait_handle != null)
-                                               safe_wait_handle.Dispose ();
+                                       return WaitAny_internal (waitHandles, millisecondsTimeout, exitContext);
+                       } finally {
+                               for (int i = release_last; i >= 0; --i) {
+                                       waitHandles [i].SafeWaitHandle.DangerousRelease ();
                                }
-                       }
-               }
-
-               public SafeWaitHandle SafeWaitHandle {
-                       [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
-                       get {
-                               return safe_wait_handle;
-                       }
 
-                       [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
-                       set {
-                               if (value == null)
-                                       safe_wait_handle = new SafeWaitHandle (InvalidHandle, false);
-                               else
-                                       safe_wait_handle = value;
+                               if (exitContext)
+                                       SynchronizationAttribute.EnterContext ();
                        }
                }
 
-               public static bool SignalAndWait (WaitHandle toSignal,
-                                                 WaitHandle toWaitOn)
-               {
-                       return SignalAndWait (toSignal, toWaitOn, -1, false);
-               }
-               
-               public static bool SignalAndWait (WaitHandle toSignal,
-                                                 WaitHandle toWaitOn,
-                                                 int millisecondsTimeout,
-                                                 bool exitContext)
-               {
-                       if (toSignal == null)
-                               throw new ArgumentNullException ("toSignal");
-                       if (toWaitOn == null)
-                               throw new ArgumentNullException ("toWaitOn");
-
-                       if (millisecondsTimeout < -1)
-                               throw new ArgumentOutOfRangeException ("millisecondsTimeout");
-
-                       return SignalAndWait_Internal (toSignal.Handle, toWaitOn.Handle, millisecondsTimeout, exitContext);
-               }
-               
-               public static bool SignalAndWait (WaitHandle toSignal,
-                                                 WaitHandle toWaitOn,
-                                                 TimeSpan timeout,
-                                                 bool exitContext)
-               {
-                       double ms = timeout.TotalMilliseconds;
-                       if (ms > Int32.MaxValue)
-                               throw new ArgumentOutOfRangeException ("timeout");
-
-                       return SignalAndWait (toSignal, toWaitOn, Convert.ToInt32 (ms), false);
-               }
-
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               static extern bool SignalAndWait_Internal (IntPtr toSignal, IntPtr toWaitOn, int ms, bool exitContext);
+               private static extern int WaitAll_internal(WaitHandle[] handles, int ms, bool exitContext);
 
-               public virtual bool WaitOne()
-               {
-                       CheckDisposed ();
-                       bool release = false;
-                       try {
-                               safe_wait_handle.DangerousAddRef (ref release);
-                               return (WaitOne_internal(safe_wait_handle.DangerousGetHandle (), Timeout.Infinite, false));
-                       } finally {
-                               if (release)
-                                       safe_wait_handle.DangerousRelease ();
-                       }
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               private static extern int WaitAny_internal(WaitHandle[] handles, int ms, bool exitContext);
 
-               public virtual bool WaitOne(int millisecondsTimeout, bool exitContext)
+               static int WaitOneNative (SafeHandle waitableSafeHandle, uint millisecondsTimeout, bool hasThreadAffinity, bool exitContext)
                {
-                       CheckDisposed ();
-                       // check negative - except for -1 (which is Timeout.Infinite)
-                       if (millisecondsTimeout < Timeout.Infinite)
-                               throw new ArgumentOutOfRangeException ("millisecondsTimeout");
+#if MONOTOUCH
+                       if (exitContext)
+                               throw new NotSupportedException ("exitContext == true is not supported");
+#endif
 
                        bool release = false;
                        try {
-                               if (exitContext) {
-#if !MONOTOUCH
-                                       SynchronizationAttribute.ExitContext ();
-#endif
-                               }
-                               safe_wait_handle.DangerousAddRef (ref release);
-                               return (WaitOne_internal(safe_wait_handle.DangerousGetHandle (), millisecondsTimeout, exitContext));
-                       } finally {
-#if !MONOTOUCH
                                if (exitContext)
-                                       SynchronizationAttribute.EnterContext ();
-#endif
-                               if (release)
-                                       safe_wait_handle.DangerousRelease ();
-                       }
-               }
+                                       SynchronizationAttribute.ExitContext ();
 
-               public virtual bool WaitOne (int millisecondsTimeout)
-               {
-                       return WaitOne (millisecondsTimeout, false);
-               }
+                               waitableSafeHandle.DangerousAddRef (ref release);
 
-               public virtual bool WaitOne (TimeSpan timeout)
-               {
-                       return WaitOne (timeout, false);
-               }
-
-               public virtual bool WaitOne(TimeSpan timeout, bool exitContext)
-               {
-                       CheckDisposed ();
-                       long ms = (long) timeout.TotalMilliseconds;
-                       if (ms < -1 || ms > Int32.MaxValue)
-                               throw new ArgumentOutOfRangeException ("timeout");
+                               return WaitOne_internal (waitableSafeHandle.DangerousGetHandle (), (int) millisecondsTimeout, exitContext);
+                       } finally {
+                               if (release)
+                                       waitableSafeHandle.DangerousRelease ();
 
-                       bool release = false;
-                       try {
-                               if (exitContext) {
-#if !MONOTOUCH
-                                       SynchronizationAttribute.ExitContext ();
-#endif
-                               }
-                               safe_wait_handle.DangerousAddRef (ref release);
-                               return (WaitOne_internal(safe_wait_handle.DangerousGetHandle (), (int) ms, exitContext));
-                       }
-                       finally {
-#if !MONOTOUCH
                                if (exitContext)
                                        SynchronizationAttribute.EnterContext ();
-#endif
-                               if (release)
-                                       safe_wait_handle.DangerousRelease ();
                        }
                }
 
-               internal void CheckDisposed ()
-               {
-                       if (disposed || safe_wait_handle == null)
-                               throw new ObjectDisposedException (GetType ().FullName);
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               static extern int WaitOne_internal(IntPtr handle, int ms, bool exitContext);
 
-               public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout)
+               static int SignalAndWaitOne (SafeWaitHandle waitHandleToSignal,SafeWaitHandle waitHandleToWaitOn, int millisecondsTimeout, bool hasThreadAffinity,  bool exitContext)
                {
-                       return WaitAll (waitHandles, millisecondsTimeout, false);
-               }
+                       bool releaseHandleToSignal = false, releaseHandleToWaitOn = false;
+                       try {
+                               waitHandleToSignal.DangerousAddRef (ref releaseHandleToSignal);
+                               waitHandleToWaitOn.DangerousAddRef (ref releaseHandleToWaitOn);
 
-               public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout)
-               {
-                       return WaitAll (waitHandles, timeout, false);
+                               return SignalAndWait_Internal (waitHandleToSignal.DangerousGetHandle (), waitHandleToWaitOn.DangerousGetHandle (), millisecondsTimeout, exitContext);
+                       } finally {
+                               if (releaseHandleToSignal)
+                                       waitHandleToSignal.DangerousRelease ();
+                               if (releaseHandleToWaitOn)
+                                       waitHandleToWaitOn.DangerousRelease ();
+                       }
                }
-               
-               protected static readonly IntPtr InvalidHandle = (IntPtr) (-1);
-               bool disposed = false;
+
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               static extern int SignalAndWait_Internal (IntPtr toSignal, IntPtr toWaitOn, int ms, bool exitContext);
        }
 }
index 126777e1923e663dd4ad2467e788782ac2956b07..70a4dea80df5d68f1a7de17fc2dfde0121e99606 100644 (file)
@@ -57,7 +57,7 @@ namespace System {
                 * of icalls, do not require an increment.
                 */
 #pragma warning disable 169
-               private const int mono_corlib_version = 142;
+               private const int mono_corlib_version = 143;
 #pragma warning restore 169
 
                [ComVisible (true)]
index 6c58234d892289e057d42de6fb13da888b6fc681..81675b16232b327fa9b2cd836eda14b6441f616e 100644 (file)
@@ -736,7 +736,8 @@ namespace System
 
                public TimeSpan GetUtcOffset (DateTimeOffset dateTimeOffset)
                {
-                       throw new NotImplementedException ();
+                       bool isDST;
+                       return GetUtcOffset (dateTimeOffset.UtcDateTime, out isDST);
                }
 
                private TimeSpan GetUtcOffset (DateTime dateTime, out bool isDST)
index 8a3ad3b76ab27956cfbdb42e9252afaa5a63cf19..cf35cfbc6a31cd5ed9c2a87c9b27821021320edf 100644 (file)
@@ -90,7 +90,7 @@ namespace MonoTests.System.Threading
                        SafeWaitHandle swh1 = are1.SafeWaitHandle;
                        are1.Handle = (IntPtr) (-1);
                        Assert.IsTrue (swh1 != are1.SafeWaitHandle, "#1");
-                       Assert.IsFalse (swh1.IsClosed, "#2");
+                       Assert.IsTrue (swh1.IsClosed, "#2"); // After testing on Windows/.NET, IsClosed returns true
                        Assert.IsFalse (swh1.IsInvalid, "#3");
                        Assert.IsFalse (are1.SafeWaitHandle.IsClosed, "#4");
                        Assert.IsTrue (are1.SafeWaitHandle.IsInvalid, "#5");
index e8990a6013944c01356c76d5fcc2148302a5920c..3bb464fe83d588485c10b81541e2bf52236748a8 100644 (file)
@@ -1121,7 +1121,33 @@ namespace MonoTests.System
                                Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d));
                                Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset (d.Add (new TimeSpan(0,0,0, 1))));
                        }
-               }
+
+                 [Test]
+                 public void  GetUtcOffset_FromDateTimeOffset ()
+                 {
+                         DateTimeOffset offset;
+
+                         offset = new DateTimeOffset(dst1Start, baseUtcOffset);
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, -1))), "dst1Start_with_baseUtcOffset#before");
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset), "dst1Start_with_baseUtcOffset#exact");
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, 1))), "dst1Start_with_baseUtcOffset#after");
+
+                         offset = new DateTimeOffset(dst1End, dstOffset + baseUtcOffset);
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, -1))), "dst1End_with_dstOffset+baseUtcOffset#before");
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset), "dst1End_with_dstOffset+baseUtcOffset#exact");
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, 1))), "dst1End_with_dstOffset+baseUtcOffset#after");
+
+                         offset = new DateTimeOffset(dst2Start, baseUtcOffset);
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, -1))), "dst2Start_with_baseUtcOffset#before");
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset), "dst2Start_with_baseUtcOffset#exact");
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, 1))), "dst2Start_with_baseUtcOffset#after");
+
+                         offset = new DateTimeOffset(dst2End, baseUtcOffset + dstOffset);
+                         Assert.AreEqual(dstUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, -1))), "dst2End_with_dstOffset+baseUtcOffset#before");
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset), "dst2End_with_dstOffset+baseUtcOffset#exact");
+                         Assert.AreEqual(baseUtcOffset, cairo.GetUtcOffset(offset.Add(new TimeSpan(0, 0, 0, 1))), "dst2End_with_dstOffset+baseUtcOffset#after");
+                 }
+    }
 
                [TestFixture]
                public class GetDaylightChanges
index 036771deee1793223602d7b69014693090bc617b..00cccc2c0234a20685989fae9df9400f49680be9 100644 (file)
@@ -1571,6 +1571,7 @@ ReferenceSources/SecurityContext.cs
 ../../../external/referencesource/mscorlib/system/threading/timeout.cs
 ../../../external/referencesource/mscorlib/system/threading/waithandlecannotbeopenedexception.cs
 ../../../external/referencesource/mscorlib/system/threading/threadpool.cs
+../../../external/referencesource/mscorlib/system/threading/waithandle.cs
 
 ../../../external/referencesource/mscorlib/system/threading/Tasks/AsyncCausalityTracer.cs
 ../../../external/referencesource/mscorlib/system/threading/Tasks/BeginEndAwaitableAdapter.cs
index ba3d0b8ef716e8ab969278bd6b46f7d3e872709b..118d89410e2efbb38ce56371da9b5012593e7e5a 100644 (file)
@@ -64,7 +64,7 @@ namespace MonoTests.Helpers
                        tcpListener = new TcpListener (ep);
                        tcpListener.Start ();
 
-                       listenTask = Task.Run (Listen);
+                       listenTask = Task.Run ((Action) Listen);
                }
 
                public void Dispose ()
index 7b092135a2b09601d4e7d20a7ed471aac6799ea7..16a67f4cbd9cb446147670c989887cef81f56c17 100644 (file)
@@ -1216,6 +1216,8 @@ namespace Mono.CSharp {
                        case "/highentropyva":
                        case "/highentropyva+":
                        case "/highentropyva-":
+                       case "/win32manifest":
+                       case "/nowin32manifest":
                                return ParseResult.Success;
 
                        default:
index 7a3936fd34b0b391e8705383f27b66576b5c9417..46c63cd9dfeff02e3431f06c12e0317b3b25f3be 100755 (executable)
@@ -353,10 +353,12 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
 
                        // The non-parallel part
                        byte [] buffer = new byte [8192];
+                       // everything other than a-zA-Z0-9_ needs to be escaped in asm symbols.
+                       var symbolEscapeRE = new System.Text.RegularExpressions.Regex ("[^\\w_]");
                        foreach (var url in files) {
                                string fname = LocateFile (new Uri (url).LocalPath);
                                string aname = Path.GetFileName (fname);
-                               string encoded = aname.Replace ("-", "_").Replace (".", "_");
+                               string encoded = symbolEscapeRE.Replace (aname, "_");
 
                                if (prog == null)
                                        prog = aname;
@@ -549,14 +551,15 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                        compilerArgs.Add(String.Format ("/I {0}", quote (include)));
 
                                if (!nomain || custom_main != null) {
-                                       compilerArgs.Add(temp_c);
-                                       compilerArgs.Add(temp_o);
+                                       compilerArgs.Add(quote(temp_c));
+                                       compilerArgs.Add(quote(temp_o));
                                        if (custom_main != null)
                                                compilerArgs.Add(quote(custom_main));
-                                       compilerArgs.Add(monoLib);
+                                       compilerArgs.Add(quote(monoLib));
                                        compilerArgs.Add("/link");
                                        compilerArgs.Add("/NODEFAULTLIB");
-                                       compilerArgs.Add("/SUBSYSTEM:CONSOLE");
+                                       compilerArgs.Add("/SUBSYSTEM:windows");
+                                       compilerArgs.Add("/ENTRY:mainCRTStartup");
                                        compilerArgs.AddRange(linkLibraries);
                                        compilerArgs.Add("/out:"+ output);
 
@@ -599,7 +602,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                                smonolib = "`pkg-config --variable=libdir mono-2`/libmono-2.0.a ";
                                        else
                                                smonolib = "-Wl,-Bstatic -lmono-2.0 -Wl,-Bdynamic ";
-                                       cmd = String.Format("{4} -o {2} -Wall `pkg-config --cflags mono-2` {0} {3} " +
+                                       cmd = String.Format("{4} -o '{2}' -Wall `pkg-config --cflags mono-2` {0} {3} " +
                                                "`pkg-config --libs-only-L mono-2` " + smonolib +
                                                "`pkg-config --libs-only-l mono-2 | sed -e \"s/\\-lmono-2.0 //\"` {1}",
                                                temp_c, temp_o, output, zlib, cc);
@@ -607,7 +610,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                else
                                {
 
-                                       cmd = String.Format("{4} " + debugging + " -o {2} -Wall {0} `pkg-config --cflags --libs mono-2` {3} {1}",
+                                       cmd = String.Format("{4} " + debugging + " -o '{2}' -Wall {0} `pkg-config --cflags --libs mono-2` {3} {1}",
                                                temp_c, temp_o, output, zlib, cc);
                                }
                                Execute (cmd);
index a593d26cacb2424519e084b1b1a1ccbd3b1bb47c..9242e8639fe4fc147608b82d559b3a6d7e62b28f 100755 (executable)
@@ -598,6 +598,12 @@ dump_table_method (MonoImage *m)
                sigblob = mono_metadata_blob_heap (m, cols [MONO_METHOD_SIGNATURE]);
                mono_metadata_decode_blob_size (sigblob, &sigblob);
                method = mono_metadata_parse_method_signature_full (m, method_container ? method_container : type_container, i, sigblob, &sigblob, &error);
+               if (!mono_error_ok (&error)) {
+                       fprintf (output,"%d: failed to parse due to %s\n", i, mono_error_get_message (&error));
+                       mono_error_cleanup (&error);
+                       continue;
+               }
+
                g_assert (mono_error_ok (&error)); /*FIXME don't swallow the error message*/
                sig = dis_stringify_method_signature (m, method, i, method_container ? method_container : type_container, FALSE);
                 impl_flags = get_method_impl_flags (cols [MONO_METHOD_IMPLFLAGS]);
index a5d3faae04c1d7acfd6cff44c0b6f3c94f088cb6..24df084d6e39865c3f8aaafcbd5a3467fd9cadae 100755 (executable)
@@ -1283,12 +1283,14 @@ get_type (MonoImage *m, const char *ptr, char **result, gboolean is_def, MonoGen
        case MONO_TYPE_VALUETYPE:
        case MONO_TYPE_CLASS: {
                guint32 token = mono_metadata_parse_typedef_or_ref (m, ptr, &ptr);
-               MonoClass *klass = mono_class_get (m, token);
+               MonoClass *klass = mono_class_get_checked (m, token, &error);
                char *temp;
-               if (klass)
+               if (klass) {
                        temp = dis_stringify_object_with_class (m, klass, TRUE, FALSE);
-               else
-                       temp = g_strdup_printf ("<BROKEN CLASS token_%8x>", token);
+               } else  {
+                       temp = g_strdup_printf ("<BROKEN CLASS token_%8x due to %s>", token, mono_error_get_message (&error));
+                       mono_error_cleanup (&error);
+               }
 
                if (show_tokens) {
                        *result = g_strdup_printf ("%s/*%08x*/", temp, token);
@@ -3180,7 +3182,7 @@ cant_print_generic_param_name (MonoGenericParam *gparam)
        container = mono_generic_param_owner (gparam);
        check_ambiguous_genparams (container);
        return (!container || (mono_generic_params_with_ambiguous_names &&
-                       g_hash_table_lookup (mono_generic_params_with_ambiguous_names, gparam)));
+                       g_hash_table_lookup (mono_generic_params_with_ambiguous_names, gparam)) || !mono_generic_param_info (gparam));
 }
 
 
index 385945f4301cbf99ef96da735e74c01b1d022c54..d54f84bd3242abb26c69473631f355fb4d1f5512 100644 (file)
@@ -2757,6 +2757,11 @@ process_wait (gpointer handle, guint32 timeout, gboolean alertable)
        if (!mp) {
                pid_t res;
 
+               if (pid == mono_process_current_pid ()) {
+                       MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on current process", __func__, handle, timeout);
+                       return WAIT_TIMEOUT;
+               }
+
                /* This path is used when calling Process.HasExited, so
                 * it is only used to poll the state of the process, not
                 * to actually wait on it to exit */
index 961ff53416584106dd9672445f82853a423e5c2d..226e0071784a78ae6c680f8688306f2dfbe67d4c 100644 (file)
@@ -80,7 +80,7 @@
  * Changes which are already detected at runtime, like the addition
  * of icalls, do not require an increment.
  */
-#define MONO_CORLIB_VERSION 142
+#define MONO_CORLIB_VERSION 143
 
 typedef struct
 {
@@ -118,6 +118,9 @@ get_shadow_assembly_location_base (MonoDomain *domain, MonoError *error);
 
 static MonoLoadFunc load_function = NULL;
 
+/* Lazy class loading functions */
+static GENERATE_GET_CLASS_WITH_CACHE (assembly, System.Reflection, Assembly)
+
 void
 mono_install_runtime_load (MonoLoadFunc func)
 {
@@ -256,11 +259,11 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT
 
        mono_thread_init (start_cb, attach_cb);
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
+       klass = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
        setup = (MonoAppDomainSetup *) mono_object_new_pinned (domain, klass, error);
        return_if_nok (error);
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomain");
+       klass = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomain");
 
        ad = (MonoAppDomain *) mono_object_new_pinned (domain, klass, error);
        return_if_nok (error);
@@ -306,7 +309,7 @@ mono_get_corlib_version (void)
        MonoClassField *field;
        MonoObject *value;
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System", "Environment");
+       klass = mono_class_load_from_name (mono_defaults.corlib, "System", "Environment");
        mono_class_init (klass);
        field = mono_class_get_field_from_name (klass, "mono_corlib_version");
        if (!field)
@@ -357,8 +360,7 @@ mono_context_init_checked (MonoDomain *domain, MonoError *error)
 
        mono_error_init (error);
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context");
-
+       klass = mono_class_load_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context");
        context = (MonoAppContext *) mono_object_new_pinned (domain, klass, error);
        return_if_nok (error);
 
@@ -427,7 +429,7 @@ mono_domain_create_appdomain (char *friendly_name, char *configuration_file)
        MonoAppDomainSetup *setup;
        MonoClass *klass;
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
+       klass = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
        setup = (MonoAppDomainSetup *) mono_object_new_checked (mono_domain_get (), klass, &error);
        mono_error_raise_exception (&error); /* FIXME don't raise here */
        setup->configuration_file = configuration_file != NULL ? mono_string_new (mono_domain_get (), configuration_file) : NULL;
@@ -467,7 +469,7 @@ copy_app_domain_setup (MonoDomain *domain, MonoAppDomainSetup *setup, MonoError
        mono_error_init (error);
 
        caller_domain = mono_domain_get ();
-       ads_class = mono_class_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
+       ads_class = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
 
        copy = (MonoAppDomainSetup*)mono_object_new_checked (domain, ads_class, error);
        return_val_if_nok (error, NULL);
@@ -510,7 +512,7 @@ mono_domain_create_appdomain_internal (char *friendly_name, MonoAppDomainSetup *
 
        mono_error_init (error);
 
-       adclass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomain");
+       adclass = mono_class_load_from_name (mono_defaults.corlib, "System", "AppDomain");
 
        /* FIXME: pin all those objects */
        data = mono_domain_create();
@@ -957,17 +959,12 @@ ves_icall_System_AppDomain_GetAssemblies (MonoAppDomain *ad, MonoBoolean refonly
        MonoError error;
        MonoDomain *domain = ad->data; 
        MonoAssembly* ass;
-       static MonoClass *System_Reflection_Assembly;
        MonoArray *res;
        GSList *tmp;
        int i;
        GPtrArray *assemblies;
 
        mono_error_init (&error);
-       
-       if (!System_Reflection_Assembly)
-               System_Reflection_Assembly = mono_class_from_name (
-                       mono_defaults.corlib, "System.Reflection", "Assembly");
 
        /* 
         * Make a copy of the list of assemblies because we can't hold the assemblies
@@ -986,7 +983,7 @@ ves_icall_System_AppDomain_GetAssemblies (MonoAppDomain *ad, MonoBoolean refonly
        }
        mono_domain_assemblies_unlock (domain);
 
-       res = mono_array_new (domain, System_Reflection_Assembly, assemblies->len);
+       res = mono_array_new (domain, mono_class_get_assembly_class (), assemblies->len);
        for (i = 0; i < assemblies->len; ++i) {
                ass = (MonoAssembly *)g_ptr_array_index (assemblies, i);
                MonoReflectionAssembly *ass_obj = mono_assembly_get_object_checked (domain, ass, &error);
index fde74b06b7a9248adc026b939471555d9c2a9ae8..20373d0afcf3463233868e0569d99db662f47c02 100644 (file)
@@ -193,6 +193,9 @@ static mono_mutex_t assembly_binding_mutex;
 /* Loaded assembly binding info */
 static GSList *loaded_assembly_bindings = NULL;
 
+/* Class lazy loading functions */
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (internals_visible, System.Runtime.CompilerServices, InternalsVisibleToAttribute)
+
 static MonoAssembly*
 mono_assembly_invoke_search_hook_internal (MonoAssemblyName *aname, MonoAssembly *requesting, gboolean refonly, gboolean postload);
 static MonoAssembly*
@@ -1684,7 +1687,7 @@ free_item (gpointer val, gpointer user_data)
  * names in custom attributes.
  *
  * This is an internal method, we need this because when we load mscorlib
- * we do not have the mono_defaults.internals_visible_class loaded yet,
+ * we do not have the internals visible cattr loaded yet,
  * so we need to load these after we initialize the runtime. 
  *
  * LOCKING: Acquires the assemblies lock plus the loader lock.
@@ -1724,7 +1727,7 @@ mono_assembly_load_friends (MonoAssembly* ass)
                MonoAssemblyName *aname;
                const gchar *data;
                /* Do some sanity checking */
-               if (!attr->ctor || attr->ctor->klass != mono_defaults.internals_visible_class)
+               if (!attr->ctor || attr->ctor->klass != mono_class_try_get_internals_visible_class ())
                        continue;
                if (attr->data_size < 4)
                        continue;
index 28a25a1f8f7c68f9a4011e80f355cf4926940a27..ffd9749f383f4165a80a0fb67d92349b0d41be16 100644 (file)
@@ -1147,16 +1147,12 @@ typedef struct {
        MonoClass *typed_reference_class;
        MonoClass *argumenthandle_class;
        MonoClass *monitor_class;
-       MonoClass *runtimesecurityframe_class;
-       MonoClass *executioncontext_class;
-       MonoClass *internals_visible_class;
        MonoClass *generic_ilist_class;
        MonoClass *generic_nullable_class;
-       MonoClass *safehandle_class;
        MonoClass *handleref_class;
        MonoClass *attribute_class;
        MonoClass *customattribute_data_class;
-       MonoClass *critical_finalizer_object;
+       MonoClass *critical_finalizer_object; /* MAYBE NULL */
        MonoClass *generic_ireadonlylist_class;
        MonoClass *threadpool_wait_callback_class;
        MonoMethod *threadpool_perform_wait_callback_method;
@@ -1182,6 +1178,9 @@ mono_install_remoting_trampoline (MonoRemotingTrampoline func);
 #define GENERATE_GET_CLASS_WITH_CACHE_DECL(shortname) \
 MonoClass* mono_class_get_##shortname##_class (void);
 
+#define GENERATE_TRY_GET_CLASS_WITH_CACHE_DECL(shortname) \
+MonoClass* mono_class_try_get_##shortname##_class (void);
+
 #define GENERATE_GET_CLASS_WITH_CACHE(shortname,namespace,name) \
 MonoClass*     \
 mono_class_get_##shortname##_class (void)      \
@@ -1189,17 +1188,31 @@ mono_class_get_##shortname##_class (void)       \
        static MonoClass *tmp_class;    \
        MonoClass *klass = tmp_class;   \
        if (!klass) {   \
-               klass = mono_class_from_name (mono_defaults.corlib, #namespace, #name); \
-               g_assert (klass);       \
+               klass = mono_class_load_from_name (mono_defaults.corlib, #namespace, #name);    \
                mono_memory_barrier (); \
                tmp_class = klass;      \
        }       \
        return klass;   \
 }
 
-#define GENERATE_STATIC_GET_CLASS_WITH_CACHE(shortname,namespace,name) \
-static GENERATE_GET_CLASS_WITH_CACHE (shortname,namespace,name)
+#define GENERATE_TRY_GET_CLASS_WITH_CACHE(shortname,namespace,name) \
+MonoClass*     \
+mono_class_try_get_##shortname##_class (void)  \
+{      \
+       static volatile MonoClass *tmp_class;   \
+       static volatile gboolean inited;        \
+       MonoClass *klass = (MonoClass *)tmp_class;      \
+       mono_memory_barrier (); \
+       if (!inited) {  \
+               klass = mono_class_try_load_from_name (mono_defaults.corlib, #namespace, #name);        \
+               tmp_class = klass;      \
+               mono_memory_barrier (); \
+               inited = TRUE;  \
+       }       \
+       return klass;   \
+}
 
+GENERATE_TRY_GET_CLASS_WITH_CACHE_DECL (safehandle)
 
 #ifndef DISABLE_COM
 
@@ -1477,4 +1490,10 @@ get_image_for_generic_param (MonoGenericParam *param);
 char *
 make_generic_name_string (MonoImage *image, int num);
 
+MonoClass *
+mono_class_load_from_name (MonoImage *image, const char* name_space, const char *name);
+
+MonoClass*
+mono_class_try_load_from_name (MonoImage *image, const char* name_space, const char *name);
+
 #endif /* __MONO_METADATA_CLASS_INTERNALS_H__ */
index 983f1ca4149d90e78ab62646b4c9983b3d2a415d..8648223d8a93b4d1f90623c1f6de9fdaedddf57a 100644 (file)
@@ -3102,15 +3102,15 @@ get_implicit_generic_array_interfaces (MonoClass *klass, int *num, int *is_enume
        all_interfaces = eclass->rank && eclass->element_class->rank? FALSE: TRUE;
 
        if (!generic_icollection_class) {
-               generic_icollection_class = mono_class_from_name (mono_defaults.corlib,
+               generic_icollection_class = mono_class_load_from_name (mono_defaults.corlib,
                        "System.Collections.Generic", "ICollection`1");
-               generic_ienumerable_class = mono_class_from_name (mono_defaults.corlib,
+               generic_ienumerable_class = mono_class_load_from_name (mono_defaults.corlib,
                        "System.Collections.Generic", "IEnumerable`1");
-               generic_ienumerator_class = mono_class_from_name (mono_defaults.corlib,
+               generic_ienumerator_class = mono_class_load_from_name (mono_defaults.corlib,
                        "System.Collections.Generic", "IEnumerator`1");
-               generic_ireadonlylist_class = mono_class_from_name (mono_defaults.corlib,
+               generic_ireadonlylist_class = mono_class_load_from_name (mono_defaults.corlib,
                        "System.Collections.Generic", "IReadOnlyList`1");
-               generic_ireadonlycollection_class = mono_class_from_name (mono_defaults.corlib,
+               generic_ireadonlycollection_class = mono_class_load_from_name (mono_defaults.corlib,
                        "System.Collections.Generic", "IReadOnlyCollection`1");
        }
 
@@ -6217,7 +6217,7 @@ make_generic_param_class (MonoGenericParam *param, MonoGenericParamInfo *pinfo)
                CHECKED_METADATA_WRITE_PTR ( klass->parent , pinfo->constraints [0] );
                pos++;
        } else if (pinfo && pinfo->flags & GENERIC_PARAMETER_ATTRIBUTE_VALUE_TYPE_CONSTRAINT) {
-               CHECKED_METADATA_WRITE_PTR ( klass->parent , mono_class_from_name (mono_defaults.corlib, "System", "ValueType") );
+               CHECKED_METADATA_WRITE_PTR ( klass->parent , mono_class_load_from_name (mono_defaults.corlib, "System", "ValueType") );
        } else {
                CHECKED_METADATA_WRITE_PTR ( klass->parent , mono_defaults.object_class );
        }
@@ -6743,7 +6743,7 @@ mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
 
        /* for the building corlib use System.Array from it */
        if (image->assembly && assembly_is_dynamic (image->assembly) && image->assembly_name && strcmp (image->assembly_name, "mscorlib") == 0) {
-               parent = mono_class_from_name (image, "System", "Array");
+               parent = mono_class_load_from_name (image, "System", "Array");
                corlib_type = TRUE;
        } else {
                parent = mono_defaults.array_class;
@@ -7836,13 +7836,15 @@ return_nested_in (MonoClass *klass, char *nested)
 }
 
 static MonoClass*
-search_modules (MonoImage *image, const char *name_space, const char *name)
+search_modules (MonoImage *image, const char *name_space, const char *name, MonoError *error)
 {
        MonoTableInfo *file_table = &image->tables [MONO_TABLE_FILE];
        MonoImage *file_image;
        MonoClass *klass;
        int i;
 
+       mono_error_init (error);
+
        /* 
         * The EXPORTEDTYPES table only contains public types, so have to search the
         * modules as well.
@@ -7857,8 +7859,8 @@ search_modules (MonoImage *image, const char *name_space, const char *name)
 
                file_image = mono_image_load_file_for_image (image, i + 1);
                if (file_image) {
-                       klass = mono_class_from_name (file_image, name_space, name);
-                       if (klass)
+                       klass = mono_class_from_name_checked (file_image, name_space, name, error);
+                       if (klass || !is_ok (error))
                                return klass;
                }
        }
@@ -7867,7 +7869,7 @@ search_modules (MonoImage *image, const char *name_space, const char *name)
 }
 
 static MonoClass *
-mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, const char *name, MonoError *error, GHashTable* visited_images)
+mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, const char *name, GHashTable* visited_images, MonoError *error)
 {
        GHashTable *nspace_table;
        MonoImage *loaded_image;
@@ -7900,8 +7902,11 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
        if (get_class_from_name && image->tables [MONO_TABLE_EXPORTEDTYPE].rows == 0) {
                gboolean res = get_class_from_name (image, name_space, name, &klass);
                if (res) {
-                       if (!klass)
-                               klass = search_modules (image, name_space, name);
+                       if (!klass) {
+                               klass = search_modules (image, name_space, name, error);
+                               if (!is_ok (error))
+                                       return NULL;
+                       }
                        if (nested)
                                return klass ? return_nested_in (klass, nested) : NULL;
                        else
@@ -7924,15 +7929,15 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
                for (i = 0; i < image->module_count; ++i) {
                        MonoImage *module = image->modules [i];
 
-                       klass = mono_class_from_name (module, name_space, name);
-                       if (klass)
+                       klass = mono_class_from_name_checked (module, name_space, name, error);
+                       if (klass || !is_ok (error))
                                return klass;
                }
        }
 
        if (!token) {
-               klass = search_modules (image, name_space, name);
-               if (klass)
+               klass = search_modules (image, name_space, name, error);
+               if (klass || !is_ok (error))
                        return klass;
        }
 
@@ -7953,7 +7958,7 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
                        loaded_image = mono_assembly_load_module (image->assembly, impl >> MONO_IMPLEMENTATION_BITS);
                        if (!loaded_image)
                                return NULL;
-                       klass = mono_class_from_name_checked_aux (loaded_image, name_space, name, error, visited_images);
+                       klass = mono_class_from_name_checked_aux (loaded_image, name_space, name, visited_images, error);
                        if (nested)
                                return klass ? return_nested_in (klass, nested) : NULL;
                        return klass;
@@ -7966,9 +7971,9 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
                        g_assert (image->references [assembly_idx - 1]);
                        if (image->references [assembly_idx - 1] == (gpointer)-1)
                                return NULL;                    
-                       klass = mono_class_from_name_checked_aux (image->references [assembly_idx - 1]->image, name_space, name, error, visited_images);
+                       klass = mono_class_from_name_checked_aux (image->references [assembly_idx - 1]->image, name_space, name, visited_images, error);
                        if (nested)
-                               return return_nested_in (klass, nested);
+                               return klass ? return_nested_in (klass, nested) : NULL;
                        return klass;
                } else {
                        g_assert_not_reached ();
@@ -7983,6 +7988,18 @@ mono_class_from_name_checked_aux (MonoImage *image, const char* name_space, cons
        return klass;
 }
 
+/**
+ * mono_class_from_name_checked:
+ * @image: The MonoImage where the type is looked up in
+ * @name_space: the type namespace
+ * @name: the type short name.
+ *
+ * Obtains a MonoClass with a given namespace and a given name which
+ * is located in the given MonoImage.
+ *
+ * Works like mono_class_from_name, but error handling is tricky. It can return NULL and have no error
+ * set if the class was not found or it will return NULL and set the error if there was a loading error.
+ */
 MonoClass *
 mono_class_from_name_checked (MonoImage *image, const char* name_space, const char *name, MonoError *error)
 {
@@ -7991,7 +8008,7 @@ mono_class_from_name_checked (MonoImage *image, const char* name_space, const ch
 
        visited_images = g_hash_table_new (g_direct_hash, g_direct_equal);
 
-       klass = mono_class_from_name_checked_aux (image, name_space, name, error, visited_images);
+       klass = mono_class_from_name_checked_aux (image, name_space, name, visited_images, error);
 
        g_hash_table_destroy (visited_images);
 
@@ -8025,6 +8042,56 @@ mono_class_from_name (MonoImage *image, const char* name_space, const char *name
        return klass;
 }
 
+/**
+ * mono_class_load_from_name:
+ * @image: The MonoImage where the type is looked up in
+ * @name_space: the type namespace
+ * @name: the type short name.
+ *
+ * This function works exactly like mono_class_from_name but it will abort if the class is not found.
+ * This function should be used by the runtime for critical types to which there's no way to recover but crash
+ * If they are missing. Thing of System.Object or System.String.
+ */
+MonoClass *
+mono_class_load_from_name (MonoImage *image, const char* name_space, const char *name)
+{
+       MonoError error;
+       MonoClass *klass;
+
+       klass = mono_class_from_name_checked (image, name_space, name, &error);
+       if (!klass)
+               g_error ("Runtime critical type %s.%s not found", name_space, name);
+       if (!mono_error_ok (&error))
+               g_error ("Could not load runtime critical type %s.%s due to %s", name_space, name, mono_error_get_message (&error));
+       return klass;
+}
+
+/**
+ * mono_class_try_load_from_name:
+ * @image: The MonoImage where the type is looked up in
+ * @name_space: the type namespace
+ * @name: the type short name.
+ *
+ * This function tries to load a type, returning the class was found or NULL otherwise.
+ * This function should be used by the runtime when probing for optional types, those that could have being linked out.
+ *
+ * Big design consideration. This function aborts if there was an error loading the type. This prevents us from missing
+ * a type that we would otherwise assume to be available but was not due some error.
+ *
+ */
+MonoClass*
+mono_class_try_load_from_name (MonoImage *image, const char* name_space, const char *name)
+{
+       MonoError error;
+       MonoClass *klass;
+
+       klass = mono_class_from_name_checked (image, name_space, name, &error);
+       if (!mono_error_ok (&error))
+               g_error ("Could not load runtime critical type %s.%s due to %s", name_space, name, mono_error_get_message (&error));
+       return klass;
+}
+
+
 /**
  * mono_class_is_subclass_of:
  * @klass: class to probe if it is a subclass of another one
@@ -10813,3 +10880,5 @@ mono_class_full_name (MonoClass *klass)
        return mono_type_full_name (&klass->byval_arg);
 }
 
+/* Declare all shared lazy type lookup functions */
+GENERATE_TRY_GET_CLASS_WITH_CACHE (safehandle, System.Runtime.InteropServices, SafeHandle)
index d9f315139b123d26407ec1d7b443270fb842fe27..3b5ca560b7939f3d9949ced2665018c2afdfc396 100644 (file)
@@ -26,10 +26,10 @@ mono_class_init            (MonoClass *klass);
 MONO_API MonoVTable *
 mono_class_vtable          (MonoDomain *domain, MonoClass *klass);
 
-MONO_API MonoClass *
+MONO_RT_EXTERNAL_ONLY MONO_API MonoClass *
 mono_class_from_name       (MonoImage *image, const char* name_space, const char *name);
 
-MONO_API MonoClass *
+MONO_RT_EXTERNAL_ONLY MONO_API MonoClass *
 mono_class_from_name_case  (MonoImage *image, const char* name_space, const char *name);
 
 MONO_API MonoMethod *
index 94a120360888dac2e17c2755809365f6b9fe2391..8d3f714f7a9cbc059fa975c1afa241416f7a7e28 100644 (file)
@@ -95,6 +95,10 @@ GENERATE_GET_CLASS_WITH_CACHE (iunknown,      Mono.Interop, IUnknown)
 GENERATE_GET_CLASS_WITH_CACHE (com_object, System, __ComObject)
 GENERATE_GET_CLASS_WITH_CACHE (variant,    System, Variant)
 
+static GENERATE_GET_CLASS_WITH_CACHE (interface_type_attribute, System.Runtime.InteropServices, InterfaceTypeAttribute)
+static GENERATE_GET_CLASS_WITH_CACHE (guid_attribute, System.Runtime.InteropServices, GuidAttribute)
+static GENERATE_GET_CLASS_WITH_CACHE (com_visible_attribute, System.Runtime.InteropServices, ComVisibleAttribute)
+
 /* Upon creation of a CCW, only allocate a weak handle and set the
  * reference count to 0. If the unmanaged client code decides to addref and
  * hold onto the CCW, I then allocate a strong handle. Once the reference count
@@ -177,7 +181,7 @@ mono_class_try_get_com_object_class (void)
        static gboolean inited;
        MonoClass *klass;
        if (!inited) {
-               klass = mono_class_from_name (mono_defaults.corlib, "System", "__ComObject");
+               klass = mono_class_load_from_name (mono_defaults.corlib, "System", "__ComObject");
                mono_memory_barrier ();
                tmp_class = klass;
                mono_memory_barrier ();
@@ -296,16 +300,13 @@ cominterop_object_is_rcw (MonoObject *obj)
 static int
 cominterop_get_com_slot_begin (MonoClass* klass)
 {
-       static MonoClass *interface_type_attribute = NULL;
        MonoCustomAttrInfo *cinfo = NULL;
        MonoInterfaceTypeAttribute* itf_attr = NULL; 
 
-       if (!interface_type_attribute)
-               interface_type_attribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "InterfaceTypeAttribute");
        cinfo = mono_custom_attrs_from_class (klass);
        if (cinfo) {
                MonoError error;
-               itf_attr = (MonoInterfaceTypeAttribute*)mono_custom_attrs_get_attr_checked (cinfo, interface_type_attribute, &error);
+               itf_attr = (MonoInterfaceTypeAttribute*)mono_custom_attrs_get_attr_checked (cinfo, mono_class_get_interface_type_attribute_class (), &error);
                g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
                if (!cinfo->cached)
                        mono_custom_attrs_free (cinfo);
@@ -404,17 +405,12 @@ cominterop_mono_string_to_guid (MonoString* string, guint8 *guid);
 static gboolean
 cominterop_class_guid (MonoClass* klass, guint8* guid)
 {
-       static MonoClass *GuidAttribute = NULL;
        MonoCustomAttrInfo *cinfo;
 
-       /* Handle the GuidAttribute */
-       if (!GuidAttribute)
-               GuidAttribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "GuidAttribute");
-
        cinfo = mono_custom_attrs_from_class (klass);   
        if (cinfo) {
                MonoError error;
-               MonoReflectionGuidAttribute *attr = (MonoReflectionGuidAttribute*)mono_custom_attrs_get_attr_checked (cinfo, GuidAttribute, &error);
+               MonoReflectionGuidAttribute *attr = (MonoReflectionGuidAttribute*)mono_custom_attrs_get_attr_checked (cinfo, mono_class_get_guid_attribute_class (), &error);
                g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
 
                if (!attr)
@@ -431,20 +427,15 @@ cominterop_class_guid (MonoClass* klass, guint8* guid)
 static gboolean
 cominterop_com_visible (MonoClass* klass)
 {
-       static MonoClass *ComVisibleAttribute = NULL;
        MonoError error;
        MonoCustomAttrInfo *cinfo;
        GPtrArray *ifaces;
        MonoBoolean visible = 1;
 
-       /* Handle the ComVisibleAttribute */
-       if (!ComVisibleAttribute)
-               ComVisibleAttribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "ComVisibleAttribute");
-
        cinfo = mono_custom_attrs_from_class (klass);
        if (cinfo) {
                MonoError error;
-               MonoReflectionComVisibleAttribute *attr = (MonoReflectionComVisibleAttribute*)mono_custom_attrs_get_attr_checked (cinfo, ComVisibleAttribute, &error);
+               MonoReflectionComVisibleAttribute *attr = (MonoReflectionComVisibleAttribute*)mono_custom_attrs_get_attr_checked (cinfo, mono_class_get_guid_attribute_class (), &error);
                g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
 
                if (attr)
@@ -618,7 +609,6 @@ mono_cominterop_emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type,
        case MONO_MARSHAL_CONV_OBJECT_INTERFACE:
        case MONO_MARSHAL_CONV_OBJECT_IUNKNOWN:
        case MONO_MARSHAL_CONV_OBJECT_IDISPATCH: {
-               static MonoClass* com_interop_proxy_class = NULL;
                static MonoMethod* com_interop_proxy_get_proxy = NULL;
                static MonoMethod* get_transparent_proxy = NULL;
                guint32 pos_null = 0, pos_ccw = 0, pos_end = 0;
@@ -643,16 +633,14 @@ mono_cominterop_emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type,
                mono_mb_emit_icall (mb, cominterop_get_ccw_object);
                pos_ccw = mono_mb_emit_short_branch (mb, CEE_BRTRUE_S);
 
-               if (!com_interop_proxy_class)
-                       com_interop_proxy_class = mono_class_from_name (mono_defaults.corlib, "Mono.Interop", "ComInteropProxy");
                if (!com_interop_proxy_get_proxy)
-                       com_interop_proxy_get_proxy = mono_class_get_method_from_name_flags (com_interop_proxy_class, "GetProxy", 2, METHOD_ATTRIBUTE_PRIVATE);
+                       com_interop_proxy_get_proxy = mono_class_get_method_from_name_flags (mono_class_get_interop_proxy_class (), "GetProxy", 2, METHOD_ATTRIBUTE_PRIVATE);
 #ifndef DISABLE_REMOTING
                if (!get_transparent_proxy)
                        get_transparent_proxy = mono_class_get_method_from_name (mono_defaults.real_proxy_class, "GetTransparentProxy", 0);
 #endif
 
-               mono_mb_add_local (mb, &com_interop_proxy_class->byval_arg);
+               mono_mb_add_local (mb, &mono_class_get_interop_proxy_class ()->byval_arg);
 
                mono_mb_emit_ldloc (mb, 0);
                mono_mb_emit_byte (mb, CEE_LDIND_I);
@@ -1054,13 +1042,10 @@ mono_cominterop_get_invoke (MonoMethod *method)
        }
 
        if (!strcmp(method->name, ".ctor"))     {
-               static MonoClass *com_interop_proxy_class = NULL;
                static MonoMethod *cache_proxy = NULL;
 
-               if (!com_interop_proxy_class)
-                       com_interop_proxy_class = mono_class_from_name (mono_defaults.corlib, "Mono.Interop", "ComInteropProxy");
                if (!cache_proxy)
-                       cache_proxy = mono_class_get_method_from_name (com_interop_proxy_class, "CacheProxy", 0);
+                       cache_proxy = mono_class_get_method_from_name (mono_class_get_interop_proxy_class (), "CacheProxy", 0);
 
                mono_mb_emit_ldarg (mb, 0);
                mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp));
@@ -1925,7 +1910,7 @@ cominterop_get_ccw (MonoObject* object, MonoClass* itf)
        if (cinfo) {
                static MonoClass* coclass_attribute = NULL;
                if (!coclass_attribute)
-                       coclass_attribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "CoClassAttribute");
+                       coclass_attribute = mono_class_load_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "CoClassAttribute");
                if (mono_custom_attrs_has_attr (cinfo, coclass_attribute)) {
                        g_assert(itf->interface_count && itf->interfaces[0]);
                        itf = itf->interfaces[0];
@@ -2469,7 +2454,7 @@ cominterop_ccw_get_ids_of_names (MonoCCWInterface* ccwe, gpointer riid,
 
        /* Handle DispIdAttribute */
        if (!ComDispIdAttribute)
-               ComDispIdAttribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "DispIdAttribute");
+               ComDispIdAttribute = mono_class_load_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "DispIdAttribute");
 
        g_assert (object);
        klass = mono_object_class (object);
index 5a4d518c230720b5e985d3ea1d34edbb2dc5f7ab..f2105335356944ebf260012c0a1a2434e74047be 100644 (file)
@@ -231,7 +231,7 @@ do_console_cancel_event (void)
        if (!domain->domain)
                return;
 
-       klass = mono_class_from_name (mono_defaults.corlib, "System", "Console");
+       klass = mono_class_try_load_from_name (mono_defaults.corlib, "System", "Console");
        if (klass == NULL)
                return;
 
index 86c3965365fe1a2ce97b98f12231109cbd479971..df32fb052af36efea073cd66d1d8e8f79a327a92 100644 (file)
@@ -538,7 +538,7 @@ mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image)
        }
 
        if (desc->name_space && desc->klass) {
-               klass = mono_class_from_name (image, desc->name_space, desc->klass);
+               klass = mono_class_try_load_from_name (image, desc->name_space, desc->klass);
                if (!klass)
                        return NULL;
                return mono_method_desc_search_in_class (desc, klass);
index e8f5dfc13bc3e069a9dd57a76542caff76b99e6a..9f2d9fbd81433be9d715311d2d995efc214b61c4 100644 (file)
@@ -624,258 +624,184 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
        }
        mono_defaults.corlib = mono_assembly_get_image (ass);
 
-       mono_defaults.object_class = mono_class_from_name (
+       mono_defaults.object_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Object");
-       g_assert (mono_defaults.object_class != 0);
 
-       mono_defaults.void_class = mono_class_from_name (
+       mono_defaults.void_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Void");
-       g_assert (mono_defaults.void_class != 0);
 
-       mono_defaults.boolean_class = mono_class_from_name (
+       mono_defaults.boolean_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Boolean");
-       g_assert (mono_defaults.boolean_class != 0);
 
-       mono_defaults.byte_class = mono_class_from_name (
+       mono_defaults.byte_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Byte");
-       g_assert (mono_defaults.byte_class != 0);
 
-       mono_defaults.sbyte_class = mono_class_from_name (
+       mono_defaults.sbyte_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "SByte");
-       g_assert (mono_defaults.sbyte_class != 0);
 
-       mono_defaults.int16_class = mono_class_from_name (
+       mono_defaults.int16_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Int16");
-       g_assert (mono_defaults.int16_class != 0);
 
-       mono_defaults.uint16_class = mono_class_from_name (
+       mono_defaults.uint16_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "UInt16");
-       g_assert (mono_defaults.uint16_class != 0);
 
-       mono_defaults.int32_class = mono_class_from_name (
+       mono_defaults.int32_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Int32");
-       g_assert (mono_defaults.int32_class != 0);
 
-       mono_defaults.uint32_class = mono_class_from_name (
+       mono_defaults.uint32_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "UInt32");
-       g_assert (mono_defaults.uint32_class != 0);
 
-       mono_defaults.uint_class = mono_class_from_name (
+       mono_defaults.uint_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "UIntPtr");
-       g_assert (mono_defaults.uint_class != 0);
 
-       mono_defaults.int_class = mono_class_from_name (
+       mono_defaults.int_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "IntPtr");
-       g_assert (mono_defaults.int_class != 0);
 
-       mono_defaults.int64_class = mono_class_from_name (
+       mono_defaults.int64_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Int64");
-       g_assert (mono_defaults.int64_class != 0);
 
-       mono_defaults.uint64_class = mono_class_from_name (
+       mono_defaults.uint64_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "UInt64");
-       g_assert (mono_defaults.uint64_class != 0);
 
-       mono_defaults.single_class = mono_class_from_name (
+       mono_defaults.single_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Single");
-       g_assert (mono_defaults.single_class != 0);
 
-       mono_defaults.double_class = mono_class_from_name (
+       mono_defaults.double_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Double");
-       g_assert (mono_defaults.double_class != 0);
 
-       mono_defaults.char_class = mono_class_from_name (
+       mono_defaults.char_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Char");
-       g_assert (mono_defaults.char_class != 0);
 
-       mono_defaults.string_class = mono_class_from_name (
+       mono_defaults.string_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "String");
-       g_assert (mono_defaults.string_class != 0);
 
-       mono_defaults.enum_class = mono_class_from_name (
+       mono_defaults.enum_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Enum");
-       g_assert (mono_defaults.enum_class != 0);
 
-       mono_defaults.array_class = mono_class_from_name (
+       mono_defaults.array_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Array");
-       g_assert (mono_defaults.array_class != 0);
 
-       mono_defaults.delegate_class = mono_class_from_name (
+       mono_defaults.delegate_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "Delegate");
-       g_assert (mono_defaults.delegate_class != 0 );
 
-       mono_defaults.multicastdelegate_class = mono_class_from_name (
+       mono_defaults.multicastdelegate_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "MulticastDelegate");
-       g_assert (mono_defaults.multicastdelegate_class != 0 );
 
-       mono_defaults.asyncresult_class = mono_class_from_name (
+       mono_defaults.asyncresult_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Runtime.Remoting.Messaging", 
                "AsyncResult");
-       g_assert (mono_defaults.asyncresult_class != 0 );
 
-       mono_defaults.manualresetevent_class = mono_class_from_name (
+       mono_defaults.manualresetevent_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Threading", "ManualResetEvent");
-       g_assert (mono_defaults.manualresetevent_class != 0 );
 
-       mono_defaults.typehandle_class = mono_class_from_name (
+       mono_defaults.typehandle_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "RuntimeTypeHandle");
-       g_assert (mono_defaults.typehandle_class != 0);
 
-       mono_defaults.methodhandle_class = mono_class_from_name (
+       mono_defaults.methodhandle_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "RuntimeMethodHandle");
-       g_assert (mono_defaults.methodhandle_class != 0);
 
-       mono_defaults.fieldhandle_class = mono_class_from_name (
+       mono_defaults.fieldhandle_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "RuntimeFieldHandle");
-       g_assert (mono_defaults.fieldhandle_class != 0);
 
-       mono_defaults.systemtype_class = mono_class_from_name (
+       mono_defaults.systemtype_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Type");
-       g_assert (mono_defaults.systemtype_class != 0);
 
-       mono_defaults.monotype_class = mono_class_from_name (
+       mono_defaults.monotype_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "MonoType");
-       g_assert (mono_defaults.monotype_class != 0);
 
-       mono_defaults.runtimetype_class = mono_class_from_name (
+       mono_defaults.runtimetype_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "RuntimeType");
-       g_assert (mono_defaults.runtimetype_class != 0);
 
-       mono_defaults.exception_class = mono_class_from_name (
+       mono_defaults.exception_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "Exception");
-       g_assert (mono_defaults.exception_class != 0);
 
-       mono_defaults.threadabortexception_class = mono_class_from_name (
+       mono_defaults.threadabortexception_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Threading", "ThreadAbortException");
-       g_assert (mono_defaults.threadabortexception_class != 0);
 
-       mono_defaults.thread_class = mono_class_from_name (
+       mono_defaults.thread_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Threading", "Thread");
-       g_assert (mono_defaults.thread_class != 0);
 
-       mono_defaults.internal_thread_class = mono_class_from_name (
+       mono_defaults.internal_thread_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Threading", "InternalThread");
-       if (!mono_defaults.internal_thread_class) {
-               /* This can happen with an old mscorlib */
-               fprintf (stderr, "Corlib too old for this runtime.\n");
-               fprintf (stderr, "Loaded from: %s\n",
-                                mono_defaults.corlib? mono_image_get_filename (mono_defaults.corlib): "unknown");
-               exit (1);
-       }
 
-       mono_defaults.appdomain_class = mono_class_from_name (
+       mono_defaults.appdomain_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System", "AppDomain");
-       g_assert (mono_defaults.appdomain_class != 0);
 
 #ifndef DISABLE_REMOTING
-       mono_defaults.transparent_proxy_class = mono_class_from_name (
+       mono_defaults.transparent_proxy_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Runtime.Remoting.Proxies", "TransparentProxy");
-       g_assert (mono_defaults.transparent_proxy_class != 0);
 
-       mono_defaults.real_proxy_class = mono_class_from_name (
+       mono_defaults.real_proxy_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Runtime.Remoting.Proxies", "RealProxy");
-       g_assert (mono_defaults.real_proxy_class != 0);
 
-       mono_defaults.marshalbyrefobject_class =  mono_class_from_name (
+       mono_defaults.marshalbyrefobject_class =  mono_class_load_from_name (
                mono_defaults.corlib, "System", "MarshalByRefObject");
-       g_assert (mono_defaults.marshalbyrefobject_class != 0);
 
-       mono_defaults.iremotingtypeinfo_class = mono_class_from_name (
+       mono_defaults.iremotingtypeinfo_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Runtime.Remoting", "IRemotingTypeInfo");
-       g_assert (mono_defaults.iremotingtypeinfo_class != 0);
+
 #endif
 
-       mono_defaults.mono_method_message_class = mono_class_from_name (
+       mono_defaults.mono_method_message_class = mono_class_load_from_name (
                 mono_defaults.corlib, "System.Runtime.Remoting.Messaging", "MonoMethodMessage");
-       g_assert (mono_defaults.mono_method_message_class != 0);
 
-       mono_defaults.field_info_class = mono_class_from_name (
+       mono_defaults.field_info_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Reflection", "FieldInfo");
-       g_assert (mono_defaults.field_info_class != 0);
 
-       mono_defaults.method_info_class = mono_class_from_name (
+       mono_defaults.method_info_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Reflection", "MethodInfo");
-       g_assert (mono_defaults.method_info_class != 0);
 
-       mono_defaults.stringbuilder_class = mono_class_from_name (
+       mono_defaults.stringbuilder_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Text", "StringBuilder");
-       g_assert (mono_defaults.stringbuilder_class != 0);
 
-       mono_defaults.math_class = mono_class_from_name (
+       mono_defaults.math_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "Math");
-       g_assert (mono_defaults.math_class != 0);
 
-       mono_defaults.stack_frame_class = mono_class_from_name (
+       mono_defaults.stack_frame_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Diagnostics", "StackFrame");
-       g_assert (mono_defaults.stack_frame_class != 0);
 
-       mono_defaults.stack_trace_class = mono_class_from_name (
+       mono_defaults.stack_trace_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Diagnostics", "StackTrace");
-       g_assert (mono_defaults.stack_trace_class != 0);
 
-       mono_defaults.marshal_class = mono_class_from_name (
+       mono_defaults.marshal_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Runtime.InteropServices", "Marshal");
-       g_assert (mono_defaults.marshal_class != 0);
 
-       mono_defaults.typed_reference_class =  mono_class_from_name (
+       mono_defaults.typed_reference_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "TypedReference");
-       g_assert (mono_defaults.typed_reference_class != 0);
 
-       mono_defaults.argumenthandle_class =  mono_class_from_name (
+       mono_defaults.argumenthandle_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "RuntimeArgumentHandle");
-       g_assert (mono_defaults.argumenthandle_class != 0);
 
-       mono_defaults.monitor_class =  mono_class_from_name (
+       mono_defaults.monitor_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Threading", "Monitor");
-       g_assert (mono_defaults.monitor_class != 0);
-
-       mono_defaults.runtimesecurityframe_class = mono_class_from_name (
-               mono_defaults.corlib, "System.Security", "RuntimeSecurityFrame");
-
-       mono_defaults.executioncontext_class = mono_class_from_name (
-               mono_defaults.corlib, "System.Threading", "ExecutionContext");
-
-       mono_defaults.internals_visible_class = mono_class_from_name (
-               mono_defaults.corlib, "System.Runtime.CompilerServices", "InternalsVisibleToAttribute");
-
-       mono_defaults.critical_finalizer_object = mono_class_from_name (
-               mono_defaults.corlib, "System.Runtime.ConstrainedExecution", "CriticalFinalizerObject");
-
        /*
-        * mscorlib needs a little help, only now it can load its friends list (after we have
-        * loaded the InternalsVisibleToAttribute), load it now
-        */
+       Not using GENERATE_TRY_GET_CLASS_WITH_CACHE_DECL as this type is heavily checked by sgen when computing finalization.
+       */
+       mono_defaults.critical_finalizer_object = mono_class_try_load_from_name (mono_defaults.corlib,
+                       "System.Runtime.ConstrainedExecution", "CriticalFinalizerObject");
+
        mono_assembly_load_friends (ass);
-       
-       mono_defaults.safehandle_class = mono_class_from_name (
-               mono_defaults.corlib, "System.Runtime.InteropServices", "SafeHandle");
 
-       mono_defaults.handleref_class = mono_class_from_name (
+       mono_defaults.handleref_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Runtime.InteropServices", "HandleRef");
 
-       mono_defaults.attribute_class = mono_class_from_name (
+       mono_defaults.attribute_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "Attribute");
 
-       mono_defaults.customattribute_data_class = mono_class_from_name (
+       mono_defaults.customattribute_data_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Reflection", "CustomAttributeData");
 
        mono_class_init (mono_defaults.array_class);
-       mono_defaults.generic_nullable_class = mono_class_from_name (
+       mono_defaults.generic_nullable_class = mono_class_load_from_name (
                mono_defaults.corlib, "System", "Nullable`1");
-       mono_defaults.generic_ilist_class = mono_class_from_name (
+       mono_defaults.generic_ilist_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Collections.Generic", "IList`1");
-       mono_defaults.generic_ireadonlylist_class = mono_class_from_name (
+       mono_defaults.generic_ireadonlylist_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Collections.Generic", "IReadOnlyList`1");
 
-       mono_defaults.threadpool_wait_callback_class = mono_class_from_name (
+       mono_defaults.threadpool_wait_callback_class = mono_class_load_from_name (
                mono_defaults.corlib, "System.Threading", "_ThreadPoolWaitCallback");
-       if (!mono_defaults.threadpool_wait_callback_class) {
-               /* This can happen with an old mscorlib */
-               fprintf (stderr, "Corlib too old for this runtime.\n");
-               fprintf (stderr, "Loaded from: %s\n",
-                                mono_defaults.corlib? mono_image_get_filename (mono_defaults.corlib): "unknown");
-               exit (1);
-       }
+
        mono_defaults.threadpool_perform_wait_callback_method = mono_class_get_method_from_name (
                mono_defaults.threadpool_wait_callback_class, "PerformWaitCallback", 0);
 
index d97fa4286551920079e68e6d23b76d84a352ec3f..a66c9d723d15c63aa04c2d9d27ffafe3659c34b9 100644 (file)
@@ -64,7 +64,7 @@ mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image,
        MonoObject *o;
        MonoDomain *caller_domain = mono_domain_get ();
 
-       klass = mono_class_from_name (image, name_space, name);
+       klass = mono_class_load_from_name (image, name_space, name);
 
        o = mono_object_new_checked (domain, klass, &error);
        g_assert (o != NULL && mono_error_ok (&error)); /* FIXME don't swallow the error */
@@ -168,7 +168,7 @@ MonoException *
 mono_exception_from_name_two_strings (MonoImage *image, const char *name_space,
                                      const char *name, MonoString *a1, MonoString *a2)
 {
-       MonoClass *klass = mono_class_from_name (image, name_space, name);
+       MonoClass *klass = mono_class_load_from_name (image, name_space, name);
 
        return create_exception_two_strings (klass, a1, a2);
 }
@@ -583,8 +583,7 @@ mono_get_exception_type_initialization (const gchar *type_name, MonoException *i
        MonoMethod *method;
        gpointer iter;
 
-       klass = mono_class_from_name (mono_get_corlib (), "System", "TypeInitializationException");
-       g_assert (klass);
+       klass = mono_class_load_from_name (mono_get_corlib (), "System", "TypeInitializationException");
 
        mono_class_init (klass);
 
@@ -759,8 +758,8 @@ mono_get_exception_reflection_type_load (MonoArray *types, MonoArray *exceptions
        MonoMethod *method;
        gpointer iter;
 
-       klass = mono_class_from_name (mono_get_corlib (), "System.Reflection", "ReflectionTypeLoadException");
-       g_assert (klass);
+       klass = mono_class_load_from_name (mono_get_corlib (), "System.Reflection", "ReflectionTypeLoadException");
+
        mono_class_init (klass);
 
        /* Find the Type[], Exception[] ctor */
@@ -798,8 +797,7 @@ mono_get_exception_runtime_wrapped (MonoObject *wrapped_exception)
        MonoDomain *domain = mono_domain_get ();
        gpointer params [16];
 
-       klass = mono_class_from_name (mono_get_corlib (), "System.Runtime.CompilerServices", "RuntimeWrappedException");
-       g_assert (klass);
+       klass = mono_class_load_from_name (mono_get_corlib (), "System.Runtime.CompilerServices", "RuntimeWrappedException");
 
        o = mono_object_new_checked (domain, klass, &error);
        g_assert (o != NULL && mono_error_ok (&error)); /* FIXME don't swallow the error */
index fbbf58f6b3ea541d87a28fd78b583fa492585bbb..c99de7aa04f344b980db02069a46a38a274f5bfc 100644 (file)
@@ -1046,7 +1046,8 @@ do_mono_image_load (MonoImage *image, MonoImageOpenStatus *status,
                        }
                }
                if (!image->loader) {
-                       *status = MONO_IMAGE_IMAGE_INVALID;
+                       if (status)
+                               *status = MONO_IMAGE_IMAGE_INVALID;
                        goto invalid_image;
                }
 
index cb762d82e95268b02038a05cf841dd973a64a45b..82e0b9b69fb17d61e6f69e1cc8fed412c2c1e2db 100644 (file)
@@ -146,6 +146,8 @@ ves_icall_marshal_alloc (gulong size);
 /* Lazy class loading functions */
 static GENERATE_GET_CLASS_WITH_CACHE (string_builder, System.Text, StringBuilder)
 static GENERATE_GET_CLASS_WITH_CACHE (date_time, System, DateTime)
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (unmanaged_function_pointer_attribute, System.Runtime.InteropServices, UnmanagedFunctionPointerAttribute)
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (icustom_marshaler, System.Runtime.InteropServices, ICustomMarshaler)
 
 /* MonoMethod pointers to SafeHandle::DangerousAddRef and ::DangerousRelease */
 static MonoMethod *sh_dangerous_add_ref;
@@ -156,9 +158,9 @@ static void
 init_safe_handle ()
 {
        sh_dangerous_add_ref = mono_class_get_method_from_name (
-               mono_defaults.safehandle_class, "DangerousAddRef", 1);
+               mono_class_try_get_safehandle_class (), "DangerousAddRef", 1);
        sh_dangerous_release = mono_class_get_method_from_name (
-               mono_defaults.safehandle_class, "DangerousRelease", 0);
+               mono_class_try_get_safehandle_class (), "DangerousRelease", 0);
 }
 
 static void
@@ -394,15 +396,11 @@ mono_marshal_use_aot_wrappers (gboolean use)
 static void
 parse_unmanaged_function_pointer_attr (MonoClass *klass, MonoMethodPInvoke *piinfo)
 {
-       static MonoClass *UnmanagedFunctionPointerAttribute;
        MonoCustomAttrInfo *cinfo;
        MonoReflectionUnmanagedFunctionPointerAttribute *attr;
 
-       if (!UnmanagedFunctionPointerAttribute)
-               UnmanagedFunctionPointerAttribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
-
        /* The attribute is only available in Net 2.0 */
-       if (UnmanagedFunctionPointerAttribute) {
+       if (mono_class_try_get_unmanaged_function_pointer_attribute_class ()) {
                /* 
                 * The pinvoke attributes are stored in a real custom attribute so we have to
                 * construct it.
@@ -410,7 +408,7 @@ parse_unmanaged_function_pointer_attr (MonoClass *klass, MonoMethodPInvoke *piin
                cinfo = mono_custom_attrs_from_class (klass);
                if (cinfo && !mono_runtime_get_no_exec ()) {
                        MonoError error;
-                       attr = (MonoReflectionUnmanagedFunctionPointerAttribute*)mono_custom_attrs_get_attr_checked (cinfo, UnmanagedFunctionPointerAttribute, &error);
+                       attr = (MonoReflectionUnmanagedFunctionPointerAttribute*)mono_custom_attrs_get_attr_checked (cinfo, mono_class_try_get_unmanaged_function_pointer_attribute_class (), &error);
                        if (attr) {
                                piinfo->piflags = (attr->call_conv << 8) | (attr->charset ? (attr->charset - 1) * 2 : 1) | attr->set_last_error;
                        } else {
@@ -1807,7 +1805,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje
                return;
        }
 
-       if (klass != mono_defaults.safehandle_class) {
+       if (klass != mono_class_try_get_safehandle_class ()) {
                if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
                        char *msg = g_strdup_printf ("Type %s which is passed to unmanaged code must have a StructLayout attribute.",
                                                                                 mono_type_full_name (&klass->byval_arg));
@@ -1837,7 +1835,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje
                        usize = info->fields [i + 1].offset - info->fields [i].offset;
                }
 
-               if (klass != mono_defaults.safehandle_class){
+               if (klass != mono_class_try_get_safehandle_class ()){
                        /* 
                         * FIXME: Should really check for usize==0 and msize>0, but we apply 
                         * the layout to the managed structure as well.
@@ -4336,7 +4334,7 @@ emit_marshal_custom (EmitMarshalContext *m, int argnum, MonoType *t,
        int pos2;
 
        if (!ICustomMarshaler) {
-               MonoClass *klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "ICustomMarshaler");
+               MonoClass *klass = mono_class_try_get_icustom_marshaler_class ();
                if (!klass) {
                        exception_msg = g_strdup ("Current profile doesn't support ICustomMarshaler");
                        goto handle_exception;
@@ -7070,8 +7068,8 @@ emit_marshal (EmitMarshalContext *m, int argnum, MonoType *t,
                        return mono_cominterop_emit_marshal_safearray (m, argnum, t, spec, conv_arg, conv_arg_type, action);
 #endif
 
-               if (mono_defaults.safehandle_class != NULL && t->data.klass &&
-                   mono_class_is_subclass_of (t->data.klass,  mono_defaults.safehandle_class, FALSE))
+               if (mono_class_try_get_safehandle_class () != NULL && t->data.klass &&
+                   mono_class_is_subclass_of (t->data.klass,  mono_class_try_get_safehandle_class (), FALSE))
                        return emit_marshal_safehandle (m, argnum, t, spec, conv_arg, conv_arg_type, action);
                
                return emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
@@ -7756,9 +7754,10 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
        }
 #else
        MonoMethodSignature *sig, *csig;
+       MonoExceptionClause *clause;
        int i, *tmp_locals;
+       int leave_pos;
        gboolean closed = FALSE;
-       int coop_gc_var, coop_gc_dummy_local;
 
        sig = m->sig;
        csig = m->csig;
@@ -7785,30 +7784,46 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
                mono_mb_add_local (mb, sig->ret);
        }
 
+       /*
+        * try {
+        *   mono_jit_attach ();
+        *
+        *   <interrupt check>
+        *
+        *   ret = method (...);
+        * } finally {
+        *   mono_jit_detach ();
+        * }
+        *
+        * return ret;
+        */
+
        if (mono_threads_is_coop_enabled ()) {
-               /* local 4, the local to be used when calling the reset_blocking funcs */
-               /* tons of code hardcode 3 to be the return var */
-               coop_gc_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
-               /* local 5, the local used to get a stack address for suspend funcs */
-               coop_gc_dummy_local = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+               clause = g_new0 (MonoExceptionClause, 1);
+               clause->flags = MONO_EXCEPTION_CLAUSE_FINALLY;
        }
 
        mono_mb_emit_icon (mb, 0);
        mono_mb_emit_stloc (mb, 2);
 
+       if (mono_threads_is_coop_enabled ()) {
+               /* try { */
+               clause->try_offset = mono_mb_get_label (mb);
+       }
+
        /*
         * Might need to attach the thread to the JIT or change the
         * domain for the callback.
+        *
+        * Also does the (STARTING|BLOCKING|RUNNING) -> RUNNING thread state transtion
+        *
+        * mono_jit_attach ();
         */
        mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
        mono_mb_emit_byte (mb, CEE_MONO_JIT_ATTACH);
 
-       if (mono_threads_is_coop_enabled ()) {
-               /* XXX can we merge reset_blocking_start with JIT_ATTACH above and save one call? */
-               mono_mb_emit_ldloc_addr (mb, coop_gc_dummy_local);
-               mono_mb_emit_icall (mb, mono_threads_reset_blocking_start);
-               mono_mb_emit_stloc (mb, coop_gc_var);
-       }
+       /* <interrupt check> */
+       emit_thread_interrupt_checkpoint (mb);
 
        /* we first do all conversions */
        tmp_locals = (int *)alloca (sizeof (int) * sig->param_count);
@@ -7832,8 +7847,6 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
                }
        }
 
-       emit_thread_interrupt_checkpoint (mb);
-
        if (sig->hasthis) {
                if (target_handle) {
                        mono_mb_emit_icon (mb, (gint32)target_handle);
@@ -7860,6 +7873,7 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
                        mono_mb_emit_ldarg (mb, i);
        }
 
+       /* ret = method (...) */
        mono_mb_emit_managed_call (mb, method, NULL);
 
        if (mspecs [0] && mspecs [0]->native == MONO_NATIVE_CUSTOM) {
@@ -7939,15 +7953,31 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
        }
 
        if (mono_threads_is_coop_enabled ()) {
-               /* XXX merge reset_blocking_end with detach */
-               mono_mb_emit_ldloc (mb, coop_gc_var);
-               mono_mb_emit_ldloc_addr (mb, coop_gc_dummy_local);
-               mono_mb_emit_icall (mb, mono_threads_reset_blocking_end);
+               leave_pos = mono_mb_emit_branch (mb, CEE_LEAVE);
+
+               /* } finally { */
+               clause->try_len = mono_mb_get_label (mb) - clause->try_offset;
+               clause->handler_offset = mono_mb_get_label (mb);
        }
 
+       /*
+        * Also does the RUNNING -> (BLOCKING|RUNNING) thread state transition
+        *
+        * mono_jit_detach ();
+        */
        mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
        mono_mb_emit_byte (mb, CEE_MONO_JIT_DETACH);
 
+       if (mono_threads_is_coop_enabled ()) {
+               mono_mb_emit_byte (mb, CEE_ENDFINALLY);
+
+               /* } [endfinally] */
+               clause->handler_len = mono_mb_get_pos (mb) - clause->handler_offset;
+
+               mono_mb_patch_branch (mb, leave_pos);
+       }
+
+       /* return ret; */
        if (m->retobj_var) {
                mono_mb_emit_ldloc (mb, m->retobj_var);
                mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
@@ -7959,6 +7989,10 @@ mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *i
                mono_mb_emit_byte (mb, CEE_RET);
        }
 
+       if (mono_threads_is_coop_enabled ()) {
+               mono_mb_set_clauses (mb, 1, clause);
+       }
+
        if (closed)
                g_free (sig);
 #endif
@@ -8008,7 +8042,6 @@ mono_marshal_set_callconv_from_modopt (MonoMethod *method, MonoMethodSignature *
 MonoMethod *
 mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, uint32_t target_handle)
 {
-       static MonoClass *UnmanagedFunctionPointerAttribute;
        MonoMethodSignature *sig, *csig, *invoke_sig;
        MonoMethodBuilder *mb;
        MonoMethod *res, *invoke;
@@ -8063,12 +8096,8 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
 
        mono_marshal_set_callconv_from_modopt (invoke, csig);
 
-       /* Handle the UnmanagedFunctionPointerAttribute */
-       if (!UnmanagedFunctionPointerAttribute)
-               UnmanagedFunctionPointerAttribute = mono_class_from_name (mono_defaults.corlib, "System.Runtime.InteropServices", "UnmanagedFunctionPointerAttribute");
-
        /* The attribute is only available in Net 2.0 */
-       if (UnmanagedFunctionPointerAttribute) {
+       if (mono_class_try_get_unmanaged_function_pointer_attribute_class ()) {
                MonoCustomAttrInfo *cinfo;
                MonoCustomAttrEntry *attr;
 
@@ -8082,7 +8111,7 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
                if (cinfo) {
                        for (i = 0; i < cinfo->num_attrs; ++i) {
                                MonoClass *ctor_class = cinfo->attrs [i].ctor->klass;
-                               if (mono_class_has_parent (ctor_class, UnmanagedFunctionPointerAttribute)) {
+                               if (mono_class_has_parent (ctor_class, mono_class_try_get_unmanaged_function_pointer_attribute_class ())) {
                                        attr = &cinfo->attrs [i];
                                        break;
                                }
index 9c082de29c66488f90ab49aa65c04a25338ff2f0..7ff64f517ac012a0464202bbb8fb5ff84f0fc457 100644 (file)
@@ -5894,7 +5894,7 @@ handle_enum:
                        *conv = MONO_MARSHAL_CONV_DEL_FTN;
                        return MONO_NATIVE_FUNC;
                }
-               if (mono_defaults.safehandle_class && type->data.klass == mono_defaults.safehandle_class){
+               if (mono_class_try_get_safehandle_class () && type->data.klass == mono_class_try_get_safehandle_class ()){
                        *conv = MONO_MARSHAL_CONV_SAFEHANDLE;
                        return MONO_NATIVE_INT;
                }
index 23f8d5990952d0a176d19cbb1e26e1a0f305114a..5bbedbbb816a1f6c83c10568412c9ecbadaca2ad 100644 (file)
@@ -550,7 +550,7 @@ mono_mb_emit_exception_full (MonoMethodBuilder *mb, const char *exc_nspace, cons
 {
        MonoMethod *ctor = NULL;
 
-       MonoClass *mme = mono_class_from_name (mono_defaults.corlib, exc_nspace, exc_name);
+       MonoClass *mme = mono_class_load_from_name (mono_defaults.corlib, exc_nspace, exc_name);
        mono_class_init (mme);
        ctor = mono_class_get_method_from_name (mme, ".ctor", 0);
        g_assert (ctor);
index d82ca0c831f7a167d88d04d5ecd71990f1b1699f..7e90b652dd5901714b31f60bfb95725fd85a8404 100644 (file)
@@ -41,7 +41,7 @@ mono_mlist_alloc (MonoObject *data)
        MonoError error;
        MonoMList* res;
        if (!monolist_item_vtable) {
-               MonoClass *klass = mono_class_from_name (mono_defaults.corlib, "System", "MonoListItem");
+               MonoClass *klass = mono_class_load_from_name (mono_defaults.corlib, "System", "MonoListItem");
                monolist_item_vtable = mono_class_vtable (mono_get_root_domain (), klass);
                g_assert (monolist_item_vtable);
        }
index 03cc519767a4172a258d86d922e7235213f2b17f..a27f82ecd292958c66ca56293c08d9b82009aadf 100644 (file)
@@ -956,7 +956,7 @@ void invoke_protected_memory_method (MonoArray *data, MonoObject *scope, gboolea
                }
        }
 
-       klass = mono_class_from_name (system_security_assembly,
+       klass = mono_class_load_from_name (system_security_assembly,
                                                                  "System.Security.Cryptography", "ProtectedMemory");
        method = mono_class_get_method_from_name (klass, encrypt ? "Protect" : "Unprotect", 2);
        params [0] = data;
index 45f93f157fa38747d06d25de3240c7eac1f9cb71..352dae4ff9c1c3154586464d2cacf72a27dda955 100644 (file)
 
 #ifdef __GNUC__
 
-/* namespace and name should be a constant */
-/* image must be mscorlib since other assemblies can be unloaded */
-#define mono_class_from_name_cached(image,namespace,name) ({ \
-                       static MonoClass *tmp_klass; \
-                       if (!tmp_klass) { \
-                               g_assert (image == mono_defaults.corlib); \
-                               tmp_klass = mono_class_from_name ((image), (namespace), (name)); \
-                               g_assert (tmp_klass); \
-                       }; \
-                       tmp_klass; })
 /* name should be a compile-time constant */
 #define mono_class_get_field_from_name_cached(klass,name) ({ \
                        static MonoClassField *tmp_field; \
 
 #else
 
-#define mono_class_from_name_cached(image,namespace,name) mono_class_from_name ((image), (namespace), (name))
 #define mono_class_get_field_from_name_cached(klass,name) mono_class_get_field_from_name ((klass), (name))
 #define mono_array_class_get_cached(eclass,rank) mono_array_class_get ((eclass), (rank))
 #define mono_array_new_cached(domain, eclass, size) mono_array_new_specific (mono_class_vtable ((domain), mono_array_class_get_cached ((eclass), 1)), (size))
@@ -297,7 +286,6 @@ typedef struct {
 typedef struct {
        MonoMarshalByRefObject object;
        gpointer     handle;
-       MonoBoolean  disposed;
 } MonoWaitHandle;
 
 /* This is a copy of System.Runtime.Remoting.Messaging.CallType */
index 533abdf3529a3eaf1b133b370a6eeceacde3083e..8d0abf7f987dad246d19ebc24eca0641fc40d4d4 100644 (file)
@@ -6604,23 +6604,16 @@ mono_wait_handle_get_handle (MonoWaitHandle *handle)
 {
        MONO_REQ_GC_UNSAFE_MODE;
 
-       static MonoClassField *f_os_handle;
-       static MonoClassField *f_safe_handle;
+       static MonoClassField *f_safe_handle = NULL;
+       MonoSafeHandle *sh;
 
-       if (!f_os_handle && !f_safe_handle) {
-               f_os_handle = mono_class_get_field_from_name (mono_defaults.manualresetevent_class, "os_handle");
-               f_safe_handle = mono_class_get_field_from_name (mono_defaults.manualresetevent_class, "safe_wait_handle");
+       if (!f_safe_handle) {
+               f_safe_handle = mono_class_get_field_from_name (mono_defaults.manualresetevent_class, "safeWaitHandle");
+               g_assert (f_safe_handle);
        }
 
-       if (f_os_handle) {
-               HANDLE retval;
-               mono_field_get_value ((MonoObject*)handle, f_os_handle, &retval);
-               return retval;
-       } else {
-               MonoSafeHandle *sh;
-               mono_field_get_value ((MonoObject*)handle, f_safe_handle, &sh);
-               return sh->handle;
-       }
+       mono_field_get_value ((MonoObject*)handle, f_safe_handle, &sh);
+       return sh->handle;
 }
 
 
index 1d2cd363c10fd4c93002429e50200c0d2035ba0e..dca9ccfc305eee7326111dad75a08ebf225465fa 100644 (file)
@@ -58,6 +58,34 @@ HANDLE ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid)
 
 static MonoImage *system_assembly=NULL;
 
+//Hand coded version that loads from system
+static MonoClass*
+mono_class_get_file_version_info_class (void)
+{
+       static MonoClass *tmp_class;
+       MonoClass *klass = tmp_class;
+       if (!klass) {
+               klass = mono_class_load_from_name (system_assembly, "System.Diagnostics", "FileVersionInfo");
+               mono_memory_barrier ();
+               tmp_class = klass;
+       }
+       return klass;
+}
+
+static MonoClass*
+mono_class_get_process_module_class (void)
+{
+       static MonoClass *tmp_class;
+       MonoClass *klass = tmp_class;
+       if (!klass) {
+               klass = mono_class_load_from_name (system_assembly, "System.Diagnostics", "ProcessModule");
+               mono_memory_barrier ();
+               tmp_class = klass;
+       }
+       return klass;
+}
+
+
 static guint32 unicode_chars (const gunichar2 *str)
 {
        guint32 len=0;
@@ -360,7 +388,6 @@ static void process_get_assembly_fileversion (MonoObject *filever, MonoAssembly
 static MonoObject* get_process_module (MonoAssembly *assembly, MonoClass *proc_class)
 {
        MonoError error;
-       static MonoClass *filever_class = NULL;
        MonoObject *item, *filever;
        MonoDomain *domain = mono_domain_get ();
        char *filename;
@@ -372,13 +399,7 @@ static MonoObject* get_process_module (MonoAssembly *assembly, MonoClass *proc_c
         */
        item = mono_object_new_checked (domain, proc_class, &error);
        mono_error_raise_exception (&error); /* FIXME don't raise here */
-
-       if (!filever_class)
-               filever_class = mono_class_from_name (system_assembly,
-                                           "System.Diagnostics",
-                                           "FileVersionInfo");
-
-       filever = mono_object_new_checked (domain, filever_class, &error);
+       filever = mono_object_new_checked (domain, mono_class_get_file_version_info_class (), &error);
        if (!mono_error_ok (&error)) goto leave;
 
        process_get_assembly_fileversion (filever, assembly);
@@ -400,7 +421,6 @@ leave:
 static MonoObject* process_add_module (HANDLE process, HMODULE mod, gunichar2 *filename, gunichar2 *modulename, MonoClass *proc_class)
 {
        MonoError error;
-       static MonoClass *filever_class = NULL;
        MonoObject *item, *filever;
        MonoDomain *domain=mono_domain_get ();
        MODULEINFO modinfo;
@@ -410,13 +430,7 @@ static MonoObject* process_add_module (HANDLE process, HMODULE mod, gunichar2 *f
         */
        item=mono_object_new_checked (domain, proc_class, &error);
        mono_error_raise_exception (&error); /* FIXME don't raise here */
-
-       if (!filever_class)
-               filever_class=mono_class_from_name (system_assembly,
-                                           "System.Diagnostics",
-                                           "FileVersionInfo");
-
-       filever=mono_object_new_checked (domain, filever_class, &error);
+       filever = mono_object_new_checked (domain, mono_class_get_file_version_info_class (), &error);
        mono_error_raise_exception (&error); /* FIXME don't raise here */
 
        process_get_fileversion (filever, filename);
@@ -475,7 +489,6 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
        DWORD needed;
        guint32 count = 0, module_count = 0, assembly_count = 0;
        guint32 i, num_added = 0;
-       static MonoClass *proc_class = NULL;
        GPtrArray *assemblies = NULL;
        static HANDLE current_process = 0;
        
@@ -496,16 +509,13 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
        }
 
        count = module_count + assembly_count; 
-       if (!proc_class)
-               proc_class = mono_class_from_name (system_assembly, "System.Diagnostics", "ProcessModule");
-
-       temp_arr = mono_array_new (mono_domain_get (), proc_class, count);
+       temp_arr = mono_array_new (mono_domain_get (), mono_class_get_process_module_class (), count);
 
        for (i = 0; i < module_count; i++) {
                if (GetModuleBaseName (process, mods[i], modname, MAX_PATH) &&
                                GetModuleFileNameEx (process, mods[i], filename, MAX_PATH)) {
                        MonoObject *module = process_add_module (process, mods[i],
-                                       filename, modname, proc_class);
+                                       filename, modname, mono_class_get_process_module_class ());
                        mono_array_setref (temp_arr, num_added++, module);
                }
        }
@@ -513,7 +523,7 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
        if (assemblies) {
                for (i = 0; i < assembly_count; i++) {
                        MonoAssembly *ass = (MonoAssembly *)g_ptr_array_index (assemblies, i);
-                       MonoObject *module = get_process_module (ass, proc_class);
+                       MonoObject *module = get_process_module (ass, mono_class_get_process_module_class ());
                        mono_array_setref (temp_arr, num_added++, module);
                }
                g_ptr_array_free (assemblies, TRUE);
@@ -523,7 +533,7 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
                arr = temp_arr;
        } else {
                /* shorter version of the array */
-               arr = mono_array_new (mono_domain_get (), proc_class, num_added);
+               arr = mono_array_new (mono_domain_get (), mono_class_get_process_module_class (), num_added);
 
                for (i = 0; i < num_added; i++)
                        mono_array_setref (arr, i, mono_array_get (temp_arr, MonoObject*, i));
index 2de7972026a8921f987f14ccd1ea385abd5b3c2d..e3c3cbc82d57a033d5ba8ba57de299dd7468fdbc 100644 (file)
@@ -11,6 +11,7 @@
 
 /* Class lazy loading functions */
 static GENERATE_GET_CLASS_WITH_CACHE (security_manager, System.Security, SecurityManager)
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (execution_context, System.Threading, ExecutionContext)
 
 static MonoSecurityMode mono_security_mode = MONO_SECURITY_MODE_NONE;
 
@@ -96,9 +97,10 @@ mono_get_context_capture_method (void)
                return NULL;
 
        /* older corlib revisions won't have the class (nor the method) */
-       if (mono_defaults.executioncontext_class && !method) {
-               mono_class_init (mono_defaults.executioncontext_class);
-               method = mono_class_get_method_from_name (mono_defaults.executioncontext_class, "Capture", 0);
+       MonoClass *execution_context = mono_class_try_get_execution_context_class ();
+       if (execution_context && !method) {
+               mono_class_init (execution_context);
+               method = mono_class_get_method_from_name (execution_context, "Capture", 0);
        }
 
        return method;
index 8f86228dce17bece01892b1e24934f67aa7af264..e070fed4ad436d1530110f0d72f23740bf334ab9 100644 (file)
@@ -1198,14 +1198,12 @@ create_allocator (int atype, gboolean slowpath)
                /* catch */
                clause->flags = MONO_EXCEPTION_CLAUSE_NONE;
                clause->try_len = mono_mb_get_pos (mb) - clause->try_offset;
-               clause->data.catch_class = mono_class_from_name (mono_defaults.corlib,
+               clause->data.catch_class = mono_class_load_from_name (mono_defaults.corlib,
                                "System", "OverflowException");
-               g_assert (clause->data.catch_class);
                clause->handler_offset = mono_mb_get_label (mb);
 
-               oom_exc_class = mono_class_from_name (mono_defaults.corlib,
+               oom_exc_class = mono_class_load_from_name (mono_defaults.corlib,
                                "System", "OutOfMemoryException");
-               g_assert (oom_exc_class);
                ctor = mono_class_get_method_from_name (oom_exc_class, ".ctor", 0);
                g_assert (ctor);
 
index 7ddf9d3e4686faa5023da5d0e7bdd947e45d8180..333c41975004a9cfb5be337a2302263215d3562e 100644 (file)
@@ -602,8 +602,7 @@ get_family_hint (void)
                socket_assembly = get_socket_assembly ();
                g_assert (socket_assembly);
 
-               socket_class = mono_class_from_name (socket_assembly, "System.Net.Sockets", "Socket");
-               g_assert (socket_class);
+               socket_class = mono_class_load_from_name (socket_assembly, "System.Net.Sockets", "Socket");
 
                ipv4_field = mono_class_get_field_from_name (socket_class, "ipv4_supported");
                g_assert (ipv4_field);
@@ -832,8 +831,7 @@ create_object_from_sockaddr(struct sockaddr *saddr, int sa_size, gint32 *error)
 
        /* Build a System.Net.SocketAddress object instance */
        if (!domain->sockaddr_class) {
-               domain->sockaddr_class=mono_class_from_name (get_socket_assembly (), "System.Net", "SocketAddress");
-               g_assert (domain->sockaddr_class);
+               domain->sockaddr_class = mono_class_load_from_name (get_socket_assembly (), "System.Net", "SocketAddress");
        }
        sockaddr_obj=mono_object_new_checked(domain, domain->sockaddr_class, &merror);
        mono_error_raise_exception (&merror); /* FIXME don't raise here */
@@ -1978,7 +1976,7 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal (SOCKET sock, g
        switch(name) {
        case SocketOptionName_Linger:
                /* build a System.Net.Sockets.LingerOption */
-               obj_class=mono_class_from_name(get_socket_assembly (),
+               obj_class = mono_class_load_from_name (get_socket_assembly (),
                                               "System.Net.Sockets",
                                               "LingerOption");
                obj=mono_object_new_checked(domain, obj_class, &merror);
@@ -2027,7 +2025,7 @@ ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal (SOCKET sock, g
                        }
                }
                
-               obj_class = mono_class_from_name(mono_posix_image,
+               obj_class = mono_class_load_from_name (mono_posix_image,
                                                 "Mono.Posix",
                                                 "PeerCredData");
                obj = mono_object_new_checked(domain, obj_class, &merror);
index 82f9d75c83a871ba74c9c6f9a599f890e8a4590e..ba70e75ca01dec739b87af6e05b40fa883083ccf 100644 (file)
@@ -357,8 +357,7 @@ mono_threadpool_ms_enqueue_work_item (MonoDomain *domain, MonoObject *work_item)
        g_assert (work_item);
 
        if (!threadpool_class)
-               threadpool_class = mono_class_from_name (mono_defaults.corlib, "System.Threading", "ThreadPool");
-       g_assert (threadpool_class);
+               threadpool_class = mono_class_load_from_name (mono_defaults.corlib, "System.Threading", "ThreadPool");
 
        if (!unsafe_queue_custom_work_item_method)
                unsafe_queue_custom_work_item_method = mono_class_get_method_from_name (threadpool_class, "UnsafeQueueCustomWorkItem", 2);
@@ -1326,8 +1325,7 @@ mono_threadpool_ms_begin_invoke (MonoDomain *domain, MonoObject *target, MonoMet
        MonoObject *state = NULL;
 
        if (!async_call_klass)
-               async_call_klass = mono_class_from_name (mono_defaults.corlib, "System", "MonoAsyncCall");
-       g_assert (async_call_klass);
+               async_call_klass = mono_class_load_from_name (mono_defaults.corlib, "System", "MonoAsyncCall");
 
        mono_lazy_initialize (&status, initialize);
 
index 86a01a481f359aa6d66197bdde3ed223877cddcf..b097a377fe6a957221c7fe24a493ba2717b65e87 100644 (file)
@@ -95,10 +95,10 @@ gboolean ves_icall_System_Threading_Events_ResetEvent_internal (HANDLE handle);
 void ves_icall_System_Threading_Events_CloseEvent_internal (HANDLE handle);
 HANDLE ves_icall_System_Threading_Events_OpenEvent_internal (MonoString *name, gint32 rights, gint32 *error);
 
-gboolean ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext);
+gint32 ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext);
 gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext);
-gboolean ves_icall_System_Threading_WaitHandle_WaitOne_internal(MonoObject *this_obj, HANDLE handle, gint32 ms, gboolean exitContext);
-gboolean ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (HANDLE toSignal, HANDLE toWait, gint32 ms, gboolean exitContext);
+gint32 ves_icall_System_Threading_WaitHandle_WaitOne_internal(HANDLE handle, gint32 ms, gboolean exitContext);
+gint32 ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (HANDLE toSignal, HANDLE toWait, gint32 ms, gboolean exitContext);
 
 MonoArray* ves_icall_System_Threading_Thread_ByteArrayToRootDomain (MonoArray *arr);
 MonoArray* ves_icall_System_Threading_Thread_ByteArrayToCurrentDomain (MonoArray *arr);
index 3c04b893353af7833b67fbbb70cc52f2f6a1c9aa..1cb5e238b4d94a10ed676668d4bd1f308122aa79 100644 (file)
@@ -1583,7 +1583,7 @@ mono_wait_uninterrupted (MonoInternalThread *thread, gboolean multiple, guint32
 }
 
 /* FIXME: exitContext isnt documented */
-gboolean ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext)
+gint32 ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext)
 {
        HANDLE *handles;
        guint32 numhandles;
@@ -1616,15 +1616,7 @@ gboolean ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_
 
        g_free(handles);
 
-       if(ret==WAIT_FAILED) {
-               THREAD_WAIT_DEBUG (g_message ("%s: (%"G_GSIZE_FORMAT") Wait failed", __func__, mono_native_thread_id_get ()));
-               return(FALSE);
-       } else if(ret==WAIT_TIMEOUT) {
-               THREAD_WAIT_DEBUG (g_message ("%s: (%"G_GSIZE_FORMAT") Wait timed out", __func__, mono_native_thread_id_get ()));
-               return(FALSE);
-       }
-       
-       return(TRUE);
+       return ret;
 }
 
 /* FIXME: exitContext isnt documented */
@@ -1676,7 +1668,7 @@ gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_ha
 }
 
 /* FIXME: exitContext isnt documented */
-gboolean ves_icall_System_Threading_WaitHandle_WaitOne_internal(MonoObject *this_obj, HANDLE handle, gint32 ms, gboolean exitContext)
+gint32 ves_icall_System_Threading_WaitHandle_WaitOne_internal(HANDLE handle, gint32 ms, gboolean exitContext)
 {
        guint32 ret;
        MonoInternalThread *thread = mono_thread_internal_current ();
@@ -1695,18 +1687,10 @@ gboolean ves_icall_System_Threading_WaitHandle_WaitOne_internal(MonoObject *this
        
        mono_thread_clr_state (thread, ThreadState_WaitSleepJoin);
        
-       if(ret==WAIT_FAILED) {
-               THREAD_WAIT_DEBUG (g_message ("%s: (%"G_GSIZE_FORMAT") Wait failed", __func__, mono_native_thread_id_get ()));
-               return(FALSE);
-       } else if(ret==WAIT_TIMEOUT) {
-               THREAD_WAIT_DEBUG (g_message ("%s: (%"G_GSIZE_FORMAT") Wait timed out", __func__, mono_native_thread_id_get ()));
-               return(FALSE);
-       }
-       
-       return(TRUE);
+       return ret;
 }
 
-gboolean
+gint32
 ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (HANDLE toSignal, HANDLE toWait, gint32 ms, gboolean exitContext)
 {
        guint32 ret;
@@ -1725,7 +1709,7 @@ ves_icall_System_Threading_WaitHandle_SignalAndWait_Internal (HANDLE toSignal, H
        
        mono_thread_clr_state (thread, ThreadState_WaitSleepJoin);
 
-       return  (!(ret == WAIT_TIMEOUT || ret == WAIT_IO_COMPLETION || ret == WAIT_FAILED));
+       return ret;
 }
 
 HANDLE ves_icall_System_Threading_Mutex_CreateMutex_internal (MonoBoolean owned, MonoString *name, MonoBoolean *created)
index 4dca2e2e092a06cf88b216e0ebc4174096f30db3..5d0cd89cfeb838e6affd664457f6b2b7dab665f0 100644 (file)
@@ -3609,7 +3609,7 @@ add_wrappers (MonoAotCompile *acfg)
                /* Assembly runtime-invoke (string, bool) [DoAssemblyResolve] */
                csig = mono_metadata_signature_alloc (mono_defaults.corlib, 2);
                csig->hasthis = 1;
-               csig->ret = &(mono_class_from_name (
+               csig->ret = &(mono_class_load_from_name (
                                                                                        mono_defaults.corlib, "System.Reflection", "Assembly"))->byval_arg;
                csig->params [0] = &mono_defaults.string_class->byval_arg;
                csig->params [1] = &mono_defaults.boolean_class->byval_arg;
@@ -4279,14 +4279,13 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
 
                memset (&ctx, 0, sizeof (ctx));
 
-               icomparable = mono_class_from_name (mono_defaults.corlib, "System", "IComparable`1");
-               g_assert (icomparable);
+               icomparable = mono_class_load_from_name (mono_defaults.corlib, "System", "IComparable`1");
+
                args [0] = &tclass->byval_arg;
                ctx.class_inst = mono_metadata_get_generic_inst (1, args);
 
                if (mono_class_is_assignable_from (mono_class_inflate_generic_class (icomparable, &ctx), tclass)) {
-                       gcomparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "GenericComparer`1");
-                       g_assert (gcomparer);
+                       gcomparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "GenericComparer`1");
                        add_generic_class (acfg, mono_class_inflate_generic_class (gcomparer, &ctx), FALSE, "Comparer<T>");
                }
        }
@@ -4300,14 +4299,13 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
 
                memset (&ctx, 0, sizeof (ctx));
 
-               iface = mono_class_from_name (mono_defaults.corlib, "System", "IEquatable`1");
+               iface = mono_class_load_from_name (mono_defaults.corlib, "System", "IEquatable`1");
                g_assert (iface);
                args [0] = &tclass->byval_arg;
                ctx.class_inst = mono_metadata_get_generic_inst (1, args);
 
                if (mono_class_is_assignable_from (mono_class_inflate_generic_class (iface, &ctx), tclass)) {
-                       gcomparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "GenericEqualityComparer`1");
-                       g_assert (gcomparer);
+                       gcomparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "GenericEqualityComparer`1");
                        add_generic_class (acfg, mono_class_inflate_generic_class (gcomparer, &ctx), FALSE, "EqualityComparer<T>");
                }
        }
@@ -4324,8 +4322,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
                        args [0] = &tclass->byval_arg;
                        ctx.class_inst = mono_metadata_get_generic_inst (1, args);
 
-                       enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "EnumEqualityComparer`1");
-                       g_assert (enum_comparer);
+                       enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "EnumEqualityComparer`1");
                        add_generic_class (acfg, mono_class_inflate_generic_class (enum_comparer, &ctx), FALSE, "EqualityComparer<T>");
                }
        }
@@ -4342,8 +4339,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth,
                        args [0] = &tclass->byval_arg;
                        ctx.class_inst = mono_metadata_get_generic_inst (1, args);
 
-                       comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "ObjectComparer`1");
-                       g_assert (comparer);
+                       comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "ObjectComparer`1");
                        add_generic_class (acfg, mono_class_inflate_generic_class (comparer, &ctx), FALSE, "Comparer<T>");
                }
        }
@@ -4561,10 +4557,10 @@ add_generic_instances (MonoAotCompile *acfg)
                insts [ninsts ++] = &mono_defaults.boolean_class->byval_arg;
 
                /* Add GenericComparer<T> instances for primitive types for Enum.ToString () */
-               klass = mono_class_from_name (acfg->image, "System.Collections.Generic", "GenericComparer`1");
+               klass = mono_class_try_load_from_name (acfg->image, "System.Collections.Generic", "GenericComparer`1");
                if (klass)
                        add_instances_of (acfg, klass, insts, ninsts, TRUE);
-               klass = mono_class_from_name (acfg->image, "System.Collections.Generic", "GenericEqualityComparer`1");
+               klass = mono_class_try_load_from_name (acfg->image, "System.Collections.Generic", "GenericEqualityComparer`1");
                if (klass)
                        add_instances_of (acfg, klass, insts, ninsts, TRUE);
 
@@ -4579,24 +4575,20 @@ add_generic_instances (MonoAotCompile *acfg)
                        insts [ninsts ++] = &mono_defaults.uint32_class->byval_arg;
                        insts [ninsts ++] = &mono_defaults.uint16_class->byval_arg;
                        insts [ninsts ++] = &mono_defaults.byte_class->byval_arg;
-                       enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "EnumEqualityComparer`1");
-                       g_assert (enum_comparer);
+                       enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "EnumEqualityComparer`1");
                        add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE);
 
                        ninsts = 0;
                        insts [ninsts ++] = &mono_defaults.int16_class->byval_arg;
-                       enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "ShortEnumEqualityComparer`1");
-                       g_assert (enum_comparer);
+                       enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "ShortEnumEqualityComparer`1");
                        add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE);
 
                        ninsts = 0;
                        insts [ninsts ++] = &mono_defaults.sbyte_class->byval_arg;
-                       enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "SByteEnumEqualityComparer`1");
-                       g_assert (enum_comparer);
+                       enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "SByteEnumEqualityComparer`1");
                        add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE);
 
-                       enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "LongEnumEqualityComparer`1");
-                       g_assert (enum_comparer);
+                       enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "LongEnumEqualityComparer`1");
                        ninsts = 0;
                        insts [ninsts ++] = &mono_defaults.int64_class->byval_arg;
                        insts [ninsts ++] = &mono_defaults.uint64_class->byval_arg;
@@ -4605,13 +4597,15 @@ add_generic_instances (MonoAotCompile *acfg)
 
                /* Add instances of the array generic interfaces for primitive types */
                /* This will add instances of the InternalArray_ helper methods in Array too */
-               klass = mono_class_from_name (acfg->image, "System.Collections.Generic", "ICollection`1");
+               klass = mono_class_try_load_from_name (acfg->image, "System.Collections.Generic", "ICollection`1");
                if (klass)
                        add_instances_of (acfg, klass, insts, ninsts, TRUE);
-               klass = mono_class_from_name (acfg->image, "System.Collections.Generic", "IList`1");
+
+               klass = mono_class_try_load_from_name (acfg->image, "System.Collections.Generic", "IList`1");
                if (klass)
                        add_instances_of (acfg, klass, insts, ninsts, TRUE);
-               klass = mono_class_from_name (acfg->image, "System.Collections.Generic", "IEnumerable`1");
+
+               klass = mono_class_try_load_from_name (acfg->image, "System.Collections.Generic", "IEnumerable`1");
                if (klass)
                        add_instances_of (acfg, klass, insts, ninsts, TRUE);
 
@@ -4642,7 +4636,7 @@ add_generic_instances (MonoAotCompile *acfg)
                        MonoGenericContext ctx;
                        MonoType *args [16];
                        MonoMethod *m;
-                       MonoClass *interlocked_klass = mono_class_from_name (mono_defaults.corlib, "System.Threading", "Interlocked");
+                       MonoClass *interlocked_klass = mono_class_load_from_name (mono_defaults.corlib, "System.Threading", "Interlocked");
                        gpointer iter = NULL;
 
                        while ((m = mono_class_get_methods (interlocked_klass, &iter))) {
@@ -4662,7 +4656,7 @@ add_generic_instances (MonoAotCompile *acfg)
                        MonoGenericContext ctx;
                        MonoType *args [16];
                        MonoMethod *m;
-                       MonoClass *volatile_klass = mono_class_from_name (mono_defaults.corlib, "System.Threading", "Volatile");
+                       MonoClass *volatile_klass = mono_class_try_load_from_name (mono_defaults.corlib, "System.Threading", "Volatile");
                        gpointer iter = NULL;
 
                        if (volatile_klass) {
@@ -5383,9 +5377,8 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint
                MonoClass *ex_class;
 
                ex_class =
-                       mono_class_from_name (mono_defaults.exception_class->image,
+                       mono_class_load_from_name (mono_defaults.exception_class->image,
                                                                  "System", (const char *)patch_info->data.target);
-               g_assert (ex_class);
                encode_klass_ref (acfg, ex_class, p, &p);
                break;
        }
@@ -7105,6 +7098,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
        gboolean skip;
        int index, depth;
        MonoMethod *wrapped;
+       GTimer *jit_timer;
        JitFlags flags;
 
        if (acfg->aot_opts.metadata_only)
@@ -7159,7 +7153,11 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
                flags = (JitFlags)(flags | JIT_FLAG_LLVM_ONLY | JIT_FLAG_EXPLICIT_NULL_CHECKS);
        if (acfg->aot_opts.no_direct_calls)
                flags = (JitFlags)(flags | JIT_FLAG_NO_DIRECT_ICALLS);
+
+       jit_timer = mono_time_track_start ();
        cfg = mini_method_compile (method, acfg->opts, mono_get_root_domain (), flags, 0, index);
+       mono_time_track_end (&mono_jit_stats.jit_time, jit_timer);
+
        mono_loader_clear_error ();
 
        if (cfg->exception_type == MONO_EXCEPTION_GENERIC_SHARING_FAILED) {
@@ -7458,6 +7456,8 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method)
 
        g_hash_table_insert (acfg->method_to_cfg, cfg->orig_method, cfg);
 
+       mono_update_jit_stats (cfg);
+
        /*
        if (cfg->orig_method->wrapper_type)
                g_ptr_array_add (acfg->extra_methods, cfg->orig_method);
@@ -7920,7 +7920,6 @@ emit_llvm_file (MonoAotCompile *acfg)
         * then removing tailcallelim + the global opts.
         * strip-dead-prototypes deletes unused intrinsics definitions.
         */
-       //opts = g_strdup ("-simplifycfg -domtree -domfrontier -scalarrepl -instcombine -simplifycfg -domtree -domfrontier -scalarrepl -simplify-libcalls -instcombine -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -domfrontier -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -iv-users -indvars -loop-deletion -loop-simplify -lcssa -loop-unroll -instcombine -memdep -gvn -memdep -memcpyopt -sccp -instcombine -domtree -memdep -dse -adce -simplifycfg -domtree -verify");
        /* The dse pass is disabled because of #13734 and #17616 */
        /*
         * The dse bug is in DeadStoreElimination.cpp:isOverwrite ():
@@ -7936,7 +7935,11 @@ emit_llvm_file (MonoAotCompile *acfg)
                // FIXME: This doesn't work yet
                opts = g_strdup ("");
        else
+#if LLVM_API_VERSION > 100
+               opts = g_strdup ("-O2");
+#else
                opts = g_strdup ("-targetlibinfo -no-aa -basicaa -notti -instcombine -simplifycfg -inline-cost -inline -sroa -domtree -early-cse -lazy-value-info -correlated-propagation -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -indvars -loop-idiom -loop-deletion -loop-unroll -memdep -gvn -memdep -memcpyopt -sccp -instcombine -lazy-value-info -correlated-propagation -domtree -memdep -adce -simplifycfg -instcombine -strip-dead-prototypes -domtree -verify");
+#endif
        command = g_strdup_printf ("\"%sopt\" -f %s -o \"%s\" \"%s\"", acfg->aot_opts.llvm_path, opts, optbc, tempbc);
        aot_printf (acfg, "Executing opt: %s\n", command);
        if (execute_system (command) != 0)
@@ -7971,6 +7974,10 @@ emit_llvm_file (MonoAotCompile *acfg)
 
        g_string_append_printf (acfg->llc_args, " -mono-eh-frame-symbol=%s%s", acfg->user_symbol_prefix, acfg->llvm_eh_frame_symbol);
 
+#if LLVM_API_VERSION > 100
+       g_string_append_printf (acfg->llc_args, " -disable-tail-calls");
+#endif
+
 #if defined(TARGET_MACH) && defined(TARGET_ARM)
        /* ios requires PIC code now */
        g_string_append_printf (acfg->llc_args, " -relocation-model=pic");
index aeb11a0ff0e7ab327bac24441a82e0854a51cec2..1a4ea53fe1f9ecfa48455f4961f6e1c8f1283639 100644 (file)
@@ -44,7 +44,7 @@ mono_branch_optimize_exception_target (MonoCompile *cfg, MonoBasicBlock *bb, con
        if (bb->region == -1 || !MONO_BBLOCK_IS_IN_REGION (bb, MONO_REGION_TRY))
                return NULL;
 
-       exclass = mono_class_from_name (mono_get_corlib (), "System", exname);
+       exclass = mono_class_load_from_name (mono_get_corlib (), "System", exname);
        /* search for the handler */
        for (i = 0; i < header->num_clauses; ++i) {
                clause = &header->clauses [i];
index f3de9130ce6e416d0c66b7f22604b3513c789f46..6b72d9571d8497909aa7fcb721f557d7b4ee70c3 100644 (file)
@@ -3328,18 +3328,14 @@ init_jit_info_dbg_attrs (MonoJitInfo *ji)
        if (ji->dbg_attrs_inited)
                return;
 
-       if (!hidden_klass) {
-               hidden_klass = mono_class_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerHiddenAttribute");
-               g_assert (hidden_klass);
-       }
-       if (!step_through_klass) {
-               step_through_klass = mono_class_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerStepThroughAttribute");
-               g_assert (step_through_klass);
-       }
-       if (!non_user_klass) {
-               non_user_klass = mono_class_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerNonUserCodeAttribute");
-               g_assert (non_user_klass);
-       }
+       if (!hidden_klass)
+               hidden_klass = mono_class_load_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerHiddenAttribute");
+
+       if (!step_through_klass)
+               step_through_klass = mono_class_load_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerStepThroughAttribute");
+
+       if (!non_user_klass)
+               non_user_klass = mono_class_load_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggerNonUserCodeAttribute");
 
        ainfo = mono_custom_attrs_from_method (jinfo_get_method (ji));
        if (ainfo) {
@@ -6957,7 +6953,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf)
                wait_for_suspend ();
 
 #ifdef TRY_MANAGED_SYSTEM_ENVIRONMENT_EXIT
-               env_class = mono_class_from_name (mono_defaults.corlib, "System", "Environment");
+               env_class = mono_class_try_load_from_name (mono_defaults.corlib, "System", "Environment");
                if (env_class)
                        exit_method = mono_class_get_method_from_name (env_class, "Exit", 1);
 #endif
@@ -9634,12 +9630,13 @@ debugger_thread (void *arg)
        ErrorCode err;
        gboolean no_reply;
        gboolean attach_failed = FALSE;
+       gpointer attach_cookie, attach_dummy;
 
        DEBUG_PRINTF (1, "[dbg] Agent thread started, pid=%p\n", (gpointer) (gsize) mono_native_thread_id_get ());
 
        debugger_thread_id = mono_native_thread_id_get ();
 
-       mono_jit_thread_attach (mono_get_root_domain ());
+       attach_cookie = mono_jit_thread_attach (mono_get_root_domain (), &attach_dummy);
 
        mono_thread_internal_current ()->flags |= MONO_THREAD_FLAG_DONT_MANAGE;
 
@@ -9792,7 +9789,9 @@ debugger_thread (void *arg)
                DEBUG_PRINTF (2, "[dbg] Detached - restarting clean debugger thread.\n");
                start_debugger_thread ();
        }
-       
+
+       mono_jit_thread_detach (attach_cookie, &attach_dummy);
+
        return 0;
 }
 
index a96c6bfd4ac367afe4a93cad9ebdea785c59d080..10c8c75e134d359dd829d023521131246a1f8f67 100644 (file)
@@ -471,6 +471,68 @@ mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins)
                }
                break;
 
+#if SIZEOF_VOID_P == 8
+       case OP_LDIV:
+       case OP_LREM:
+       case OP_LDIV_UN:
+       case OP_LREM_UN:
+               if (cfg->backend->emulate_div && mono_arch_opcode_needs_emulation (cfg, ins->opcode))
+                       emulate = TRUE;
+               if (!emulate) {
+                       if (cfg->backend->need_div_check) {
+                               int reg1 = alloc_ireg (cfg);
+                               int reg2 = alloc_ireg (cfg);
+                               int reg3 = alloc_ireg (cfg);
+                               /* b == 0 */
+                               MONO_EMIT_NEW_LCOMPARE_IMM (cfg, ins->sreg2, 0);
+                               MONO_EMIT_NEW_COND_EXC (cfg, IEQ, "DivideByZeroException");
+                               if (ins->opcode == OP_LDIV || ins->opcode == OP_LREM) {
+                                       /* b == -1 && a == 0x80000000 */
+                                       MONO_EMIT_NEW_I8CONST (cfg, reg3, -1);
+                                       MONO_EMIT_NEW_BIALU (cfg, OP_LCOMPARE, -1, ins->sreg2, reg3);
+                                       MONO_EMIT_NEW_UNALU (cfg, OP_LCEQ, reg1, -1);
+                                       MONO_EMIT_NEW_I8CONST (cfg, reg3, 0x8000000000000000L);
+                                       MONO_EMIT_NEW_BIALU (cfg, OP_LCOMPARE, -1, ins->sreg1, reg3);
+                                       MONO_EMIT_NEW_UNALU (cfg, OP_LCEQ, reg2, -1);
+                                       MONO_EMIT_NEW_BIALU (cfg, OP_IAND, reg1, reg1, reg2);
+                                       MONO_EMIT_NEW_ICOMPARE_IMM (cfg, reg1, 1);
+                                       MONO_EMIT_NEW_COND_EXC (cfg, IEQ, "OverflowException");
+                               }
+                       }
+                       MONO_EMIT_NEW_BIALU (cfg, ins->opcode, ins->dreg, ins->sreg1, ins->sreg2);
+                       NULLIFY_INS (ins);
+               }
+               break;
+#endif
+
+       case OP_DIV_IMM:
+       case OP_REM_IMM:
+       case OP_IDIV_IMM:
+       case OP_IREM_IMM:
+       case OP_IDIV_UN_IMM:
+       case OP_IREM_UN_IMM:
+               if (cfg->backend->need_div_check) {
+                       int reg1 = alloc_ireg (cfg);
+                       /* b == 0 */
+                       if (ins->inst_imm == 0) {
+                               // FIXME: Optimize this
+                               MONO_EMIT_NEW_ICONST (cfg, reg1, 0);
+                               MONO_EMIT_NEW_ICOMPARE_IMM (cfg, reg1, 0);
+                               MONO_EMIT_NEW_COND_EXC (cfg, IEQ, "DivideByZeroException");
+                       }
+                       if ((ins->opcode == OP_DIV_IMM || ins->opcode == OP_IDIV_IMM || ins->opcode == OP_REM_IMM || ins->opcode == OP_IREM_IMM) &&
+                               (ins->inst_imm == -1)) {
+                                       /* b == -1 && a == 0x80000000 */
+                                       MONO_EMIT_NEW_ICOMPARE_IMM (cfg, ins->sreg1, 0x80000000);
+                                       MONO_EMIT_NEW_COND_EXC (cfg, IEQ, "OverflowException");
+                       }
+                       MONO_EMIT_NEW_BIALU_IMM (cfg, ins->opcode, ins->dreg, ins->sreg1, ins->inst_imm);
+                       NULLIFY_INS (ins);
+               } else {
+                       emulate = TRUE;
+               }
+               break;
+
        default:
                emulate = TRUE;
                break;
index dada64022d8d4245e015258627a8a358e0459784..0f6aed5e6737c544d6ee25fc4e42f96c544d2484 100644 (file)
@@ -1928,6 +1928,11 @@ mono_main (int argc, char* argv[])
        }
 #endif
 
+#ifdef DISABLE_HW_TRAPS
+       // Signal handlers not available
+       opt->explicit_null_checks = TRUE;
+#endif
+
        if (!argv [i]) {
                mini_usage ();
                return 1;
index dc39414e557a05bf9a5538ced43a21c653aa90e4..d4ba5599049ef11e6221d7c565a9b3a0c76fcb06 100644 (file)
 
 #include "config.h"
 
+#include <llvm-c/Core.h>
+#include <llvm-c/ExecutionEngine.h>
+
+#include "mini-llvm-cpp.h"
+
+#if !defined(MONO_CROSS_COMPILE) && LLVM_API_VERSION < 100
+
 #include <stdint.h>
 
 #include <llvm/Support/raw_ostream.h>
 #include <llvm/IR/IRBuilder.h>
 #include <llvm/IR/Module.h>
 
-#include <llvm-c/Core.h>
-#include <llvm-c/ExecutionEngine.h>
-
-#include "mini-llvm-cpp.h"
-
-#ifndef MONO_CROSS_COMPILE
-
 using namespace llvm;
 
 static void (*unhandled_exception)() = default_mono_llvm_unhandled_exception;
index 5b11f776cf68e710b7ff891bdad6a89ab123c810..2120fa08728e6c39a3863b4ab80ce95dc3c5b499 100644 (file)
@@ -205,8 +205,8 @@ mono_local_cprop (MonoCompile *cfg)
        int initial_max_vregs = cfg->next_vreg;
 
        max = cfg->next_vreg;
-       defs = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * cfg->next_vreg + 1);
-       def_index = (gint32 *)mono_mempool_alloc (cfg->mempool, sizeof (guint32) * cfg->next_vreg + 1);
+       defs = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * cfg->next_vreg);
+       def_index = (gint32 *)mono_mempool_alloc (cfg->mempool, sizeof (guint32) * cfg->next_vreg);
        cfg->cbb = bb_opt = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock));
 
        for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
@@ -219,22 +219,28 @@ mono_local_cprop (MonoCompile *cfg)
                        int sregs [MONO_MAX_SRC_REGS];
                        int num_sregs, i;
 
-                       if ((ins->dreg != -1) && (ins->dreg < max)) {
-                               defs [ins->dreg] = NULL;
+                       if (ins->dreg != -1) {
 #if SIZEOF_REGISTER == 4
-                               defs [ins->dreg + 1] = NULL;
+                               const char *spec = INS_INFO (ins->opcode);
+                               if (spec [MONO_INST_DEST] == 'l') {
+                                       defs [ins->dreg + 1] = NULL;
+                                       defs [ins->dreg + 2] = NULL;
+                               }
 #endif
+                               defs [ins->dreg] = NULL;
                        }
 
                        num_sregs = mono_inst_get_src_registers (ins, sregs);
                        for (i = 0; i < num_sregs; ++i) {
                                int sreg = sregs [i];
-                               if (sreg < max) {
-                                       defs [sreg] = NULL;
 #if SIZEOF_REGISTER == 4
+                               const char *spec = INS_INFO (ins->opcode);
+                               if (spec [MONO_INST_SRC1 + i] == 'l') {
                                        defs [sreg + 1] = NULL;
-#endif
+                                       defs [sreg + 2] = NULL;
                                }
+#endif
+                               defs [sreg] = NULL;
                        }
                }
 
index b0d03803d432d4523ea0f8382776e40dc7fcc530..d76f2085b9697f5d8576adc580146a57017a426c 100644 (file)
@@ -160,6 +160,7 @@ static MonoMethodSignature *helper_sig_llvmonly_imt_thunk;
 
 /* type loading helpers */
 static GENERATE_GET_CLASS_WITH_CACHE (runtime_helpers, System.Runtime.CompilerServices, RuntimeHelpers)
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (debuggable_attribute, System.Diagnostics, DebuggableAttribute)
 
 /*
  * Instruction metadata
@@ -7895,7 +7896,7 @@ is_jit_optimizer_disabled (MonoMethod *m)
 {
        MonoAssembly *ass = m->klass->image->assembly;
        MonoCustomAttrInfo* attrs;
-       static MonoClass *klass;
+       MonoClass *klass;
        int i;
        gboolean val = FALSE;
 
@@ -7903,8 +7904,8 @@ is_jit_optimizer_disabled (MonoMethod *m)
        if (ass->jit_optimizer_disabled_inited)
                return ass->jit_optimizer_disabled;
 
-       if (!klass)
-               klass = mono_class_from_name (mono_defaults.corlib, "System.Diagnostics", "DebuggableAttribute");
+       klass = mono_class_try_get_debuggable_attribute_class ();
+
        if (!klass) {
                /* Linked away */
                ass->jit_optimizer_disabled = FALSE;
@@ -12750,47 +12751,54 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                MonoInst *ad_ins, *jit_tls_ins;
                                MonoBasicBlock *next_bb = NULL, *call_bb = NULL;
 
-                               cfg->orig_domain_var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
+                               cfg->attach_cookie = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
+                               cfg->attach_dummy = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
 
-                               EMIT_NEW_PCONST (cfg, ins, NULL);
-                               MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->orig_domain_var->dreg, ins->dreg);
+                               if (mono_threads_is_coop_enabled ()) {
+                                       /* AOT code is only used in the root domain */
+                                       EMIT_NEW_PCONST (cfg, args [0], cfg->compile_aot ? NULL : cfg->domain);
+                                       EMIT_NEW_VARLOADA (cfg, args [1], cfg->attach_dummy, cfg->attach_dummy->inst_vtype);
+                                       ins = mono_emit_jit_icall (cfg, mono_jit_thread_attach, args);
+                                       MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->attach_cookie->dreg, ins->dreg);
+                               } else {
+                                       EMIT_NEW_PCONST (cfg, ins, NULL);
+                                       MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->attach_cookie->dreg, ins->dreg);
 
-                               ad_ins = mono_get_domain_intrinsic (cfg);
-                               jit_tls_ins = mono_get_jit_tls_intrinsic (cfg);
+                                       ad_ins = mono_get_domain_intrinsic (cfg);
+                                       jit_tls_ins = mono_get_jit_tls_intrinsic (cfg);
 
-                               if (cfg->backend->have_tls_get && ad_ins && jit_tls_ins) {
-                                       NEW_BBLOCK (cfg, next_bb);
-                                       NEW_BBLOCK (cfg, call_bb);
+                                       if (cfg->backend->have_tls_get && ad_ins && jit_tls_ins) {
+                                               NEW_BBLOCK (cfg, next_bb);
+                                               NEW_BBLOCK (cfg, call_bb);
 
-                                       if (cfg->compile_aot) {
-                                               /* AOT code is only used in the root domain */
-                                               EMIT_NEW_PCONST (cfg, domain_ins, NULL);
-                                       } else {
-                                               EMIT_NEW_PCONST (cfg, domain_ins, cfg->domain);
-                                       }
-                                       MONO_ADD_INS (cfg->cbb, ad_ins);
-                                       MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, ad_ins->dreg, domain_ins->dreg);
-                                       MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBNE_UN, call_bb);
+                                               if (cfg->compile_aot) {
+                                                       /* AOT code is only used in the root domain */
+                                                       EMIT_NEW_PCONST (cfg, domain_ins, NULL);
+                                               } else {
+                                                       EMIT_NEW_PCONST (cfg, domain_ins, cfg->domain);
+                                               }
+                                               MONO_ADD_INS (cfg->cbb, ad_ins);
+                                               MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, ad_ins->dreg, domain_ins->dreg);
+                                               MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBNE_UN, call_bb);
 
-                                       MONO_ADD_INS (cfg->cbb, jit_tls_ins);
-                                       MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, jit_tls_ins->dreg, 0);
-                                       MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBEQ, call_bb);
+                                               MONO_ADD_INS (cfg->cbb, jit_tls_ins);
+                                               MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, jit_tls_ins->dreg, 0);
+                                               MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBEQ, call_bb);
 
-                                       MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, next_bb);
-                                       MONO_START_BB (cfg, call_bb);
-                               }
+                                               MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, next_bb);
+                                               MONO_START_BB (cfg, call_bb);
+                                       }
 
-                               if (cfg->compile_aot) {
                                        /* AOT code is only used in the root domain */
-                                       EMIT_NEW_PCONST (cfg, args [0], NULL);
-                               } else {
-                                       EMIT_NEW_PCONST (cfg, args [0], cfg->domain);
+                                       EMIT_NEW_PCONST (cfg, args [0], cfg->compile_aot ? NULL : cfg->domain);
+                                       EMIT_NEW_PCONST (cfg, args [1], NULL);
+                                       ins = mono_emit_jit_icall (cfg, mono_jit_thread_attach, args);
+                                       MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->attach_cookie->dreg, ins->dreg);
+
+                                       if (next_bb)
+                                               MONO_START_BB (cfg, next_bb);
                                }
-                               ins = mono_emit_jit_icall (cfg, mono_jit_thread_attach, args);
-                               MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->orig_domain_var->dreg, ins->dreg);
 
-                               if (next_bb)
-                                       MONO_START_BB (cfg, next_bb);
                                ip += 2;
                                break;
                        }
@@ -12799,8 +12807,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
                                /* Restore the original domain */
                                dreg = alloc_ireg (cfg);
-                               EMIT_NEW_UNALU (cfg, args [0], OP_MOVE, dreg, cfg->orig_domain_var->dreg);
-                               mono_emit_jit_icall (cfg, mono_jit_set_domain, args);
+                               EMIT_NEW_UNALU (cfg, args [0], OP_MOVE, dreg, cfg->attach_cookie->dreg);
+                               EMIT_NEW_VARLOADA (cfg, args [1], cfg->attach_dummy, cfg->attach_dummy->inst_vtype);
+                               mono_emit_jit_icall (cfg, mono_jit_thread_detach, args);
                                ip += 2;
                                break;
                        }
index 66d6d5c648156269d88893732fb302ae66f9fe5e..56ca3d7aaebb01544516a507fbd924b81e5444d6 100644 (file)
@@ -7597,8 +7597,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
 
                        amd64_patch (patch_info->ip.i + cfg->native_code, code);
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
                        throw_ip = patch_info->ip.i;
 
                        //x86_breakpoint (code);
index b1ddb65fc8fc0fb228950edd88a1a38e40505fbc..c9b74ee958f6e8caf0bdee4b6a4b80931b5aa05e 100644 (file)
@@ -6802,8 +6802,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
                        }
                        arm_patch (ip, code);
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
 
                        ARM_MOV_REG_REG (code, ARMREG_R1, ARMREG_LR);
 #ifdef USE_JUMP_TABLES
index 6667530f9273ed42ea646b84b593f8b5241b78a5..43d192707def962b78813b6e639012497a263d1d 100644 (file)
@@ -2630,19 +2630,19 @@ mini_method_is_open (MonoMethod *method)
        return FALSE;
 }
 
+/* Lazy class loading functions */
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (iasync_state_machine, System.Runtime.CompilerServices, IAsyncStateMachine)
+static GENERATE_TRY_GET_CLASS_WITH_CACHE (async_state_machine_attribute, System.Runtime.CompilerServices, AsyncStateMachineAttribute)
+
+
 static G_GNUC_UNUSED gboolean
 is_async_state_machine_class (MonoClass *klass)
 {
-       static MonoClass *iclass;
-       static gboolean iclass_set;
+       MonoClass *iclass;
 
        return FALSE;
 
-       if (!iclass_set) {
-               iclass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.CompilerServices", "IAsyncStateMachine");
-               mono_memory_barrier ();
-               iclass_set = TRUE;
-       }
+       iclass = mono_class_try_get_iasync_state_machine_class ();
 
        if (iclass && klass->valuetype && mono_class_is_assignable_from (iclass, klass))
                return TRUE;
@@ -2655,16 +2655,11 @@ is_async_method (MonoMethod *method)
        MonoCustomAttrInfo *cattr;
        MonoMethodSignature *sig;
        gboolean res = FALSE;
-       static MonoClass *attr_class;
-       static gboolean attr_class_set;
+       MonoClass *attr_class;
 
        return FALSE;
 
-       if (!attr_class_set) {
-               attr_class = mono_class_from_name (mono_defaults.corlib, "System.Runtime.CompilerServices", "AsyncStateMachineAttribute");
-               mono_memory_barrier ();
-               attr_class_set = TRUE;
-       }
+       attr_class = mono_class_try_get_iasync_state_machine_class ();
 
        /* Do less expensive checks first */
        sig = mono_method_signature (method);
index 54222c26698975ce20e00aed2ec952697d36454a..aee49d44b2125b324b9770b24fa29c9ba2fe96f9 100644 (file)
@@ -4188,8 +4188,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
                        guint8* buf;
                        guint64 exc_token_index;
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
                        exc_token_index = mono_metadata_token_index (exc_class->type_token);
                        throw_ip = cfg->native_code + patch_info->ip.i;
 
index f6c95a0cb361243c790e0d10878ac5759313c80f..1a65475f2121243848e69dbf483f23c2a6578fa1 100644 (file)
@@ -265,7 +265,7 @@ static void init_jit_module (MonoDomain *domain);
 static void emit_dbg_loc (EmitContext *ctx, LLVMBuilderRef builder, const unsigned char *cil_code);
 static LLVMValueRef emit_dbg_subprogram (EmitContext *ctx, MonoCompile *cfg, LLVMValueRef method, const char *name);
 static void emit_dbg_info (MonoLLVMModule *module, const char *filename, const char *cu_name);
-
+static void emit_cond_system_exception (EmitContext *ctx, MonoBasicBlock *bb, const char *exc_type, LLVMValueRef cmp);
 
 static inline void
 set_failure (EmitContext *ctx, const char *message)
@@ -1866,8 +1866,19 @@ emit_load_general (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder
        const char *intrins_name;
        LLVMValueRef args [16], res;
        LLVMTypeRef addr_type;
+       gboolean use_intrinsics = TRUE;
 
+#if LLVM_API_VERSION > 100
        if (is_faulting && bb->region != -1 && !ctx->cfg->llvm_only) {
+               /* The llvm.mono.load/store intrinsics are not supported by this llvm version, emit an explicit null check instead */
+               LLVMValueRef cmp = LLVMBuildICmp (*builder_ref, LLVMIntEQ, addr, LLVMConstNull (LLVMTypeOf (addr)), "");
+               emit_cond_system_exception (ctx, bb, "NullReferenceException", cmp);
+               *builder_ref = ctx->builder;
+               use_intrinsics = FALSE;
+       }
+#endif
+
+       if (is_faulting && bb->region != -1 && !ctx->cfg->llvm_only && use_intrinsics) {
                LLVMAtomicOrdering ordering;
 
                switch (barrier) {
@@ -1955,8 +1966,19 @@ emit_store_general (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builde
 {
        const char *intrins_name;
        LLVMValueRef args [16];
+       gboolean use_intrinsics = TRUE;
 
+#if LLVM_API_VERSION > 100
        if (is_faulting && bb->region != -1 && !ctx->cfg->llvm_only) {
+               /* The llvm.mono.load/store intrinsics are not supported by this llvm version, emit an explicit null check instead */
+               LLVMValueRef cmp = LLVMBuildICmp (*builder_ref, LLVMIntEQ, addr, LLVMConstNull (LLVMTypeOf (addr)), "");
+               emit_cond_system_exception (ctx, bb, "NullReferenceException", cmp);
+               *builder_ref = ctx->builder;
+               use_intrinsics = FALSE;
+       }
+#endif
+
+       if (is_faulting && bb->region != -1 && !ctx->cfg->llvm_only && use_intrinsics) {
                LLVMAtomicOrdering ordering;
 
                switch (barrier) {
@@ -2035,8 +2057,7 @@ emit_cond_system_exception (EmitContext *ctx, MonoBasicBlock *bb, const char *ex
 
        LLVMBuildCondBr (ctx->builder, cmp, ex_bb, noex_bb);
 
-       exc_class = mono_class_from_name (mono_get_corlib (), "System", exc_type);
-       g_assert (exc_class);
+       exc_class = mono_class_load_from_name (mono_get_corlib (), "System", exc_type);
 
        /* Emit exception throwing code */
        ctx->builder = builder = create_builder (ctx);
@@ -4852,7 +4873,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                        break;
                case OP_FCONV_TO_U1:
                case OP_RCONV_TO_U1:
-                       values [ins->dreg] = LLVMBuildZExt (builder, LLVMBuildFPToUI (builder, lhs, LLVMInt8Type (), dname), LLVMInt32Type (), "");
+                       values [ins->dreg] = LLVMBuildZExt (builder, LLVMBuildTrunc (builder, LLVMBuildFPToUI (builder, lhs, IntPtrType (), dname), LLVMInt8Type (), ""), LLVMInt32Type (), "");
                        break;
                case OP_FCONV_TO_I2:
                case OP_RCONV_TO_I2:
@@ -5014,7 +5035,9 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb)
                                 * they can't fail, allowing them to be hoisted out of loops.
                                 */
                                set_invariant_load_flag (values [ins->dreg]);
+#if LLVM_API_VERSION < 100
                                set_metadata_flag (values [ins->dreg], "mono.nofail.load");
+#endif
                        }
 
                        if (sext)
index 0b1265e9e7844b744df10536a41500bb5b1038f8..a5453a88e05ca98d64213755782cbbb9bdf325b6 100644 (file)
@@ -221,8 +221,7 @@ mips_emit_exc_by_name(guint8 *code, const char *name)
        gpointer addr;
        MonoClass *exc_class;
 
-       exc_class = mono_class_from_name (mono_defaults.corlib, "System", name);
-       g_assert (exc_class);
+       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", name);
 
        mips_load_const (code, mips_a0, exc_class->type_token);
        addr = mono_get_throw_corlib_exception ();
index 9e715e2dd71e52383fd04b63f250b2236dbd7ca9..c9116ff46e1e6a974f1e5391de97731bc38bd90e 100644 (file)
@@ -5621,8 +5621,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
                                exc_throw_pos [i] = code;
                        }
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
 
                        ppc_patch (ip, code);
                        /*mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_EXC_NAME, patch_info->data.target);*/
index 89633ace28f8014431daff579bafb34f0f23352e..a3fe3305d5c476af87670d5925414a5f628f8a3f 100644 (file)
@@ -825,7 +825,8 @@ mono_get_lmf_addr (void)
         * mono_get_lmf_addr, and mono_get_lmf_addr requires the thread to be attached.
         */
 
-       mono_jit_thread_attach (NULL);
+       mono_thread_attach (mono_get_root_domain ());
+       mono_thread_set_state (mono_thread_internal_current (), ThreadState_Background);
 
        if ((jit_tls = mono_native_tls_get_value (mono_jit_tls_id)))
                return &jit_tls->lmf;
@@ -884,48 +885,119 @@ mono_set_lmf_addr (gpointer lmf_addr)
 }
 
 /*
- * mono_jit_thread_attach:
+ * mono_jit_thread_attach: called by native->managed wrappers
  *
- * Called by native->managed wrappers. Returns the original domain which needs to be
- * restored, or NULL.
+ * In non-coop mode:
+ *  - @dummy: is NULL
+ *  - @return: the original domain which needs to be restored, or NULL.
+ *
+ * In coop mode:
+ *  - @dummy: contains the original domain
+ *  - @return: a cookie containing current MonoThreadInfo* if it was in BLOCKING mode, NULL otherwise
  */
-MonoDomain*
-mono_jit_thread_attach (MonoDomain *domain)
+gpointer
+mono_jit_thread_attach (MonoDomain *domain, gpointer *dummy)
 {
        MonoDomain *orig;
 
-       if (!domain)
-               /*
-                * Happens when called from AOTed code which is only used in the root
-                * domain.
-                */
+       if (!domain) {
+               /* Happens when called from AOTed code which is only used in the root domain. */
                domain = mono_get_root_domain ();
+       }
+
+       g_assert (domain);
+
+       if (!mono_threads_is_coop_enabled ()) {
+               gboolean attached;
 
 #ifdef MONO_HAVE_FAST_TLS
-       if (!MONO_FAST_TLS_GET (mono_lmf_addr)) {
-               mono_thread_attach (domain);
-               // #678164
-               mono_thread_set_state (mono_thread_internal_current (), ThreadState_Background);
-       }
+               attached = MONO_FAST_TLS_GET (mono_lmf_addr) != NULL;
 #else
-       if (!mono_native_tls_get_value (mono_jit_tls_id)) {
-               mono_thread_attach (domain);
-               mono_thread_set_state (mono_thread_internal_current (), ThreadState_Background);
-       }
+               attached = mono_native_tls_get_value (mono_jit_tls_id) != NULL;
 #endif
-       orig = mono_domain_get ();
-       if (orig != domain)
-               mono_domain_set (domain, TRUE);
 
-       return orig != domain ? orig : NULL;
+               if (!attached) {
+                       mono_thread_attach (domain);
+
+                       // #678164
+                       mono_thread_set_state (mono_thread_internal_current (), ThreadState_Background);
+               }
+
+               orig = mono_domain_get ();
+               if (orig != domain)
+                       mono_domain_set (domain, TRUE);
+
+               return orig != domain ? orig : NULL;
+       } else {
+               MonoThreadInfo *info;
+
+               info = mono_thread_info_current_unchecked ();
+               if (!info || !mono_thread_info_is_live (info)) {
+                       /* thread state STARTING -> RUNNING */
+                       mono_thread_attach (domain);
+
+                       // #678164
+                       mono_thread_set_state (mono_thread_internal_current (), ThreadState_Background);
+
+                       *dummy = NULL;
+
+                       /* mono_threads_reset_blocking_start returns the current MonoThreadInfo
+                        * if we were in BLOCKING mode */
+                       return mono_thread_info_current ();
+               } else {
+                       orig = mono_domain_get ();
+
+                       /* orig might be null if we did an attach -> detach -> attach sequence */
+
+                       if (orig != domain)
+                               mono_domain_set (domain, TRUE);
+
+                       *dummy = orig;
+
+                       /* thread state (BLOCKING|RUNNING) -> RUNNING */
+                       return mono_threads_reset_blocking_start (dummy);
+               }
+       }
 }
 
-/* Called by native->managed wrappers */
+/*
+ * mono_jit_thread_detach: called by native->managed wrappers
+ *
+ * In non-coop mode:
+ *  - @cookie: the original domain which needs to be restored, or NULL.
+ *  - @dummy: is NULL
+ *
+ * In coop mode:
+ *  - @cookie: contains current MonoThreadInfo* if it was in BLOCKING mode, NULL otherwise
+ *  - @dummy: contains the original domain
+ */
 void
-mono_jit_set_domain (MonoDomain *domain)
+mono_jit_thread_detach (gpointer cookie, gpointer *dummy)
 {
-       if (domain)
-               mono_domain_set (domain, TRUE);
+       MonoDomain *domain, *orig;
+
+       if (!mono_threads_is_coop_enabled ()) {
+               orig = (MonoDomain*) cookie;
+
+               if (orig)
+                       mono_domain_set (orig, TRUE);
+       } else {
+               orig = (MonoDomain*) *dummy;
+
+               domain = mono_domain_get ();
+               g_assert (domain);
+
+               /* it won't do anything if cookie is NULL
+                * thread state RUNNING -> (RUNNING|BLOCKING) */
+               mono_threads_reset_blocking_end (cookie, dummy);
+
+               if (orig != domain) {
+                       if (!orig)
+                               mono_domain_unset ();
+                       else
+                               mono_domain_set (orig, TRUE);
+               }
+       }
 }
 
 /**
@@ -3309,6 +3381,43 @@ register_jit_stats (void)
        mono_counters_register ("Methods from AOT", MONO_COUNTER_JIT | MONO_COUNTER_INT, &mono_jit_stats.methods_aot);
        mono_counters_register ("Methods JITted using mono JIT", MONO_COUNTER_JIT | MONO_COUNTER_INT, &mono_jit_stats.methods_without_llvm);
        mono_counters_register ("Methods JITted using LLVM", MONO_COUNTER_JIT | MONO_COUNTER_INT, &mono_jit_stats.methods_with_llvm);
+       mono_counters_register ("JIT/method-to-IR (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_method_to_ir);
+       mono_counters_register ("JIT/liveness_handle_exception_clauses (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_liveness_handle_exception_clauses);
+       mono_counters_register ("JIT/handle_out_of_line_bblock (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_handle_out_of_line_bblock);
+       mono_counters_register ("JIT/decompose_long_opts (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_decompose_long_opts);
+       mono_counters_register ("JIT/local_cprop (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_local_cprop);
+       mono_counters_register ("JIT/local_emulate_ops (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_local_emulate_ops);
+       mono_counters_register ("JIT/optimize_branches (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_optimize_branches);
+       mono_counters_register ("JIT/handle_global_vregs (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_handle_global_vregs);
+       mono_counters_register ("JIT/local_deadce (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_local_deadce);
+       mono_counters_register ("JIT/local_alias_analysis (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_local_alias_analysis);
+       mono_counters_register ("JIT/if_conversion (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_if_conversion);
+       mono_counters_register ("JIT/bb_ordering (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_bb_ordering);
+       mono_counters_register ("JIT/compile_dominator_info (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_compile_dominator_info);
+       mono_counters_register ("JIT/compute_natural_loops (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_compute_natural_loops);
+       mono_counters_register ("JIT/insert_safepoints (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_insert_safepoints);
+       mono_counters_register ("JIT/ssa_compute (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_ssa_compute);
+       mono_counters_register ("JIT/ssa_cprop (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_ssa_cprop);
+       mono_counters_register ("JIT/ssa_deadce(sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_ssa_deadce);
+       mono_counters_register ("JIT/perform_abc_removal (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_perform_abc_removal);
+       mono_counters_register ("JIT/ssa_remove (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_ssa_remove);
+       mono_counters_register ("JIT/local_cprop2 (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_local_cprop2);
+       mono_counters_register ("JIT/handle_global_vregs2 (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_handle_global_vregs2);
+       mono_counters_register ("JIT/local_deadce2 (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_local_deadce2);
+       mono_counters_register ("JIT/optimize_branches2 (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_optimize_branches2);
+       mono_counters_register ("JIT/decompose_vtype_opts (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_decompose_vtype_opts);
+       mono_counters_register ("JIT/decompose_array_access_opts (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_decompose_array_access_opts);
+       mono_counters_register ("JIT/liveness_handle_exception_clauses2 (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_liveness_handle_exception_clauses2);
+       mono_counters_register ("JIT/analyze_liveness (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_analyze_liveness);
+       mono_counters_register ("JIT/linear_scan (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_linear_scan);
+       mono_counters_register ("JIT/arch_allocate_vars (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_arch_allocate_vars);
+       mono_counters_register ("JIT/spill_global_vars (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_spill_global_vars);
+       mono_counters_register ("JIT/jit_local_cprop3 (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_local_cprop3);
+       mono_counters_register ("JIT/jit_local_deadce3 (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_local_deadce3);
+       mono_counters_register ("JIT/codegen (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_codegen);
+       mono_counters_register ("JIT/create_jit_info (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_create_jit_info);
+       mono_counters_register ("JIT/gc_create_gc_map (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_gc_create_gc_map);
+       mono_counters_register ("JIT/save_seq_point_info (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_save_seq_point_info);
        mono_counters_register ("Total time spent JITting (sec)", MONO_COUNTER_JIT | MONO_COUNTER_DOUBLE, &mono_jit_stats.jit_time);
        mono_counters_register ("Basic blocks", MONO_COUNTER_JIT | MONO_COUNTER_INT, &mono_jit_stats.basic_blocks);
        mono_counters_register ("Max basic blocks", MONO_COUNTER_JIT | MONO_COUNTER_INT, &mono_jit_stats.max_basic_blocks);
@@ -3740,8 +3849,8 @@ register_icalls (void)
        register_icall (mono_trace_enter_method, "mono_trace_enter_method", NULL, TRUE);
        register_icall (mono_trace_leave_method, "mono_trace_leave_method", NULL, TRUE);
        register_icall (mono_get_lmf_addr, "mono_get_lmf_addr", "ptr", TRUE);
-       register_icall (mono_jit_thread_attach, "mono_jit_thread_attach", "ptr ptr", TRUE);
-       register_icall (mono_jit_set_domain, "mono_jit_set_domain", "void ptr", TRUE);
+       register_icall (mono_jit_thread_attach, "mono_jit_thread_attach", "ptr ptr ptr", TRUE);
+       register_icall (mono_jit_thread_detach, "mono_jit_thread_detach", "void ptr ptr", TRUE);
        register_icall (mono_domain_get, "mono_domain_get", "ptr", TRUE);
 
        register_icall (mono_llvm_throw_exception, "mono_llvm_throw_exception", "void object", TRUE);
index a4a7776094c57ab7ee2372e50f8da6d51f4e4d2b..4cf7b4df7ad0a69e069da3f066ad2007e8b29b0e 100644 (file)
@@ -6077,10 +6077,9 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
                        /*-----------------------------------------------------*/
                        s390_patch_rel (ip + 2, (guint64) S390_RELATIVE(code,ip));
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, 
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib,
                                                          "System", 
                                                          patch_info->data.name);
-                       g_assert (exc_class);
                        throw_ip = patch_info->ip.i;
 
                        for (iExc = 0; iExc < nThrows; ++iExc)
index 7f99809d51f5bbfda35588899c28e3940d0abb3c..f791290851c2f393bee65d55f528c919f7c13dec 100644 (file)
@@ -4208,8 +4208,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
 
                        sparc_patch ((guint32*)(cfg->native_code + patch_info->ip.i), code);
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
                        type_idx = exc_class->type_token - MONO_TOKEN_TYPE_DEF;
                        throw_ip = patch_info->ip.i;
 
index 0407c7cc57e4d6a527a24d3a80d17c7deb754b8c..c772cf21305605e745e101c8e4b7bb8563bb0660 100644 (file)
@@ -5664,8 +5664,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
 
                        x86_patch (patch_info->ip.i + cfg->native_code, code);
 
-                       exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
-                       g_assert (exc_class);
+                       exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
                        throw_ip = patch_info->ip.i;
 
                        /* Find a throw sequence for the same exception class */
index a93659383f1ec435fd91b5677ee222f44b8188bc..09b31feaaf278fab0b2b50ab5a7d82c03ac8d720 100644 (file)
@@ -2713,6 +2713,42 @@ compute_reachable (MonoBasicBlock *bb)
        }
 }
 
+static void mono_bb_ordering (MonoCompile *cfg)
+{
+       int dfn = 0;
+       /* Depth-first ordering on basic blocks */
+       cfg->bblocks = (MonoBasicBlock **)mono_mempool_alloc (cfg->mempool, sizeof (MonoBasicBlock*) * (cfg->num_bblocks + 1));
+
+       cfg->max_block_num = cfg->num_bblocks;
+
+       df_visit (cfg->bb_entry, &dfn, cfg->bblocks);
+       if (cfg->num_bblocks != dfn + 1) {
+               MonoBasicBlock *bb;
+
+               cfg->num_bblocks = dfn + 1;
+
+               /* remove unreachable code, because the code in them may be 
+                * inconsistent  (access to dead variables for example) */
+               for (bb = cfg->bb_entry; bb; bb = bb->next_bb)
+                       bb->flags &= ~BB_VISITED;
+               compute_reachable (cfg->bb_entry);
+               for (bb = cfg->bb_entry; bb; bb = bb->next_bb)
+                       if (bb->flags & BB_EXCEPTION_HANDLER)
+                               compute_reachable (bb);
+               for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+                       if (!(bb->flags & BB_VISITED)) {
+                               if (cfg->verbose_level > 1)
+                                       g_print ("found unreachable code in BB%d\n", bb->block_num);
+                               bb->code = bb->last_ins = NULL;
+                               while (bb->out_count)
+                                       mono_unlink_bblock (cfg, bb, bb->out_bb [0]);
+                       }
+               }
+               for (bb = cfg->bb_entry; bb; bb = bb->next_bb)
+                       bb->flags &= ~BB_VISITED;
+       }
+}
+
 static void
 mono_handle_out_of_line_bblock (MonoCompile *cfg)
 {
@@ -3220,6 +3256,52 @@ mono_insert_safepoints (MonoCompile *cfg)
 
 }
 
+
+static void
+mono_insert_branches_between_bblocks (MonoCompile *cfg)
+{
+       MonoBasicBlock *bb;
+
+       /* Add branches between non-consecutive bblocks */
+       for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+               if (bb->last_ins && MONO_IS_COND_BRANCH_OP (bb->last_ins) &&
+                       bb->last_ins->inst_false_bb && bb->next_bb != bb->last_ins->inst_false_bb) {
+                       /* we are careful when inverting, since bugs like #59580
+                        * could show up when dealing with NaNs.
+                        */
+                       if (MONO_IS_COND_BRANCH_NOFP(bb->last_ins) && bb->next_bb == bb->last_ins->inst_true_bb) {
+                               MonoBasicBlock *tmp =  bb->last_ins->inst_true_bb;
+                               bb->last_ins->inst_true_bb = bb->last_ins->inst_false_bb;
+                               bb->last_ins->inst_false_bb = tmp;
+
+                               bb->last_ins->opcode = mono_reverse_branch_op (bb->last_ins->opcode);
+                       } else {
+                               MonoInst *inst = (MonoInst *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst));
+                               inst->opcode = OP_BR;
+                               inst->inst_target_bb = bb->last_ins->inst_false_bb;
+                               mono_bblock_add_inst (bb, inst);
+                       }
+               }
+       }
+
+       if (cfg->verbose_level >= 4) {
+               for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+                       MonoInst *tree = bb->code;
+                       g_print ("DUMP BLOCK %d:\n", bb->block_num);
+                       if (!tree)
+                               continue;
+                       for (; tree; tree = tree->next) {
+                               mono_print_ins_index (-1, tree);
+                       }
+               }
+       }
+
+       /* FIXME: */
+       for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+               bb->max_vreg = cfg->next_vreg;
+       }
+}
+
 static void
 init_backend (MonoBackend *backend)
 {
@@ -3303,7 +3385,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        MonoMethodSignature *sig;
        MonoError err;
        MonoCompile *cfg;
-       int dfn, i, code_size_ratio;
+       int i, code_size_ratio;
        gboolean try_generic_shared, try_llvm = FALSE;
        MonoMethod *method_to_compile, *method_to_register;
        gboolean method_is_gshared = FALSE;
@@ -3649,7 +3731,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
         */
        mono_compile_create_vars (cfg);
 
-       i = mono_method_to_ir (cfg, method_to_compile, NULL, NULL, NULL, NULL, 0, FALSE);
+       MONO_TIME_TRACK (mono_jit_stats.jit_method_to_ir, i = mono_method_to_ir (cfg, method_to_compile, NULL, NULL, NULL, NULL, 0, FALSE));
 
        if (i < 0) {
                if (try_generic_shared && cfg->exception_type == MONO_EXCEPTION_GENERIC_SHARING_FAILED) {
@@ -3710,71 +3792,43 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
         * This also allows SSA to be run on methods containing exception clauses, since
         * SSA will ignore variables marked VOLATILE.
         */
-       mono_liveness_handle_exception_clauses (cfg);
+       MONO_TIME_TRACK (mono_jit_stats.jit_liveness_handle_exception_clauses, mono_liveness_handle_exception_clauses (cfg));
 
-       mono_handle_out_of_line_bblock (cfg);
+       MONO_TIME_TRACK (mono_jit_stats.jit_handle_out_of_line_bblock, mono_handle_out_of_line_bblock (cfg));
 
        /*g_print ("numblocks = %d\n", cfg->num_bblocks);*/
 
-       if (!COMPILE_LLVM (cfg))
-               mono_decompose_long_opts (cfg);
+       if (!COMPILE_LLVM (cfg)) {
+               MONO_TIME_TRACK (mono_jit_stats.jit_decompose_long_opts, mono_decompose_long_opts (cfg));
+       }
 
        /* Should be done before branch opts */
        if (cfg->opt & (MONO_OPT_CONSPROP | MONO_OPT_COPYPROP))
-               mono_local_cprop (cfg);
+               MONO_TIME_TRACK (mono_jit_stats.jit_local_cprop, mono_local_cprop (cfg));
+
        /*
         * Should be done after cprop which can do strength reduction on
         * some of these ops, after propagating immediates.
         */
        if (cfg->has_emulated_ops)
-               mono_local_emulate_ops (cfg);
+               MONO_TIME_TRACK (mono_jit_stats.jit_local_emulate_ops, mono_local_emulate_ops (cfg));
+
        if (cfg->opt & MONO_OPT_BRANCH)
-               mono_optimize_branches (cfg);
+               MONO_TIME_TRACK (mono_jit_stats.jit_optimize_branches, mono_optimize_branches (cfg));
 
        /* This must be done _before_ global reg alloc and _after_ decompose */
-       mono_handle_global_vregs (cfg);
+       MONO_TIME_TRACK (mono_jit_stats.jit_handle_global_vregs, mono_handle_global_vregs (cfg));
        if (cfg->opt & MONO_OPT_DEADCE)
-               mono_local_deadce (cfg);
+               MONO_TIME_TRACK (mono_jit_stats.jit_local_deadce, mono_local_deadce (cfg));
        if (cfg->opt & MONO_OPT_ALIAS_ANALYSIS)
-               mono_local_alias_analysis (cfg);
+               MONO_TIME_TRACK (mono_jit_stats.jit_local_alias_analysis, mono_local_alias_analysis (cfg));
        /* Disable this for LLVM to make the IR easier to handle */
        if (!COMPILE_LLVM (cfg))
-               mono_if_conversion (cfg);
+               MONO_TIME_TRACK (mono_jit_stats.jit_if_conversion, mono_if_conversion (cfg));
 
        mono_threads_safepoint ();
 
-       /* Depth-first ordering on basic blocks */
-       cfg->bblocks = (MonoBasicBlock **)mono_mempool_alloc (cfg->mempool, sizeof (MonoBasicBlock*) * (cfg->num_bblocks + 1));
-
-       cfg->max_block_num = cfg->num_bblocks;
-
-       dfn = 0;
-       df_visit (cfg->bb_entry, &dfn, cfg->bblocks);
-       if (cfg->num_bblocks != dfn + 1) {
-               MonoBasicBlock *bb;
-
-               cfg->num_bblocks = dfn + 1;
-
-               /* remove unreachable code, because the code in them may be 
-                * inconsistent  (access to dead variables for example) */
-               for (bb = cfg->bb_entry; bb; bb = bb->next_bb)
-                       bb->flags &= ~BB_VISITED;
-               compute_reachable (cfg->bb_entry);
-               for (bb = cfg->bb_entry; bb; bb = bb->next_bb)
-                       if (bb->flags & BB_EXCEPTION_HANDLER)
-                               compute_reachable (bb);
-               for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
-                       if (!(bb->flags & BB_VISITED)) {
-                               if (cfg->verbose_level > 1)
-                                       g_print ("found unreachable code in BB%d\n", bb->block_num);
-                               bb->code = bb->last_ins = NULL;
-                               while (bb->out_count)
-                                       mono_unlink_bblock (cfg, bb, bb->out_bb [0]);
-                       }
-               }
-               for (bb = cfg->bb_entry; bb; bb = bb->next_bb)
-                       bb->flags &= ~BB_VISITED;
-       }
+       MONO_TIME_TRACK (mono_jit_stats.jit_bb_ordering, mono_bb_ordering (cfg));
 
        if (((cfg->num_varinfo > 2000) || (cfg->num_bblocks > 1000)) && !cfg->compile_aot) {
                /* 
@@ -3787,11 +3841,11 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        }
 
        if (cfg->opt & MONO_OPT_LOOP) {
-               mono_compile_dominator_info (cfg, MONO_COMP_DOM | MONO_COMP_IDOM);
-               mono_compute_natural_loops (cfg);
+               MONO_TIME_TRACK (mono_jit_stats.jit_compile_dominator_info, mono_compile_dominator_info (cfg, MONO_COMP_DOM | MONO_COMP_IDOM));
+               MONO_TIME_TRACK (mono_jit_stats.jit_compute_natural_loops, mono_compute_natural_loops (cfg));
        }
 
-       mono_insert_safepoints (cfg);
+       MONO_TIME_TRACK (mono_jit_stats.jit_insert_safepoints, mono_insert_safepoints (cfg));
 
        /* after method_to_ir */
        if (parts == 1) {
@@ -3820,7 +3874,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        if (cfg->opt & MONO_OPT_SSA) {
                if (!(cfg->comp_done & MONO_COMP_SSA) && !cfg->disable_ssa) {
 #ifndef DISABLE_SSA
-                       mono_ssa_compute (cfg);
+                       MONO_TIME_TRACK (mono_jit_stats.jit_ssa_compute, mono_ssa_compute (cfg));
 #endif
 
                        if (cfg->verbose_level >= 2) {
@@ -3840,7 +3894,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        if ((cfg->opt & MONO_OPT_CONSPROP) || (cfg->opt & MONO_OPT_COPYPROP)) {
                if (cfg->comp_done & MONO_COMP_SSA && !COMPILE_LLVM (cfg)) {
 #ifndef DISABLE_SSA
-                       mono_ssa_cprop (cfg);
+                       MONO_TIME_TRACK (mono_jit_stats.jit_ssa_cprop, mono_ssa_cprop (cfg));
 #endif
                }
        }
@@ -3850,19 +3904,19 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
                //mono_ssa_strength_reduction (cfg);
 
                if (cfg->opt & MONO_OPT_DEADCE)
-                       mono_ssa_deadce (cfg);
+                       MONO_TIME_TRACK (mono_jit_stats.jit_ssa_deadce, mono_ssa_deadce (cfg));
 
                if ((cfg->flags & (MONO_CFG_HAS_LDELEMA|MONO_CFG_HAS_CHECK_THIS)) && (cfg->opt & MONO_OPT_ABCREM))
-                       mono_perform_abc_removal (cfg);
+                       MONO_TIME_TRACK (mono_jit_stats.jit_perform_abc_removal, mono_perform_abc_removal (cfg));
 
-               mono_ssa_remove (cfg);
-               mono_local_cprop (cfg);
-               mono_handle_global_vregs (cfg);
+               MONO_TIME_TRACK (mono_jit_stats.jit_ssa_remove, mono_ssa_remove (cfg));
+               MONO_TIME_TRACK (mono_jit_stats.jit_local_cprop2, mono_local_cprop (cfg));
+               MONO_TIME_TRACK (mono_jit_stats.jit_handle_global_vregs2, mono_handle_global_vregs (cfg));
                if (cfg->opt & MONO_OPT_DEADCE)
-                       mono_local_deadce (cfg);
+                       MONO_TIME_TRACK (mono_jit_stats.jit_local_deadce2, mono_local_deadce (cfg));
 
                if (cfg->opt & MONO_OPT_BRANCH)
-                       mono_optimize_branches (cfg);
+                       MONO_TIME_TRACK (mono_jit_stats.jit_optimize_branches2, mono_optimize_branches (cfg));
        }
 #endif
 
@@ -3887,9 +3941,9 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        if (COMPILE_SOFT_FLOAT (cfg))
                mono_decompose_soft_float (cfg);
 #endif
-       mono_decompose_vtype_opts (cfg);
+       MONO_TIME_TRACK (mono_jit_stats.jit_decompose_vtype_opts, mono_decompose_vtype_opts (cfg));
        if (cfg->flags & MONO_CFG_HAS_ARRAY_ACCESS)
-               mono_decompose_array_access_opts (cfg);
+               MONO_TIME_TRACK (mono_jit_stats.jit_decompose_array_access_opts, mono_decompose_array_access_opts (cfg));
 
        if (cfg->got_var) {
 #ifndef MONO_ARCH_GOT_REG
@@ -3922,7 +3976,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        /*
         * Have to call this again to process variables added since the first call.
         */
-       mono_liveness_handle_exception_clauses (cfg);
+       MONO_TIME_TRACK(mono_jit_stats.jit_liveness_handle_exception_clauses2, mono_liveness_handle_exception_clauses (cfg));
 
        if (cfg->opt & MONO_OPT_LINEARS) {
                GList *vars, *regs, *l;
@@ -3930,7 +3984,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
                /* fixme: maybe we can avoid to compute livenesss here if already computed ? */
                cfg->comp_done &= ~MONO_COMP_LIVENESS;
                if (!(cfg->comp_done & MONO_COMP_LIVENESS))
-                       mono_analyze_liveness (cfg);
+                       MONO_TIME_TRACK (mono_jit_stats.jit_analyze_liveness, mono_analyze_liveness (cfg));
 
                if ((vars = mono_arch_get_allocatable_int_vars (cfg))) {
                        regs = mono_arch_get_global_int_regs (cfg);
@@ -3943,7 +3997,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
                                        }
                                }
                        }
-                       mono_linear_scan (cfg, vars, regs, &cfg->used_int_regs);
+                       MONO_TIME_TRACK (mono_jit_stats.jit_linear_scan, mono_linear_scan (cfg, vars, regs, &cfg->used_int_regs));
                }
        }
 
@@ -3953,69 +4007,28 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        
        /* variables are allocated after decompose, since decompose could create temps */
        if (!COMPILE_LLVM (cfg)) {
-               mono_arch_allocate_vars (cfg);
+               MONO_TIME_TRACK (mono_jit_stats.jit_arch_allocate_vars, mono_arch_allocate_vars (cfg));
                if (cfg->exception_type)
                        return cfg;
        }
 
-       {
-               MonoBasicBlock *bb;
-               gboolean need_local_opts;
-
-               if (cfg->gsharedvt)
-                       mono_allocate_gsharedvt_vars (cfg);
-
-               if (!COMPILE_LLVM (cfg)) {
-                       mono_spill_global_vars (cfg, &need_local_opts);
-
-                       if (need_local_opts || cfg->compile_aot) {
-                               /* To optimize code created by spill_global_vars */
-                               mono_local_cprop (cfg);
-                               if (cfg->opt & MONO_OPT_DEADCE)
-                                       mono_local_deadce (cfg);
-                       }
-               }
-
-               /* Add branches between non-consecutive bblocks */
-               for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
-                       if (bb->last_ins && MONO_IS_COND_BRANCH_OP (bb->last_ins) &&
-                               bb->last_ins->inst_false_bb && bb->next_bb != bb->last_ins->inst_false_bb) {
-                               /* we are careful when inverting, since bugs like #59580
-                                * could show up when dealing with NaNs.
-                                */
-                               if (MONO_IS_COND_BRANCH_NOFP(bb->last_ins) && bb->next_bb == bb->last_ins->inst_true_bb) {
-                                       MonoBasicBlock *tmp =  bb->last_ins->inst_true_bb;
-                                       bb->last_ins->inst_true_bb = bb->last_ins->inst_false_bb;
-                                       bb->last_ins->inst_false_bb = tmp;
-
-                                       bb->last_ins->opcode = mono_reverse_branch_op (bb->last_ins->opcode);
-                               } else {                        
-                                       MonoInst *inst = (MonoInst *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst));
-                                       inst->opcode = OP_BR;
-                                       inst->inst_target_bb = bb->last_ins->inst_false_bb;
-                                       mono_bblock_add_inst (bb, inst);
-                               }
-                       }
-               }
+       if (cfg->gsharedvt)
+               mono_allocate_gsharedvt_vars (cfg);
 
-               if (cfg->verbose_level >= 4) {
-                       for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
-                               MonoInst *tree = bb->code;      
-                               g_print ("DUMP BLOCK %d:\n", bb->block_num);
-                               if (!tree)
-                                       continue;
-                               for (; tree; tree = tree->next) {
-                                       mono_print_ins_index (-1, tree);
-                               }
-                       }
-               }
+       if (!COMPILE_LLVM (cfg)) {
+               gboolean need_local_opts;
+               MONO_TIME_TRACK (mono_jit_stats.jit_spill_global_vars, mono_spill_global_vars (cfg, &need_local_opts));
 
-               /* FIXME: */
-               for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
-                       bb->max_vreg = cfg->next_vreg;
+               if (need_local_opts || cfg->compile_aot) {
+                       /* To optimize code created by spill_global_vars */
+                       MONO_TIME_TRACK (mono_jit_stats.jit_local_cprop3, mono_local_cprop (cfg));
+                       if (cfg->opt & MONO_OPT_DEADCE)
+                               MONO_TIME_TRACK (mono_jit_stats.jit_local_deadce3, mono_local_deadce (cfg));
                }
        }
 
+       mono_insert_branches_between_bblocks (cfg);
+
        if (COMPILE_LLVM (cfg)) {
 #ifdef ENABLE_LLVM
                char *nm;
@@ -4055,7 +4068,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
                }
 #endif
        } else {
-               mono_codegen (cfg);
+               MONO_TIME_TRACK (mono_jit_stats.jit_codegen, mono_codegen (cfg));
        }
 
        if (COMPILE_LLVM (cfg))
@@ -4063,7 +4076,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        else
                InterlockedIncrement (&mono_jit_stats.methods_without_llvm);
 
-       cfg->jit_info = create_jit_info (cfg, method_to_compile);
+       MONO_TIME_TRACK (mono_jit_stats.jit_create_jit_info, cfg->jit_info = create_jit_info (cfg, method_to_compile));
 
 #ifdef MONO_ARCH_HAVE_LIVERANGE_OPS
        if (cfg->extend_live_ranges) {
@@ -4076,9 +4089,9 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        if (!cfg->compile_aot)
                mono_save_xdebug_info (cfg);
 
-       mini_gc_create_gc_map (cfg);
+       MONO_TIME_TRACK (mono_jit_stats.jit_gc_create_gc_map, mini_gc_create_gc_map (cfg));
  
-       mono_save_seq_point_info (cfg);
+       MONO_TIME_TRACK (mono_jit_stats.jit_save_seq_point_info, mono_save_seq_point_info (cfg));
 
        if (cfg->verbose_level >= 2) {
                char *id =  mono_method_full_name (cfg->method, FALSE);
@@ -4186,6 +4199,31 @@ create_jit_info_for_trampoline (MonoMethod *wrapper, MonoTrampInfo *info)
        return jinfo;
 }
 
+GTimer *mono_time_track_start ()
+{
+       return g_timer_new ();
+}
+
+void mono_time_track_end (double *time, GTimer *timer)
+{
+       g_timer_stop (timer);
+       *time += g_timer_elapsed (timer, NULL);
+       g_timer_destroy (timer);
+}
+
+void mono_update_jit_stats (MonoCompile *cfg)
+{
+       mono_jit_stats.allocate_var += cfg->stat_allocate_var;
+       mono_jit_stats.locals_stack_size += cfg->stat_locals_stack_size;
+       mono_jit_stats.basic_blocks += cfg->stat_basic_blocks;
+       mono_jit_stats.max_basic_blocks = MAX (cfg->stat_basic_blocks, mono_jit_stats.max_basic_blocks);
+       mono_jit_stats.cil_code_size += cfg->stat_cil_code_size;
+       mono_jit_stats.regvars += cfg->stat_n_regvars;
+       mono_jit_stats.inlineable_methods += cfg->stat_inlineable_methods;
+       mono_jit_stats.inlined_methods += cfg->stat_inlined_methods;
+       mono_jit_stats.code_reallocs += cfg->stat_code_reallocs;
+}
+
 /*
  * mono_jit_compile_method_inner:
  *
@@ -4319,14 +4357,11 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
                return NULL;
        }
 
-       jit_timer = g_timer_new ();
-
+       jit_timer = mono_time_track_start ();
        cfg = mini_method_compile (method, opt, target_domain, JIT_FLAG_RUN_CCTORS, 0, -1);
-       prof_method = cfg->method;
+       mono_time_track_end (&mono_jit_stats.jit_time, jit_timer);
 
-       g_timer_stop (jit_timer);
-       mono_jit_stats.jit_time += g_timer_elapsed (jit_timer, NULL);
-       g_timer_destroy (jit_timer);
+       prof_method = cfg->method;
 
        switch (cfg->exception_type) {
        case MONO_EXCEPTION_NONE:
@@ -4414,15 +4449,7 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
         * Update global stats while holding a lock, instead of doing many
         * InterlockedIncrement operations during JITting.
         */
-       mono_jit_stats.allocate_var += cfg->stat_allocate_var;
-       mono_jit_stats.locals_stack_size += cfg->stat_locals_stack_size;
-       mono_jit_stats.basic_blocks += cfg->stat_basic_blocks;
-       mono_jit_stats.max_basic_blocks = MAX (cfg->stat_basic_blocks, mono_jit_stats.max_basic_blocks);
-       mono_jit_stats.cil_code_size += cfg->stat_cil_code_size;
-       mono_jit_stats.regvars += cfg->stat_n_regvars;
-       mono_jit_stats.inlineable_methods += cfg->stat_inlineable_methods;
-       mono_jit_stats.inlined_methods += cfg->stat_inlined_methods;
-       mono_jit_stats.code_reallocs += cfg->stat_code_reallocs;
+       mono_update_jit_stats (cfg);
 
        mono_destroy_compile (cfg);
 
index 6954a7639ac771732aab96445870b50923a4eaea..5ebe8e3b1429305c31aef5f79670ec5f9a132982 100644 (file)
@@ -1605,8 +1605,9 @@ typedef struct {
        /* Points to a MonoGSharedVtMethodRuntimeInfo at runtime */
        MonoInst *gsharedvt_info_var;
 
-       /* For native-to-managed wrappers, the saved old domain */
-       MonoInst *orig_domain_var;
+       /* For native-to-managed wrappers, CEE_MONO_JIT_(AT|DE)TACH opcodes */
+       MonoInst *attach_cookie;
+       MonoInst *attach_dummy;
 
        MonoInst *lmf_var;
        MonoInst *lmf_addr_var;
@@ -1893,6 +1894,43 @@ typedef struct {
        int methods_without_llvm;
        char *max_ratio_method;
        char *biggest_method;
+       double jit_method_to_ir;
+       double jit_liveness_handle_exception_clauses;
+       double jit_handle_out_of_line_bblock;
+       double jit_decompose_long_opts;
+       double jit_local_cprop;
+       double jit_local_emulate_ops;
+       double jit_optimize_branches;
+       double jit_handle_global_vregs;
+       double jit_local_deadce;
+       double jit_local_alias_analysis;
+       double jit_if_conversion;
+       double jit_bb_ordering;
+       double jit_compile_dominator_info;
+       double jit_compute_natural_loops;
+       double jit_insert_safepoints;
+       double jit_ssa_compute;
+       double jit_ssa_cprop;
+       double jit_ssa_deadce;
+       double jit_perform_abc_removal;
+       double jit_ssa_remove;
+       double jit_local_cprop2;
+       double jit_handle_global_vregs2;
+       double jit_local_deadce2;
+       double jit_optimize_branches2;
+       double jit_decompose_vtype_opts;
+       double jit_decompose_array_access_opts;
+       double jit_liveness_handle_exception_clauses2;
+       double jit_analyze_liveness;
+       double jit_linear_scan;
+       double jit_arch_allocate_vars;
+       double jit_spill_global_vars;
+       double jit_local_cprop3;
+       double jit_local_deadce3;
+       double jit_codegen;
+       double jit_create_jit_info;
+       double jit_gc_create_gc_map;
+       double jit_save_seq_point_info;
        double jit_time;
        gboolean enabled;
 } MonoJitStats;
@@ -2332,8 +2370,8 @@ MonoLMF * mono_get_lmf                      (void);
 MonoLMF** mono_get_lmf_addr                 (void);
 void      mono_set_lmf                      (MonoLMF *lmf);
 MonoJitTlsData* mono_get_jit_tls            (void);
-MONO_API MonoDomain *mono_jit_thread_attach          (MonoDomain *domain);
-MONO_API void      mono_jit_set_domain               (MonoDomain *domain);
+MONO_API gpointer  mono_jit_thread_attach            (MonoDomain *domain, gpointer *dummy);
+MONO_API void      mono_jit_thread_detach            (gpointer cookie, gpointer *dummy);
 gint32    mono_get_jit_tls_offset           (void);
 gint32    mono_get_lmf_tls_offset           (void);
 gint32    mono_get_lmf_addr_tls_offset      (void);
@@ -3008,6 +3046,18 @@ void mono_cfg_add_try_hole (MonoCompile *cfg, MonoExceptionClause *clause, guint
 void mono_cfg_set_exception (MonoCompile *cfg, int type);
 void mono_cfg_set_exception_invalid_program (MonoCompile *cfg, char *msg);
 
+#define MONO_TIME_TRACK(a, phase) \
+       { \
+               GTimer *timer = mono_time_track_start (); \
+               (phase) ; \
+               mono_time_track_end (&(a), timer); \
+       }
+
+GTimer *mono_time_track_start (void);
+void mono_time_track_end (double *time, GTimer *timer);
+
+void mono_update_jit_stats (MonoCompile *cfg);
+
 gboolean mini_type_is_reference (MonoType *type);
 gboolean mini_type_is_vtype (MonoType *t) MONO_LLVM_INTERNAL;
 gboolean mini_type_var_is_vt (MonoType *type) MONO_LLVM_INTERNAL;
@@ -3115,6 +3165,11 @@ void mono_cross_helpers_run (void);
  * Signal handling
  */
 
+#ifdef DISABLE_HW_TRAPS
+ // Signal handlers not available
+#define MONO_ARCH_NEED_DIV_CHECK 1
+#endif
+
 void MONO_SIG_HANDLER_SIGNATURE (mono_sigfpe_signal_handler) ;
 void MONO_SIG_HANDLER_SIGNATURE (mono_sigill_signal_handler) ;
 void MONO_SIG_HANDLER_SIGNATURE (mono_sigsegv_signal_handler);
index 0dff9e980880e9e276e33182ceb53ea43ff693e4..7030a4b3e5fa4149528fda724c8c49e8fd51a321 100644 (file)
@@ -195,7 +195,7 @@ static inline void print_report (const gchar *format, ...)
        vfprintf (stdout, format, ap);
        fprintf (stdout, "\n");
        va_end (ap);
-       klass = mono_class_from_name (mono_get_corlib (), "System", "Environment");
+       klass = mono_class_load_from_name (mono_get_corlib (), "System", "Environment");
        mono_class_init (klass);
        prop = mono_class_get_property_from_name (klass, "StackTrace");
        str = (MonoString*)mono_property_get_value (prop, NULL, NULL, NULL);
index 97279d2fb6ddbd9e2dabf09dbb61ee5af68a174e..5bfa3a89da58104ebfd20516c665ed37dbf4bdb2 100644 (file)
@@ -350,7 +350,7 @@ public class Tests : LoadMissing {
                return 2;
        }
 
-       public static int Main () {
-               return TestDriver.RunTests (typeof (Tests));
+       public static int Main (string[] args) {
+               return TestDriver.RunTests (typeof (Tests), args);
        }
 }
index 768b169079f4b8f4a95dde7d593621761818333c..c37fc3d16cb8518dddfc115c9bf89c9512bbd599 100644 (file)
@@ -599,7 +599,7 @@ mono_error_prepare_exception (MonoError *oerror, MonoError *error_out)
                break;
 
        case MONO_ERROR_TYPE_LOAD:
-               if (error->type_name || error->assembly_name) {
+               if (error->type_name && error->assembly_name) {
                        type_name = get_type_name_as_mono_string (error, domain, error_out);
                        if (!mono_error_ok (error_out))
                                break;
index e92d3720656aedef8edd71c808d08874b841e643..d11059161c5d43f493300169f88c47a9c7aa77c0 100644 (file)
@@ -486,7 +486,6 @@ mono_jit_init_version
 mono_jit_parse_options
 mono_jit_set_aot_mode
 mono_jit_set_aot_only
-mono_jit_set_domain
 mono_jit_set_trace_options
 mono_jit_thread_attach
 mono_ldstr
index dc32801d088054e5a333d5ebdaaf7fdbbfb700c8..aaa6969cfff791a071dde4a280cc1a519050d791 100644 (file)
@@ -488,7 +488,6 @@ mono_jit_init_version
 mono_jit_parse_options
 mono_jit_set_aot_mode
 mono_jit_set_aot_only
-mono_jit_set_domain
 mono_jit_set_trace_options
 mono_jit_thread_attach
 mono_ldstr
index e86cdf9df091ca5226d28752ac9ecbf35ee6db65..223dac2e7f6edcb4ec6848e00c16e177388a4713 100755 (executable)
@@ -1,2 +1,3 @@
 #!/bin/sh
+echo "Note: dmcs is deprecated, please use mcs instead!"
 exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.5/mcs.exe -sdk:4.0 "$@"