--- /dev/null
+#*.c crlf
+#*.h crlf
+#*.cs crlf
+#*.sh crlf
+
+#ChangeLog crlf
+#*akefile* crlf
+#*.sources crlf
+
+# don't do anything to line-endings. Let CRLFs go into the repo
+*.bat -crlf
+*.sln -crlf
+*.*proj* -crlf
+
+# CRLF Handling
+# -------------
+#
+# The ideal situation would be to do no EOL normalization. Each file
+# would have a default EOL, and tools on Windows and Linux would handle
+# both EOL formats.
+#
+# We're not in the ideal world. A popular editor on Windows (possibly
+# Visual Studio) silently introduces EOL corruption -- it displays an
+# LF-file normally, but any newly added lines have CRLF. On Linux,
+# Emacs and versions of VI handle LF-files and CRLF-files properly.
+# However, emacs doesn't like files with both LF and CRLF EOLs. Editing
+# the file without additional action will increase the EOL corruption
+# in the file.
+#
+# Another vector for mixed EOLs is scripts. We mostly don't have scripts
+# that add new lines -- so we rarely see this. However, one major event
+# in the tree was the addition of copyright headers using a script. That
+# script introduced EOL corruption.
+#
+# Any automated EOL normalization of files already in the repository will
+# cause difficulties in traversing histories, assigning blame, etc. So, we
+# don't want to change what's in the repository significantly, even if it
+# causes trouble.
+#
+# What we do now:
+#
+# a) we ensure that there's no further corruption of LF-files. So, we use
+# git's 'crlf' attribute on those files to ensure that things are fine
+# when we work on Windows. We could use 'crlf=input', but it doesn't buy
+# us much -- we might as well be working with consistent EOLs for files in
+# working directories as well as in the repository
+#
+# b) if the file already of CRLFs, we don't do any normalization. We use '-crlf'
+# so that git doesn't do any EOL-conversion of the file. As I said, this
+# is mostly harmless on Linux. We can't mark these files as 'crlf' or use
+# the new (git 1.7.2) 'eol=crlf' attribute, since it changes the contents
+# _inside_ the repository [1], and hence makes history traversal annoying.
+# So, we live with occasional EOL corruption.
+#
+# c) We can handle mixed-EOL files on a case-by-case basis, converting them to
+# LF- or CRLF-files based on which causes fewer lines to change
+#
+# d) We try to ensure no further headaches, by declaring EOL normalization on
+# code files, and Unix-flavoured files, like shell-scripts, makefiles, etc.
+#
+# [1] GIT use LFs as the normalized internal representation.
# Distribute the 'mcs' tree too
dist-hook:
+ ./scripts/commits-to-changelog.py --root=$(distdir) last-commit-with-compulsory-changelog-entry
test -d $(distdir)/mcs || mkdir $(distdir)/mcs
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
same prefix than this module gets.
+
--- /dev/null
+/Compat.browser -crlf
/mono-file-formats.zip
/mono-tools.tree
/mono-tools.zip
+/AgilityPack.dll*
--- /dev/null
+/EncodingFoundException.cs -crlf
+/HtmlAttribute.cs -crlf
+/HtmlAttributeCollection.cs -crlf
+/HtmlCmdLine.cs -crlf
+/HtmlCommentNode.cs -crlf
+/HtmlConsoleListener.cs -crlf
+/HtmlDocument.cs -crlf
+/HtmlElementFlag.cs -crlf
+/HtmlEntity.cs -crlf
+/HtmlNameTable.cs -crlf
+/HtmlNode.cs -crlf
+/HtmlNodeCollection.cs -crlf
+/HtmlNodeNavigator.cs -crlf
+/HtmlNodeType.cs -crlf
+/HtmlParseError.cs -crlf
+/HtmlParseErrorCode.cs -crlf
+/HtmlTextNode.cs -crlf
+/HtmlWeb.cs -crlf
+/HtmlWebException.cs -crlf
+/IOLibrary.cs -crlf
+/LICENSE -crlf
+/MixedCodeDocument.cs -crlf
+/MixedCodeDocumentCodeFragment.cs -crlf
+/MixedCodeDocumentFragment.cs -crlf
+/MixedCodeDocumentFragmentList.cs -crlf
+/MixedCodeDocumentFragmentType.cs -crlf
+/MixedCodeDocumentTextFragment.cs -crlf
+/NameValuePair.cs -crlf
+/NameValuePairList.cs -crlf
+/crc32.cs -crlf
+2010-07-25 Zoltan Varga <vargaz@gmail.com>
+
+ * configure.ac src/eglib-config.h.in src/eglib-config.hw: Define G_GINT64_FORMAT.
+
2010-07-20 Zoltan Varga <vargaz@gmail.com>
* src/glib.h (G_LIKELY): Implement these for gcc properly.
GSIZE="long"
GSIZE_FORMAT='"lu"'
G_GUINT64_FORMAT='"lu"'
+ G_GINT64_FORMAT='"ld"'
else
GPOINTER_TO_INT="((gint) (ptr))"
GPOINTER_TO_UINT="((guint) (ptr))"
GSIZE="int"
GSIZE_FORMAT='"u"'
G_GUINT64_FORMAT='"llu"'
+ G_GINT64_FORMAT='"lld"'
fi
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_SUBST(GSIZE)
AC_SUBST(GSIZE_FORMAT)
AC_SUBST(G_GUINT64_FORMAT)
+AC_SUBST(G_GINT64_FORMAT)
AC_OUTPUT([
Makefile
#define G_GSIZE_FORMAT @GSIZE_FORMAT@
#define G_GUINT64_FORMAT @G_GUINT64_FORMAT@
+#define G_GINT64_FORMAT @G_GINT64_FORMAT@
#if @G_HAVE_ISO_VARARGS@ == 1
#define G_HAVE_ISO_VARARGS
#define G_SEARCHPATH_SEPARATOR ';'
#define G_GSIZE_FORMAT "d"
#define G_GUINT64_FORMAT "d"
+#define G_GINT64_FORMAT "d"
#define GPOINTER_TO_INT(ptr) ((gint)(intptr_t) (ptr))
#define GPOINTER_TO_UINT(ptr) ((guint)(intptr_t) (ptr))
#define GINT_TO_POINTER(v) ((gpointer)(intptr_t) (v))
--- /dev/null
+/BCC_MAKEFILE -crlf
+/digimars.mak -crlf
+2010-07-27 Geoff Norton <gnorton@novell.com>
+
+ * darwin_stop_world.c: Dont track unneeded registers for amd64.
+
2010-06-29 Geoff Norton <gnorton@novell.com>
* include/private/gc_locks.h: Implement armv6+ variants of
GC_push_one(state.__rdi);
GC_push_one(state.__rsi);
GC_push_one(state.__rbp);
- GC_push_one(state.__rsp);
GC_push_one(state.__r8);
GC_push_one(state.__r9);
GC_push_one(state.__r10);
GC_push_one(state.__r13);
GC_push_one(state.__r14);
GC_push_one(state.__r15);
- GC_push_one(state.__rip);
- GC_push_one(state.__rflags);
- GC_push_one(state.__cs);
- GC_push_one(state.__fs);
- GC_push_one(state.__gs);
#elif defined(POWERPC)
#if defined(_STRUCT_PPC_EXCEPTION_STATE) && defined(__DARWIN_UNIX03)
lo = (void*)(state.__r1 - PPC_RED_ZONE_SIZE);
# else
# if (defined(_MSDOS) || defined(_MSC_VER)) && (_M_IX86 >= 300) \
|| defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
-# if defined(__LP64__) || defined(_WIN64)\r
-# define X86_64\r
-# else\r
-# define I386\r
-# endif\r
-# define MSWIN32 /* or Win64 */\r
-# define mach_type_known\r
-# endif\r
-# if defined(_MSC_VER) && defined(_M_IA64)\r
-# define IA64\r
-# define MSWIN32 /* Really win64, but we don't treat 64-bit */\r
- /* variants as a differnt platform. */\r
+# if defined(__LP64__) || defined(_WIN64)
+# define X86_64
+# else
+# define I386
+# endif
+# define MSWIN32 /* or Win64 */
+# define mach_type_known
+# endif
+# if defined(_MSC_VER) && defined(_M_IA64)
+# define IA64
+# define MSWIN32 /* Really win64, but we don't treat 64-bit */
+ /* variants as a differnt platform. */
# endif
# endif
# if defined(__DJGPP__)
# define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
# define DATAEND /* not needed */
# endif
-\r
+
# ifdef LINUX
# if defined(__powerpc64__)
# define ALIGNMENT 8
# define PUSH4(r1,r2,r3,r4) PUSH2(r1,r2), PUSH2(r3,r4)
# if defined(I386)
PUSH4(Edi,Esi,Ebx,Edx), PUSH2(Ecx,Eax), PUSH1(Ebp);
- sp = (ptr_t)context.Esp;\r
-# elif defined(X86_64)\r
- PUSH4(Rax,Rcx,Rdx,Rbx); PUSH2(Rbp, Rsi); PUSH1(Rdi);\r
- PUSH4(R8, R9, R10, R11); PUSH4(R12, R13, R14, R15);\r
+ sp = (ptr_t)context.Esp;
+# elif defined(X86_64)
+ PUSH4(Rax,Rcx,Rdx,Rbx); PUSH2(Rbp, Rsi); PUSH1(Rdi);
+ PUSH4(R8, R9, R10, R11); PUSH4(R12, R13, R14, R15);
sp = (ptr_t)context.Rsp;
# elif defined(ARM32)
PUSH4(R0,R1,R2,R3),PUSH4(R4,R5,R6,R7),PUSH4(R8,R9,R10,R11),PUSH1(R12);
--- /dev/null
+/LICENSE.MSPL -crlf
+/ScalableMonoIcon.svg -crlf
*.mdb
*.exe
+*.dll
+*_test_*.dll.config
+*_test_*.xml
*.o
+TestResult-*.log
+TestResult-*.xml
+errors/?mcs.log
+errors/dummy.xml
+tests/?mcs.log
tests/gtest-*.dll
tests/test-*.dll
tests/xml-*.xml
tests/gxml-*.xml
tests/test-*.xml
tests/data.xml
-tests/gmcs.log
-System_test_net_2_0.dll
-System_test_net_2_0.dll.config
-TestResult-net_2_0.log
-TestResult-net_2_0.xml
+class/Mono.Data.Sqlite/test.db
class/Mono.CSharp/Mono.CSharp.dll.sources
class/RabbitMQ.Client/docs/specs/autogenerated-api-0-8.cs
class/RabbitMQ.Client/docs/specs/autogenerated-api-0-9.cs
--- /dev/null
+/Mono.Common.targets -crlf
+/Mono.Default.targets -crlf
--- /dev/null
+/makefile.build -crlf
--- /dev/null
+/README -crlf
--- /dev/null
+/RncTokenizer.cs -crlf
+/RncWriter.cs -crlf
if (p is RelaxngGrammar)
((RelaxngGrammar) p).IsSourceCompactSyntax = true;
return p;
- } catch (Exception ex) {\r
- throw new RelaxngException (String.Format ("Tokenizer error at line {0}, column {1}: {2}", Line, Column, ex.Message), ex);\r
- }\r
+ } catch (Exception ex) {
+ throw new RelaxngException (String.Format ("Tokenizer error at line {0}, column {1}: {2}", Line, Column, ex.Message), ex);
+ }
}
private void FillLocation (RelaxngElementBase el)
// (C)2003 Atsushi Enomoto\r
// (C)2004 Novell Inc.\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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
}\r
\r
}\r
-}
+}\r
//\r
// (C)2005 Novell Inc.\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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
}\r
#endregion\r
}\r
-}
+}\r
--- /dev/null
+/XmlDefaultReader.cs -crlf
//\r
// Copyright (c) 2004 Novell Inc.\r
// All rights reserved\r
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+//\r
+// 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
// Similar to SAX DefaultHandler\r
--- /dev/null
+/ns-Commons.Xml.Nvdl.xml -crlf
+/ns-Commons.Xml.Relaxng.xml -crlf
--- /dev/null
+/Nvdl.xml -crlf
+/NvdlAction.xml -crlf
+/NvdlActionList.xml -crlf
+/NvdlAllow.xml -crlf
+/NvdlAnyNamespace.xml -crlf
+/NvdlAttach.xml -crlf
+/NvdlAttachPlaceHolder.xml -crlf
+/NvdlAttributable.xml -crlf
+/NvdlBuiltInValidationProvider.xml -crlf
+/NvdlCancelAction.xml -crlf
+/NvdlCompileException.xml -crlf
+/NvdlConfig.xml -crlf
+/NvdlContext.xml -crlf
+/NvdlContextList.xml -crlf
+/NvdlElementBase.xml -crlf
+/NvdlException.xml -crlf
+/NvdlIncludedMode.xml -crlf
+/NvdlMessage.xml -crlf
+/NvdlMessageEventArgs.xml -crlf
+/NvdlMessageEventHandler.xml -crlf
+/NvdlMessageList.xml -crlf
+/NvdlMode.xml -crlf
+/NvdlModeBase.xml -crlf
+/NvdlModeList.xml -crlf
+/NvdlModeUsage.xml -crlf
+/NvdlNamespace.xml -crlf
+/NvdlNestedMode.xml -crlf
+/NvdlNoCancelAction.xml -crlf
+/NvdlNoResultAction.xml -crlf
+/NvdlOption.xml -crlf
+/NvdlOptionList.xml -crlf
+/NvdlReader.xml -crlf
+/NvdlReject.xml -crlf
+/NvdlRelaxngValidatorProvider.xml -crlf
+/NvdlResultAction.xml -crlf
+/NvdlResultType.xml -crlf
+/NvdlRule.xml -crlf
+/NvdlRuleList.xml -crlf
+/NvdlRuleTarget.xml -crlf
+/NvdlRules.xml -crlf
+/NvdlTrigger.xml -crlf
+/NvdlTriggerList.xml -crlf
+/NvdlUnwrap.xml -crlf
+/NvdlValidate.xml -crlf
+/NvdlValidatingReader.xml -crlf
+/NvdlValidationException.xml -crlf
+/NvdlValidationProvider.xml -crlf
+/NvdlValidatorGenerator.xml -crlf
+/NvdlXsdValidatorProvider.xml -crlf
--- /dev/null
+/RncParser.xml -crlf
--- /dev/null
+/IGrammarContent.xml -crlf
+/RelaxngAnyName.xml -crlf
+/RelaxngAttribute.xml -crlf
+/RelaxngBinaryContentPattern.xml -crlf
+/RelaxngChoice.xml -crlf
+/RelaxngData.xml -crlf
+/RelaxngDataSupport.xml -crlf
+/RelaxngDatatype.xml -crlf
+/RelaxngDatatypeProvider.xml -crlf
+/RelaxngDefine.xml -crlf
+/RelaxngDiv.xml -crlf
+/RelaxngElement.xml -crlf
+/RelaxngElementBase.xml -crlf
+/RelaxngEmpty.xml -crlf
+/RelaxngExcept.xml -crlf
+/RelaxngExceptNameClass.xml -crlf
+/RelaxngException.xml -crlf
+/RelaxngExternalRef.xml -crlf
+/RelaxngGrammar.xml -crlf
+/RelaxngGrammarContentList.xml -crlf
+/RelaxngGroup.xml -crlf
+/RelaxngInclude.xml -crlf
+/RelaxngInterleave.xml -crlf
+/RelaxngList.xml -crlf
+/RelaxngMergedProvider.xml -crlf
+/RelaxngMixed.xml -crlf
+/RelaxngName.xml -crlf
+/RelaxngNameChoice.xml -crlf
+/RelaxngNameClass.xml -crlf
+/RelaxngNameClassList.xml -crlf
+/RelaxngNotAllowed.xml -crlf
+/RelaxngNsName.xml -crlf
+/RelaxngOneOrMore.xml -crlf
+/RelaxngOptional.xml -crlf
+/RelaxngParam.xml -crlf
+/RelaxngParamList.xml -crlf
+/RelaxngParentRef.xml -crlf
+/RelaxngPattern.xml -crlf
+/RelaxngPatternList.xml -crlf
+/RelaxngPatternType.xml -crlf
+/RelaxngReader.xml -crlf
+/RelaxngRef.xml -crlf
+/RelaxngSingleContentPattern.xml -crlf
+/RelaxngStart.xml -crlf
+/RelaxngString.xml -crlf
+/RelaxngText.xml -crlf
+/RelaxngToken.xml -crlf
+/RelaxngValidatingReader.xml -crlf
+/RelaxngValue.xml -crlf
+/RelaxngZeroOrMore.xml -crlf
--- /dev/null
+/XmlDefaultReader.xml -crlf
--- /dev/null
+/SimpleElementPattern1.rng -crlf
+/SimpleElementPattern1.xml -crlf
+/SimpleElementPattern2.rng -crlf
+/SimpleElementPattern2.xml -crlf
+/atom.rnc -crlf
+/relaxng.rnc -crlf
+/team.rng -crlf
--- /dev/null
+/README -crlf
+/anglia-test-runner.cs -crlf
+/relaxngtest.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/ZipException.cs -crlf
[assembly: AssemblyTrademark("")]\r
[assembly: AssemblyCulture("")]\r
\r
-#if NET_2_0
+#if NET_2_0\r
[assembly: AssemblyVersion("2.6.0.0")]\r
-#else
-// not worrying about the NET_1_0 profile for now.
+#else\r
+// not worrying about the NET_1_0 profile for now.\r
[assembly: AssemblyVersion("0.6.0.0")]\r
-#endif
+#endif\r
\r
[assembly: AssemblyDelaySign(true)]\r
[assembly: AssemblyKeyFile ("SharpZipLib.pub")]\r
--- /dev/null
+/BZip2.cs -crlf
+/BZip2Constants.cs -crlf
+/BZip2InputStream.cs -crlf
+/BZip2OutputStream.cs -crlf
--- /dev/null
+/Adler32.cs -crlf
+/Crc32.cs -crlf
+/IChecksum.cs -crlf
+/StrangeCrc.cs -crlf
--- /dev/null
+/GZipConstants.cs -crlf
+/GZipInputStream.cs -crlf
+/GZipOutputStream.cs -crlf
--- /dev/null
+/InvalidHeaderException.cs -crlf
+/TarArchive.cs -crlf
+/TarBuffer.cs -crlf
+/TarEntry.cs -crlf
+/TarHeader.cs -crlf
+/TarInputStream.cs -crlf
+/TarOutputStream.cs -crlf
--- /dev/null
+/ZipConstants.cs -crlf
+/ZipEntry.cs -crlf
+/ZipFile.cs -crlf
+/ZipInputStream.cs -crlf
+/ZipOutputStream.cs -crlf
--- /dev/null
+/Deflater.cs -crlf
+/DeflaterConstants.cs -crlf
+/DeflaterEngine.cs -crlf
+/DeflaterHuffman.cs -crlf
+/DeflaterPending.cs -crlf
+/Inflater.cs -crlf
+/InflaterDynHeader.cs -crlf
+/InflaterHuffmanTree.cs -crlf
+/PendingBuffer.cs -crlf
--- /dev/null
+/DeflaterOutputStream.cs -crlf
+/InflaterInputStream.cs -crlf
+/OutputWindow.cs -crlf
+/StreamManipulator.cs -crlf
("count", Strings.GetString("ArgRange_Array"));
}
- if (count == 0)\r
- return string.Empty;\r
-\r
- string s = new string ((char) 0, count);\r
-\r
- fixed (byte* bytePtr = bytes)\r
- fixed (char* charPtr = s)\r
- fixed (char* cvt = toChars) {\r
- byte* b = bytePtr + index;\r
- char* c = charPtr;\r
+ if (count == 0)
+ return string.Empty;
+
+ string s = new string ((char) 0, count);
+
+ fixed (byte* bytePtr = bytes)
+ fixed (char* charPtr = s)
+ fixed (char* cvt = toChars) {
+ byte* b = bytePtr + index;
+ char* c = charPtr;
while(count-- != 0)
*(c++) = cvt[*(b++)];
}
-\r
- return s;\r
+
+ return s;
}
public override String GetString(byte[] bytes)
{
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/DB2ClientUtils.cs -crlf
+/DB2Command.cs -crlf
+/DB2Connection.cs -crlf
+/DB2ConnectionPool.cs -crlf
+/DB2ConnectionSettings.cs -crlf
+/DB2Constants.cs -crlf
+/DB2DataReader.cs -crlf
+/DB2Environment.cs -crlf
+/DB2Error.cs -crlf
+/DB2ErrorCollection.cs -crlf
+/DB2Exception.cs -crlf
+/DB2InfoMessageEventHandler.cs -crlf
+/DB2OpenConnection.cs -crlf
+/DB2Parameter.cs -crlf
+/DB2ParameterCollection.cs -crlf
+/DB2Transaction.cs -crlf
+/DB2Type.cs -crlf
DataAdapter = adapter;
}
- public DB2DataAdapter DataAdapter \r
+ public DB2DataAdapter DataAdapter
{
get
{
}
}
- public string QuotePrefix \r
+ public string QuotePrefix
{
get
{
{ }
}
- public string QuoteSuffix \r
+ public string QuoteSuffix
{
get
{
values += ", ";
}
- if(!((bool)dr["IsAutoIncrement"]))\r
+ if(!((bool)dr["IsAutoIncrement"]))
{
fields += column.ColumnName;
//values += ":v_" + column.ColumnName;
{
//DataColumn column = dt.Columns[i];
DataRow dr = dt.Rows[i];
- DataColumn column = new DataColumn((string)dr["ColumnName"], DB2TypeConverter.GetManagedType((int)dr["ProviderType"]));\r
- if (!((bool)dr["IsAutoIncrement"]))\r
+ DataColumn column = new DataColumn((string)dr["ColumnName"], DB2TypeConverter.GetManagedType((int)dr["ProviderType"]));
+ if (!((bool)dr["IsAutoIncrement"]))
{
DB2Parameter aux = new DB2Parameter("v_" + column.ColumnName, column.DataType);
aux.Direction = ParameterDirection.Input;
string wheres = "";
for (int i = 0; i < dt.Rows.Count; i++)
{
- if (sets.Length != 0 && !((bool)dt.Rows[i]["IsAutoIncrement"]))\r
+ if (sets.Length != 0 && !((bool)dt.Rows[i]["IsAutoIncrement"]))
{
sets += ", ";
}
{
DataRow dr = dt.Rows[i];
DataColumn column = new DataColumn((string)dr["ColumnName"], DB2TypeConverter.GetManagedType((int)dr["ProviderType"]));
- if (!((bool)dr["IsAutoIncrement"]))\r
+ if (!((bool)dr["IsAutoIncrement"]))
{
DB2Parameter aux = new DB2Parameter("s_" + column.ColumnName, column.DataType);
aux.Direction = ParameterDirection.Input;
deleteCommand = null;
}
- private DataTable GetSchema()\r
+ private DataTable GetSchema()
{
dataAdapter.SelectCommand.Connection.Open();
DB2Command cmd = new DB2Command(dataAdapter.SelectCommand.CommandText, dataAdapter.SelectCommand.Connection);
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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.Collections;\r
using System.Text;\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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.Runtime.InteropServices;\r
using System.Text;\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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
\r
namespace IBM.Data.DB2\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Data;
-using System.Runtime.InteropServices;
-using System.Globalization;
-using System.Text;
-
-namespace IBM.Data.DB2
-{
- /// <summary>
- /// Summary description for DB2ClientDataReader.
- /// DB2ClientDataReader.
- /// </summary>
- public sealed class DB2DataReader : MarshalByRefObject, IDataReader
- {
+\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.Collections;\r
+using System.Data;\r
+using System.Runtime.InteropServices;\r
+using System.Globalization;\r
+using System.Text;\r
+\r
+namespace IBM.Data.DB2\r
+{\r
+ /// <summary>\r
+ /// Summary description for DB2ClientDataReader.\r
+ /// DB2ClientDataReader. \r
+ /// </summary>\r
+ public sealed class DB2DataReader : MarshalByRefObject, IDataReader\r
+ {\r
private struct ColumnInfo\r
{\r
public string Colname;\r
public int Sqltype;\r
- }
-
+ }\r
+\r
private object[] _resultSet;\r
private ColumnInfo[] columnInfo;\r
private Hashtable columnsNames;\r
private CommandBehavior behavior;\r
private bool hasRows;\r
private bool skipReadOnce;\r
-
-
+ \r
+ \r
#region Constructors and destructors\r
/// <summary>\r
/// \r
}\r
\r
#endregion\r
-
+\r
private void GetFieldCountAndAffectedRows()\r
{\r
short sqlRet;\r
sqlRet = DB2CLIWrapper.SQLNumResultCols(hwndStmt, out colCount);\r
DB2ClientUtils.DB2CheckReturn(sqlRet, DB2Constants.SQL_HANDLE_STMT, hwndStmt, "DB2ClientDataReader - SQLNumResultCols", db2Conn);\r
fieldCount = colCount;\r
- }
-
- #region Properties
-
- #region Depth property
- ///
- ///Depth of nesting for the current row, need to figure out what this translates into
- ///with DB2.
- ///
- private int depth = 0;
- public int Depth
- {
- get
- {
+ }\r
+\r
+ #region Properties\r
+\r
+ #region Depth property \r
+ ///\r
+ ///Depth of nesting for the current row, need to figure out what this translates into \r
+ ///with DB2.\r
+ ///\r
+ private int depth = 0;\r
+ public int Depth\r
+ {\r
+ get\r
+ {\r
if(isClosed)\r
{\r
throw new InvalidOperationException("Reader is closed");\r
- }
- return depth;
- }
- }
- #endregion
-
- #region IsClosed property
- /// <summary>
- /// True if the reader is closed.
- /// </summary>
- private bool isClosed = true;
- public bool IsClosed
- {
- get
- {
- return isClosed;
- }
- }
- #endregion
-
- #region RecordsAffected property
- ///
- /// Number of records affected by this operation. Will be zero until we close the
- /// reader
- ///
-
- public int RecordsAffected
- {
- get
- {
- return recordsAffected;
- }
- }
- #endregion
-
- #endregion
-
- #region Methods
-
-
-
+ }\r
+ return depth;\r
+ }\r
+ }\r
+ #endregion\r
+\r
+ #region IsClosed property\r
+ /// <summary>\r
+ /// True if the reader is closed.\r
+ /// </summary>\r
+ private bool isClosed = true;\r
+ public bool IsClosed\r
+ {\r
+ get\r
+ {\r
+ return isClosed;\r
+ }\r
+ }\r
+ #endregion\r
+\r
+ #region RecordsAffected property\r
+ ///\r
+ /// Number of records affected by this operation. Will be zero until we close the \r
+ /// reader\r
+ /// \r
+ \r
+ public int RecordsAffected\r
+ {\r
+ get\r
+ {\r
+ return recordsAffected;\r
+ }\r
+ }\r
+ #endregion\r
+\r
+ #endregion\r
+\r
+ #region Methods\r
+\r
+\r
+\r
#region Close method\r
\r
public void Close()\r
Dispose(false);\r
}\r
\r
- #endregion
-
- #region GetSchemaTable
-
+ #endregion\r
+\r
+ #region GetSchemaTable \r
+\r
public DataTable GetSchemaTable()\r
{\r
if(isClosed)\r
}\r
}\r
return _schemaTable;\r
- }
- #endregion
-
- #region NextResult
-
+ }\r
+ #endregion\r
+\r
+ #region NextResult \r
+\r
public bool NextResult()\r
{\r
hasRows = false;\r
return false;\r
DB2ClientUtils.DB2CheckReturn(sqlRet, DB2Constants.SQL_HANDLE_STMT, hwndStmt, "Db2ClientDataReader - SQLMoreResults", db2Conn);\r
return true;\r
- }
- #endregion
-
- #region Read
-
+ }\r
+ #endregion\r
+\r
+ #region Read\r
+\r
#if !NET_1_0\r
public bool HasRows\r
{\r
return hasRows;\r
}\r
}\r
-#endif
-
+#endif\r
+\r
public bool Read()\r
{\r
if (isClosed)\r
\r
hasData = true;\r
return true;\r
- }
- #endregion
-
- #region GetColumnInfo
+ }\r
+ #endregion\r
+\r
+ #region GetColumnInfo\r
private void GetColumnInfo()\r
{\r
if(isClosed)\r
\r
\r
}\r
- }
- #endregion
-
- #region Describe/Bind/Fetch functions
- ///
- ///Broke these out so that we can use different paths for Immediate executions and Prepared executions
- /// <summary>
- /// Does the describe and bind steps for the query result set. Called for both immediate and prepared queries.
- /// </summary>
-
-/// <summary>
-/// FetchResults does what it says.
-/// </summary>
-/// <param name="dbVals"></param>
-/// <param name="sqlLen_or_IndPtr"></param>
-/// <param name="_resultSet"></param>
+ }\r
+ #endregion\r
+\r
+ #region Describe/Bind/Fetch functions\r
+ ///\r
+ ///Broke these out so that we can use different paths for Immediate executions and Prepared executions\r
+ /// <summary>\r
+ /// Does the describe and bind steps for the query result set. Called for both immediate and prepared queries. \r
+ /// </summary>\r
+ \r
+/// <summary>\r
+/// FetchResults does what it says.\r
+/// </summary>\r
+/// <param name="dbVals"></param>\r
+/// <param name="sqlLen_or_IndPtr"></param>\r
+/// <param name="_resultSet"></param>\r
private int FieldNameLookup(DataTable _schemaTable, string name)\r
{\r
for(int i = 0; i < _schemaTable.Rows.Count; i++)\r
}\r
}\r
return -1;\r
- }
-
- #endregion
-
- #region IDataRecord Interface
- ///Code for the IDataRecord interface
- ///
- #region FieldCount
- ///
- ///
+ }\r
+ \r
+ #endregion\r
+\r
+ #region IDataRecord Interface\r
+ ///Code for the IDataRecord interface\r
+ ///\r
+ #region FieldCount\r
+ ///\r
+ ///\r
public int FieldCount\r
{\r
get\r
\r
return fieldCount;\r
}\r
- }
- #endregion
-
- #region Item accessors
+ }\r
+ #endregion\r
+\r
+ #region Item accessors\r
public object this[string name]\r
{\r
get\r
}\r
throw new NotImplementedException("Unknown SQL type " + columnInfo[col].Sqltype);\r
}\r
- }
- #endregion
-
+ }\r
+ #endregion\r
+\r
#region GetBytes\r
///\r
/// GetBytes, return a stream of bytes\r
return sourceArray.LongLength;\r
#endif\r
}\r
- #endregion
-
+ #endregion\r
+\r
#region GetChars\r
///\r
///GetChars, returns char array\r
}\r
return (long)sourceString.Length;\r
}\r
- #endregion
-
- #region GetBoolean method
-
+ #endregion\r
+\r
+ #region GetBoolean method\r
+\r
public Boolean GetBoolean(int col)\r
{\r
return (Boolean)GetBooleanInternal(col);\r
}\r
} \r
return _resultSet[col];\r
- }
- #endregion
-
+ }\r
+ #endregion\r
+\r
#region GetGuid\r
///\r
/// GetDateTime method\r
return _resultSet[col];\r
}\r
\r
- #endregion
-
- #region GetByte
- ///
- ///GetByte
- ///
+ #endregion\r
+\r
+ #region GetByte\r
+ ///\r
+ ///GetByte\r
+ ///\r
public Byte GetByte(int col)\r
{\r
return (Byte)GetByteInternal(col);\r
}\r
} \r
return _resultSet[col];\r
- }
- #endregion
-
- #region GetChar
- ///
- ///GetChar, return column as a char
- ///
+ }\r
+ #endregion\r
+\r
+ #region GetChar\r
+ ///\r
+ ///GetChar, return column as a char\r
+ ///\r
public Char GetChar(int col)\r
{\r
return (Char)GetCharInternal(col);\r
}\r
} \r
return _resultSet[col];\r
- }
- #endregion
-
- #region GetData
- ///
- /// GetData method
- ///
- public IDataReader GetData(int col)
- {
- //Have to research this one, not quite sure what the docs mean
- //DB2 does have some structured data types, is that what this is for?
- throw new NotSupportedException();
- }
- #endregion
-
- #region GetDataTypeName
- ///
- ///GetDataTypeName return the type of data
- ///
+ }\r
+ #endregion\r
+\r
+ #region GetData\r
+ ///\r
+ /// GetData method\r
+ /// \r
+ public IDataReader GetData(int col)\r
+ {\r
+ //Have to research this one, not quite sure what the docs mean\r
+ //DB2 does have some structured data types, is that what this is for?\r
+ throw new NotSupportedException();\r
+ }\r
+ #endregion\r
+\r
+ #region GetDataTypeName\r
+ ///\r
+ ///GetDataTypeName return the type of data\r
+ ///\r
public string GetDataTypeName(int col)\r
{\r
if(columnInfo == null)\r
return "VARBINARY";\r
}\r
throw new NotImplementedException("Unknown SQL type " + columnInfo[col].Sqltype);\r
- }
- #endregion
-
- #region GetDateTime
- ///
- /// GetDateTime method
- ///
-
+ }\r
+ #endregion\r
+\r
+ #region GetDateTime\r
+ ///\r
+ /// GetDateTime method\r
+ /// \r
+\r
public DateTime GetDateTime(int col)\r
{\r
return (DateTime)GetDateTimeInternal(col);\r
}\r
} \r
return _resultSet[col];\r
- }
- #endregion
-
+ }\r
+ #endregion\r
+\r
#region GetDate\r
///\r
/// GetDate method\r
return _resultSet[col];\r
}\r
\r
- #endregion
-
+ #endregion\r
+\r
#region GetTime\r
///\r
/// GetTime method\r
return _resultSet[col];\r
}\r
\r
- #endregion
-
-
- #region GetDecimal
- ///
- ///GetDecimal method
- ///
+ #endregion\r
+\r
+\r
+ #region GetDecimal\r
+ ///\r
+ ///GetDecimal method\r
+ ///\r
\r
public Decimal GetDecimal(int col)\r
{\r
// }\r
// } \r
return _resultSet[col];\r
- }
- #endregion
-
- #region GetDouble
- ///
- /// GetDouble
- ///
+ }\r
+ #endregion\r
+\r
+ #region GetDouble \r
+ ///\r
+ /// GetDouble \r
+ /// \r
public Double GetDouble(int col)\r
{\r
return (Double)GetDoubleInternal(col);\r
}\r
} \r
return _resultSet[col];\r
- }
- #endregion
-
- #region GetFieldType
- ///
- /// Type GetFieldType
- ///
+ }\r
+ #endregion\r
+\r
+ #region GetFieldType\r
+ ///\r
+ /// Type GetFieldType\r
+ ///\r
public Type GetFieldType(int col)\r
{\r
if(columnInfo == null)\r
GetColumnInfo();\r
}\r
return GetManagedType(columnInfo[col].Sqltype);\r
- }
- #endregion
-
- #region GetFloat
- ///
- /// GetFloat
- ///
+ }\r
+ #endregion\r
+\r
+ #region GetFloat\r
+ ///\r
+ /// GetFloat\r
+ /// \r
public float GetFloat(int col)\r
{\r
return (float)GetFloatInternal(col);\r
}\r
} \r
return _resultSet[col];\r
- }
- #endregion
-
- #region The GetInt?? series
- ///
- ///GetInt16
- ///
+ }\r
+ #endregion\r
+\r
+ #region The GetInt?? series\r
+ ///\r
+ ///GetInt16\r
+ ///\r
public short GetInt16(int col)\r
{\r
return (short)GetInt16Internal(col);\r
} \r
return _resultSet[col];\r
}\r
-
- #endregion
-
- #region GetName
- ///
- ///GetName, returns the name of the field
- ///
+\r
+ #endregion\r
+\r
+ #region GetName\r
+ ///\r
+ ///GetName, returns the name of the field\r
+ ///\r
public string GetName(int col)\r
{\r
if(columnInfo == null)\r
GetColumnInfo();\r
}\r
return columnInfo[col].Colname;\r
- }
- #endregion
-
- #region GetOrdinal
- ///
- /// GetOrdinal, return the index of the named column
- ///
+ }\r
+ #endregion\r
+\r
+ #region GetOrdinal\r
+ ///\r
+ /// GetOrdinal, return the index of the named column\r
+ /// \r
public int GetOrdinal(string name)\r
{\r
if(columnInfo == null)\r
throw new IndexOutOfRangeException("name");\r
}\r
return (int)ordinal;\r
- }
- #endregion
-
- #region GetString
- ///
- /// GetString returns a string
- ///
+ }\r
+ #endregion\r
+\r
+ #region GetString\r
+ ///\r
+ /// GetString returns a string\r
+ /// \r
public string GetString(int col)\r
{\r
return (string)GetStringInternal(col);\r
}\r
} \r
return _resultSet[col];\r
- }
- #endregion
-
- #region GetValue
- ///
- /// GetVCalue, returns an object
- ///
- public object GetValue(int col)
- {
- return this[col];
- }
- #endregion
-
- #region GetValues
- ///
- /// GetValues returns all columns in the row through the argument, and the number of columns in the return value
- ///
+ }\r
+ #endregion\r
+\r
+ #region GetValue\r
+ ///\r
+ /// GetVCalue, returns an object\r
+ /// \r
+ public object GetValue(int col)\r
+ {\r
+ return this[col];\r
+ }\r
+ #endregion\r
+\r
+ #region GetValues\r
+ ///\r
+ /// GetValues returns all columns in the row through the argument, and the number of columns in the return value\r
+ /// \r
public int GetValues(object[] values)\r
{\r
int count = Math.Min(fieldCount, values.Length);\r
}\r
\r
return count;\r
- }
- #endregion
-
- #region IsDBNull
- ///
- /// IsDBNull Is the column null
- ///
+ }\r
+ #endregion\r
+\r
+ #region IsDBNull\r
+ ///\r
+ /// IsDBNull Is the column null\r
+ /// \r
public bool IsDBNull(int col)\r
{\r
//Proper implementation once I get the SQLDescribe/SQLBind/SQLFetch stuff in place\r
return Convert.IsDBNull(this[col]);\r
- }
- #endregion
-
- #endregion ///For IDataRecord
-
- #region private methods
-
+ }\r
+ #endregion\r
+\r
+ #endregion ///For IDataRecord\r
+\r
+ #region private methods\r
+ \r
private DataTable BuildNewSchemaTable()\r
{\r
DataTable schemaTable = new DataTable("SchemaTable");\r
schemaTable.Columns.Add(new DataColumn("BaseColumnName", typeof(string)));\r
\r
return schemaTable;\r
- }
- #endregion
-
- private void InitMem(int memSize, ref IntPtr ptr){
- if (ptr.ToInt32() == 0){
- unsafe{
- fixed(byte* arr = new byte[memSize]){
- ptr = new IntPtr(arr);
- }
- }
- }
- }
-
+ }\r
+ #endregion\r
+ \r
+ private void InitMem(int memSize, ref IntPtr ptr){\r
+ if (ptr.ToInt32() == 0){\r
+ unsafe{\r
+ fixed(byte* arr = new byte[memSize]){\r
+ ptr = new IntPtr(arr); \r
+ }\r
+ }\r
+ } \r
+ }\r
+ \r
private Type GetManagedType(int sql_type)\r
{\r
switch(sql_type)\r
return typeof(byte[]);\r
}\r
throw new NotImplementedException("Unknown SQL type " + sql_type);\r
- }
-
+ }\r
+ \r
private bool IsLong(short sql_type)\r
{\r
switch(sql_type)\r
return true;\r
}\r
return false;\r
- }
+ }\r
private object GetBlobDataInternal(int col)\r
{\r
if((col < 0) || (col >= fieldCount))\r
}\r
} \r
return _resultSet[col];\r
- }
- }
-
-}
-#endregion
+ }\r
+ }\r
+\r
+}\r
+#endregion\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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.Collections;\r
using System.Text;\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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.Collections;\r
using System.Runtime.InteropServices;\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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.Runtime.InteropServices;\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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.Collections;\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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.Runtime.InteropServices;\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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
\r
namespace IBM.Data.DB2\r
--- /dev/null
+/AssemblyInfo.cs -crlf
+/ICSharpCode.SharpZLib.prjx -crlf
+/Main.cs -crlf
+/SharpZipBaseException.cs -crlf
--- /dev/null
+/BZip2.cs -crlf
+/BZip2Constants.cs -crlf
+/BZip2Exception.cs -crlf
+/BZip2InputStream.cs -crlf
+/BZip2OutputStream.cs -crlf
--- /dev/null
+/Adler32.cs -crlf
+/CRC32.cs -crlf
+/IChecksum.cs -crlf
+/StrangeCRC.cs -crlf
--- /dev/null
+/FileSystemScanner.cs -crlf
+/INameTransform.cs -crlf
+/NameFilter.cs -crlf
+/PathFilter.cs -crlf
--- /dev/null
+/PkzipClassic.cs -crlf
--- /dev/null
+/GZIPConstants.cs -crlf
+/GZipException.cs -crlf
+/GzipInputStream.cs -crlf
+/GzipOutputStream.cs -crlf
--- /dev/null
+/InvalidHeaderException.cs -crlf
+/TarArchive.cs -crlf
+/TarBuffer.cs -crlf
+/TarEntry.cs -crlf
+/TarException.cs -crlf
+/TarHeader.cs -crlf
+/TarInputStream.cs -crlf
+/TarOutputStream.cs -crlf
--- /dev/null
+/FastZip.cs -crlf
+/ZipConstants.cs -crlf
+/ZipEntry.cs -crlf
+/ZipException.cs -crlf
+/ZipFile.cs -crlf
+/ZipInputStream.cs -crlf
+/ZipNameTransform.cs -crlf
+/ZipOutputStream.cs -crlf
--- /dev/null
+/Deflater.cs -crlf
+/DeflaterConstants.cs -crlf
+/DeflaterEngine.cs -crlf
+/DeflaterHuffman.cs -crlf
+/DeflaterPending.cs -crlf
+/Inflater.cs -crlf
+/InflaterDynHeader.cs -crlf
+/InflaterHuffmanTree.cs -crlf
+/PendingBuffer.cs -crlf
--- /dev/null
+/DeflaterOutputStream.cs -crlf
+/InflaterInputStream.cs -crlf
+/OutputWindow.cs -crlf
+/StreamManipulator.cs -crlf
--- /dev/null
+/makefile.build -crlf
--- /dev/null
+/MainsoftWebSectionGroup.cs -crlf
+/PagesSection.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/makefile.build -crlf
--- /dev/null
+/Web.config -crlf
+/Web.config.bak -crlf
+/makefile.build -crlf
--- /dev/null
+/GlobalResource.resx -crlf
--- /dev/null
+/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
--- /dev/null
+/Searcher.ascx -crlf
+/Searcher.ascx.cs -crlf
+/Searcher.ascx.cs.bak -crlf
+/Searcher.ascx.designer.cs -crlf
+/Searcher.ascx.designer.cs.bak -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/AssemblyInfo.cs.bak -crlf
--- /dev/null
+/faces-config.xml -crlf
+/web.xml -crlf
--- /dev/null
+/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
using System.Collections;
using System.Configuration;
using System.Xml;
-using System.Globalization;\r
-using System;\r
-\r
+using System.Globalization;
+using System;
+
namespace Mainsoft.Web.Configuration
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System.Web.SessionState;\r
-using System.Web;\r
+using System.Web.SessionState;
+using System.Web;
using System;
namespace Mainsoft.Web.Util {
--- /dev/null
+/AbstractAttributeMap.cs -crlf
+/AspNetFacesContext.cs -crlf
+/BaseExternalContext.cs -crlf
+/BaseFacesPageHandlerFactory.cs -crlf
+/BaseFacesStateManager.cs -crlf
+/BaseFacesViewHandler.cs -crlf
+/ChangeLog -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
namespace Mainsoft.Web.Hosting
{
- /// <summary>\r
- /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
+ /// <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
{
namespace System.Web.GH
{
- /// <summary>\r
- /// <para>This class supports the Framework infrastructure and is not intended to be used directly from your code.</para>\r
+ /// <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
{
return _HttpServletRequest.getServerPort ();
}
- public override string GetPathInfo () {\r
+ public override string GetPathInfo () {
return base.GetPathInfo () ?? String.Empty;
}
--- /dev/null
+/ChangeLog -crlf
+/CloudscapeProfileProvider.cs -crlf
+/DerbyProfileHelper.cs -crlf
+/DerbyProfileProvider.cs -crlf
return 0;\r
\r
string queryDelete = @"DELETE FROM aspnet_Profile WHERE UserId IN ( " +\r
- "SELECT UserId FROM aspnet_Users WHERE ApplicationId = ? AND LastActivityDate <= ? " +
+ "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
if (appId == null)\r
return 0;\r
\r
- string querySelect = @"SELECT COUNT(*) FROM aspnet_Users usr, aspnet_Profile prf WHERE ApplicationId = ? " +
+ 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
//\r
-// Mainsoft.Web.Profile.DerbyProfileProvider
-//
-// Authors:
-// Vladimir Krasnov (vladimirk@mainsoft.com)
-//
-// (C) 2006 Mainsoft
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
+// 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
+#if NET_2_0\r
+\r
using System;\r
using System.Data.OleDb;\r
using System.Data.Common;\r
-using System.Collections;
+using System.Collections;\r
using System.Configuration;\r
using System.Globalization;\r
using System.Web.Profile;\r
-using System.Web.Configuration;
+using System.Web.Configuration;\r
using System.Collections.Specialized;\r
using System.Text;\r
using System.IO;\r
using Mainsoft.Web.Security;\r
using System.Configuration.Provider;\r
\r
-namespace Mainsoft.Web.Profile
-{
+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>
- public class DerbyProfileProvider : ProfileProvider
+ /// </summary>\r
+ public class DerbyProfileProvider : ProfileProvider\r
{\r
ConnectionStringSettings _connectionString;\r
- string _applicationName = string.Empty;
+ string _applicationName = string.Empty;\r
bool _schemaChecked = false;\r
- DerbyUnloadManager.DerbyShutDownPolicy _shutDownPolicy = DerbyUnloadManager.DerbyShutDownPolicy.Default;
-
- public DerbyProfileProvider ()
- {
+ DerbyUnloadManager.DerbyShutDownPolicy _shutDownPolicy = DerbyUnloadManager.DerbyShutDownPolicy.Default;\r
+\r
+ public DerbyProfileProvider ()\r
+ {\r
}\r
\r
public override string ApplicationName\r
OleDbConnection connection = new OleDbConnection (_connectionString.ConnectionString);\r
connection.Open ();\r
return connection;\r
- }
-
- public override int DeleteInactiveProfiles (ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate)
+ }\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
\r
return DeleteProfilesInternal (usernames);\r
- }
-
- private int DeleteProfilesInternal (string[] usernames)
+ }\r
+\r
+ private int DeleteProfilesInternal (string[] usernames)\r
{\r
using (DbConnection connection = CreateConnection ()) {\r
return DerbyProfileHelper.Profile_DeleteProfiles (connection, ApplicationName, usernames);\r
return BuildProfileInfoCollection (reader, pageIndex, pageSize, out totalRecords);\r
}\r
}\r
- }
-
- public override ProfileInfoCollection GetAllInactiveProfiles (ProfileAuthenticationOption authenticationOption,
- DateTime userInactiveSinceDate,
- int pageIndex,
- int pageSize,
- out int totalRecords)
+ }\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
return BuildProfileInfoCollection (reader, pageIndex, pageSize, out totalRecords);\r
}\r
}\r
- }
-
- public override ProfileInfoCollection GetAllProfiles (ProfileAuthenticationOption authenticationOption,
- int pageIndex,
- int pageSize,
- out int totalRecords)
+ }\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
return BuildProfileInfoCollection (reader, pageIndex, pageSize, out totalRecords);\r
}\r
}\r
- }
-
- public override int GetNumberOfInactiveProfiles (ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate)
+ }\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
- }
-
- public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext sc, SettingsPropertyCollection properties)
+ }\r
+\r
+ public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext sc, SettingsPropertyCollection properties)\r
{\r
SettingsPropertyValueCollection settings = new SettingsPropertyValueCollection ();\r
\r
buf, username, authenticated, DateTime.UtcNow);\r
}\r
}\r
-
- public override void Initialize (string name, NameValueCollection config)
+\r
+ public override void Initialize (string name, NameValueCollection config)\r
{\r
if (config == null)\r
throw new ArgumentNullException ("config");\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
throw new ArgumentException (String.Format ("invalid format for {0}", pName));\r
}\r
\r
-
- }
-}
-
-#endif
+\r
+ }\r
+}\r
+\r
+#endif\r
--- /dev/null
+/ChangeLog -crlf
+/CloudscapeMembershipProvider.cs -crlf
+/CloudscapeRoleProvider.cs -crlf
+/DerbyApplicationsHelper.cs -crlf
+/DerbyMembershipHelper.cs -crlf
+/DerbyMembershipProvider.cs -crlf
+/DerbyRoleProvider.cs -crlf
+/DerbyRolesHelper.cs -crlf
\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 " +
- "WHERE usr.ApplicationId = app.ApplicationId AND usr.LastActivityDate > ? AND " +
+ 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
return 1; // user not found\r
}\r
\r
- string querySelect = "SELECT usr.UserName, mbr.UserId, mbr.Email, mbr.PasswordQuestion, mbr.Comment, mbr.IsApproved, " +
- "mbr.IsLockedOut, mbr.CreateDate, mbr.LastLoginDate, usr.LastActivityDate, mbr.LastPasswordChangedDate, mbr.LastLockoutDate " +
- "FROM aspnet_Users usr, aspnet_Membership mbr " +
+ 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
if (roleId == null)\r
return 2;\r
\r
- string querySelect = "SELECT usr.UserName FROM aspnet_Users usr, aspnet_UsersInRoles uir " +
- "WHERE usr.UserId = uir.UserId AND usr.ApplicationId = ? AND uir.RoleId = ? AND LoweredUserName LIKE ? " +
+ 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
--- /dev/null
+/ObjectInputStream.cs -crlf
+/ObjectOutputStream.cs -crlf
+/ServletSessionIDManager.cs -crlf
+/ServletSessionStateItemCollection.cs -crlf
+/ServletSessionStateStoreProvider.cs -crlf
--- /dev/null
+/BaseHttpContext.cs -crlf
+/J2EEConsts.cs -crlf
+/J2EEUtils.cs -crlf
+/ServletHttpContext.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/MembershipTests.cs -crlf
using System.Collections.Specialized;\r
using System.Text;\r
using Mainsoft.Web.Security;\r
-using NUnit.Framework;
+using NUnit.Framework;\r
\r
\r
namespace Mainsoft.Web.Security.Tests\r
--- /dev/null
+/System.Windows.Forms.xml -crlf
--- /dev/null
+/ToolStripItemDesignerAvailability.cs -crlf
+/ToolStripItemDesignerAvailabilityAttribute.cs -crlf
--- /dev/null
+/TableLayoutSettingsTypeConverter.cs -crlf
--- /dev/null
+/ChangeLog -crlf
+/ThemeElements.cs -crlf
+/ThemeElementsClearlooks.cs -crlf
+/ThemeElementsDefault.cs -crlf
+/ThemeElementsGtk.cs -crlf
+/ThemeElementsNice.cs -crlf
--- /dev/null
+/ButtonPainter.cs -crlf
+/ChangeLog -crlf
+/CheckBoxPainter.cs -crlf
+/RadioButtonPainter.cs -crlf
+/TabControlPainter.cs -crlf
+/ToolStripPainter.cs -crlf
-// 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
-// Copyright (c) 2007 Novell, Inc.\r
-//\r
-// Authors:\r
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// 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) 2007 Novell, Inc.
+//
+// Authors:
// Everaldo Canuto (ecanuto@novell.com)
-using System;\r
-using System.Drawing;\r
-using System.Drawing.Drawing2D;\r
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
namespace System.Windows.Forms.Theming.Default
{
--- /dev/null
+/ChangeLog -crlf
+/TabControlPainter.cs -crlf
//\r
// Authors:\r
// Jonathan Pobst (monkey@jpobst.com)\r
-// Everaldo Canuto <ecanuto@novell.com>
+// Everaldo Canuto <ecanuto@novell.com>\r
\r
using System;\r
using System.Drawing;\r
{\r
theme.ButtonPainter.DrawPopup (g, bounds, state, backColor, foreColor);\r
}\r
- #endregion
-
- #region Painters
-
+ #endregion\r
+ \r
+ #region Painters\r
+\r
public virtual Default.ButtonPainter ButtonPainter {\r
get { return theme.ButtonPainter; }\r
}\r
-
- public static Default.LabelPainter LabelPainter {
- get { return theme.LabelPainter; }
+\r
+ public static Default.LabelPainter LabelPainter {\r
+ get { return theme.LabelPainter; }\r
}\r
-
- public static Default.LinkLabelPainter LinkLabelPainter {
- get { return theme.LinkLabelPainter; }
+\r
+ public static Default.LinkLabelPainter LinkLabelPainter {\r
+ get { return theme.LinkLabelPainter; }\r
}\r
-
+\r
public virtual Default.TabControlPainter TabControlPainter {\r
get { return theme.TabControlPainter; }\r
}\r
-
+\r
#if NET_2_0\r
public virtual Default.CheckBoxPainter CheckBoxPainter {\r
get { return theme.CheckBoxPainter; }\r
public virtual Default.RadioButtonPainter RadioButtonPainter {\r
get { return theme.RadioButtonPainter; }\r
}\r
-
+\r
public virtual Default.ToolStripPainter ToolStripPainter {\r
get { return theme.ToolStripPainter; }\r
}\r
#endif\r
-
+\r
#endregion\r
}\r
\r
return buttonPainter;\r
}\r
}\r
-
+\r
protected Default.LabelPainter labelPainter;\r
public virtual Default.LabelPainter LabelPainter {\r
get {\r
return labelPainter;\r
}\r
}\r
-
+\r
protected Default.LinkLabelPainter linklabelPainter;\r
public virtual Default.LinkLabelPainter LinkLabelPainter {\r
get {\r
--- /dev/null
+/AlertCheck.cs -crlf
+/ChangeLog -crlf
+/ConfirmCheck.cs -crlf
+/Generic.cs -crlf
+/Prompt.cs -crlf
--- /dev/null
+/ColumnHeaderConverter.cs -crlf
+/DataGridViewLinkCell.cs -crlf
+/DataGridViewLinkColumn.cs -crlf
+/HtmlElement.cs -crlf
+/HtmlElementCollection.cs -crlf
+/HtmlElementErrorEventArgs.cs -crlf
+/HtmlElementErrorEventHandler.cs -crlf
+/HtmlElementEventArgs.cs -crlf
+/HtmlElementEventHandler.cs -crlf
+/HtmlWindowCollection.cs -crlf
+/ImageKeyConverter.cs -crlf
+/Line.cs -crlf
+/LineTag.cs -crlf
+/LinkConverter.cs -crlf
+/MdiControlStrip.cs -crlf
+/NumericUpDownAcceleration.cs -crlf
+/NumericUpDownAccelerationCollection.cs -crlf
+/PowerStatus.cs -crlf
+/TextBoxTextRenderer.cs -crlf
+/ToolStripDropDownItemAccessibleObject.cs -crlf
+/ToolStripSystemRenderer.cs -crlf
+/TreeViewImageKeyConverter.cs -crlf
+/WebBrowser.cs -crlf
+/WebBrowserBase.cs -crlf
+/WebBrowserSiteBase.cs -crlf
+/WindowsFormsSynchronizationContext.cs -crlf
--- /dev/null
+/ChangeLog -crlf
--- /dev/null
+/ButtonBaseTest.cs -crlf
+/DataObjectTest.cs -crlf
+/EventArgsTest.cs -crlf
+/EventLogger.cs -crlf
+/FlowPanelTests.cs -crlf
+/FormHandleTest.cs -crlf
+/HScrollPropertiesTest.cs -crlf
+/ImageKeyConverterTest.cs -crlf
+/KeysConverterTest.cs -crlf
+/LinkConverterTest.cs -crlf
+/LinkLabelTest.cs -crlf
+/LogGenerator.cs -crlf
+/MaskedTextBoxTest.cs -crlf
+/MdiFormHandleTest.cs -crlf
+/NumericUpDownTest.cs -crlf
+/PanelTest.cs -crlf
+/SendKeysTest.cs -crlf
+/SplitContainerTests.cs -crlf
+/StatusStripTest.cs -crlf
+/TableLayoutTest.cs -crlf
+/TimerTest.cs -crlf
+/ToolStripContainerTest.cs -crlf
+/ToolStripContentPanelTest.cs -crlf
+/ToolStripDropDownTest.cs -crlf
+/ToolStripManagerTest.cs -crlf
+/ToolStripOverflowButtonTest.cs -crlf
+/ToolStripOverflowTest.cs -crlf
+/ToolStripPanelTest.cs -crlf
+/ToolStripStatusLabelTest.cs -crlf
+/TreeViewImageIndexConverterTest.cs -crlf
+/TreeViewImageKeyConverterTest.cs -crlf
+/UpDownTest.cs -crlf
+/VScrollPropertiesTest.cs -crlf
+2010-07-27 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * EventLogger.cs: Emit verifiable code. This was blocking the SWF
+ test suite from running under the verifier.
+
2010-06-24 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* TabControlTest.cs: New test to assert that getting focus is not
\r
TypeBuilder logType = module.DefineType ("Logger");\r
FieldBuilder logField = logType.DefineField ("log", ListType, FieldAttributes.Public);\r
- ConstructorBuilder logCtor = logType.DefineConstructor (MethodAttributes.Public, CallingConventions.HasThis, new Type [] {ListType, typeof (object)});\r
+ ConstructorBuilder logCtor = logType.DefineConstructor (MethodAttributes.Public, CallingConventions.HasThis, new Type [] {ListType, itemType});\r
logCtor.DefineParameter (1, ParameterAttributes.None, "test");\r
logCtor.DefineParameter (2, ParameterAttributes.None, "obj");\r
ILGenerator logIL = logCtor.GetILGenerator ();\r
+
+ logIL.Emit (OpCodes.Ldarg_0);
+ logIL.Emit (OpCodes.Call, typeof (object).GetConstructor (Type.EmptyTypes));
+
logIL.Emit (OpCodes.Ldarg_0);\r
logIL.Emit (OpCodes.Ldarg_1);\r
logIL.Emit (OpCodes.Stfld, logField);\r
if (child2 != null) {\r
child2.Dispose ();\r
child2 = null;\r
- }
+ }\r
base.TearDown ();\r
}\r
\r
\r
[SetUp]\r
protected override void SetUp () {\r
- keys.Clear();
+ keys.Clear();\r
base.SetUp ();\r
}\r
\r
{\r
[SetUp]\r
protected override void SetUp () {\r
- Reset ();
+ Reset ();\r
base.SetUp ();\r
}\r
\r
--- /dev/null
+/ChangeLog -crlf
+/MonoTODOAttribute.cs -crlf
--- /dev/null
+/System.Windows.Forms.de.resx -crlf
+/System.Windows.Forms.en.resx -crlf
+/System.Windows.Forms.resx -crlf
<data name="Restore" xml:space="preserve">\r
<value>Restore</value>\r
</data>\r
-</root>
+</root>\r
/r:Microsoft.Build.Framework.dll \
/r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll
-EXTRA_DISTFILES = \\r
- Test/resources/TestTasks.cs \\r
+EXTRA_DISTFILES = \
+ Test/resources/TestTasks.cs \
Test/resources/*.*proj \
Test/test-config-file*
+2010-07-24 Ankit Jain <jankit@novell.com>
+
+ * ConsoleLogger.cs: Collect and dump timing information.
+
2010-07-24 Ankit Jain <jankit@novell.com>
* ConsoleLogger.cs: Honor LoggerVerbosity.Quiet .
using System.Collections;
using System.Collections.Generic;
using System.IO;
+using System.Linq;
using System.Security;
using System.Text;
using Microsoft.Build.Framework;
List<BuildStatusEventArgs> events;
Dictionary<string, List<string>> errorsTable;
Dictionary<string, List<string>> warningsTable;
+ SortedDictionary<string, PerfInfo> targetPerfTable, tasksPerfTable;
string current_events_string;
public ConsoleLogger ()
events = new List<BuildStatusEventArgs> ();
errorsTable = new Dictionary<string, List<string>> ();
warningsTable = new Dictionary<string, List<string>> ();
+ targetPerfTable = new SortedDictionary<string, PerfInfo> ();
+ tasksPerfTable = new SortedDictionary<string, PerfInfo> ();
//defaults
errorColor = ConsoleColor.DarkRed;
return;
}
+ TimeSpan timeElapsed = args.Timestamp - buildStart;
+ if (performanceSummary || verbosity == LoggerVerbosity.Diagnostic)
+ DumpPerformanceSummary ();
+
if (args.Succeeded == true && !projectFailed) {
WriteLine ("Build succeeded.");
} else {
WriteLine ("Build FAILED.");
}
- if (performanceSummary == true) {
- }
-
if (warnings.Count > 0) {
WriteLine (Environment.NewLine + "Warnings:");
SetColor (warningColor);
}
if (showSummary == true){
- TimeSpan timeElapsed = args.Timestamp - buildStart;
WriteLine (String.Format ("\t {0} Warning(s)", warningCount));
WriteLine (String.Format ("\t {0} Error(s)", errorCount));
WriteLine (String.Empty);
void PopEvent ()
{
+ if (performanceSummary || verbosity == LoggerVerbosity.Diagnostic) {
+ var args = events [events.Count - 1];
+ TargetStartedEventArgs tgt_args = args as TargetStartedEventArgs;
+ if (tgt_args != null) {
+ AddPerfInfo (tgt_args.TargetName, args.Timestamp, targetPerfTable);
+ } else {
+ TaskStartedEventArgs tsk_args = args as TaskStartedEventArgs;
+ if (tsk_args != null)
+ AddPerfInfo (tsk_args.TaskName, args.Timestamp, tasksPerfTable);
+ }
+ }
+
events.RemoveAt (events.Count - 1);
current_events_string = null;
}
string last_imported_target_file = String.Empty;
for (int i = 0; i < events.Count; i ++) {
- BuildStatusEventArgs args = events [i];
+ var args = events [i];
ProjectStartedEventArgs pargs = args as ProjectStartedEventArgs;
if (pargs != null) {
sb.AppendFormat ("{0} ({1}) ->\n", pargs.ProjectFile,
return sb.ToString ();
}
+
+ void AddPerfInfo (string name, DateTime start, IDictionary<string, PerfInfo> perf_table)
+ {
+ PerfInfo pi;
+ if (!perf_table.TryGetValue (name, out pi)) {
+ pi = new PerfInfo ();
+ perf_table [name] = pi;
+ }
+
+ pi.Time += DateTime.Now - start;
+ pi.NumberOfCalls ++;
+ }
+
+ void DumpPerformanceSummary ()
+ {
+ SetColor (eventColor);
+ WriteLine ("Target perfomance summary:");
+ ResetColor ();
+
+ foreach (var pi in targetPerfTable.OrderBy (pair => pair.Value.Time))
+ WriteLine (String.Format ("{0,10:0.000} ms {1,-50} {2,5} calls", pi.Value.Time.TotalMilliseconds, pi.Key, pi.Value.NumberOfCalls));
+
+ WriteLine (String.Empty);
+
+ SetColor (eventColor);
+ WriteLine ("Tasks perfomance summary:");
+ ResetColor ();
+
+ foreach (var pi in tasksPerfTable.OrderBy (pair => pair.Value.Time))
+ WriteLine (String.Format ("{0,10:0.000} ms {1,-50} {2,5} calls", pi.Value.Time.TotalMilliseconds, pi.Key, pi.Value.NumberOfCalls));
+
+ WriteLine (String.Empty);
+ }
private void WriteLineWithoutIndent (string message)
{
set { writeHandler = value; }
}
}
+
+ class PerfInfo {
+ public TimeSpan Time;
+ public int NumberOfCalls;
+ }
}
#endif
{
var ctx = CSharpBinder.CreateDefaultCompilerContext ();
CSharpBinder.InitializeCompiler (ctx);
- var context = TypeImporter.Import (callingContext);
+ var context_type = TypeImporter.Import (callingContext);
+ var rc = new Compiler.ResolveContext (new RuntimeBinderContext (ctx, context_type), 0);
- var expr = Compiler.Expression.MemberLookup (ctx, context, context, name, 0, Compiler.BindingRestriction.None, Compiler.Location.Null);
+ var expr = Compiler.Expression.MemberLookup (rc, context_type, context_type, name, 0, false, Compiler.Location.Null);
var binder = new CSharpBinder (
this, new Compiler.BoolConstant (expr is Compiler.EventExpr, Compiler.Location.Null), null);
//
using System;
+using System.Collections.Generic;
using Compiler = Mono.CSharp;
namespace Microsoft.CSharp.RuntimeBinder
throw new NotImplementedException ();
}
- public Compiler.ExtensionMethodGroupExpr LookupExtensionMethod (Compiler.TypeSpec extensionType, string name, int arity, Mono.CSharp.Location loc)
+ public IList<Compiler.MethodSpec> LookupExtensionMethod (Compiler.TypeSpec extensionType, string name, int arity, ref Compiler.NamespaceEntry scope)
{
// No extension method lookup in this context
return null;
#endregion
}
-}
\ No newline at end of file
+}
--- /dev/null
+/License.htm -crlf
+/Readme.htm -crlf
--- /dev/null
+/MicrosoftAjax.debug.js -crlf
+/MicrosoftAjax.debug.jvm.js -crlf
+/MicrosoftAjax.js -crlf
+/MicrosoftAjaxTimer.debug.js -crlf
+/MicrosoftAjaxTimer.js -crlf
+/MicrosoftAjaxWebForms.debug.js -crlf
+/MicrosoftAjaxWebForms.debug.jvm.js -crlf
+/MicrosoftAjaxWebForms.js -crlf
--- /dev/null
+/af-ZA.js -crlf
+/ar-AE.js -crlf
+/ar-BH.js -crlf
+/ar-DZ.js -crlf
+/ar-EG.js -crlf
+/ar-IQ.js -crlf
+/ar-JO.js -crlf
+/ar-KW.js -crlf
+/ar-LB.js -crlf
+/ar-LY.js -crlf
+/ar-MA.js -crlf
+/ar-OM.js -crlf
+/ar-QA.js -crlf
+/ar-SA.js -crlf
+/ar-SY.js -crlf
+/ar-TN.js -crlf
+/ar-YE.js -crlf
+/az-AZ-Cyrl.js -crlf
+/az-AZ-Latn.js -crlf
+/be-BY.js -crlf
+/bg-BG.js -crlf
+/ca-ES.js -crlf
+/cs-CZ.js -crlf
+/da-DK.js -crlf
+/de-AT.js -crlf
+/de-CH.js -crlf
+/de-DE.js -crlf
+/de-LI.js -crlf
+/de-LU.js -crlf
+/div-MV.js -crlf
+/el-GR.js -crlf
+/en-AU.js -crlf
+/en-BZ.js -crlf
+/en-CA.js -crlf
+/en-CB.js -crlf
+/en-GB.js -crlf
+/en-IE.js -crlf
+/en-JM.js -crlf
+/en-NZ.js -crlf
+/en-PH.js -crlf
+/en-TT.js -crlf
+/en-US.js -crlf
+/en-ZA.js -crlf
+/en-ZW.js -crlf
+/es-AR.js -crlf
+/es-BO.js -crlf
+/es-CL.js -crlf
+/es-CO.js -crlf
+/es-CR.js -crlf
+/es-DO.js -crlf
+/es-EC.js -crlf
+/es-ES.js -crlf
+/es-GT.js -crlf
+/es-HN.js -crlf
+/es-MX.js -crlf
+/es-NI.js -crlf
+/es-PA.js -crlf
+/es-PE.js -crlf
+/es-PR.js -crlf
+/es-PY.js -crlf
+/es-SV.js -crlf
+/es-UY.js -crlf
+/es-VE.js -crlf
+/et-EE.js -crlf
+/eu-ES.js -crlf
+/fa-IR.js -crlf
+/fi-FI.js -crlf
+/fo-FO.js -crlf
+/fr-BE.js -crlf
+/fr-CA.js -crlf
+/fr-CH.js -crlf
+/fr-FR.js -crlf
+/fr-LU.js -crlf
+/fr-MC.js -crlf
+/gl-ES.js -crlf
+/gu-IN.js -crlf
+/he-IL.js -crlf
+/hi-IN.js -crlf
+/hr-HR.js -crlf
+/hu-HU.js -crlf
+/hy-AM.js -crlf
+/id-ID.js -crlf
+/is-IS.js -crlf
+/it-CH.js -crlf
+/it-IT.js -crlf
+/ja-JP.js -crlf
+/ka-GE.js -crlf
+/kk-KZ.js -crlf
+/kn-IN.js -crlf
+/ko-KR.js -crlf
+/kok-IN.js -crlf
+/ky-KG.js -crlf
+/lt-LT.js -crlf
+/lv-LV.js -crlf
+/mk-MK.js -crlf
+/mn-MN.js -crlf
+/mr-IN.js -crlf
+/ms-BN.js -crlf
+/ms-MY.js -crlf
+/nb-NO.js -crlf
+/nl-BE.js -crlf
+/nl-NL.js -crlf
+/nn-NO.js -crlf
+/pa-IN.js -crlf
+/pl-PL.js -crlf
+/pt-BR.js -crlf
+/pt-PT.js -crlf
+/ro-RO.js -crlf
+/ru-RU.js -crlf
+/sa-IN.js -crlf
+/sk-SK.js -crlf
+/sl-SI.js -crlf
+/sq-AL.js -crlf
+/sr-SP-Cyrl.js -crlf
+/sr-SP-Latn.js -crlf
+/sv-FI.js -crlf
+/sv-SE.js -crlf
+/sw-KE.js -crlf
+/syr-SY.js -crlf
+/ta-IN.js -crlf
+/te-IN.js -crlf
+/th-TH.js -crlf
+/tr-TR.js -crlf
+/tt-RU.js -crlf
+/uk-UA.js -crlf
+/ur-PK.js -crlf
+/uz-UZ-Cyrl.js -crlf
+/uz-UZ-Latn.js -crlf
+/vi-VN.js -crlf
+/zh-CN.js -crlf
+/zh-HK.js -crlf
+/zh-MO.js -crlf
+/zh-SG.js -crlf
+/zh-TW.js -crlf
--- /dev/null
+/MicrosoftAjax.debug.en-US.js -crlf
+/MicrosoftAjax.debug.js -crlf
+/MicrosoftAjax.debug.jvm.js -crlf
+/MicrosoftAjax.en-US.js -crlf
+/MicrosoftAjax.js -crlf
+/MicrosoftAjax.jvm.js -crlf
+/MicrosoftAjaxTimer.debug.en-US.js -crlf
+/MicrosoftAjaxTimer.debug.js -crlf
+/MicrosoftAjaxTimer.en-US.js -crlf
+/MicrosoftAjaxTimer.js -crlf
+/MicrosoftAjaxWebForms.debug.en-US.js -crlf
+/MicrosoftAjaxWebForms.debug.js -crlf
+/MicrosoftAjaxWebForms.en-US.js -crlf
+/MicrosoftAjaxWebForms.js -crlf
--- /dev/null
+/af-ZA.js -crlf
+/ar-AE.js -crlf
+/ar-BH.js -crlf
+/ar-DZ.js -crlf
+/ar-EG.js -crlf
+/ar-IQ.js -crlf
+/ar-JO.js -crlf
+/ar-KW.js -crlf
+/ar-LB.js -crlf
+/ar-LY.js -crlf
+/ar-MA.js -crlf
+/ar-OM.js -crlf
+/ar-QA.js -crlf
+/ar-SA.js -crlf
+/ar-SY.js -crlf
+/ar-TN.js -crlf
+/ar-YE.js -crlf
+/arn-CL.js -crlf
+/az-Cyrl-AZ.js -crlf
+/az-Latn-AZ.js -crlf
+/be-BY.js -crlf
+/bg-BG.js -crlf
+/bs-Cyrl-BA.js -crlf
+/bs-Latn-BA.js -crlf
+/ca-ES.js -crlf
+/cs-CZ.js -crlf
+/cy-GB.js -crlf
+/da-DK.js -crlf
+/de-AT.js -crlf
+/de-CH.js -crlf
+/de-DE.js -crlf
+/de-LI.js -crlf
+/de-LU.js -crlf
+/dv-MV.js -crlf
+/el-GR.js -crlf
+/en-029.js -crlf
+/en-AU.js -crlf
+/en-BZ.js -crlf
+/en-CA.js -crlf
+/en-GB.js -crlf
+/en-IE.js -crlf
+/en-JM.js -crlf
+/en-NZ.js -crlf
+/en-PH.js -crlf
+/en-TT.js -crlf
+/en-US.js -crlf
+/en-ZA.js -crlf
+/en-ZW.js -crlf
+/es-AR.js -crlf
+/es-BO.js -crlf
+/es-CL.js -crlf
+/es-CO.js -crlf
+/es-CR.js -crlf
+/es-DO.js -crlf
+/es-EC.js -crlf
+/es-ES.js -crlf
+/es-GT.js -crlf
+/es-HN.js -crlf
+/es-MX.js -crlf
+/es-NI.js -crlf
+/es-PA.js -crlf
+/es-PE.js -crlf
+/es-PR.js -crlf
+/es-PY.js -crlf
+/es-SV.js -crlf
+/es-UY.js -crlf
+/es-VE.js -crlf
+/et-EE.js -crlf
+/eu-ES.js -crlf
+/fa-IR.js -crlf
+/fi-FI.js -crlf
+/fil-PH.js -crlf
+/fo-FO.js -crlf
+/fr-BE.js -crlf
+/fr-CA.js -crlf
+/fr-CH.js -crlf
+/fr-FR.js -crlf
+/fr-LU.js -crlf
+/fr-MC.js -crlf
+/fy-NL.js -crlf
+/ga-IE.js -crlf
+/gl-ES.js -crlf
+/gu-IN.js -crlf
+/he-IL.js -crlf
+/hi-IN.js -crlf
+/hr-BA.js -crlf
+/hr-HR.js -crlf
+/hu-HU.js -crlf
+/hy-AM.js -crlf
+/id-ID.js -crlf
+/is-IS.js -crlf
+/it-CH.js -crlf
+/it-IT.js -crlf
+/iu-Latn-CA.js -crlf
+/ja-JP.js -crlf
+/ka-GE.js -crlf
+/kk-KZ.js -crlf
+/kn-IN.js -crlf
+/ko-KR.js -crlf
+/kok-IN.js -crlf
+/ky-KG.js -crlf
+/lb-LU.js -crlf
+/lt-LT.js -crlf
+/lv-LV.js -crlf
+/mi-NZ.js -crlf
+/mk-MK.js -crlf
+/mn-MN.js -crlf
+/moh-CA.js -crlf
+/mr-IN.js -crlf
+/ms-BN.js -crlf
+/ms-MY.js -crlf
+/mt-MT.js -crlf
+/nb-NO.js -crlf
+/nl-BE.js -crlf
+/nl-NL.js -crlf
+/nn-NO.js -crlf
+/ns-ZA.js -crlf
+/pa-IN.js -crlf
+/pl-PL.js -crlf
+/pt-BR.js -crlf
+/pt-PT.js -crlf
+/quz-BO.js -crlf
+/quz-EC.js -crlf
+/quz-PE.js -crlf
+/rm-CH.js -crlf
+/ro-RO.js -crlf
+/ru-RU.js -crlf
+/sa-IN.js -crlf
+/se-FI.js -crlf
+/se-NO.js -crlf
+/se-SE.js -crlf
+/sk-SK.js -crlf
+/sl-SI.js -crlf
+/sma-NO.js -crlf
+/sma-SE.js -crlf
+/smj-NO.js -crlf
+/smj-SE.js -crlf
+/smn-FI.js -crlf
+/sms-FI.js -crlf
+/sq-AL.js -crlf
+/sr-Cyrl-BA.js -crlf
+/sr-Cyrl-CS.js -crlf
+/sr-Latn-BA.js -crlf
+/sr-Latn-CS.js -crlf
+/sv-FI.js -crlf
+/sv-SE.js -crlf
+/sw-KE.js -crlf
+/syr-SY.js -crlf
+/ta-IN.js -crlf
+/te-IN.js -crlf
+/th-TH.js -crlf
+/tn-ZA.js -crlf
+/tr-TR.js -crlf
+/tt-RU.js -crlf
+/uk-UA.js -crlf
+/ur-PK.js -crlf
+/uz-Cyrl-UZ.js -crlf
+/uz-Latn-UZ.js -crlf
+/vi-VN.js -crlf
+/xh-ZA.js -crlf
+/zh-CN.js -crlf
+/zh-HK.js -crlf
+/zh-MO.js -crlf
+/zh-SG.js -crlf
+/zh-TW.js -crlf
+/zu-ZA.js -crlf
--- /dev/null
+/Makefile -crlf
--- /dev/null
+/SQLite3.cs -crlf
+/SQLite3_UTF16.cs -crlf
+/SQLiteBase.cs -crlf
+/SQLiteCommand.cs -crlf
+/SQLiteCommandBuilder.cs -crlf
+/SQLiteConnection.cs -crlf
+/SQLiteConnectionPool.cs -crlf
+/SQLiteConnectionStringBuilder.cs -crlf
+/SQLiteConvert.cs -crlf
+/SQLiteDataAdapter.cs -crlf
+/SQLiteDataReader.cs -crlf
+/SQLiteEnlistment.cs -crlf
+/SQLiteException.cs -crlf
+/SQLiteFactory.cs -crlf
+/SQLiteFunction.cs -crlf
+/SQLiteFunctionAttribute.cs -crlf
+/SQLiteKeyReader.cs -crlf
+/SQLiteMetaDataCollectionNames.cs -crlf
+/SQLiteParameter.cs -crlf
+/SQLiteParameterCollection.cs -crlf
+/SQLiteStatement.cs -crlf
+/SQLiteTransaction.cs -crlf
+/SR.Designer.cs -crlf
+/UnsafeNativeMethods.cs -crlf
2007-06-03 Kamil Skalski <nazgul@nemerle.org>
- * SQLiteConvert.cs: Port function for converting native UTF8 string\r
- into managed string from the old SqliteClient implementation.\r
+ * SQLiteConvert.cs: Port function for converting native UTF8 string
+ into managed string from the old SqliteClient implementation.
Use it instead of PtrToStrAuto, which fails on Windows.
2007-02-20 Marek Habersack <grendello@gmail.com>
--- /dev/null
+/SQLiteConnection_Linq.cs -crlf
+/SQLiteFactory_Linq.cs -crlf
--- /dev/null
+/SqliteTest.cs -crlf
--- /dev/null
+/DataTypes.xml -crlf
+/MetaDataCollections.xml -crlf
+/SR.resx -crlf
--- /dev/null
+/ChangeLog -crlf
--- /dev/null
+/MessageEnumeratorExceptionTest.cs -crlf
--- /dev/null
+/CompletedEventArgs.cs -crlf
--- /dev/null
+/UnixConnectionPool.cs -crlf
_nextInChain.AsyncProcessRequest (stack, msg, transportHeaders, stream);
// FIXME: No idea about how to implement IMessageCtrl
- return null; \r
+ return null;
}
public IMessage SyncProcessMessage (IMessage msg)
//\r
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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
}\r
\r
\r
-}
+}\r
<remarks>
<example>
<code lang="C#">
-using System;\r
-using System.IO;\r
-using System.Net;\r
-using System.Net.Sockets;\r
-using System.Text;\r
-\r
-using Mono.Security.Authenticode;\r
-using Mono.Security.Protocol.Tls;\r
-using System.Security.Cryptography;\r
-using System.Security.Cryptography.X509Certificates;\r
-\r
-namespace SslHttpServer\r
-{\r
- class SslHttpServer\r
- {\r
+using System;
+using System.IO;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+
+using Mono.Security.Authenticode;
+using Mono.Security.Protocol.Tls;
+using System.Security.Cryptography;
+using System.Security.Cryptography.X509Certificates;
+
+namespace SslHttpServer
+{
+ class SslHttpServer
+ {
private static X509Certificate _certificate;
private static string certfile;
- private static string keyfile;\r
-\r
- static void Main (string [] args)\r
+ private static string keyfile;
+
+ static void Main (string [] args)
{
certfile = (args.Length > 0) ? args [0] : "ssl.cer";
keyfile = (args.Length > 0) ? args [0] : "ssl.pvk";
-\r
- Socket listenSocket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);\r
- IPEndPoint localEndPoint = new IPEndPoint (IPAddress.Any, 1888);\r
- Socket requestSocket;\r
-\r
- listenSocket.Bind (localEndPoint);\r
- listenSocket.Listen (10);\r
-\r
- while (true) {\r
- try {\r
- requestSocket = listenSocket.Accept ();\r
- using (NetworkStream ns = new NetworkStream (requestSocket, FileAccess.ReadWrite, true)) {\r
- using (SslServerStream s = new SslServerStream (ns, Certificate, false, false)) {\r
- s.PrivateKeyCertSelectionDelegate += new PrivateKeySelectionCallback (GetPrivateKey);\r
- StreamReader reader = new StreamReader (s);\r
- StreamWriter writer = new StreamWriter (s, Encoding.ASCII);\r
-\r
- string line;\r
- string answer =\r
- "HTTP/1.0 200\r\n" +\r
- "Connection: close\r\n" +\r
- "Content-Type: text/html\r\n" +\r
- "Content-Encoding: " + Encoding.ASCII.WebName + "\r\n" +\r
- "\r\n" +\r
- "<html><body><h1>Hello World!</h1></body></html>\r\n";\r
-\r
- // Read request header\r
- do {\r
- line = reader.ReadLine ();\r
- if (line != null)\r
- Console.WriteLine (line);\r
- }\r
- while (line != null && line.Length > 0);\r
-\r
- // Send response\r
- writer.Write (answer);\r
-\r
- writer.Flush ();\r
- s.Flush ();\r
- ns.Flush ();\r
- }\r
- }\r
- }\r
- catch (Exception ex) {\r
- Console.WriteLine ("---------------------------------------------------------");\r
- Console.WriteLine (ex.ToString ());\r
- }\r
- }\r
- }\r
-\r
- private static X509Certificate Certificate {\r
- get {\r
- if (_certificate == null)\r
- _certificate = X509Certificate.CreateFromCertFile (certfile);\r
- return _certificate;\r
- }\r
- }\r
-\r
- // note: makecert creates the private key in the PVK format\r
- private static AsymmetricAlgorithm GetPrivateKey (X509Certificate certificate, string targetHost)\r
- {\r
- PrivateKey key = PrivateKey.CreateFromFile (keyfile);\r
- return key.RSA;\r
- }\r
- }\r
-}\r
+
+ Socket listenSocket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ IPEndPoint localEndPoint = new IPEndPoint (IPAddress.Any, 1888);
+ Socket requestSocket;
+
+ listenSocket.Bind (localEndPoint);
+ listenSocket.Listen (10);
+
+ while (true) {
+ try {
+ requestSocket = listenSocket.Accept ();
+ using (NetworkStream ns = new NetworkStream (requestSocket, FileAccess.ReadWrite, true)) {
+ using (SslServerStream s = new SslServerStream (ns, Certificate, false, false)) {
+ s.PrivateKeyCertSelectionDelegate += new PrivateKeySelectionCallback (GetPrivateKey);
+ StreamReader reader = new StreamReader (s);
+ StreamWriter writer = new StreamWriter (s, Encoding.ASCII);
+
+ string line;
+ string answer =
+ "HTTP/1.0 200\r\n" +
+ "Connection: close\r\n" +
+ "Content-Type: text/html\r\n" +
+ "Content-Encoding: " + Encoding.ASCII.WebName + "\r\n" +
+ "\r\n" +
+ "<html><body><h1>Hello World!</h1></body></html>\r\n";
+
+ // Read request header
+ do {
+ line = reader.ReadLine ();
+ if (line != null)
+ Console.WriteLine (line);
+ }
+ while (line != null && line.Length > 0);
+
+ // Send response
+ writer.Write (answer);
+
+ writer.Flush ();
+ s.Flush ();
+ ns.Flush ();
+ }
+ }
+ }
+ catch (Exception ex) {
+ Console.WriteLine ("---------------------------------------------------------");
+ Console.WriteLine (ex.ToString ());
+ }
+ }
+ }
+
+ private static X509Certificate Certificate {
+ get {
+ if (_certificate == null)
+ _certificate = X509Certificate.CreateFromCertFile (certfile);
+ return _certificate;
+ }
+ }
+
+ // note: makecert creates the private key in the PVK format
+ private static AsymmetricAlgorithm GetPrivateKey (X509Certificate certificate, string targetHost)
+ {
+ PrivateKey key = PrivateKey.CreateFromFile (keyfile);
+ return key.RSA;
+ }
+ }
+}
</code>
</example>
<para>
--- /dev/null
+/ca.pem -crlf
+/client.pem -crlf
+/mutual.cs -crlf
ssl.ClientCertSelectionDelegate += new CertificateSelectionCallback (ClientCertificateSelection);\r
ssl.PrivateKeyCertSelectionDelegate += new PrivateKeySelectionCallback (PrivateKeySelection);\r
\r
- StreamWriter sw = new StreamWriter (ssl, System.Text.Encoding.ASCII);
- sw.WriteLine ("GET /clientcert.aspx{0}", Environment.NewLine);
- sw.Flush ();
+ StreamWriter sw = new StreamWriter (ssl, System.Text.Encoding.ASCII);\r
+ sw.WriteLine ("GET /clientcert.aspx{0}", Environment.NewLine);\r
+ sw.Flush ();\r
\r
- StreamReader sr = new StreamReader (ssl);
+ StreamReader sr = new StreamReader (ssl);\r
Console.WriteLine (sr.ReadToEnd ());\r
}\r
\r
--- /dev/null
+/sendback.asp -crlf
--- /dev/null
+/managed.xml -crlf
--- /dev/null
+/XPathNavigatorReader.cs -crlf
--- /dev/null
+/XQueryArithmeticOperator.cs -crlf
+/XQueryCliFunction.cs -crlf
+/XQueryComparisonOperator.cs -crlf
+/XQueryDefaultFunctionCall.cs -crlf
+/XQueryFunctionTable.cs -crlf
+/XmlQueryCompileException.cs -crlf
+/XmlQueryException.cs -crlf
--- /dev/null
+/SubtreeXmlReader.cs -crlf
+/XmlChar.cs -crlf
+/XmlStoredResolver.cs -crlf
--- /dev/null
+/makefile.build -crlf
+/net_1_1_java_Novell.Directory.Ldap.dll.sources -crlf
--- /dev/null
+/RfcLdapSuperDN.cs -crlf
--- /dev/null
+/AuthenticationCallbackHandler.cs -crlf
+/CreateContextPrivilegedAction.cs -crlf
+/ExchangeTokenPrivilegedAction.cs -crlf
+/Krb5Helper.cs -crlf
+/SecureStream.cs -crlf
+/UnwrapPrivilegedAction.cs -crlf
+/WrapPrivilegedAction.cs -crlf
-//
-// Novell.Directory.Ldap.Security.Krb5Helper.cs
-//
-// Authors:
-// Boris Kirzner <borsk@mainsoft.com>
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+// \r
+// Novell.Directory.Ldap.Security.Krb5Helper.cs\r
+//\r
+// Authors:\r
+// Boris Kirzner <borsk@mainsoft.com>\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
using System;\r
internal class Krb5Helper : IDisposable\r
{\r
enum QOP {\r
- NO_PROTECTION = 1,
- INTEGRITY_ONLY_PROTECTION = 2,
+ NO_PROTECTION = 1,\r
+ INTEGRITY_ONLY_PROTECTION = 2,\r
PRIVACY_PROTECTION = 4\r
}\r
\r
\r
//int rawSendSize = Context.getWrapSizeLimit(0, _encryption, srvMaxBufSize);\r
\r
- byte [] gssInToken = new byte [4];
+ byte [] gssInToken = new byte [4];\r
gssInToken [0] = (byte) myCop;\r
\r
SecureStream.IntToNetworkByteOrder (srvMaxBufSize, gssInToken, 1, 3);\r
-//
-// Novell.Directory.Ldap.Security.SecureStream.cs
-//
-// Authors:
-// Boris Kirzner <borsk@mainsoft.com>
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+// \r
+// Novell.Directory.Ldap.Security.SecureStream.cs\r
+//\r
+// Authors:\r
+// Boris Kirzner <borsk@mainsoft.com>\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
using System;\r
--- /dev/null
+/ExceptionMessages.resx -crlf
+/ExceptionMessages.txt -crlf
+/ResultCodeMessages.resx -crlf
public static System.String getMessage(System.String messageOrKey, System.Object[] arguments, System.Globalization.CultureInfo locale)
{
if (defaultMessages == null)
- {\r
+ {
defaultMessages = new ResourceManager ("ExceptionMessages", Assembly.GetExecutingAssembly ());
}
if (defaultResultCodes == null)
{
/*
- defaultResultCodes = ResourceManager.CreateFileBasedResourceManager("ResultCodeMessages", "Resources", null);*/\r
+ defaultResultCodes = ResourceManager.CreateFileBasedResourceManager("ResultCodeMessages", "Resources", null);*/
defaultResultCodes = new ResourceManager ("ResultCodeMessages", Assembly.GetExecutingAssembly ());
}
--- /dev/null
+/AuthenticationTypes.cs -crlf
+/MessageVector.cs -crlf
--- /dev/null
+/Cache.cs -crlf
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
- -->\r
+ -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
- -->\r
+ -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
- -->\r
+ -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "IndexOf", parameterName);
// Iterate values to see what is the index of parameter.
- Int32 index = 0;\r
- if ((parameterName[0] == ':') || (parameterName[0] == '@'))\r
- parameterName = parameterName.Remove(0, 1);\r
-\r
- foreach (NpgsqlParameter parameter in this)\r
- {\r
- if (parameter.ParameterName.Remove(0, 1) == parameterName)\r
- return index;\r
+ Int32 index = 0;
+ if ((parameterName[0] == ':') || (parameterName[0] == '@'))
+ parameterName = parameterName.Remove(0, 1);
+
+ foreach (NpgsqlParameter parameter in this)
+ {
+ if (parameter.ParameterName.Remove(0, 1) == parameterName)
+ return index;
index++;
}
return -1;
NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Contains", value);
CheckType(value);
return this.InternalList.Contains(value);
- }\r
-\r
- /// <summary>\r
- /// Gets a value indicating whether a <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> with the specified parameter name exists in the collection.\r
- /// </summary>\r
- /// <param name="parameterName">The name of the <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> object to find.</param>\r
- /// <param name="parameter">A reference to the requested parameter is returned in this out param if it is found in the list. This value is null if the parameter is not found.</param>\r
- /// <returns><b>true</b> if the collection contains the parameter and param will contain the parameter; otherwise, <b>false</b>.</returns>\r
- public bool TryGetValue(string parameterName, out NpgsqlParameter parameter)\r
- {\r
- NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "TryGetValue", parameterName);\r
- int index = IndexOf(parameterName);\r
- if (index != -1)\r
- {\r
- parameter = this[index];\r
- return true;\r
- }\r
- else\r
- {\r
- parameter = null;\r
- return false;\r
- }\r
- }\r
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether a <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> with the specified parameter name exists in the collection.
+ /// </summary>
+ /// <param name="parameterName">The name of the <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> object to find.</param>
+ /// <param name="parameter">A reference to the requested parameter is returned in this out param if it is found in the list. This value is null if the parameter is not found.</param>
+ /// <returns><b>true</b> if the collection contains the parameter and param will contain the parameter; otherwise, <b>false</b>.</returns>
+ public bool TryGetValue(string parameterName, out NpgsqlParameter parameter)
+ {
+ NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "TryGetValue", parameterName);
+ int index = IndexOf(parameterName);
+ if (index != -1)
+ {
+ parameter = this[index];
+ return true;
+ }
+ else
+ {
+ parameter = null;
+ return false;
+ }
+ }
/// <summary>
/// Removes all items from the collection.
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
- -->\r
+ -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
- -->\r
+ -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
- -->\r
+ -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
- -->\r
+ -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
--- /dev/null
+/README.txt -crlf
--- /dev/null
+/PossibleAuthenticationFailureException.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/StringsTests.cs -crlf
--- /dev/null
+/AssumesTests.cs -crlf
--- /dev/null
+/ConditionalWeakTableTests.cs -crlf
+/ReadOnlyDictionaryDebuggerProxyTests.cs -crlf
+/ReadOnlyDictionaryTests.cs -crlf
+/WeakReferenceCollectionTests.cs -crlf
--- /dev/null
+/LazyOfTTMetadataTests.cs -crlf
--- /dev/null
+/AdvancedValueComposition.cs -crlf
+/AggregateExportProviderTest.cs -crlf
+/AttributedModelServicesTests.cs -crlf
+/CardinalityMismatchExceptionTests.cs -crlf
+/ComponentModelTestTypes.cs -crlf
+/ComponentServicesTests.cs -crlf
+/ComposablePartCatalogExtensions.cs -crlf
+/ComposablePartDefinitionTests.cs -crlf
+/ComposablePartExceptionTests.cs -crlf
+/ComposablePartExtensibilityTests.cs -crlf
+/ComposablePartTests.cs -crlf
+/CompositionContainerCollectionTests.cs -crlf
+/CompositionContainerExtensibilityTests.cs -crlf
+/CompositionContainerExtensions.cs -crlf
+/CompositionContainerImportTests.cs -crlf
+/CompositionContainerTests.cs -crlf
+/CompositionErrorDebuggerProxyTests.cs -crlf
+/CompositionErrorIdTests.cs -crlf
+/CompositionErrorTests.cs -crlf
+/CompositionExceptionTests.cs -crlf
+/CompositionResultOfTTest.cs -crlf
+/CompositionResultTest.cs -crlf
+/CompositionServiceExtensionsTests.cs -crlf
+/CompositionServiceProxy.cs -crlf
+/CompositionServicesTests.cs -crlf
+/ConcreteComposablePart.cs -crlf
+/ConstraintServicesTests.cs -crlf
+/ContractBasedImportDefinitionTests.cs -crlf
+/ContractMismatchExceptionTests.cs -crlf
+/DynamicMetadata.cs -crlf
+/Expectations.cs -crlf
+/ExportAttributeTests.cs -crlf
+/ExportCollectionTests.cs -crlf
+/ExportDefinitionTests.cs -crlf
+/ExportMetadataAttributeTests.cs -crlf
+/ExportProviderTests.cs -crlf
+/ExportTests.cs -crlf
+/ExportableAttributeTests.cs -crlf
+/GenerationServicesTests.cs -crlf
+/ImportAttributeTests.cs -crlf
+/ImportDefinitionTests.cs -crlf
+/ImportingComposablePart.cs -crlf
+/ImportingConstructorAttributeTests.cs -crlf
+/InitializationScopeTests.cs -crlf
+/MetadataAttributeAttributeTests.cs -crlf
+/MetadataTests.cs -crlf
+/MetadataViewProviderTests.cs -crlf
+/MicroExport.cs -crlf
+/PartCreationPolicyAttributeTests.cs -crlf
+/PartMetadataAttributeTests.cs -crlf
+/SampleComponents.cs -crlf
--- /dev/null
+/AllowNonPublicCompositionTests.cs -crlf
+/AttributedModelCompositionTests.cs -crlf
+/AttributedModelDiscoveryTests.cs -crlf
+/INotifyImportTests.cs -crlf
--- /dev/null
+/CompositionTraceIdTests.cs -crlf
+/CompositionTraceSourceTests.cs -crlf
--- /dev/null
+/CustomImportAttribute.cs -crlf
+/CustomImportManyAttribute.cs -crlf
--- /dev/null
+/CatalogFactory.DerivedComposablePartCatalog.cs -crlf
+/CatalogFactory.DisposableComposablePartCatalog.cs -crlf
+/CatalogFactory.FilteredComposablePartCatalog.cs -crlf
+/CatalogFactory.MutableComposablePartCatalog.cs -crlf
+/CatalogFactory.NoOverridesComposablePartCatalog.cs -crlf
+/CatalogFactory.NonFilteringTypeCatalog.cs -crlf
+/CatalogFactory.cs -crlf
+/ConstraintFactory.cs -crlf
+/ContainerFactory.DisposableCompositionContainer.cs -crlf
+/ContainerFactory.NoOverridesCompositionContainer.cs -crlf
+/ContainerFactory.cs -crlf
+/ElementFactory.CompositionElement.cs -crlf
+/ElementFactory.cs -crlf
+/ErrorFactory.cs -crlf
+/ExportDefinitionFactory.DerivedExportDefinition.cs -crlf
+/ExportDefinitionFactory.cs -crlf
+/ExportFactory.cs -crlf
+/ExportProviderFactory.NoOverridesExportProvider.cs -crlf
+/ExportProviderFactory.RecomposableExportProvider.cs -crlf
+/ExportProviderFactory.cs -crlf
+/ImportDefinitionFactory.DerivedContractBasedImportDefinition.cs -crlf
+/ImportDefinitionFactory.DerivedImportDefinition.cs -crlf
+/ImportDefinitionFactory.cs -crlf
+/PartDefinitionFactory.DerivedComposablePartDefinition.cs -crlf
+/PartDefinitionFactory.NoOverridesComposablePartDefinition.cs -crlf
+/PartDefinitionFactory.cs -crlf
+/PartFactory.DisposableComposablePart.cs -crlf
+/PartFactory.NoOverridesComposablePart.cs -crlf
+/PartFactory.cs -crlf
+/ReflectionFactory.MockParameterInfo.cs -crlf
+/ReflectionFactory.cs -crlf
--- /dev/null
+/AggregateCatalogTest.cs -crlf
+/AssemblyCatalogDebuggerProxyTests.cs -crlf
+/AssemblyCatalogTests.cs -crlf
+/CatalogExportProviderTests.cs -crlf
+/CompositionBatchTests.cs -crlf
+/CompositionTransactionTests.cs -crlf
+/DirectoryCatalogDebuggerProxyTests.cs -crlf
+/DirectoryCatalogTests.cs -crlf
+/ImportEngineTests.cs -crlf
+/TypeCatalogTests.cs -crlf
--- /dev/null
+/ComposablePartCatalogDebuggerProxyTests.cs -crlf
+/ComposablePartCatalogTests.cs -crlf
+/CompositionElementDebuggerProxyTests.cs -crlf
+/CompositionElementTests.cs -crlf
+/SerializableCompositionElementTests.cs -crlf
--- /dev/null
+/LazyMemberInfoTests.cs -crlf
+/ReflectionComposablePartDefinitionTests.cs -crlf
+/ReflectionComposablePartTests.cs -crlf
+/ReflectionMemberExportDefinitionTests.cs -crlf
+/ReflectionMemberImportDefinitionTests.cs -crlf
+/ReflectionModelServicesTests.cs -crlf
+/ReflectionParameterImportDefinitionTests.cs -crlf
--- /dev/null
+/ConstraintAssert.cs -crlf
--- /dev/null
+/AdaptingCollectionTests.cs -crlf
+/CatalogFilteringTests.cs -crlf
+/CompositionContainerAttributedModelCycleTests.cs -crlf
+/ConstructorInjectionTests.cs -crlf
+/DelayLoadingTests.cs -crlf
+/DelegateCompositionTests.cs -crlf
+/DiscoveryTests.cs -crlf
+/ExportProviderEventTests.cs -crlf
+/LifetimeTests.cs -crlf
+/PartCreatorTests.cs -crlf
+/RecompositionTests.cs -crlf
+/RejectionTests.cs -crlf
+/RequiredCreationPolicyTests.cs -crlf
--- /dev/null
+/ReflectionItemAssert.cs -crlf
+/TestUtilities.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/DisposableObject.cs -crlf
+/EnumExtensions.cs -crlf
+/ReferenceTracker.cs -crlf
+/TypeExtensions.cs -crlf
--- /dev/null
+/EnumerableExtensions.cs -crlf
--- /dev/null
+/DictionaryExtensions.cs -crlf
--- /dev/null
+/ConstraintParser.cs -crlf
--- /dev/null
+/TraceContext.TraceContextTraceListener.cs -crlf
+/TraceContext.cs -crlf
+/TraceEventDetails.cs -crlf
+/TraceId.cs -crlf
--- /dev/null
+/CompositionHostTestService.cs -crlf
--- /dev/null
+/ReflectionModelServicesEx.cs -crlf
--- /dev/null
+/CompositionAssert.cs -crlf
+/ElementAssert.cs -crlf
+/ErrorId.cs -crlf
+/ExportsAssert.cs -crlf
--- /dev/null
+/CurrentCultureContext.cs -crlf
--- /dev/null
+/FileIO.cs -crlf
+/TemporaryDirectory.cs -crlf
+/TemporaryFile.cs -crlf
+/TemporaryFileCopier.cs -crlf
--- /dev/null
+/SerializationTestServices.cs -crlf
+/StrictFormatterConverter.cs -crlf
--- /dev/null
+/EnumerableAssert.cs -crlf
+/ExceptionAssert.cs -crlf
+/ExpectationCollectionOfI.cs -crlf
+/ExpectationCollectionOfIO.cs -crlf
+/ExpectationOfI.cs -crlf
+/ExpectationOfIO.cs -crlf
+/ExtendedAssert.cs -crlf
+/ReflectionAssert.cs -crlf
+/RetryMode.cs -crlf
+/TestServices.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/SilverlightAdditions.cs -crlf
+/Strings.Designer.cs -crlf
+/Strings.resx -crlf
+/SuppressMessages.cs -crlf
+/SuppressMessagesBaselined.cs -crlf
--- /dev/null
+/Assumes.InternalErrorException.cs -crlf
+/Assumes.cs -crlf
+/AttributeServices.cs -crlf
+/ContractServices.cs -crlf
+/GenerationServices.cs -crlf
+/LazyServices.cs -crlf
+/Lock.Reader.cs -crlf
+/Lock.Writer.cs -crlf
+/Lock.cs -crlf
+/ReflectionInvoke.cs -crlf
+/ReflectionServices.cs -crlf
+/Requires.cs -crlf
+/SilverlightReflectionInvoke.cs -crlf
+/StringComparers.cs -crlf
--- /dev/null
+/CollectionServices.CollectionOfObject.cs -crlf
+/CollectionServices.cs -crlf
+/ConditionalWeakTable.cs -crlf
+/EnumerableCardinality.cs -crlf
+/ReadOnlyDictionary.cs -crlf
+/ReadOnlyDictionaryDebuggerProxy.cs -crlf
+/WeakReferenceCollection.cs -crlf
--- /dev/null
+/SerializationServices.cs -crlf
--- /dev/null
+/Lazy.cs -crlf
+/LazyOfTTMetadata.cs -crlf
+/Tuple.cs -crlf
--- /dev/null
+/AttributedModelServices.cs -crlf
+/ChangeRejectedException.cs -crlf
+/CompositionContractMismatchException.cs -crlf
+/CompositionError.cs -crlf
+/CompositionErrorDebuggerProxy.cs -crlf
+/CompositionErrorId.cs -crlf
+/CompositionException.cs -crlf
+/CompositionResult.cs -crlf
+/CompositionResultOfT.cs -crlf
+/ConstraintServices.cs -crlf
+/ContractNameServices.cs -crlf
+/CreationPolicy.cs -crlf
+/ErrorBuilder.cs -crlf
+/ExceptionBuilder.cs -crlf
+/ExportAttribute.cs -crlf
+/ExportCardinalityCheckResult.cs -crlf
+/ExportMetadataAttribute.cs -crlf
+/ExportServices.DisposableLazy.cs -crlf
+/ExportServices.cs -crlf
+/IAttributedImport.cs -crlf
+/ICompositionError.cs -crlf
+/ICompositionService.cs -crlf
+/IPartImportsSatisfiedNotification.cs -crlf
+/ImportAttribute.cs -crlf
+/ImportCardinalityMismatchException.cs -crlf
+/ImportManyAttribute.cs -crlf
+/ImportingConstructorAttribute.cs -crlf
+/InheritedExportAttribute.cs -crlf
+/MetadataAttributeAttribute.cs -crlf
+/MetadataServices.cs -crlf
+/MetadataViewGenerator.cs -crlf
+/MetadataViewProvider.cs -crlf
+/PartCreationPolicyAttribute.cs -crlf
+/PartCreatorOfT.cs -crlf
+/PartCreatorOfTTMetadata.cs -crlf
+/PartLifetimeContextOfT.cs -crlf
+/PartMetadataAttribute.cs -crlf
+/PartNotDiscoverableAttribute.cs -crlf
--- /dev/null
+/AttributedExportDefinition.cs -crlf
+/AttributedModelDiscovery.cs -crlf
+/AttributedPartCreationInfo.cs -crlf
--- /dev/null
+/CompositionTrace.cs -crlf
+/CompositionTraceId.cs -crlf
+/CompositionTraceSource.cs -crlf
+/SilverlightTraceWriter.cs -crlf
+/TraceSourceTraceWriter.cs -crlf
+/TraceWriter.cs -crlf
--- /dev/null
+/AggregateCatalog.cs -crlf
+/AggregateExportProvider.cs -crlf
+/AssemblyCatalog.cs -crlf
+/AssemblyCatalogDebuggerProxy.cs -crlf
+/AtomicComposition.cs -crlf
+/AtomicCompositionExtensions.cs -crlf
+/CatalogExportProvider.CatalogChangeProxy.cs -crlf
+/CatalogExportProvider.CatalogExport.cs -crlf
+/CatalogExportProvider.PartCreatorExport.cs -crlf
+/CatalogExportProvider.cs -crlf
+/ComposablePartCatalogChangeEventArgs.cs -crlf
+/ComposablePartCatalogCollection.cs -crlf
+/ComposablePartExportProvider.cs -crlf
+/CompositionBatch.SingleExportComposablePart.cs -crlf
+/CompositionBatch.cs -crlf
+/CompositionConstants.cs -crlf
+/CompositionContainer.cs -crlf
+/CompositionLock.cs -crlf
+/CompositionServices.cs -crlf
+/DirectoryCatalog.DirectoryCatalogDebuggerProxy.cs -crlf
+/DirectoryCatalog.cs -crlf
+/ExportProvider.GetExportOverrides.cs -crlf
+/ExportProvider.cs -crlf
+/ExportsChangeEventArgs.cs -crlf
+/INotifyComposablePartCatalogChanged.cs -crlf
+/ImportEngine.EngineContext.cs -crlf
+/ImportEngine.PartManager.cs -crlf
+/ImportEngine.RecompositionManager.cs -crlf
+/ImportEngine.cs -crlf
+/TypeCatalog.cs -crlf
--- /dev/null
+/ComposablePart.cs -crlf
+/ComposablePartCatalog.cs -crlf
+/ComposablePartCatalogDebuggerProxy.cs -crlf
+/ComposablePartDefinition.cs -crlf
+/ComposablePartException.cs -crlf
+/CompositionElement.cs -crlf
+/CompositionElementDebuggerProxy.cs -crlf
+/CompositionElementExtensions.cs -crlf
+/ContractBasedImportDefinition.cs -crlf
+/Export.cs -crlf
+/ExportDefinition.cs -crlf
+/ExportedDelegate.cs -crlf
+/ICompositionElement.cs -crlf
+/IPartCreatorImportDefinition.cs -crlf
+/ImportCardinality.cs -crlf
+/ImportDefinition.cs -crlf
+/SerializableCompositionElement.cs -crlf
--- /dev/null
+/DisposableReflectionComposablePart.cs -crlf
+/ExportingMember.cs -crlf
+/IReflectionPartCreationInfo.cs -crlf
+/ImportType.cs -crlf
+/ImportingItem.cs -crlf
+/ImportingMember.cs -crlf
+/ImportingParameter.cs -crlf
+/LazyMemberInfo.cs -crlf
+/PartCreatorExportDefinition.cs -crlf
+/PartCreatorMemberImportDefinition.cs -crlf
+/PartCreatorParameterImportDefinition.cs -crlf
+/ReflectionComposablePart.cs -crlf
+/ReflectionComposablePartDefinition.cs -crlf
+/ReflectionExtensions.cs -crlf
+/ReflectionField.cs -crlf
+/ReflectionImportDefinition.cs -crlf
+/ReflectionItem.cs -crlf
+/ReflectionItemType.cs -crlf
+/ReflectionMember.cs -crlf
+/ReflectionMemberExportDefinition.cs -crlf
+/ReflectionMemberImportDefinition.cs -crlf
+/ReflectionMethod.cs -crlf
+/ReflectionModelServices.cs -crlf
+/ReflectionParameter.cs -crlf
+/ReflectionParameterImportDefinition.cs -crlf
+/ReflectionProperty.cs -crlf
+/ReflectionType.cs -crlf
+/ReflectionWritableMember.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/Strings.Designer.cs -crlf
+/Strings.resx -crlf
+/SuppressMessages.cs -crlf
--- /dev/null
+/Lock.Reader.cs -crlf
+/Lock.Writer.cs -crlf
+/Lock.cs -crlf
+/Requires.cs -crlf
--- /dev/null
+/CompositionInitializer.AssemblyList.cs -crlf
+/CompositionInitializer.cs -crlf
+/ExportFactoryOfT.cs -crlf
+/ExportFactoryOfTTMetadata.cs -crlf
+/ExportLifetimeContextOfT.cs -crlf
--- /dev/null
+/CompositionHost.cs -crlf
+/DeploymentCatalog.cs -crlf
+/Package.cs -crlf
--- /dev/null
+/System.Configuration.Install.xml -crlf
--- /dev/null
+/makefile.build -crlf
+2010-07-27 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ConfigurationPropertyCollection.cs, PropertyInformation.cs:
+ add null check to detect bogus configuration early.
+
2010-01-09 Marek Habersack <mhabersack@novell.com>
* ConfigurationLocation.cs: trailing / characters are removed from
public void Add (ConfigurationProperty property)
{
+ if (property == null)
+ throw new ArgumentNullException ("property");
collection.Add (property);
}
internal PropertyInformation (ConfigurationElement owner, ConfigurationProperty property)
{
+ if (owner == null)
+ throw new ArgumentNullException ("owner");
+ if (property == null)
+ throw new ArgumentNullException ("property");
this.owner = owner;
this.property = property;
}
--- /dev/null
+/ConfigurationPropertyTest.cs -crlf
--- /dev/null
+/t11.exe.expected -crlf
+/t32.exe.expected -crlf
+/t33.exe.expected -crlf
+/t34.exe.expected -crlf
+/t35.exe.config -crlf
+/t35.exe.expected -crlf
+/t36.exe.expected -crlf
+/t38.exe.expected -crlf
+/t39.exe.expected -crlf
+/t40.exe.expected -crlf
+/t41.exe.expected -crlf
+/t42.exe.config -crlf
+/t42.exe.expected -crlf
+/t45.exe.expected -crlf
{
try {
NameValueCollection AppSettings = ConfigurationManager.AppSettings;
- Assert.Fail ("#1:" + AppSettings);\r
+ Assert.Fail ("#1:" + AppSettings);
} catch (ConfigurationErrorsException ex) {
// Configuration system failed to initialize
Assert.AreEqual (typeof (ConfigurationErrorsException), ex.GetType (), "#2");
Assert.AreEqual (3, inner.Line, "#12");
Assert.IsNotNull (inner.Message, "#13");
Assert.IsTrue (inner.Message.IndexOf ("<location>") != -1, "#14:" + inner.Message);
- Assert.IsTrue (inner.Message.IndexOf ("<configuration>") != -1, "#15:" + inner.Message);\r
-\r
- Console.WriteLine ("configuration exception thrown.");\r
+ Assert.IsTrue (inner.Message.IndexOf ("<configuration>") != -1, "#15:" + inner.Message);
+
+ Console.WriteLine ("configuration exception thrown.");
}
}
}
--- /dev/null
+/makefile.build -crlf
+2010-07-26 Jb Evain <jbevain@novell.com>
+
+ * EmitContext.cs: Properly call methods on enumerations.
+ Fixes #625367.
+
2010-05-19 Jb Evain <jbevain@novell.com>
* ConstantExpression.cs: fix emission of nullable constants.
{
if (value == null) {
var ig = ec.ig;
- var local = ig.DeclareLocal (type);
- ig.Emit (OpCodes.Ldloca, local);
- ig.Emit (OpCodes.Initobj, type);
- ig.Emit (OpCodes.Ldloc, local);
+ var local = ec.ig.DeclareLocal (type);
+ ec.EmitNullableInitialize (local);
} else {
EmitConstant (ec, type.GetFirstGenericArgument (), value);
ec.EmitNullableNew (type);
ig.Emit (OpCodes.Ldloca, EmitStored (expression));
}
+ public void EmitLoadEnum (Expression expression)
+ {
+ expression.Emit (this);
+ ig.Emit (OpCodes.Box, expression.Type);
+ }
+
+ public void EmitLoadEnum (LocalBuilder local)
+ {
+ ig.Emit (OpCodes.Ldloc, local);
+ ig.Emit (OpCodes.Box, local.LocalType);
+ }
+
public void EmitLoadSubject (Expression expression)
{
+ if (expression.Type.IsEnum) {
+ EmitLoadEnum (expression);
+ return;
+ }
+
if (expression.Type.IsValueType) {
EmitLoadAddress (expression);
return;
public void EmitLoadSubject (LocalBuilder local)
{
+ if (local.LocalType.IsEnum) {
+ EmitLoadEnum (local);
+ return;
+ }
+
if (local.LocalType.IsValueType) {
EmitLoadAddress (local);
return;
--- /dev/null
+/Aes.cs -crlf
Assert.AreEqual (2, getter (null, 2));
Assert.AreEqual (4, getter (4, 2));
}
+
+ [Test]
+ public void CallToStringOnEnum () // #625367
+ {
+ var lambda = Expression.Lambda<Func<string>> (
+ Expression.Call (
+ Expression.Constant (TypeCode.Boolean, typeof (TypeCode)),
+ typeof (object).GetMethod ("ToString"))).Compile ();
+
+ Assert.AreEqual ("Boolean", lambda ());
+ }
}
}
--- /dev/null
+/makefile.build -crlf
--- /dev/null
+/Employee.cs -crlf
+/Northwind.cs -crlf
+/ObjectDumper.cs -crlf
+/Program.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/Northwind.cs -crlf
--- /dev/null
+/create_Northwind.sql -crlf
--- /dev/null
+/Program.cs -crlf
--- /dev/null
+/demodb.cs -crlf
--- /dev/null
+/Northwind.cs -crlf
--- /dev/null
+/create_Northwind.sql -crlf
+/create_User.sql -crlf
--- /dev/null
+/Program.cs -crlf
+/nwind.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/Northwind.cs -crlf
+/NorthwindCustom.cs -crlf
+/originalMSNorthwind.dbml -crlf
+/originalMSNorthwind.dbml.layout -crlf
+/originalMSNorthwind.designer.cs -crlf
--- /dev/null
+/create_Northwind.sql -crlf
--- /dev/null
+/ObjectDumper.cs -crlf
+/Program.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/AllTypes.cs -crlf
+/Andrus.cs -crlf
+/DbLinq_EnumTest.cs -crlf
+/Northwind.cs -crlf
+/Northwind_from_mysql.dbml -crlf
}\r
\r
#endregion\r
- #warning L189 table t2 has no primary key. Multiple c# objects will refer to the same row.
+ #warning L189 table t2 has no primary key. Multiple c# objects will refer to the same row.\r
\r
#region childtables\r
#endregion\r
--- /dev/null
+/createDB_AllTypes.sql -crlf
+/createDB_Andrus.sql -crlf
+/create_Northwind.sql -crlf
+/create_User.sql -crlf
--- /dev/null
+/Program.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/Northwind.cs -crlf
--- /dev/null
+/create_Northwind_ora.sql -crlf
+/drop_Northwind_ora.sql -crlf
--- /dev/null
+/PgAndrusClient.cs -crlf
+/ProgramPg.cs -crlf
--- /dev/null
+/Adrus_Employee_Types.cs -crlf
+/AndrusDB.cs -crlf
+/Northwind.cs -crlf
--- /dev/null
+/NorthWindRegular.sql -crlf
+/createDB_Andrus.sql -crlf
+/createDB_Northwind_pg.sql -crlf
+/install_readme.txt -crlf
--- /dev/null
+/ObjectDumper.cs -crlf
+/Program.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/DbLinq_EnumTest.cs -crlf
+/Northwind.cs -crlf
--- /dev/null
+/create_AllTypes.sql -crlf
+/create_Northwind.sql -crlf
+/create_User.sql -crlf
--- /dev/null
+/Build?Northwind?parameters.txt -crlf
+/DbLinq.ProductInfo.cs -crlf
+/DbLinq.fxcop -crlf
+/DbLinq.vsmdi -crlf
+/DbLinq1.vsmdi -crlf
+/DbLinq2.vsmdi -crlf
+/DbLinq3.vsmdi -crlf
+/LocalTestRun.testrunconfig -crlf
+/readme.txt -crlf
--- /dev/null
+/FirebirdDataContext.cs -crlf
+/FirebirdExpressionTranslator.cs -crlf
+/FirebirdSchemaLoader.Columns.cs -crlf
+/FirebirdSchemaLoader.Constraints.cs -crlf
+/FirebirdSchemaLoader.StoredProcedures.cs -crlf
+/FirebirdSchemaLoader.Tables.cs -crlf
+/FirebirdSchemaLoader.cs -crlf
+/FirebirdSqlProvider.cs -crlf
+/FirebirdVendor.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/TestBase.cs -crlf
--- /dev/null
+/IngresDataContext.cs -crlf
+/IngresSchemaLoader.Columns.cs -crlf
+/IngresSchemaLoader.Constraints.cs -crlf
+/IngresSchemaLoader.StoredProcedures.cs -crlf
+/IngresSchemaLoader.Tables.cs -crlf
+/IngresSchemaLoader.cs -crlf
+/IngresSqlProvider.cs -crlf
+/IngresVendor.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/NorthwindIngres.dbml -crlf
+/TestBase.cs -crlf
--- /dev/null
+/MySqlDataContext.cs -crlf
+/MySqlSchemaLoader.Columns.cs -crlf
+/MySqlSchemaLoader.Constraints.cs -crlf
+/MySqlSchemaLoader.StoredProcedures.cs -crlf
+/MySqlSchemaLoader.Tables.cs -crlf
+/MySqlSchemaLoader.cs -crlf
+/MySqlSqlProvider.cs -crlf
+/MySqlVendor.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/NorthwindMySql.dbml -crlf
+/TestBase.cs -crlf
--- /dev/null
+/Application.Designer.vb -crlf
+/Application.myapp -crlf
+/AssemblyInfo.vb -crlf
+/Resources.Designer.vb -crlf
+/Resources.resx -crlf
+/Settings.Designer.vb -crlf
+/Settings.settings -crlf
--- /dev/null
+/OracleDataContext.cs -crlf
+/OracleSchemaLoader.Columns.cs -crlf
+/OracleSchemaLoader.Constraints.cs -crlf
+/OracleSchemaLoader.StoredProcedures.cs -crlf
+/OracleSchemaLoader.Tables.cs -crlf
+/OracleSchemaLoader.cs -crlf
+/OracleSqlProvider.cs -crlf
+/OracleVendor.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/NorthwindOraODP.dbml -crlf
+/NorthwindOracle.dbml -crlf
+/TestBase.cs -crlf
+/TestBase_odp.cs -crlf
--- /dev/null
+/PgsqlDataContext.cs -crlf
+/PgsqlSchemaLoader.Columns.cs -crlf
+/PgsqlSchemaLoader.Constraints.cs -crlf
+/PgsqlSchemaLoader.StoredProcedures.cs -crlf
+/PgsqlSchemaLoader.Tables.cs -crlf
+/PgsqlSchemaLoader.cs -crlf
+/PgsqlSqlProvider.cs -crlf
+/PgsqlVendor.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/NorthwindPgsql.dbml -crlf
+/TestBase.cs -crlf
--- /dev/null
+/SqlServerDataContext.cs -crlf
+/SqlServerExpressionTranslator.cs -crlf
+/SqlServerSchemaLoader.cs -crlf
+/SqlServerSqlProvider.cs -crlf
+/SqlServerTypeConversions.cs -crlf
+/SqlServerVendor.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/MsSqlDataContextTest.cs -crlf
+/TestBase.cs -crlf
--- /dev/null
+/SqliteDataContext.cs -crlf
+/SqliteSchemaLoader.Columns.cs -crlf
+/SqliteSchemaLoader.Constraints.cs -crlf
+/SqliteSchemaLoader.Tables.cs -crlf
+/SqliteSchemaLoader.cs -crlf
+/SqliteSqlProvider.cs -crlf
+/SqliteVendor.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/DataCommand.cs -crlf
--- /dev/null
+/DirectDataContext.cs -crlf
+/NorthwindSqlite.dbml -crlf
+/TestBase.cs -crlf
+/TestBase_mono.cs -crlf
--- /dev/null
+/DbLinqToDoAttribute.cs -crlf
+/MonoTODOAttribute.cs -crlf
--- /dev/null
+/ChangeAction.cs -crlf
+/ChangeSet.cs -crlf
+/DBLinqExtendedAttributte.cs -crlf
+/DataContext.Extended.cs -crlf
+/DataContext.cs -crlf
+/DataLoadOptions.cs -crlf
+/EntityRef.cs -crlf
+/EntitySet.cs -crlf
+/IExecuteResult.cs -crlf
+/IMemberModificationHandler.cs -crlf
+/ITable.Extended.cs -crlf
+/ITable.cs -crlf
+/IVendorProvider.cs -crlf
+/ReadMe.txt -crlf
+/RefreshMode.cs -crlf
+/Table.Extended.cs -crlf
+/Table.cs -crlf
--- /dev/null
+/IDatabaseContext.cs -crlf
+/IDatabaseTransaction.cs -crlf
+/ITransactionalCommand.cs -crlf
--- /dev/null
+/DatabaseConnection.cs -crlf
+/DatabaseContext.cs -crlf
+/DatabaseTransaction.cs -crlf
+/TransactionalCommand.cs -crlf
--- /dev/null
+/IIdentityProvider.cs -crlf
+/IIdentityReader.cs -crlf
+/IIdentityReaderFactory.cs -crlf
+/IdentityKey.cs -crlf
--- /dev/null
+/IdentityProviderReader.cs -crlf
+/IdentityReader.cs -crlf
+/IdentityReaderFactory.cs -crlf
--- /dev/null
+/DisabledEntityTracker.cs -crlf
+/EntityState.cs -crlf
+/EntityTrack.cs -crlf
+/EntityTracker.cs -crlf
+/IEntityTracker.cs -crlf
+/MemberModificationHandler.cs -crlf
+/QueryProvider.cs -crlf
+/VendorProvider.cs -crlf
--- /dev/null
+/AttributeMappingSource.cs -crlf
+/AttributedAbstractMetaDataMember.cs -crlf
+/AttributedAssociationMetaDataMember.cs -crlf
+/AttributedColumnMetaDataMember.cs -crlf
+/AttributedMetaAssociation.cs -crlf
+/AttributedMetaFunction.cs -crlf
+/AttributedMetaModel.cs -crlf
+/AttributedMetaTable.cs -crlf
+/AttributedMetaType.cs -crlf
+/LambdaMetaAccessor.cs -crlf
+/MappingContext.cs -crlf
+/XmlMappingSource.cs -crlf
--- /dev/null
+/SqlLiteralPart.cs -crlf
+/SqlParameterPart.cs -crlf
+/SqlPart.cs -crlf
+/SqlStatement.cs -crlf
+/SqlStatementBuilder.cs -crlf
--- /dev/null
+/FirebirdProvider.cs -crlf
+/IngresProvider.cs -crlf
+/MySqlProvider.cs -crlf
+/OracleProvider.cs -crlf
+/PostgreSqlProvider.cs -crlf
+/Sql2000Provider.cs -crlf
+/Sql2005Provider.cs -crlf
+/Sql2008Provider.cs -crlf
+/SqlServerProvider.cs -crlf
+/SqliteProvider.cs -crlf
--- /dev/null
+/AbstractQuery.cs -crlf
+/BuilderContext.cs -crlf
+/DeleteQuery.cs -crlf
+/DirectQuery.cs -crlf
+/Error.cs -crlf
+/ExpressionChain.cs -crlf
+/ExpressionPrecedence.cs -crlf
+/ExpressionQuery.cs -crlf
+/ExpressionTier.cs -crlf
+/IDataMapper.cs -crlf
+/IDataRecordReader.cs -crlf
+/IExpressionDispatcher.cs -crlf
+/IExpressionLanguageParser.cs -crlf
+/IExpressionOptimizer.cs -crlf
+/IExpressionQualifier.cs -crlf
+/IPrequelAnalyzer.cs -crlf
+/IQueryBuilder.cs -crlf
+/IQueryCache.cs -crlf
+/IQueryRunner.cs -crlf
+/ISpecialExpressionTranslator.cs -crlf
+/ISqlBuilder.cs -crlf
+/Notes.txt -crlf
+/ParameterizedQuery.cs -crlf
+/QueryContext.cs -crlf
+/SelectQuery.cs -crlf
+/UpsertQuery.cs -crlf
--- /dev/null
+/ExpressionMutatorExtensions.cs -crlf
+/ExpressionMutatorFactory.cs -crlf
--- /dev/null
+/BinaryExpressionMutator.cs -crlf
+/ConditionalExpressionMutator.cs -crlf
+/ConstantExpressionMutator.cs -crlf
+/IMemberBindingMutator.cs -crlf
+/InvocationExpressionMutator.cs -crlf
+/LambdaExpressionMutator.cs -crlf
+/ListInitExpressionMutator.cs -crlf
+/MemberAssignmentMutator.cs -crlf
+/MemberBindingMutatorFactory.cs -crlf
+/MemberExpressionMutator.cs -crlf
+/MemberInitExpressionMutator.cs -crlf
+/MemberListBindingMutator.cs -crlf
+/MemberMemberBindingMutator.cs -crlf
+/MethodCallExpressionMutator.cs -crlf
+/NewArrayExpressionMutator.cs -crlf
+/NewExpressionMutator.cs -crlf
+/ParameterExpressionMutator.cs -crlf
+/TypeBinaryExpressionMutator.cs -crlf
+/UnaryExpressionMutator.cs -crlf
--- /dev/null
+/ColumnExpression.cs -crlf
+/CustomExpressionType.cs -crlf
+/EntitySetExpression.cs -crlf
+/ExpressionTranslator.cs -crlf
+/GroupByExpression.cs -crlf
+/GroupExpression.cs -crlf
+/IExecutableExpression.cs -crlf
+/IMutableExpression.cs -crlf
+/InputParameterExpression.cs -crlf
+/MetaTableExpression.cs -crlf
+/MutableExpression.cs -crlf
+/ObjectInputParameterExpression.cs -crlf
+/ObjectOutputParameterExpression.cs -crlf
+/OperandsMutableExpression.cs -crlf
+/OrderByExpression.cs -crlf
+/ScopeExpression.cs -crlf
+/SelectExpression.cs -crlf
+/SelectOperatorType.cs -crlf
+/SpecialExpression.cs -crlf
+/SpecialExpressionType.cs -crlf
+/StartIndexOffsetExpression.cs -crlf
+/SubSelectExpression.cs -crlf
+/TableExpression.cs -crlf
+/TableJoinType.cs -crlf
--- /dev/null
+/DataMapper.cs -crlf
+/DataRecordReader.cs -crlf
+/ExpressionDispatcher.Analyzer.cs -crlf
+/ExpressionDispatcher.Registrar.cs -crlf
+/ExpressionDispatcher.cs -crlf
+/ExpressionLanguageParser.cs -crlf
+/ExpressionOptimizer.cs -crlf
+/ExpressionQualifier.cs -crlf
+/LineGrouping.cs -crlf
+/PrequelAnalyzer.cs -crlf
+/QueryBuilder.Upsert.cs -crlf
+/QueryBuilder.cs -crlf
+/QueryCache.cs -crlf
+/QueryRunner.cs -crlf
+/SpecialExpressionTranslator.cs -crlf
+/SqlBuilder.cs -crlf
--- /dev/null
+/DbLinqAttribute.cs -crlf
+/IObjectFactory.cs -crlf
+/ObjectFactory.cs -crlf
--- /dev/null
+/ReflectionObjectFactory.cs -crlf
--- /dev/null
+/ILanguageWords.cs -crlf
+/ILanguages.cs -crlf
--- /dev/null
+/AbstractEndPluralWords.cs -crlf
+/AbstractWords.cs -crlf
+/Languages.cs -crlf
+/NoLanguageWords.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/AssociationName.cs -crlf
+/Case.cs -crlf
+/ColumnName.cs -crlf
+/INameFormatter.cs -crlf
+/Name.cs -crlf
+/NameFormat.cs -crlf
+/ParameterName.cs -crlf
+/ProcedureName.cs -crlf
+/SchemaName.cs -crlf
+/TableName.cs -crlf
+/WordsExtraction.cs -crlf
--- /dev/null
+/DbmlSchema.Adapter.cs -crlf
+/DbmlSchema.cs -crlf
+/DbmlSerializer.cs -crlf
--- /dev/null
+/ArrayAdapter.cs -crlf
+/CsvArrayAdapter.cs -crlf
+/EnumType.cs -crlf
+/INamedType.cs -crlf
+/ISimpleList.cs -crlf
+/SpecifiedPropertyUpdater.cs -crlf
--- /dev/null
+/NameFormatter.cs -crlf
--- /dev/null
+/Binary.cs -crlf
+/ChangeConflictCollection.cs -crlf
+/ChangeConflictException.cs -crlf
+/CompiledQuery.cs -crlf
+/ConflictMode.cs -crlf
+/DBConvert.cs -crlf
+/DuplicateKeyException.cs -crlf
+/EntitySet.cs -crlf
+/ForeignKeyReferenceAlreadyHasValueException.cs -crlf
+/IFunctionResult.cs -crlf
+/IMultipleResults.cs -crlf
+/ISingleResult.cs -crlf
+/Link.cs -crlf
+/Makefile -crlf
+/MemberChangeConflict.cs -crlf
+/ModifiedMemberInfo.cs -crlf
+/ObjectChangeConflict.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/AssociationAttribute.cs -crlf
+/AutoSync.cs -crlf
+/ColumnAttribute.cs -crlf
+/DataAttribute.cs -crlf
+/DatabaseAttribute.cs -crlf
+/FunctionAttribute.cs -crlf
+/InheritanceMappingAttribute.cs -crlf
+/MappingSource.cs -crlf
+/MetaAccessor.cs -crlf
+/MetaAccessor_2.cs -crlf
+/MetaAssociation.cs -crlf
+/MetaDataMember.cs -crlf
+/MetaFunction.cs -crlf
+/MetaModel.cs -crlf
+/MetaParameter.cs -crlf
+/MetaTable.cs -crlf
+/MetaType.cs -crlf
+/ParameterAttribute.cs -crlf
+/ProviderAttribute.cs -crlf
+/ResultTypeAttribute.cs -crlf
+/TableAttribute.cs -crlf
+/UpdateCheck.cs -crlf
--- /dev/null
+/ObjectMaterializer.cs -crlf
--- /dev/null
+/Sql2000Provider.cs -crlf
+/Sql2005Provider.cs -crlf
+/SqlHelpers.cs -crlf
+/SqlMethods.cs -crlf
+/SqlProvider.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/AttributeMappingSourceTest.cs -crlf
+/BinaryTest.cs -crlf
+/CsvArrayAdapterTest.cs -crlf
+/DataContextTest.cs -crlf
+/EntitySetTest.cs -crlf
+/ExpressionEqualityComparerTest.cs -crlf
+/IDataTypeExtensionsTest.cs -crlf
+/PeopleTable.cs -crlf
+/TableTest.cs -crlf
+/TypeContextTest.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/App.config -crlf
+/Attach.cs -crlf
+/CompositePK_Test.cs -crlf
+/DataContext.cs -crlf
+/DataContextTestBase.cs -crlf
+/DataLoadOptions_Test.cs -crlf
+/DynamicLinqTest.cs -crlf
+/ExecuteCommand_Test.cs -crlf
+/ExecuteQuery_Test.cs -crlf
+/MetalTest.cs -crlf
+/Program2Ing.cs -crlf
+/Program2Mysql.cs -crlf
+/Program2Pg.cs -crlf
+/Program2SQLite.cs -crlf
+/Program3Ora.cs -crlf
+/ReadTest.cs -crlf
+/ReadTest_AllTypes_MySql.cs -crlf
+/ReadTest_Complex.cs -crlf
+/ReadTest_GroupBy.cs -crlf
+/ReadTest_Operands.cs -crlf
+/ReadTest_Subquery.cs -crlf
+/ReadTests_AnyCountFirst.cs -crlf
+/ReadTests_Conversions.cs -crlf
+/ReadTests_DateTimeFunctions.cs -crlf
+/ReadTests_EntitySet.cs -crlf
+/ReadTests_Join.cs -crlf
+/ReadTests_Maths.cs -crlf
+/ReadTests_ReferenceLoading.cs -crlf
+/ReadTests_StringFunctions.cs -crlf
+/StoredProcTest.cs -crlf
+/Table.cs -crlf
+/TestBase.cs -crlf
+/Transactions.cs -crlf
+/VerticalPartitioningTest.cs -crlf
+/WriteTest.cs -crlf
+/WriteTest_BulkInsert.cs -crlf
--- /dev/null
+/ReflectionTest.cs -crlf
--- /dev/null
+/101_readme.htm -crlf
+/Advanced.cs -crlf
+/Conversion_Operators.cs -crlf
+/Count_Sum_Min_Max_Avg.cs -crlf
+/ExsistIn_Any_All.cs -crlf
+/GroupBy_Having.cs -crlf
+/Inheritance.cs -crlf
+/Insert_Update_Delete.cs -crlf
+/Join.cs -crlf
+/Linq101SamplesModifiedAttribute.cs -crlf
+/Null.cs -crlf
+/Object?Loading.cs -crlf
+/Object_Identity.cs -crlf
+/OptimisticConcurrence.cs -crlf
+/OrderBy.cs -crlf
+/Paging.cs -crlf
+/Select_Distinct.cs -crlf
+/String_Date_functions.cs -crlf
+/Top_Bottom.cs -crlf
+/UnionAll_Union_Intersect.cs -crlf
+/Views.cs -crlf
+/Where.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/ColumnAttributeTest.cs -crlf
--- /dev/null
+/DbLinq.accessor -crlf
--- /dev/null
+/CacheChecker.cs -crlf
+/DataCommand.cs -crlf
+/DbmlExtensions.cs -crlf
+/ExpressionChainEqualityComparer.cs -crlf
+/ExpressionEqualityComparer.cs -crlf
+/IDataRecordExtensions.cs -crlf
+/IDataTypeExtensions.cs -crlf
+/IDbDataParameterExtensions.cs -crlf
+/IThreadSafeDictionary.cs -crlf
+/LambdaComparer.cs -crlf
+/MemberInfoExtensions.cs -crlf
+/Output.cs -crlf
+/OutputLevel.cs -crlf
+/Page.cs -crlf
+/Profiler.cs -crlf
+/QuotesHelper.cs -crlf
+/ReferenceEqualityComparer.cs -crlf
+/ReflectionExtensions.cs -crlf
+/ReflectionUtility.cs -crlf
+/StringExtensions.cs -crlf
+/TextWriterExtension.cs -crlf
+/ThreadSafeDictionary.cs -crlf
+/TypeConvert.cs -crlf
+/TypeExtensions.cs -crlf
+/TypeLoader.cs -crlf
--- /dev/null
+/DbSchemaLoader.cs -crlf
+/IDataName.cs -crlf
+/IDataTableColumn.cs -crlf
+/IDataType.cs -crlf
+/INameAliases.cs -crlf
+/ISchemaLoader.cs -crlf
+/ISqlProvider.cs -crlf
+/IVendor.cs -crlf
+/VendorAttribute.cs -crlf
--- /dev/null
+/SchemaLoader.Columns.cs -crlf
+/SchemaLoader.DataName.cs -crlf
+/SchemaLoader.DataTableColumn.cs -crlf
+/SchemaLoader.ForeignKey.cs -crlf
+/SchemaLoader.Name.cs -crlf
+/SchemaLoader.StoredProcedures.cs -crlf
+/SchemaLoader.Tables.cs -crlf
+/SchemaLoader.TypeMapping.cs -crlf
+/SchemaLoader.cs -crlf
+/SqlProvider.cs -crlf
+/Vendor.ProcedureResult.cs -crlf
+/Vendor.cs -crlf
--- /dev/null
+/AbstractParameters.cs -crlf
+/AllTypes?all?to?Cs.txt -crlf
+/AllTypes?to?Cs.txt -crlf
+/App.config -crlf
+/DB?all?to?Cs.txt -crlf
+/DB?all?to?DBML.txt -crlf
+/DB?to?Cs.txt -crlf
+/DB?to?DBML.txt -crlf
+/NorthwindRename.dbml -crlf
+/Parameters.cs -crlf
+/Program.cs -crlf
+/Reference.cs -crlf
+/oraFieldRenames.xml -crlf
+/pgsqlFieldRenames.xml -crlf
+/sqlmetal.exe.config -crlf
--- /dev/null
+/ProvidersSection.cs -crlf
--- /dev/null
+/AttributeDefinition.cs -crlf
+/CodeDomGenerator.cs -crlf
+/CodeWriter.cs -crlf
+/GenerationContext.cs -crlf
+/ICodeGenerator.cs -crlf
+/IProcessor.cs -crlf
+/ISchemaLoaderFactory.cs -crlf
+/ParameterDefinition.cs -crlf
+/SpecificationDefinition.cs -crlf
--- /dev/null
+/IImplementation.cs -crlf
--- /dev/null
+/IModifiedImplementation.cs -crlf
+/INotifyPropertyChangedImplementation.cs -crlf
+/INotifyPropertyChangingImplementation.cs -crlf
+/InterfaceImplementation.cs -crlf
--- /dev/null
+/Processor.cs -crlf
+/SchemaLoaderFactory.cs -crlf
--- /dev/null
+/AbstractCodeDomGenerator.cs -crlf
+/CSharpCodeDomGenerator.cs -crlf
+/VisualBasicCodeDomGenerator.cs -crlf
--- /dev/null
+/CSCodeGenerator.cs -crlf
+/CSCodeWriter.cs -crlf
+/CodeGenerator.Class.cs -crlf
+/CodeGenerator.Context.Ctor.cs -crlf
+/CodeGenerator.Procedure.cs -crlf
+/CodeGenerator.cs -crlf
--- /dev/null
+/EnglishWords.cs -crlf
+/EnglishWords.txt -crlf
+/FrenchWords.cs -crlf
+/GermanWords.cs -crlf
+/GermanWords.txt -crlf
zythums
#pluriels irréguliers
-# http://fr.wikipedia.org/wiki/Pluriels_irr%C3%A9guliers_en_fran%C3%A7ais\r
-\r
-banal=>banals\r
-bancal=>bancals\r
-fatal=>fatals\r
-fractalmorfal=>fractalmorfals\r
-naval=>navals\r
-aéronaval=>aéronavals\r
-natal=>natals\r
-anténatal=>anténatals\r
-néonatal=>néonatals\r
-périnatal=>périnatals\r
-postnatal=>postnatals\r
-prénatal=>prénatals\r
-tonal=>tonals\r
-atonal=>atonals\r
-bitonal=>bitonals\r
-polytonal=>polytonals\r
-acétal=>acétals\r
-ammonal=>ammonals\r
-aval=>avals\r
-bal=>bals\r
-barbital=>barbitals\r
-cal=>cals\r
-captal=>captals\r
-carnaval=>carnavals\r
-cérémonial=>cérémonials\r
-chloral=>chlorals\r
-chrysocal=>chrysocals\r
-copal=>copals\r
-dial=>dials\r
-dispersal=>dispersals\r
-éthanal=>éthanals\r
-festival=>festivals\r
-foiral=>foirals\r
-furfural=>furfurals\r
-futal=>futals\r
-gal=>gals\r
-galgal=>galgals\r
-gardénal=>gardénals\r
-graal=>graals\r
-joual=>jouals\r
-kraal=>kraals\r
-kursaal=>kursaals\r
-matorral=>matorrals\r
-mescal=>mescals\r
-mezcal=>mezcals\r
-méthanal=>méthanals\r
-minerval=>minervals\r
-mistral=>mistrals\r
-nopal=>nopals\r
-pal=>pals\r
-pascal=>pascals\r
-hectopascal=>hectopascals\r
-kilopascal=>kilopascals\r
-penthotal=>penthotals\r
-phénobarbital=>phénobarbitals\r
-pipéronal=>pipéronals\r
-raval=>ravals\r
-récital=>récitals\r
-régal=>régals\r
-rétinal=>rétinals\r
-rital=>ritals\r
-roberval=>robervals\r
-roseval=>rosevals\r
-salicional=>salicionals\r
-sal=>sals\r
-santal=>santals\r
-saroual=>sarouals\r
-sial=>sials\r
-sisal=>sisals\r
-sonal=>sonals\r
-tagal=>tagals\r
-tefal=>tefals\r
-tergal=>tergals\r
-thiopental=>thiopentals\r
-tical=>ticals\r
-tincal=>tincals\r
-véronal=>véronals\r
-zicral=>zicrals\r
-caracal=>caracals\r
-chacal=>chacals\r
-gavial=>gavials\r
-gayal=>gayals\r
-narval=>narvals\r
-quetzal=>quetzals\r
-rorqual=>rorquals\r
-serval=>servals\r
-cantal=>cantals\r
-emmental=>emmentals\r
-emmenthal=>emmenthals\r
-metical=>meticals\r
-rial=>rials\r
-riyal=>riyals\r
-ryal=>ryals\r
-floréal=>floréals\r
-germinal=>germinals\r
-prairial=>prairials\r
-corral=>corrals\r
-deal=>deals\r
-goal=>goals\r
-autogoal=>autogoals\r
-revival=>revivals\r
-serial=>serials\r
-spiritual=>spirituals\r
-taal=>taals\r
-trial=>trials\r
-\r
-bail=>baux\r
-corail=>coraux\r
-émail=>émaux\r
-fermail=>fermaux\r
-soupirail=>soupiraux\r
-travail=>travaux\r
-vantail=>vantaux\r
-vitrail=>vitraux\r
-\r
-bijou=>bijoux\r
-caillou=>cailloux\r
-chou=>choux\r
-genou=>genoux\r
-hibou=>hiboux\r
-joujou=>joujoux\r
-pou=>poux\r
-\r
-ciel=>cieux\r
-oeil=>yeux\r
+# http://fr.wikipedia.org/wiki/Pluriels_irr%C3%A9guliers_en_fran%C3%A7ais
+
+banal=>banals
+bancal=>bancals
+fatal=>fatals
+fractalmorfal=>fractalmorfals
+naval=>navals
+aéronaval=>aéronavals
+natal=>natals
+anténatal=>anténatals
+néonatal=>néonatals
+périnatal=>périnatals
+postnatal=>postnatals
+prénatal=>prénatals
+tonal=>tonals
+atonal=>atonals
+bitonal=>bitonals
+polytonal=>polytonals
+acétal=>acétals
+ammonal=>ammonals
+aval=>avals
+bal=>bals
+barbital=>barbitals
+cal=>cals
+captal=>captals
+carnaval=>carnavals
+cérémonial=>cérémonials
+chloral=>chlorals
+chrysocal=>chrysocals
+copal=>copals
+dial=>dials
+dispersal=>dispersals
+éthanal=>éthanals
+festival=>festivals
+foiral=>foirals
+furfural=>furfurals
+futal=>futals
+gal=>gals
+galgal=>galgals
+gardénal=>gardénals
+graal=>graals
+joual=>jouals
+kraal=>kraals
+kursaal=>kursaals
+matorral=>matorrals
+mescal=>mescals
+mezcal=>mezcals
+méthanal=>méthanals
+minerval=>minervals
+mistral=>mistrals
+nopal=>nopals
+pal=>pals
+pascal=>pascals
+hectopascal=>hectopascals
+kilopascal=>kilopascals
+penthotal=>penthotals
+phénobarbital=>phénobarbitals
+pipéronal=>pipéronals
+raval=>ravals
+récital=>récitals
+régal=>régals
+rétinal=>rétinals
+rital=>ritals
+roberval=>robervals
+roseval=>rosevals
+salicional=>salicionals
+sal=>sals
+santal=>santals
+saroual=>sarouals
+sial=>sials
+sisal=>sisals
+sonal=>sonals
+tagal=>tagals
+tefal=>tefals
+tergal=>tergals
+thiopental=>thiopentals
+tical=>ticals
+tincal=>tincals
+véronal=>véronals
+zicral=>zicrals
+caracal=>caracals
+chacal=>chacals
+gavial=>gavials
+gayal=>gayals
+narval=>narvals
+quetzal=>quetzals
+rorqual=>rorquals
+serval=>servals
+cantal=>cantals
+emmental=>emmentals
+emmenthal=>emmenthals
+metical=>meticals
+rial=>rials
+riyal=>riyals
+ryal=>ryals
+floréal=>floréals
+germinal=>germinals
+prairial=>prairials
+corral=>corrals
+deal=>deals
+goal=>goals
+autogoal=>autogoals
+revival=>revivals
+serial=>serials
+spiritual=>spirituals
+taal=>taals
+trial=>trials
+
+bail=>baux
+corail=>coraux
+émail=>émaux
+fermail=>fermaux
+soupirail=>soupiraux
+travail=>travaux
+vantail=>vantaux
+vitrail=>vitraux
+
+bijou=>bijoux
+caillou=>cailloux
+chou=>choux
+genou=>genoux
+hibou=>hiboux
+joujou=>joujoux
+pou=>poux
+
+ciel=>cieux
+oeil=>yeux
--- /dev/null
+/AssemblyInfo.cs -crlf
+/Settings.Designer.cs -crlf
+/Settings.settings -crlf
--- /dev/null
+/DbmlRename.cs -crlf
+/DbmlRenameLoader.cs -crlf
+/NameAliasesLoader.cs -crlf
+/SchemaPostprocess.cs -crlf
+/TableAlias.cs -crlf
--- /dev/null
+/AppRunner.cs -crlf
+/CreateDbmlFromSqliteDbTest.cs -crlf
+/CreateEntitiesFromSqliteDbTest.cs -crlf
+/EnglishWordsTest.cs -crlf
+/FrenchWordsTest.cs -crlf
+/NameFormatterTest.cs -crlf
--- /dev/null
+/TableSorter.cs -crlf
--- /dev/null
+/EnvironmentExtension.cs -crlf
+/VariablesExtension.cs -crlf
--- /dev/null
+/Program.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/Resources.Designer.cs -crlf
+/Resources.resx -crlf
+/Settings.Designer.cs -crlf
+/Settings.settings -crlf
--- /dev/null
+/App.config -crlf
+/Program.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/ConnectionStrings.xml -crlf
+/instnwnd.MySql.sql -crlf
+/instnwnd.Oracle.sql -crlf
+/instnwnd.SQLite.sql -crlf
+/instnwnd.SqlServer.sql -crlf
--- /dev/null
+/Northwind.Sqlite+DbSchemaLoader-DbMetal.cs -crlf
+/Northwind.Sqlite+DbSchemaLoader-DbMetal.dbml -crlf
+/Northwind.Sqlite+DbSchemaLoader-sqlmetal.cs -crlf
+/Northwind.Sqlite+DbSchemaLoader-sqlmetal.dbml -crlf
+/Northwind.Sqlite-DbMetal.cs -crlf
+/Northwind.Sqlite-DbMetal.dbml -crlf
+/Northwind.Sqlite-sqlmetal.cs -crlf
+/Northwind.Sqlite-sqlmetal.dbml -crlf
--- /dev/null
+/makefile.build -crlf
executeMode = (int)OciExecuteMode.Default;
}
- if (this.disposed) \r
+ if (this.disposed)
{
throw new InvalidOperationException ("StatementHandle is already disposed.");
}
{
int status = 0;
- if (this.disposed) \r
+ if (this.disposed)
{
throw new InvalidOperationException ("StatementHandle is already disposed.");
}
case OciGlue.OCI_DEFAULT:
moreResults = true;
break;
- case OciGlue.OCI_SUCCESS_WITH_INFO:\r
- //OciErrorInfo ei = ErrorHandle.HandleError ();\r
- //command.Connection.CreateInfoMessage (ei);\r
- moreResults = true;\r
+ case OciGlue.OCI_SUCCESS_WITH_INFO:
+ //OciErrorInfo ei = ErrorHandle.HandleError ();
+ //command.Connection.CreateInfoMessage (ei);
+ moreResults = true;
break;
default:
OciErrorInfo info = ErrorHandle.HandleError ();
0,
OciAttributeType.Transaction,
ErrorHandle);
- if (status != 0) \r
+ if (status != 0)
{
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
try {
status = OciCalls.OCITransCommit (Service, ErrorHandle, 0);
- if (status != 0) \r
+ if (status != 0)
{
OciErrorInfo info = ErrorHandle.HandleError ();
throw new OracleException (info.ErrorCode, info.ErrorMessage);
--- /dev/null
+/OracleCommand.cs -crlf
+/OracleCommandBuilder.cs -crlf
+/OracleConnection.cs -crlf
+/OracleConvert.cs -crlf
+/OracleDataReader.cs -crlf
+/OracleError.cs -crlf
+/OracleErrorCollection.cs -crlf
+/OracleException.cs -crlf
+/OracleParameter.cs -crlf
+/OracleParameterCollection.cs -crlf
+/OracleTransaction.cs -crlf
//\r
// System.Data.OracleClient.OracleCommand\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
\r
// Author:\r
// Rodrigo Moya (rodrigo@ximian.com)\r
// Tim Coleman (tim@timcoleman.com)\r
-// Konstantin Triger <kostat@mainsoft.com>
+// Konstantin Triger <kostat@mainsoft.com>\r
// Boris Kirzner <borisk@mainsoft.com>\r
//\r
// Copyright (C) Rodrigo Moya, 2002\r
-// Copyright (C) Tim Coleman, 2002
-// (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.
+// Copyright (C) Tim Coleman, 2002 \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
// System.Data.Oracle.OracleConvert\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
\r
//\r
// System.Data.OracleClient.OracleDataReader\r
//\r
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
// Boris Kirzner <borisk@mainsoft.com>\r
//\r
-// (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.
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
using System.Data.Common;\r
}\r
}\r
\r
- protected override int GetProviderType(int jdbcType) {
- return (int)OracleConvert.JdbcTypeToOracleType(jdbcType);
+ protected override int GetProviderType(int jdbcType) {\r
+ return (int)OracleConvert.JdbcTypeToOracleType(jdbcType); \r
}\r
\r
protected override IReaderCacheContainer CreateReaderCacheContainer(int jdbcType, int columnIndex) {\r
//\r
// System.Data.SqlClient.SqlException\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.OracleClient {\r
-//\r
-// System.Data.SqlClient.SqlInfoMessageEventArgs\r
+//
+// System.Data.SqlClient.SqlInfoMessageEventArgs
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
//
using System;
-using System.Data;\r
-\r
-namespace System.Data.OracleClient {\r
- /// <summary>\r
- /// Summary description for SqlInfoMessageEventArgs.\r
- /// </summary>\r
+using System.Data;
+
+namespace System.Data.OracleClient {
+ /// <summary>
+ /// Summary description for SqlInfoMessageEventArgs.
+ /// </summary>
public sealed class OracleInfoMessageEventArgs : EventArgs {
#region Fields
}
#endregion // Methods
- }\r
-}\r
+ }
+}
//\r
// System.Data.OracleClient.OracleParameter\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
\r
--- /dev/null
+/TestOracleClient.cs -crlf
--- /dev/null
+/License.txt -crlf
--- /dev/null
+/AssemblyAttributes.cs -crlf
+/Parameterized.System.Data.Services.Client.cs -crlf
+/System.Data.Services.Client.cs -crlf
+/System.Data.Services.Client.txt -crlf
--- /dev/null
+/ArraySet.cs -crlf
+/AtomContentProperty.cs -crlf
+/AtomDataKind.cs -crlf
+/AtomEntry.cs -crlf
+/AtomFeed.cs -crlf
+/AtomMaterializer.cs -crlf
+/AtomMaterializerLog.cs -crlf
+/AtomParser.cs -crlf
+/BaseAsyncResult.cs -crlf
+/BatchStream.cs -crlf
+/BatchStreamState.cs -crlf
+/ChangesetResponse.cs -crlf
+/ClientConvert.cs -crlf
+/ClientType.cs -crlf
+/DataServiceClientException.cs -crlf
+/DataServiceContext.cs -crlf
+/DataServiceEntityAttribute.cs -crlf
+/DataServiceKeyAttribute.cs -crlf
+/DataServiceProtocolVersion.cs -crlf
+/DataServiceQuery.cs -crlf
+/DataServiceQueryContinuation.cs -crlf
+/DataServiceQueryException.cs -crlf
+/DataServiceQueryOfT.cs -crlf
+/DataServiceRequest.cs -crlf
+/DataServiceRequestArgs.cs -crlf
+/DataServiceRequestException.cs -crlf
+/DataServiceRequestOfT.cs -crlf
+/DataServiceResponse.cs -crlf
+/DataServiceStreamResponse.cs -crlf
+/Descriptor.cs -crlf
+/EntityDescriptor.cs -crlf
+/EntityPropertyMappingAttribute.cs -crlf
+/EntityStates.cs -crlf
+/Error.cs -crlf
+/GetReadStreamResult.cs -crlf
+/HasStreamAttribute.cs -crlf
+/LinkDescriptor.cs -crlf
+/MaterializeFromAtom.cs -crlf
+/MediaEntryAttribute.cs -crlf
+/MemberAssignmentAnalysis.cs -crlf
+/MergeOption.cs -crlf
+/MimeTypePropertyAttribute.cs -crlf
+/OpenObject.cs -crlf
+/OpenObjectAttribute.cs -crlf
+/OperationResponse.cs -crlf
+/ProjectionPath.cs -crlf
+/ProjectionPathBuilder.cs -crlf
+/ProjectionPathSegment.cs -crlf
+/ProjectionPlan.cs -crlf
+/ProjectionPlanCompiler.cs -crlf
+/QueryOperationResponseOfT.cs -crlf
+/QueryResponse.cs -crlf
+/QueryResult.cs -crlf
+/ReadingWritingEntityEventArgs.cs -crlf
+/ReferenceEqualityComparer.cs -crlf
+/SaveChangesOptions.cs -crlf
+/SendingRequestEventArgs.cs -crlf
+/Util.cs -crlf
+/WebUtil.cs -crlf
+/XmlUtil.cs -crlf
--- /dev/null
+/DataServiceExpressionVisitor.cs -crlf
+/DataServiceQueryProvider.cs -crlf
+/Evaluator.cs -crlf
+/ExpressionNormalizer.cs -crlf
+/ExpressionVisitor.cs -crlf
+/ExpressionWriter.cs -crlf
+/FilterQueryOptionExpression.cs -crlf
+/InputBinder.cs -crlf
+/InputReferenceExpression.cs -crlf
+/NavigationPropertySingletonExpression.cs -crlf
+/OrderByQueryOptionExpression.cs -crlf
+/ParameterReplacerVisitor.cs -crlf
+/PathBox.cs -crlf
+/ProjectionAnalyzer.cs -crlf
+/ProjectionQueryOptionExpression.cs -crlf
+/ProjectionRewriter.cs -crlf
+/QueryComponents.cs -crlf
+/QueryOptionExpression.cs -crlf
+/ReflectionUtil.cs -crlf
+/ResourceBinder.cs -crlf
+/ResourceExpression.cs -crlf
+/ResourceExpressionType.cs -crlf
+/ResourceSetExpression.cs -crlf
+/SkipQueryOptionExpression.cs -crlf
+/TakeQueryOptionExpression.cs -crlf
+/TypeSystem.cs -crlf
+/UriHelper.cs -crlf
+/UriWriter.cs -crlf
--- /dev/null
+/BindingEntityInfo.cs -crlf
+/BindingGraph.cs -crlf
+/BindingObserver.cs -crlf
+/BindingUtils.cs -crlf
+/DataServiceCollectionOfT.cs -crlf
+/DataServiceEntityAttribute.cs -crlf
+/DataServiceSaveChangesEventArgs.cs -crlf
+/EntityChangedParams.cs -crlf
+/EntityCollectionChangedParams.cs -crlf
+/LoadCompletedEventArgs.cs -crlf
--- /dev/null
+/EpmSyndicationContentSerializer.cs -crlf
--- /dev/null
+/XmlAtomErrorReader.cs -crlf
+/XmlWrappingReader.cs -crlf
--- /dev/null
+/AssemblyAttributes.cs -crlf
+/Parameterized.System.Data.Services.Client.cs -crlf
+/System.Data.Services.Client.cs -crlf
+/System.Data.Services.Client.txt -crlf
--- /dev/null
+/HttpStack.cs -crlf
--- /dev/null
+/CaseInsensitiveAscii.cs -crlf
+/ClientHttpWebRequest.cs -crlf
+/ClientHttpWebResponse.cs -crlf
+/ClientWebHeaderCollection.cs -crlf
+/HeaderInfo.cs -crlf
+/HeaderInfoTable.cs -crlf
+/HttpHeaderToName.cs -crlf
+/HttpRequestHeader.cs -crlf
+/HttpRequestHeaderEnumToName.cs -crlf
+/HttpStatusCode.cs -crlf
+/HttpWebRequest.cs -crlf
+/HttpWebResponse.cs -crlf
+/NameValueFromDictionary.cs -crlf
+/ScriptObjectUtility.cs -crlf
+/ScriptXmlHttpRequest.cs -crlf
+/ValidationHelper.cs -crlf
+/WebException.cs -crlf
+/WebExceptionStatus.cs -crlf
+/WebHeaderCollection.cs -crlf
+/WebHeaderCollectionType.cs -crlf
+/WebParseError.cs -crlf
+/WebRequest.cs -crlf
+/WebResponse.cs -crlf
+/XHRHttpWebRequest.cs -crlf
+/XHRHttpWebResponse.cs -crlf
+/XHRWebHeaderCollection.cs -crlf
--- /dev/null
+/HttpProcessUtility.cs -crlf
+/XmlConstants.cs -crlf
--- /dev/null
+/EpmContentSerializerBase.cs -crlf
+/EpmCustomContentSerializer.cs -crlf
+/EpmCustomContentWriterNodeData.cs -crlf
+/EpmSourcePathSegment.cs -crlf
+/EpmSourceTree.cs -crlf
+/EpmTargetPathSegment.cs -crlf
+/EpmTargetTree.cs -crlf
--- /dev/null
+/WebConvert.cs -crlf
--- /dev/null
+/EntityPropertyMappingInfo.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/ChangeInterceptorAttribute.cs -crlf
+/DataService.cs -crlf
+/DataServiceException.cs -crlf
+/DataServiceHost.cs -crlf
+/DataServiceHostFactory.cs -crlf
+/ETagAttribute.cs -crlf
+/EntitySetRights.cs -crlf
+/ExpandSegment.cs -crlf
+/ExpandSegmentCollection.cs -crlf
+/HandleExceptionArgs.cs -crlf
+/IDataServiceConfiguration.cs -crlf
+/IDataServiceHost.cs -crlf
+/IExpandProvider.cs -crlf
+/IExpandedResult.cs -crlf
+/IRequestHandler.cs -crlf
+/IUpdatable.cs -crlf
+/IgnorePropertiesAttribute.cs -crlf
+/MimeTypeAttribute.cs -crlf
+/ProcessRequestArgs.cs -crlf
+/QueryInterceptorAttribute.cs -crlf
+/ServiceOperationRights.cs -crlf
+/SingleResultAttribute.cs -crlf
+/UpdateOperations.cs -crlf
--- /dev/null
+/ChangeInterceptorAttributeTests.cs -crlf
+/DataServiceExceptionTests.cs -crlf
+/DataServiceTests.cs -crlf
+/ETagAttributeTests.cs -crlf
+/ExpandSegmentCollectionTests.cs -crlf
+/ExpandSegmentTests.cs -crlf
+/IgnorePropertiesAttributeTests.cs -crlf
+/MimeTypeAttributeTests.cs -crlf
+/QueryInterceptorAttributeTests.cs -crlf
--- /dev/null
+/makefile.build -crlf
--- /dev/null
+/System.Data.xml -crlf
--- /dev/null
+/wrappers.cs -crlf
--- /dev/null
+/DbMetaDataCache.cs -crlf
+/DbTypes.cs -crlf
+/ExceptionHelper.cs -crlf
+/Index.cs -crlf
+/Key.cs -crlf
--- /dev/null
+/GlobalConfig.cs -crlf
+/ObjectNameResolutionSectionHandler.cs -crlf
+/ObjectNameResolver.cs -crlf
+/ObjectNameResolversCollection.cs -crlf
--- /dev/null
+/OleDbCommand.cs -crlf
+/OleDbConvert.cs -crlf
+/OleDbDataAdapter.cs -crlf
+/OleDbException.cs -crlf
+/OleDbInfoMessageEventArgs.cs -crlf
+/OleDbInfoMessageEventHandler.cs -crlf
+/OleDbLiteral.cs -crlf
+/OleDbPermission.cs -crlf
+/OleDbPermissionAttribute.cs -crlf
+/OleDbRowUpdatedEventArgs.cs -crlf
+/OleDbRowUpdatedEventHandler.cs -crlf
+/OleDbRowUpdatingEventArgs.cs -crlf
+/OleDbRowUpdatingEventHandler.cs -crlf
+/OleDbSchemaGuid.cs -crlf
+/OleDbTransaction.cs -crlf
+/OleDbType.cs -crlf
//\r
// System.Data.OleDb.OleDbCommand\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
\r
// Authors:\r
// Rodrigo Moya (rodrigo@ximian.com)\r
// Tim Coleman (tim@timcoleman.com)\r
-// Konstantin Triger <kostat@mainsoft.com>
+// Konstantin Triger <kostat@mainsoft.com>\r
// Boris Kirzner <borisk@mainsoft.com>\r
//\r
// Copyright (C) Rodrigo Moya, 2002\r
// Copyright (C) Tim Coleman, 2002\r
-// (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.
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
\r
//\r
// System.Data.OleDb.OleDbException\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
\r
// Tim Coleman (tim@timcoleman.com)\r
//\r
// Copyright (C) Rodrigo Moya, 2002\r
-// Copyright (C) Tim Coleman, 2002
-// (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.
+// Copyright (C) Tim Coleman, 2002 \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
\r
//\r
// System.Data.OleDb.OleDbType\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.OleDb\r
--- /dev/null
+/AbstractDBCommand.cs -crlf
+/AbstractDBConnection.cs -crlf
+/AbstractDataReader.cs -crlf
+/AbstractDbError.cs -crlf
+/AbstractDbErrorCollection.cs -crlf
+/AbstractDbException.cs -crlf
+/AbstractTransaction.cs -crlf
+/DbConvert.cs -crlf
+/ParameterMetadataWrapper.cs -crlf
+/ReaderCache.cs -crlf
+/regex.cs -crlf
//\r
// System.Data.ProviderBase.AbstractDbCommand\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
\r
{\r
public abstract class AbstractDbCommand : DbCommand, ICloneable\r
{\r
- #region ProcedureColumnCache
-
+ #region ProcedureColumnCache\r
+\r
internal sealed class ProcedureColumnCache : AbstractDbMetaDataCache\r
{\r
internal ArrayList GetProcedureColumns(AbstractDBConnection connection, String commandText,AbstractDbCommand command) \r
cache[key] = col;\r
return col; \r
}\r
- }
-
- #endregion
-
- #region SqlStatementsHelper
-
- internal sealed class SqlStatementsHelper
- {
- #region Fields
+ }\r
+\r
+ #endregion\r
+\r
+ #region SqlStatementsHelper\r
+\r
+ internal sealed class SqlStatementsHelper\r
+ {\r
+ #region Fields\r
#if USE_DOTNET_REGEXP \r
internal static readonly Regex NamedParameterStoredProcedureRegExp = new Regex(@"^\s*{?\s*((?<RETVAL>@\w+)\s*=\s*)?call\s+(?<PROCNAME>(((\[[^\]]*\])|([^\.\(])*)\s*\.\s*){0,2}(\[[^\]]*\]|((\s*[^\.\(\)\{\}\s])+)))\s*(\(\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)?\s*(,\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)\s*)*\))?\s*}?\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
internal static readonly Regex SimpleParameterStoredProcedureRegExp = new Regex(@"^\s*{?\s*((?<RETVAL>\?)\s*=\s*)?call\s+(?<PROCNAME>(((\[[^\]]*\])|([^\.\(])*)\s*\.\s*){0,2}(\[[^\]]*\]|((\s*[^\.\(\)\{\}\s])+)))\s*(\(\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)?\s*(,\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)\s*)*\))?\s*}?\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
internal static readonly SimpleRegex CompoundStatementSplitterReqExp = new CharacterSplitterRegex(';');\r
internal static readonly SimpleRegex ProcedureParameterSplitterReqExp = new CharacterSplitterRegex(',');\r
\r
- #endregion // Fields
- }
-
- #endregion // SqlStatementsHelper
+ #endregion // Fields\r
+ }\r
+\r
+ #endregion // SqlStatementsHelper\r
\r
#region Fields\r
\r
- string _commandText;
- int _commandTimeout;
- CommandType _commandType;
- bool _designTimeVisible;
+ string _commandText;\r
+ int _commandTimeout;\r
+ CommandType _commandType;\r
+ bool _designTimeVisible;\r
UpdateRowSource _updatedRowSource;\r
\r
private DbParameterCollection _parameters;\r
_commandText = cmdText;\r
_transaction = transaction;\r
\r
- _commandTimeout = 30;
- _commandType = CommandType.Text;
- _designTimeVisible = true;
+ _commandTimeout = 30;\r
+ _commandType = CommandType.Text;\r
+ _designTimeVisible = true;\r
_updatedRowSource = UpdateRowSource.Both;\r
\r
_isCommandPrepared = false;\r
#endregion // Constructors\r
\r
#region Properties\r
-
- public override int CommandTimeout {
- get { return _commandTimeout; }
- set { _commandTimeout = value; }
- }
-
- public override CommandType CommandType {
- get { return _commandType; }
- set { _commandType = value; }
- }
-
- public override bool DesignTimeVisible {
- get { return _designTimeVisible; }
- set { _designTimeVisible = value; }
- }
-
- public override UpdateRowSource UpdatedRowSource {
- get { return _updatedRowSource; }
- set { _updatedRowSource = value; }
+\r
+ public override int CommandTimeout {\r
+ get { return _commandTimeout; }\r
+ set { _commandTimeout = value; }\r
+ }\r
+\r
+ public override CommandType CommandType {\r
+ get { return _commandType; }\r
+ set { _commandType = value; }\r
+ }\r
+\r
+ public override bool DesignTimeVisible {\r
+ get { return _designTimeVisible; }\r
+ set { _designTimeVisible = value; }\r
+ } \r
+\r
+ public override UpdateRowSource UpdatedRowSource {\r
+ get { return _updatedRowSource; }\r
+ set { _updatedRowSource = value; }\r
}\r
\r
protected override DbParameterCollection DbParameterCollection\r
\r
protected internal abstract SystemException CreateException(SQLException e);\r
\r
- public override int ExecuteNonQuery ()
- {
- IDataReader reader = null;
- try {
- reader = ExecuteReader ();
- }
- finally {
- if (reader != null)
- reader.Close ();
- }
- return reader.RecordsAffected;
- }
-
- public override object ExecuteScalar ()
- {
- IDataReader reader = ExecuteReader(CommandBehavior.SequentialAccess);
-
- try {
- do {
- if (reader.FieldCount > 0 && reader.Read ())
- return reader.GetValue (0);
- }
- while (reader.NextResult ());
- return null;
- } finally {
- reader.Close();
- }
+ public override int ExecuteNonQuery ()\r
+ {\r
+ IDataReader reader = null;\r
+ try {\r
+ reader = ExecuteReader ();\r
+ }\r
+ finally {\r
+ if (reader != null)\r
+ reader.Close (); \r
+ }\r
+ return reader.RecordsAffected;\r
}\r
\r
- public virtual void ResetCommandTimeout ()
- {
- _commandTimeout = 30;
+ public override object ExecuteScalar ()\r
+ {\r
+ IDataReader reader = ExecuteReader(CommandBehavior.SequentialAccess);\r
+ \r
+ try {\r
+ do {\r
+ if (reader.FieldCount > 0 && reader.Read ())\r
+ return reader.GetValue (0); \r
+ }\r
+ while (reader.NextResult ());\r
+ return null;\r
+ } finally {\r
+ reader.Close();\r
+ }\r
+ }\r
+\r
+ public virtual void ResetCommandTimeout ()\r
+ {\r
+ _commandTimeout = 30;\r
}\r
\r
public override void Cancel()\r
}\r
}\r
\r
- protected virtual void BindOutputParameter(AbstractDbParameter parameter, int parameterIndex)
- {
- parameter.Validate();
+ protected virtual void BindOutputParameter(AbstractDbParameter parameter, int parameterIndex)\r
+ {\r
+ parameter.Validate();\r
int jdbcType = (int)parameter.JdbcType; \r
// java parameters are 1 based, while .net are 0 based\r
parameterIndex++;\r
}\r
else {\r
callableStatement.registerOutParameter(parameterIndex, jdbcType);\r
- }
+ }\r
}\r
\r
- private void FillOutputParameters()
- {
- if (!(_statement is CallableStatement)) {
- return;
- }
- for(int i = 0; i < InternalParameters.Count; i++) {
- AbstractDbParameter parameter = (AbstractDbParameter)InternalParameters[i];
- ParameterDirection direction = parameter.Direction;
- if (((direction & ParameterDirection.Output) != 0) && !SkipParameter(parameter)) {
- FillOutputParameter(parameter, i);
- }
- // drop jdbc type of out parameter, since it possibly was updated in ExecuteReader
- parameter.IsJdbcTypeSet = false;
- }
+ private void FillOutputParameters()\r
+ { \r
+ if (!(_statement is CallableStatement)) {\r
+ return;\r
+ }\r
+ for(int i = 0; i < InternalParameters.Count; i++) {\r
+ AbstractDbParameter parameter = (AbstractDbParameter)InternalParameters[i];\r
+ ParameterDirection direction = parameter.Direction;\r
+ if (((direction & ParameterDirection.Output) != 0) && !SkipParameter(parameter)) { \r
+ FillOutputParameter(parameter, i);\r
+ }\r
+ // drop jdbc type of out parameter, since it possibly was updated in ExecuteReader\r
+ parameter.IsJdbcTypeSet = false;\r
+ }\r
}\r
\r
protected virtual void FillOutputParameter(DbParameter parameter, int index)\r
}\r
}\r
\r
- throw new ArgumentException(
+ throw new ArgumentException(\r
String.Format("Unknown provider name '{0}'", provider), "ConnectionString");\r
}\r
\r
-//\r
-// System.Data.ProviderBase.AbstractDbParameter\r
+//
+// System.Data.ProviderBase.AbstractDbParameter
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-\r
-using System;\r
-using System.Data;\r
-using System.Data.Common;\r
-\r
-using java.sql;\r
-\r
-namespace System.Data.ProviderBase\r
-{\r
- public abstract class AbstractDbParameter : DbParameter, IDbDataParameter, ICloneable\r
- {\r
- #region Fields\r
-\r
- byte _precision;\r
- byte _scale;\r
- protected DataRowVersion _sourceVersion;\r
- private int _jdbcType;\r
- bool _isDbTypeSet;\r
- bool _isJdbcTypeSet;\r
- object _convertedValue;\r
-\r
+//
+
+
+using System;
+using System.Data;
+using System.Data.Common;
+
+using java.sql;
+
+namespace System.Data.ProviderBase
+{
+ public abstract class AbstractDbParameter : DbParameter, IDbDataParameter, ICloneable
+ {
+ #region Fields
+
+ byte _precision;
+ byte _scale;
+ protected DataRowVersion _sourceVersion;
+ private int _jdbcType;
+ bool _isDbTypeSet;
+ bool _isJdbcTypeSet;
+ object _convertedValue;
+
string _parameterName;
ParameterDirection _direction = ParameterDirection.Input;
- int _size;\r
+ int _size;
object _value;
bool _isNullable;
int _offset;
string _sourceColumn;
- DbParameterCollection _parent = null;\r
-\r
- #endregion // Fields\r
-\r
+ DbParameterCollection _parent = null;
+
+ #endregion // Fields
+
#region Constructors
[MonoTODO]
{
}
- #endregion // Constructors\r
-\r
+ #endregion // Constructors
+
#region Properties
public override ParameterDirection Direction {
public byte Precision
{
- get { return _precision; }\r
+ get { return _precision; }
set { _precision = value; }
}
public byte Scale
{
- get { return _scale; }\r
+ get { return _scale; }
set { _scale = value; }
}
-\r
- public override DataRowVersion SourceVersion\r
- {\r
- get { return _sourceVersion; }\r
- set { _sourceVersion = value; }\r
+
+ public override DataRowVersion SourceVersion
+ {
+ get { return _sourceVersion; }
+ set { _sourceVersion = value; }
}
protected internal int JdbcType
}
}
- internal object ConvertedValue\r
- {\r
- get { \r
- if (_convertedValue == null) {\r
- object value = Value;\r
- _convertedValue = ((value != null) && (value != DBNull.Value)) ? ConvertValue(value) : value;\r
- }\r
- return _convertedValue;\r
- }\r
+ internal object ConvertedValue
+ {
+ get {
+ if (_convertedValue == null) {
+ object value = Value;
+ _convertedValue = ((value != null) && (value != DBNull.Value)) ? ConvertValue(value) : value;
+ }
+ return _convertedValue;
+ }
}
public override object Value {
//DbParameter overrides
- public override bool SourceColumnNullMapping {\r
- get {\r
- throw new NotImplementedException();\r
- }\r
- set {\r
- throw new NotImplementedException();\r
- }\r
- }\r
+ public override bool SourceColumnNullMapping {
+ get {
+ throw new NotImplementedException();
+ }
+ set {
+ throw new NotImplementedException();
+ }
+ }
#endregion // Properties
#region Methods
- public override String ToString()\r
- {\r
- return ParameterName;\r
+ public override String ToString()
+ {
+ return ParameterName;
}
- protected internal abstract void SetParameterName(ResultSet res);\r
-\r
- protected internal abstract void SetParameterDbType(ResultSet res);\r
-\r
+ protected internal abstract void SetParameterName(ResultSet res);
+
+ protected internal abstract void SetParameterDbType(ResultSet res);
+
protected internal abstract void SetSpecialFeatures(ResultSet res);
public virtual object Clone()
- {\r
- AbstractDbParameter other = (AbstractDbParameter) MemberwiseClone ();\r
- other._parent = null;\r
+ {
+ AbstractDbParameter other = (AbstractDbParameter) MemberwiseClone ();
+ other._parent = null;
return other;
}
internal void SetParameterPrecisionAndScale(ResultSet res)
{
- int jdbcType = res.getInt("DATA_TYPE");\r
- if(jdbcType == java.sql.Types.DECIMAL || jdbcType == java.sql.Types.NUMERIC) {\r
- Precision = (byte)res.getInt("PRECISION");\r
- Scale = (byte)res.getInt("SCALE");\r
+ int jdbcType = res.getInt("DATA_TYPE");
+ if(jdbcType == java.sql.Types.DECIMAL || jdbcType == java.sql.Types.NUMERIC) {
+ Precision = (byte)res.getInt("PRECISION");
+ Scale = (byte)res.getInt("SCALE");
}
}
//DbParameter overrides
- public override void ResetDbType() {\r
- throw new NotImplementedException();\r
+ public override void ResetDbType() {
+ throw new NotImplementedException();
}
- #endregion // Methods\r
- }\r
-}\r
-\r
+ #endregion // Methods
+ }
+}
+
\r
#region Properties\r
\r
- public override int Depth {
- get { return 0; }
+ public override int Depth {\r
+ get { return 0; }\r
}\r
\r
public override bool HasRows {\r
_isClosed = true;\r
}\r
\r
- public override IEnumerator GetEnumerator ()
- {
- bool closeReader = (Behavior & CommandBehavior.CloseConnection) != 0;
- return new DbEnumerator (this , closeReader);
+ public override IEnumerator GetEnumerator ()\r
+ {\r
+ bool closeReader = (Behavior & CommandBehavior.CloseConnection) != 0;\r
+ return new DbEnumerator (this , closeReader);\r
}\r
\r
public override bool NextResult()\r
//\r
// System.Data.ProviderBase.AbstractDbException\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
\r
-//\r
-// System.Data.Common.AbstractDbParameterCollection\r
+//
+// System.Data.Common.AbstractDbParameterCollection
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//\r
-\r
-\r
-using System;\r
-using System.Data.Common;\r
-using System.Collections;\r
-\r
-namespace System.Data.ProviderBase\r
-{\r
- public abstract class AbstractDbParameterCollection : DbParameterCollection\r
- {\r
- #region Fields\r
-\r
- readonly AbstractDbCommand _parent;\r
- readonly ArrayList _list = new ArrayList();\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public AbstractDbParameterCollection(DbCommand parent)\r
- {\r
- _parent = (AbstractDbCommand)parent;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
+//
+
+
+using System;
+using System.Data.Common;
+using System.Collections;
+
+namespace System.Data.ProviderBase
+{
+ public abstract class AbstractDbParameterCollection : DbParameterCollection
+ {
+ #region Fields
+
+ readonly AbstractDbCommand _parent;
+ readonly ArrayList _list = new ArrayList();
+
+ #endregion // Fields
+
+ #region Constructors
+
+ public AbstractDbParameterCollection(DbCommand parent)
+ {
+ _parent = (AbstractDbCommand)parent;
+ }
+
+ #endregion // Constructors
+
#region Properties
public override int Count {
get { return _list.SyncRoot; }
}
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
+ #endregion // Properties
+
+ #region Methods
+
public override int Add (object value) {
Validate (-1, value);
OnSchemaChanging();
return (DbParameter) _list [index];
}
-#if NET_2_0\r
- protected override DbParameter GetParameter (string parameterName) {\r
- return GetParameter (IndexOf (parameterName));\r
- }\r
-\r
- protected override void SetParameter (string parameterName, DbParameter value) {\r
- SetParameter (IndexOf (parameterName), value);\r
+#if NET_2_0
+ protected override DbParameter GetParameter (string parameterName) {
+ return GetParameter (IndexOf (parameterName));
+ }
+
+ protected override void SetParameter (string parameterName, DbParameter value) {
+ SetParameter (IndexOf (parameterName), value);
}
#endif
((AbstractDbParameter)value).Parent = this;
_list [index] = value;
- }\r
-\r
- protected internal void OnSchemaChanging()\r
- {\r
- if (_parent != null) {\r
- _parent.OnSchemaChanging();\r
- }\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
+ }
+
+ protected internal void OnSchemaChanging()
+ {
+ if (_parent != null) {
+ _parent.OnSchemaChanging();
+ }
+ }
+
+ #endregion // Methods
+ }
+}
//\r
// System.Data.ProviderBase.AbstractTransaction\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
using System.Data.Common;\r
//\r
// System.Data.ProviderBase.ReaderCache.cs\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
using System;\r
//\r
// System.Data.ProviderBase.regex.cs\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
using System.Data;\r
--- /dev/null
+/SqlClientPermission.cs -crlf
+/SqlClientPermissionAttribute.cs -crlf
+/SqlCommand.resx -crlf
+/SqlCommandBuilder.cs -crlf
+/SqlConnection.resx -crlf
+/SqlConvert.cs -crlf
+/SqlDataAdapter.cs -crlf
+/SqlException.cs -crlf
+/SqlInfoMessageEventHandler.cs -crlf
+/SqlRowUpdatedEventArgs.cs -crlf
+/SqlRowUpdatedEventHandler.cs -crlf
+/SqlRowUpdatingEventArgs.cs -crlf
+/SqlRowUpdatingEventHandler.cs -crlf
-//\r
-// System.Data.SqlClient.MetaType\r
+//
+// System.Data.SqlClient.MetaType
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
-//\r
-// System.Data.SqlClient.SqlCollation\r
+//
+// System.Data.SqlClient.SqlCollation
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
// Author:\r
// Tim Coleman (tim@timcoleman.com)\r
//\r
-// Copyright (C) Tim Coleman, 2002
-// (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.
+// Copyright (C) Tim Coleman, 2002 \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
// System.Data.SqlClient.SqlConvert\r
//\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
using System;\r
{\r
// FIXME : other java.sql.Type\r
// Types.ARRAY\r
- if(Types.BIGINT == jdbcType) return SqlDbType.BigInt;
- if(Types.BINARY == jdbcType) return SqlDbType.Binary;
- if(Types.BIT == jdbcType) return SqlDbType.Bit;
- if(Types.BLOB == jdbcType) return SqlDbType.Binary;
- // Types.BOOLEAN
- if(Types.CHAR == jdbcType) return SqlDbType.Char;
- if(Types.CLOB == jdbcType) return SqlDbType.Binary;
- if(Types.DATE == jdbcType) return SqlDbType.DateTime;
- if(Types.DECIMAL == jdbcType) return SqlDbType.Decimal;
- // Types.DISTINCT
- if(Types.DOUBLE == jdbcType) return SqlDbType.Float;
- if(Types.FLOAT == jdbcType) return SqlDbType.Float;
- if(Types.INTEGER == jdbcType) return SqlDbType.Int;
- // Types.JAVA_OBJECT
- if(Types.LONGVARBINARY == jdbcType) return SqlDbType.Image;
- if(Types.LONGVARCHAR == jdbcType) return SqlDbType.Text;
- // Types.NULL
- if(Types.NUMERIC == jdbcType) return SqlDbType.Decimal;
- if(Types.REAL == jdbcType) return SqlDbType.Real;
- // Types.REF
- if(Types.SMALLINT == jdbcType) return SqlDbType.SmallInt;
- // Types.STRUCT
- if(Types.TIME == jdbcType) return SqlDbType.DateTime;
- if(Types.TIMESTAMP == jdbcType) return SqlDbType.DateTime;
- if(Types.TINYINT == jdbcType) return SqlDbType.TinyInt;
- if(Types.VARBINARY == jdbcType) return SqlDbType.VarBinary;
- if(Types.VARCHAR == jdbcType) return SqlDbType.NVarChar;
+ if(Types.BIGINT == jdbcType) return SqlDbType.BigInt;\r
+ if(Types.BINARY == jdbcType) return SqlDbType.Binary;\r
+ if(Types.BIT == jdbcType) return SqlDbType.Bit;\r
+ if(Types.BLOB == jdbcType) return SqlDbType.Binary;\r
+ // Types.BOOLEAN\r
+ if(Types.CHAR == jdbcType) return SqlDbType.Char;\r
+ if(Types.CLOB == jdbcType) return SqlDbType.Binary;\r
+ if(Types.DATE == jdbcType) return SqlDbType.DateTime;\r
+ if(Types.DECIMAL == jdbcType) return SqlDbType.Decimal;\r
+ // Types.DISTINCT\r
+ if(Types.DOUBLE == jdbcType) return SqlDbType.Float;\r
+ if(Types.FLOAT == jdbcType) return SqlDbType.Float;\r
+ if(Types.INTEGER == jdbcType) return SqlDbType.Int;\r
+ // Types.JAVA_OBJECT\r
+ if(Types.LONGVARBINARY == jdbcType) return SqlDbType.Image;\r
+ if(Types.LONGVARCHAR == jdbcType) return SqlDbType.Text;\r
+ // Types.NULL\r
+ if(Types.NUMERIC == jdbcType) return SqlDbType.Decimal;\r
+ if(Types.REAL == jdbcType) return SqlDbType.Real;\r
+ // Types.REF\r
+ if(Types.SMALLINT == jdbcType) return SqlDbType.SmallInt;\r
+ // Types.STRUCT\r
+ if(Types.TIME == jdbcType) return SqlDbType.DateTime;\r
+ if(Types.TIMESTAMP == jdbcType) return SqlDbType.DateTime;\r
+ if(Types.TINYINT == jdbcType) return SqlDbType.TinyInt;\r
+ if(Types.VARBINARY == jdbcType) return SqlDbType.VarBinary;\r
+ if(Types.VARCHAR == jdbcType) return SqlDbType.NVarChar;\r
return SqlDbType.Variant;\r
}\r
\r
// Tim Coleman (tim@timcoleman.com)\r
//\r
// (C) Ximian, Inc 2002\r
-// Copyright (C) 2002 Tim Coleman
-// (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.
+// Copyright (C) 2002 Tim Coleman \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
-// System.Data.SqlClient.SqlError\r
+//
+// System.Data.SqlClient.SqlError
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
//\r
// System.Data.SqlClient.SqlException\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlClient\r
-//\r
-// System.Data.SqlClient.SqlInfoMessageEventArgs\r
+//
+// System.Data.SqlClient.SqlInfoMessageEventArgs
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
//
using System;
-using System.Data;\r
-\r
-namespace System.Data.SqlClient\r
-{\r
- /// <summary>\r
- /// Summary description for SqlInfoMessageEventArgs.\r
- /// </summary>\r
+using System.Data;
+
+namespace System.Data.SqlClient
+{
+ /// <summary>
+ /// Summary description for SqlInfoMessageEventArgs.
+ /// </summary>
public sealed class SqlInfoMessageEventArgs : EventArgs
{
#region Fields
#region Properties
- public SqlErrorCollection Errors \r
+ public SqlErrorCollection Errors
{
get { return errors; }
}
- public string Message \r
+ public string Message
{
get { return errors[0].Message; }
}
- public string Source \r
+ public string Source
{
get { return errors[0].Source; }
}
}
#endregion // Methods
- }\r
-}\r
+ }
+}
+2010-07-28 Veerapuram Varadhan <vvaradhan@novell.com>
+
+ ** Fixes #584833
+ * SqlCommand.cs (DeriveParameters): Support procedure name nomenclature
+ of the form <database>.<user>.<procname> .
+
2010-06-15 Veerapuram Varadhan <vvaradhan@novell.com>
** Fixes #613087
* SqlDataReader.cs (GetSqlValue): Tds70 returns decimal (18,0)
string procName = CommandText;
string schemaName = String.Empty;
- int dotPosition = procName.IndexOf ('.');
+ int dotPosition = procName.LastIndexOf ('.');
+
+ // Procedure name can be: [database].[user].[procname]
if (dotPosition >= 0) {
schemaName = procName.Substring (0, dotPosition);
procName = procName.Substring (dotPosition + 1);
+ if ((dotPosition = schemaName.LastIndexOf ('.')) >= 0)
+ schemaName = schemaName.Substring (dotPosition + 1);
}
procName = EscapeProcName (procName, false);
--- /dev/null
+/SqlByte.cs -crlf
+/SqlCompareOptions.cs -crlf
+/SqlDateTime.cs -crlf
+/SqlDecimal.cs -crlf
+/SqlDouble.cs -crlf
+/SqlGuid.cs -crlf
+/SqlInt16.cs -crlf
+/SqlInt32.cs -crlf
+/SqlInt64.cs -crlf
+/SqlMoney.cs -crlf
+/SqlSingle.cs -crlf
+/SqlString.cs -crlf
-// System.Data.SqlTypes.INullable\r
+// System.Data.SqlTypes.INullable
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
-// System.Data.SqlTypes.SqlBinary\r
+// System.Data.SqlTypes.SqlBinary
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
-// System.Data.SqlTypes.SqlBoolean\r
+// System.Data.SqlTypes.SqlBoolean
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
// System.Data.SqlTypes.SqlByte\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlTypes\r
// System.Data.SqlTypes.SqlDateTime\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlTypes\r
// System.Data.SqlTypes.SqlDecimal\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlTypes\r
// System.Data.SqlTypes.SqlDouble\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlTypes\r
// System.Data.SqlTypes.SqlGuid\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlTypes\r
\r
public int CompareTo(Object obj)\r
{\r
- if (obj == null)
- return 1;
-
- if (obj is SqlGuid)
- {
- SqlGuid g = (SqlGuid)obj;
-
- if (g.IsNull)
- return 1;
- if (this.IsNull)
- return -1;
-
- return this._value.CompareTo(g._value);
- }
-
- throw new ArgumentException("parameter obj is not SqlGuid : " + obj.GetType().Name);
+ if (obj == null)\r
+ return 1;\r
+\r
+ if (obj is SqlGuid)\r
+ {\r
+ SqlGuid g = (SqlGuid)obj;\r
+\r
+ if (g.IsNull)\r
+ return 1;\r
+ if (this.IsNull)\r
+ return -1;\r
+\r
+ return this._value.CompareTo(g._value);\r
+ }\r
+\r
+ throw new ArgumentException("parameter obj is not SqlGuid : " + obj.GetType().Name);\r
\r
}\r
\r
\r
public override bool Equals(Object obj)\r
{\r
- if (obj == null)
- return false;
-
- if (obj is SqlGuid)
- {
- SqlGuid g = (SqlGuid)obj;
-
- if (IsNull && g.IsNull)
- return true;
-
- if (IsNull || g.IsNull)
- return false;
-
- return _value == g._value;
- }
-
+ if (obj == null)\r
+ return false;\r
+\r
+ if (obj is SqlGuid)\r
+ {\r
+ SqlGuid g = (SqlGuid)obj;\r
+\r
+ if (IsNull && g.IsNull)\r
+ return true;\r
+\r
+ if (IsNull || g.IsNull)\r
+ return false;\r
+\r
+ return _value == g._value;\r
+ }\r
+\r
return false;\r
}\r
\r
public override String ToString()\r
{\r
- if (IsNull)
- return "null";
-
-
+ if (IsNull)\r
+ return "null";\r
+\r
+\r
return _value.ToString();\r
}\r
\r
// System.Data.SqlTypes.SqlInt16\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlTypes\r
// System.Data.SqlTypes.SqlInt32\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlTypes\r
// System.Data.SqlTypes.SqlInt64\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlTypes\r
// System.Data.SqlTypes.SqlMoney\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlTypes\r
-// System.Data.SqlTypes.SqlNullValueException\r
+// System.Data.SqlTypes.SqlNullValueException
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
// System.Data.SqlTypes.SqlSingle\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlTypes\r
// System.Data.SqlTypes.SqlString\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// Authors:\r
+// Konstantin Triger <kostat@mainsoft.com>\r
+// Boris Kirzner <borisk@mainsoft.com>\r
+// \r
+// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
+//\r
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
namespace System.Data.SqlTypes\r
-// System.Data.SqlTypes.SqlTruncateException\r
+// System.Data.SqlTypes.SqlTruncateException
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
-//\r
-// System.Data.SqlTypes.SqlTypeException\r
+//
+// System.Data.SqlTypes.SqlTypeException
//
// Authors:
// Konstantin Triger <kostat@mainsoft.com>
--- /dev/null
+/DataColumn.cs -crlf
+/DataRelationPropertyDescriptor.cs -crlf
+/DataRowView.cs -crlf
+/DataSet.cs -crlf
+/DataTable.cs -crlf
+/DataView.cs -crlf
+/DataViewManager.cs -crlf
+/ExpressionElement.cs -crlf
+/RelatedDataView.cs -crlf
+/Res.cs -crlf
+/XmlDataInferenceLoader.cs -crlf
+/XmlDataReader.cs -crlf
--- /dev/null
+/MySqlTestBed.dll.config -crlf
+/OdbcTest.cs -crlf
+/TestExecuteScalar.cs -crlf
+/TestSqlConnection.cs -crlf
+/TestSqlDataReader.cs -crlf
+/TestSqlParameters.cs -crlf
--- /dev/null
+/README -crlf
--- /dev/null
+/ChangeLog -crlf
+/DateComparisonTest.cs -crlf
// used internally by ReadData() to read each result set
static void ReadResult(IDataReader rdr, DataTable dt) {
- \r
- // number of columns in the table\r
- Console.WriteLine(" Total Columns: " +\r
- dt.Rows.Count);\r
-\r
- // display the schema\r
- foreach (DataRow schemaRow in dt.Rows) {\r
- foreach (DataColumn schemaCol in dt.Columns)\r
- Console.WriteLine(schemaCol.ColumnName + \r
- " = " + \r
- schemaRow[schemaCol]);\r
- Console.WriteLine();\r
- }\r
-\r
- int nRows = 0;\r
- int c = 0;\r
- string output, metadataValue, dataValue;\r
- // Read and display the rows\r
- Console.WriteLine("Gonna do a Read() now...");\r
- while(rdr.Read()) {\r
- Console.WriteLine(" Row " + nRows + ": ");\r
- \r
- for(c = 0; c < rdr.FieldCount; c++) {\r
- // column meta data \r
- DataRow dr = dt.Rows[c];\r
- metadataValue = \r
- " Col " + \r
- c + ": " + \r
- dr["ColumnName"];\r
- \r
- // column data\r
- if(rdr.IsDBNull(c) == true)\r
- dataValue = " is NULL";\r
- else\r
- dataValue = \r
- ": " + \r
- rdr.GetValue(c);\r
- \r
- // display column meta data and data\r
- output = metadataValue + dataValue; \r
- Console.WriteLine(output);\r
- }\r
- nRows++;\r
- }\r
- Console.WriteLine(" Total Rows Retrieved: " + \r
+
+ // number of columns in the table
+ Console.WriteLine(" Total Columns: " +
+ dt.Rows.Count);
+
+ // display the schema
+ foreach (DataRow schemaRow in dt.Rows) {
+ foreach (DataColumn schemaCol in dt.Columns)
+ Console.WriteLine(schemaCol.ColumnName +
+ " = " +
+ schemaRow[schemaCol]);
+ Console.WriteLine();
+ }
+
+ int nRows = 0;
+ int c = 0;
+ string output, metadataValue, dataValue;
+ // Read and display the rows
+ Console.WriteLine("Gonna do a Read() now...");
+ while(rdr.Read()) {
+ Console.WriteLine(" Row " + nRows + ": ");
+
+ for(c = 0; c < rdr.FieldCount; c++) {
+ // column meta data
+ DataRow dr = dt.Rows[c];
+ metadataValue =
+ " Col " +
+ c + ": " +
+ dr["ColumnName"];
+
+ // column data
+ if(rdr.IsDBNull(c) == true)
+ dataValue = " is NULL";
+ else
+ dataValue =
+ ": " +
+ rdr.GetValue(c);
+
+ // display column meta data and data
+ output = metadataValue + dataValue;
+ Console.WriteLine(output);
+ }
+ nRows++;
+ }
+ Console.WriteLine(" Total Rows Retrieved: " +
nRows);
}
Console.WriteLine("IDataReader has a Null Reference.");
}
else {
- do {\r
- DataTable dt = rdr.GetSchemaTable();\r
- if(rdr.RecordsAffected != -1) {\r
- // Results for \r
- // SQL INSERT, UPDATE, DELETE Commands \r
- // have RecordsAffected >= 0\r
- Console.WriteLine("Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);\r
- }\r
- else if(dt == null)\r
- // Results for\r
- // SQL Commands not INSERT, UPDATE, nor DELETE\r
- // have RecordsAffected == -1\r
- // and GetSchemaTable() returns a null reference\r
- Console.WriteLine("Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);\r
- else {\r
- // Results for\r
- // SQL SELECT Queries\r
- // have RecordsAffected = -1\r
- // and GetSchemaTable() returns a reference to a DataTable\r
- Console.WriteLine("Result is from a SELECT SQL Query. Records Affected: " + rdr.RecordsAffected);\r
- \r
- results++;\r
- Console.WriteLine("Result Set " + results + "...");\r
-\r
- ReadResult(rdr, dt);\r
- }\r
-\r
- } while(rdr.NextResult());\r
- Console.WriteLine("Total Result sets: " + results);\r
- \r
+ do {
+ DataTable dt = rdr.GetSchemaTable();
+ if(rdr.RecordsAffected != -1) {
+ // Results for
+ // SQL INSERT, UPDATE, DELETE Commands
+ // have RecordsAffected >= 0
+ Console.WriteLine("Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
+ }
+ else if(dt == null)
+ // Results for
+ // SQL Commands not INSERT, UPDATE, nor DELETE
+ // have RecordsAffected == -1
+ // and GetSchemaTable() returns a null reference
+ Console.WriteLine("Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
+ else {
+ // Results for
+ // SQL SELECT Queries
+ // have RecordsAffected = -1
+ // and GetSchemaTable() returns a reference to a DataTable
+ Console.WriteLine("Result is from a SELECT SQL Query. Records Affected: " + rdr.RecordsAffected);
+
+ results++;
+ Console.WriteLine("Result Set " + results + "...");
+
+ ReadResult(rdr, dt);
+ }
+
+ } while(rdr.NextResult());
+ Console.WriteLine("Total Result sets: " + results);
+
rdr.Close();
}
}
Console.WriteLine("\t\tCall ExecuteReader with a SQL Command. (Is INSERT,UPDATE,DELETE).");
reader = SelectDataUsingInsertCommand(cnc);
ReadData(reader);
-\r
- // Call a Stored Procedure named Version()\r
- Console.WriteLine("\t\tCalling stored procedure version()");\r
- object obj = CallStoredProcedure(cnc);\r
- Console.WriteLine("Result: " + obj);\r
-\r
- Console.WriteLine("Database Server Version: " + \r
- ((PgSqlConnection)cnc).ServerVersion);\r
-\r
+
+ // Call a Stored Procedure named Version()
+ Console.WriteLine("\t\tCalling stored procedure version()");
+ object obj = CallStoredProcedure(cnc);
+ Console.WriteLine("Result: " + obj);
+
+ Console.WriteLine("Database Server Version: " +
+ ((PgSqlConnection)cnc).ServerVersion);
+
/* Clean up */
Console.WriteLine ("Clean up...");
Console.WriteLine ("\t\tDrop table...");
}
}
- [STAThread]\r
- static void Main(string[] args) {\r
- Console.WriteLine("Tests Start.");\r
- Console.WriteLine("Creating PgSqlConnectioin...");\r
- PgSqlConnection cnc = new PgSqlConnection ();\r
-\r
- // possible PostgreSQL Provider ConnectionStrings\r
+ [STAThread]
+ static void Main(string[] args) {
+ Console.WriteLine("Tests Start.");
+ Console.WriteLine("Creating PgSqlConnectioin...");
+ PgSqlConnection cnc = new PgSqlConnection ();
+
+ // possible PostgreSQL Provider ConnectionStrings
//string connectionString =
// "Server=hostname;" +
// "Database=database;" +
// "User ID=userid;" +
- // "Password=password";\r
- // or\r
+ // "Password=password";
+ // or
//string connectionString =
// "host=hostname;" +
// "dbname=database;" +
// "user=userid;" +
// "password=password";
-\r
+
string connectionString =
"host=localhost;" +
"dbname=test;" +
"user=postgres";
- \r
- Console.WriteLine("Setting ConnectionString: " +\r
- connectionString);\r
- cnc.ConnectionString = connectionString;\r
-\r
- Console.WriteLine("Opening database connection...");\r
- cnc.Open();\r
-\r
- Console.WriteLine("Do Tests....");\r
+
+ Console.WriteLine("Setting ConnectionString: " +
+ connectionString);
+ cnc.ConnectionString = connectionString;
+
+ Console.WriteLine("Opening database connection...");
+ cnc.Open();
+
+ Console.WriteLine("Do Tests....");
DoPostgresTest(cnc);
Console.WriteLine("Close database connection...");
--- /dev/null
+/GHTDB.MSSQL2005.sql -crlf
--- /dev/null
+/SqlCommand_ExecuteReader_.cs -crlf
+/SqlCommand_ExecuteXmlReader_.cs -crlf
+/SqlCommand_Parameters.cs -crlf
--- /dev/null
+/SqlCommandBuilder_DeriveParameters_S.cs -crlf
--- /dev/null
+/SqlConnection_BeginTransaction_S.cs -crlf
+/SqlConnection_InfoMessage.cs -crlf
+/SqlConnection_StateChange.cs -crlf
--- /dev/null
+/SqlDataAdapter_RowUpdated.cs -crlf
+/SqlDataAdapter_RowUpdating.cs -crlf
--- /dev/null
+/SqlParameter_Direction.cs -crlf
+/SqlParameter_ctor_SO.cs -crlf
+/SqlParameter_set_DbType_D.cs -crlf
// used internally by ReadData() to read each result set
static void ReadResult(IDataReader rdr, DataTable dt) {
- \r
- // number of columns in the table\r
- Console.WriteLine(" Total Columns: " +\r
- dt.Rows.Count);\r
-\r
- // display the schema\r
- foreach (DataRow schemaRow in dt.Rows) {\r
- foreach (DataColumn schemaCol in dt.Columns)\r
- Console.WriteLine(schemaCol.ColumnName + \r
- " = " + \r
- schemaRow[schemaCol]);\r
- Console.WriteLine();\r
- }\r
-\r
- int nRows = 0;\r
- int c = 0;\r
- string output, metadataValue, dataValue;\r
- // Read and display the rows\r
- Console.WriteLine("Gonna do a Read() now...");\r
- while(rdr.Read()) {\r
- Console.WriteLine(" Row " + nRows + ": ");\r
- \r
- for(c = 0; c < rdr.FieldCount; c++) {\r
- // column meta data \r
- DataRow dr = dt.Rows[c];\r
- metadataValue = \r
- " Col " + \r
- c + ": " + \r
- dr["ColumnName"];\r
- \r
- // column data\r
- if (rdr.IsDBNull(c) == true)\r
- dataValue = " is NULL";\r
+
+ // number of columns in the table
+ Console.WriteLine(" Total Columns: " +
+ dt.Rows.Count);
+
+ // display the schema
+ foreach (DataRow schemaRow in dt.Rows) {
+ foreach (DataColumn schemaCol in dt.Columns)
+ Console.WriteLine(schemaCol.ColumnName +
+ " = " +
+ schemaRow[schemaCol]);
+ Console.WriteLine();
+ }
+
+ int nRows = 0;
+ int c = 0;
+ string output, metadataValue, dataValue;
+ // Read and display the rows
+ Console.WriteLine("Gonna do a Read() now...");
+ while(rdr.Read()) {
+ Console.WriteLine(" Row " + nRows + ": ");
+
+ for(c = 0; c < rdr.FieldCount; c++) {
+ // column meta data
+ DataRow dr = dt.Rows[c];
+ metadataValue =
+ " Col " +
+ c + ": " +
+ dr["ColumnName"];
+
+ // column data
+ if (rdr.IsDBNull(c) == true)
+ dataValue = " is NULL";
else if ((Type) dr["DataType"] == typeof (byte[]))
dataValue =
": 0x" +
BitConverter.ToString ((byte[]) rdr.GetValue (c)).Replace ("-", "").ToLower ();
- else\r
- dataValue = \r
- ": " + \r
- rdr.GetValue(c);\r
- \r
- // display column meta data and data\r
- output = metadataValue + dataValue; \r
- Console.WriteLine(output);\r
- }\r
- nRows++;\r
- }\r
- Console.WriteLine(" Total Rows Retrieved: " + \r
+ else
+ dataValue =
+ ": " +
+ rdr.GetValue(c);
+
+ // display column meta data and data
+ output = metadataValue + dataValue;
+ Console.WriteLine(output);
+ }
+ nRows++;
+ }
+ Console.WriteLine(" Total Rows Retrieved: " +
nRows);
}
Console.WriteLine("IDataReader has a Null Reference.");
}
else {
- do {\r
- DataTable dt = rdr.GetSchemaTable();\r
- if(rdr.RecordsAffected != -1) {\r
- // Results for \r
- // SQL INSERT, UPDATE, DELETE Commands \r
- // have RecordsAffected >= 0\r
- Console.WriteLine("Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);\r
- }\r
- else if(dt == null)\r
- // Results for\r
- // SQL Commands not INSERT, UPDATE, nor DELETE\r
- // have RecordsAffected == -1\r
- // and GetSchemaTable() returns a null reference\r
- Console.WriteLine("Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);\r
- else {\r
- // Results for\r
- // SQL SELECT Queries\r
- // have RecordsAffected = -1\r
- // and GetSchemaTable() returns a reference to a DataTable\r
- Console.WriteLine("Result is from a SELECT SQL Query. Records Affected: " + rdr.RecordsAffected);\r
- \r
- results++;\r
- Console.WriteLine("Result Set " + results + "...");\r
-\r
- ReadResult(rdr, dt);\r
- }\r
-\r
- } while(rdr.NextResult());\r
- Console.WriteLine("Total Result sets: " + results);\r
- \r
+ do {
+ DataTable dt = rdr.GetSchemaTable();
+ if(rdr.RecordsAffected != -1) {
+ // Results for
+ // SQL INSERT, UPDATE, DELETE Commands
+ // have RecordsAffected >= 0
+ Console.WriteLine("Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
+ }
+ else if(dt == null)
+ // Results for
+ // SQL Commands not INSERT, UPDATE, nor DELETE
+ // have RecordsAffected == -1
+ // and GetSchemaTable() returns a null reference
+ Console.WriteLine("Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
+ else {
+ // Results for
+ // SQL SELECT Queries
+ // have RecordsAffected = -1
+ // and GetSchemaTable() returns a reference to a DataTable
+ Console.WriteLine("Result is from a SELECT SQL Query. Records Affected: " + rdr.RecordsAffected);
+
+ results++;
+ Console.WriteLine("Result Set " + results + "...");
+
+ ReadResult(rdr, dt);
+ }
+
+ } while(rdr.NextResult());
+ Console.WriteLine("Total Result sets: " + results);
+
rdr.Close();
}
}
Console.WriteLine("\t\tCall ExecuteReader with a SQL Command. (Is INSERT,UPDATE,DELETE).");
reader = SelectDataUsingInsertCommand(cnc);
ReadData(reader);
-\r
- // Call a Stored Procedure named Version()\r
- Console.WriteLine("\t\tCalling stored procedure sp_server_info()");\r
- object obj = CallStoredProcedure(cnc);\r
- Console.WriteLine("Result: " + obj);\r
-\r
- Console.WriteLine("Database Server Version: " + \r
- ((SqlConnection)cnc).ServerVersion);\r
-\r
+
+ // Call a Stored Procedure named Version()
+ Console.WriteLine("\t\tCalling stored procedure sp_server_info()");
+ object obj = CallStoredProcedure(cnc);
+ Console.WriteLine("Result: " + obj);
+
+ Console.WriteLine("Database Server Version: " +
+ ((SqlConnection)cnc).ServerVersion);
+
/* Clean up */
Console.WriteLine ("Clean up...");
Console.WriteLine ("\t\tDrop table...");
}
}
- [STAThread]\r
- static void Main(string[] args) {\r
- string connectionString = "";\r
- \r
- if(args.Length == 3 || args.Length == 4) {\r
- if(args.Length == 3) {\r
+ [STAThread]
+ static void Main(string[] args) {
+ string connectionString = "";
+
+ if(args.Length == 3 || args.Length == 4) {
+ if(args.Length == 3) {
connectionString = String.Format(
"Server={0};" +
"Database={1};" +
Console.WriteLine("Usage: mono SqlTest.exe sql_server database user_id password");
return;
}
-\r
- SqlConnection cnc = new SqlConnection ();\r
- cnc.ConnectionString = connectionString;\r
-\r
- cnc.Open();\r
+
+ SqlConnection cnc = new SqlConnection ();
+ cnc.ConnectionString = connectionString;
+
+ cnc.Open();
DoSqlTest(cnc);
cnc.Close();
}
--- /dev/null
+/DBDataPermissionAttributeTest.cs -crlf
--- /dev/null
+/OdbcDataReaderTest.cs -crlf
+/OdbcPermissionAttributeTest.cs -crlf
--- /dev/null
+/OleDbPermissionAttributeTest.cs -crlf
+/OleDbPermissionTest.cs -crlf
--- /dev/null
+/SqlClientPermissionAttributeTest.cs -crlf
+/SqlClientPermissionTest.cs -crlf
+/SqlConnectionTest.cs -crlf
--- /dev/null
+/SqlDateTimeTest.cs -crlf
+/SqlGuidTest.cs -crlf
--- /dev/null
+/Makefile -crlf
--- /dev/null
+/RowNotInTableException_Generate.cs -crlf
-// Authors:
-// Rafael Mizrahi <rafim@mainsoft.com>
-// Erez Lotan <erezl@mainsoft.com>
-// Oren Gurfinkel <oreng@mainsoft.com>
-// Ofer Borstein
-//
-// Copyright (c) 2004 Mainsoft Co.
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+// Authors:\r
+// Rafael Mizrahi <rafim@mainsoft.com>\r
+// Erez Lotan <erezl@mainsoft.com>\r
+// Oren Gurfinkel <oreng@mainsoft.com>\r
+// Ofer Borstein\r
+// \r
+// Copyright (c) 2004 Mainsoft Co.\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 NUnit.Framework;
-
-
-using System;
-using System.Data;
-
-using GHTUtils;
+using NUnit.Framework;\r
+\r
+\r
+using System;\r
+using System.Data;\r
+\r
+using GHTUtils;\r
using GHTUtils.Base;\r
\r
-namespace tests.system_data_dll.System_Data
+namespace tests.system_data_dll.System_Data\r
{\r
[TestFixture] public class RowNotInTableException_Generate : GHTBase\r
{\r
--- /dev/null
+/DataColumnCollectionTest2.cs -crlf
+/DataRelationTest.cs -crlf
+/DataSetReadXmlTest.cs -crlf
+/MissingPrimaryKeyExceptionTest.cs -crlf
+/TypedDataSet.xml -crlf
+/store.xsd -crlf
+/store2.xsd -crlf
+/store3.xsd -crlf
+/store4.xsd -crlf
--- /dev/null
+/Items.xsd -crlf
+/test001.xsd -crlf
+/test002.xsd -crlf
+/test003.xsd -crlf
+/test004.xsd -crlf
+/test005.xsd -crlf
+/test006.xsd -crlf
+/test007.xsd -crlf
+/test008.xsd -crlf
+/test009.xsd -crlf
+/test010.xsd -crlf
+/test011.xsd -crlf
+/test012.xsd -crlf
+/test013.xsd -crlf
+/test014.xsd -crlf
+/test103.xsd -crlf
--- /dev/null
+/2books.xml -crlf
+/XmlDataDocumentTest2.cs -crlf
+/region.xml -crlf
+/region.xsd -crlf
+/store.xsd -crlf
//\r
// (C) 2002 Daniel Morgan\r
//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// Copyright (C) 2004 Novell, Inc (http://www.novell.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 System.Data;\r
String connectionString = null;\r
String sql = null;\r
\r
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
+ connectionString = \r
+ "host=localhost;" +\r
+ "dbname=test;" +\r
+ "user=postgres";\r
\r
try {\r
string maxStrValue;\r
Console.WriteLine(e.ToString());\r
}\r
finally {\r
- if(con != null)
- if(con.State == ConnectionState.Open)
+ if(con != null)\r
+ if(con.State == ConnectionState.Open)\r
con.Close();\r
}\r
}\r
// -lib:C:/cygwin/home/MyHome/mono/install/lib -r System.Data.dll \\r
// -r Mono.Data.SybaseClient.dll -r Mono.Data.TdsClient.dll\r
//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// Copyright (C) 2004 Novell, Inc (http://www.novell.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
//#define IncludeSybaseAndTdsClient\r
\r
//\r
// (C) 2002 Daniel Morgan\r
//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// Copyright (C) 2004 Novell, Inc (http://www.novell.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 System.Data;\r
Console.WriteLine("ExecuteReader...");\r
rdr = cmd.ExecuteReader(behavior);\r
\r
- if(rdr == null) {
-
- Console.WriteLine("IDataReader has a Null Reference.");
- }
- else {
+ if(rdr == null) {\r
+ \r
+ Console.WriteLine("IDataReader has a Null Reference.");\r
+ }\r
+ else {\r
\r
do {\r
// get the DataTable that holds\r
[STAThread]\r
static void Main(string[] args) {\r
String connectionString = null;\r
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
+ connectionString = \r
+ "host=localhost;" +\r
+ "dbname=test;" +\r
+ "user=postgres";\r
\r
PgSqlConnection con;\r
con = new PgSqlConnection(connectionString);\r
//\r
// (c)copyright 2002 Daniel Morgan\r
//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// Copyright (C) 2004 Novell, Inc (http://www.novell.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 System.Collections;\r
Console.WriteLine("** Start Test...");\r
\r
String connectionString = null;\r
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
+ connectionString = \r
+ "host=localhost;" +\r
+ "dbname=test;" +\r
+ "user=postgres";\r
\r
PgSqlConnection con;\r
Console.WriteLine("** Creating connection...");\r
--- /dev/null
+/System.Design.xml -crlf
--- /dev/null
+/CompositeControlDesigner.cs -crlf
--- /dev/null
+/ISelectionUIHandler.cs -crlf
--- /dev/null
+/App.config -crlf
+/ChangeLog -crlf
+/Secure.config -crlf
+/makefile.build -crlf
+/net_1_1_java_System.DirectoryServices.dll.exclude.sources -crlf
--- /dev/null
+/SearchScope.cs -crlf
+/SortDirection.cs -crlf
cons.ServerTimeLimit = (int)ServerTimeLimit.TotalSeconds;
}
- int connScope = LdapConnection.SCOPE_SUB;\r
- switch (_SearchScope)\r
- {\r
- case SearchScope.Base:\r
- connScope = LdapConnection.SCOPE_BASE;\r
- break;\r
-\r
- case SearchScope.OneLevel:\r
- connScope = LdapConnection.SCOPE_ONE;\r
- break;\r
-\r
- case SearchScope.Subtree:\r
- connScope = LdapConnection.SCOPE_SUB;\r
- break;\r
-\r
- default:\r
- connScope = LdapConnection.SCOPE_SUB;\r
- break;\r
+ int connScope = LdapConnection.SCOPE_SUB;
+ switch (_SearchScope)
+ {
+ case SearchScope.Base:
+ connScope = LdapConnection.SCOPE_BASE;
+ break;
+
+ case SearchScope.OneLevel:
+ connScope = LdapConnection.SCOPE_ONE;
+ break;
+
+ case SearchScope.Subtree:
+ connScope = LdapConnection.SCOPE_SUB;
+ break;
+
+ default:
+ connScope = LdapConnection.SCOPE_SUB;
+ break;
}
LdapSearchResults lsc=_conn.Search( SearchRoot.Fdn,
connScope,
[MonoTODO]
protected override void Dispose(bool disposing)
{
- if (disposing) {\r
- if(_conn != null && _conn.Connected) {\r
- _conn.Disconnect();\r
- }\r
- }\r
+ if (disposing) {
+ if(_conn != null && _conn.Connected) {
+ _conn.Disconnect();
+ }
+ }
base.Dispose(disposing);
}
--- /dev/null
+/README.txt -crlf
+/krb5.conf.example -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/DirectoryServicesDirectoryEntryTest.cs -crlf
+/DirectoryServicesDirectorySearcherTest.cs -crlf
+/DirectoryServicesPermissionAttributeTest.cs -crlf
+/DirectoryServicesPermissionTest.cs -crlf
+/DirectoryServicesSearchResultTest.cs -crlf
+/TestConfiguration.cs -crlf
+/example.app.config -crlf
[Test]\r
public void IsSubset_Null ()\r
{\r
- DirectoryServicesPermission dsp = new DirectoryServicesPermission (PermissionState.None);
+ DirectoryServicesPermission dsp = new DirectoryServicesPermission (PermissionState.None);\r
#if NET_2_0\r
- Assert.IsTrue (dsp.IsSubsetOf (null), "null");
+ Assert.IsTrue (dsp.IsSubsetOf (null), "null");\r
#else\r
- Assert.IsFalse (dsp.IsSubsetOf (null), "null");
-#endif
+ Assert.IsFalse (dsp.IsSubsetOf (null), "null");\r
+#endif\r
}\r
\r
[Test]\r
--- /dev/null
+/ColorEditor.cs -crlf
--- /dev/null
+/makefile.build -crlf
--- /dev/null
+/System.Drawing.xml -crlf
--- /dev/null
+/ResolutionConfiguration.cs -crlf
+/ResolutionConfigurationCollection.cs -crlf
+/ResolutionConfigurationHandler.cs -crlf
PointF[] polygon_pnts = {new PointF(150.0F, 150.0F),
new PointF(200.0F, 125.0F), new PointF(300.0F, 105.0F),
new PointF(350.0F, 150.0F), new PointF(400.0F, 200.0F),
- new PointF(450.0F, 300.0F), new PointF(350.0F, 350.0F) };\r
+ new PointF(450.0F, 300.0F), new PointF(350.0F, 350.0F) };
- // Default Display\r
+ // Default Display
gr.DrawRectangle (Pens.Red, rect);
gr.DrawString ("Unit " + gr.PageUnit, new Font ("Arial", 10), Brushes.Red, 50, 50);
gr.DrawArc (Pens.Red, 30, 30, 60, 60, 0, 180);
- gr.DrawPolygon (Pens.Red, polygon_pnts);\r
+ gr.DrawPolygon (Pens.Red, polygon_pnts);
- // Point\r
- gr.PageUnit = GraphicsUnit.Point;\r
+ // Point
+ gr.PageUnit = GraphicsUnit.Point;
gr.DrawRectangle (Pens.Yellow, rect);
gr.DrawString ("Unit " + gr.PageUnit, new Font ("Arial", 10), Brushes.Yellow, 50, 50);
gr.DrawArc (Pens.Yellow, 30, 30, 60, 60, 0, 180);
gr.DrawPolygon (Pens.Yellow, polygon_pnts);
- // Document\r
- gr.PageUnit = GraphicsUnit.Document;\r
+ // Document
+ gr.PageUnit = GraphicsUnit.Document;
gr.DrawRectangle (Pens.Pink, rect);
gr.DrawString ("Unit " + gr.PageUnit, new Font ("Arial", 10), Brushes.Pink, 50, 50);
gr.DrawArc (Pens.Pink, 30, 30, 60, 60, 0, 180);
gr.DrawPolygon (Pens.Pink, polygon_pnts);
- // Inc\r
- gr.PageUnit = GraphicsUnit.Inch;\r
+ // Inc
+ gr.PageUnit = GraphicsUnit.Inch;
gr.DrawRectangle (Pens.Blue, 3f, 1f, 1f, 1f);
gr.DrawString ("Unit " + gr.PageUnit, new Font ("Arial", 10), Brushes.Blue, 0.7f, 0.7f);
gr.DrawArc (Pens.Blue, 3f, 3f, 1f, 1f, 0, 180);
-\r
+
bmp.Save ("units1.bmp");
bmp.Dispose ();
gr.Dispose ();
bmp = new Bitmap (600, 600);
gr = Graphics.FromImage (bmp);
- GraphicsPath graphPath = new GraphicsPath();\r
+ GraphicsPath graphPath = new GraphicsPath();
graphPath.AddEllipse (0, 80, 100, 200);
- // Default Display\r
+ // Default Display
gr.DrawBezier (Pens.Red, new Point (10, 10), new Point (20, 10),
new Point (35, 50), new Point (50, 10));
- gr.DrawEllipse (Pens.Red, 10, 50, 30, 50);\r
+ gr.DrawEllipse (Pens.Red, 10, 50, 30, 50);
gr.DrawPath (Pens.Red, graphPath);
gr.DrawPie (Pens.Red, 150, 20, 60, 60, 100, 140);
- gr.DrawCurve (Pens.Red, polygon_pnts, 2, 4, 0.5f);\r
+ gr.DrawCurve (Pens.Red, polygon_pnts, 2, 4, 0.5f);
// Point
- gr.PageUnit = GraphicsUnit.Display;\r
+ gr.PageUnit = GraphicsUnit.Display;
gr.PageUnit = GraphicsUnit.Point;
gr.DrawBezier (Pens.Pink, new Point (10, 10), new Point (20, 10),
new Point (35, 50), new Point (50, 10));
gr.DrawPath (Pens.Pink, graphPath);
gr.DrawPie (Pens.Pink, 150, 20, 60, 60, 100, 140);
- // Document\r
+ // Document
gr.PageUnit = GraphicsUnit.Document;
gr.DrawBezier (Pens.Yellow, new Point (10, 10), new Point (20, 10),
new Point (35, 50), new Point (50, 10));
gr.DrawPie (Pens.Yellow, 150, 20, 60, 60, 100, 140);
gr.DrawCurve (Pens.Yellow, polygon_pnts, 2, 4, 0.5f);
- // Inc\r
- gr.PageUnit = GraphicsUnit.Inch;\r
+ // Inc
+ gr.PageUnit = GraphicsUnit.Inch;
gr.DrawBezier (Pens.Blue, new Point (10, 10), new Point (20, 10),
new Point (35, 50), new Point (50, 10));
x = 0;
if (xor) {
- rect1 = new Rectangle (20+x, 330+300, 40, 50);\r
- rect2 = new Rectangle (40+x, 360+300, 20, 20);\r
+ rect1 = new Rectangle (20+x, 330+300, 40, 50);
+ rect2 = new Rectangle (40+x, 360+300, 20, 20);
dc.DrawRectangle (Pens.Red, rect1);
dc.DrawRectangle (Pens.Green, rect2);
rgn1 = new Region (rect1);
--- /dev/null
+/ToolboxItem.cs -crlf
--- /dev/null
+/ExtendedGeneralPath.jvm.cs -crlf
+/GeneralPathIterator.jvm.cs -crlf
-//
-// System.Drawing.Drawing2D.ExtendedGeneralPath.cs
-//
-// Author:
-// Bors Kirzner <boris@mainsoft.com>
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//\r
+// System.Drawing.Drawing2D.ExtendedGeneralPath.cs\r
+//\r
+// Author:\r
+// Bors Kirzner <boris@mainsoft.com> \r
+//\r
+// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
using System;\r
//
using System;
-namespace System.Drawing.Drawing2D \r
+namespace System.Drawing.Drawing2D
{
/// <summary>
/// Summary description for GraphicsContainer.
/// </summary>
- public sealed class GraphicsContainer : MarshalByRefObject\r
+ public sealed class GraphicsContainer : MarshalByRefObject
{
readonly GraphicsState _stateObject;
#region Properites
- public int Count \r
+ public int Count
{
get { return _path.NativeObject.PointCount; }
}
using geom = java.awt.geom;
using awt = java.awt;
-namespace System.Drawing.Drawing2D \r
+namespace System.Drawing.Drawing2D
{
/// <summary>
/// Summary description for GraphicsState.
lgb.SetBlendTriangularShape(0.5f);
g.FillPath( lgb, pt );
}
- private PointF GetVertical(PointF c, PointF p1, PointF p2) {\r
- if (p1.X == p2.X)\r
- return new PointF(p1.X, c.Y);\r
- if (p1.Y == p2.Y)\r
- return new PointF(c.X, p2.Y);\r
-\r
- float a = (float)(p2.Y - p1.Y) / (p2.X - p1.X);\r
- float av = - 1 / a;\r
-\r
- float b1 = p1.Y - a * p1.X;\r
- float b2 = c.Y - av * c.X;\r
-\r
- float ox = (b1 - b2) / (av - a);\r
- float oy = av * ox + b2;\r
-\r
- return new PointF(ox, oy);\r
- }\r
-\r
- #endregion\r
-\r
- #region ctors\r
+ private PointF GetVertical(PointF c, PointF p1, PointF p2) {
+ if (p1.X == p2.X)
+ return new PointF(p1.X, c.Y);
+ if (p1.Y == p2.Y)
+ return new PointF(c.X, p2.Y);
+
+ float a = (float)(p2.Y - p1.Y) / (p2.X - p1.X);
+ float av = - 1 / a;
+
+ float b1 = p1.Y - a * p1.X;
+ float b2 = c.Y - av * c.X;
+
+ float ox = (b1 - b2) / (av - a);
+ float oy = av * ox + b2;
+
+ return new PointF(ox, oy);
+ }
+
+ #endregion
+
+ #region ctors
public PathGradientBrush (GraphicsPath path) {
Initialize( path, WrapMode.Clamp, true, true );
--- /dev/null
+/ImageAttributes.jvm.cs -crlf
+/ImageCodec.jvm.cs -crlf
-
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-
-namespace System.Drawing.Imaging
-{
- /// <summary>
- /// Summary description for ImageAttributes.
+\r
+using System;\r
+using System.Drawing;\r
+using System.Drawing.Drawing2D;\r
+\r
+namespace System.Drawing.Imaging\r
+{\r
+ /// <summary>\r
+ /// Summary description for ImageAttributes.\r
/// </summary>\r
/// \r
[MonoTODO]\r
public Color col;\r
public bool bClamp;\r
public ColorPalette clrPalette;\r
- public bool bNoOp;
- }
+ public bool bNoOp;\r
+ }\r
}
\ No newline at end of file
int i=0;
foreach (ImageCodecInfo codec in oldInfo.Values) {
newInfo [i++] = (ImageCodecInfo) codec.MemberwiseClone ();
- }\r
+ }
return newInfo;
}
--- /dev/null
+/Duplex.cs -crlf
+/PaperKind.cs -crlf
+/PaperSourceKind.cs -crlf
+/PrintPageEventHandler.cs -crlf
+/PrintRange.cs -crlf
+/PrinterResolution.cs -crlf
+/PrinterResolutionKind.cs -crlf
+/PrinterUnit.cs -crlf
+/PrintingPermissionLevel.cs -crlf
+/QueryPageSettingsEventArgs.cs -crlf
using System.Globalization;
using System.Text.RegularExpressions;
using System.ComponentModel.Design.Serialization;
-using System.Reflection;\r
+using System.Reflection;
namespace System.Drawing.Printing {
/// <summary>
// (C) 2002 Ximian, Inc. http://www.ximian.com\r
// Author: Dennis Hayes (dennish@raytek.com)\r
//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
+\r
+//\r
+// Copyright (C) 2004 Novell, Inc (http://www.novell.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
\r
namespace System.Drawing.Printing \r
{\r
-#if NET_2_0
- [Serializable]
+#if NET_2_0\r
+ [Serializable]\r
#endif\r
- public enum PaperKind
+ public enum PaperKind\r
{\r
A2 = 66,\r
A3 = 8,\r
APlus = 57,\r
B4 = 12,\r
B4Envelope = 33,\r
- B4JisRotated = 79,
- B5 = 13,
+ B4JisRotated = 79,\r
+ B5 = 13,\r
B5Envelope = 34,\r
B5Extra = 65,\r
B5JisRotated = 80,\r
C3Envelope = 29,\r
C4Envelope = 30,\r
C5Envelope = 28,\r
- C65Envelope = 32,
+ C65Envelope = 32,\r
C6Envelope = 31,\r
CSheet = 24,\r
Custom = 0,\r
GermanLegalFanfold = 41,\r
GermanStandardFanfold = 40,\r
InviteEnvelope = 47,\r
- IsoB4 = 42,
+ IsoB4 = 42,\r
ItalyEnvelope = 36,\r
JapaneseDoublePostcard = 69,\r
JapaneseDoublePostcardRotated = 82,\r
kind = (PaperSourceKind)value;
}
}
-#endif\r
+#endif
internal bool IsDefault {
get { return is_default;}
PrintToFile = 0,
PrintToPreview = 1,
PrintToPrinter = 2
- }\r
+ }
}
public virtual bool IsPreview {
get { return false; }
}
-#else\r
+#else
public PrintController ()
{
}
}
internal static GlobalPrintingServices GlobalService {
- get {\r
- if (global_printing_services == null) {\r
- if (is_unix)\r
- global_printing_services = new GlobalPrintingServicesUnix ();\r
- else\r
- global_printing_services = new GlobalPrintingServicesWin32 ();\r
- }\r
-\r
- return global_printing_services;\r
+ get {
+ if (global_printing_services == null) {
+ if (is_unix)
+ global_printing_services = new GlobalPrintingServicesUnix ();
+ else
+ global_printing_services = new GlobalPrintingServicesWin32 ();
+ }
+
+ return global_printing_services;
}
}
--- /dev/null
+/InstalledFontCollection.jvm.cs -crlf
+/PrivateFontCollection.jvm.cs -crlf
+/TextLineIterator.jvm.cs -crlf
--- /dev/null
+/AdvancedStroke.jvm.cs -crlf
+/PlainImage.jvm.cs -crlf
+/PlainImageCollection.jvm.cs -crlf
+/StrokeFactory.jvm.cs -crlf
BrushMultiplyTransform(matrix, MatrixOrder.Prepend);
}
protected internal void BrushMultiplyTransform (Matrix matrix, MatrixOrder order) {
- if (matrix == null)\r
- throw new ArgumentNullException("matrix");\r
+ if (matrix == null)
+ throw new ArgumentNullException("matrix");
_brushTransform.Multiply(matrix, order);
}
try {
TextLineIterator iter = new TextLineIterator(s, font, NativeObject.getFontRenderContext(), format, width, height);
NativeObject.transform(iter.Transform);
- for (LineLayout layout = iter.NextLine(); layout != null; layout = iter.NextLine()) {\r
+ for (LineLayout layout = iter.NextLine(); layout != null; layout = iter.NextLine()) {
layout.Draw (NativeObject, x * UnitConversion [(int) PageUnit], y * UnitConversion [(int) PageUnit]);
}
}
#region flags enum
[Flags]
- protected enum ImageFlags {\r
- ImageFlagsNone = 0,\r
- ImageFlagsScalable = 0x0001,\r
- ImageFlagsHasAlpha = 0x0002,\r
- ImageFlagsHasTranslucent = 0x0004,\r
- ImageFlagsPartiallyScalable = 0x0008,\r
- ImageFlagsColorSpaceRGB = 0x0010,\r
- ImageFlagsColorSpaceCMYK = 0x0020,\r
- ImageFlagsColorSpaceGRAY = 0x0040,\r
- ImageFlagsColorSpaceYCBCR = 0x0080,\r
- ImageFlagsColorSpaceYCCK = 0x0100,\r
- ImageFlagsHasRealDPI = 0x1000,\r
- ImageFlagsHasRealPixelSize = 0x2000,\r
- ImageFlagsReadOnly = 0x00010000,\r
- ImageFlagsCaching = 0x00020000\r
- }\r
- #endregion\r
+ protected enum ImageFlags {
+ ImageFlagsNone = 0,
+ ImageFlagsScalable = 0x0001,
+ ImageFlagsHasAlpha = 0x0002,
+ ImageFlagsHasTranslucent = 0x0004,
+ ImageFlagsPartiallyScalable = 0x0008,
+ ImageFlagsColorSpaceRGB = 0x0010,
+ ImageFlagsColorSpaceCMYK = 0x0020,
+ ImageFlagsColorSpaceGRAY = 0x0040,
+ ImageFlagsColorSpaceYCBCR = 0x0080,
+ ImageFlagsColorSpaceYCCK = 0x0100,
+ ImageFlagsHasRealDPI = 0x1000,
+ ImageFlagsHasRealPixelSize = 0x2000,
+ ImageFlagsReadOnly = 0x00010000,
+ ImageFlagsCaching = 0x00020000
+ }
+ #endregion
#region Constructor
public void Dispose () {
default:
throw new ArgumentOutOfRangeException();
}
- image.AffineTransformOp op = new image.AffineTransformOp(tx, image.AffineTransformOp.TYPE_NEAREST_NEIGHBOR);\r
- CurrentImage.NativeImage = op.filter((BufferedImage)CurrentImage.NativeImage, null);\r
+ image.AffineTransformOp op = new image.AffineTransformOp(tx, image.AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
+ CurrentImage.NativeImage = op.filter((BufferedImage)CurrentImage.NativeImage, null);
}
#endregion
internal bool isModifiable = true;
Color _color;
- protected override java.awt.Paint NativeObject {\r
- get {\r
- return _color.NativeObject;\r
- }\r
- }\r
+ protected override java.awt.Paint NativeObject {
+ get {
+ return _color.NativeObject;
+ }
+ }
public SolidBrush (Color color)
{
protected override void Dispose (bool disposing)
{
- if (!isModifiable && disposing)\r
- throw new ArgumentException ("This SolidBrush object can't be modified.");\r
- }\r
+ if (!isModifiable && disposing)
+ throw new ArgumentException ("This SolidBrush object can't be modified.");
+ }
}
}
private StringTrimming _trimming;
private float _firstTabOffset;
- private float [] _tabStops;\r
-\r
+ private float [] _tabStops;
+
private bool _genericTypeographic = false;
#region Constructors
StringFormatFlags.LineLimit |
StringFormatFlags.NoClip,
0 );
- genericTypographic.Trimming = StringTrimming.None;\r
+ genericTypographic.Trimming = StringTrimming.None;
genericTypographic._genericTypeographic = true;
return genericTypographic;
}
#endregion
#region internal accessors
- internal bool NoWrap {\r
- get {\r
- return (FormatFlags & StringFormatFlags.NoWrap) != 0;\r
- }\r
- }\r
-\r
- internal bool IsVertical {\r
- get {\r
- return (FormatFlags & StringFormatFlags.DirectionVertical) != 0;\r
- }\r
- }\r
-\r
- internal bool MeasureTrailingSpaces {\r
- get {\r
- return (FormatFlags & StringFormatFlags.MeasureTrailingSpaces) != 0;\r
- }\r
- }\r
-\r
- internal bool LineLimit {\r
- get {\r
- return (FormatFlags & StringFormatFlags.LineLimit) != 0;\r
- }\r
- }\r
-\r
- internal bool NoClip {\r
- get {\r
- return (FormatFlags & StringFormatFlags.NoClip) != 0;\r
- }\r
+ internal bool NoWrap {
+ get {
+ return (FormatFlags & StringFormatFlags.NoWrap) != 0;
+ }
+ }
+
+ internal bool IsVertical {
+ get {
+ return (FormatFlags & StringFormatFlags.DirectionVertical) != 0;
+ }
}
- internal bool IsRightToLeft {\r
- get {\r
- return (FormatFlags & StringFormatFlags.DirectionRightToLeft) != 0;\r
- }\r
+ internal bool MeasureTrailingSpaces {
+ get {
+ return (FormatFlags & StringFormatFlags.MeasureTrailingSpaces) != 0;
+ }
+ }
+
+ internal bool LineLimit {
+ get {
+ return (FormatFlags & StringFormatFlags.LineLimit) != 0;
+ }
+ }
+
+ internal bool NoClip {
+ get {
+ return (FormatFlags & StringFormatFlags.NoClip) != 0;
+ }
+ }
+
+ internal bool IsRightToLeft {
+ get {
+ return (FormatFlags & StringFormatFlags.DirectionRightToLeft) != 0;
+ }
}
internal CharacterRange [] CharRanges {
get {
return _charRanges;
}
- }\r
-\r
- internal bool IsGenericTypographic\r
- {\r
- get {\r
- return _genericTypeographic;\r
- }\r
+ }
+
+ internal bool IsGenericTypographic
+ {
+ get {
+ return _genericTypeographic;
+ }
}
#endregion
public sealed class SystemColors
{
- private SystemColors (){}\r
-\r
- static Color [] SystemColorsCache {\r
- get {\r
- return KnownColors.Values;\r
- }\r
+ private SystemColors (){}
+
+ static Color [] SystemColorsCache {
+ get {
+ return KnownColors.Values;
+ }
}
static public Color ActiveBorder
--- /dev/null
+/AssemblyInfo.cs -crlf
+/DrawingTest.cs -crlf
+/PDComparer.cs -crlf
--- /dev/null
+/Exocortex.DSP.xml -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/Complex.cs -crlf
+/ComplexArray.cs -crlf
+/ComplexF.cs -crlf
+/ComplexMath.cs -crlf
+/ComplexStats.cs -crlf
+/Fourier.cs -crlf
+/FourierDirection.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/Bitmap.cs -crlf
+/Brush.cs -crlf
+/Brushes.cs -crlf
+/ChangeLog -crlf
+/Colors.cs -crlf
+/Enums.cs -crlf
+/Graphics.cs -crlf
+/GraphicsPath.cs -crlf
+/GraphicsPathIterator.cs -crlf
+/Image.cs -crlf
+/Pen.cs -crlf
+/Pens.cs -crlf
+/Region.cs -crlf
}\r
\r
static string getInFile (string file) {\r
- string sRslt;
-
- sRslt = Path.GetFullPath (file);
-
- if (! File.Exists (file))
- sRslt = Path.Combine (
- Path.Combine ("..", ".."),
- file);
-
- return sRslt;
+ string sRslt; \r
+ \r
+ sRslt = Path.GetFullPath (file);\r
+ \r
+ if (! File.Exists (file))\r
+ sRslt = Path.Combine (\r
+ Path.Combine ("..", ".."),\r
+ file);\r
+\r
+ return sRslt;\r
}\r
\r
[Test]\r
--- /dev/null
+/TestColorMatrix.cs -crlf
+/tests-ms.sh -crlf
}
}
- [Test]\r
+ [Test]
#if TARGET_JVM
[Category("NotWorking")]
-#endif\r
+#endif
public void Save_24bppRgb ()
{
Save (PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb, true);
}
- [Test]\r
+ [Test]
#if TARGET_JVM
[Category("NotWorking")]
-#endif\r
+#endif
public void Save_32bppRgb ()
{
Save (PixelFormat.Format32bppRgb, PixelFormat.Format32bppRgb, true);
}
- [Test]\r
+ [Test]
#if TARGET_JVM
[Category("NotWorking")]
-#endif\r
+#endif
public void Save_32bppArgb ()
{
Save (PixelFormat.Format32bppArgb, PixelFormat.Format32bppRgb, true);
}
- [Test]\r
+ [Test]
#if TARGET_JVM
[Category("NotWorking")]
-#endif\r
+#endif
public void Save_32bppPArgb ()
{
Save (PixelFormat.Format32bppPArgb, PixelFormat.Format32bppRgb, true);
Assert.AreEqual (0, cm[4,3], "4,3");\r
Assert.AreEqual (0, cm[4,4], "4,4");\r
}\r
-
+\r
[Test]\r
public void IndividualProperties ()\r
{\r
}
}
- [Test]\r
+ [Test]
#if TARGET_JVM
[Category("NotWorking")]
-#endif\r
+#endif
public void Save_24bppRgb ()
{
Save (PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb);
}
- [Test]\r
+ [Test]
#if TARGET_JVM
[Category("NotWorking")]
-#endif\r
+#endif
public void Save_32bppRgb ()
{
Save (PixelFormat.Format32bppRgb, PixelFormat.Format24bppRgb);
}
- [Test]\r
+ [Test]
#if TARGET_JVM
[Category("NotWorking")]
-#endif\r
+#endif
public void Save_32bppArgb ()
{
Save (PixelFormat.Format32bppArgb, PixelFormat.Format24bppRgb);
}
- [Test]\r
+ [Test]
#if TARGET_JVM
[Category("NotWorking")]
-#endif\r
+#endif
public void Save_32bppPArgb ()
{
Save (PixelFormat.Format32bppPArgb, PixelFormat.Format24bppRgb);
--- /dev/null
+/tests-ms.sh -crlf
--- /dev/null
+/Clerk.cs -crlf
+/ClerkInfo.cs -crlf
+/ClerkMonitor.cs -crlf
+/CompensatorOptions.cs -crlf
+/LogRecord.cs -crlf
+/LogRecordFlags.cs -crlf
+/TransactionState.cs -crlf
--- /dev/null
+/AccessChecksLevelOption.cs -crlf
+/ActivationOption.cs -crlf
+/Activity.cs -crlf
+/ApplicationQueuingAttribute.cs -crlf
+/AutoCompleteAttribute.cs -crlf
+/BOID.cs -crlf
+/BYOT.cs -crlf
+/BindingOption.cs -crlf
+/COMTIIntrinsicsAttribute.cs -crlf
+/ComponentAccessControlAttribute.cs -crlf
+/ConstructionEnabledAttribute.cs -crlf
+/ContextUtil.cs -crlf
+/DescriptionAttribute.cs -crlf
+/EventClassAttribute.cs -crlf
+/EventTrackingEnabledAttribute.cs -crlf
+/ExceptionClassAttribute.cs -crlf
+/IAsyncErrorNotify.cs -crlf
+/IISIntrinsicsAttribute.cs -crlf
+/IPlaybackControl.cs -crlf
+/IProcessInitControl.cs -crlf
+/IRemoteDispatch.cs -crlf
+/ISecurityCallContext.cs -crlf
+/ISecurityCallersColl.cs -crlf
+/ISecurityIdentityColl.cs -crlf
+/IServiceCall.cs -crlf
+/IServicedComponentInfo.cs -crlf
+/ISharedProperty.cs -crlf
+/ISharedPropertyGroup.cs -crlf
+/ITransaction.cs -crlf
+/InheritanceOption.cs -crlf
+/InterfaceQueuingAttribute.cs -crlf
+/JustInTimeActivationAttribute.cs -crlf
+/LoadBalancingSupportedAttribute.cs -crlf
+/MustRunInClientContextAttribute.cs -crlf
+/ObjectPoolingAttribute.cs -crlf
+/PartitionOption.cs -crlf
+/PrivateComponentAttribute.cs -crlf
+/RegistrationConfig.cs -crlf
+/RegistrationErrorInfo.cs -crlf
+/RegistrationException.cs -crlf
+/ResourcePool.cs -crlf
+/SecureMethodAttribute.cs -crlf
+/SecurityCallContext.cs -crlf
+/SecurityCallers.cs -crlf
+/SecurityIdentity.cs -crlf
+/SecurityRoleAttribute.cs -crlf
+/ServiceConfig.cs -crlf
+/ServiceDomain.cs -crlf
+/ServicedComponent.cs -crlf
+/ServicedComponentException.cs -crlf
+/SharedProperty.cs -crlf
+/SharedPropertyGroup.cs -crlf
+/SharedPropertyGroupManager.cs -crlf
+/SxsOption.cs -crlf
+/SynchronizationAttribute.cs -crlf
+/ThreadPoolOption.cs -crlf
+/TransactionAttribute.cs -crlf
+/TransactionStatus.cs -crlf
+/XACTTRANSINFO.cs -crlf
--- /dev/null
+/AudienceUriMode.cs -crlf
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * SecurityTokenRequirement.cs : return false if property value is
+ null in the internal dictionary (unlike Dictionary<K,V>).
+
2007-11-27 Atsushi Enomoto <atsushi@ximian.com>
* SecurityTokenRequirement.cs : fill out parameter properly (gmcs
value = (TValue) tmp;
else
throw new ArgumentException (String.Format ("The value of property '{0}' is of type '{1}', while '{2}' is expected.", property, tmp.GetType (), typeof (TValue)));
- return true;
+ return value != null;
}
}
}
+2010-07-26 Atsushi Enomoto <atsushi@ximian.com>
+
+ * SamlSubject.cs : add missing .ctor().
+
2007-11-27 Atsushi Enomoto <atsushi@ximian.com>
* SecurityKeyIdentifier.cs : fill 'out' parameter properly (gmcs
string name_format, name_qualifier, name;
SecurityKey crypto;
SecurityKeyIdentifier key_identifier;
- List<string> confirmation_methods = new List<string> ();
+ List<string> confirmation_methods;
string confirmation_data;
public SamlSubject ()
}
public SamlSubject (string nameFormat, string nameQualifier, string name)
+ : this (nameFormat, nameQualifier, name, new string [0], null, null)
+ {
+ }
+
+ public SamlSubject (string nameFormat, string nameQualifier, string name, IEnumerable<string> confirmations, string confirmationData, SecurityKeyIdentifier securityKeyIdentifier)
{
if (name == null || name.Length == 0)
throw new ArgumentException ("non-zero length string must be specified for name of SAML Subject.");
name_format = nameFormat;
name_qualifier = nameQualifier;
this.name = name;
+
+ confirmation_methods = new List<string> (confirmations);
+ confirmation_data = confirmationData;
+ key_identifier = securityKeyIdentifier;
}
public bool IsReadOnly {
--- /dev/null
+/InstrumentationClassAttribute.cs -crlf
+/ManagedNameAttribute.cs -crlf
//
namespace System.Management.Instrumentation
-{\r
- [InstrumentationClass (InstrumentationType.Instance)]\r
+{
+ [InstrumentationClass (InstrumentationType.Instance)]
public abstract class Instance : IInstance {
- bool published;\r
-\r
- [MonoTODO]\r
- protected Instance ()\r
- {\r
- }\r
-\r
+ bool published;
+
+ [MonoTODO]
+ protected Instance ()
+ {
+ }
+
[IgnoreMember]
public bool Published {
get { return published; }
[MonoTODO]
public InstrumentedAttribute()
{
- }\r
-\r
- [MonoTODO]\r
- public InstrumentedAttribute (string namespaceName) : this(namespaceName, null)\r
- {\r
- }\r
-\r
- [MonoTODO]\r
- public InstrumentedAttribute (string namespaceName, string securityDescriptor)\r
- {\r
- }\r
-\r
+ }
+
+ [MonoTODO]
+ public InstrumentedAttribute (string namespaceName) : this(namespaceName, null)
+ {
+ }
+
+ [MonoTODO]
+ public InstrumentedAttribute (string namespaceName, string securityDescriptor)
+ {
+ }
+
public string NamespaceName {
[MonoTODO]
get { throw new NotImplementedException(); }
--- /dev/null
+/AccessControlEntry.cs -crlf
+/AccessControlEntryType.cs -crlf
+/AccessControlList.cs -crlf
+/AcknowledgeTypes.cs -crlf
+/Acknowledgment.cs -crlf
+/ActiveXMessageFormatter.cs -crlf
+/CryptographicProviderType.cs -crlf
+/DefaultPropertiesToSend.cs -crlf
+/EncryptionAlgorithm.cs -crlf
+/EncryptionRequired.cs -crlf
+/GenericAccessRights.cs -crlf
+/HashAlgorithm.cs -crlf
+/Message.resx -crlf
+/MessagePriority.cs -crlf
+/MessagePropertyFilter.cs -crlf
+/MessageQueue.resx -crlf
+/MessageQueueAccessControlEntry.cs -crlf
+/MessageQueueAccessRights.cs -crlf
+/MessageQueueCriteria.cs -crlf
+/MessageQueueEnumerator.cs -crlf
+/MessageQueueErrorCode.cs -crlf
+/MessageQueuePermission.cs -crlf
+/MessageQueuePermissionAccess.cs -crlf
+/MessageQueuePermissionAttribute.cs -crlf
+/MessageQueuePermissionEntry.cs -crlf
+/MessageQueuePermissionEntryCollection.cs -crlf
+/MessageQueueTransaction.cs -crlf
+/MessageQueueTransactionStatus.cs -crlf
+/MessageQueueTransactionType.cs -crlf
+/MessageType.cs -crlf
+/MessagingDescriptionAttribute.cs -crlf
+/PeekCompletedEventArgs.cs -crlf
+/PeekCompletedEventHandler.cs -crlf
+/ReceiveCompletedEventArgs.cs -crlf
+/ReceiveCompletedEventHandler.cs -crlf
+/StandardAccessRights.cs -crlf
+/Trustee.cs -crlf
+/TrusteeType.cs -crlf
//\r
// (C) 2003 Peter Van Isacker\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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
\r
namespace System.Messaging \r
//\r
// (C) 2003 Peter Van Isacker\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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.ComponentModel;\r
//\r
// (C) 2003 Peter Van Isacker\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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.ComponentModel;\r
//\r
// (C) 2003 Peter Van Isacker, Rafael Teixeira\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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
\r
namespace System.Messaging \r
//\r
// (C) 2003 Peter Van Isacker\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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.Collections;\r
\r
//\r
// (C) 2003 Peter Van Isacker\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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
\r
namespace System.Messaging\r
get {throw new NotImplementedException();}
[MonoTODO]
set {throw new NotImplementedException();}
- }\r
-\r
- [DefaultValue (EncryptionRequired.None)]\r
+ }
+
+ [DefaultValue (EncryptionRequired.None)]
public EncryptionRequired EncryptionRequired {
[MonoTODO]
get {throw new NotImplementedException();}
get {throw new NotImplementedException();}
[MonoTODO]
set {throw new NotImplementedException();}
- }\r
-\r
- [DefaultValue (UninstallAction.Remove)]\r
+ }
+
+ [DefaultValue (UninstallAction.Remove)]
public UninstallAction UninstallAction {
[MonoTODO]
get {throw new NotImplementedException();}
//\r
// (C) 2003 Peter Van Isacker\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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.Collections;\r
\r
//\r
// (C) 2003 Peter Van Isacker\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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
\r
namespace System.Messaging \r
--- /dev/null
+/MessageQueuePermissionAttributeTest.cs -crlf
case 12:\r
case 13:\r
case 32:\r
- case 92:
+ case 92:\r
#if NET_2_0\r
- case 133:
+ case 133:\r
#endif\r
case 160:\r
// known invalid chars\r
--- /dev/null
+/DLR-0.92-BigIntegerv2.patch -crlf
---- ./Runtime/Microsoft.Dynamic/Math/BigIntegerV2.cs 2009-10-19 13:36:38.000000000 -0400
-+++ /cvs/mcs/class/System.Numerics/System.Numerics/BigInteger.cs 2009-10-31 12:13:55.000000000 -0400
-@@ -12,7 +12,6 @@
+--- ./Runtime/Microsoft.Dynamic/Math/BigIntegerV2.cs 2009-10-19 13:36:38.000000000 -0400\r
++++ /cvs/mcs/class/System.Numerics/System.Numerics/BigInteger.cs 2009-10-31 12:13:55.000000000 -0400\r
+@@ -12,7 +12,6 @@\r
*\r
*\r
* ***************************************************************************/\r
\r
using System;\r
using System.Collections.Generic;\r
-@@ -20,8 +19,6 @@
+@@ -20,8 +19,6 @@\r
using System.Diagnostics.CodeAnalysis;\r
using System.Globalization;\r
using System.Text;\r
\r
namespace Microsoft.Scripting.Math {\r
/// <summary>\r
-@@ -104,7 +101,8 @@
+@@ -104,7 +101,8 @@\r
/// (inverse of ToByteArray())\r
/// </summary>\r
public static BigInteger Create(byte[] v) {\r
if (v.Length == 0) return Create(0);\r
\r
int byteCount = v.Length;\r
-@@ -339,10 +337,13 @@
+@@ -339,10 +337,13 @@\r
\r
[CLSCompliant(false)]\r
public BigInteger(int sign, params uint[] data) {\r
\r
this.data = data;\r
this.sign = (short)(length == 0 ? 0 : sign);\r
-@@ -507,7 +508,7 @@
+@@ -507,7 +508,7 @@\r
}\r
\r
public bool TryToFloat64(out double result) {\r
System.Globalization.NumberStyles.Number,\r
System.Globalization.CultureInfo.InvariantCulture.NumberFormat,\r
out result);\r
-@@ -1355,17 +1356,92 @@
+@@ -1355,17 +1356,92 @@\r
return this * this;\r
}\r
\r
public override int GetHashCode() {\r
// The Object.GetHashCode function needs to be consistent with the Object.Equals function.\r
// Languages that build on top of this may have a more flexible equality function and \r
-@@ -1395,12 +1471,10 @@
+@@ -1395,12 +1471,10 @@\r
}\r
}\r
\r
public bool Equals(BigInteger other) {\r
if (object.ReferenceEquals(other, null)) return false;\r
return this == other;\r
-@@ -1492,17 +1566,14 @@
+@@ -1492,17 +1566,14 @@\r
\r
#region IConvertible Members\r
\r
public byte ToByte(IFormatProvider provider) {\r
uint ret;\r
if (AsUInt32(out ret) && (ret & ~0xFF) == 0) {\r
-@@ -1561,7 +1632,6 @@
+@@ -1561,7 +1632,6 @@\r
return trimmedBytes;\r
}\r
\r
public char ToChar(IFormatProvider provider) {\r
int ret;\r
if (AsInt32(out ret) && (ret <= Char.MaxValue) && (ret >= Char.MinValue)) {\r
-@@ -1570,24 +1640,20 @@
+@@ -1570,24 +1640,20 @@\r
throw new OverflowException("big integer won't fit into char");\r
}\r
\r
public short ToInt16(IFormatProvider provider) {\r
int ret;\r
if (AsInt32(out ret) && (ret <= short.MaxValue) && (ret >= short.MinValue)) {\r
-@@ -1596,7 +1662,6 @@
+@@ -1596,7 +1662,6 @@\r
throw new OverflowException("big integer won't fit into short");\r
}\r
\r
public int ToInt32(IFormatProvider provider) {\r
int ret;\r
if (AsInt32(out ret)) {\r
-@@ -1605,7 +1670,6 @@
+@@ -1605,7 +1670,6 @@\r
throw new OverflowException("big integer won't fit into int");\r
}\r
\r
public long ToInt64(IFormatProvider provider) {\r
long ret;\r
if (AsInt64(out ret)) {\r
-@@ -1614,7 +1678,7 @@
+@@ -1614,7 +1678,7 @@\r
throw new OverflowException("big integer won't fit into long");\r
}\r
\r
public sbyte ToSByte(IFormatProvider provider) {\r
int ret;\r
if (AsInt32(out ret) && (ret <= sbyte.MaxValue) && (ret >= sbyte.MinValue)) {\r
-@@ -1623,17 +1687,14 @@
+@@ -1623,17 +1687,14 @@\r
throw new OverflowException("big integer won't fit into sbyte");\r
}\r
\r
public object ToType(Type conversionType, IFormatProvider provider) {\r
if (conversionType == typeof(BigInteger)) {\r
return this;\r
-@@ -1641,7 +1702,7 @@
+@@ -1641,7 +1702,7 @@\r
throw new NotImplementedException();\r
}\r
\r
public ushort ToUInt16(IFormatProvider provider) {\r
uint ret;\r
if (AsUInt32(out ret) && ret <= ushort.MaxValue) {\r
-@@ -1650,7 +1711,7 @@
+@@ -1650,7 +1711,7 @@\r
throw new OverflowException("big integer won't fit into ushort");\r
}\r
\r
public uint ToUInt32(IFormatProvider provider) {\r
uint ret;\r
if (AsUInt32(out ret)) {\r
-@@ -1659,7 +1720,7 @@
+@@ -1659,7 +1720,7 @@\r
throw new OverflowException("big integer won't fit into uint");\r
}\r
\r
public ulong ToUInt64(IFormatProvider provider) {\r
ulong ret;\r
if (AsUInt64(out ret)) {\r
-@@ -1724,4 +1785,3 @@
+@@ -1724,4 +1785,3 @@\r
#endregion \r
}\r
}\r
*
* ***************************************************************************/
-using System;\r
-using System.Collections.Generic;\r
-using System.Diagnostics;\r
-using System.Diagnostics.CodeAnalysis;\r
-using System.Globalization;\r
-using System.Text;\r
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
+using System.Globalization;
+using System.Text;
using System.Threading;
/*
Optimize BitScanBackward
Use a carry variable to make shift opts do half the number of array ops.
Schoolbook multiply is O(n^2), use Karatsuba /Toom-3 for large numbers
-*/\r
-namespace System.Numerics {\r
+*/
+namespace System.Numerics {
public struct BigInteger : IComparable, IFormattable, IComparable<BigInteger>, IEquatable<BigInteger>
{
//LSB on [0]
{
//FIXME
try {
- return double.Parse (value.ToString (),\r
+ return double.Parse (value.ToString (),
System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
} catch (OverflowException) {
return value.sign == -1 ? double.NegativeInfinity : double.PositiveInfinity;
- }\r
+ }
}
public static explicit operator float (BigInteger value)
{
//FIXME
try {
- return float.Parse (value.ToString (),\r
- System.Globalization.CultureInfo.InvariantCulture.NumberFormat);\r
+ return float.Parse (value.ToString (),
+ System.Globalization.CultureInfo.InvariantCulture.NumberFormat);
} catch (OverflowException) {
return value.sign == -1 ? float.NegativeInfinity : float.PositiveInfinity;
- }\r
+ }
}
public static explicit operator decimal (BigInteger value)
static uint[] MakeTwoComplement (uint[] v)
{
- uint[] res = new uint [v.Length];\r
+ uint[] res = new uint [v.Length];
ulong carry = 1;
for (int i = 0; i < v.Length; ++i) {
for (int i = 1; i < idx; ++i)
mask = (mask << 8) | 0xFF;
- res [res.Length - 1] = last & mask;\r
- return res;\r
+ res [res.Length - 1] = last & mask;
+ return res;
}
string ToString (uint radix, IFormatProvider provider)
}
static byte[] Resize (byte[] v, int len)
- {\r
- byte[] res = new byte [len];\r
- Array.Copy (v, res, Math.Min (v.Length, len));\r
- return res;\r
+ {
+ byte[] res = new byte [len];
+ Array.Copy (v, res, Math.Min (v.Length, len));
+ return res;
}
static uint[] Resize (uint[] v, int len)
{
- uint[] res = new uint [len];\r
- Array.Copy (v, res, Math.Min (v.Length, len));\r
- return res;\r
+ uint[] res = new uint [len];
+ Array.Copy (v, res, Math.Min (v.Length, len));
+ return res;
}
static uint[] CoreAdd (uint[] a, uint[] b)
}
}
}
-}\r
+}
static byte[] huge_add = new byte[] {0xB3, 0x38, 0xD5, 0xFD, 0x45, 0x1A, 0x46, 0xD8, 0xB6, 0xC, 0x2C, 0x9E, 0x9C, 0x61, 0xC4, 0xE0, 0x26, 0xDB, 0xEF, 0x31, 0xC0, 0x67, 0xC3, 0xDD, 0xF0, 0x68, 0x57, 0xBD, 0xEF, 0x79, 0xFF, 0x78, 0x3, 0x35, 0x7, 0x15, 0x95, 0x22, 0x6A, 0x3A, 0x41, 0xCD, 0xD7, 0xD2, 0x91, 0x14, 0x8, 0xB3, 0x65, 0x16, 0xBF, 0x3D, 0x20, 0x95, 0xE6, 0x4C, 0xE1, 0xE0, 0x4B, 0x49, 0xD5, 0x5A, 0xB7, };
- static byte[] a_m_b = new byte[] { 0x87, 0x2D, 0x21, 0x0, 0x1E, 0xEB, 0xC3, 0xB0, 0xDD, 0xAC, 0xCB, 0x43, 0x7E, 0x10, 0x9E, 0xAE, 0x45, 0xF2, 0x55, 0x71, 0x73, 0xD4, 0x7A, 0xEB, 0x88, 0xD3, 0xD4, 0xEE, 0x36, 0xBE, 0x9B, 0x2D, 0xB6, 0xB3, 0x8B, 0x66, 0x60, 0x8B, 0x16, 0x76, 0x17, 0x74, 0xFE, 0xD7, 0xB2, 0x96, 0x7B, 0xBD, 0xE2, 0xC4, 0x2D, 0xDC, 0xDE, 0x6A, 0x19, 0xB3, 0x1E, 0x1F, 0xB4, 0xB6, 0x2A, 0xA5, 0x48, };\r
- static byte[] b_m_a = new byte[] { 0x79, 0xD2, 0xDE, 0xFF, 0xE1, 0x14, 0x3C, 0x4F, 0x22, 0x53, 0x34, 0xBC, 0x81, 0xEF, 0x61, 0x51, 0xBA, 0xD, 0xAA, 0x8E, 0x8C, 0x2B, 0x85, 0x14, 0x77, 0x2C, 0x2B, 0x11, 0xC9, 0x41, 0x64, 0xD2, 0x49, 0x4C, 0x74, 0x99, 0x9F, 0x74, 0xE9, 0x89, 0xE8, 0x8B, 0x1, 0x28, 0x4D, 0x69, 0x84, 0x42, 0x1D, 0x3B, 0xD2, 0x23, 0x21, 0x95, 0xE6, 0x4C, 0xE1, 0xE0, 0x4B, 0x49, 0xD5, 0x5A, 0xB7, };\r
+ static byte[] a_m_b = new byte[] { 0x87, 0x2D, 0x21, 0x0, 0x1E, 0xEB, 0xC3, 0xB0, 0xDD, 0xAC, 0xCB, 0x43, 0x7E, 0x10, 0x9E, 0xAE, 0x45, 0xF2, 0x55, 0x71, 0x73, 0xD4, 0x7A, 0xEB, 0x88, 0xD3, 0xD4, 0xEE, 0x36, 0xBE, 0x9B, 0x2D, 0xB6, 0xB3, 0x8B, 0x66, 0x60, 0x8B, 0x16, 0x76, 0x17, 0x74, 0xFE, 0xD7, 0xB2, 0x96, 0x7B, 0xBD, 0xE2, 0xC4, 0x2D, 0xDC, 0xDE, 0x6A, 0x19, 0xB3, 0x1E, 0x1F, 0xB4, 0xB6, 0x2A, 0xA5, 0x48, };
+ static byte[] b_m_a = new byte[] { 0x79, 0xD2, 0xDE, 0xFF, 0xE1, 0x14, 0x3C, 0x4F, 0x22, 0x53, 0x34, 0xBC, 0x81, 0xEF, 0x61, 0x51, 0xBA, 0xD, 0xAA, 0x8E, 0x8C, 0x2B, 0x85, 0x14, 0x77, 0x2C, 0x2B, 0x11, 0xC9, 0x41, 0x64, 0xD2, 0x49, 0x4C, 0x74, 0x99, 0x9F, 0x74, 0xE9, 0x89, 0xE8, 0x8B, 0x1, 0x28, 0x4D, 0x69, 0x84, 0x42, 0x1D, 0x3B, 0xD2, 0x23, 0x21, 0x95, 0xE6, 0x4C, 0xE1, 0xE0, 0x4B, 0x49, 0xD5, 0x5A, 0xB7, };
static byte[] huge_mul = new byte[] { 0xFE, 0x83, 0xE1, 0x9B, 0x8D, 0x61, 0x40, 0xD1, 0x60, 0x19, 0xBD, 0x38, 0xF0, 0xFF, 0x90, 0xAE, 0xDD, 0xAE, 0x73, 0x2C, 0x20, 0x23, 0xCF, 0x6, 0x7A, 0xB4, 0x1C, 0xE7, 0xD9, 0x64, 0x96, 0x2C, 0x87, 0x7E, 0x1D, 0xB3, 0x8F, 0xD4, 0x33, 0xBA, 0xF4, 0x22, 0xB4, 0xDB, 0xC0, 0x5B, 0xA5, 0x64, 0xA0, 0xBC, 0xCA, 0x3E, 0x94, 0x95, 0xDA, 0x49, 0xE2, 0xA8, 0x33, 0xA2, 0x6A, 0x33, 0xB1, 0xF2, 0xEA, 0x99, 0x32, 0xD0, 0xB2, 0xAE, 0x55, 0x75, 0xBD, 0x19, 0xFC, 0x9A, 0xEC, 0x54, 0x87, 0x2A, 0x6, 0xCC, 0x78, 0xDA, 0x88, 0xBB, 0xAB, 0xA5, 0x47, 0xEF, 0xC7, 0x2B, 0xC7, 0x5B, 0x32, 0x31, 0xCD, 0xD9, 0x53, 0x96, 0x1A, 0x9D, 0x9A, 0x57, 0x40, 0x51, 0xB6, 0x5D, 0xC, 0x17, 0xD1, 0x86, 0xE9, 0xA4, 0x20, };
- static byte[] huge_div = new byte[] { 0x0, };\r
- static byte[] huge_rem = new byte[] { 0x1D, 0x33, 0xFB, 0xFE, 0xB1, 0x2, 0x85, 0x44, 0xCA, 0xDC, 0xFB, 0x70, 0xD, 0x39, 0xB1, 0x47, 0xB6, 0xE6, 0xA2, 0xD1, 0x19, 0x1E, 0x9F, 0xE4, 0x3C, 0x1E, 0x16, 0x56, 0x13, 0x9C, 0x4D, 0xD3, 0x5C, 0x74, 0xC9, 0xBD, 0xFA, 0x56, 0x40, 0x58, 0xAC, 0x20, 0x6B, 0x55, 0xA2, 0xD5, 0x41, 0x38, 0xA4, 0x6D, 0xF6, 0x8C, };\r
+ static byte[] huge_div = new byte[] { 0x0, };
+ static byte[] huge_rem = new byte[] { 0x1D, 0x33, 0xFB, 0xFE, 0xB1, 0x2, 0x85, 0x44, 0xCA, 0xDC, 0xFB, 0x70, 0xD, 0x39, 0xB1, 0x47, 0xB6, 0xE6, 0xA2, 0xD1, 0x19, 0x1E, 0x9F, 0xE4, 0x3C, 0x1E, 0x16, 0x56, 0x13, 0x9C, 0x4D, 0xD3, 0x5C, 0x74, 0xC9, 0xBD, 0xFA, 0x56, 0x40, 0x58, 0xAC, 0x20, 0x6B, 0x55, 0xA2, 0xD5, 0x41, 0x38, 0xA4, 0x6D, 0xF6, 0x8C, };
static byte[][] add_a = new byte[][] {
new byte[] {1},
new byte[] {0xFF},
--- /dev/null
+/makefile.build -crlf
+/net_1_1_java_System.Runtime.Remoting.dll.exclude.sources -crlf
+/net_1_1_java_System.Runtime.Remoting.dll.sources -crlf
--- /dev/null
+/System.Runtime.Remoting.xml -crlf
--- /dev/null
+/AggregateDictionary.cs -crlf
+/HttpClientTransportSinkProvider.cs -crlf
--- /dev/null
+/IpcChannel.cs -crlf
+/IpcClientChannel.cs -crlf
+/IpcServerChannel.cs -crlf
Type type = obj.GetType ();
- if (type == typeof (String)) \r
+ if (type == typeof (String))
{
writer.Write ((byte)TypeId.String);
writer.Write ((String)obj);
--- /dev/null
+/TcpConnectionPool.cs -crlf
--- /dev/null
+/SoapClientFormatterSink.cs -crlf
+/SoapClientFormatterSinkProvider.cs -crlf
+/SoapMessageFormatter.cs -crlf
+/SoapServerFormatterSink.cs -crlf
+/SoapServerFormatterSinkProvider.cs -crlf
--- /dev/null
+/BaseCalls.cs -crlf
+/CallSeq.cs -crlf
+/ContextHookAttribute.cs -crlf
+/ContextsTest.cs -crlf
+/HttpCalls.cs -crlf
+/RemotingServicesTest.cs -crlf
+/ServerObject.cs -crlf
set { calls = value; }\r
}\r
}\r
-}
+}\r
--- /dev/null
+/README -crlf
+/Sample.txt -crlf
+/makefile.build -crlf
+/net_1_1_java_System.Runtime.Serialization.Formatters.Soap.dll.sources -crlf
--- /dev/null
+/System.Runtime.Serialization.Formatters.Soap.xml -crlf
--- /dev/null
+/SoapFormatter.cs -crlf
+/SoapReader.cs -crlf
+/SoapWriter.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/InternalSoapValuesTest.cs -crlf
+/SerializationTest.cs -crlf
+/SoapFormatterTest.cs -crlf
+/Test.cmbx -crlf
+/Test.prjx -crlf
[Serializable]\r
class SerializedClass\r
{\r
- public string str = "rrr";
- public bool m_bool;
- public sbyte m_sbyte;
- public byte m_byte;
- public long m_long;
- public ulong m_ulong;
- public int m_int;
- public uint m_uint;
- public float m_float;
- public double m_double;
- public decimal m_decimal;
- public short m_short;
- public ushort m_ushort;
- public object m_object = new object();
- public TimeSpan m_timeSpan = TimeSpan.FromTicks(TimeSpan.TicksPerDay);
+ public string str = "rrr";\r
+ public bool m_bool;\r
+ public sbyte m_sbyte;\r
+ public byte m_byte;\r
+ public long m_long;\r
+ public ulong m_ulong;\r
+ public int m_int;\r
+ public uint m_uint;\r
+ public float m_float;\r
+ public double m_double;\r
+ public decimal m_decimal;\r
+ public short m_short;\r
+ public ushort m_ushort;\r
+ public object m_object = new object();\r
+ public TimeSpan m_timeSpan = TimeSpan.FromTicks(TimeSpan.TicksPerDay);\r
public byte[] m_bytes = new byte[10];\r
public DateTime m_time = DateTime.Now;\r
}\r
using System.Runtime.Serialization.Formatters.Soap;\r
using System.Runtime.Remoting.Metadata.W3cXsd2001;\r
using System.IO;\r
-using NUnit.Framework;
+using NUnit.Framework;\r
\r
namespace MonoTests.System.Runtime.Serialization.Formatters.Soap {\r
\r
Assertion.AssertEquals("#Version1 Version2", "Version2", objReturn.GetType().Name);\r
Assertion.AssertEquals("#_value", 123, ((Version2) objReturn)._value);\r
Assertion.AssertEquals("#_foo", "Default value", ((Version2) objReturn)._foo);\r
- }
-
+ }\r
+ \r
[Test]\r
- public void TestMethodSignatureSerialization ()
+ public void TestMethodSignatureSerialization ()\r
{\r
Header h = new Header ("__MethodSignature", new Type [] { typeof(string),typeof(SignatureTest[]) }, false, "http://schemas.microsoft.com/clr/soap/messageProperties");\r
\r
\r
SoapMessage t = new SoapMessage ();\r
sf.TopObject = t;\r
- t = (SoapMessage) sf.Deserialize (ms);
-
+ t = (SoapMessage) sf.Deserialize (ms);\r
+ \r
Assertion.AssertNotNull ("#1", t.Headers[0].Value);\r
- Assertion.AssertEquals ("#2", t.Headers[0].Value.GetType (), typeof(Type[]));
-
- Type[] ts = (Type[]) t.Headers[0].Value;
-
- Assertion.AssertEquals ("#3", 2, ts.Length);
+ Assertion.AssertEquals ("#2", t.Headers[0].Value.GetType (), typeof(Type[]));\r
+ \r
+ Type[] ts = (Type[]) t.Headers[0].Value;\r
+ \r
+ Assertion.AssertEquals ("#3", 2, ts.Length);\r
Assertion.AssertNotNull ("#4", ts[0]);\r
- Assertion.AssertNotNull ("#5", ts[1]);
- Console.WriteLine ("PPP:" + ts[0].GetType());
+ Assertion.AssertNotNull ("#5", ts[1]);\r
+ Console.WriteLine ("PPP:" + ts[0].GetType());\r
Assertion.AssertEquals ("#6", typeof(string), ts[0]);\r
Assertion.AssertEquals ("#7", typeof(SignatureTest[]), ts[1]);\r
}\r
- }
-
+ }\r
+ \r
[Serializable]\r
public class SignatureTest\r
{\r
--- /dev/null
+/System.Security.Policy.ApplicationTrust.xml -crlf
--- /dev/null
+/AttributesTest.cs -crlf
+/DataContractSerializerTest_FrameworkTypes.cs -crlf
+/DataContractSerializerTest_FrameworkTypes_System.Data.cs -crlf
+/DataContractSerializerTest_FrameworkTypes_System.cs -crlf
+/DataContractSerializerTest_FrameworkTypes_mscorlib.cs -crlf
using System;
-using System.Xml;\r
+using System.Xml;
using NUnit.Framework;
namespace MonoTests
-{\r
+{
public class XmlComparer
{
[Flags]
public string Expected
{
get { return _expected; }
- }\r
-\r
- public static void AssertAreEqual (string expected, string actual) {\r
- AssertAreEqual (expected, actual, String.Empty);\r
- }\r
-\r
- public static void AssertAreEqual (string expected, string actual, string msg) {\r
-\r
- try {\r
- XmlDocument or = new XmlDocument ();\r
- or.LoadXml (expected);\r
- XmlDocument dr = new XmlDocument ();\r
- dr.LoadXml (actual);\r
- XmlComparer comparer = new XmlComparer ();\r
- if (!comparer.AreEqual (or, dr))\r
- Assert.AreEqual (comparer.Expected, comparer.Actual, msg);\r
- }\r
- catch (AssertionException) {\r
- throw;\r
- }\r
- catch (Exception e) {\r
- //swallow e when there is XML error and fallback\r
- //to the text comparison\r
- Assert.AreEqual (expected, actual, msg);\r
- }\r
+ }
+
+ public static void AssertAreEqual (string expected, string actual) {
+ AssertAreEqual (expected, actual, String.Empty);
+ }
+
+ public static void AssertAreEqual (string expected, string actual, string msg) {
+
+ try {
+ XmlDocument or = new XmlDocument ();
+ or.LoadXml (expected);
+ XmlDocument dr = new XmlDocument ();
+ dr.LoadXml (actual);
+ XmlComparer comparer = new XmlComparer ();
+ if (!comparer.AreEqual (or, dr))
+ Assert.AreEqual (comparer.Expected, comparer.Actual, msg);
+ }
+ catch (AssertionException) {
+ throw;
+ }
+ catch (Exception e) {
+ //swallow e when there is XML error and fallback
+ //to the text comparison
+ Assert.AreEqual (expected, actual, msg);
+ }
}
}
}
--- /dev/null
+/XmlDsigNodeList.cs -crlf
--- /dev/null
+/ProtectedData.cs -crlf
+/ProtectedMemory.cs -crlf
private ArrayList _list;
public CryptographicAttributeObjectCollection ()
- {\r
+ {
_list = new ArrayList ();
}
public CryptographicAttributeObjectCollection (CryptographicAttributeObject attribute)
: this ()
- {\r
+ {
_list.Add (attribute);
}
public int Add (AsnEncodedData asnEncodedData)
{
if (asnEncodedData == null)
- throw new ArgumentNullException ("asnEncodedData");\r
-\r
- AsnEncodedDataCollection coll = new AsnEncodedDataCollection (asnEncodedData);\r
+ throw new ArgumentNullException ("asnEncodedData");
+
+ AsnEncodedDataCollection coll = new AsnEncodedDataCollection (asnEncodedData);
return Add (new CryptographicAttributeObject (asnEncodedData.Oid, coll));
}
public int Add (CryptographicAttributeObject attribute)
{
if (attribute == null)
- throw new ArgumentNullException ("attribute");\r
-\r
- int existing = -1;\r
- string oid = attribute.Oid.Value;\r
- for (int i=0; i < _list.Count; i++) {\r
- if ((_list[i] as CryptographicAttributeObject).Oid.Value == oid) {\r
- existing = i;\r
- break;\r
- }\r
- }\r
- if (existing >= 0) {\r
- CryptographicAttributeObject cao = this[existing];\r
- foreach (AsnEncodedData value in attribute.Values) {\r
- cao.Values.Add (value);\r
- }\r
- return existing;\r
- } else {\r
- return _list.Add (attribute);\r
+ throw new ArgumentNullException ("attribute");
+
+ int existing = -1;
+ string oid = attribute.Oid.Value;
+ for (int i=0; i < _list.Count; i++) {
+ if ((_list[i] as CryptographicAttributeObject).Oid.Value == oid) {
+ existing = i;
+ break;
+ }
+ }
+ if (existing >= 0) {
+ CryptographicAttributeObject cao = this[existing];
+ foreach (AsnEncodedData value in attribute.Values) {
+ cao.Values.Add (value);
+ }
+ return existing;
+ } else {
+ return _list.Add (attribute);
}
}
}
public void Remove (CryptographicAttributeObject attribute)
- {\r
- if (attribute == null)\r
- throw new ArgumentNullException ("attribute");\r
-\r
+ {
+ if (attribute == null)
+ throw new ArgumentNullException ("attribute");
+
_list.Remove (attribute);
}
}
--- /dev/null
+/EncryptedXmlSample3.xml -crlf
+2010-07-30 Atsushi Enomoto <atsushi@ximian.com>
+
+ * System.ServiceModel.Discovery.dll.soures : add config types. NOTE:
+ this somehow breaks compilation. To get working build, remove those
+ config types.
+
2010-03-19 Atsushi Enomoto <atsushi@ximian.com>
* : initial checkin (mostly stubs).
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ [ConfigurationCollection (typeof (ChannelEndpointElement), AddItemName = "endpoint")]
+ public sealed class AnnouncementChannelEndpointElementCollection : ServiceModelConfigurationElementCollection<ChannelEndpointElement>
+ {
+ public AnnouncementChannelEndpointElementCollection ()
+ {
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public class AnnouncementEndpointCollectionElement : StandardEndpointCollectionElement<AnnouncementEndpoint, AnnouncementEndpointElement>
+ {
+ public AnnouncementEndpointCollectionElement ()
+ {
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+using System.ServiceModel.Description;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public class AnnouncementEndpointElement : StandardEndpointElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty discovery_version, max_announcement_delay;
+
+ static AnnouncementEndpointElement ()
+ {
+ discovery_version = new ConfigurationProperty ("discoveryVersion", typeof (DiscoveryVersion), "WSDiscovery11", new DiscoveryVersionConverter (), null, ConfigurationPropertyOptions.None);
+ max_announcement_delay = new ConfigurationProperty ("maxAnnouncementDelay", typeof (TimeSpan), "00:00:00", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (discovery_version);
+ properties.Add (max_announcement_delay);
+ }
+
+ public AnnouncementEndpointElement ()
+ {
+ }
+
+ [TypeConverter (typeof (DiscoveryVersionConverter))]
+ [ConfigurationProperty ("discoveryVersion", DefaultValue = "WSDiscovery11")]
+ public DiscoveryVersion DiscoveryVersion {
+ get { return (DiscoveryVersion) base [discovery_version]; }
+ set { base [discovery_version] = value; }
+ }
+
+ protected override Type EndpointType {
+ get { return typeof (AnnouncementEndpoint); }
+ }
+
+ [TypeConverter (typeof (TimeSpanConverter))]
+ [ConfigurationProperty ("maxAnnouncementDelay", DefaultValue = "00:00:00")]
+ public TimeSpan MaxAnnouncementDelay {
+ get { return (TimeSpan) base [max_announcement_delay]; }
+ set { base [max_announcement_delay] = value; }
+ }
+
+ protected override ServiceEndpoint CreateServiceEndpoint (ContractDescription contractDescription)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void InitializeFrom (ServiceEndpoint endpoint)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ChannelEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInitializeAndValidate (ChannelEndpointElement channelEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
--- /dev/null
+2010-07-30 Atsushi Enomoto <atsushi@ximian.com>
+
+ *.cs : initial checkin.
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public sealed class ContractTypeNameElement : ConfigurationElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty name, @namespace;
+
+ static ContractTypeNameElement ()
+ {
+ name = new ConfigurationProperty ("name", typeof (string), null, null, new StringValidator (0), ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
+ @namespace = new ConfigurationProperty ("namespace", typeof (string), "http://tempuri.org/", null, null, ConfigurationPropertyOptions.IsKey);
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (name);
+ properties.Add (@namespace);
+ }
+
+ public ContractTypeNameElement ()
+ {
+ }
+
+ public ContractTypeNameElement (string name, string ns)
+ {
+ Name = name;
+ Namespace = ns;
+ }
+
+ [ConfigurationProperty ("name", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
+ [StringValidator (MinLength = 0)]
+ public string Name {
+ get { return (string) Properties [name]; }
+ set { Properties [name] = value; }
+ }
+
+ [ConfigurationProperty ("namespace", DefaultValue = "http://tempuri.org/", Options = ConfigurationPropertyOptions.IsKey)]
+ public string Namespace {
+ get { return (string) Properties [@namespace]; }
+ set { Properties [@namespace] = value; }
+ }
+
+ protected override ConfigurationPropertyCollection Properties {
+ get { return properties; }
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ [ConfigurationCollection (typeof(ContractTypeNameElement))]
+ public sealed class ContractTypeNameElementCollection : ServiceModelConfigurationElementCollection<ContractTypeNameElement>
+ {
+ public ContractTypeNameElementCollection ()
+ {
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public sealed class DiscoveryClientElement : BindingElementExtensionElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty endpoint, find_criteria;
+
+ static DiscoveryClientElement ()
+ {
+ endpoint = new ConfigurationProperty ("endpoint", typeof (ChannelEndpointElement), null, null, null, ConfigurationPropertyOptions.None);
+ find_criteria = new ConfigurationProperty ("findCriteria", typeof (FindCriteriaElement), null, null, null, ConfigurationPropertyOptions.None);
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (endpoint);
+ properties.Add (find_criteria);
+ }
+
+ public DiscoveryClientElement ()
+ {
+ }
+
+ public override Type BindingElementType {
+ get { return typeof (DiscoveryClientBindingElement); }
+ }
+
+ [ConfigurationProperty ("endpoint")]
+ public ChannelEndpointElement DiscoveryEndpoint {
+ get { return (ChannelEndpointElement) Properties [endpoint]; }
+ }
+
+ [ConfigurationProperty ("findCriteria")]
+ public FindCriteriaElement FindCriteria {
+ get { return (FindCriteriaElement) Properties [find_criteria]; }
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public sealed class DiscoveryClientSettingsElement : ConfigurationElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty endpoint, find_criteria;
+
+ static DiscoveryClientSettingsElement ()
+ {
+ endpoint = new ConfigurationProperty ("endpoint", typeof (ChannelEndpointElement), null, null, null, ConfigurationPropertyOptions.None);
+ find_criteria = new ConfigurationProperty ("findCriteria", typeof (FindCriteriaElement), null, null, null, ConfigurationPropertyOptions.None);
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (endpoint);
+ properties.Add (find_criteria);
+ }
+
+ public DiscoveryClientSettingsElement ()
+ {
+ }
+
+ [ConfigurationProperty ("endpoint")]
+ public ChannelEndpointElement DiscoveryEndpoint {
+ get { return (ChannelEndpointElement) Properties [discovery_element]; }
+ }
+
+ [ConfigurationProperty ("findCriteria")]
+ public FindCriteriaElement FindCriteria {
+ get { return (FindCriteriaElement) Properties [find_criteria]; }
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public class DiscoveryEndpointCollectionElement : StandardEndpointCollectionElement<DiscoveryEndpoint, DiscoveryEndpointElement>
+ {
+ public DiscoveryEndpointCollectionElement ()
+ {
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+using System.ServiceModel.Description;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public class DiscoveryEndpointElement : StandardEndpointElement
+ {
+ public DiscoveryEndpointElement ()
+ {
+ }
+
+ protected override ServiceEndpoint CreateServiceEndpoint (ContractDescription contractDescription)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void InitializeFrom (ServiceEndpoint endpoint)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ChannelEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInitializeAndValidate (ChannelEndpointElement channelEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInitializeAndValidate (ServiceEndpointElement channelEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.Globalization;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public class DiscoveryVersionConverter : TypeConverter
+ {
+ public DiscoveryVersionConverter ()
+ {
+ }
+
+ public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public class DynamicEndpointCollectionElement : StandardEndpointCollectionElement<DynamicEndpoint, DynamicEndpointElement>
+ {
+ public DynamicEndpointCollectionElement ()
+ {
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public sealed class DynamicEndpointElement : StandardEndpointElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty discovery_client_settings;
+
+ static DynamicEndpointElement ()
+ {
+ discovery_client_settings = new ConfigurationProperty ("discoveryClientSettings", typeof (DiscoveryClientSettingsElement), null, null, null, ConfigurationPropertyOptions.None);
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (discovery_client_settings);
+ }
+
+ public DynamicEndpointElement ()
+ {
+ }
+
+ [ConfigurationProperty ("discoveryClientSettings")]
+ public DiscoveryClientSettingsElement DiscoveryClientSettings {
+ get { return (DiscoveryClientSettingsElement) Prperties [discovery_client_settings]; }
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public sealed class EndpointDiscoveryElement : BehaviorExtensionElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty types, enabled, extensions, scopes;
+
+ static EndpointDiscoveryElement ()
+ {
+ types = new ConfigurationProperty ("types", typeof (ContractTypeNameElementCollection), null, null, null, ConfigurationPropertyOptions.None);
+ enabled = new ConfigurationProperty ("enabled", typeof (bool), null, null, null, ConfigurationPropertyOptions.None);
+ extensions = new ConfigurationProperty ("extensions", typeof (XmlElementElementCollection), null, null, null, ConfigurationPropertyOptions.None);
+ scopes = new ConfigurationProperty ("scopes", typeof (ScopeElementCollection), null, null, null, ConfigurationPropertyOptions.None);
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (types);
+ properties.Add (enabled);
+ properties.Add (extensions);
+ properties.Add (scopes);
+ }
+
+ public EndpointDiscoveryElement ()
+ {
+ }
+
+ public override Type BehaviorType {
+ get { return typeof (EndpointDiscoveryBehavior); }
+ }
+
+ [ConfigurationProperty ("types")]
+ public ContractTypeNameElementCollection ContractTypeNames {
+ get { return (ContractTypeNameElementCollection) Properties [types]; }
+ }
+
+ [ConfigurationPropertyAttribute("enabled", DefaultValue = true)]
+ public bool Enabled {
+ get { return (bool) Properties [enabled]; }
+ set { Properties [enabled] = value; }
+ }
+
+ [ConfigurationPropertyAttribute("extensions")]
+ public XmlElementElementCollection Extensions {
+ get { return (XmlElementElementCollection) Properties [extensions]; }
+ }
+
+ [ConfigurationPropertyAttribute("scopes")]
+ public ScopeElementCollection Scopes {
+ get { return (ScopeElementCollection) Properties [scopes]; }
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public sealed class FindCriteriaElement : ConfigurationElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty types, duration, extensions, max_results, scope_match_by, scopes;
+
+ static FindCriteriaElement ()
+ {
+ types = new ConfigurationProperty ("types", typeof (ContractTypeNameElementCollection), null, null, null, ConfigurationPropertyOptions.None);
+ duration = new ConfigurationProperty ("duration", typeof (TimeSpan), "00:00:20", new TimeSpanconverter (), null, ConfigurationPropertyOptions.None);
+ extensions = new ConfigurationProperty ("extensions", typeof (XmlElementElementCollection), null, null, null, ConfigurationPropertyOptions.None);
+ max_results = new ConfigurationProperty ("maxResults", typeof (TimeSpan), "00:00:20", new TimeSpanconverter (), null, ConfigurationPropertyOptions.None);
+ scope_match_by = new ConfigurationProperty ("scopeMatchBy", typeof (Uri), null, null, null, ConfigurationPropertyOptions.None);
+ scopes = new ConfigurationProperty ("scopes", typeof (ScopeElementCollection), null, null, null, ConfigurationPropertyOptions.None);
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (types);
+ properties.Add (duration);
+ properties.Add (extensions);
+ properties.Add (max_results);
+ properties.Add (scope_match_by);
+ properties.Add (scopes);
+ }
+
+ public FindCriteriaElement ()
+ {
+ }
+
+ [ConfigurationProperty ("types")]
+ public ContractTypeNameElementCollection ContractTypeNames {
+ get { return (ContractTypeNameElementCollection) Properties [types]; }
+ }
+
+ [ConfigurationProperty ("duration", DefaultValue = "00:00:20")]
+ [TypeConverter (typeof (TimeSpanConverter))]
+ public TimeSpan Duration {
+ get { return (TimeSpan) Properties [duration]; }
+ set { Properties [duration] = value; }
+ }
+
+ [ConfigurationProperty ("extensions")]
+ public XmlElementElementCollection Extensions {
+ get { return (XmlElementElementCollection) Properties [extensions]; }
+ }
+
+ [ConfigurationProperty ("maxResults", DefaultValue = 0)]
+ [IntegerValidator (0, int.MaxValue)]
+ public int MaxResults {
+ get { return (int) Properties [max_results]; }
+ set { Properties [max_results] = value; }
+ }
+
+ [ConfigurationProperty ("scopeMatchBy")]
+ [TypeConverter (typeof (UriTypeConverter))]
+ public Uri ScopeMatchBy {
+ get { return (Uri) Properties [scope_match_by]; }
+ set { Properties [scope_match_by] = value; }
+ }
+
+ [ConfigurationProperty ("scopes")]
+ public ScopeElementCollection Scopes {
+ get { return (ScopeElementCollection) Properties [scopes]; }
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public sealed class ScopeElement : ConfigurationElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty scope;
+
+ static ScopeElement ()
+ {
+ scope = new ConfigurationProperty ("scopes", typeof (Uri), null, new CallbackValidator (typeof (ScopeElement), null/*FIXME: fill it*/), null, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (scope);
+ }
+
+ public ScopeElement ()
+ {
+ }
+
+ [MonoTODO]
+ [ConfigurationProperty ("scope", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
+ [CallbackValidator (CallbackMethodName = "ScopeValidatorCallback", Type = typeof (ScopeElement))]
+ public Uri Scope {
+ get { return (Uri) Properties [scope]; }
+ set { Properties [scope] = value; }
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ [ConfigurationCollection (typeof (ScopeElement))]
+ public sealed class ScopeElementCollection : ServiceModelConfigurationElementCollection<ScopeElement>
+ {
+ public ScopeElementCollection ()
+ {
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+using System.ServiceModel.Description;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public sealed class ServiceDiscoveryElement : BehaviorExtensionElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty announcement_endpoints;
+
+ static ServiceDiscoveryElement ()
+ {
+ announcement_endpoints = new ConfigurationProperty ("announcementEndpoints", typeof (AnnouncementChannelEndpointElementCollection), null, null, null, ConfigurationPropertyOptions.None);
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (announcement_endpoints);
+ }
+
+ public ServiceDiscoveryElement ()
+ {
+ }
+
+ [ConfigurationProperty ("announcementEndpoints")]
+ public AnnouncementChannelEndpointElementCollection AnnouncementEndpoints {
+ get { return Properties [announcement_endpoints]; }
+ }
+ public override Type BehaviorType {
+ get { return typeof (ServiceDiscoveryBehavior); }
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public class UdpAnnouncementEndpointCollectionElement : StandardEndpointCollectionElement<UdpAnnouncementEndpoint, UdpAnnouncementEndpointElement>
+ {
+ public UdpAnnouncementEndpointCollectionElement ()
+ {
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+using System.ServiceModel.Description;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public class UdpAnnouncementEndpointElement : AnnouncementEndpointElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty max_announcement_delay, multicast_address, transport_settings;
+
+ static UdpAnnouncementEndpointElement ()
+ {
+ max_announcement_delay = new ConfigurationProperty ("maxAnnouncementDelay", typeof (TimeSpan), "00:00:00.500", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+ multicast_address = new ConfigurationProperty ("multicastAddress", typeof (Uri), "soap.udp://239.255.255.250:3702", new UriTypeConverter (), null, ConfigurationPropertyOptions.None);
+ transport_settings = new ConfigurationProperty ("transportSettings", typeof (UdpTransportSettingsElement), null, null, null, ConfigurationPropertyOptions.None);
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (max_announcement_delay);
+ properties.Add (multicast_address);
+ properties.Add (transport_settings);
+ }
+
+ public UdpAnnouncementEndpointElement ()
+ {
+ }
+
+ protected override Type EndpointType {
+ get { return typeof (UdpAnnouncementEndpoint); }
+ }
+
+ [TypeConverter (typeof (TimeSpanConverter))]
+ [ConfigurationPropertyAttribute("maxAnnouncementDelay", DefaultValue = "00:00:00.500")]
+ public TimeSpan MaxAnnouncementDelay {
+ get { return Properties [max_announcement_delay]; }
+ set { Properties [max_announcement_delay] = value; }
+ }
+
+ [TypeConverter (typeof (UriTypeConverter))]
+ [ConfigurationPropertyAttribute("multicastAddress", DefaultValue = "soap.udp://239.255.255.250:3702")]
+ public Uri MulticastAddress {
+ get { return Properties [multicast_address]; }
+ set { Properties [multicast_address] = value; }
+ }
+
+ [ConfigurationPropertyAttribute("transportSettings")]
+ public UdpTransportSettingsElement TransportSettings {
+ get { return Properties [transport_settings]; }
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public class UdpDiscoveryEndpointCollectionElement : StandardEndpointCollectionElement<UdpDiscoveryEndpoint, UdpDiscoveryEndpointElement>
+ {
+ public UdpDiscoveryEndpointCollectionElement ()
+ {
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+using System.ServiceModel.Description;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public class UdpDiscoveryEndpointElement : DiscoveryEndpointElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty discovery_mode, max_response_delay, multicast_address, transport_settings;
+
+ static UdpDiscoveryEndpointElement ()
+ {
+ discovery_mode = new ConfigurationProperty ("discoveryMode", typeof (ServiceDiscoveryMode), ServiceDiscoveryMode.Adhoc, null, null, ConfigurationPropertyOptions.None);
+ max_response_delay = new ConfigurationProperty ("maxResponseDelay", typeof (TimeSpan), "00:00:00.500", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+ multicast_address = new ConfigurationProperty ("multicastAddress", typeof (Uri), "soap.udp://239.255.255.250:3702", new UriTypeConverter (), null, ConfigurationPropertyOptions.None);
+ transport_settings = new ConfigurationProperty ("transportSettings", typeof (UdpTransportSettingsElement), null, null, null, ConfigurationPropertyOptions.None);
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (discovery_mode);
+ properties.Add (max_response_delay);
+ properties.Add (multicast_address);
+ properties.Add (transport_settings);
+ }
+
+ public UdpDiscoveryEndpointElement ()
+ {
+ }
+
+ [ConfigurationProperty ("discoveryMode", DefaultValue = ServiceDiscoveryMode.Adhoc)]
+ public ServiceDiscoveryMode DiscoveryMode {
+ get { return (ServiceDiscoveryMode) Propperties [discovery_mode]; }
+ set { Properties [discovery_mode] = value; }
+ }
+
+ protected override Type EndpointType {
+ get { return typeof (UdpDiscoveryEndpoint); }
+ }
+
+ [ConfigurationProperty ("maxResponseDelay", DefaultValue = "00:00:00.500")]
+ public TimeSpan MaxResponseDelay {
+ get { return (TimeSpan) Propperties [max_response_delay]; }
+ set { Properties [max_response_delay] = value; }
+ }
+
+ [ConfigurationProperty ("multicastAddress", DefaultValue = "soap.udp://239.255.255.250:3702")]
+ public Uri MulticastAddress {
+ get { return (Uri) Propperties [multicast_address]; }
+ set { Properties [multicast_address] = value; }
+ }
+
+ [ConfigurationProperty ("transportSettings")]
+ public UdpTransportSettingsElement TransportSettings {
+ get { return (UdpTransportSettingsElement) Propperties [transport_settings]; }
+ }
+
+ protected override ServiceEndpoint CreateServiceEndpoint (ContractDescription contractDescription)
+ {
+ throw new NotImplementedException ();
+ }
+ protected override void InitializeFrom (ServiceEndpoint endpoint)
+ {
+ throw new NotImplementedException ();
+ }
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ChannelEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+ protected override void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+ protected override void OnInitializeAndValidate (ChannelEndpointElement channelEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+ protected override void OnInitializeAndValidate (ServiceEndpointElement channelEndpointElement)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
--- /dev/null
+using System;
+using System.ComponentModel;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+
+namespace System.ServiceModel.Discovery.Configuration
+{
+ public sealed class UdpTransportSettingsElement : ConfigurationElement
+ {
+ public UdpTransportSettingsElement ()
+ {
+ }
+ }
+}
+
../../build/common/Locale.cs
../../build/common/MonoTODOAttribute.cs
Assembly/AssemblyInfo.cs
+System.ServiceModel.Discovery.Configuration/AnnouncementChannelEndpointElementCollection.cs
+System.ServiceModel.Discovery.Configuration/AnnouncementEndpointCollectionElement.cs
+System.ServiceModel.Discovery.Configuration/AnnouncementEndpointElement.cs
+System.ServiceModel.Discovery.Configuration/ContractTypeNameElement.cs
+System.ServiceModel.Discovery.Configuration/ContractTypeNameElementCollection.cs
+System.ServiceModel.Discovery.Configuration/DiscoveryClientElement.cs
+System.ServiceModel.Discovery.Configuration/DiscoveryClientSettingsElement.cs
+System.ServiceModel.Discovery.Configuration/DiscoveryEndpointCollectionElement.cs
+System.ServiceModel.Discovery.Configuration/DiscoveryEndpointElement.cs
+System.ServiceModel.Discovery.Configuration/DiscoveryVersionConverter.cs
+System.ServiceModel.Discovery.Configuration/DynamicEndpointCollectionElement.cs
+System.ServiceModel.Discovery.Configuration/DynamicEndpointElement.cs
+System.ServiceModel.Discovery.Configuration/EndpointDiscoveryElement.cs
+System.ServiceModel.Discovery.Configuration/FindCriteriaElement.cs
+System.ServiceModel.Discovery.Configuration/ScopeElement.cs
+System.ServiceModel.Discovery.Configuration/ScopeElementCollection.cs
+System.ServiceModel.Discovery.Configuration/ServiceDiscoveryElement.cs
+System.ServiceModel.Discovery.Configuration/UdpAnnouncementEndpointCollectionElement.cs
+System.ServiceModel.Discovery.Configuration/UdpAnnouncementEndpointElement.cs
+System.ServiceModel.Discovery.Configuration/UdpDiscoveryEndpointCollectionElement.cs
+System.ServiceModel.Discovery.Configuration/UdpDiscoveryEndpointElement.cs
+System.ServiceModel.Discovery.Configuration/UdpTransportSettingsElement.cs
System.ServiceModel.Discovery.VersionApril2005/DiscoveryMessageSequenceApril2005.cs
System.ServiceModel.Discovery.VersionApril2005/EndpointDiscoveryMetadataApril2005.cs
System.ServiceModel.Discovery.VersionApril2005/FindCriteriaApril2005.cs
+2010-07-27 Andreia Gaita <avidigal@novell.com>
+
+ * JsonSerializationReader.cs: Add Char type to the switch. Reads the
+ content as a string and validates its length
+
+2010-07-27 Andreia Gaita <avidigal@novell.com>
+
+ * JsonSerializationReader.cs, JsonSerializationWriter.cs:
+ Add a special case for IDictionary, since KeyValuePair objects
+ have private setters and can't be processed via the normal
+ object code path.
+
2010-07-06 Atsushi Enomoto <atsushi@ximian.com>
* TypeMap.cs :
}
else
return reader.ReadElementContentAsString ();
+ case TypeCode.Char:
+ var c = reader.ReadElementContentAsString ();
+ if (c.Length > 1)
+ throw new XmlException ("Invalid JSON char");
+ return Char.Parse(c);
case TypeCode.Single:
return reader.ReadElementContentAsFloat ();
case TypeCode.Double:
#else
ret = collectionType.IsArray ? ((ArrayList) c).ToArray (elementType) : c;
#endif
+ } else if (typeof (IDictionary).IsAssignableFrom(collectionType)) {
+ IDictionary id = (IDictionary)Activator.CreateInstance (collectionType);
+
+ for (reader.MoveToContent (); reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ()) {
+ if (!reader.IsStartElement ("item"))
+ throw SerializationError (String.Format ("Expected element 'item', but found '{0}' in namespace '{1}'", reader.LocalName, reader.NamespaceURI));
+
+ // reading a KeyValuePair in the form of <Key .../><Value .../>
+ reader.Read ();
+ reader.MoveToContent ();
+ object key = ReadObject (elementType.GetGenericArguments ()[0]);
+ reader.MoveToContent ();
+ object val = ReadObject (elementType.GetGenericArguments ()[1]);
+ reader.Read ();
+ id[key] = val;
+ }
+ ret = id;
} else {
object c = Activator.CreateInstance (collectionType);
MethodInfo add = collectionType.GetMethod ("Add", new Type [] {elementType});
writer.WriteString (qn.Name);
writer.WriteString (":");
writer.WriteString (qn.Namespace);
+ } else if (graph is IDictionary) {
+ writer.WriteAttributeString ("type", "array");
+ IDictionary dic = (IDictionary) graph;
+ foreach (object o in dic.Keys) {
+ writer.WriteStartElement ("item");
+ writer.WriteAttributeString ("type", "object");
+ // outputting a KeyValuePair as <Key .. /><Value ... />
+ writer.WriteStartElement ("Key");
+ WriteObjectContent (o, false, !(graph is Array && graph.GetType ().GetElementType () != typeof (object)));
+ writer.WriteEndElement ();
+ writer.WriteStartElement ("Value");
+ WriteObjectContent (dic[o], false, !(graph is Array && graph.GetType ().GetElementType () != typeof (object)));
+ writer.WriteEndElement ();
+ writer.WriteEndElement ();
+ }
} else if (graph is ICollection) { // array
writer.WriteAttributeString ("type", "array");
foreach (object o in (ICollection) graph) {
--- /dev/null
+/WebServiceHostTest.cs -crlf
public class WebServiceHostTest\r
{\r
[Test]\r
- [Category("NotWorking")]
+ [Category("NotWorking")]\r
public void ServiceDebugBehaviorTest () {\r
\r
var host = new WebServiceHost (typeof (MyService), new Uri ("http://localhost:8080/"));\r
}\r
\r
[Test]\r
- [Category("NotWorking")]
+ [Category("NotWorking")]\r
public void WebHttpBehaviorTest2 () {\r
\r
var host = new WebServiceHost (typeof (MyService), new Uri ("http://localhost:8080/"));\r
--- /dev/null
+/System.ServiceModel_test_net_3_0.dll.config -crlf
+/System.ServiceModel_test_net_3_5.dll.config -crlf
[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
#if !MOONLIGHT
[assembly: InternalsVisibleTo ("System.ServiceModel.Routing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
+[assembly: InternalsVisibleTo ("System.ServiceModel.Discovery, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] // AnnouncementChannelEndpointElementCollection requires it.
#endif
+2010-07-30 Atsushi Enomoto <atsushi@ximian.com>
+
+ * AssemblyInfo.cs : add InternalVisibleTo(sys.sm.discovery).
+
2010-06-03 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Don't open internals to System.ServiceModel.Routing
+2010-07-30 Astushi Enomoto <atsushi@ximian.com>
+
+ * System.ServiceModel.dll.sources: add 4.0 standard endpoint types.
+
2010-07-12 Astushi Enomoto <atsushi@ximian.com>
* System.ServiceModel.dll.sources: remove SecurityHandler.cs
// FIXME: use proper max buffer
buf = source.CreateBufferedCopy (int.MaxValue);
+Console.WriteLine ("####### " + buf.CreateMessage ());
doc = new XmlDocument ();
doc.PreserveWhitespace = true;
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * SecurityBindingElement.cs : implement ToString().
+
2010-07-15 Atsushi Enomoto <atsushi@ximian.com>
* MtomMessageEncodingBindingElement.cs, MtomMessageEncoder.cs :
using System.IdentityModel.Tokens;
using System.ServiceModel.Security.Tokens;
#endif
+using System.Text;
namespace System.ServiceModel.Channels
{
p.SetKeyDerivation (requireDerivedKeys);
}
- [MonoTODO]
public override string ToString ()
{
- return base.ToString ();
+ var sb = new StringBuilder ();
+ sb.Append (GetType ().FullName).Append (":\n");
+ foreach (var pi in GetType ().GetProperties ()) {
+ var simple = Type.GetTypeCode (pi.PropertyType) != TypeCode.Object;
+ var val = pi.GetValue (this, null);
+ sb.Append (pi.Name).Append (':');
+ if (val != null)
+ sb.AppendFormat ("{0}{1}{2}", simple ? " " : "\n", simple ? "" : " ", String.Join ("\n ", val.ToString ().Split ('\n')));
+ sb.Append ('\n');
+ }
+ sb.Length--; // chop trailing EOL.
+ return sb.ToString ();
}
#else
[MonoTODO]
[ConfigurationProperty ("transactionTimeout",
DefaultValue = "00:00:00",
Options = ConfigurationPropertyOptions.None)]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan TransactionTimeout {
get { return (TimeSpan) base ["transactionTimeout"]; }
set { base ["transactionTimeout"] = value; }
+2010-07-30 Atsushi Enomoto <atsushi@ximian.com>
+
+ * EndpointCollectionElement.cs,
+ StandardEndpointCollectionElement.cs,
+ StandardEndpointElement.cs,
+ StandardEndpointElementCollection.cs : new 4.0 types.
+
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * CallbackTimeoutsElement.cs
+ ChannelPoolSettingsElement.cs
+ ClaimTypeElement.cs
+ ClientCredentialsElement.cs
+ ServiceCredentialsElement.cs
+ ServiceModelExtensionCollectionElement.cs
+ StandardBindingOptionalReliableSessionElement.cs
+ StandardBindingReliableSessionElement.cs : couple of API fixes.
+ * LocalClientSecuritySettingsElement.cs : fixed Properties.
+
+2010-07-27 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ClaimTypeElement.cs
+ ClaimTypeElementCollection.cs
+ FederatedMessageSecurityOverHttpElement.cs
+ StandardBindingOptionalReliableSessionElement.cs
+ StandardBindingReliableSessionElement.cs
+ WSFederationHttpBindingElement.cs
+ WSFederationHttpSecurityElement.cs
+ WSHttpBindingBaseElement.cs : implemented ApplyConfiguration and
+ add/fix descendants' members.
+
+2010-07-27 Atsushi Enomoto <atsushi@ximian.com>
+
+ * FederatedMessageSecurityOverHttpElement.cs : use correct converter.
+ * WSFederationHttpBindingCollectionElement.cs : remove extra members.
+ * WSDualHttpBindingElement.cs, WSFederationHttpBindingElement.cs :
+ fill base properties expectedly.
+
+2010-07-27 Atsushi Enomoto <atsushi@ximian.com>
+
+ * WSDualHttpBindingElement.cs, WSFederationHttpBindingElement.cs :
+ BindingElementType is not a configuration property.
+
+2010-07-27 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ConfigUtil.cs : the error message can be less ambiguous.
+
+2010-07-26 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ConfigUtil.cs, ServiceCredentialsElement.cs :
+ implement x509 store support.
+
2010-07-08 Atsushi Enomoto <atsushi@ximian.com>
* ClientCredentialsElement.cs : warning cleanup.
[ConfigurationProperty ("idleTimeout",
DefaultValue = "00:02:00",
Options = ConfigurationPropertyOptions.None)]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan IdleTimeout {
get { return (TimeSpan) base ["idleTimeout"]; }
set { base ["idleTimeout"] = value; }
[ConfigurationProperty ("leaseTimeout",
DefaultValue = "00:10:00",
Options = ConfigurationPropertyOptions.None)]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan LeaseTimeout {
get { return (TimeSpan) base ["leaseTimeout"]; }
set { base ["leaseTimeout"] = value; }
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
+using System.ServiceModel.Security.Tokens;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
- [MonoTODO]
public sealed partial class ClaimTypeElement
: ConfigurationElement
{
{
}
+ public ClaimTypeElement (string claimType, bool isOptional)
+ {
+ ClaimType = claimType;
+ IsOptional = isOptional;
+ }
// Properties
get { return properties; }
}
-
+ internal ClaimTypeRequirement Create ()
+ {
+ return new ClaimTypeRequirement (ClaimType, IsOptional);
+ }
}
}
RemoveItemName = "remove",
ClearItemsName = "clear",
CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)]
- [MonoTODO]
public sealed partial class ClaimTypeElementCollection
: ServiceModelConfigurationElementCollection<ClaimTypeElement>, ICollection, IEnumerable
{
// Properties
-
-
}
}
protected internal override object CreateBehavior ()
{
var cb = new ClientCredentials ();
+ ApplyConfiguration (cb);
+ return cb;
+ }
+
+ protected internal void ApplyConfiguration (ClientCredentials cb)
+ {
cb.SupportInteractive = SupportInteractive;
// how is "Type" used?
// Windows
cb.Windows.AllowedImpersonationLevel = Windows.AllowedImpersonationLevel;
cb.Windows.AllowNtlm = Windows.AllowNtlm;
-
- return cb;
}
object CreateInstance (string typeName)
return null;
}
+ public static X509Certificate2 CreateCertificateFrom (StoreLocation storeLocation, StoreName storeName, X509FindType findType, Object findValue)
+ {
+ var store = new X509Store (storeName, storeLocation);
+ store.Open (OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
+ try {
+ foreach (var c in store.Certificates.Find (findType, findValue, false))
+ return c;
+ throw new InvalidOperationException (String.Format ("Specified X509 certificate with find type {0} and find value {1} was not found in X509 store {2} location {3}", findType, findValue, storeName, storeLocation));
+ } finally {
+ store.Close ();
+ }
+ }
+
public static X509Certificate2 CreateInstance (this CertificateElement el)
{
return new X509Certificate2 (Convert.FromBase64String (el.EncodedValue));
}
- public static X509Certificate2 CreateCertificateFrom (StoreLocation storeLocation, StoreName storeName, X509FindType findType, Object findValue)
- {
- throw new NotImplementedException ();
- }
-
public static X509Certificate2 CreateInstance (this CertificateReferenceElement el)
{
return CreateCertificateFrom (el.StoreLocation, el.StoreName, el.X509FindType, el.FindValue);
--- /dev/null
+//
+// EndpointCollectionElement.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2006 Novell, Inc. http://www.novell.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_4_0
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Configuration;
+using System.Net;
+using System.Net.Security;
+using System.Reflection;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Principal;
+using System.IdentityModel.Claims;
+using System.IdentityModel.Policy;
+using System.IdentityModel.Tokens;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Diagnostics;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.MsmqIntegration;
+using System.ServiceModel.PeerResolvers;
+using System.ServiceModel.Security;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Xml;
+
+using ConfigurationType = System.Configuration.Configuration;
+
+namespace System.ServiceModel.Configuration
+{
+ public abstract class EndpointCollectionElement : ConfigurationElement
+ {
+ public abstract ReadOnlyCollection<StandardEndpointElement> ConfiguredEndpoints { get; }
+
+ public string EndpointName {
+ get { throw new NotImplementedException (); }
+ }
+
+ public abstract Type EndpointType { get; }
+
+ public abstract bool ContainsKey (string name);
+
+ protected internal abstract StandardEndpointElement GetDefaultStandardEndpointElement ();
+
+ protected internal abstract bool TryAdd (string name, ServiceEndpoint endpoint, ConfigurationType config);
+ }
+}
+#endif
static ConfigurationPropertyCollection properties;
static ConfigurationProperty algorithm_suite;
static ConfigurationProperty claim_type_requirements;
+ static ConfigurationProperty establish_security_context;
static ConfigurationProperty issued_key_type;
static ConfigurationProperty issued_token_type;
static ConfigurationProperty issuer;
{
properties = new ConfigurationPropertyCollection ();
algorithm_suite = new ConfigurationProperty ("algorithmSuite",
- typeof (SecurityAlgorithmSuite), "Default", null/* FIXME: get converter for SecurityAlgorithmSuite*/, null,
+ typeof (SecurityAlgorithmSuite), "Default", new SecurityAlgorithmSuiteConverter (), null,
ConfigurationPropertyOptions.None);
claim_type_requirements = new ConfigurationProperty ("claimTypeRequirements",
typeof (ClaimTypeElementCollection), null, null/* FIXME: get converter for ClaimTypeElementCollection*/, null,
ConfigurationPropertyOptions.None);
+ establish_security_context = new ConfigurationProperty ("establishSecurityContext",
+ typeof (bool), "true", new BooleanConverter (), null,
+ ConfigurationPropertyOptions.None);
+
issued_key_type = new ConfigurationProperty ("issuedKeyType",
typeof (SecurityKeyType), "SymmetricKey", null/* FIXME: get converter for SecurityKeyType*/, null,
ConfigurationPropertyOptions.None);
properties.Add (algorithm_suite);
properties.Add (claim_type_requirements);
+ properties.Add (establish_security_context);
properties.Add (issued_key_type);
properties.Add (issued_token_type);
properties.Add (issuer);
get { return (ClaimTypeElementCollection) base [claim_type_requirements]; }
}
+ [ConfigurationProperty ("establishSecurityContext",
+ Options = ConfigurationPropertyOptions.None,
+ DefaultValue = true)]
+ public bool EstablishSecurityContext {
+ get { return (bool) base [establish_security_context]; }
+ set { base [establish_security_context] = value; }
+ }
+
[ConfigurationProperty ("issuedKeyType",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "SymmetricKey")]
get { return (XmlElementElementCollection) base [token_request_parameters]; }
}
-
+ // Methods
+ internal void ApplyConfiguration (FederatedMessageSecurityOverHttp s)
+ {
+ s.AlgorithmSuite = AlgorithmSuite;
+ foreach (ClaimTypeElement cte in ClaimTypeRequirements)
+ s.ClaimTypeRequirements.Add (cte.Create ());
+ s.EstablishSecurityContext = EstablishSecurityContext;
+ s.IssuedKeyType = IssuedKeyType;
+ s.IssuedTokenType = IssuedTokenType;
+ if (Issuer.Address != null)
+ s.IssuerAddress = new EndpointAddress (Issuer.Address, Issuer.Identity.Create (), Issuer.Headers.Headers);
+ if (!String.IsNullOrEmpty (Issuer.Binding))
+ s.IssuerBinding = ConfigUtil.CreateBinding (Issuer.Binding, Issuer.BindingConfiguration);
+ if (IssuerMetadata.Address != null)
+ s.IssuerMetadataAddress = new EndpointAddress (IssuerMetadata.Address, IssuerMetadata.Identity.Create (), IssuerMetadata.Headers.Headers);
+ s.NegotiateServiceCredential = NegotiateServiceCredential;
+ foreach (XmlElementElement xee in TokenRequestParameters)
+ s.TokenRequestParameters.Add (xee.XmlElement);
+ }
}
}
public sealed class LocalClientSecuritySettingsElement
: ConfigurationElement
{
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty cache_cookies;
+ static ConfigurationProperty cookie_renewal_threshold_percentage;
+ static ConfigurationProperty detect_replays;
+ static ConfigurationProperty max_clock_skew;
+ static ConfigurationProperty max_cookie_caching_time;
+ static ConfigurationProperty reconnect_transport_on_failure;
+ static ConfigurationProperty replay_cache_size;
+ static ConfigurationProperty replay_window;
+ static ConfigurationProperty session_key_renewal_interval;
+ static ConfigurationProperty session_key_rollover_interval;
+ static ConfigurationProperty timestamp_validity_duration;
+
+ static LocalClientSecuritySettingsElement ()
+ {
+ cache_cookies = new ConfigurationProperty ("cacheCookies", typeof (bool), true, null, null, ConfigurationPropertyOptions.None);
+
+ cookie_renewal_threshold_percentage = new ConfigurationProperty ("cookieRenewalThresholdPercentage", typeof (int), 60, null, new IntegerValidator (0, 100, false), ConfigurationPropertyOptions.None);
+
+ detect_replays = new ConfigurationProperty ("detectReplays", typeof (bool), true, null, null, ConfigurationPropertyOptions.None);
+
+ max_clock_skew = new ConfigurationProperty ("maxClockSkew", typeof (TimeSpan), "00:05:00", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+ max_cookie_caching_time = new ConfigurationProperty ("maxCookieCachingTime", typeof (TimeSpan), "10675199.02:48:05.4775807", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+ reconnect_transport_on_failure = new ConfigurationProperty ("reconnectTransportOnFailure", typeof (bool), true, null, null, ConfigurationPropertyOptions.None);
+
+ replay_cache_size = new ConfigurationProperty ("replayCacheSize", typeof (int), 900000, null, new IntegerValidator (1, int.MaxValue, false), ConfigurationPropertyOptions.None);
+
+ replay_window = new ConfigurationProperty ("replayWindow", typeof (TimeSpan), "00:05:00", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+ session_key_renewal_interval = new ConfigurationProperty ("sessionKeyRenewalInterval", typeof (TimeSpan), "10:00:00", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+ session_key_rollover_interval = new ConfigurationProperty ("sessionKeyRolloverInterval", typeof (TimeSpan), "00:05:00", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+ timestamp_validity_duration = new ConfigurationProperty ("timestampValidityDuration", typeof (TimeSpan), "00:05:00", new TimeSpanConverter (), null, ConfigurationPropertyOptions.None);
+
+ properties = new ConfigurationPropertyCollection ();
+
+ properties.Add (cache_cookies);
+ properties.Add (cookie_renewal_threshold_percentage);
+ properties.Add (detect_replays);
+ properties.Add (max_clock_skew);
+ properties.Add (max_cookie_caching_time);
+ properties.Add (reconnect_transport_on_failure);
+ properties.Add (replay_cache_size);
+ properties.Add (replay_window);
+ properties.Add (session_key_renewal_interval);
+ properties.Add (session_key_rollover_interval);
+ properties.Add (timestamp_validity_duration);
+ }
+
public LocalClientSecuritySettingsElement ()
{
}
}
protected override ConfigurationPropertyCollection Properties {
- get { return base.Properties; }
+ get { return properties; }
}
[ConfigurationProperty ("reconnectTransportOnFailure",
[ConfigurationProperty ("sessionKeyRolloverInterval",
Options = ConfigurationPropertyOptions.None,
DefaultValue = "00:05:00")]
+ [TypeConverter (typeof (TimeSpanConverter))]
public TimeSpan SessionKeyRolloverInterval {
get { return (TimeSpan) base ["sessionKeyRolloverInterval"]; }
set { base ["sessionKeyRolloverInterval"] = value; }
namespace System.ServiceModel.Configuration
{
- public sealed class ServiceCredentialsElement
- : BehaviorExtensionElement
+ public class ServiceCredentialsElement : BehaviorExtensionElement
{
public ServiceCredentialsElement () {
}
get { return (WindowsServiceElement) base ["windowsAuthentication"]; }
}
- [MonoTODO]
protected internal override object CreateBehavior ()
{
var sb = new ServiceCredentials ();
+ ApplyConfiguration (sb);
+ return sb;
+ }
+ protected internal void ApplyConfiguration (ServiceCredentials sb)
+ {
// IssuedToken
foreach (AllowedAudienceUriElement ae in IssuedTokenAuthentication.AllowedAudienceUris)
sb.IssuedTokenAuthentication.AllowedAudienceUris.Add (ae.AllowedAudienceUri);
// Windows
sb.WindowsAuthentication.AllowAnonymousLogons = WindowsAuthentication.AllowAnonymousLogons;
sb.WindowsAuthentication.IncludeWindowsGroups = WindowsAuthentication.IncludeWindowsGroups;
-
- return sb;
}
X509Certificate2 GetCertificate (StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue)
{
- throw new NotImplementedException ();
+ return ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
}
object CreateInstance (string typeName)
namespace System.ServiceModel.Configuration
{
- [MonoTODO]
- public class ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>
- : ConfigurationElement,
+ public abstract class ServiceModelExtensionCollectionElement<TServiceModelExtensionElement> : ConfigurationElement,
ICollection<TServiceModelExtensionElement>,
- IEnumerable<TServiceModelExtensionElement>,
+ IEnumerable<TServiceModelExtensionElement>,
IEnumerable
where TServiceModelExtensionElement : ServiceModelExtensionElement
{
+ internal ServiceModelExtensionCollectionElement ()
+ {
+ }
+
ConfigurationPropertyCollection properties;
KeyedByTypeCollection<TServiceModelExtensionElement> _list = new KeyedByTypeCollection<TServiceModelExtensionElement> ();
namespace System.ServiceModel.Configuration
{
- [MonoTODO]
public sealed partial class StandardBindingOptionalReliableSessionElement
: StandardBindingReliableSessionElement
{
get { return properties; }
}
+ // Methods
+ public void ApplyConfiguration (OptionalReliableSession s)
+ {
+ base.ApplyConfiguration (s);
+ s.Enabled = this.Enabled;
+ }
}
}
get { return properties; }
}
+ // Methods
+ public void ApplyConfiguration (ReliableSession s)
+ {
+ s.InactivityTimeout = InactivityTimeout;
+ s.Ordered = Ordered;
+ }
}
}
--- /dev/null
+//
+// StandardEndpointCollectionElement.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2006 Novell, Inc. http://www.novell.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_4_0
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Configuration;
+using System.Net;
+using System.Net.Security;
+using System.Reflection;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Principal;
+using System.IdentityModel.Claims;
+using System.IdentityModel.Policy;
+using System.IdentityModel.Tokens;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Diagnostics;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.MsmqIntegration;
+using System.ServiceModel.PeerResolvers;
+using System.ServiceModel.Security;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Xml;
+
+using ConfigurationType = System.Configuration.Configuration;
+
+namespace System.ServiceModel.Configuration
+{
+ public class StandardEndpointCollectionElement<TStandardEndpoint, TEndpointConfiguration> : EndpointCollectionElement
+ where TStandardEndpoint : ServiceEndpoint
+ where TEndpointConfiguration : StandardEndpointElement, new()
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty endpoints = new ConfigurationProperty ("endpoints",
+ typeof (StandardEndpointElementCollection<TEndpointConfiguration>), null, null, null,
+ ConfigurationPropertyOptions.IsDefaultCollection);
+
+
+ static StandardEndpointCollectionElement ()
+ {
+ }
+
+ void FillProperties (ConfigurationPropertyCollection baseProps)
+ {
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (endpoints);
+ }
+
+ public override ReadOnlyCollection<StandardEndpointElement> ConfiguredEndpoints {
+ get { throw new NotImplementedException (); }
+ }
+
+ [ConfigurationPropertyAttribute("", Options = ConfigurationPropertyOptions.IsDefaultCollection)]
+ public StandardEndpointElementCollection<TEndpointConfiguration> Endpoints {
+ get { return (StandardEndpointElementCollection<TEndpointConfiguration>) base [endpoints]; }
+ }
+
+ public override Type EndpointType {
+ get { return typeof (TStandardEndpoint); }
+ }
+
+ protected override ConfigurationPropertyCollection Properties {
+ get {
+ if (properties == null)
+ lock (endpoints)
+ if (properties == null)
+ FillProperties (base.Properties);
+ return properties;
+ }
+ }
+
+ public override bool ContainsKey (string name)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected internal override StandardEndpointElement GetDefaultStandardEndpointElement ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected internal override bool TryAdd (string name, ServiceEndpoint endpoint, ConfigurationType config)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
--- /dev/null
+//
+// StandardEndpointElement.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_4_0
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Configuration;
+using System.Net;
+using System.Net.Security;
+using System.Reflection;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Principal;
+using System.IdentityModel.Claims;
+using System.IdentityModel.Policy;
+using System.IdentityModel.Tokens;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Diagnostics;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.MsmqIntegration;
+using System.ServiceModel.PeerResolvers;
+using System.ServiceModel.Security;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Xml;
+
+namespace System.ServiceModel.Configuration
+{
+ public abstract class StandardEndpointElement : ConfigurationElement
+ {
+ static ConfigurationPropertyCollection properties;
+ static ConfigurationProperty name = new ConfigurationProperty ("name",
+ typeof (string), null, null, new StringValidator (0),
+ ConfigurationPropertyOptions.IsKey);
+
+ static StandardEndpointElement ()
+ {
+ properties = new ConfigurationPropertyCollection ();
+ properties.Add (name);
+ }
+
+ [StringValidator (MinLength = 0)]
+ [ConfigurationProperty ("name", Options = ConfigurationPropertyOptions.IsKey)]
+ public string Name {
+ get { return (string) base [name]; }
+ set { base [name] = value; }
+ }
+
+ protected internal abstract Type EndpointType { get; }
+
+ protected override ConfigurationPropertyCollection Properties {
+ get { return properties; }
+ }
+
+ protected internal abstract ServiceEndpoint CreateServiceEndpoint (ContractDescription contractDescription);
+
+ protected internal virtual void InitializeFrom (ServiceEndpoint endpoint)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected abstract void OnApplyConfiguration (ServiceEndpoint endpoint, ChannelEndpointElement channelEndpointElement);
+
+ protected abstract void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement channelEndpointElement);
+
+ protected abstract void OnInitializeAndValidate (ChannelEndpointElement channelEndpointElement);
+
+ protected abstract void OnInitializeAndValidate (ServiceEndpointElement channelEndpointElement);
+
+ protected override void Reset (ConfigurationElement parentElement)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
--- /dev/null
+//
+// StandardEndpointElementCollection.cs
+//
+// Author:
+// Atsushi Enomoto <atsushi@ximian.com>
+//
+// Copyright (C) 2010 Novell, Inc. http://www.novell.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_4_0
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Configuration;
+using System.Net;
+using System.Net.Security;
+using System.Reflection;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Principal;
+using System.IdentityModel.Claims;
+using System.IdentityModel.Policy;
+using System.IdentityModel.Tokens;
+using System.ServiceModel;
+using System.ServiceModel.Channels;
+using System.ServiceModel.Description;
+using System.ServiceModel.Diagnostics;
+using System.ServiceModel.Dispatcher;
+using System.ServiceModel.MsmqIntegration;
+using System.ServiceModel.PeerResolvers;
+using System.ServiceModel.Security;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Xml;
+
+namespace System.ServiceModel.Configuration
+{
+ public sealed class StandardEndpointElementCollection<TEndpointConfiguration> : ServiceModelEnhancedConfigurationElementCollection<TEndpointConfiguration>
+ where TEndpointConfiguration : StandardEndpointElement, new()
+ {
+ }
+}
+#endif
{
// Static Fields
static ConfigurationPropertyCollection properties;
- static ConfigurationProperty binding_element_type;
static ConfigurationProperty bypass_proxy_on_local;
static ConfigurationProperty client_base_address;
static ConfigurationProperty host_name_comparison_mode;
static ConfigurationProperty use_default_web_proxy;
static WSDualHttpBindingElement ()
+ {
+ }
+
+ static void FillProperties (ConfigurationPropertyCollection baseProps)
{
properties = new ConfigurationPropertyCollection ();
- binding_element_type = new ConfigurationProperty ("",
- typeof (Type), null, new TypeConverter (), null,
- ConfigurationPropertyOptions.None);
+ foreach (ConfigurationProperty prop in baseProps)
+ properties.Add (prop);
bypass_proxy_on_local = new ConfigurationProperty ("bypassProxyOnLocal",
typeof (bool), "false", new BooleanConverter (), null,
typeof (bool), "true", new BooleanConverter (), null,
ConfigurationPropertyOptions.None);
- properties.Add (binding_element_type);
properties.Add (bypass_proxy_on_local);
properties.Add (client_base_address);
properties.Add (host_name_comparison_mode);
// Properties
protected override Type BindingElementType {
- get { return (Type) base [binding_element_type]; }
+ get { return typeof (WSDualHttpBindingElement); }
}
[ConfigurationProperty ("bypassProxyOnLocal",
}
protected override ConfigurationPropertyCollection Properties {
- get { return properties; }
+ get {
+ if (properties == null) {
+ var baseProps = base.Properties;
+ lock (baseProps)
+ FillProperties (baseProps);
+ }
+ return properties;
+ }
}
[ConfigurationProperty ("proxyAddress",
namespace System.ServiceModel.Configuration
{
- [MonoTODO]
public partial class WSFederationHttpBindingCollectionElement
: StandardBindingCollectionElement<WSFederationHttpBinding, WSFederationHttpBindingElement>
{
- // Static Fields
- static ConfigurationPropertyCollection properties;
-
- static WSFederationHttpBindingCollectionElement ()
- {
- properties = new ConfigurationPropertyCollection ();
- }
-
- public WSFederationHttpBindingCollectionElement ()
- {
- }
-
-
- // Properties
-
-
}
-
}
namespace System.ServiceModel.Configuration
{
- [MonoTODO]
public partial class WSFederationHttpBindingElement
: WSHttpBindingBaseElement, IBindingConfigurationElement
{
// Static Fields
static ConfigurationPropertyCollection properties;
- static ConfigurationProperty binding_element_type;
static ConfigurationProperty privacy_notice_at;
static ConfigurationProperty privacy_notice_version;
static ConfigurationProperty security;
static WSFederationHttpBindingElement ()
+ {
+ }
+
+ static void FillProperties (ConfigurationPropertyCollection baseProps)
{
properties = new ConfigurationPropertyCollection ();
+ foreach (ConfigurationProperty item in baseProps)
+ properties.Add (item);
privacy_notice_at = new ConfigurationProperty ("privacyNoticeAt",
typeof (Uri), null, new UriTypeConverter (), null,
typeof (WSFederationHttpSecurityElement), null, null/* FIXME: get converter for WSFederationHttpSecurityElement*/, null,
ConfigurationPropertyOptions.None);
- properties.Add (binding_element_type);
properties.Add (privacy_notice_at);
properties.Add (privacy_notice_version);
properties.Add (security);
// Properties
protected override Type BindingElementType {
- get { return (Type) base [binding_element_type]; }
+ get { return typeof (WSFederationHttpBinding); }
}
[ConfigurationProperty ("privacyNoticeAt",
}
protected override ConfigurationPropertyCollection Properties {
- get { return properties; }
+ get {
+ if (properties == null) {
+ var baseProps = base.Properties;
+ lock (baseProps)
+ FillProperties (baseProps);
+ }
+ return properties;
+ }
}
[ConfigurationProperty ("security",
get { return (WSFederationHttpSecurityElement) base [security]; }
}
-
-
- protected override void OnApplyConfiguration (Binding binding) {
- throw new NotImplementedException ();
+ protected override void OnApplyConfiguration (Binding binding)
+ {
+ base.OnApplyConfiguration (binding);
+ var b = (WSFederationHttpBinding) binding;
+ b.PrivacyNoticeAt = PrivacyNoticeAt;
+ b.PrivacyNoticeVersion = PrivacyNoticeVersion;
+ Security.ApplyConfiguration (b.Security);
}
}
namespace System.ServiceModel.Configuration
{
- [MonoTODO]
public sealed partial class WSFederationHttpSecurityElement
: ConfigurationElement
{
get { return properties; }
}
-
+ internal void ApplyConfiguration (WSFederationHttpSecurity security)
+ {
+ security.Mode = Mode;
+ Message.ApplyConfiguration (security.Message);
+ }
}
}
set { this ["useDefaultWebProxy"] = value; }
}
-
+ protected override void OnApplyConfiguration (Binding binding)
+ {
+ var b = (WSHttpBindingBase) binding;
+ b.BypassProxyOnLocal = BypassProxyOnLocal;
+ b.HostNameComparisonMode = HostNameComparisonMode;
+ b.MaxBufferPoolSize = MaxBufferPoolSize;
+ b.MaxReceivedMessageSize = MaxReceivedMessageSize;
+ b.MessageEncoding = MessageEncoding;
+ b.ProxyAddress = ProxyAddress;
+ b.ReaderQuotas = ReaderQuotas.Create ();
+ ReliableSession.ApplyConfiguration (b.ReliableSession);
+ b.TextEncoding = TextEncoding;
+ b.TransactionFlow = TransactionFlow;
+ b.UseDefaultWebProxy = UseDefaultWebProxy;
+ }
}
}
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ServiceDebugBehavior.cs, ServiceMetadataExtension.cs :
+ remove invalid comments.
+
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ServiceDescription.cs : fill Name and Namespace. Remove extra code.
+
2010-07-19 Sebastien Pouliot <sebastien@ximian.com>
* ClientCredentials.cs: Fix NET_2_1 builds
if (HttpHelpPageEnabled) {
Uri uri = serviceHostBase.CreateUri ("http", HttpHelpPageUrl);
if (uri != null)
- // FIXME: wrong. It should add help page
sme.EnsureChannelDispatcher (false, "http", uri, HttpHelpPageBinding);
}
if (HttpsHelpPageEnabled) {
Uri uri = serviceHostBase.CreateUri ("https", HttpsHelpPageUrl);
if (uri != null)
- // FIXME: wrong. It should add help page
sme.EnsureChannelDispatcher (false, "https", uri, HttpsHelpPageBinding);
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Linq;
using System.Reflection;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace System.ServiceModel.Description
{
+ internal static class Extensions
+ {
+ public static T GetCustomAttribute<T> (this MemberInfo mi, bool inherit) where T : Attribute
+ {
+ foreach (T att in mi.GetCustomAttributes (typeof (T), inherit))
+ return att;
+ return null;
+ }
+ }
+
public class ServiceDescription
{
ServiceEndpointCollection endpoints = new ServiceEndpointCollection ();
// null Type is not rejected
ServiceDescription sd = new ServiceDescription ();
sd.ServiceType = type;
+ if (type != null) {
+ var att = type.GetCustomAttribute<ServiceBehaviorAttribute> (true);
+ if (att != null) {
+ sd.Name = att.Name;
+ sd.Namespace = att.Namespace;
+ }
+ if (sd.Name == null)
+ sd.Name = type.Name;
+ if (sd.Namespace == null)
+ sd.Namespace = "http://tempuri.org/";
+ }
return sd;
}
sd.ServiceType = wellKnown != null ? wellKnown.GetType () : null;
return sd;
}
-
-/*
- internal ServiceEndpoint AddServiceEndpoint (Type contractType,
- Binding binding)
- {
- return AddServiceEndpoint (contractType, binding, null);
- }
-
- internal ServiceEndpoint AddServiceEndpoint (
- Type contractType, Binding binding,
- EndpointAddress address)
- {
- foreach (ServiceEndpoint i in Endpoints)
- if (i.Address.Equals (address) &&
- i.Binding.Equals (binding) &&
- i.Contract.ContractType == contractType)
- return i;
-
- ContractDescription cd;
- if (!contracts.Contains (contractType)) {
- cd = ContractDescription.GetContract (contractType);
- contracts.Add (contractType,
- cd);
- }
- else
- cd = contracts [contractType];
-
- ServiceEndpoint se = new ServiceEndpoint (
- cd, binding, address);
-
- Endpoints.Add (se);
-
- return se;
- }
-*/
}
}
return sme;
}
- // FIXME: distinguish HTTP and HTTPS in the Url properties.
- // FIXME: reject such ServiceDescription that has no HTTP(S) binding.
- // FIXME: it should not use the binding that is used in the ServiceEndpoint. For example, WSDL results have to be given as text, not binary.
// FIXME: if the ServiceDescription has a base address (e.g. http://localhost:8080) and HttpGetUrl is empty, it returns UnknownDestination while it is expected to return the HTTP help page.
internal void EnsureChannelDispatcher (bool isMex, string scheme, Uri uri, WCFBinding binding)
{
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * SecurityTokenParameters.cs, SupportingTokenParameters.cs,
+ SslSecurityTokenParameters.cs, IssuedSecurityTokenParameters.cs,
+ SspiSecurityTokenParameters.cs,
+ SecureConversationSecurityTokenParameters.cs :
+ implement ToString().
+
2010-07-15 Atsushi Enomoto <atsushi@ximian.com>
* SslSecurityTokenProvider.cs : verify mismatch. We don't have
Collection<XmlElement> additional_reqs =
new Collection<XmlElement> ();
- [MonoTODO]
public override string ToString ()
{
return base.ToString ();
requirement.KeyType = SecurityKeyType.SymmetricKey;
}
- [MonoTODO]
public override string ToString ()
{
return base.ToString ();
using System.IdentityModel.Tokens;
using System.ServiceModel.Channels;
using System.ServiceModel.Security;
+using System.Text;
namespace System.ServiceModel.Security.Tokens
{
return CloneCore ();
}
- [MonoTODO]
public override string ToString ()
{
- return base.ToString ();
+ var sb = new StringBuilder ();
+ sb.Append (GetType ().FullName).Append (":\n");
+ foreach (var pi in GetType ().GetProperties ()) {
+ var simple = Type.GetTypeCode (pi.PropertyType) != TypeCode.Object;
+ var val = pi.GetValue (this, null);
+ sb.Append (pi.Name).Append (':');
+ if (val != null)
+ sb.AppendFormat ("{0}{1}{2}", simple ? " " : "\n", simple ? "" : " ", String.Join ("\n ", val.ToString ().Split ('\n')));
+ sb.Append ('\n');
+ }
+ sb.Length--; // chop trailing EOL.
+ return sb.ToString ();
}
protected abstract bool HasAsymmetricKey { get; }
set { cancel = value; }
}
- [MonoTODO]
public override string ToString ()
{
return base.ToString ();
requirement.KeyType = SecurityKeyType.SymmetricKey;
}
- [MonoTODO]
public override string ToString ()
{
return base.ToString ();
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Security;
+using System.Text;
using ParamList = System.Collections.ObjectModel.Collection<System.ServiceModel.Security.Tokens.SecurityTokenParameters>;
p.RequireDerivedKeys = requireDerivedKeys;
}
- [MonoTODO]
public override string ToString ()
{
- return base.ToString ();
+ var sb = new StringBuilder ();
+ AppendCollection (sb, Endorsing, "endorsing", "Endorsing");
+ AppendCollection (sb, Signed, "signed", "Signed");
+ AppendCollection (sb, SignedEncrypted, "signed encrypted", "SignedEncrypted");
+ AppendCollection (sb, SignedEndorsing, "signed endorsing", "SignedEndorsing");
+ sb.Length--; // chop trailing EOL.
+ return sb.ToString ();
+ }
+
+ void AppendCollection (StringBuilder sb, Collection<SecurityTokenParameters> col, string emptyLabel, string label)
+ {
+ if (col.Count == 0)
+ sb.AppendFormat ("No {0} tokens.\n", emptyLabel);
+ for (int i = 0; i < col.Count; i++)
+ sb.AppendFormat ("{0}[{1}]\n {2}\n", label, i, String.Join ("\n ", col [i].ToString ().Split ('\n')));
}
}
}
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ServiceCredentialsSecurityTokenManager.cs : implement some
+ requirement check for WS-SecureConversation.
+
+2010-07-27 Atsushi Enomoto <atsushi@ximian.com>
+
+ * X509CertificateRecipientClientCredential.cs,
+ X509CertificateRecipientServiceCredential.cs :
+ implement x509 store support.
+
+2010-07-26 Atsushi Enomoto <atsushi@ximian.com>
+
+ * X509CertificateInitiatorClientCredential.cs,
+ X509CertificateInitiatorServiceCredential.cs :
+ implement x509 store support.
+
2010-07-15 Atsushi Enomoto <atsushi@ximian.com>
* HttpDigestClientCredential.cs
if (requirement.TokenType == SecurityTokenTypes.Rsa)
return new RsaSecurityTokenAuthenticator ();
if (requirement.TokenType == ServiceModelSecurityTokenTypes.SecureConversation) {
+ SecurityBindingElement binding;
+ if (!requirement.TryGetProperty<SecurityBindingElement> (ReqType.SecurityBindingElementProperty, out binding))
+ throw new ArgumentException ("SecurityBindingElement is required in the security token requirement");
+ SecureConversationSecurityTokenParameters issuedParams;
+ if (!requirement.TryGetProperty<SecureConversationSecurityTokenParameters> (ReqType.IssuedSecurityTokenParametersProperty, out issuedParams))
+ throw new ArgumentException ("IssuedSecurityTokenParameters are required in the security token requirement");
+ BindingContext issuerBC;
+ if (!requirement.TryGetProperty<BindingContext> (ReqType.IssuerBindingContextProperty, out issuerBC))
+ throw new ArgumentException ("IssuerBindingContext is required in the security token requirement");
+ SecurityTokenVersion secVer;
+ if (!requirement.TryGetProperty<SecurityTokenVersion> (ReqType.MessageSecurityVersionProperty, out secVer))
+ throw new ArgumentException ("MessageSecurityVersion property (of type SecurityTokenVersion) is required in the security token requirement");
+
// FIXME: get parameters from somewhere
SecurityContextSecurityTokenResolver resolver =
new SecurityContextSecurityTokenResolver (0x1000, true);
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.ServiceModel.Channels;
+using System.ServiceModel.Configuration;
using System.ServiceModel.Description;
using System.ServiceModel.Security.Tokens;
set { certificate = value; }
}
- [MonoTODO]
public void SetCertificate (StoreLocation storeLocation,
StoreName storeName, X509FindType findType,
object findValue)
{
- throw new NotImplementedException ();
+ certificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
}
- [MonoTODO]
public void SetCertificate (
string subjectName, StoreLocation storeLocation,
StoreName storeName)
{
- throw new NotImplementedException ();
+ certificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, X509FindType.FindBySubjectName, subjectName);
}
}
}
using System.Security.Cryptography.X509Certificates;
using System.IdentityModel.Selectors;
using System.ServiceModel.Channels;
+using System.ServiceModel.Configuration;
using System.ServiceModel.Description;
using System.ServiceModel.Security.Tokens;
set { certificate = value; }
}
- [MonoTODO]
public void SetCertificate (StoreLocation storeLocation,
StoreName storeName, X509FindType findType,
object findValue)
{
- throw new NotImplementedException ();
+ certificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
}
- [MonoTODO]
public void SetCertificate (
string subjectName, StoreLocation storeLocation,
StoreName storeName)
{
- throw new NotImplementedException ();
+ certificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, X509FindType.FindBySubjectName, subjectName);
}
}
}
using System.IdentityModel.Selectors;
using System.Security.Cryptography.X509Certificates;
using System.ServiceModel.Channels;
+using System.ServiceModel.Configuration;
using System.ServiceModel.Description;
using System.ServiceModel.Security.Tokens;
get { return scoped; }
}
- [MonoTODO]
public void SetDefaultCertificate (string subjectName,
StoreLocation storeLocation, StoreName storeName)
{
- throw new NotImplementedException ();
+ SetDefaultCertificate (storeLocation, storeName, X509FindType.FindBySubjectName, subjectName);
}
- [MonoTODO]
public void SetDefaultCertificate (StoreLocation storeLocation,
StoreName storeName, X509FindType findType, Object findValue)
{
- throw new NotImplementedException ();
+ DefaultCertificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
}
- [MonoTODO]
public void SetScopedCertificate (string subjectName,
StoreLocation storeLocation, StoreName storeName,
Uri targetService)
{
- throw new NotImplementedException ();
+ SetScopedCertificate (storeLocation, storeName, X509FindType.FindBySubjectName, subjectName, targetService);
}
- [MonoTODO]
public void SetScopedCertificate (StoreLocation storeLocation,
StoreName storeName, X509FindType findType,
Object findValue, Uri targetService)
{
- throw new NotImplementedException ();
+ ScopedCertificates [targetService] = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
}
}
}
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.ServiceModel.Channels;
+using System.ServiceModel.Configuration;
using System.ServiceModel.Description;
using System.ServiceModel.Security.Tokens;
set { certificate = value; }
}
- [MonoTODO]
public void SetCertificate (StoreLocation storeLocation,
StoreName storeName, X509FindType findType,
object findValue)
{
- throw new NotImplementedException ();
+ Certificate = ConfigUtil.CreateCertificateFrom (storeLocation, storeName, findType, findValue);
}
- [MonoTODO]
public void SetCertificate (string subjectName)
{
- throw new NotImplementedException ();
+ SetCertificate (subjectName, StoreLocation.CurrentUser, StoreName.My);
}
- [MonoTODO]
public void SetCertificate (
string subjectName, StoreLocation storeLocation,
StoreName storeName)
{
- throw new NotImplementedException ();
+ SetCertificate (storeLocation, storeName, X509FindType.FindBySubjectName, subjectName);
}
}
}
System.ServiceModel.Configuration/EndpointAddressElementBase.cs
System.ServiceModel.Configuration/EndpointBehaviorElement.cs
System.ServiceModel.Configuration/EndpointBehaviorElementCollection.cs
+System.ServiceModel.Configuration/EndpointCollectionElement.cs
System.ServiceModel.Configuration/ExtensionElement.cs
System.ServiceModel.Configuration/ExtensionElementCollection.cs
System.ServiceModel.Configuration/ExtensionsSection.cs
System.ServiceModel.Configuration/StandardBindingElementCollection.cs
System.ServiceModel.Configuration/StandardBindingOptionalReliableSessionElement.cs
System.ServiceModel.Configuration/StandardBindingReliableSessionElement.cs
+System.ServiceModel.Configuration/StandardEndpointCollectionElement.cs
+System.ServiceModel.Configuration/StandardEndpointElement.cs
+System.ServiceModel.Configuration/StandardEndpointElementCollection.cs
System.ServiceModel.Configuration/SynchronousReceiveElement.cs
System.ServiceModel.Configuration/TcpConnectionPoolSettingsElement.cs
System.ServiceModel.Configuration/TcpTransportElement.cs
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ServiceHost.cs, ServiceHostBase.cs : handle ListenUri to give
+ correct Uri. Reject wrong service endpoint configuration.
+ * ClientCredentialSecurityTokenManager.cs : give a bit kind error.
+
+2010-07-27 Atsushi Enomoto <atsushi@ximian.com>
+
+ * FederatedMessageSecurityOverHttp.cs, OptionalReliableSession.cs,
+ ReliableSession.cs, WSFederationHttpBinding.cs:
+ filled couple of missing members.
+
2010-07-08 Atsushi Enomoto <atsushi@ximian.com>
* ServiceRuntimeChannel.cs, NetNamedPipeBinding.cs,
else if (requirement.TokenType == ServiceModelSecurityTokenTypes.Spnego)
return new SspiClientSecurityTokenAuthenticator (this, requirement);
else
- throw new NotImplementedException ();
+ throw new NotImplementedException ("Security token type " + requirement.TokenType);
throw new NotSupportedException (String.Format ("Security token requirement '{0}' is not supported to create SecurityTokenAuthenticator.", requirement));
}
string issued_token_type;
EndpointAddress issuer_address, metadata_address;
Binding issuer_binding;
- bool negotiate = true;
+ bool establish_sec_ctx = true, negotiate = true;
Collection<ClaimTypeRequirement> claim_type_reqs =
new Collection<ClaimTypeRequirement> ();
Collection<XmlElement> request_params = new Collection<XmlElement> ();
set { algorithm = value; }
}
+ public bool EstablishSecurityContext {
+ get { return establish_sec_ctx; }
+ set { establish_sec_ctx = value; }
+ }
+
public SecurityKeyType IssuedKeyType {
get { return issued_key_type; }
set { issued_key_type = value; }
bool enabled;
ReliableSessionBindingElement binding;
+ public OptionalReliableSession ()
+ {
+ }
+
public OptionalReliableSession (ReliableSessionBindingElement binding)
+ : base (binding)
{
+ if (binding == null)
+ throw new ArgumentNullException ("binding");
}
public bool Enabled {
{
public class ReliableSession
{
- bool ordered;
- TimeSpan inactivity_timeout;
-
public ReliableSession ()
{
}
- public TimeSpan InactivityTimeout {
- get { return inactivity_timeout; }
+ public ReliableSession (ReliableSessionBindingElement binding)
+ {
+ if (binding == null)
+ throw new ArgumentNullException ("binding");
+ InactivityTimeout = binding.InactivityTimeout;
+ Ordered = binding.Ordered;
}
- public bool Ordered {
- get { return ordered; }
- }
+ public TimeSpan InactivityTimeout { get; set; }
+
+ public bool Ordered { get; set; }
}
}
Type implementedContract, Binding binding, Uri address)
{
return AddServiceEndpoint (implementedContract,
- binding, address, address);
+ binding, address, null);
}
public ServiceEndpoint AddServiceEndpoint (
Type implementedContract, Binding binding, Uri address, Uri listenUri)
{
- EndpointAddress ea = BuildEndpointAddress (address, binding);
+ EndpointAddress ea = new EndpointAddress (BuildAbsoluteUri (address, binding));
ContractDescription cd = GetExistingContract (implementedContract);
if (cd == null) {
string implementedContract, Binding binding,
Uri address)
{
- return AddServiceEndpoint (implementedContract, binding, address, address);
+ return AddServiceEndpoint (implementedContract, binding, address, null);
}
public ServiceEndpoint AddServiceEndpoint (
string implementedContract, Binding binding,
Uri address, Uri listenUri)
{
- EndpointAddress ea = BuildEndpointAddress (address, binding);
+ EndpointAddress ea = new EndpointAddress (BuildAbsoluteUri (address, binding));
ContractDescription cd = GetContract (implementedContract, binding.Namespace == "http://schemas.microsoft.com/ws/2005/02/mex/bindings");
if (cd == null)
throw new InvalidOperationException (String.Format ("Contract '{0}' was not found in the implemented contracts in this service host.", implementedContract));
return null;
}
- internal EndpointAddress BuildEndpointAddress (Uri address, Binding binding)
+ internal Uri BuildAbsoluteUri (Uri address, Binding binding)
{
if (!address.IsAbsoluteUri) {
// Find a Base address with matching scheme,
baseaddr = new Uri (baseaddr.AbsoluteUri + "/");
address = new Uri (baseaddr, address);
}
- return new EndpointAddress (address);
+ return address;
}
internal ServiceEndpoint AddServiceEndpointCore (
ContractDescription cd, Binding binding, EndpointAddress address, Uri listenUri)
{
+ if (listenUri != null)
+ listenUri = BuildAbsoluteUri (listenUri, binding);
+
foreach (ServiceEndpoint e in Description.Endpoints)
if (e.Contract == cd && e.Binding == binding && e.Address == address && e.ListenUri.Equals (listenUri))
return e;
ServiceEndpoint se = new ServiceEndpoint (cd, binding, address);
- se.ListenUri = listenUri.IsAbsoluteUri ? listenUri : new Uri (address.Uri, listenUri);
+ // FIXME: should we reject relative ListenUri?
+ se.ListenUri = listenUri ?? address.Uri;
Description.Endpoints.Add (se);
return se;
}
throw new InvalidOperationException ("ApplyConfiguration requires that the Description property be initialized. Either provide a valid ServiceDescription in the CreateDescription method or override the ApplyConfiguration method to provide an alternative implementation");
ServiceElement service = GetServiceElement ();
-
- //TODO: Should we call here LoadServiceElement ?
if (service != null) {
//base addresses
}
// behaviors
- // TODO: use EvaluationContext of ServiceElement.
ServiceBehaviorElement behavior = ConfigUtil.BehaviorsSection.ServiceBehaviors [service.BehaviorConfiguration];
if (behavior != null) {
foreach (var bxe in behavior) {
Description.Behaviors.Add (b);
}
}
+ else
+ throw new ArgumentException (String.Format ("Service behavior {0} is specified, but was not found", service.BehaviorConfiguration));
// services
foreach (ServiceEndpointElement endpoint in service.Endpoints) {
ServiceEndpoint se = AddServiceEndpoint (
endpoint.Contract,
ConfigUtil.CreateBinding (endpoint.Binding, endpoint.BindingConfiguration),
- endpoint.Address.ToString ());
+ endpoint.Address);
// endpoint behaviors
EndpointBehaviorElement epbehavior = ConfigUtil.BehaviorsSection.EndpointBehaviors [endpoint.BehaviorConfiguration];
if (epbehavior != null)
Description.Endpoints.CopyTo (endPoints, 0);
var builder = new DispatcherBuilder (this);
foreach (ServiceEndpoint se in endPoints) {
-
var commonParams = new BindingParameterCollection ();
foreach (IServiceBehavior b in Description.Behaviors)
b.AddBindingParameters (Description, this, Description.Endpoints, commonParams);
public class WSFederationHttpBinding : WSHttpBindingBase
{
WSFederationHttpSecurity security;
+ Uri privacy_notice_at;
+ int privacy_notice_ver;
bool allow_cookies;
public WSFederationHttpBinding ()
set { allow_cookies = value; }
}
+ [MonoTODO]
+ public Uri PrivacyNoticeAt {
+ get { return privacy_notice_at; }
+ set { privacy_notice_at = value; }
+ }
+
+ [MonoTODO]
+ public int PrivacyNoticeVersion {
+ get { return privacy_notice_ver; }
+ set { privacy_notice_ver = value; }
+ }
+
[MonoTODO]
public WSFederationHttpSecurity Security {
get { return security; }
--- /dev/null
+/README.txt -crlf
--- /dev/null
+/AsyncPatternServer.cs -crlf
+/ExitProcessHelperServer.cs -crlf
+/OperationContractServer.cs -crlf
+/PrimitiveTester.cs -crlf
--- /dev/null
+/AsyncPatternContract.cs -crlf
+/DualContract.cs -crlf
+/ExitpProcessHelper.cs -crlf
+/OperationContract.cs -crlf
--- /dev/null
+/AsyncPatternTester.cs -crlf
+/DualContractTester.cs -crlf
+/ExitProcessHelper.cs -crlf
+/OperationContractTester.cs -crlf
using System;
-using System.Xml;\r
+using System.Xml;
using System.IO;
namespace MonoTests.stand_alone.WebHarness
return false;//and another has none
return AreEqualNodeList (expected.ChildNodes, actual.ChildNodes);
}
- }\r
-\r
- public bool AreEqual (string expected, string actual) \r
- {\r
- XmlDocument eDocument = new XmlDocument();\r
- eDocument.LoadXml(expected);\r
- XmlNode eNode = eDocument.DocumentElement;\r
- XmlDocument aDocument = new XmlDocument ();\r
- aDocument.LoadXml (actual);\r
- XmlNode aNode = aDocument.DocumentElement;\r
- return AreEqual (eNode, aNode);\r
+ }
+
+ public bool AreEqual (string expected, string actual)
+ {
+ XmlDocument eDocument = new XmlDocument();
+ eDocument.LoadXml(expected);
+ XmlNode eNode = eDocument.DocumentElement;
+ XmlDocument aDocument = new XmlDocument ();
+ aDocument.LoadXml (actual);
+ XmlNode aNode = aDocument.DocumentElement;
+ return AreEqual (eNode, aNode);
}
public string LastCompare
--- /dev/null
+/AssemblyInfo.cs -crlf
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * CustomBindingTest.cs : add tests for ListenUri handling.
+
2010-07-06 Atsushi Enomoto <atsushi@ximian.com>
* HttpTransportBindingElementTest.cs : add test for
new HandlerTransportBindingElement (sender));
EndpointAddress address = new EndpointAddress (
- new Uri ("http://localhost:8080"),
+ new Uri ("http://localhost:37564"),
new X509CertificateEndpointIdentity (new X509Certificate2 ("Test/Resources/test.pfx", "mono")));
ChannelFactory<IRequestChannel> cf =
new HandlerTransportBindingElement (sender));
EndpointAddress address = new EndpointAddress (
- new Uri ("http://localhost:8080"),
+ new Uri ("http://localhost:37564"),
new X509CertificateEndpointIdentity (new X509Certificate2 ("Test/Resources/test.pfx", "mono")));
ChannelProtectionRequirements reqs =
new HttpTransportBindingElement ());
BindingContext ctx = new BindingContext (
cb, new BindingParameterCollection (),
- new Uri ("http://localhost:8080"), String.Empty, ListenUriMode.Unique);
+ new Uri ("http://localhost:37564"), String.Empty, ListenUriMode.Unique);
new TextMessageEncodingBindingElement ().BuildChannelListener<IReplyChannel> (ctx);
}
ServiceHost host = new ServiceHost (typeof (FooService));
host.AddServiceEndpoint (typeof (IFooService),
new CustomBinding (new MyBindingElement (false), new HttpTransportBindingElement ()),
- "http://localhost:8080");
+ "http://localhost:37564");
host.Open ();
}
ServiceHost host = new ServiceHost (typeof (FooService));
host.AddServiceEndpoint (typeof (IFooService),
new CustomBinding (new MyBindingElement (true), new HttpTransportBindingElement ()),
- "http://localhost:8080");
+ "http://localhost:37564");
+ host.Open ();
+ host.Close ();
+ }
+
+ [Test]
+ [ExpectedException (typeof (InvalidOperationException))]
+ public void RelativeListenUriNoBaseAddress ()
+ {
+ // MyBindingElement overrides GetProperty<T>() to call GetInnerProperty<T>() (default implementation).
+ // HttpTransportBindingElement should return Soap11.
+ ServiceHost host = new ServiceHost (typeof (FooService));
+ host.AddServiceEndpoint (typeof (IFooService),
+ new CustomBinding (new MyBindingElement (true), new HttpTransportBindingElement ()),
+ "http://localhost:37564", new Uri ("foobar", UriKind.Relative));
+ }
+
+ [Test]
+ [ExpectedException (typeof (MyException))]
+ public void RelativeListenUriWithBaseAddress ()
+ {
+ // MyBindingElement overrides GetProperty<T>() to call GetInnerProperty<T>() (default implementation).
+ // HttpTransportBindingElement should return Soap11.
+ ServiceHost host = new ServiceHost (typeof (FooService), new Uri ("http://localhost:37564"));
+ host.AddServiceEndpoint (typeof (IFooService),
+ new CustomBinding (new MyBindingElement (true), new HttpTransportBindingElement ()),
+ "http://localhost:37564", new Uri ("foobar", UriKind.Relative));
host.Open ();
host.Close ();
}
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ServiceCredentialsSecurityTokenManagerTest.cs : another WS-SC test.
+
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ServiceCredentialsSecurityTokenManagerTest.cs :
+ enable some WS-SC tests.
+
2010-03-24 Atsushi Enomoto <atsushi@ximian.com>
* TransportSecurityBindingElementTest.cs : new test.
def_c.CreateSecurityTokenProvider (r);
}
+ [Test]
+ [ExpectedException (typeof (NotSupportedException))]
+ [Category ("NotDotNet")] // it results in NRE inside InitializeSecurityTokenRequirement().
+ public void CreateProviderSecureConv2 ()
+ {
+ var sbe = (SymmetricSecurityBindingElement) SecurityBindingElement.CreateSecureConversationBindingElement (SecurityBindingElement.CreateUserNameForCertificateBindingElement ());
+ var p = new MySecureConversationSecurityTokenParameters ((SecureConversationSecurityTokenParameters) sbe.ProtectionTokenParameters);
+ var r = new RecipientServiceModelSecurityTokenRequirement ();
+ p.InitRequirement (r);
+ def_c.CreateSecurityTokenProvider (r);
+ }
+
[Test]
[ExpectedException (typeof (ArgumentException))]
- [Category ("NotWorking")]
public void CreateAuthenticatorSecureConvNoSecurityBindingElement ()
{
RecipientServiceModelSecurityTokenRequirement r =
[Test]
[ExpectedException (typeof (ArgumentException))]
- [Category ("NotWorking")]
public void CreateAuthenticatorSecureConvNoIssuedSecurityTokenParameters ()
{
RecipientServiceModelSecurityTokenRequirement r =
[Test]
[ExpectedException (typeof (ArgumentException))]
- [Category ("NotWorking")]
public void CreateAuthenticatorSecureConvNoIssuerBindingContext ()
{
RecipientServiceModelSecurityTokenRequirement r =
def_c.CreateSecurityTokenAuthenticator (r, out resolver);
}
- [Test]
- // The type of exception should not matter though.
- [ExpectedException (typeof (NotSupportedException))]
- [Category ("NotWorking")]
- public void CreateAuthenticatorSecureConvNullMessageSecurityVersion ()
- {
- RecipientServiceModelSecurityTokenRequirement r =
- CreateSecureConvRequirement ();
- r.MessageSecurityVersion = null;
- SecurityTokenResolver resolver;
- def_c.CreateSecurityTokenAuthenticator (r, out resolver);
- }
-
[Test]
[ExpectedException (typeof (ArgumentException))]
- [Category ("NotWorking")]
public void CreateAuthenticatorSecureConvNoMessageSecurityVersion ()
{
RecipientServiceModelSecurityTokenRequirement r =
+2010-07-28 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ClientCredentialsSecurityTokenManagerTest.cs : add utility .ctor.
+
2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
* EndpointAddressTest.cs : add more ReadFrom() tests.
{
}
+ public MySecureConversationSecurityTokenParameters (SecureConversationSecurityTokenParameters clone)
+ : base (clone)
+ {
+ }
+
public MySecureConversationSecurityTokenParameters (SecurityBindingElement element)
: base (element)
{
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/basicHttpBinding -crlf
+/client.endpoint -crlf
+/client.endpoint.config -crlf
+/client.metadata -crlf
+/client.metadata.config -crlf
+/customBinding -crlf
+/customBinding.config -crlf
+/empty -crlf
+/empty.config -crlf
+/endpointBehaviors -crlf
+/endpointBehaviors.config -crlf
+/extensions -crlf
+/extensions.config -crlf
+/netTcpBinding -crlf
+/netTcpBinding.config -crlf
+/service -crlf
+/service.config -crlf
+/serviceBehaviors -crlf
+/serviceBehaviors.config -crlf
+/test1 -crlf
+/userBinding -crlf
+/userBinding.config -crlf
+/wsHttpBinding -crlf
+/wsHttpBinding.config -crlf
<xs:element name="ServiceName" type="wsa:ServiceNameType" minOccurs="0" />
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
- <xs:documentation>\r
- If "Policy" elements from namespace "http://schemas.xmlsoap.org/ws/2002/12/policy#policy" are used, they must appear first (before any extensibility elements).\r
+ <xs:documentation>
+ If "Policy" elements from namespace "http://schemas.xmlsoap.org/ws/2002/12/policy#policy" are used, they must appear first (before any extensibility elements).
</xs:documentation>
</xs:annotation>
</xs:any>
--- /dev/null
+/Site.css -crlf
+/Site.master -crlf
--- /dev/null
+/makefile.build -crlf
--- /dev/null
+/makefile.build -crlf
+/run-tests.cmd -crlf
+/run-tests.selenium.cmd -crlf
--- /dev/null
+/MicrosoftAjaxExtension.js -crlf
+/MicrosoftAjaxWebFormsExtension.js -crlf
--- /dev/null
+/ScriptModule.cs -crlf
+/ScriptResourceHandler.cs -crlf
--- /dev/null
+/AuthenticationService.cs -crlf
+/ProxyGenerator.cs -crlf
readonly ScriptingAuthenticationServiceSection _section;\r
\r
public AuthenticationService () {\r
- _section = (ScriptingAuthenticationServiceSection) WebConfigurationManager.GetSection ("system.web.extensions/scripting/webServices/authenticationService");
+ _section = (ScriptingAuthenticationServiceSection) WebConfigurationManager.GetSection ("system.web.extensions/scripting/webServices/authenticationService");\r
}\r
\r
void EnsureEnabled() {\r
string contentType = request.ContentType;
if (!String.IsNullOrEmpty (contentType) && contentType.StartsWith ("application/json", StringComparison.OrdinalIgnoreCase)) {
Type handlerType = null;
- if (url.EndsWith (ProfileService.DefaultWebServicePath, StringComparison.Ordinal))\r
+ if (url.EndsWith (ProfileService.DefaultWebServicePath, StringComparison.Ordinal))
handlerType = typeof (ProfileService);
else
if (url.EndsWith (AuthenticationService.DefaultWebServicePath, StringComparison.Ordinal))
--- /dev/null
+/RegisteredArrayDeclaration.cs -crlf
+/RegisteredDisposeScript.cs -crlf
+/RegisteredExpandoAttribute.cs -crlf
+/RegisteredHiddenField.cs -crlf
+/RegisteredScript.cs -crlf
+/RegisteredScriptType.cs -crlf
--- /dev/null
+/CalendarInCalendarOut.aspx -crlf
+/CancelPostback.js -crlf
+/ClientPageLifecycleEvents.aspx -crlf
+/NoScriptManager.aspx -crlf
+/StopAsynchronousPostback.aspx -crlf
+/TwoPanelsProgress.aspx -crlf
+/TwoScriptManagers.aspx -crlf
+/TwoUpdatePanels.aspx -crlf
+/UpdateButtonInside.aspx -crlf
+/UpdateButtonOutside.aspx -crlf
+/Web.config -crlf
--- /dev/null
+/AjaxScript.aspx -crlf
+/AjaxScriptComplete.aspx -crlf
+/HelloWorldService.asmx -crlf
--- /dev/null
+/Contacts.xml -crlf
+/SurveyQuestions.xml -crlf
--- /dev/null
+/ArrayMembersSampleCSharp.aspx -crlf
--- /dev/null
+/BooleanParseSampleCSharp.aspx -crlf
--- /dev/null
+/ClientEventTest.js -crlf
+/default.aspx -crlf
--- /dev/null
+/EventSyntax.js -crlf
+/default.aspx -crlf
--- /dev/null
+/Default.aspx -crlf
+/Question.js -crlf
+/Section.js -crlf
--- /dev/null
+/Default.aspx -crlf
+/Question.js -crlf
+/Section.js -crlf
--- /dev/null
+/DynamicScriptReferences1.aspx -crlf
+/DynamicScriptReferences2.aspx -crlf
--- /dev/null
+/Scripts.debug.js -crlf
+/Scripts.js -crlf
--- /dev/null
+/Enumeration.aspx -crlf
+/Enumeration.js -crlf
+/Inheritance.aspx -crlf
+/Inheritance.js -crlf
+/Interface.aspx -crlf
+/Interface.js -crlf
+/Namespace.aspx -crlf
+/Namespace.js -crlf
+/Reflection.aspx -crlf
--- /dev/null
+/ErrorArgumentNullSampleCSharp.aspx -crlf
+/ErrorCreateSampleCSharp.aspx -crlf
--- /dev/null
+/Default.aspx -crlf
+/FocusBehavior.js -crlf
+/FocusExtender.cs -crlf
--- /dev/null
+/Default.aspx -crlf
+/SampleTextBox.cs -crlf
+/SampleTextBox.js -crlf
--- /dev/null
+/CheckAnswer.js -crlf
+/ClientVerification.cs -crlf
+/Default.aspx -crlf
+/VerificationResources.it.resx -crlf
+/VerificationResources.resx -crlf
--- /dev/null
+/localeFormat.aspx -crlf
+/web.config -crlf
--- /dev/null
+/localeFormat.aspx -crlf
+/web.config -crlf
--- /dev/null
+/localeFormat.aspx -crlf
+/web.config -crlf
--- /dev/null
+/localeFormat.aspx -crlf
+/web.config -crlf
--- /dev/null
+/MyAuthenticationService.asmx -crlf
--- /dev/null
+/MyProfileService.asmx -crlf
--- /dev/null
+/NumberParseSampleCSharp.aspx -crlf
--- /dev/null
+/TicketExampleCS.aspx -crlf
--- /dev/null
+/PartialPageRenderingOverviewCS.aspx -crlf
+/PartialPageRenderingOverviewSyntaxCS.aspx -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/Default.aspx -crlf
--- /dev/null
+/CheckAnswer.it-IT.js -crlf
+/CheckAnswer.js -crlf
--- /dev/null
+/Employees.aspx -crlf
--- /dev/null
+/QuickStartTestSuite.html -crlf
--- /dev/null
+/PageRequestManagerTestSuite.html -crlf
--- /dev/null
+/UpdatePanelTestSuite.html -crlf
--- /dev/null
+/StringBuilderOverviewSample.aspx -crlf
--- /dev/null
+/Default.aspx -crlf
+/HighVis.js -crlf
+/HoverButton.js -crlf
--- /dev/null
+/default.aspx -crlf
+/web.config -crlf
--- /dev/null
+/default.aspx -crlf
+/web.config -crlf
--- /dev/null
+/Default.aspx -crlf
--- /dev/null
+/Default.aspx -crlf
+/HoverButton.js -crlf
--- /dev/null
+/CallWebServiceMethods.aspx -crlf
+/CallWebServiceMethods.js -crlf
+/WebService.asmx -crlf
--- /dev/null
+/ConnectingEndPoints.aspx -crlf
+/ConnectingEndPoints.js -crlf
+/getTarget.htm -crlf
+/postTarget.aspx -crlf
--- /dev/null
+/WebService.asmx -crlf
+/WebServiceMethodError.aspx -crlf
+/WebServiceMethodError.js -crlf
--- /dev/null
+/HandleColor.asmx -crlf
+/HandleColor.js -crlf
+/default.aspx -crlf
--- /dev/null
+/ClientDeserializeServerSerialize.aspx -crlf
+/ClientSerializeServerDeserialize.aspx -crlf
--- /dev/null
+/WebService.asmx -crlf
+/WebServiceMultipleCallers.js -crlf
+/multiplecallers.aspx -crlf
--- /dev/null
+/PageMethod.aspx -crlf
+/PageMethod.js -crlf
--- /dev/null
+/HandleColor.asmx -crlf
+/HandleColor.js -crlf
+/default.aspx -crlf
--- /dev/null
+/HandleColor.asmx -crlf
+/HandleColor.js -crlf
+/default.aspx -crlf
--- /dev/null
+/ServerTypes.asmx -crlf
+/ServerTypes.js -crlf
+/default.aspx -crlf
--- /dev/null
+/ServerTime.asmx -crlf
+/ServerTime.aspx -crlf
--- /dev/null
+/SimpleWebService.asmx -crlf
+/SimpleWebService.aspx -crlf
--- /dev/null
+/UsingProxyClass.asmx -crlf
+/UsingProxyClass.js -crlf
+/default.aspx -crlf
--- /dev/null
+/WebRequest.js -crlf
+/getTarget.htm -crlf
+/postTarget.aspx -crlf
+/webrequest.aspx -crlf
--- /dev/null
+/WebRequestManager.aspx -crlf
+/WebRequestManager.js -crlf
+/getTarget.htm -crlf
--- /dev/null
+/WebService.asmx -crlf
+/default.aspx -crlf
+/generics.js -crlf
--- /dev/null
+/WebService.asmx -crlf
+/WebServiceProxy.aspx -crlf
+/WebServiceProxy.js -crlf
--- /dev/null
+/XmlHttpExecutor.aspx -crlf
+/XmlHttpExecutor.js -crlf
+/getTarget.aspx -crlf
+/getTarget.htm -crlf
+/getTarget.xml -crlf
--- /dev/null
+/Authentication.js -crlf
+/CreateNewUser.aspx -crlf
+/login.aspx -crlf
--- /dev/null
+/Default.aspx -crlf
+/Web.config.txt -crlf
--- /dev/null
+/Login.aspx -crlf
+/LoginControl.ascx -crlf
--- /dev/null
+/Default.aspx -crlf
+/Web.config -crlf
--- /dev/null
+/Profile.js -crlf
+/login.aspx -crlf
--- /dev/null
+/LoginProfileControl.ascx -crlf
+/Profile.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/PageRequestManager_AbortPostBackCS.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/PageRequestManager_isInAsyncPostBack.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/PostBackTriggerCS.aspx -crlf
--- /dev/null
+/ConfigSectionSample.cs -crlf
+/DefaultDummy.aspx -crlf
--- /dev/null
+/DefaultDummy.aspx -crlf
+/ScriptIgnoreSample.cs -crlf
--- /dev/null
+/Default.aspx -crlf
+/TypeResolver.cs -crlf
--- /dev/null
+/Default.aspx -crlf
+/ListItemCollectionConverter.cs -crlf
--- /dev/null
+/GenerateScriptTypeSample.asmx -crlf
--- /dev/null
+/WebService.asmx -crlf
--- /dev/null
+/ScriptServiceSample.asmx -crlf
--- /dev/null
+/AsyncPostBackTriggerCS.aspx -crlf
--- /dev/null
+/UpdatePanelWizardValidatorsCS.aspx -crlf
--- /dev/null
+/Default.aspx -crlf
--- /dev/null
+/Default.aspx -crlf
--- /dev/null
+/Default.aspx -crlf
+/Default.aspx.cs -crlf
+/Default.aspx.designer.cs -crlf
--- /dev/null
+/Default.aspx -crlf
+/Default.aspx.cs -crlf
+/Default.aspx.designer.cs -crlf
--- /dev/null
+/Default.aspx -crlf
--- /dev/null
+/ScriptManager_AsyncPostBackErrorMessageCS.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/ErrorHandling.js -crlf
+/default.aspx -crlf
--- /dev/null
+/ScriptManager1CS.aspx -crlf
+/ScriptManager2CS.aspx -crlf
--- /dev/null
+/WebUserControl.ascx -crlf
--- /dev/null
+/ScriptManager_RegisterClientScriptBlockCS.aspx -crlf
--- /dev/null
+/Contacts.xml -crlf
--- /dev/null
+/ScriptManager_RegisterClientScriptIncludeCS.aspx -crlf
--- /dev/null
+/script_alertdiv.js -crlf
--- /dev/null
+/ScriptManagerRegisterDataItemCS.aspx -crlf
--- /dev/null
+/CustomClient.js -crlf
+/Default.aspx -crlf
--- /dev/null
+/Default.aspx -crlf
--- /dev/null
+/UpdatePanelAnimation.js -crlf
--- /dev/null
+/Default.aspx -crlf
+/UpdatePanelAnimation.js -crlf
+/customcontrol.cs -crlf
--- /dev/null
+/Default.aspx -crlf
--- /dev/null
+/CustomScript.js -crlf
--- /dev/null
+/UpdatePanelConstructorCS.aspx -crlf
--- /dev/null
+/CustomContentTemplate.cs -crlf
+/UpdatePanelContentTemplateCS.aspx -crlf
+/UpdatePanelContentTemplateDynamicCS.aspx -crlf
--- /dev/null
+/CustomUpdatePanel.cs -crlf
+/UpdatePanelCreateContentTemplateContainerCS.aspx -crlf
--- /dev/null
+/UpdatePanelRenderModeCS.aspx -crlf
--- /dev/null
+/UpdatePanelUpdateMode2CS.aspx -crlf
+/UpdatePanelUpdateMode3CS.aspx -crlf
+/UpdatePanelUpdateModeCS.aspx -crlf
--- /dev/null
+/UpdatePanelExample1CS.aspx -crlf
+/UpdatePanelExample2CS.aspx -crlf
+/UpdatePanelExample3CS.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/ValidationSummaryCS.aspx -crlf
--- /dev/null
+/WizardValidationSummaryCS.aspx -crlf
--- /dev/null
+/UpdatePanel1CS.aspx -crlf
+/UpdatePanel2CS.aspx -crlf
+/UpdatePanel3CS.aspx -crlf
+/UpdatePanel4CS.aspx -crlf
--- /dev/null
+/UpdatePanelHowToNoUpdatePanel.aspx -crlf
+/UpdatePanelHowToWithUpdatePanel.aspx -crlf
--- /dev/null
+/ErrorHandlingBasicsCS.aspx -crlf
+/ErrorHandlingExampleCS.aspx -crlf
--- /dev/null
+/UpdatePanelHowTo1CS.aspx -crlf
+/UpdatePanelHowTo2CS.aspx -crlf
--- /dev/null
+/WebUserControl.ascx -crlf
--- /dev/null
+/MasterPageCS.master -crlf
+/UpdatePanelContentPage2CS.aspx -crlf
+/UpdatePanelContentPage3CS.aspx -crlf
+/UpdatePanelContentPageCS.aspx -crlf
+/UpdatePanelContentPageDisablePartialRenderingCS.aspx -crlf
--- /dev/null
+/UpdatePanelDynamicallyUpdatedCS1.aspx -crlf
+/UpdatePanelDynamicallyUpdatedCS2.aspx -crlf
+/UpdatePanelDynamicallyUpdatedCS3.aspx -crlf
--- /dev/null
+/UpdatePanelTriggerBasicsCS.aspx -crlf
+/UpdatePanelTriggerExampleCS.aspx -crlf
--- /dev/null
+/SurveyQuestionsExample.aspx -crlf
--- /dev/null
+/NewsHeadLineExampleCS.aspx -crlf
+/SimpleExample1CS.aspx -crlf
+/SimpleExample2CS.aspx -crlf
--- /dev/null
+/SimpleExample1CS.aspx -crlf
+/SimpleExample2CS.aspx -crlf
+/SimpleExample3CS.aspx -crlf
--- /dev/null
+/ExclusivePostBackBasicsCS.aspx -crlf
+/ExclusivePostBackCS.aspx -crlf
--- /dev/null
+/MasterCS.master -crlf
+/UpdatePanelCS.aspx -crlf
+/UpdatePanelContentPageCS.aspx -crlf
+/UpdatePanelNestedCS.aspx -crlf
+/UpdatePanelProgrammaticallyCS.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/ProductQueryScript.js -crlf
+/ProductQueryService.asmx -crlf
+/default.aspx -crlf
--- /dev/null
+/ProductQueryScript.js -crlf
+/ProductQueryService.asmx -crlf
+/default.aspx -crlf
--- /dev/null
+/UpdatePanelAnimation.js -crlf
+/default.aspx -crlf
--- /dev/null
+/CancelPostback.js -crlf
+/default.aspx -crlf
--- /dev/null
+/PostbackPrecedence.js -crlf
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/ChildTriggers.aspx -crlf
--- /dev/null
+/ProductsView.cs -crlf
+/ShowProducts.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/MasterPage.master -crlf
+/default.aspx -crlf
--- /dev/null
+/MasterPage.master -crlf
+/default.aspx -crlf
--- /dev/null
+/NestedPanels.aspx -crlf
--- /dev/null
+/DataEntry.aspx -crlf
--- /dev/null
+/Default.aspx -crlf
+/Default.aspx.cs -crlf
+/Default.aspx.designer.cs -crlf
+/EmployeeInfo.ascx -crlf
+/EmployeeInfo.ascx.cs -crlf
+/EmployeeInfo.ascx.designer.cs -crlf
+/EmployeeList.ascx -crlf
+/EmployeeList.ascx.cs -crlf
+/EmployeeList.ascx.designer.cs -crlf
--- /dev/null
+/DeclarativeMarkupCS.aspx -crlf
+/WizardWithUpdatePanelCS.aspx -crlf
+/WizardWithoutUpdatePanelCS.aspx -crlf
--- /dev/null
+/SearchResultsWithUpdatePanelCS.aspx -crlf
+/SearchResultsWithoutUpdatePanelCS.aspx -crlf
+/TriggersDeclarativeMarkupCS.aspx -crlf
--- /dev/null
+/DeclarativeMasterPageCS.master -crlf
+/DelcarativeContentPageCS.aspx -crlf
+/NorthwindTradersContentPageCS.aspx -crlf
+/NorthwindTradersMasterPageCS.master -crlf
--- /dev/null
+/SurveyExampleCS.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/default.aspx -crlf
--- /dev/null
+/faces-config.xml -crlf
+/web.xml -crlf
{
string originalHtml = @"<span id=""Bug604053ListView1""><table id=""Bug604053ListView1_itemPlaceholderContainer"" border=""0"" style=""""><tr style=""""><th>
M1</th><th>
- M2</th>\r
+ M2</th>
</tr>
<tr style="""">
<td>
<span id=""Bug604053ListView1_ctl10_M2Label"">0</span>
</td>
</tr>
- \r
+
<tr style="""">
<td>
<span id=""Bug604053ListView1_ctl12_M2Label"">1</span>
</td>
</tr>
- \r
-\r
-\r
-</table>\r
+
+
+
+</table>
<table><tr><td>
- </td>\r
+ </td>
</tr><tr><td style="""">
<span id=""DataPager1""><input type=""submit"" name=""Bug604053ListView1$DataPager1$ctl00$ctl00"" value=""First"" disabled=""disabled"" /> <span>1</span> <a href=""javascript:__doPostBack('Bug604053ListView1$DataPager1$ctl01$ctl01','')"">2</a> <a href=""javascript:__doPostBack('Bug604053ListView1$DataPager1$ctl01$ctl02','')"">3</a> <a href=""javascript:__doPostBack('Bug604053ListView1$DataPager1$ctl01$ctl03','')"">4</a> <a href=""javascript:__doPostBack('Bug604053ListView1$DataPager1$ctl01$ctl04','')"">5</a> <input type=""submit"" name=""Bug604053ListView1$DataPager1$ctl02$ctl00"" value=""Last"" /> </span>
- </td>\r
- </tr>\r
-\r
-</table>\r
+ </td>
+ </tr>
+
+</table>
</span>
<span id=""Bug604053ListView2""><table id=""Bug604053ListView2_itemPlaceholderContainer"" border=""0"" style=""""><tr style=""""><th>
M1</th><th>
- M2</th>\r
+ M2</th>
</tr>
<tr style="""">
<td>
<span id=""Bug604053ListView2_ctl10_M2Label"">0</span>
</td>
</tr>
- \r
+
<tr style="""">
<td>
<span id=""Bug604053ListView2_ctl12_M2Label"">1</span>
</td>
</tr>
- \r
-\r
-\r
-</table>\r
+
+
+
+</table>
<table><tr><td>
- </td>\r
+ </td>
</tr><tr><td style="""">
<span id=""DataPager1""><input type=""submit"" name=""Bug604053ListView2$DataPager1$ctl00$ctl00"" value=""First"" disabled=""disabled"" /> <input type=""submit"" name=""Bug604053ListView2$DataPager1$ctl00$ctl01"" value=""Previous"" disabled=""disabled"" /> <input type=""submit"" name=""Bug604053ListView2$DataPager1$ctl00$ctl02"" value=""Next"" /> <input type=""submit"" name=""Bug604053ListView2$DataPager1$ctl00$ctl03"" value=""Last"" /> </span>
- </td>\r
- </tr>\r
-\r
-</table>\r
+ </td>
+ </tr>
+
+</table>
</span>";
--- /dev/null
+/Web.mono.config -crlf
--- /dev/null
+/GlobalSuppressions.cs -crlf
+/license.htm -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/AcceptVerbsAttribute.cs -crlf
+/ActionDescriptor.cs -crlf
+/ActionExecutedContext.cs -crlf
+/ActionExecutingContext.cs -crlf
+/ActionFilterAttribute.cs -crlf
+/ActionMethodDispatcher.cs -crlf
+/ActionMethodDispatcherCache.cs -crlf
+/ActionMethodSelector.cs -crlf
+/ActionMethodSelectorAttribute.cs -crlf
+/ActionMethodSelectorCache.cs -crlf
+/ActionNameAttribute.cs -crlf
+/ActionNameSelectorAttribute.cs -crlf
+/ActionResult.cs -crlf
+/ActionSelector.cs -crlf
+/AjaxHelper.cs -crlf
+/AjaxHelper`1.cs -crlf
+/AjaxRequestExtensions.cs -crlf
+/AntiForgeryData.cs -crlf
+/AntiForgeryDataSerializer.cs -crlf
+/AntiForgeryToken.cs -crlf
+/AntiForgeryTokenSerializer.cs -crlf
+/AuthorizationContext.cs -crlf
+/AuthorizeAttribute.cs -crlf
+/BindAttribute.cs -crlf
+/BuildManagerWrapper.cs -crlf
+/ContentResult.cs -crlf
+/Controller.cs -crlf
+/ControllerActionInvoker.cs -crlf
+/ControllerBase.cs -crlf
+/ControllerBuilder.cs -crlf
+/ControllerContext.cs -crlf
+/ControllerDescriptor.cs -crlf
+/ControllerDescriptorCache.cs -crlf
+/ControllerTypeCache.cs -crlf
+/CustomModelBinderAttribute.cs -crlf
+/DefaultControllerFactory.cs -crlf
+/DefaultViewLocationCache.cs -crlf
+/DescriptorUtil.cs -crlf
+/DictionaryHelpers.cs -crlf
+/EmptyResult.cs -crlf
+/ExceptionContext.cs -crlf
+/FileContentResult.cs -crlf
+/FilePathResult.cs -crlf
+/FileResult.cs -crlf
+/FileStreamResult.cs -crlf
+/FilterAttribute.cs -crlf
+/FilterInfo.cs -crlf
+/FormCollection.cs -crlf
+/FormMethod.cs -crlf
+/HandleErrorAttribute.cs -crlf
+/HandleErrorInfo.cs -crlf
+/HtmlHelper.cs -crlf
+/HtmlHelper`1.cs -crlf
+/HttpAntiForgeryException.cs -crlf
+/HttpPostedFileBaseModelBinder.cs -crlf
+/HttpUnauthorizedResult.cs -crlf
+/HttpVerbs.cs -crlf
+/IActionFilter.cs -crlf
+/IActionInvoker.cs -crlf
+/IAuthorizationFilter.cs -crlf
+/IBuildManager.cs -crlf
+/IController.cs -crlf
+/IControllerFactory.cs -crlf
+/IExceptionFilter.cs -crlf
+/IModelBinder.cs -crlf
+/IResultFilter.cs -crlf
+/ITempDataProvider.cs -crlf
+/IView.cs -crlf
+/IViewDataContainer.cs -crlf
+/IViewEngine.cs -crlf
+/IViewLocationCache.cs -crlf
+/InputType.cs -crlf
+/JavaScriptResult.cs -crlf
+/JsonResult.cs -crlf
+/ModelBinderAttribute.cs -crlf
+/ModelBinderDictionary.cs -crlf
+/ModelBinders.cs -crlf
+/ModelBindingContext.cs -crlf
+/ModelError.cs -crlf
+/ModelErrorCollection.cs -crlf
+/ModelState.cs -crlf
+/ModelStateDictionary.cs -crlf
+/MultiSelectList.cs -crlf
+/MvcHandler.cs -crlf
+/MvcHttpHandler.cs -crlf
+/MvcRouteHandler.cs -crlf
+/NameValueCollectionExtensions.cs -crlf
+/NonActionAttribute.cs -crlf
+/NullViewLocationCache.cs -crlf
+/OutputCacheAttribute.cs -crlf
+/ParameterBindingInfo.cs -crlf
+/ParameterDescriptor.cs -crlf
+/PartialViewResult.cs -crlf
+/PathHelpers.cs -crlf
+/ReaderWriterCache`2.cs -crlf
+/RedirectResult.cs -crlf
+/RedirectToRouteResult.cs -crlf
+/ReflectedActionDescriptor.cs -crlf
+/ReflectedControllerDescriptor.cs -crlf
+/ReflectedParameterBindingInfo.cs -crlf
+/ReflectedParameterDescriptor.cs -crlf
+/ResultExecutedContext.cs -crlf
+/ResultExecutingContext.cs -crlf
+/RouteCollectionExtensions.cs -crlf
+/RouteValuesHelpers.cs -crlf
+/SelectList.cs -crlf
+/SelectListItem.cs -crlf
+/SessionStateTempDataProvider.cs -crlf
+/TagBuilder.cs -crlf
+/TagRenderMode.cs -crlf
+/TempDataDictionary.cs -crlf
+/TypeHelpers.cs -crlf
+/UrlHelper.cs -crlf
+/ValidateAntiForgeryTokenAttribute.cs -crlf
+/ValidateInputAttribute.cs -crlf
+/ValueProviderDictionary.cs -crlf
+/ValueProviderResult.cs -crlf
+/ViewContext.cs -crlf
+/ViewDataDictionary.cs -crlf
+/ViewDataDictionary`1.cs -crlf
+/ViewEngineCollection.cs -crlf
+/ViewEngineResult.cs -crlf
+/ViewEngines.cs -crlf
+/ViewMasterPage.cs -crlf
+/ViewMasterPage`1.cs -crlf
+/ViewPage.cs -crlf
+/ViewPageControlBuilder.cs -crlf
+/ViewPage`1.cs -crlf
+/ViewResult.cs -crlf
+/ViewResultBase.cs -crlf
+/ViewType.cs -crlf
+/ViewTypeControlBuilder.cs -crlf
+/ViewTypeParserFilter.cs -crlf
+/ViewUserControl.cs -crlf
+/ViewUserControlControlBuilder.cs -crlf
+/ViewUserControl`1.cs -crlf
+/VirtualPathProviderViewEngine.cs -crlf
+/WebFormView.cs -crlf
+/WebFormViewEngine.cs -crlf
--- /dev/null
+/AjaxExtensions.cs -crlf
+/AjaxOptions.cs -crlf
+/InsertionMode.cs -crlf
--- /dev/null
+/FormExtensions.cs -crlf
+/InputExtensions.cs -crlf
+/LinkExtensions.cs -crlf
+/MvcForm.cs -crlf
+/RenderPartialExtensions.cs -crlf
+/SelectExtensions.cs -crlf
+/TextAreaExtensions.cs -crlf
+/ValidationExtensions.cs -crlf
--- /dev/null
+/MvcResources.Designer.cs -crlf
--- /dev/null
+/GlobalSuppressions.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
\r
[assembly: SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames",\r
Justification = "Assembly is delay-signed.")]\r
-
+\r
[assembly: AssemblyDelaySign (true)]\r
[assembly: AssemblyKeyFile("../winfx.pub")]\r
--- /dev/null
+/AcceptVerbsAttribute.cs -crlf
+/ActionDescriptor.cs -crlf
+/ActionExecutedContext.cs -crlf
+/ActionExecutingContext.cs -crlf
+/ActionFilterAttribute.cs -crlf
+/ActionMethodDispatcher.cs -crlf
+/ActionMethodDispatcherCache.cs -crlf
+/ActionMethodSelector.cs -crlf
+/ActionMethodSelectorAttribute.cs -crlf
+/ActionNameAttribute.cs -crlf
+/ActionNameSelectorAttribute.cs -crlf
+/ActionResult.cs -crlf
+/ActionSelector.cs -crlf
+/AjaxHelper.cs -crlf
+/AjaxHelper`1.cs -crlf
+/AjaxRequestExtensions.cs -crlf
+/AntiForgeryData.cs -crlf
+/AntiForgeryDataSerializer.cs -crlf
+/AreaHelpers.cs -crlf
+/AreaRegistration.cs -crlf
+/AreaRegistrationContext.cs -crlf
+/AssociatedMetadataProvider.cs -crlf
+/AssociatedValidatorProvider.cs -crlf
+/AsyncController.cs -crlf
+/AsyncTimeoutAttribute.cs -crlf
+/AuthorizationContext.cs -crlf
+/AuthorizeAttribute.cs -crlf
+/BindAttribute.cs -crlf
+/BuildManagerWrapper.cs -crlf
+/ByteArrayModelBinder.cs -crlf
+/ChildActionOnlyAttribute.cs -crlf
+/ClientDataTypeModelValidatorProvider.cs -crlf
+/ContentResult.cs -crlf
+/Controller.cs -crlf
+/ControllerActionInvoker.cs -crlf
+/ControllerBase.cs -crlf
+/ControllerBuilder.cs -crlf
+/ControllerContext.cs -crlf
+/ControllerDescriptor.cs -crlf
+/ControllerDescriptorCache.cs -crlf
+/ControllerTypeCache.cs -crlf
+/CustomModelBinderAttribute.cs -crlf
+/DataAnnotationsModelMetadata.cs -crlf
+/DataAnnotationsModelMetadataProvider.cs -crlf
+/DataAnnotationsModelValidator.cs -crlf
+/DataAnnotationsModelValidatorProvider.cs -crlf
+/DataAnnotationsModelValidator`1.cs -crlf
+/DataErrorInfoModelValidatorProvider.cs -crlf
+/DefaultControllerFactory.cs -crlf
+/DefaultModelBinder.cs -crlf
+/DefaultViewLocationCache.cs -crlf
+/DescriptorUtil.cs -crlf
+/DictionaryHelpers.cs -crlf
+/DictionaryValueProvider`1.cs -crlf
+/DynamicTypeGenerator.cs -crlf
+/EmptyModelMetadataProvider.cs -crlf
+/EmptyModelValidatorProvider.cs -crlf
+/EmptyResult.cs -crlf
+/Error.cs -crlf
+/ExceptionContext.cs -crlf
+/ExpressionHelper.cs -crlf
+/FieldValidationMetadata.cs -crlf
+/FileContentResult.cs -crlf
+/FilePathResult.cs -crlf
+/FileResult.cs -crlf
+/FileStreamResult.cs -crlf
+/FilterAttribute.cs -crlf
+/FilterInfo.cs -crlf
+/FormCollection.cs -crlf
+/FormContext.cs -crlf
+/FormMethod.cs -crlf
+/FormValueProvider.cs -crlf
+/FormValueProviderFactory.cs -crlf
+/HandleErrorAttribute.cs -crlf
+/HandleErrorInfo.cs -crlf
+/HiddenInputAttribute.cs -crlf
+/HtmlHelper.cs -crlf
+/HtmlHelper`1.cs -crlf
+/HttpAntiForgeryException.cs -crlf
+/HttpDeleteAttribute.cs -crlf
+/HttpFileCollectionValueProvider.cs -crlf
+/HttpFileCollectionValueProviderFactory.cs -crlf
+/HttpGetAttribute.cs -crlf
+/HttpHandlerUtil.cs -crlf
+/HttpPostAttribute.cs -crlf
+/HttpPostedFileBaseModelBinder.cs -crlf
+/HttpPutAttribute.cs -crlf
+/HttpRequestExtensions.cs -crlf
+/HttpUnauthorizedResult.cs -crlf
+/HttpVerbs.cs -crlf
+/IActionFilter.cs -crlf
+/IActionInvoker.cs -crlf
+/IAuthorizationFilter.cs -crlf
+/IBuildManager.cs -crlf
+/IController.cs -crlf
+/IControllerFactory.cs -crlf
+/IExceptionFilter.cs -crlf
+/IModelBinder.cs -crlf
+/IResultFilter.cs -crlf
+/IRouteWithArea.cs -crlf
+/ITempDataProvider.cs -crlf
+/IValueProvider.cs -crlf
+/IView.cs -crlf
+/IViewDataContainer.cs -crlf
+/IViewEngine.cs -crlf
+/IViewLocationCache.cs -crlf
+/InputType.cs -crlf
+/JavaScriptResult.cs -crlf
+/JsonRequestBehavior.cs -crlf
+/JsonResult.cs -crlf
+/LinqBinaryModelBinder.cs -crlf
+/ModelBinderAttribute.cs -crlf
+/ModelBinderDictionary.cs -crlf
+/ModelBinders.cs -crlf
+/ModelBindingContext.cs -crlf
+/ModelClientValidationRangeRule.cs -crlf
+/ModelClientValidationRegexRule.cs -crlf
+/ModelClientValidationRequiredRule.cs -crlf
+/ModelClientValidationRule.cs -crlf
+/ModelClientValidationStringLengthRule.cs -crlf
+/ModelError.cs -crlf
+/ModelErrorCollection.cs -crlf
+/ModelMetadata.cs -crlf
+/ModelMetadataProvider.cs -crlf
+/ModelMetadataProviders.cs -crlf
+/ModelState.cs -crlf
+/ModelStateDictionary.cs -crlf
+/ModelValidationResult.cs -crlf
+/ModelValidator.cs -crlf
+/ModelValidatorProvider.cs -crlf
+/ModelValidatorProviderCollection.cs -crlf
+/ModelValidatorProviders.cs -crlf
+/MultiSelectList.cs -crlf
+/MvcHandler.cs -crlf
+/MvcHtmlString.cs -crlf
+/MvcHttpHandler.cs -crlf
+/MvcRouteHandler.cs -crlf
+/NameValueCollectionExtensions.cs -crlf
+/NameValueCollectionValueProvider.cs -crlf
+/NoAsyncTimeoutAttribute.cs -crlf
+/NonActionAttribute.cs -crlf
+/NullViewLocationCache.cs -crlf
+/OutputCacheAttribute.cs -crlf
+/ParameterBindingInfo.cs -crlf
+/ParameterDescriptor.cs -crlf
+/ParameterInfoUtil.cs -crlf
+/PartialViewResult.cs -crlf
+/PathHelpers.cs -crlf
+/QueryStringValueProvider.cs -crlf
+/QueryStringValueProviderFactory.cs -crlf
+/RangeAttributeAdapter.cs -crlf
+/ReaderWriterCache`2.cs -crlf
+/RedirectResult.cs -crlf
+/RedirectToRouteResult.cs -crlf
+/ReflectedActionDescriptor.cs -crlf
+/ReflectedControllerDescriptor.cs -crlf
+/ReflectedParameterBindingInfo.cs -crlf
+/ReflectedParameterDescriptor.cs -crlf
+/RegularExpressionAttributeAdapter.cs -crlf
+/RequireHttpsAttribute.cs -crlf
+/RequiredAttributeAdapter.cs -crlf
+/ResultExecutedContext.cs -crlf
+/ResultExecutingContext.cs -crlf
+/RouteCollectionExtensions.cs -crlf
+/RouteDataValueProvider.cs -crlf
+/RouteDataValueProviderFactory.cs -crlf
+/RouteValuesHelpers.cs -crlf
+/SelectList.cs -crlf
+/SelectListItem.cs -crlf
+/SessionStateTempDataProvider.cs -crlf
+/StringLengthAttributeAdapter.cs -crlf
+/TagBuilder.cs -crlf
+/TagRenderMode.cs -crlf
+/TempDataDictionary.cs -crlf
+/TemplateInfo.cs -crlf
+/TryGetValueDelegate.cs -crlf
+/TypeCacheSerializer.cs -crlf
+/TypeCacheUtil.cs -crlf
+/TypeDescriptorHelper.cs -crlf
+/TypeHelpers.cs -crlf
+/UrlHelper.cs -crlf
+/UrlParameter.cs -crlf
+/ValidateAntiForgeryTokenAttribute.cs -crlf
+/ValidateInputAttribute.cs -crlf
+/ValueProviderCollection.cs -crlf
+/ValueProviderDictionary.cs -crlf
+/ValueProviderFactories.cs -crlf
+/ValueProviderFactory.cs -crlf
+/ValueProviderFactoryCollection.cs -crlf
+/ValueProviderResult.cs -crlf
+/ValueProviderUtil.cs -crlf
+/ViewContext.cs -crlf
+/ViewDataDictionary.cs -crlf
+/ViewDataDictionary`1.cs -crlf
+/ViewDataInfo.cs -crlf
+/ViewEngineCollection.cs -crlf
+/ViewEngineResult.cs -crlf
+/ViewEngines.cs -crlf
+/ViewMasterPage.cs -crlf
+/ViewMasterPage`1.cs -crlf
+/ViewPage.cs -crlf
+/ViewPageControlBuilder.cs -crlf
+/ViewPage`1.cs -crlf
+/ViewResult.cs -crlf
+/ViewResultBase.cs -crlf
+/ViewTemplateUserControl.cs -crlf
+/ViewTemplateUserControl`1.cs -crlf
+/ViewType.cs -crlf
+/ViewTypeControlBuilder.cs -crlf
+/ViewTypeParserFilter.cs -crlf
+/ViewUserControl.cs -crlf
+/ViewUserControlControlBuilder.cs -crlf
+/ViewUserControl`1.cs -crlf
+/VirtualPathProviderViewEngine.cs -crlf
+/WebFormView.cs -crlf
+/WebFormViewEngine.cs -crlf
--- /dev/null
+/AjaxExtensions.cs -crlf
+/AjaxOptions.cs -crlf
+/InsertionMode.cs -crlf
--- /dev/null
+/ActionDescriptorCreator.cs -crlf
+/AsyncActionDescriptor.cs -crlf
+/AsyncActionMethodSelector.cs -crlf
+/AsyncControllerActionInvoker.cs -crlf
+/AsyncManager.cs -crlf
+/AsyncResultWrapper.cs -crlf
+/AsyncUtil.cs -crlf
+/AsyncVoid.cs -crlf
+/BeginInvokeDelegate.cs -crlf
+/EndInvokeDelegate.cs -crlf
+/EndInvokeDelegate`1.cs -crlf
+/IAsyncActionInvoker.cs -crlf
+/IAsyncController.cs -crlf
+/IAsyncManagerContainer.cs -crlf
+/OperationCounter.cs -crlf
+/ReflectedAsyncActionDescriptor.cs -crlf
+/ReflectedAsyncControllerDescriptor.cs -crlf
+/SimpleAsyncResult.cs -crlf
+/SingleEntryGate.cs -crlf
+/SynchronizationContextUtil.cs -crlf
+/SynchronousOperationException.cs -crlf
+/Trigger.cs -crlf
+/TriggerListener.cs -crlf
--- /dev/null
+/BinaryExpressionFingerprint.cs -crlf
+/CachedExpressionCompiler.cs -crlf
+/CompiledExpressionDelegate`2.cs -crlf
+/ConditionalExpressionFingerprint.cs -crlf
+/ConstantExpressionFingerprint.cs -crlf
+/ExpressionFingerprint.cs -crlf
+/ExpressionParser.cs -crlf
+/FastTrack`2.cs -crlf
+/HashCodeCombiner.cs -crlf
+/MemberExpressionFingerprint.cs -crlf
+/MethodCallExpressionFingerprint.cs -crlf
+/ParameterExpressionFingerprint.cs -crlf
+/ParserContext.cs -crlf
+/UnaryExpressionFingerprint.cs -crlf
--- /dev/null
+/ChildActionExtensions.cs -crlf
+/DefaultDisplayTemplates.cs -crlf
+/DefaultEditorTemplates.cs -crlf
+/DisplayExtensions.cs -crlf
+/DisplayTextExtensions.cs -crlf
+/EditorExtensions.cs -crlf
+/FormExtensions.cs -crlf
+/InputExtensions.cs -crlf
+/LabelExtensions.cs -crlf
+/LinkExtensions.cs -crlf
+/MvcForm.cs -crlf
+/PartialExtensions.cs -crlf
+/RenderPartialExtensions.cs -crlf
+/SelectExtensions.cs -crlf
+/TemplateHelpers.cs -crlf
+/TextAreaExtensions.cs -crlf
+/ValidationExtensions.cs -crlf
private static bool ShouldShow(ModelMetadata metadata, TemplateInfo templateInfo) {\r
return\r
metadata.ShowForDisplay\r
-#if false
+#if false\r
&& metadata.ModelType != typeof(EntityState)\r
-#endif
+#endif\r
&& !metadata.IsComplexType\r
&& !templateInfo.Visited(metadata);\r
}\r
private static bool ShouldShow(ModelMetadata metadata, TemplateInfo templateInfo) {\r
return\r
metadata.ShowForEdit\r
-#if false
+#if false\r
&& metadata.ModelType != typeof(EntityState)\r
-#endif
+#endif\r
&& !metadata.IsComplexType\r
&& !templateInfo.Visited(metadata);\r
}\r
--- /dev/null
+/MvcResources.Designer.cs -crlf
+/MvcResources.resx -crlf
--- /dev/null
+/makefile.build -crlf
--- /dev/null
+/Web.config -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/faces-config.xml -crlf
+/web.xml -crlf
--- /dev/null
+/System.Web.Services.xml -crlf
--- /dev/null
+/wsdl-1.1-soap.xsd -crlf
--- /dev/null
+/check-import.wsdl -crlf
+/check-import2.wsdl -crlf
+/test2.wsdl -crlf
-<%@ WebService Language="c#" Codebehind="InteropTestDocLitParameters.wsdl.cs" Class="InteropTestDocLitParameters.wsdl.WSDLInteropTestDocLitParameters" %>\r
+<%@ WebService Language="c#" Codebehind="InteropTestDocLitParameters.wsdl.cs" Class="InteropTestDocLitParameters.wsdl.WSDLInteropTestDocLitParameters" %>
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://soapinterop.org/", RequestNamespace="http://soapinterop.org/xsd", ResponseNamespace="http://soapinterop.org/xsd", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public SOAPStruct echoStruct([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] SOAPStruct param0, SOAPStruct X_WS_ReturnValue_X)
- {\r
+ {
return null;
}
-<%@ WebService Language="c#" Codebehind="BusinessList.wsdl.cs" Class="BusinessList.wsdl.BusinessList" %>\r
+<%@ WebService Language="c#" Codebehind="BusinessList.wsdl.cs" Class="BusinessList.wsdl.BusinessList" %>
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
-<%@ WebService Language="c#" Codebehind="main.wsdl.cs" Class="main.wsdl.Main" %>\r
-\r
+<%@ WebService Language="c#" Codebehind="main.wsdl.cs" Class="main.wsdl.Main" %>
+
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
-<%@ WebService Language="c#" Codebehind="GetData.wsdl.cs" Class="GetData.wsdl.GetData" %>\r
-\r
+<%@ WebService Language="c#" Codebehind="GetData.wsdl.cs" Class="GetData.wsdl.GetData" %>
+
using System.Xml.Serialization;
using System;
using System.Xml;
-<%@ WebService Language="c#" Codebehind="GetData.wsdl.cs" Class="GetData.wsdl.GetData" %>\r
-\r
+<%@ WebService Language="c#" Codebehind="GetData.wsdl.cs" Class="GetData.wsdl.GetData" %>
+
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
-<%@ WebService Language="c#" Codebehind="InteropTestExtensibilityRequired.wsdl.cs" Class="InteropTestExtensibilityRequired.wsdl.InteropTestExtensibilityRequired" %>\r
+<%@ WebService Language="c#" Codebehind="InteropTestExtensibilityRequired.wsdl.cs" Class="InteropTestExtensibilityRequired.wsdl.InteropTestExtensibilityRequired" %>
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
--- /dev/null
+/NoDoubleOnInitOnRemoveAdd.aspx -crlf
+/NoDoubleOnInitOnRemoveAdd.aspx.cs -crlf
--- /dev/null
+/Common.fr-FR.resx -crlf
+/Common.resx -crlf
--- /dev/null
+/Makefile -crlf
+/System.Windows.Forms.DataVisualization.dll.sources -crlf
--- /dev/null
+/Form1.resx -crlf
--- /dev/null
+/Resources.resx -crlf
+/Settings.settings -crlf
--- /dev/null
+/Resources.resx -crlf
+/Settings.settings -crlf
--- /dev/null
+/makefile.build -crlf
--- /dev/null
+/System.Xml.xml -crlf
{
MyObject o = new MyObject (5, 8);
using (FileStream fs = new FileStream("test.xml", FileMode.Create)) {
- XmlSerializer serializer = new XmlSerializer(typeof(MyObject));\r
+ XmlSerializer serializer = new XmlSerializer(typeof(MyObject));
serializer.Serialize(fs, o);
}
}
public static void Main(string[] args) {
MyObject o;
using (FileStream fs = File.OpenRead("test.xml")) {
- XmlSerializer serializer = new XmlSerializer(typeof(MyObject));\r
+ XmlSerializer serializer = new XmlSerializer(typeof(MyObject));
o = (MyObject) serializer.Deserialize(fs);
}
Console.WriteLine("Deserialized object: " + o.X + "," + o.Y);
--- /dev/null
+/XsdWildcard.cs -crlf
return seq.ValidatedMinOccurs <= Occured && seq.ValidatedMaxOccurs >= Occured;
}
- internal override bool EvaluateIsEmptiable ()\r
- {\r
- if (seq.ValidatedMinOccurs > Occured + 1)\r
- return false;\r
- if (seq.ValidatedMinOccurs == 0 && currentAutomata == null)\r
- return true;\r
-\r
- if (emptiable)\r
- return true;\r
- if (seq.CompiledItems.Count == 0)\r
- return true;\r
-\r
+ internal override bool EvaluateIsEmptiable ()
+ {
+ if (seq.ValidatedMinOccurs > Occured + 1)
+ return false;
+ if (seq.ValidatedMinOccurs == 0 && currentAutomata == null)
+ return true;
+
+ if (emptiable)
+ return true;
+ if (seq.CompiledItems.Count == 0)
+ return true;
+
int idx = current < 0 ? 0 : current;
- XsdValidationState xa = currentAutomata;\r
+ XsdValidationState xa = currentAutomata;
if (xa == null)
xa = Manager.Create (seq.CompiledItems [idx] as XmlSchemaParticle);
while (xa != null) {
}
emptiable = true;
return true;
- }\r
+ }
}
return false;
}
- internal override bool EvaluateIsEmptiable ()\r
- {\r
+ internal override bool EvaluateIsEmptiable ()
+ {
if (emptiableComputed)
return emptiable;
-\r
- if (choice.ValidatedMaxOccurs < Occured)\r
- return false;\r
- else if (choice.ValidatedMinOccurs > Occured + 1)\r
- return false;\r
-\r
- for (int i = Occured; i < choice.ValidatedMinOccurs; i++) {\r
- bool next = false;\r
+
+ if (choice.ValidatedMaxOccurs < Occured)
+ return false;
+ else if (choice.ValidatedMinOccurs > Occured + 1)
+ return false;
+
+ for (int i = Occured; i < choice.ValidatedMinOccurs; i++) {
+ bool next = false;
for (int pi = 0; pi < choice.CompiledItems.Count; pi++) {
- XmlSchemaParticle p = (XmlSchemaParticle) choice.CompiledItems [pi];\r
+ XmlSchemaParticle p = (XmlSchemaParticle) choice.CompiledItems [pi];
if (Manager.Create (p).EvaluateIsEmptiable ()) {
next = true;
break;
}
- }\r
- if (!next)\r
- return false;\r
- }\r
- return true;\r
- }\r
+ }
+ if (!next)
+ return false;
+ }
+ return true;
+ }
}
internal class XsdAllValidationState : XsdValidationState
return true;
}
- internal override bool EvaluateIsEmptiable ()\r
- {\r
+ internal override bool EvaluateIsEmptiable ()
+ {
if (all.Emptiable || all.ValidatedMinOccurs == 0)
return true;
for (int i = 0; i < all.CompiledItems.Count; i++) {
return false;
}
return true;
- }\r
+ }
}
internal class XsdAnyValidationState : XsdValidationState
return EvaluateIsEmptiable ();
}
- internal override bool EvaluateIsEmptiable ()\r
- {\r
+ internal override bool EvaluateIsEmptiable ()
+ {
return any.ValidatedMinOccurs <= Occured &&
any.ValidatedMaxOccurs >= Occured;
- }\r
+ }
}
internal class XsdAppendedValidationState : XsdValidationState
return rest.EvaluateEndElement ();
}
- internal override bool EvaluateIsEmptiable ()\r
- {\r
- if (head.EvaluateIsEmptiable ())\r
- return rest.EvaluateIsEmptiable ();\r
- else\r
- return false;\r
- }\r
+ internal override bool EvaluateIsEmptiable ()
+ {
+ if (head.EvaluateIsEmptiable ())
+ return rest.EvaluateIsEmptiable ();
+ else
+ return false;
+ }
}
internal class XsdEmptyValidationState : XsdValidationState
return true;
}
- internal override bool EvaluateIsEmptiable ()\r
- {\r
- return true;\r
- }\r
-\r
+ internal override bool EvaluateIsEmptiable ()
+ {
+ return true;
+ }
+
}
internal class XsdInvalidValidationState : XsdValidationState
return false;
}
- internal override bool EvaluateIsEmptiable ()\r
- {\r
- return false;\r
- }\r
-\r
+ internal override bool EvaluateIsEmptiable ()
+ {
+ return false;
+ }
+
}
}
-//
-// Mono.Xml.Schema.XsdWildcard.cs
-//
-// Author:
-// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
-//
-// (C)2003 Atsushi Enomoto
-//
-//
-// This class represents common part of xs:any and xs:anyAttribute
-//
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+//\r
+// Mono.Xml.Schema.XsdWildcard.cs\r
+//\r
+// Author:\r
+// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)\r
+//\r
+// (C)2003 Atsushi Enomoto\r
+//\r
+//\r
+// This class represents common part of xs:any and xs:anyAttribute\r
+//\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
using System;\r
using System.Collections.Specialized;\r
using System.Xml;\r
int nscount = 0;\r
string actualNamespace = nss == null ? "##any" : nss;\r
string[] nslist = XmlSchemaUtil.SplitList(actualNamespace);\r
- for (int i = 0; i < nslist.Length; i++) {
- string ns = nslist [i];
+ for (int i = 0; i < nslist.Length; i++) {\r
+ string ns = nslist [i];\r
switch(ns) {\r
case "##any": \r
- if (HasValueAny)
- xsobj.error (h, "Multiple specification of ##any was found.");
+ if (HasValueAny)\r
+ xsobj.error (h, "Multiple specification of ##any was found.");\r
nscount |= 1;\r
- HasValueAny = true;
+ HasValueAny = true;\r
break;\r
case "##other":\r
- if (HasValueOther)
- xsobj.error (h, "Multiple specification of ##other was found.");
+ if (HasValueOther)\r
+ xsobj.error (h, "Multiple specification of ##other was found.");\r
nscount |= 2;\r
- HasValueOther = true;
+ HasValueOther = true;\r
break;\r
case "##targetNamespace":\r
- if (HasValueTargetNamespace)
- xsobj.error (h, "Multiple specification of ##targetNamespace was found.");
+ if (HasValueTargetNamespace)\r
+ xsobj.error (h, "Multiple specification of ##targetNamespace was found.");\r
nscount |= 4;\r
HasValueTargetNamespace = true;\r
break;\r
case "##local":\r
- if (HasValueLocal)
- xsobj.error (h, "Multiple specification of ##local was found.");
+ if (HasValueLocal)\r
+ xsobj.error (h, "Multiple specification of ##local was found.");\r
nscount |= 8;\r
- HasValueLocal = true;
+ HasValueLocal = true;\r
break;\r
default:\r
if(!XmlSchemaUtil.CheckAnyUri(ns))\r
xsobj.error(h,"the namespace is not a valid anyURI");\r
- else if (ResolvedNamespaces.Contains (ns))
- xsobj.error (h, "Multiple specification of '" + ns + "' was found.");
+ else if (ResolvedNamespaces.Contains (ns))\r
+ xsobj.error (h, "Multiple specification of '" + ns + "' was found.");\r
else {\r
nscount |= 16;\r
- ResolvedNamespaces.Add (ns);
- }
+ ResolvedNamespaces.Add (ns);\r
+ }\r
break;\r
}\r
}\r
public bool ValidateWildcardAllowsNamespaceName (string ns,\r
ValidationEventHandler h, XmlSchema schema, bool raiseError)\r
{\r
- if (HasValueAny)
- return true;
- if (HasValueOther && ns != TargetNamespace)
- return true;
- if (HasValueTargetNamespace && ns == TargetNamespace)
- return true;
- if (HasValueLocal && ns == "")
- return true;
- for (int i = 0; i < ResolvedNamespaces.Count; i++)
- if (ns == ResolvedNamespaces [i])
- return true;
- if (raiseError)
- xsobj.error (h, "This wildcard does not allow the namespace: " + ns);
- return false;
+ if (HasValueAny)\r
+ return true;\r
+ if (HasValueOther && ns != TargetNamespace)\r
+ return true;\r
+ if (HasValueTargetNamespace && ns == TargetNamespace)\r
+ return true;\r
+ if (HasValueLocal && ns == "")\r
+ return true;\r
+ for (int i = 0; i < ResolvedNamespaces.Count; i++)\r
+ if (ns == ResolvedNamespaces [i])\r
+ return true;\r
+ if (raiseError)\r
+ xsobj.error (h, "This wildcard does not allow the namespace: " + ns);\r
+ return false;\r
}\r
\r
// 3.10.6 Wildcard Subset\r
--- /dev/null
+/DTMXPathDocumentWriter.cs -crlf
+/DTMXPathDocumentWriter2.cs -crlf
+/XPathNavigatorReader.cs -crlf
--- /dev/null
+/XmlFilterReader.cs -crlf
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Xml;
-\r
-namespace Mono.Xml\r
-{\r
- internal interface IHasXmlParserContext\r
- {\r
- XmlParserContext ParserContext { get; }\r
- }\r
-}\r
+
+namespace Mono.Xml
+{
+ internal interface IHasXmlParserContext
+ {
+ XmlParserContext ParserContext { get; }
+ }
+}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Xml;
-\r
-namespace Mono.Xml\r
-{\r
- internal interface IHasXmlSchemaInfo\r
- {\r
- object SchemaType { get; }\r
- }\r
-}\r
+
+namespace Mono.Xml
+{
+ internal interface IHasXmlSchemaInfo
+ {
+ object SchemaType { get; }
+ }
+}
// Atsushi Enomoto <atsushi@ximian.com>\r
//\r
// Copyright (c) 2004 Novell Inc. All rights reserved\r
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+//\r
+// 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
// Similar to SAX DefaultHandler\r
--- /dev/null
+/BUGS-MS.txt -crlf
+/BUGS.txt -crlf
--- /dev/null
+/array.output -crlf
+/complex.output -crlf
+/dataset.output -crlf
+/icollection.output -crlf
+/potest.output -crlf
+/xmlelement.output -crlf
+/xmlnode.output -crlf
--- /dev/null
+/IXsltContextFunction.cs -crlf
+/IXsltContextVariable.cs -crlf
+/XslTransform.cs -crlf
+/XsltArgumentList.cs -crlf
+/XsltCompileException.cs -crlf
+/XsltContext.cs -crlf
+/XsltException.cs -crlf
--- /dev/null
+/XmlSchemaBuiltInDatatypeTests.cs -crlf
+/XmlSchemaLengthFacetTests.cs -crlf
--- /dev/null
+/xsdtest.cs -crlf
--- /dev/null
+/README.j2ee -crlf
+/XmlCompare.cs -crlf
+/XmlNormalizer.cs -crlf
--- /dev/null
+/XmlDocumentEventTests.cs -crlf
+/XmlNodeReaderTests.cs -crlf
+/XmlReaderCommonTests.cs -crlf
+/XmlUrlResolverTests.cs -crlf
+/XmlValidatingReaderTests.cs -crlf
+/XmlWriterTests.cs -crlf
+/XsdParticleValidationTests.cs -crlf
+/XsdValidatingReaderTests.cs -crlf
--- /dev/null
+/Makefile -crlf
+/README.j2ee -crlf
+/TODO -crlf
namespace MonoTests.W3C_xmlconf {
using NUnit.Core;
- using NUnit.Framework;\r
-\r
+ using NUnit.Framework;
+
public abstract class BaseTests
{
- TestSuite _suite;\r
+ TestSuite _suite;
#region test list fields
protected readonly ArrayList ignoredTests = new ArrayList ();
: base (suite)
{
}
- }\r
-\r
- public class CleanTests : BaseTests\r
+ }
+
+ public class CleanTests : BaseTests
{
[Suite]
static public TestSuite Suite{
base.ProcessTest (testId, test);
}
- }\r
-\r
- public class KnownFailureTests : BaseTests\r
+ }
+
+ public class KnownFailureTests : BaseTests
{
[Suite]
static public TestSuite Suite{
base.ProcessTest (testId, test);
}
- }\r
-\r
+ }
+
public class TestFromCatalog : NUnit.Core.TestCase
{
XmlElement _test;
u2 = xr.ResolveUri (null, "file:///mystuff");
Assert.IsTrue (u2.IsAbsoluteUri, "null,absolute/file");
}
-#endif\r
+#endif
}
}
--- /dev/null
+/ITest.cs -crlf
+/readme.txt -crlf
// Mainsoft Corporation (c) 2003-2004
//
//**************************************************************************
-using System;\r
-using System.Xml;\r
+using System;
+using System.Xml;
using nist_dom;
-using NUnit.Framework;\r
-\r
-namespace nist_dom.fundamental\r
+using NUnit.Framework;
+
+namespace nist_dom.fundamental
{
- [TestFixture]\r
- public class AttrTest//, ITest\r
- {\r
- public static int i = 1;\r
-/*\r
- public testResults[] RunTests()\r
- {\r
+ [TestFixture]
+ public class AttrTest//, ITest
+ {
+ public static int i = 1;
+/*
+ public testResults[] RunTests()
+ {
testResults[] tests = new testResults[] {core0001A(), core0002A(), core0003A(),core0004A(),
core0005A(), core0006A(), core0007A(), core0008A(),
core0009A(), core0010A(), core0011A(), core0012A(),
- core0013A(), core0014A()};\r
- \r
- return tests;\r
+ core0013A(), core0014A()};
+
+ return tests;
}
*/
//------------------------ test case core-0001A ------------------------
// Write out results
//
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
domesticAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("domestic");
computedValue = domesticAttr.PreviousSibling;
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
domesticAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("domestic");
computedValue = domesticAttr.NextSibling;
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
domesticAttr = (System.Xml.XmlAttribute)docFragment.FirstChild.Attributes.Item(0) ;
computedValue = domesticAttr.Name;
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
domesticAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("domestic");
computedValue = domesticAttr.Value;
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Value;
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Name;
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
domesticAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("domestic");;
computedValue = domesticAttr.Specified.ToString();
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Specified.ToString();
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Specified.ToString();
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Specified.ToString();
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
streetAttr = (System.Xml.XmlAttribute)testNode.Attributes.GetNamedItem("street");
computedValue = streetAttr.Value;
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
streetAttr.Value = "Y%ent1;";
computedValue = streetAttr.Value;
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
//
// attempt to set a value on a readonly node should raise an exception.
//
- try \r
+ try
{
readOnlyAttribute.Value = "ABCD";
}
- catch (ArgumentException ex)\r
+ catch (ArgumentException ex)
{
computedValue = ex.GetType ().FullName;
}
}
- catch(System.Exception ex)\r
+ catch(System.Exception ex)
{
computedValue = "Exception " + ex.Message;
}
// return results;
}
//------------------------ End test case core-0014A --------------------------
- }\r
-\r
-}\r
+ }
+
+}
--- /dev/null
+/Comment.cs -crlf
--- /dev/null
+/Document.cs -crlf
--- /dev/null
+/Element.cs -crlf
--- /dev/null
+/NamedNodeMap.cs -crlf
--- /dev/null
+/Node.cs -crlf
--- /dev/null
+/NodeList.cs -crlf
About the Test Suite:\r
==============================\r
NIST DOM is XML DOM Level 1 Test Suite,\r
-Mainsoft have converted part of the NIST DOM
+Mainsoft have converted part of the NIST DOM \r
Test Suite \r
from ECMAScript (Java Script) into \r
C# .Net System.XML Conformance Test Suite.\r
System.Xml.XmlNode tmpNode = getDOMDocument().ImportNode(getOriginalDOMDocument().DocumentElement,true);
getDOMDocument().AppendChild(tmpNode);
//getDOMDocument().AppendChild(getOriginalDOMDocument().DocumentElement.CloneNode(true));
- }\r
+ }
catch (NotImplementedException ex)
{
throw ex;
--- /dev/null
+/xmltest.cs -crlf
--- /dev/null
+/nested-dtd-test.dtd -crlf
+/nested-included.dtd -crlf
--- /dev/null
+/1.xsd -crlf
+/2.xsd -crlf
+/3.xsd -crlf
+/4.xsd -crlf
--- /dev/null
+/358408.xsd -crlf
+/361818-2.xsd -crlf
+/361818-3.xsd -crlf
+/361818.xsd -crlf
+/422581.xml -crlf
+/422581.xsd -crlf
+/79650.xsd -crlf
+/81360.xsd -crlf
+/81360inc1.xsd -crlf
+/81360inc2.xsd -crlf
+/resolveUriSchema.xsd -crlf
--- /dev/null
+/empty.xsl -crlf
--- /dev/null
+/makefile.build -crlf
--- /dev/null
+/machine.config -crlf
+/makefile.build -crlf
--- /dev/null
+/System.xml -crlf
--- /dev/null
+/PowerModeChangedEventArgs.cs -crlf
+/PowerModeChangedEventHandler.cs -crlf
+/PowerModes.cs -crlf
+/SessionEndReasons.cs -crlf
+/SessionEndedEventArgs.cs -crlf
+/SessionEndedEventHandler.cs -crlf
+/SessionEndingEventArgs.cs -crlf
+/SessionEndingEventHandler.cs -crlf
+/TimerElapsedEventHandler.cs -crlf
+/UserPreferenceCategory.cs -crlf
+/UserPreferenceChangedEventArgs.cs -crlf
+/UserPreferenceChangedEventHandler.cs -crlf
+/UserPreferenceChangingEventArgs.cs -crlf
+/UserPreferenceChangingEventHandler.cs -crlf
using System.Security.Permissions;
using System.Timers;
-namespace Microsoft.Win32 {\r
-\r
+namespace Microsoft.Win32 {
+
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public sealed class SystemEvents
{
remove { }
}
}
-}\r
+}
using System.Runtime.InteropServices;
using System.Security.Permissions;
-namespace Microsoft.Win32 {\r
+namespace Microsoft.Win32 {
[PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
[PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
void Add (T item, Func<bool> cancellationFunc)
{
+ SpinWait sw = new SpinWait ();
+
while (true) {
long cachedAddId = addId;
long cachedRemoveId = removeId;
if (upperBound != -1) {
if (cachedAddId - cachedRemoveId > upperBound) {
- Block ();
+ sw.SpinOnce ();
continue;
}
}
T Take (Func<bool> cancellationFunc)
{
+ SpinWait sw = new SpinWait ();
+
while (true) {
long cachedRemoveId = removeId;
long cachedAddId = addId;
throw new OperationCanceledException ("The BlockingCollection<T> has"
+ " been marked as complete with regards to additions.");
- Block ();
+ sw.SpinOnce ();
continue;
}
{
return underlyingColl.ToArray ();
}
-
- [ThreadStatic]
- SpinWait sw;
-
- // Method used to stall the thread for a limited period of time before retrying an operation
- void Block ()
- {
- sw.SpinOnce ();
- }
public int BoundedCapacity {
get {
--- /dev/null
+/CollectionsUtil.cs -crlf
+/OrderedDictionary.cs -crlf
+/StringDictionary.cs -crlf
+/StringEnumerator.cs -crlf
--- /dev/null
+/DataObjectAttribute.cs -crlf
--- /dev/null
+/Debugger.jvm.cs -crlf
+/StackFrame.jvm.cs -crlf
+/StackTrace.jvm.cs -crlf
+/TraceEventCache.jvm.cs -crlf
--- /dev/null
+/Handshake.cs -crlf
+/Parity.cs -crlf
+/SerialData.cs -crlf
+/SerialError.cs -crlf
+/SerialPinChange.cs -crlf
+/StopBits.cs -crlf
--- /dev/null
+/ErrorEventArgs.cs -crlf
+/ErrorEventHandler.cs -crlf
+/FileSystemEventArgs.cs -crlf
+/FileSystemEventHandler.cs -crlf
+/IODescriptionAttribute.cs -crlf
+/InternalBufferOverflowException.cs -crlf
+/MonoIOError.cs -crlf
+/NotifyFilters.cs -crlf
+/RenamedEventArgs.cs -crlf
+/RenamedEventHandler.cs -crlf
+/WaitForChangedResult.cs -crlf
+/WatcherChangeTypes.cs -crlf
//\r
// (C) 2002\r
//\r
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// 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
public sealed class SmtpSection : ConfigurationSection
{
[ConfigurationProperty ("deliveryMethod", DefaultValue = "Network")]
- public SmtpDeliveryMethod DeliveryMethod {\r
- get { return (SmtpDeliveryMethod) base ["deliveryMethod"]; }\r
+ public SmtpDeliveryMethod DeliveryMethod {
+ get { return (SmtpDeliveryMethod) base ["deliveryMethod"]; }
set { base ["deliveryMethod"] = value; }
}
[ConfigurationProperty ("from")]
- public string From {\r
- get { return (string) base ["from"]; }\r
+ public string From {
+ get { return (string) base ["from"]; }
set { base ["from"] = value; }
}
[ConfigurationProperty ("network")]
- public SmtpNetworkElement Network {\r
+ public SmtpNetworkElement Network {
get { return (SmtpNetworkElement) base ["network"]; }
}
[ConfigurationProperty ("specifiedPickupDirectory")]
- public SmtpSpecifiedPickupDirectoryElement SpecifiedPickupDirectory {\r
+ public SmtpSpecifiedPickupDirectoryElement SpecifiedPickupDirectory {
get { return (SmtpSpecifiedPickupDirectoryElement) base ["specifiedPickupDirectory"]; }
}
--- /dev/null
+/SmtpPermission.cs -crlf
+/SmtpPermissionAttribute.cs -crlf
--- /dev/null
+/GHSocket.jvm.cs -crlf
+/GHSocketFactory.jvm.cs -crlf
+/GHStreamSocket.jvm.cs -crlf
+/GHStreamSocketSSL.jvm.cs -crlf
--- /dev/null
+/CookieException.cs -crlf
+/DnsPermission.cs -crlf
+/DnsPermissionAttribute.cs -crlf
+/EndpointPermission.cs -crlf
+/FileWebRequest.cs -crlf
+/FileWebResponse.cs -crlf
+/FtpStatus.cs -crlf
+/HttpContinueDelegate.cs -crlf
+/HttpProvider.jvm.cs -crlf
+/HttpStateCache.jvm.cs -crlf
+/HttpVersion.cs -crlf
+/HttpWebRequest.jvm.cs -crlf
+/HttpWebResponse.jvm.cs -crlf
+/IPv6Address.cs -crlf
+/MonoHttpDate.cs -crlf
+/ProtocolViolationException.cs -crlf
+/SocketPermission.cs -crlf
+/VMWHttpProvider.jvm.cs -crlf
+/WebException.cs -crlf
+/WebResponse.cs -crlf
+/WebUtility.cs -crlf
asyncResult.AsyncWaitHandle.WaitOne ();\r
AsyncResult async = (AsyncResult) asyncResult;\r
GetResponseCallback cb = (GetResponseCallback) async.AsyncDelegate;\r
- WebResponse webResponse = cb.EndInvoke(asyncResult);\r
+ FileWebResponse webResponse = (FileWebResponse) cb.EndInvoke(asyncResult);\r
asyncResponding = false;\r
+ if (webResponse.HasError)\r
+ throw webResponse.Error;\r
return webResponse;\r
}\r
\r
}\r
FileStream fileStream = null;\r
try {\r
- fileStream = new FileWebStream (this, FileMode.Open,\r
- FileAccess.Read, FileShare.Read);\r
+ fileStream = new FileWebStream (this, FileMode.Open, FileAccess.Read, FileShare.Read);\r
+ this.webResponse = new FileWebResponse (this.uri, fileStream);\r
} catch (Exception ex) {\r
- throw new WebException (ex.Message, ex);\r
+ this.webResponse = new FileWebResponse (this.uri, new WebException (ex.Message, ex));\r
}\r
- this.webResponse = new FileWebResponse (this.uri, fileStream);\r
- return (WebResponse) this.webResponse;\r
+ return this.webResponse;\r
}\r
\r
void ISerializable.GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
private FileStream fileStream;\r
private long contentLength;\r
private WebHeaderCollection webHeaders;\r
- private bool disposed = false;\r
+ private bool disposed;\r
+ Exception exception;\r
\r
// Constructors\r
\r
throw new WebException (e.Message, e);\r
}\r
}\r
+\r
+ internal FileWebResponse (Uri responseUri, WebException exception)\r
+ {\r
+ this.responseUri = responseUri;\r
+ this.exception = exception;\r
+ }\r
\r
#if NET_2_0\r
[Obsolete ("Serialization is obsoleted for this type", false)]\r
}\r
\r
// Properties\r
+ internal bool HasError {\r
+ get { return exception != null; }\r
+ }\r
+\r
+ internal Exception Error {\r
+ get { return exception; }\r
+ }\r
\r
public override long ContentLength {\r
get {\r
result.InnerAsyncResult = r;
result.DoCallback ();
} else {
- EndRead (r);
+ try {
+ EndRead (r);
+ } catch {
+ }
}
}
--- /dev/null
+/BaseMachine.cs -crlf
+/LookBehindWithUndefinedLength.jvm.cs -crlf
+/NotAllowedConstruct.jvm.cs -crlf
+/RegexRunnerFactory.cs -crlf
+/cache.cs -crlf
+/category.cs -crlf
+/debug.cs -crlf
+/interval.cs -crlf
\r
int gcount = m.Groups.Count;\r
for (int gindex = 1; gindex < gcount; gindex++) {\r
- Group grp = m.Groups [gindex];
+ Group grp = m.Groups [gindex];\r
if (grp.Length > 0)\r
splits.Add (input.Substring (grp.Index, grp.Length));\r
}\r
--- /dev/null
+/UriBuilder.cs -crlf
new NameValueCollection (-1, new EqualityComparer ());
}
- [Test]\r
- public void Constructor_IEqualityComparer_Null ()\r
- {\r
- NameValueCollection c1 = new NameValueCollection ((IEqualityComparer)null);\r
- c1.Add ("key", "value");\r
- Assert.AreEqual (c1.Get ("KEY"), "value", "Constructor_IEqualityComparer_Null");\r
- c1.Remove ("key");\r
- }\r
-\r
- [Test]\r
- public void Constructor_NameValueCollection ()\r
- {\r
- NameValueCollection c1 = new NameValueCollection (StringComparer.InvariantCultureIgnoreCase);\r
- c1.Add ("key", "value");\r
- NameValueCollection c2 = new NameValueCollection (c1);\r
- Assert.AreEqual (c2.Get ("KEY"), "value", "Constructor_NameValueCollection");\r
- c2.Remove ("key");\r
- }
-#endif\r
+ [Test]
+ public void Constructor_IEqualityComparer_Null ()
+ {
+ NameValueCollection c1 = new NameValueCollection ((IEqualityComparer)null);
+ c1.Add ("key", "value");
+ Assert.AreEqual (c1.Get ("KEY"), "value", "Constructor_IEqualityComparer_Null");
+ c1.Remove ("key");
+ }
+
+ [Test]
+ public void Constructor_NameValueCollection ()
+ {
+ NameValueCollection c1 = new NameValueCollection (StringComparer.InvariantCultureIgnoreCase);
+ c1.Add ("key", "value");
+ NameValueCollection c2 = new NameValueCollection (c1);
+ Assert.AreEqual (c2.Get ("KEY"), "value", "Constructor_NameValueCollection");
+ c2.Remove ("key");
+ }
+#endif
}
}
--- /dev/null
+/AsyncOperationManagerTest.cs -crlf
--- /dev/null
+/Makefile -crlf
+/TypeDescriptorTest.cs -crlf
--- /dev/null
+/EventLogPermissionAttributeTest.cs -crlf
+/PerformanceCounterPermissionAttributeTest.cs -crlf
case 12:\r
case 13:\r
case 32:\r
- case 92:
+ case 92:\r
#if NET_2_0\r
- case 133:
+ case 133:\r
#endif\r
case 160:\r
// known invalid chars\r
case 32:\r
case 92:\r
#if NET_2_0\r
- case 133:
+ case 133:\r
#endif\r
case 160:\r
// known invalid chars\r
--- /dev/null
+/CookieCollectionTest.cs -crlf
+/CredentialCacheTest.cs -crlf
+/DnsTest.cs -crlf
+/ServicePointManagerTest.cs -crlf
+/ServicePointTest.cs -crlf
+/SocketPermissionTest.cs -crlf
+/WebRequestTest.cs -crlf
using System;
using System.Net;
-using NUnit.Framework;\r
+using NUnit.Framework;
namespace MoonTest.System.Net {
--- /dev/null
+/x509build.cs -crlf
--- /dev/null
+/AspNetHostingPermissionAttributeTest.cs -crlf
+/AspNetHostingPermissionTest.cs -crlf
Assert.AreEqual (AspNetHostingPermissionLevel.Unrestricted, anhp.Level, "Level");\r
Assert.IsTrue (anhp.IsUnrestricted (), "IsUnrestricted");\r
\r
- SecurityElement se = anhp.ToXml ();
-#if NET_2_0
+ SecurityElement se = anhp.ToXml ();\r
+#if NET_2_0\r
// fixed in 2.0 RC\r
- Assert.IsNotNull (se.Attribute ("Unrestricted"), "Xml-Unrestricted");
+ Assert.IsNotNull (se.Attribute ("Unrestricted"), "Xml-Unrestricted");\r
#else\r
- Assert.IsNull (se.Attribute ("Unrestricted"), "Xml-Unrestricted");
+ Assert.IsNull (se.Attribute ("Unrestricted"), "Xml-Unrestricted");\r
#endif\r
Assert.AreEqual ("Unrestricted", se.Attribute ("Level"), "Xml-Level");\r
Assert.IsNull (se.Children, "Xml-Children");\r
AspNetHostingPermission anhp = new AspNetHostingPermission (PermissionState.None);\r
// No intersection with null\r
foreach (AspNetHostingPermissionLevel ppl in AllLevel) {\r
- anhp.Level = ppl;
- IPermission p = anhp.Intersect (null);
-#if ! NET_2_0
- if (p != null)
+ anhp.Level = ppl;\r
+ IPermission p = anhp.Intersect (null);\r
+#if ! NET_2_0\r
+ if (p != null)\r
Assert.Ignore ("Behaviour changed in FX 1.1 SP1");\r
#endif\r
Assert.IsNull (p, ppl.ToString ());\r
--- /dev/null
+/UriTest2.cs -crlf
+/test-uri-props-manual.txt -crlf
+/test-uri-props.txt -crlf
+/test-uri-relative-props.txt -crlf
+/uri-test-generator.cs -crlf
--- /dev/null
+/ca.pem -crlf
+/client.pem -crlf
--- /dev/null
+/ChangeLog -crlf
-2010-02-19 Alan McGovern <amcgovern@novell.com>
-
- * System.IO.Packaging/PackUriHelper.cs: Commit a fix for #570648 so
- that PackUris can be combined properly.
-
+2010-02-19 Alan McGovern <amcgovern@novell.com>\r
+\r
+ * System.IO.Packaging/PackUriHelper.cs: Commit a fix for #570648 so\r
+ that PackUris can be combined properly.\r
+\r
2009-11-21 Raja R Harinath <harinath@hurrynot.org>\r
\r
* System.Collections.ObjectModel/ObservableCollection.cs [NET_4_0]:\r
}
public override int GetHashCode ()
- {\r
+ {
return (x.GetHashCode() ^ y.GetHashCode());
}
}
public static Point Parse (string source)
- {\r
- string[] points = source.Split(',');\r
-\r
- if (points.Length<2)\r
- throw new InvalidOperationException ("source does not contain two numbers");\r
- if (points.Length > 2)\r
- throw new InvalidOperationException ("source contains too many delimiters");\r
-\r
+ {
+ string[] points = source.Split(',');
+
+ if (points.Length<2)
+ throw new InvalidOperationException ("source does not contain two numbers");
+ if (points.Length > 2)
+ throw new InvalidOperationException ("source contains too many delimiters");
+
CultureInfo ci = CultureInfo.InvariantCulture;
return new Point (Convert.ToDouble(points[0],ci), Convert.ToDouble(points[1],ci));
}
public override string ToString ()
- {\r
+ {
return this.ToString(null, null);
}
public string ToString (IFormatProvider formatProvider)
- {\r
+ {
return this.ToString(null,formatProvider);
}
- private string ToString(string format,IFormatProvider formatProvider)\r
- {\r
- CultureInfo ci = (CultureInfo)formatProvider;\r
-\r
- if (ci == null)\r
- ci = CultureInfo.CurrentCulture;\r
- string seperator = ci.NumberFormat.NumberDecimalSeparator;\r
- if (seperator.Equals(","))\r
- seperator = ";";\r
- else\r
- seperator = ",";\r
- object[] ob = { this.x, seperator, this.y };\r
-\r
- return string.Format(formatProvider, "{0:" + format + "}{1}{2:" + format + "}", ob);\r
+ private string ToString(string format,IFormatProvider formatProvider)
+ {
+ CultureInfo ci = (CultureInfo)formatProvider;
+
+ if (ci == null)
+ ci = CultureInfo.CurrentCulture;
+ string seperator = ci.NumberFormat.NumberDecimalSeparator;
+ if (seperator.Equals(","))
+ seperator = ";";
+ else
+ seperator = ",";
+ object[] ob = { this.x, seperator, this.y };
+
+ return string.Format(formatProvider, "{0:" + format + "}{1}{2:" + format + "}", ob);
}
string IFormattable.ToString (string format, IFormatProvider formatProvider)
- {\r
+ {
return this.ToString(format, formatProvider);
}
// Removing the PropertyChanged event handler should work as well:
((INotifyPropertyChanged)collection).PropertyChanged -= pceh;
- }\r
-\r
- //Private test class for protected members of ObservableCollection\r
- private class ObservableCollectionTestHelper : ObservableCollection<char> {\r
- internal void DoubleEnterReentrant()\r
- {\r
- IDisposable object1 = BlockReentrancy ();\r
- IDisposable object2 = BlockReentrancy ();\r
-\r
- Assert.AreSame (object1, object2);\r
-\r
- //With double block, try the reentrant:\r
- NotifyCollectionChangedEventArgs args = null;\r
-\r
- CollectionChanged += delegate (object sender, NotifyCollectionChangedEventArgs e) {\r
- args = e;\r
- };\r
-\r
- // We need a second callback for reentrancy to matter\r
- CollectionChanged += delegate (object sender, NotifyCollectionChangedEventArgs e) {\r
- // Doesn't need to do anything; just needs more than one callback registered.\r
- };\r
-\r
- // Try adding - this should cause reentrancy, and fail\r
- try {\r
- Add ('I');\r
- Assert.Fail ("Reentrancy should not be allowed. -- #2");\r
- } catch (InvalidOperationException) {\r
- }\r
- \r
- // Release the first reentrant\r
- object1.Dispose ();\r
-\r
- // Try adding again - this should cause reentrancy, and fail again\r
- try {\r
- Add ('J');\r
- Assert.Fail ("Reentrancy should not be allowed. -- #3");\r
- } catch (InvalidOperationException) {\r
- }\r
-\r
- // Release the reentrant a second time\r
- object1.Dispose ();\r
-\r
- // This last add should work fine.\r
- Add ('K');\r
- CollectionChangedEventValidators.ValidateAddOperation (args, new char [] { 'K' }, 0, "REENTHELP_1");\r
- }\r
- }\r
-\r
- [Test]\r
- public void ReentrantReuseObject()\r
- {\r
- ObservableCollectionTestHelper helper = new ObservableCollectionTestHelper ();\r
-\r
- helper.DoubleEnterReentrant ();\r
+ }
+
+ //Private test class for protected members of ObservableCollection
+ private class ObservableCollectionTestHelper : ObservableCollection<char> {
+ internal void DoubleEnterReentrant()
+ {
+ IDisposable object1 = BlockReentrancy ();
+ IDisposable object2 = BlockReentrancy ();
+
+ Assert.AreSame (object1, object2);
+
+ //With double block, try the reentrant:
+ NotifyCollectionChangedEventArgs args = null;
+
+ CollectionChanged += delegate (object sender, NotifyCollectionChangedEventArgs e) {
+ args = e;
+ };
+
+ // We need a second callback for reentrancy to matter
+ CollectionChanged += delegate (object sender, NotifyCollectionChangedEventArgs e) {
+ // Doesn't need to do anything; just needs more than one callback registered.
+ };
+
+ // Try adding - this should cause reentrancy, and fail
+ try {
+ Add ('I');
+ Assert.Fail ("Reentrancy should not be allowed. -- #2");
+ } catch (InvalidOperationException) {
+ }
+
+ // Release the first reentrant
+ object1.Dispose ();
+
+ // Try adding again - this should cause reentrancy, and fail again
+ try {
+ Add ('J');
+ Assert.Fail ("Reentrancy should not be allowed. -- #3");
+ } catch (InvalidOperationException) {
+ }
+
+ // Release the reentrant a second time
+ object1.Dispose ();
+
+ // This last add should work fine.
+ Add ('K');
+ CollectionChangedEventValidators.ValidateAddOperation (args, new char [] { 'K' }, 0, "REENTHELP_1");
+ }
+ }
+
+ [Test]
+ public void ReentrantReuseObject()
+ {
+ ObservableCollectionTestHelper helper = new ObservableCollectionTestHelper ();
+
+ helper.DoubleEnterReentrant ();
}
[Test]
--- /dev/null
+/FakePackage.cs -crlf
+/FakePackagePartTests.cs -crlf
+/FakePackageTests.cs -crlf
+/PackUriHelperTests.cs -crlf
+/PackagePartStreamTests.cs -crlf
+/PackagePartTest.cs -crlf
+/PackageRelationshipTests.cs -crlf
+/PackageTest.cs -crlf
}
[DllImport ("MonoPosixHelper")]
- static extern unsafe int zipWriteInFileInZip (ZipHandle handle,\r
- byte* buffer,\r
+ static extern unsafe int zipWriteInFileInZip (ZipHandle handle,
+ byte* buffer,
uint len);
[DllImport ("MonoPosixHelper")]
{
[StructLayout (LayoutKind.Sequential)]
struct UnzipFileInfo
- {\r
- IntPtr version; /* version made by 2 bytes */\r
- IntPtr version_needed; /* version needed to extract 2 bytes */\r
- IntPtr flag; /* general purpose bit flag 2 bytes */\r
- IntPtr compression_method; /* compression method 2 bytes */\r
- IntPtr dosDate; /* last mod file date in Dos fmt 4 bytes */\r
- IntPtr crc; /* crc-32 4 bytes */\r
- IntPtr compressed_size; /* compressed size 4 bytes */\r
- IntPtr uncompressed_size; /* uncompressed size 4 bytes */\r
- IntPtr size_filename; /* filename length 2 bytes */\r
- IntPtr size_file_extra; /* extra field length 2 bytes */\r
- IntPtr size_file_comment; /* file comment length 2 bytes */\r
- \r
- IntPtr disk_num_start; /* disk number start 2 bytes */\r
- IntPtr internal_fa; /* internal file attributes 2 bytes */\r
- IntPtr external_fa; /* external file attributes 4 bytes */\r
- \r
+ {
+ IntPtr version; /* version made by 2 bytes */
+ IntPtr version_needed; /* version needed to extract 2 bytes */
+ IntPtr flag; /* general purpose bit flag 2 bytes */
+ IntPtr compression_method; /* compression method 2 bytes */
+ IntPtr dosDate; /* last mod file date in Dos fmt 4 bytes */
+ IntPtr crc; /* crc-32 4 bytes */
+ IntPtr compressed_size; /* compressed size 4 bytes */
+ IntPtr uncompressed_size; /* uncompressed size 4 bytes */
+ IntPtr size_filename; /* filename length 2 bytes */
+ IntPtr size_file_extra; /* extra field length 2 bytes */
+ IntPtr size_file_comment; /* file comment length 2 bytes */
+
+ IntPtr disk_num_start; /* disk number start 2 bytes */
+ IntPtr internal_fa; /* internal file attributes 2 bytes */
+ IntPtr external_fa; /* external file attributes 4 bytes */
+
ZipTime tmu_date;
public ulong VersionNeeded {
--- /dev/null
+/mscorlib.xml -crlf
<ReturnValue />
<Parameters />
<Docs>
- <summary>Constructor, no idea why it is here (abstract class) :-)\r
+ <summary>Constructor, no idea why it is here (abstract class) :-)
</summary>
<remarks>Included for compatibility with MS.</remarks>
</Docs>
+2010-07-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * UnixRegistryApi.cs: From the static ctor of KeyHandler remove the
+ volatile keys directory if the last registered boot time has changed.
+ This way we *actually* have our volatile keys removed if the system as
+ rebooted.
+
2010-07-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* UnixRegistryApi.cs: Remove the in-memmory approach to volatile keys,
using System;
using System.Collections;
+using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
string file;
bool dirty;
+ static KeyHandler ()
+ {
+ CleanVolatileKeys ();
+ }
+
KeyHandler (RegistryKey rkey, string basedir) : this (rkey, basedir, false)
{
}
return String.Concat (rkey.Name, "\\", extra);
}
-
+
+ static long GetSystemBootTime ()
+ {
+ if (!File.Exists ("/proc/stat"))
+ return -1;
+
+ string btime = null;
+ string line;
+
+ try {
+ using (StreamReader stat_file = new StreamReader ("/proc/stat", Encoding.ASCII)) {
+ while ((line = stat_file.ReadLine ()) != null)
+ if (line.StartsWith ("btime")) {
+ btime = line;
+ break;
+ }
+ }
+ } catch (Exception e) {
+ Console.Error.WriteLine ("While reading system info {0}", e);
+ }
+
+ if (btime == null)
+ return -1;
+
+ int space = btime.IndexOf (' ');
+ long res;
+ if (!Int64.TryParse (btime.Substring (space, btime.Length - space), out res))
+ return -1;
+
+ return res;
+ }
+
+ // The registered boot time it's a simple line containing the last system btime.
+ static long GetRegisteredBootTime (string path)
+ {
+ if (!File.Exists (path))
+ return -1;
+
+ string line = null;
+ try {
+ using (StreamReader reader = new StreamReader (path, Encoding.ASCII))
+ line = reader.ReadLine ();
+ } catch (Exception e) {
+ Console.Error.WriteLine ("While reading registry data at {0}: {1}", path, e);
+ }
+
+ if (line == null)
+ return -1;
+
+ long res;
+ if (!Int64.TryParse (line, out res))
+ return -1;
+
+ return res;
+ }
+
+ static void SaveRegisteredBootTime (string path, long btime)
+ {
+ try {
+ using (StreamWriter writer = new StreamWriter (path, false, Encoding.ASCII))
+ writer.WriteLine (btime.ToString ());
+ } catch (Exception e) {
+ Console.Error.WriteLine ("While saving registry data at {0}: {1}", path, e);
+ }
+ }
+
+ // We save the last boot time in a last-btime file in every root, and we use it
+ // to clean the volatile keys directory in case the system btime changed.
+ static void CleanVolatileKeys ()
+ {
+ long system_btime = GetSystemBootTime ();
+
+ string [] roots = new string [] {
+ UserStore,
+ MachineStore
+ };
+
+ foreach (string root in roots) {
+ if (!Directory.Exists (root))
+ continue;
+
+ string btime_file = Path.Combine (root, "last-btime");
+ string volatile_dir = Path.Combine (root, VolatileDirectoryName);
+
+ if (Directory.Exists (volatile_dir)) {
+ long registered_btime = GetRegisteredBootTime (btime_file);
+ if (system_btime < 0 || registered_btime < 0 || registered_btime != system_btime)
+ Directory.Delete (volatile_dir, true);
+ }
+
+ SaveRegisteredBootTime (btime_file, system_btime);
+ }
+ }
+
public static bool VolatileKeyExists (string dir)
{
lock (typeof (KeyHandler)) {
return vals;
}
+ public int GetSubKeyCount ()
+ {
+ return GetSubKeyNames ().Length;
+ }
+
+ public string [] GetSubKeyNames ()
+ {
+ DirectoryInfo selfDir = new DirectoryInfo (ActualDir);
+ DirectoryInfo[] subDirs = selfDir.GetDirectories ();
+ string[] subKeyNames;
+
+ // for volatile keys (cannot contain non-volatile subkeys) or keys
+ // without *any* presence in the volatile key section, we can do it simple.
+ if (IsVolatile || !Directory.Exists (GetVolatileDir (Dir))) {
+ subKeyNames = new string[subDirs.Length];
+ for (int i = 0; i < subDirs.Length; i++) {
+ DirectoryInfo subDir = subDirs[i];
+ subKeyNames[i] = subDir.Name;
+ }
+ return subKeyNames;
+ }
+
+ // We may have the entries repeated, so keep just one of each one.
+ DirectoryInfo volatileDir = new DirectoryInfo (GetVolatileDir (Dir));
+ DirectoryInfo [] volatileSubDirs = volatileDir.GetDirectories ();
+ Dictionary<string,string> dirs = new Dictionary<string,string> ();
+
+ foreach (DirectoryInfo dir in subDirs)
+ dirs [dir.Name] = dir.Name;
+ foreach (DirectoryInfo volDir in volatileSubDirs)
+ dirs [volDir.Name] = volDir.Name;
+
+ subKeyNames = new string [dirs.Count];
+ int j = 0;
+ foreach (KeyValuePair<string,string> entry in dirs)
+ subKeyNames[j++] = entry.Value;
+
+ return subKeyNames;
+ }
+
//
// This version has to do argument validation based on the valueKind
//
KeyHandler self = KeyHandler.Lookup (rkey, true);
if (self == null)
throw RegistryKey.CreateMarkedForDeletionException ();
- return Directory.GetDirectories (self.Dir).Length;
+ return self.GetSubKeyCount ();
}
public int ValueCount (RegistryKey rkey)
public string [] GetSubKeyNames (RegistryKey rkey)
{
KeyHandler self = KeyHandler.Lookup (rkey, true);
- DirectoryInfo selfDir = new DirectoryInfo (self.Dir);
- DirectoryInfo[] subDirs = selfDir.GetDirectories ();
- string[] subKeyNames = new string[subDirs.Length];
- for (int i = 0; i < subDirs.Length; i++) {
- DirectoryInfo subDir = subDirs[i];
- subKeyNames[i] = subDir.Name;
- }
- return subKeyNames;
+ return self.GetSubKeyNames ();
}
public string [] GetValueNames (RegistryKey rkey)
--- /dev/null
+/ChangeLog -crlf
--- /dev/null
+/CodePageDataItem.cs -crlf
{\r
[Serializable]\r
internal sealed class CodePageDataItem\r
- {
+ {\r
#pragma warning disable 169 \r
private string m_bodyName;\r
private int m_codePage;\r
\r
private CodePageDataItem ()\r
{\r
- }
+ }\r
#pragma warning disable 169 \r
}\r
}\r
--- /dev/null
+/MonoIOError.cs -crlf
+/MonoIOStat.cs -crlf
+/SearchPattern.cs -crlf
+/StreamWriter.cs -crlf
+/StringWriter.cs -crlf
-//
-// System.IO.MonoIOError.cs: Win32 error codes. Yuck.
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+//\r
+// System.IO.MonoIOError.cs: Win32 error codes. Yuck.\r
+//\r
+// Author:\r
+// Dan Lewis (dihlewis@yahoo.co.uk)\r
+//\r
+// (C) 2002\r
+//\r
+\r
+//\r
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
\r
using System;\r
\r
ERROR_PATH_NOT_FOUND = 3,\r
ERROR_TOO_MANY_OPEN_FILES = 4,\r
ERROR_ACCESS_DENIED = 5,\r
- ERROR_INVALID_HANDLE = 6,
+ ERROR_INVALID_HANDLE = 6,\r
/* ERROR_ARENA_TRASHED = 7,\r
ERROR_NOT_ENOUGH_MEMORY = 8,\r
ERROR_INVALID_BLOCK = 9,\r
ERROR_SEEK = 25,\r
ERROR_NOT_DOS_DISK = 26,\r
ERROR_SECTOR_NOT_FOUND = 27,\r
- ERROR_OUT_OF_PAPER = 28,*/
+ ERROR_OUT_OF_PAPER = 28,*/\r
ERROR_WRITE_FAULT = 29,\r
ERROR_READ_FAULT = 30,\r
- ERROR_GEN_FAILURE = 31,
- ERROR_SHARING_VIOLATION = 32,
+ ERROR_GEN_FAILURE = 31,\r
+ ERROR_SHARING_VIOLATION = 32,\r
ERROR_LOCK_VIOLATION = 33,\r
/* ERROR_WRONG_DISK = 34,\r
ERROR_SHARING_BUFFER_EXCEEDED = 36,\r
ERROR_SHARING_PAUSED = 70,\r
ERROR_REQ_NOT_ACCEP = 71,\r
ERROR_REDIR_PAUSED = 72,\r
- */ ERROR_FILE_EXISTS = 80,
- ERROR_CANNOT_MAKE = 82,
+ */ ERROR_FILE_EXISTS = 80,\r
+ ERROR_CANNOT_MAKE = 82,\r
/* ERROR_FAIL_I24 = 83,\r
ERROR_OUT_OF_STRUCTURES = 84,\r
ERROR_ALREADY_ASSIGNED = 85,\r
ERROR_BUSY_DRIVE = 142,\r
ERROR_SAME_DRIVE = 143,\r
ERROR_DIR_NOT_ROOT = 144,\r
- */
+ */\r
ERROR_DIR_NOT_EMPTY = 145,\r
- /*
+ /*\r
ERROR_IS_SUBST_PATH = 146,\r
ERROR_IS_JOIN_PATH = 147,\r
ERROR_PATH_BUSY = 148,\r
ERROR_NODE_CANNOT_BE_CLUSTERED = 5898,\r
ERROR_CLUSTER_WRONG_OS_VERSION = 5899,\r
ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME = 5900,\r
- */
- ERROR_ENCRYPTION_FAILED = 6000,
- /*
+ */\r
+ ERROR_ENCRYPTION_FAILED = 6000,\r
+ /*\r
ERROR_DECRYPTION_FAILED = 6001,\r
ERROR_FILE_ENCRYPTED = 6002,\r
ERROR_NO_RECOVERY_POLICY = 6003,\r
//\r
// (C) 2002\r
//\r
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
\r
using System;\r
\r
--- /dev/null
+/IOperatingSystem.cs -crlf
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
+\r
+//\r
+// Copyright (C) 2004 Novell, Inc (http://www.novell.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
\r
XX X XXX\r
public PermissionSet PermissionSet {
get { return this.GrantedPermissionSet; }
}
+
+ [MonoTODO]
+ public bool IsFullyTrusted {
+ get { return true; }
+ }
#endif
#if !MOONLIGHT
+2010-07-28 Jb Evain <jbevain@novell.com>
+
+ * Assembly.cs: add IsFullyTrusted stub.
Thu Jul 22 11:05:04 CEST 2010 Paolo Molaro <lupus@ximian.com>
-//------------------------------------------------------------------------------\r
-// \r
-// System.Runtime.CompilerServices.MethodCodeType.cs \r
-//\r
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved\r
-// \r
-// Author: Michael Lambert, michaellambert@email.com\r
-// Created: Thu 07/18/2001 \r
-//\r
-//------------------------------------------------------------------------------\r
+//------------------------------------------------------------------------------
+//
+// System.Runtime.CompilerServices.MethodCodeType.cs
+//
+// Copyright (C) 2001 Michael Lambert, All Rights Reserved
+//
+// Author: Michael Lambert, michaellambert@email.com
+// Created: Thu 07/18/2001
+//
+//------------------------------------------------------------------------------
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-\r
-using System;\r
-using System.Threading;\r
-using System.Runtime.Remoting.Messaging;\r
-using System.Runtime.Remoting.Activation;\r
-using System.Runtime.Remoting.Channels;\r
-\r
-namespace System.Runtime.Remoting.Contexts\r
-{\r
- internal class CrossContextChannel: IMessageSink\r
- {\r
+
+using System;
+using System.Threading;
+using System.Runtime.Remoting.Messaging;
+using System.Runtime.Remoting.Activation;
+using System.Runtime.Remoting.Channels;
+
+namespace System.Runtime.Remoting.Contexts
+{
+ internal class CrossContextChannel: IMessageSink
+ {
public IMessage SyncProcessMessage (IMessage msg)
{
ServerIdentity identity = (ServerIdentity) RemotingServices.GetMessageTargetIdentity (msg);
public IMessageSink NextSink
{
get { return null; }
- }\r
-\r
- class ContextRestoreSink: IMessageSink\r
- {\r
- IMessageSink _next;\r
- Context _context;\r
- IMessage _call;\r
-\r
- public ContextRestoreSink (IMessageSink next, Context context, IMessage call)\r
- {\r
- _next = next;\r
- _context = context;\r
- _call = call;\r
- }\r
-\r
+ }
+
+ class ContextRestoreSink: IMessageSink
+ {
+ IMessageSink _next;
+ Context _context;
+ IMessage _call;
+
+ public ContextRestoreSink (IMessageSink next, Context context, IMessage call)
+ {
+ _next = next;
+ _context = context;
+ _call = call;
+ }
+
public IMessage SyncProcessMessage (IMessage msg)
{
try
{
if (_context != null)
Context.SwitchToContext (_context);
- } \r
+ }
}
public IMessageCtrl AsyncProcessMessage (IMessage msg, IMessageSink replySink)
public IMessageSink NextSink
{
get { return _next; }
- } \r
- }\r
-\r
- }\r
-}\r
+ }
+ }
+
+ }
+}
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-\r
-using System;\r
-using System.Threading;\r
-using System.Collections;\r
-\r
-namespace System.Runtime.Remoting.Lifetime\r
-{\r
- internal class Lease : MarshalByRefObject, ILease\r
- {\r
+
+using System;
+using System.Threading;
+using System.Collections;
+
+namespace System.Runtime.Remoting.Lifetime
+{
+ internal class Lease : MarshalByRefObject, ILease
+ {
DateTime _leaseExpireTime;
LeaseState _currentState;
TimeSpan _initialLeaseTime;
RenewalDelegate _renewalDelegate;
delegate TimeSpan RenewalDelegate(ILease lease);
-\r
- public Lease()\r
- {\r
- _currentState = LeaseState.Initial;\r
- _initialLeaseTime = LifetimeServices.LeaseTime;\r
- _renewOnCallTime = LifetimeServices.RenewOnCallTime;\r
- _sponsorshipTimeout = LifetimeServices.SponsorshipTimeout;\r
- _leaseExpireTime = DateTime.Now + _initialLeaseTime;\r
- }\r
-\r
+
+ public Lease()
+ {
+ _currentState = LeaseState.Initial;
+ _initialLeaseTime = LifetimeServices.LeaseTime;
+ _renewOnCallTime = LifetimeServices.RenewOnCallTime;
+ _sponsorshipTimeout = LifetimeServices.SponsorshipTimeout;
+ _leaseExpireTime = DateTime.Now + _initialLeaseTime;
+ }
+
public TimeSpan CurrentLeaseTime
{
get { return _leaseExpireTime - DateTime.Now; }
throw new RemotingException ("InitialLeaseTime property can only be set when the lease is in initial state; state is " + _currentState + ".");
_initialLeaseTime = value;
- _leaseExpireTime = DateTime.Now + _initialLeaseTime;\r
+ _leaseExpireTime = DateTime.Now + _initialLeaseTime;
if (value == TimeSpan.Zero) _currentState = LeaseState.Null;
}
}
Unregister ((ISponsor) _renewingSponsors.Dequeue()); // Drop the sponsor
CheckNextSponsor ();
}
- }\r
-}\r
+ }
+}
--- /dev/null
+/EnvoyTerminatorSink.cs -crlf
+/Header.cs -crlf
+/IInternalMessage.cs -crlf
+/MethodCallDictionary.cs -crlf
+/MethodReturnDictionary.cs -crlf
+/RemotingSurrogate.cs -crlf
// Author: Lluis Sanchez Gual (lluis@ideary.com)
//
// (C) 2003, Lluis Sanchez Gual
-//\r
+//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-\r
-using System;\r
-using System.Runtime.Remoting.Activation;\r
-\r
-namespace System.Runtime.Remoting.Messaging\r
-{\r
- class ConstructionCallDictionary : MethodDictionary\r
- {\r
- public static string[] InternalKeys = new string[] {"__Uri", "__MethodName", "__TypeName", "__MethodSignature", "__Args", "__CallContext", "__CallSiteActivationAttributes", "__ActivationType", "__ContextProperties", "__Activator", "__ActivationTypeName"};\r
-\r
- public ConstructionCallDictionary(IConstructionCallMessage message) : base (message) \r
- { \r
- MethodKeys = InternalKeys;\r
- }\r
+
+using System;
+using System.Runtime.Remoting.Activation;
+
+namespace System.Runtime.Remoting.Messaging
+{
+ class ConstructionCallDictionary : MethodDictionary
+ {
+ public static string[] InternalKeys = new string[] {"__Uri", "__MethodName", "__TypeName", "__MethodSignature", "__Args", "__CallContext", "__CallSiteActivationAttributes", "__ActivationType", "__ContextProperties", "__Activator", "__ActivationTypeName"};
+
+ public ConstructionCallDictionary(IConstructionCallMessage message) : base (message)
+ {
+ MethodKeys = InternalKeys;
+ }
protected override object GetMethodProperty (string key)
{
default: base.SetMethodProperty (key, value); break;
}
}
- }\r
-}\r
+ }
+}
// Author: Lluis Sanchez Gual (lluis@ideary.com)
//
// (C) 2003, Lluis Sanchez Gual
-//\r
+//
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
// simple message to avoid serialization of crap data
[Serializable]
- internal class ErrorMessage : IMethodCallMessage\r
+ internal class ErrorMessage : IMethodCallMessage
{
string _uri = "Exception";
return "unknown";
}
- public int InArgCount \r
- { \r
- get { \r
- return 0;\r
- } \r
- }\r
-\r
- public String GetInArgName(int index) \r
- { \r
- return null; \r
- }\r
-\r
- public Object GetInArg(int argNum) \r
- { \r
- return null;\r
- }\r
-\r
- public Object[] InArgs \r
- { \r
- get { return null; }\r
- }\r
-\r
- public LogicalCallContext LogicalCallContext \r
- { \r
- get { return null; } \r
- }\r
+ public int InArgCount
+ {
+ get {
+ return 0;
+ }
+ }
+
+ public String GetInArgName(int index)
+ {
+ return null;
+ }
+
+ public Object GetInArg(int argNum)
+ {
+ return null;
+ }
+
+ public Object[] InArgs
+ {
+ get { return null; }
+ }
+
+ public LogicalCallContext LogicalCallContext
+ {
+ get { return null; }
+ }
}
}
return _inArgInfo.GetInOutArgName(index);
}
- class DictionaryWrapper : MethodCallDictionary\r
- {\r
- IDictionary _wrappedDictionary;\r
- static string[] _keys = new string[] {"__Args"};\r
-\r
- public DictionaryWrapper(IMethodMessage message, IDictionary wrappedDictionary) : base (message)\r
- {\r
- _wrappedDictionary = wrappedDictionary;\r
- MethodKeys = _keys;\r
- }\r
-
- protected override IDictionary AllocInternalProperties()\r
- {\r
- return _wrappedDictionary;\r
- }\r
+ class DictionaryWrapper : MethodCallDictionary
+ {
+ IDictionary _wrappedDictionary;
+ static string[] _keys = new string[] {"__Args"};
+
+ public DictionaryWrapper(IMethodMessage message, IDictionary wrappedDictionary) : base (message)
+ {
+ _wrappedDictionary = wrappedDictionary;
+ MethodKeys = _keys;
+ }
+
+ protected override IDictionary AllocInternalProperties()
+ {
+ return _wrappedDictionary;
+ }
protected override void SetMethodProperty (string key, object value)
{
get { return _args.Length; }
}
- public virtual object [] Args \r
+ public virtual object [] Args
{
get { return _args; }
set { _args = value; }
get { return ((IMethodReturnMessage)WrappedMessage).TypeName; }
}
- public string Uri \r
+ public string Uri
{
get { return ((IMethodReturnMessage)WrappedMessage).Uri; }
set { Properties["__Uri"] = value; }
return _outArgInfo.GetInOutArgName(index);
}
- class DictionaryWrapper : MethodReturnDictionary\r
- {\r
- IDictionary _wrappedDictionary;\r
- static string[] _keys = new string[] {"__Args", "__Return"};\r
-\r
- public DictionaryWrapper(IMethodReturnMessage message, IDictionary wrappedDictionary) : base (message)\r
- {\r
- _wrappedDictionary = wrappedDictionary;\r
- MethodKeys = _keys;\r
- }\r
-
- protected override IDictionary AllocInternalProperties()\r
- {\r
- return _wrappedDictionary;\r
- }\r
+ class DictionaryWrapper : MethodReturnDictionary
+ {
+ IDictionary _wrappedDictionary;
+ static string[] _keys = new string[] {"__Args", "__Return"};
+
+ public DictionaryWrapper(IMethodReturnMessage message, IDictionary wrappedDictionary) : base (message)
+ {
+ _wrappedDictionary = wrappedDictionary;
+ MethodKeys = _keys;
+ }
+
+ protected override IDictionary AllocInternalProperties()
+ {
+ return _wrappedDictionary;
+ }
protected override void SetMethodProperty (string key, object value)
{
[System.Runtime.InteropServices.ComVisible (true)]
public class RemotingSurrogateSelector : ISurrogateSelector
{
- static Type s_cachedTypeObjRef = typeof(ObjRef);\r
+ static Type s_cachedTypeObjRef = typeof(ObjRef);
static ObjRefSurrogate _objRefSurrogate = new ObjRefSurrogate();
static RemotingSurrogate _objRemotingSurrogate = new RemotingSurrogate();
- Object _rootObj = null; \r
+ Object _rootObj = null;
MessageSurrogateFilter _filter = null;
ISurrogateSelector _next;
--- /dev/null
+/TrackingServices.cs -crlf
--- /dev/null
+/EnvoyInfo.cs -crlf
--- /dev/null
+/binary_serialization_format.htm -crlf
--- /dev/null
+/IFieldInfo.cs -crlf
+/ISoapMessage.cs -crlf
+/ServerFault.cs -crlf
+/SoapFault.cs -crlf
+/SoapMessage.cs -crlf
{\r
string exceptionType;\r
string message;\r
- string stackTrace;
-
-#pragma warning disable 169
- // Used by some remoting magic
- Exception exception;
+ string stackTrace;\r
+ \r
+#pragma warning disable 169 \r
+ // Used by some remoting magic\r
+ Exception exception;\r
#pragma warning restore 169 \r
\r
public ServerFault (string exceptionType, string message,\r
--- /dev/null
+/AsymmetricKeyExchangeDeformatter.cs -crlf
+/AsymmetricKeyExchangeFormatter.cs -crlf
+/Base64Constants.cs -crlf
+/CspParameters.cs -crlf
+/DSAParameters.cs -crlf
+/DeriveBytes.cs -crlf
+/MD5.cs -crlf
+/RSAParameters.cs -crlf
+/Rijndael.cs -crlf
+/SHA1.cs -crlf
+/SHA256.cs -crlf
+/SHA384.cs -crlf
+/SHA512.cs -crlf
// Ek1(Ek2(m)) = m
internal static readonly byte[,] semiWeakKeys = {
- { 0x00, 0x1E, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x0E }, // map to packed key 011F011F010E010E\r
- { 0x00, 0xE0, 0x00, 0xE0, 0x00, 0xF0, 0x00, 0xF0 }, // map to packed key 01E001E001F101F1\r
- { 0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE }, // map to packed key 01FE01FE01FE01FE\r
- { 0x1E, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x0E, 0x00 }, // map to packed key 1F011F010E010E01\r
- { 0x1E, 0xE0, 0x1E, 0xE0, 0x0E, 0xF0, 0x0E, 0xF0 }, // map to packed key 1FE01FE00EF10EF1\r
- { 0x1E, 0xFE, 0x1E, 0xFE, 0x0E, 0xFE, 0x0E, 0xFE }, // map to packed key 1FFE1FFE0EFE0EFE\r
- { 0xE0, 0x00, 0xE0, 0x00, 0xF0, 0x00, 0xF0, 0x00 }, // map to packed key E001E001F101F101\r
- { 0xE0, 0x1E, 0xE0, 0x1E, 0xF0, 0x0E, 0xF0, 0x0E }, // map to packed key E01FE01FF10EF10E\r
- { 0xE0, 0xFE, 0xE0, 0xFE, 0xF0, 0xFE, 0xF0, 0xFE }, // map to packed key E0FEE0FEF1FEF1FE\r
- { 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00 }, // map to packed key FE01FE01FE01FE01\r
- { 0xFE, 0x1E, 0xFE, 0x1E, 0xFE, 0x0E, 0xFE, 0x0E }, // map to packed key FE1FFE1FFE0EFE0E\r
- { 0xFE, 0xE0, 0xFE, 0xE0, 0xFE, 0xF0, 0xFE, 0xF0 }, // map to packed key FEE0FEE0FEF1FEF1\r
- };\r
+ { 0x00, 0x1E, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x0E }, // map to packed key 011F011F010E010E
+ { 0x00, 0xE0, 0x00, 0xE0, 0x00, 0xF0, 0x00, 0xF0 }, // map to packed key 01E001E001F101F1
+ { 0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE }, // map to packed key 01FE01FE01FE01FE
+ { 0x1E, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x0E, 0x00 }, // map to packed key 1F011F010E010E01
+ { 0x1E, 0xE0, 0x1E, 0xE0, 0x0E, 0xF0, 0x0E, 0xF0 }, // map to packed key 1FE01FE00EF10EF1
+ { 0x1E, 0xFE, 0x1E, 0xFE, 0x0E, 0xFE, 0x0E, 0xFE }, // map to packed key 1FFE1FFE0EFE0EFE
+ { 0xE0, 0x00, 0xE0, 0x00, 0xF0, 0x00, 0xF0, 0x00 }, // map to packed key E001E001F101F101
+ { 0xE0, 0x1E, 0xE0, 0x1E, 0xF0, 0x0E, 0xF0, 0x0E }, // map to packed key E01FE01FF10EF10E
+ { 0xE0, 0xFE, 0xE0, 0xFE, 0xF0, 0xFE, 0xF0, 0xFE }, // map to packed key E0FEE0FEF1FEF1FE
+ { 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00 }, // map to packed key FE01FE01FE01FE01
+ { 0xFE, 0x1E, 0xFE, 0x1E, 0xFE, 0x0E, 0xFE, 0x0E }, // map to packed key FE1FFE1FFE0EFE0E
+ { 0xFE, 0xE0, 0xFE, 0xE0, 0xFE, 0xF0, 0xFE, 0xF0 }, // map to packed key FEE0FEE0FEF1FEF1
+ };
public static bool IsWeakKey (byte[] rgbKey)
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace System.Security.Cryptography {\r
+namespace System.Security.Cryptography {
internal static class SHAConstants {
// SHA-256 Constants
0x4cc5d4becb3e42b6L, 0x597f299cfc657e2aL, 0x5fcb6fab3ad6faecL, 0x6c44198c4a475817L
};
}
-}\r
+}
--- /dev/null
+/IUnrestrictedPermission.cs -crlf
//
using System.Runtime.InteropServices;
-\r
-namespace System.Security.Permissions {\r
+
+namespace System.Security.Permissions {
#if NET_2_1
[Obsolete ("CAS support is not available with Silverlight applications.")]
-#endif\r
+#endif
[ComVisible (true)]
[AttributeUsage(
AttributeTargets.Assembly
using System.Collections;
using System.Runtime.InteropServices;
using System.Text;
-\r
-namespace System.Security.Permissions {\r
-\r
+
+namespace System.Security.Permissions {
+
[ComVisible (true)]
[Serializable]
public sealed class EnvironmentPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
//
using System.Runtime.InteropServices;
-\r
-namespace System.Security.Permissions {\r
-\r
+
+namespace System.Security.Permissions {
+
[ComVisible (true)]
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
//
using System.Runtime.InteropServices;
-\r
-namespace System.Security.Permissions {\r
-\r
+
+namespace System.Security.Permissions {
+
[ComVisible (true)]
[Serializable]
public sealed class FileDialogPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
//
using System.Runtime.InteropServices;
-\r
-namespace System.Security.Permissions {\r
-\r
+
+namespace System.Security.Permissions {
+
[ComVisible (true)]
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
//
using System.Runtime.InteropServices;
-\r
-namespace System.Security.Permissions {\r
-\r
+
+namespace System.Security.Permissions {
+
[ComVisible (true)]
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
using System.Globalization;
using System.Runtime.InteropServices;
-\r
-namespace System.Security.Permissions {\r
-\r
+
+namespace System.Security.Permissions {
+
[ComVisible (true)]
[Serializable]
public sealed class GacIdentityPermission : CodeAccessPermission, IBuiltInPermission {
//
using System.Runtime.InteropServices;
-\r
-namespace System.Security.Permissions {\r
-\r
+
+namespace System.Security.Permissions {
+
[ComVisible (true)]
[AttributeUsage ( AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
//
using System.Runtime.InteropServices;
-\r
-namespace System.Security.Permissions {\r
-\r
+
+namespace System.Security.Permissions {
+
[ComVisible (true)]
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
AttributeTargets.Struct | AttributeTargets.Constructor |
--- /dev/null
+/ApplicationDirectoryMembershipCondition.cs -crlf
+/ApplicationMembershipCondition.cs -crlf
+/DomainApplicationMembershipCondition.cs -crlf
+/IIdentityPermissionFactory.cs -crlf
+/IMembershipCondition.cs -crlf
+/PermissionRequestEvidence.cs -crlf
+/PolicyStatement.cs -crlf
HasElevatedPermissions = !SecurityEnabled;
}
- // note: this let us differentiate between running in the browser (w/CoreCLR) and \r
- // running on the desktop (e.g. smcs compiling stuff)\r
+ // note: this let us differentiate between running in the browser (w/CoreCLR) and
+ // running on the desktop (e.g. smcs compiling stuff)
extern public static bool SecurityEnabled {
[MethodImplAttribute (MethodImplOptions.InternalCall)]
get;
public static void WorkerMethod (Func<bool> predicate, IProducerConsumerCollection<Task> sharedWorkQueue,
ThreadWorker[] others)
{
+ SpinWait wait = new SpinWait ();
+
while (!predicate ()) {
Task value;
}
// First check to see if we comply to predicate
- if (predicate ()) {
+ if (predicate ())
return;
- }
// Try to complete other work by stealing since our desired tasks may be in other worker
ThreadWorker other;
}
}
- if (predicate ()) {
+ if (predicate ())
return;
- }
}
+
+ wait.SpinOnce ();
}
}
namespace System.Threading
{
-
public struct SpinWait
{
// The number of step until SpinOnce yield on multicore machine
const int step = 5;
+ const int maxSpin = 10000;
static readonly bool isSingleCpu = (Environment.ProcessorCount == 1);
int ntime;
public void SpinOnce ()
{
- // On a single-CPU system, spinning does no good
- if (isSingleCpu) {
- Yield ();
+ if (ntime > 2 * maxSpin) {
+ Thread.Sleep (1);
+ } else if (isSingleCpu) {
+ // On a single-CPU system, spinning does no good
+ Thread.Yield ();
} else {
- if (Interlocked.Increment (ref ntime) % step == 0) {
- Yield ();
- } else {
+ if (++ntime % step == 0)
+ Thread.Yield ();
+ else
// Multi-CPU system might be hyper-threaded, let other thread run
- Thread.SpinWait (2 * (ntime + 1));
- }
+ Thread.SpinWait (Math.Min (ntime << 1, maxSpin));
}
}
return true;
}
- void Yield ()
- {
- // Replace sched_yield by Thread.Sleep(0) which does almost the same thing
- // (going back in kernel mode and yielding) but avoid the branching and unmanaged bridge
- Thread.Sleep (0);
- }
-
public void Reset ()
{
ntime = 0;
ResetAbort_internal ();
}
+#if NET_4_0 || BOOTSTRAP_NET_4_0
+ [HostProtectionAttribute (SecurityAction.LinkDemand, Synchronization = true, ExternalThreading = true)]
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public extern static bool Yield ();
+#endif
+
+
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static void Sleep_internal(int ms);
if (source == null)
return null;
+ if (value == null)
+ return source;
+
+ if (source.GetType () != value.GetType ())
+ throw new ArgumentException ("Delegate type mismatch");
+
return source.RemoveImpl (value);
}
key2.Close ();
}
}
+
+ [Test]
+ public void DeleteSubKey_Volatile ()
+ {
+ RegistryKey key = null;
+ RegistryKey subkey = null;
+ string subKeyName = "VolatileKey";
+
+ try {
+ key = Registry.CurrentUser.CreateSubKey (subKeyName, RegistryKeyPermissionCheck.Default, RegistryOptions.Volatile);
+ key.CreateSubKey ("VolatileKeyChild", RegistryKeyPermissionCheck.Default, RegistryOptions.Volatile);
+ key.SetValue ("Name", "Mono");
+ key.Close ();
+
+ Registry.CurrentUser.DeleteSubKeyTree (subKeyName);
+
+ key = Registry.CurrentUser.OpenSubKey (subKeyName);
+ Assert.AreEqual (null, key, "#A0");
+ } finally {
+ if (subkey != null)
+ subkey.Close ();
+ if (key != null)
+ key.Close ();
+ }
+ }
+
+ // Define a normal key, and create a normal and a volatile key under it, and retrieve their names.
+ [Test]
+ public void GetSubKeyNames_Volatile ()
+ {
+ RegistryKey key = null;
+ RegistryKey subkey = null;
+ string subKeyName = Guid.NewGuid ().ToString ();
+ string volChildKeyName = "volatilechildkey";
+ string childKeyName = "childkey";
+
+ try {
+ key = Registry.CurrentUser.CreateSubKey (subKeyName);
+ key.CreateSubKey (volChildKeyName, RegistryKeyPermissionCheck.Default, RegistryOptions.Volatile);
+ key.CreateSubKey (childKeyName, RegistryKeyPermissionCheck.Default, RegistryOptions.None);
+ key.Close ();
+
+ key = Registry.CurrentUser.OpenSubKey (subKeyName);
+ string [] keyNames = key.GetSubKeyNames ();
+
+ // we can guarantee the order of the child keys, so we sort the two of them
+ Array.Sort (keyNames);
+
+ Assert.AreEqual (2, keyNames.Length, "#A0");
+ Assert.AreEqual (childKeyName, keyNames [0], "#A1");
+ Assert.AreEqual (volChildKeyName, keyNames [1], "#A2");
+ } finally {
+ if (subkey != null)
+ subkey.Close ();
+ if (key != null)
+ key.Close ();
+ }
+
+ }
#endif
[Test]
--- /dev/null
+/HashtableTest.cs -crlf
isf.Close ();
}
-\r
- private ulong MaximumSize (SecurityZone zone)\r
- {\r
- IsolatedStorageScope scope = IsolatedStorageScope.User | IsolatedStorageScope.Assembly;\r
-\r
- Evidence ae = new Evidence ();\r
- ae.AddHost (new Zone (zone));\r
- IsolatedStorageFile isf = IsolatedStorageFile.GetStore (scope, null, null, ae, typeof (Zone));\r
- return isf.MaximumSize;\r
- }\r
-\r
- [Test]\r
- public void MaximumSize ()\r
- {\r
- Assert.AreEqual (Int64.MaxValue, MaximumSize (SecurityZone.MyComputer), "MyComputer");\r
+
+ private ulong MaximumSize (SecurityZone zone)
+ {
+ IsolatedStorageScope scope = IsolatedStorageScope.User | IsolatedStorageScope.Assembly;
+
+ Evidence ae = new Evidence ();
+ ae.AddHost (new Zone (zone));
+ IsolatedStorageFile isf = IsolatedStorageFile.GetStore (scope, null, null, ae, typeof (Zone));
+ return isf.MaximumSize;
+ }
+
+ [Test]
+ public void MaximumSize ()
+ {
+ Assert.AreEqual (Int64.MaxValue, MaximumSize (SecurityZone.MyComputer), "MyComputer");
Assert.AreEqual (Int64.MaxValue, MaximumSize (SecurityZone.Intranet), "Intranet");
#if NET_2_0
- Assert.AreEqual (512000, MaximumSize (SecurityZone.Internet), "Internet");\r
+ Assert.AreEqual (512000, MaximumSize (SecurityZone.Internet), "Internet");
Assert.AreEqual (512000, MaximumSize (SecurityZone.Trusted), "Trusted");
#else
- Assert.AreEqual (10240, MaximumSize (SecurityZone.Internet), "Internet");\r
+ Assert.AreEqual (10240, MaximumSize (SecurityZone.Internet), "Internet");
Assert.AreEqual (10240, MaximumSize (SecurityZone.Trusted), "Trusted");
-#endif\r
- }\r
-\r
- [Test]\r
- [ExpectedException (typeof (PolicyException))]\r
- public void MaximumSize_Untrusted ()\r
- {\r
- Assert.AreEqual (Int64.MaxValue, MaximumSize (SecurityZone.Untrusted), "Untrusted");\r
- }\r
-\r
- [Test]\r
- [ExpectedException (typeof (PolicyException))]\r
- public void MaximumSize_NoZone ()\r
- {\r
- Assert.AreEqual (Int64.MaxValue, MaximumSize (SecurityZone.NoZone), "NoZone");\r
- }\r
+#endif
+ }
+
+ [Test]
+ [ExpectedException (typeof (PolicyException))]
+ public void MaximumSize_Untrusted ()
+ {
+ Assert.AreEqual (Int64.MaxValue, MaximumSize (SecurityZone.Untrusted), "Untrusted");
+ }
+
+ [Test]
+ [ExpectedException (typeof (PolicyException))]
+ public void MaximumSize_NoZone ()
+ {
+ Assert.AreEqual (Int64.MaxValue, MaximumSize (SecurityZone.NoZone), "NoZone");
+ }
}
}
--- /dev/null
+/DirectoryTest.cs -crlf
+2010-07-29 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * MethodBuilderTest.cs: Add test for #626441.
+
2010-07-15 Miguel de Icaza <miguel@novell.com>
* FieldBuilderTest.cs: Add new test that exercises encoding
Assert.AreEqual (99, rt, "#1");
}
+ public static void VarargMethod (string headline, __arglist) {
+ ArgIterator ai = new ArgIterator (__arglist);
+
+ Console.Write (headline);
+ while (ai.GetRemainingCount () > 0)
+ Console.Write (TypedReference.ToObject (ai.GetNextArg ()));
+ Console.WriteLine ();
+ }
+
+ [Test]//bug #626441
+ public void CanCallVarargMethods ()
+ {
+ var tb = module.DefineType ("foo");
+ MethodBuilder mb = tb.DefineMethod ("CallVarargMethod",
+ MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard,
+ typeof (void), Type.EmptyTypes);
+
+ ILGenerator il = mb.GetILGenerator ();
+ MethodInfo miVarargMethod = typeof (MethodBuilderTest).GetMethod ("VarargMethod");
+
+ il.Emit (OpCodes.Ldstr, "Hello world from ");
+ il.Emit (OpCodes.Call, typeof(Assembly).GetMethod ("GetExecutingAssembly"));
+ il.EmitCall (OpCodes.Call, miVarargMethod, new Type[] { typeof(Assembly) });
+
+ il.Emit (OpCodes.Ldstr, "Current time: ");
+ il.Emit (OpCodes.Call, typeof(DateTime).GetMethod("get_Now"));
+ il.Emit (OpCodes.Ldstr, " (UTC ");
+ il.Emit (OpCodes.Call, typeof(DateTime).GetMethod("get_UtcNow"));
+ il.Emit (OpCodes.Ldstr, ")");
+ il.EmitCall (OpCodes.Call, miVarargMethod, new Type[] { typeof (DateTime), typeof (string), typeof (DateTime), typeof (string) });
+ il.Emit (OpCodes.Ret);
+
+ Type type = tb.CreateType ();
+ type.GetMethod ("CallVarargMethod").Invoke (null, null);
+ }
}
}
--- /dev/null
+/MutexTest.cs -crlf
Assert.IsFalse (Monitor.Wait (o, SmallNegative), "Wait");
}
}
+#if NET_4_0
+ [Test]
+ public void Enter_bool ()
+ {
+ object o = new object ();
+ bool taken = false;
+ Monitor.Enter (o, ref taken);
+ Assert.IsTrue (taken, "Monitor.Enter (obj, ref taken)");
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void Enter_bool_argcheck ()
+ {
+ object o = new object ();
+ bool taken = true;
+ Monitor.Enter (o, ref taken);
+ }
+
+#endif
+
}
}
--- /dev/null
+/DecimalTest2.cs -crlf
+/ExceptionTest.cs -crlf
+/MulticastDelegate.cs -crlf
delegate int WrongDelegate ();
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void RemoveDelegateTypeMismatch ()
+ {
+ Delegate boxer = new Boxer (() => new object ());
+ Delegate.Remove (boxer, new WrongDelegate (() => 42));
+ }
+
[Test]
[ExpectedException (typeof (ArgumentException))]
public void WrongReturnTypeContravariance ()
--- /dev/null
+/AFile.txt -crlf
--- /dev/null
+/BindingRestrictions.cs -crlf
+/ExpandoObject.cs -crlf
--- /dev/null
+/Expression.cs -crlf
+/ListInitExpression.cs -crlf
--- /dev/null
+/LambdaCompiler.Lambda.cs -crlf
--- /dev/null
+/ExtensionAssemblyInfo.cs -crlf
--- /dev/null
+/CS0122-19-lib.cs -crlf
+/cs0019-21.cs -crlf
+/cs0019-22.cs -crlf
+/cs0019-23.cs -crlf
+/cs0029-11.cs -crlf
+/cs0029-2.cs -crlf
+/cs0035.cs -crlf
+/cs0037-6.cs -crlf
+/cs0103-4.cs -crlf
+/cs0117-6.cs -crlf
+/cs0121-10.cs -crlf
+/cs0121-9.cs -crlf
+/cs0144-3.cs -crlf
+/cs0154-3.cs -crlf
+/cs0173-4.cs -crlf
+/cs0221-10.cs -crlf
+/cs0221-5.cs -crlf
+/cs0221-6.cs -crlf
+/cs0221-7.cs -crlf
+/cs0221-8.cs -crlf
+/cs0221-9.cs -crlf
+/cs0236-2.cs -crlf
+/cs0266-9.cs -crlf
+/cs0466.cs -crlf
+/cs0469.cs -crlf
+/cs0553-2.cs -crlf
+/cs0596-2.cs -crlf
+/cs0596.cs -crlf
+/cs0619-47.cs -crlf
+/cs0619-48.cs -crlf
+/cs0619-49.cs -crlf
+/cs0619-50.cs -crlf
+/cs0619-51.cs -crlf
+/cs0664-3.cs -crlf
+/cs1059-2.cs -crlf
+/cs1503.cs -crlf
+/cs1547-3.cs -crlf
+/cs1547-5.cs -crlf
+/cs1547-6.cs -crlf
+/cs1547-7.cs -crlf
+/cs1706-2.cs -crlf
+/cs1729-12.cs -crlf
+/cs3003-6.cs -crlf
+/gcs0019-4.cs -crlf
+/gcs0019-5.cs -crlf
+/gcs0019-6.cs -crlf
+/gcs0029-3.cs -crlf
+/gcs0266.cs -crlf
+/gcs0453-4.cs -crlf
+/gcs1644-15.cs -crlf
+/gcs1644-16.cs -crlf
+/gcs1960-2.cs -crlf
+/gcs1960.cs -crlf
+/gcs1961-10.cs -crlf
+/gcs1961-11.cs -crlf
+/gcs1961-12.cs -crlf
+/gcs1961-15.cs -crlf
+/gcs1961-16.cs -crlf
+/gcs1961-17.cs -crlf
+/gcs1961-2.cs -crlf
+/gcs1961-24.cs -crlf
+/gcs1961-25.cs -crlf
+/gcs1961-26.cs -crlf
+/gcs1961-27.cs -crlf
+/gcs1961-30.cs -crlf
+/gcs1961-31.cs -crlf
+/gcs1961-32.cs -crlf
+/gcs1961-33.cs -crlf
+/gcs1961-34.cs -crlf
+/gcs1961-35.cs -crlf
+/gcs1961-36.cs -crlf
+/gcs1961-37.cs -crlf
+/gcs1961-9.cs -crlf
+/gcs1961.cs -crlf
+/cs0122-32.cs -crlf
+/cs0143.cs -crlf
+/cs1540-12.cs -crlf
+/cs1739-3.cs -crlf
+/cs1746.cs -crlf
+/gcs0307-5.cs -crlf
+/gcs1579.cs -crlf
--- /dev/null
+.assembly extern mscorlib { }
+
+.assembly 'CS0143-lib' { }
+
+.class public auto ansi beforefieldinit A
+ extends [mscorlib]System.Object
+{
+}
\ No newline at end of file
$(wildcard known-issues-*)
TEST_SUPPORT_FILES = \
- CS0103-2-lib.dll CS0118-2-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0144-3-lib.dll \
+ CS0103-2-lib.dll CS0118-2-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0143-lib.dll CS0144-3-lib.dll \
CS0205-3-lib.dll \
CS0229-3-lib.dll CS0229-4-lib.dll \
CS0433-lib.dll CS0433-2-lib.dll \
-// CS0019: Operator `+' cannot be applied to operands of type `AA' and `uint'
+// CS0019: Operator `+' cannot be applied to operands of type `AA' and `uint'\r
// Line: 11\r
\r
enum AA : byte { a, b = 200 }\r
const uint ul = 1;\r
AA b = AA.a + ul;\r
}\r
-}
+}\r
-// CS0019: Operator `-' cannot be applied to operands of type `AA' and `long'
+// CS0019: Operator `-' cannot be applied to operands of type `AA' and `long'\r
// Line: 11\r
\r
enum AA : short { a, b = 200 }\r
const long ul = 1;\r
AA b = AA.a - ul;\r
}\r
-}
+}\r
--- /dev/null
+// CS0023: The `.' operator cannot be applied to operand of type `method group'
+// Line: 14
+
+using System;
+
+public class Test
+{
+ public static void E ()
+ {
+ }
+
+ public static void Main ()
+ {
+ Console.WriteLine(E.x);
+ }
+}
--- /dev/null
+// CS0023: The `.' operator cannot be applied to operand of type `method group'
+// Line: 20
+
+using System;
+
+enum Enum
+{
+ Test
+}
+
+class A : Attribute
+{
+ public A (object e)
+ {
+ }
+}
+
+class C
+{
+ [A (Enum.Test)]
+ int Enum ()
+ {
+ return 0;
+ }
+}
--- /dev/null
+// CS0023: The `.' operator cannot be applied to operand of type `method group'
+// Line: 9
+
+public class App {
+
+ public static void Main() {}
+
+ SomeEnum SomeEnum() {
+ return SomeEnum.First;
+ }
+
+}
+
+enum SomeEnum { First, Second };
class T {
public static bool Main ()
- {\r
+ {
return false;
}
}
A a = new A ();\r
float f = -a; \r
}\r
-}
+}\r
-// cs0037.cs: Cannot convert null to `bool' because it is a value type
+// cs0037.cs: Cannot convert null to `bool' because it is a value type\r
// Line: 13\r
-
+\r
using System;\r
\r
public sealed class BoundAttribute : System.Attribute\r
-// CS0117: `string' does not contain a definition for `Parse'
-// Line: 10
+// CS0117: `string' does not contain a definition for `Parse'\r
+// Line: 10\r
\r
using System;\r
\r
+++ /dev/null
-// cs0119-2.cs: Expression denotes a `method group', where a `variable', `value' or `type' was expected
-// Line: 9
-
-public class App {
-
- public static void Main() {}
-
- SomeEnum SomeEnum() {
- return SomeEnum.First;
- }
-
-}
-
-enum SomeEnum { First, Second };
+++ /dev/null
-// CS0119: Expression denotes a `method group', where a `variable', `value' or `type' was expected
-// Line: 20
-
-using System;
-
-enum Enum
-{
- Test
-}
-
-class A : Attribute
-{
- public A (object e)
- {
- }
-}
-
-class C
-{
- [A (Enum.Test)]
- int Enum ()
- {
- return 0;
- }
-}
+++ /dev/null
-// cs0119.cs: Expression denotes a `method group', where a `variable', `value' or `type' was expected
-// Line: 14
-
-using System;
-
-public class Test
-{
- public static void E ()
- {
- }
-
- public static void Main ()
- {
- Console.WriteLine(E.x);
- }
-}
--- /dev/null
+// CS0122: `Data.Count' is inaccessible due to its protection level
+// Line: 13
+
+class Data
+{
+ int Count;
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new Data { Count = 10 };
+ }
+}
--- /dev/null
+// CS0122: `A.Foo()' is inaccessible due to its protection level\r
+// Line: 23\r
+\r
+class A\r
+{\r
+ public void Foo (int i)\r
+ {\r
+ }\r
+\r
+ private void Foo ()\r
+ {\r
+ }\r
+}\r
+\r
+class B : A\r
+{\r
+ public static void Main ()\r
+ {\r
+ }\r
+\r
+ void Test ()\r
+ {\r
+ Foo ();\r
+ }\r
+}
\ No newline at end of file
// cs0132.-2cs: `X.X(int)': The static constructor must be parameterless
// Line: 5
-class X {\r
+class X {
static int ii = 55;
static X (int x)
{
--- /dev/null
+// CS0133: The expression being assigned to `c' must be constant\r
+// Line: 10\r
+\r
+class C\r
+{\r
+ void Foo ()\r
+ {\r
+ int[] array;\r
+ int idx;\r
+ const int c = array [idx];\r
+ }\r
+}\r
--- /dev/null
+// CS0143: The class `A' has no constructors defined\r
+// Line: 9\r
+// Compiler options: -r:CS0143-lib.dll\r
+\r
+public class Test\r
+{\r
+ public static void Main ()\r
+ {\r
+ new A ();\r
+ }\r
+}\r
-// CS0154: The property or indexer `Test.this[bool]' cannot be used in this context because it lacks a `get' accessor\r
+// CS0154: The property or indexer `Test.this[bool]' cannot be used in this context because it lacks the `get' accessor\r
// Line: 13\r
\r
class Test\r
-// CS0154: The property or indexer `A.this[int]' cannot be used in this context because it lacks a `get' accessor
+// CS0154: The property or indexer `A.this[int]' cannot be used in this context because it lacks the `get' accessor
// Line: 18
public class A
using System;
-class C {\r
- bool T () { return true; }\r
+class C {
+ bool T () { return true; }
void Close()
{
-// CS0200: The read only property or indexer `X.this[int]' cannot be assigned to
-// Line: 12
+// CS0200: Property or indexer `X.this[int]' cannot be assigned to (it is read-only)
+// Line: 14
class X {
int this[int i] {
-// cs0200.cs: Property or indexer `X.P' cannot be assigned to (it is read only)
-// Line: 12
+// CS0200: Property or indexer `X.P' cannot be assigned to (it is read-only)
+// Line: 13
+
class X {
static int P {
get {
-// cs0205-2.cs: Cannot call an abstract base member `A.Foobar'
-// Line: 15
+// CS0205: Cannot call an abstract base member `A.Foobar.get'
+// Line: 22
using System;
public class B: A
{
- public override int Foobar {
+ public override int Foobar {
get {
- return base.Foobar;
+ return base.Foobar;
}
- }
+ }
- static void Main ()
- {
- B b = new B ();
- if (b.Foobar == 1)
- ;
- }
+ static void Main ()
+ {
+ B b = new B ();
+ if (b.Foobar == 1) {
+ }
+ }
}
-// cs0205-3.cs: Cannot call an abstract base member `A.Foobar'
-// Line: 15
+// CS0205: Cannot call an abstract base member `A.Foobar.get'
+// Line: 18
// Compiler options: -r:CS0205-3-lib.dll
using System;
public class B: A1
{
- protected override int Foobar {
+ protected override int Foobar {
get {
- return base.Foobar;
+ return base.Foobar;
}
- }
+ }
- static void Main ()
- {
- B b = new B ();
- if (b.Foobar == 1)
- ;
- }
+ static void Main ()
+ {
+ B b = new B ();
+ if (b.Foobar == 1) {
+ }
+ }
}
-// CS0205: Cannot call an abstract base member `A.this[int]'
+// CS0205: Cannot call an abstract base member `A.this[int].set'
// Line: 13
public abstract class A
}
}
}
-
-// cs0205.cs: Cannot call an abstract base member `A.Foobar()'
-// Line: 20
+// CS0205: Cannot call an abstract base member `A.Foobar()'
+// Line: 21
+
using System;
public abstract class A
-// CS0229: Ambiguity between `TestLib.FOO' and `TestLib.FOO()'
+// CS0229: Ambiguity between `TestLib.FOO()' and `TestLib.FOO'
// Line: 9
// Compiler options: -r:CS0229-4-lib.dll
class X {\r
const E1 e = ~E2.A;\r
}\r
-
+\r
+++ /dev/null
-// CS0271: The property or indexer `C.this[string]' cannot be used in this context because a `set' accessor is inaccessible
-// Line: 13
-
-class C
-{
- public int this [string i] { private set { } get { return 1; } }
-}
-
-public class Test
-{
- void Foo ()
- { C c = new C ();
- c [""] = 9;
- }
-}
--- /dev/null
+// CS0272: The property or indexer `C.this[string]' cannot be used in this context because the set accessor is inaccessible
+// Line: 13
+
+class C
+{
+ public int this [string i] { private set { } get { return 1; } }
+}
+
+public class Test
+{
+ void Foo ()
+ { C c = new C ();
+ c [""] = 9;
+ }
+}
// cs0466.cs: `Base.I.M(params int[])': the explicit interface implementation cannot introduce the params modifier\r
-// Line: 10
+// Line: 10\r
\r
interface I\r
{\r
--- /dev/null
+// CS0467: Ambiguity between method `IMethod.Count()' and invocable non-method `IList.Count'. Using method group
+// Line: 27
+// Compiler options: -warn:2 -warnaserror
+
+using System;
+
+delegate void D (int i);
+
+interface IList
+{
+ D Count { get; }
+}
+
+interface IMethod
+{
+ int Count ();
+}
+
+interface IListCounter: IList, IMethod
+{
+}
+
+class Test
+{
+ static void Foo (IListCounter t)
+ {
+ t.Count ();
+ }
+}
-// cs0469.cs: The `goto case' value is not implicitly convertible to type `char'
-// Line: 16
+// cs0469.cs: The `goto case' value is not implicitly convertible to type `char'\r
+// Line: 16\r
// Compiler options: -warnaserror -warn:2\r
\r
class Test\r
return null;\r
}\r
}\r
-}
+}\r
-// cs0619-50.cs: `A.B' is obsolete: `yes'
+// cs0619-50.cs: `A.B' is obsolete: `yes'\r
// Line: 12\r
-
+\r
using Z = A.B;\r
\r
class A\r
-// cs0619-51.cs: `A.comparer' is obsolete: `Please use ...'
+// cs0619-51.cs: `A.comparer' is obsolete: `Please use ...'\r
// Line: 16\r
// Compiler options: -reference:CS0619-51-lib.dll\r
\r
-// cs0647.cs: Error during emitting `System.Runtime.InteropServices.GuidAttribute' attribute. The reason is `Invalid format for Guid.Guid(string).'
-// Line: 5
+// CS0647: Error during emitting `System.Runtime.InteropServices.GuidAttribute' attribute. The reason is `Invalid Guid format: aaa'
+// Line: 6
+
using System.Runtime.InteropServices;
[Guid ("aaa")]
-
class X {
static void Main () {}
}
+++ /dev/null
-// cs0654: Method `Test.foo()' is referenced without parentheses
-// Line: 9
-// Compiler options: -langversion:ISO-1
-
-class Test {
- static int foo () { return 0; }
- static void Main ()
- {
- int i = foo;
- }
-}
// cs0664-3.cs: Literal of type double cannot be implicitly converted to type `float'. Add suffix `f' to create a literal of this type\r
// Line: 13\r
-
+\r
using System;\r
\r
public sealed class BoundAttribute : System.Attribute\r
-// CS0815: An implicitly typed local variable declaration cannot be initialized with `lambda expression'
-// Line: 9
-
+// CS0815: An implicitly typed local variable declaration cannot be initialized with `anonymous method'
+// Line: 8
public class Test
{
-// CS0815: An implicitly typed local variable declaration cannot be initialized with `Tests.Main()'
+// CS0815: An implicitly typed local variable declaration cannot be initialized with `method group'
// Line: 8
public class Tests
void Main () {\r
Console.WriteLine (++0);\r
}\r
-}
+}\r
{\r
A.Foo (1);\r
}\r
-}
+}\r
+++ /dev/null
-// CS1533: Invoke cannot be called directly on a delegate
-// Line : 11
-// Compiler options: -langversion:ISO-1
-
-public class TestClass
-{
- delegate void OneDelegate (int i);
-
- static void Main()
- {
- OneDelegate d = new OneDelegate (TestMethod);
- d.Invoke (1);
- }
- public static void TestMethod (int i)
- {
- }
-}
--- /dev/null
+// CS1540: Cannot access protected member `A.Test.get' via a qualifier of type `B'. The qualifier must be of type `C' or derived from it\r
+// Line: 17\r
+\r
+class A\r
+{\r
+ public object[] Test {\r
+ set { }\r
+ protected get { return null; }\r
+ }\r
+}\r
+\r
+class B : A\r
+{\r
+}\r
+\r
+class C : A\r
+{\r
+ public void Test2 (B b)\r
+ {\r
+ foreach (object o in b.Test) {\r
+ }\r
+ }\r
+}\r
--- /dev/null
+// CS1540: Cannot access protected member `A.del' via a qualifier of type `A'. The qualifier must be of type `B' or derived from it
+// Line: 16
+
+delegate int D ();
+
+class A
+{
+ protected D del;
+}
+
+class B : A
+{
+ public static void Main ()
+ {
+ A b = new A ();
+ var v = b.del ();
+ }
+}
-// cs1579-2.cs: foreach statement cannot operate on variables of type `Foo' because it does not contain a definition for `GetEnumerator' or is not accessible
+// Cs1579: foreach statement cannot operate on variables of type `Foo' because it does not contain a definition for `GetEnumerator' or is inaccessible
// Line: 12
using System;
{
return new ArrayList ().GetEnumerator ();
}
-}
\ No newline at end of file
+}
-// CS1579: foreach statement cannot operate on variables of type `C' because it does not contain a definition for `GetEnumerator' or is not accessible
+// CS1579: foreach statement cannot operate on variables of type `C' because it does not contain a definition for `GetEnumerator' or is inaccessible
// Line: 37
using System;
-// cs1579.cs: foreach statement cannot operate on variables of type `X' because it does not contain a definition for `GetEnumerator' or is not accessible
-// Line: 10
+// CS1579: foreach statement cannot operate on variables of type `X' because it does not contain a definition for `GetEnumerator' or is inaccessible
+// Line: 11
+
class X {
}
-// CS1706: Anonymous methods and lambda expressions cannot be used in the current context
+// CS1706: Anonymous methods and lambda expressions cannot be used in the current context\r
// Line: 14\r
\r
public delegate void Proc();\r
public void Foo()\r
{\r
}\r
-}
+} \r
class A
{
public A ()
- {\r
+ {
int a = a = 5;
}
}
\ No newline at end of file
{\r
A a = new A.Foo ("test"); \r
}\r
-}
+}\r
-// CS1739: The best overloaded method match for `A.this[int].set' does not contain a parameter named `value'
+// CS1739: The best overloaded method match for `A.this[int]' does not contain a parameter named `value'
// Line: 17
class A
--- /dev/null
+// CS1739: The best overloaded method match for `System.Delegate.DynamicInvoke(params object[])' does not contain a parameter named `b'\r
+// Line: 18\r
+\r
+using System;\r
+\r
+class C\r
+{\r
+ delegate int IntDelegate (int a);\r
+ \r
+ static int TestInt (int u)\r
+ {\r
+ return 29;\r
+ }\r
+ \r
+ public static void Main ()\r
+ {\r
+ var del = new IntDelegate (TestInt);\r
+ del.DynamicInvoke (b : 7);\r
+ }\r
+}\r
// CS1739: The best overloaded method match for `C.Foo(int, int)' does not contain a parameter named `b'
// Line: 12
-// Compiler options: -langversion:future
class C
{
-// CS1746: The delegate `C.IntDelegate' does not contain a parameter named `b'
-// Line: 18
-// Compiler options: -langversion:future
-
-using System;
-
-class C
-{
- delegate int IntDelegate (int a);
-
- static int TestInt (int u)
- {
- return 29;
- }
-
- public static void Main ()
- {
- var del = new IntDelegate (TestInt);
- del (b : 7);
- }
-}
+// CS1746: The delegate `C.IntDelegate' does not contain a parameter named `b'\r
+// Line: 18\r
+\r
+using System;\r
+\r
+class C\r
+{\r
+ delegate int IntDelegate (int a);\r
+ \r
+ static int TestInt (int u)\r
+ {\r
+ return 29;\r
+ }\r
+ \r
+ public static void Main ()\r
+ {\r
+ var del = new IntDelegate (TestInt);\r
+ del (b : 7);\r
+ }\r
+}\r
// CS3003: Type of `I.Foo' is not CLS-compliant\r
-// Line: 10
-// Compiler options: -warnaserror -warn:1
+// Line: 10\r
+// Compiler options: -warnaserror -warn:1\r
\r
using System;\r
[assembly:CLSCompliant (true)]\r
-// CS0019: Operator `+=' cannot be applied to operands of type `EventHandler' and `T'
+// CS0019: Operator `+=' cannot be applied to operands of type `EventHandler' and `T'\r
// Line: 10\r
\r
using System;\r
--- /dev/null
+// CS0117: `A' does not contain a definition for `Method'
+// Line: 8
+
+public class E : A
+{
+ void Test ()
+ {
+ base.Method ();
+ }
+}
+
+static class S
+{
+ public static void Method (this A a)
+ {
+ }
+}
+
+public class A
+{
+}
\ No newline at end of file
-// CS0200: Property or indexer `A.Counter' cannot be assigned to (it is read only)
+// CS0200: Property or indexer `A.Counter' cannot be assigned to (it is read-only)
// Line: 9
class Program
-// CS0266: Cannot implicitly convert type `I' to `C'. An explicit conversion exists (are you missing a cast?)
-// Line: 16
+// CS0266: Cannot implicitly convert type `I' to `C'. An explicit conversion exists (are you missing a cast?)\r
+// Line: 16\r
\r
interface I\r
{\r
--- /dev/null
+// CS0305: Using the generic method `X.G<T>()' requires `1' type argument(s)
+// Line: 17
+
+using System;
+
+delegate int E ();
+
+class X
+{
+ public static T G<T> ()
+ {
+ throw new ArgumentException ();
+ }
+
+ static void Main ()
+ {
+ E e2 = new E (G);
+ }
+}
--- /dev/null
+// CS0307: The property `Test<T,U>.Value' cannot be used with type arguments\r
+// Line: 16\r
+\r
+class Test<T, U>\r
+{\r
+ public object Value {\r
+ get { return null; }\r
+ }\r
+\r
+ public class B\r
+ {\r
+ public B (object arg)\r
+ {\r
+ }\r
+ \r
+ public static B Default = new B (Value<U>.Default);\r
+ }\r
+}\r
--- /dev/null
+// CS0307: The variable `a' cannot be used with type arguments
+// Line: 9
+
+public class Tests
+{
+ public static void Test<a> ()
+ {
+ a<int> ();
+ }
+}
+++ /dev/null
-// CS0411: The type arguments for method `X.G<T>()' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 17
-
-using System;
-
-delegate int E ();
-
-class X
-{
- public static T G<T> ()
- {
- throw new ArgumentException ();
- }
-
- static void Main ()
- {
- E e2 = new E (G);
- }
-}
--- /dev/null
+// CS1113: Extension method `Extension.Foo(this S)' of value type `S' cannot be used to create delegates
+// Line: 11
+
+delegate void D ();
+
+public class C
+{
+ static void Main ()
+ {
+ S s = new S ();
+ D d = s.Foo;
+ }
+}
+
+public struct S
+{
+ public void Foo (int i)
+ {
+ }
+}
+
+public static class Extension
+{
+ public static void Foo (this S s) { }
+}
--- /dev/null
+// CS1579: foreach statement cannot operate on variables of type `Foo' because it does not contain a definition for `GetEnumerator' or is inaccessible\r
+// Line: 12\r
+\r
+using System;\r
+using System.Collections;\r
+\r
+public class Test\r
+{\r
+ public static void Main ()\r
+ {\r
+ Foo f = new Foo ();\r
+ foreach (object o in f)\r
+ Console.WriteLine (o);\r
+ }\r
+}\r
+\r
+public class Foo\r
+{\r
+ public Func<IEnumerator> GetEnumerator;\r
+}\r
-// CS1928: Type `Test.mFoo' does not contain a member `Frobnicate' and the best extension method overload `Extensions.Frobnicate<Test>(this Test)' has some invalid arguments
+// CS1928: Type `System.Collections.IList' does not contain a member `Frobnicate' and the best extension method overload `Extensions.Frobnicate<Test>(this Test)' has some invalid arguments
// Line: 20
using System;
-// CS1961: The contravariant type parameter `T' must be covariantly valid on `B<T>.A'\r
-// Line: 9\r
+// CS1961: The contravariant type parameter `T' must be covariantly valid on `B<T>.A'
+// Line: 9
// Compiler options: -langversion:future
interface A<out T>
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'\r
-// Line: 9\r
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.A'\r
-// Line: 9\r
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.A'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.A'\r
-// Line: 9\r
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.A'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C()'\r
-// Line: 9\r
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C()'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C()'\r
-// Line: 9\r
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C()'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'\r
-// Line: 9\r
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1923: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<A<T>>)'\r
-// Line: 9\r
+// CS1923: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<A<T>>)'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1961: The covariant type parameter `T' must be contravariantly valid on `B<T>.A'\r
-// Line: 9\r
+// CS1961: The covariant type parameter `T' must be contravariantly valid on `B<T>.A'
+// Line: 9
// Compiler options: -langversion:future
interface A<in T>
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'\r
-// Line: 9\r
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.A'\r
-// Line: 9\r
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.A'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.A'
-// Line: 9\r
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C()'\r
-// Line: 9\r
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C()'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C()'\r
-// Line: 9\r
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C()'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'\r
-// Line: 9\r
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<A<T>>)'\r
-// Line: 9\r
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<A<T>>)'
+// Line: 9
// Compiler options: -langversion:future
interface A<T>
cs0457-2.cs
cs0457.cs
-cs1540-6.cs
-cs1540-9.cs
+cs1540-6.cs NO ERROR Is it real error
--- /dev/null
+/Main.cs -crlf
--- /dev/null
+/Class.cs -crlf
+/CodeGen.cs -crlf
+/Method.cs -crlf
+/Types.cs -crlf
--- /dev/null
+/abs_method4.il -crlf
+/abs_method9.il -crlf
+/err-cattr.il -crlf
+/err-gen-cattr-1.il -crlf
+/err-gen-cattr-2.il -crlf
+/err-gen-cattr-3.il -crlf
+/err-gen-cattr-4.il -crlf
+/err-global.il -crlf
+/err-global2.il -crlf
--- /dev/null
+/ILParser.jay -crlf
+/ScannerAdapter.cs -crlf
--- /dev/null
+/ILReader.cs -crlf
+/ILSyntaxError.cs -crlf
+/ILTables.cs -crlf
+/ILToken.cs -crlf
+/ILTokenizer.cs -crlf
+/ITokenStream.cs -crlf
+/InstrToken.cs -crlf
+/Location.cs -crlf
+/NumberHelper.cs -crlf
+/StringHelper.cs -crlf
+/StringHelperBase.cs -crlf
--- /dev/null
+/abs_method1.il -crlf
+/abs_method10.il -crlf
+/abs_method2.il -crlf
+/abs_method3.il -crlf
+/abs_method5.il -crlf
+/abs_method6.il -crlf
+/abs_method7.il -crlf
+/abs_method8.il -crlf
+/dotted-names.il -crlf
+/gen-1.il -crlf
+/gen-extern-type.il -crlf
+/global.il -crlf
+/test-33.il -crlf
+/test-34.il -crlf
+/test-bounded-array.il -crlf
+/test-cattr-1.il -crlf
+/test-field-init.il -crlf
+/test-perm_pass-2.il -crlf
+/test-perm_pass-3.il -crlf
--- /dev/null
+/gmcs.exe.config -crlf
+2010-07-28 Marek Safar <marek.safar@gmail.com>
+
+ * anonymous.cs, assign.cs, attribute.cs, decl.cs, delegate.cs,
+ doc.cs, dynamic.cs, ecore.cs, expression.cs, generic.cs, import.cs,
+ iterators.cs, linq.cs, membercache.cs, method.cs, report.cs,
+ statement.cs, typemanager.cs: Major name lookup fixes to deal with
+ C# 3.0 invocable members, correctly handle accessibility hidding and
+ property-like different get/set base accessors.
+
+ Also fixes bugs #624870, #618522, #616068, #444180, #333891
+
2010-07-14 Marek Safar <marek.safar@gmail.com>
* namespace.cs, import.cs: When importing nested type via type
var hoisted_tparams = generic.CurrentTypeParameters;
type_params = new TypeParameter [hoisted_tparams.Length];
for (int i = 0; i < type_params.Length; ++i) {
- type_params[i] = hoisted_tparams[i].CreateHoistedCopy (spec);
+ type_params[i] = hoisted_tparams[i].CreateHoistedCopy (this, spec);
}
}
}
for (int i = 0; i < delegate_parameters.Count; i++) {
Parameter.Modifier i_mod = delegate_parameters.FixedParameters [i].ModFlags;
if (i_mod == Parameter.Modifier.OUT) {
- ec.Report.Error (1688, loc, "Cannot convert anonymous " +
- "method block without a parameter list " +
- "to delegate type `{0}' because it has " +
- "one or more `out' parameters.",
- TypeManager.CSharpName (delegate_type));
+ if (!ec.IsInProbingMode) {
+ ec.Report.Error (1688, loc,
+ "Cannot convert anonymous method block without a parameter list to delegate type `{0}' because it has one or more `out' parameters",
+ delegate_type.GetSignatureForError ());
+ }
+
return null;
}
fixedpars[i] = new Parameter (
var hoisted_tparams = ec.CurrentTypeParameters;
var type_params = new TypeParameter[hoisted_tparams.Length];
for (int i = 0; i < type_params.Length; ++i) {
- type_params[i] = hoisted_tparams[i].CreateHoistedCopy (null);
+ type_params[i] = hoisted_tparams[i].CreateHoistedCopy (null, null);
}
generic_method = new GenericMethod (parent.NamespaceEntry, parent, member_name, type_params,
if (Expr == EmptyExpression.Null)
return;
- using (ec.With (ResolveContext.Options.DoFlowAnalysis, true)) {
+// using (ec.With (ResolveContext.Options.DoFlowAnalysis, true)) {
// Verify that the argument is readable
if (ArgType != AType.Out)
Expr = Expr.Resolve (ec);
if (Expr == null)
Expr = EmptyExpression.Null;
- }
+// }
}
public virtual void Emit (EmitContext ec)
return null;
}
- if ((RootContext.Version == LanguageVersion.ISO_1) && (source is MethodGroupExpr)){
- ((MethodGroupExpr) source).ReportUsageError (ec);
- return null;
- }
-
if (!TypeManager.IsEqual (target_type, source_type)) {
Expression resolved = ResolveConversions (ec);
if (tassign == null)
throw new InternalErrorException (target.GetType () + " does not support dynamic assignment");
- var target_object = tassign.MakeAssignExpression (ctx);
+ var target_object = tassign.MakeAssignExpression (ctx, source);
//
// Some hacking is needed as DLR does not support void type and requires
}
}
- class EventAddOrRemove : ExpressionStatement {
- EventExpr target;
- Binary.Operator op;
- Expression source;
-
- public EventAddOrRemove (Expression target, Binary.Operator op, Expression source, Location loc)
- {
- this.target = target as EventExpr;
- this.op = op;
- this.source = source;
- this.loc = loc;
- }
-
- public override Expression CreateExpressionTree (ResolveContext ec)
- {
- return new SimpleAssign (target, source).CreateExpressionTree (ec);
- }
-
- protected override Expression DoResolve (ResolveContext ec)
- {
- if (op != Binary.Operator.Addition && op != Binary.Operator.Subtraction)
- target.Error_AssignmentEventOnly (ec);
-
- source = source.Resolve (ec);
- if (source == null)
- return null;
-
- source = Convert.ImplicitConversionRequired (ec, source, target.Type, loc);
- if (source == null)
- return null;
-
- eclass = ExprClass.Value;
- type = TypeManager.void_type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- if (RootContext.EvalMode)
- EmitStatement (ec);
- else
- throw new InternalErrorException ("don't know what to emit");
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- target.EmitAddOrRemove (ec, op == Binary.Operator.Addition, source);
- }
- }
-
//
// This class is used for compound assignments.
//
return null;
}
- if (target is EventExpr)
- return new EventAddOrRemove (target, op, right, loc).Resolve (ec);
+ var event_expr = target as EventExpr;
+ if (event_expr != null) {
+ source = Convert.ImplicitConversionRequired (ec, right, target.Type, loc);
+ if (source == null)
+ return null;
+
+ Expression rside;
+ if (op == Binary.Operator.Addition)
+ rside = EmptyExpression.EventAddition;
+ else if (op == Binary.Operator.Subtraction)
+ rside = EmptyExpression.EventSubtraction;
+ else
+ rside = null;
+
+ target = target.ResolveLValue (ec, rside);
+ if (target == null)
+ return null;
+
+ eclass = ExprClass.Value;
+ type = event_expr.Operator.ReturnType;
+ return this;
+ }
//
// Only now we can decouple the original source/target
}
}
- MethodGroupExpr mg = MemberLookupFinal (ec, ec.CurrentType,
- Type, ConstructorInfo.ConstructorName, 0, MemberKind.Constructor,
- BindingRestriction.AccessibleOnly | BindingRestriction.DeclaredOnly,
- Location) as MethodGroupExpr;
-
- if (mg == null)
- throw new NotImplementedException ();
-
- mg = mg.OverloadResolve (ec, ref PosArguments, false, Location);
- if (mg == null)
- return null;
-
- return mg.BestCandidate;
+ return ConstructorLookup (ec, Type, ref PosArguments, loc);
}
protected virtual bool ResolveNamedArguments (ResolveContext ec)
a.Resolve (ec);
- Expression member = Expression.MemberLookup (ec.Compiler,
- ec.CurrentType, Type, name, 0,
- MemberKind.All,
- BindingRestriction.AccessibleOnly | BindingRestriction.DefaultMemberLookup,
- Location);
+ Expression member = Expression.MemberLookup (ec, ec.CurrentType, Type, name, 0, false, loc);
if (member == null) {
- member = Expression.MemberLookup (ec.Compiler, ec.CurrentType, Type, name, 0,
- MemberKind.All, BindingRestriction.None,
- Location);
+ member = Expression.MemberLookup (null, ec.CurrentType, Type, name, 0, false, loc);
if (member != null) {
- ec.Report.SymbolRelatedToPreviousError (member.Type);
- Expression.ErrorIsInaccesible (Location, member.GetSignatureForError (), ec.Report);
+ // TODO: ec.Report.SymbolRelatedToPreviousError (member);
+ Expression.ErrorIsInaccesible (ec, member.GetSignatureForError (), loc);
return false;
}
}
return tc.GetSignatureForError ();
}
- public ExtensionMethodGroupExpr LookupExtensionMethod (TypeSpec extensionType, string name, int arity, Location loc)
+ public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
{
return null;
}
// Holds the compiler generated classes
List<CompilerGeneratedClass> compiler_generated;
+ Dictionary<MethodSpec, Method> hoisted_base_call_proxies;
+
//
// Pointers to the default constructor and the default static constructor
//
return true;
}
+ //
+ // Creates a proxy base method call inside this container for hoisted base member calls
+ //
+ public MethodSpec CreateHoistedBaseCallProxy (ResolveContext rc, MethodSpec method)
+ {
+ Method proxy_method;
+
+ //
+ // One proxy per base method is enough
+ //
+ if (hoisted_base_call_proxies == null) {
+ hoisted_base_call_proxies = new Dictionary<MethodSpec, Method> ();
+ proxy_method = null;
+ } else {
+ hoisted_base_call_proxies.TryGetValue (method, out proxy_method);
+ }
+
+ if (proxy_method == null) {
+ string name = CompilerGeneratedClass.MakeName (method.Name, null, "BaseCallProxy", hoisted_base_call_proxies.Count);
+ var cloned_params = ParametersCompiled.CreateFullyResolved (method.Parameters.FixedParameters, method.Parameters.Types);
+ if (method.Parameters.HasArglist) {
+ cloned_params.FixedParameters[0] = new Parameter (null, "__arglist", Parameter.Modifier.NONE, null, Location);
+ cloned_params.Types[0] = TypeManager.runtime_argument_handle_type;
+ }
+
+ GenericMethod generic_method;
+ MemberName member_name;
+ if (method.IsGeneric) {
+ //
+ // Copy all base generic method type parameters info
+ //
+ var hoisted_tparams = method.GenericDefinition.TypeParameters;
+ var targs = new TypeArguments ();
+ var type_params = new TypeParameter[hoisted_tparams.Length];
+ for (int i = 0; i < type_params.Length; ++i) {
+ var tp = hoisted_tparams[i];
+ targs.Add (new TypeParameterName (tp.Name, null, Location));
+ type_params[i] = new TypeParameter (tp, null, null, new MemberName (tp.Name), null);
+ }
+
+ member_name = new MemberName (name, targs, Location);
+ generic_method = new GenericMethod (NamespaceEntry, this, member_name, type_params,
+ new TypeExpression (method.ReturnType, Location), cloned_params);
+ } else {
+ member_name = new MemberName (name);
+ generic_method = null;
+ }
+
+ // Compiler generated proxy
+ proxy_method = new Method (this, generic_method, new TypeExpression (method.ReturnType, Location),
+ Modifiers.PRIVATE | Modifiers.COMPILER_GENERATED | Modifiers.DEBUGGER_HIDDEN,
+ member_name, cloned_params, null);
+
+ var block = new ToplevelBlock (Compiler, proxy_method.ParameterInfo, Location);
+
+ var mg = MethodGroupExpr.CreatePredefined (method, method.DeclaringType, Location);
+ mg.InstanceExpression = new BaseThis (method.DeclaringType, Location);
+
+ // Get all the method parameters and pass them as arguments
+ var real_base_call = new Invocation (mg, block.GetAllParametersArguments ());
+ Statement statement;
+ if (method.ReturnType == TypeManager.void_type)
+ statement = new StatementExpression (real_base_call);
+ else
+ statement = new Return (real_base_call, Location);
+
+ block.AddStatement (statement);
+ proxy_method.Block = block;
+
+ methods.Add (proxy_method);
+ proxy_method.Define ();
+
+ hoisted_base_call_proxies.Add (method, proxy_method);
+ }
+
+ return proxy_method.Spec;
+ }
+
bool DefineBaseTypes ()
{
iface_exprs = ResolveBaseTypes (out base_type_expr);
}
}
- public override ExtensionMethodGroupExpr LookupExtensionMethod (TypeSpec extensionType, string name, int arity, Location loc)
+ public override IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
{
DeclSpace top_level = Parent;
if (top_level != null) {
top_level = top_level.Parent;
var candidates = NamespaceEntry.NS.LookupExtensionMethod (extensionType, this, name, arity);
- if (candidates != null)
- return new ExtensionMethodGroupExpr (candidates, NamespaceEntry, extensionType, loc);
+ if (candidates != null) {
+ scope = NamespaceEntry;
+ return candidates;
+ }
}
- return NamespaceEntry.LookupExtensionMethod (extensionType, name, arity, loc);
+ return NamespaceEntry.LookupExtensionMethod (extensionType, name, arity, ref scope);
}
protected override TypeAttributes TypeAttr {
get { return false; }
}
- public ExtensionMethodGroupExpr LookupExtensionMethod (TypeSpec extensionType, string name, int arity, Location loc)
+ public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
{
throw new NotImplementedException ();
}
string GetSignatureForError ();
- ExtensionMethodGroupExpr LookupExtensionMethod (TypeSpec extensionType, string name, int arity, Location loc);
+ IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope);
FullNamedExpression LookupNamespaceOrType (string name, int arity, Location loc, bool ignore_cs0104);
FullNamedExpression LookupNamespaceAlias (string name);
get { return HasSet (Options.UnsafeScope) || MemberContext.IsUnsafe; }
}
- public ExtensionMethodGroupExpr LookupExtensionMethod (TypeSpec extensionType, string name, int arity, Location loc)
+ public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
{
- return MemberContext.LookupExtensionMethod (extensionType, name, arity, loc);
+ return MemberContext.LookupExtensionMethod (extensionType, name, arity, ref scope);
}
public FullNamedExpression LookupNamespaceOrType (string name, int arity, Location loc, bool ignore_cs0104)
}
public virtual bool IsUsed {
- get { return (caching_flags & Flags.IsUsed) != 0; }
+ get {
+ return (caching_flags & Flags.IsUsed) != 0;
+ }
}
protected Report Report {
return true;
}
- public virtual ExtensionMethodGroupExpr LookupExtensionMethod (TypeSpec extensionType, string name, int arity, Location loc)
+ public virtual IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
{
- return Parent.LookupExtensionMethod (extensionType, name, arity, loc);
+ return Parent.LookupExtensionMethod (extensionType, name, arity, ref scope);
}
public virtual FullNamedExpression LookupNamespaceAlias (string name)
return inflated;
}
+ //
+ // Is this member accessible from invocationType
+ //
+ public bool IsAccessible (TypeSpec invocationType)
+ {
+ var ma = Modifiers & Modifiers.AccessibilityMask;
+ if (ma == Modifiers.PUBLIC)
+ return true;
+
+ var parentType = /* this as TypeSpec ?? */ DeclaringType;
+
+ //
+ // If only accessible to the current class or children
+ //
+ if (ma == Modifiers.PRIVATE)
+ return invocationType.MemberDefinition == parentType.MemberDefinition ||
+ TypeManager.IsNestedChildOf (invocationType, parentType);
+
+ if ((ma & Modifiers.INTERNAL) != 0) {
+ var b = TypeManager.IsThisOrFriendAssembly (invocationType == InternalType.FakeInternalType ?
+ CodeGen.Assembly.Builder : invocationType.Assembly, parentType.Assembly);
+ if (b || ma == Modifiers.INTERNAL)
+ return b;
+ }
+
+ // PROTECTED
+ if (!TypeManager.IsNestedFamilyAccessible (invocationType, parentType))
+ return false;
+
+ return true;
+ }
+
//
// Returns member CLS compliance based on full member hierarchy
//
public bool CheckAccessLevel (TypeSpec check_type)
{
+// TODO: Use this instead
+// return PartialContainer.Definition.IsAccessible (check_type);
+
TypeSpec tb = PartialContainer.Definition;
check_type = check_type.GetDefinition ();
return null;
// FIXME: Breaks error reporting
- if (!CheckAccessLevel (t))
+ if (!t.IsAccessible (CurrentType))
return null;
return t;
//
// Base class for `NewDelegate' and `ImplicitDelegateCreation'
//
- public abstract class DelegateCreation : Expression, MethodGroupExpr.IErrorHandler
+ public abstract class DelegateCreation : Expression, OverloadResolver.IErrorHandler
{
protected MethodSpec constructor_method;
protected MethodGroupExpr method_group;
constructor_method = Delegate.GetConstructor (ec.Compiler, ec.CurrentType, type);
var invoke_method = Delegate.GetInvokeMethod (ec.Compiler, type);
- method_group.DelegateType = type;
- method_group.CustomErrorHandler = this;
Arguments arguments = CreateDelegateMethodArguments (invoke_method.Parameters, invoke_method.Parameters.Types, loc);
- method_group = method_group.OverloadResolve (ec, ref arguments, false, loc);
+ method_group = method_group.OverloadResolve (ec, ref arguments, this, OverloadResolver.Restrictions.Covariant);
if (method_group == null)
return null;
TypeManager.CSharpName (invoke_method.ReturnType), Delegate.FullDelegateDesc (invoke_method));
return;
}
+
if (return_type == null) {
ec.Report.Error (123, loc, "A method or delegate `{0}' parameters do not match delegate `{1}' parameters",
member_name, Delegate.FullDelegateDesc (invoke_method));
if (target_type == TypeManager.delegate_type || target_type == TypeManager.multicast_delegate_type)
return false;
- mg.DelegateType = target_type;
var invoke = Delegate.GetInvokeMethod (ec.Compiler, target_type);
Arguments arguments = CreateDelegateMethodArguments (invoke.Parameters, invoke.Parameters.Types, mg.Location);
- return mg.OverloadResolve (ec, ref arguments, true, mg.Location) != null;
+ return mg.OverloadResolve (ec, ref arguments, null, OverloadResolver.Restrictions.Covariant | OverloadResolver.Restrictions.ProbingOnly) != null;
}
#region IErrorHandler Members
- public bool NoExactMatch (ResolveContext ec, MethodSpec method)
+ bool OverloadResolver.IErrorHandler.AmbiguousCandidates (ResolveContext ec, MemberSpec best, MemberSpec ambiguous)
{
- if (method.IsGeneric)
- return false;
+ return false;
+ }
- Error_ConversionFailed (ec, method, null);
+ bool OverloadResolver.IErrorHandler.ArgumentMismatch (ResolveContext rc, MemberSpec best, Argument arg, int index)
+ {
+ Error_ConversionFailed (rc, best as MethodSpec, null);
return true;
}
- public bool AmbiguousCall (ResolveContext ec, MethodGroupExpr mg, MethodSpec ambiguous)
+ bool OverloadResolver.IErrorHandler.NoArgumentMatch (ResolveContext rc, MemberSpec best)
+ {
+ Error_ConversionFailed (rc, best as MethodSpec, null);
+ return true;
+ }
+
+ bool OverloadResolver.IErrorHandler.TypeInferenceFailed (ResolveContext rc, MemberSpec best)
{
return false;
}
TypeSpec del_type = InstanceExpr.Type;
if (del_type == null)
return null;
-
+
+ //
+ // Do only core overload resolution the rest of the checks has been
+ // done on primary expression
+ //
method = Delegate.GetInvokeMethod (ec.Compiler, del_type);
- var mb = method;
- var me = new MethodGroupExpr (mb, del_type, loc);
- me.InstanceExpression = InstanceExpr;
-
- AParametersCollection pd = mb.Parameters;
- int pd_count = pd.Count;
-
- int arg_count = arguments == null ? 0 : arguments.Count;
-
- bool params_method = pd.HasParams;
- bool is_params_applicable = false;
- bool is_applicable = me.IsApplicable (ec, ref arguments, arg_count, ref mb, ref is_params_applicable) == 0;
- if (arguments != null)
- arg_count = arguments.Count;
-
- if (!is_applicable && !params_method && arg_count != pd_count) {
- ec.Report.Error (1593, loc, "Delegate `{0}' does not take `{1}' arguments",
- TypeManager.CSharpName (del_type), arg_count.ToString ());
- } else if (arguments == null || !arguments.HasDynamic) {
- me.VerifyArgumentsCompat (ec, ref arguments, arg_count, mb,
- is_params_applicable || (!is_applicable && params_method), false, loc);
- }
+ var res = new OverloadResolver (new MemberSpec[] { method }, OverloadResolver.Restrictions.DelegateInvoke, loc);
+ var valid = res.ResolveMember<MethodSpec> (ec, ref arguments);
+ if (valid == null && !res.BestCandidateIsDynamic)
+ return null;
type = method.ReturnType;
eclass = ExprClass.Value;
string cref, bool warn419, string name_for_error, Report Report)
{
warning_type = 0;
- var filter = new MemberFilter (member_name, 0, MemberKind.All, param_list, null);
+// var filter = new MemberFilter (member_name, 0, MemberKind.All, param_list, null);
IList<MemberSpec> found = null;
while (type != null && found == null) {
- found = MemberCache.FindMembers (type, filter, BindingRestriction.StopOnFirstMatch);
+ found = MemberCache.FindMembers (type, member_name, false);
type = type.DeclaringType;
}
#endregion
- public SLE.Expression MakeAssignExpression (BuilderContext ctx)
+ public SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source)
{
return obj.Expression;
}
//
interface IDynamicAssign : IAssignMethod
{
-#if NET_4_0
- SLE.Expression MakeAssignExpression (BuilderContext ctx);
-#endif
+ SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source);
}
//
set { type = value; }
}
- public virtual Location Location {
+ public Location Location {
get { return loc; }
}
return type.GetDefinition ().GetSignatureForError ();
}
- public static bool IsMemberAccessible (TypeSpec invocation_type, MemberSpec mi, out bool must_do_cs1540_check)
- {
- var ma = mi.Modifiers & Modifiers.AccessibilityMask;
-
- must_do_cs1540_check = false; // by default we do not check for this
-
- if (ma == Modifiers.PUBLIC)
- return true;
-
- //
- // If only accessible to the current class or children
- //
- if (ma == Modifiers.PRIVATE)
- return invocation_type.MemberDefinition == mi.DeclaringType.MemberDefinition ||
- TypeManager.IsNestedChildOf (invocation_type, mi.DeclaringType);
-
- if ((ma & Modifiers.INTERNAL) != 0) {
- var b = TypeManager.IsThisOrFriendAssembly (invocation_type == InternalType.FakeInternalType ?
- CodeGen.Assembly.Builder : invocation_type.Assembly, mi.DeclaringType.Assembly);
- if (b || ma == Modifiers.INTERNAL)
- return b;
- }
-
- // Family and FamANDAssem require that we derive.
- // FamORAssem requires that we derive if in different assemblies.
- if (!TypeManager.IsNestedFamilyAccessible (invocation_type, mi.DeclaringType))
- return false;
-
- if (!TypeManager.IsNestedChildOf (invocation_type, mi.DeclaringType))
- must_do_cs1540_check = true;
-
- return true;
- }
-
public virtual bool IsNull {
get {
return false;
if (!te.CheckAccessLevel (ec)) {
ec.Compiler.Report.SymbolRelatedToPreviousError (te.Type);
- ErrorIsInaccesible (loc, TypeManager.CSharpName (te.Type), ec.Compiler.Report);
+ ErrorIsInaccesible (ec, te.Type.GetSignatureForError (), loc);
}
te.loc = loc;
return te;
}
- public static void ErrorIsInaccesible (Location loc, string name, Report Report)
+ public static void ErrorIsInaccesible (IMemberContext rc, string member, Location loc)
{
- Report.Error (122, loc, "`{0}' is inaccessible due to its protection level", name);
- }
-
- protected static void Error_CannotAccessProtected (ResolveContext ec, Location loc, MemberSpec m, TypeSpec qualifier, TypeSpec container)
- {
- ec.Report.Error (1540, loc, "Cannot access protected member `{0}' via a qualifier of type `{1}'."
- + " The qualifier must be of type `{2}' or derived from it",
- m.GetSignatureForError (),
- TypeManager.CSharpName (qualifier),
- TypeManager.CSharpName (container));
-
+ rc.Compiler.Report.Error (122, loc, "`{0}' is inaccessible due to its protection level", member);
}
public void Error_ExpressionMustBeConstant (ResolveContext rc, Location loc, string e_name)
name, member.GetSignatureForError ());
}
} else {
- report.Error (307, loc, "The {0} `{1}' cannot be used with type arguments",
- ExprClassName, GetSignatureForError ());
+ Error_TypeArgumentsCannotBeUsed (report, ExprClassName, GetSignatureForError (), loc);
}
}
+ public void Error_TypeArgumentsCannotBeUsed (Report report, string exprType, string name, Location loc)
+ {
+ report.Error (307, loc, "The {0} `{1}' cannot be used with type arguments",
+ exprType, name);
+ }
+
protected virtual void Error_TypeDoesNotContainDefinition (ResolveContext ec, TypeSpec type, string name)
{
Error_TypeDoesNotContainDefinition (ec, loc, type, name);
{
if (eclass != ExprClass.Unresolved)
return this;
-
Expression e;
try {
/// Returns a fully formed expression after a MemberLookup
/// </summary>
///
- public static Expression ExprClassFromMemberInfo (TypeSpec container_type, MemberSpec spec, Location loc)
+ static Expression ExprClassFromMemberInfo (MemberSpec spec, Location loc)
{
if (spec is EventSpec)
return new EventExpr ((EventSpec) spec, loc);
return null;
}
- //
- // FIXME: Probably implement a cache for (t,name,current_access_set)?
- //
- // This code could use some optimizations, but we need to do some
- // measurements. For example, we could use a delegate to `flag' when
- // something can not any longer be a method-group (because it is something
- // else).
- //
- // Return values:
- // If the return value is an Array, then it is an array of
- // MethodBases
- //
- // If the return value is an MemberInfo, it is anything, but a Method
- //
- // null on error.
- //
- // FIXME: When calling MemberLookup inside an `Invocation', we should pass
- // the arguments here and have MemberLookup return only the methods that
- // match the argument count/type, unlike we are doing now (we delay this
- // decision).
- //
- // This is so we can catch correctly attempts to invoke instance methods
- // from a static body (scan for error 120 in ResolveSimpleName).
- //
- //
- // FIXME: Potential optimization, have a static ArrayList
- //
-
- public static Expression MemberLookup (CompilerContext ctx, TypeSpec container_type, TypeSpec queried_type, string name, int arity,
- MemberKind mt, BindingRestriction bf, Location loc)
+ protected static MethodSpec ConstructorLookup (ResolveContext rc, TypeSpec type, ref Arguments args, Location loc)
{
- return MemberLookup (ctx, container_type, null, queried_type, name, arity, mt, bf, loc);
- }
-
- //
- // Lookup type `queried_type' for code in class `container_type' with a qualifier of
- // `qualifier_type' or null to lookup members in the current class.
- //
- public static Expression MemberLookup (CompilerContext ctx, TypeSpec container_type,
- TypeSpec qualifier_type, TypeSpec queried_type,
- string name, int arity, MemberKind mt,
- BindingRestriction binding, Location loc)
- {
- var mi = TypeManager.MemberLookup (container_type, qualifier_type,
- queried_type, mt, binding, name, arity, null);
- if (mi == null)
- return null;
-
- var first = mi [0];
- if (mi.Count > 1) {
- foreach (var mc in mi) {
- if (mc is MethodSpec)
- return new MethodGroupExpr (mi, queried_type, loc);
+ var ctors = MemberCache.FindMembers (type, ConstructorInfo.ConstructorName, true);
+ if (ctors == null) {
+ rc.Report.SymbolRelatedToPreviousError (type);
+ if (type.IsStruct) {
+ // Report meaningful error for struct as they always have default ctor in C# context
+ OverloadResolver.Error_ConstructorMismatch (rc, type, args == null ? 0 : args.Count, loc);
+ } else {
+ rc.Report.Error (143, loc, "The class `{0}' has no constructors defined",
+ type.GetSignatureForError ());
}
- ctx.Report.SymbolRelatedToPreviousError (mi [1]);
- ctx.Report.SymbolRelatedToPreviousError (first);
- ctx.Report.Error (229, loc, "Ambiguity between `{0}' and `{1}'",
- first.GetSignatureForError (), mi [1].GetSignatureForError ());
+ return null;
}
- if (first is MethodSpec)
- return new MethodGroupExpr (mi, queried_type, loc);
-
- return ExprClassFromMemberInfo (container_type, first, loc);
+ var r = new OverloadResolver (ctors, OverloadResolver.Restrictions.NoBaseMembers, loc);
+ return r.ResolveMember<MethodSpec> (rc, ref args);
}
- public static Expression MemberLookup (CompilerContext ctx, TypeSpec container_type, TypeSpec queried_type,
- string name, int arity, BindingRestriction binding, Location loc)
+ //
+ // Lookup type `queried_type' for code in class `container_type' with a qualifier of
+ // `qualifier_type' or null to lookup members in the current class.
+ //
+ public static Expression MemberLookup (ResolveContext rc, TypeSpec currentType, TypeSpec queried_type, string name, int arity, bool invocableOnly, Location loc)
{
- return MemberLookup (ctx, container_type, null, queried_type, name, arity,
- MemberKind.All, binding | BindingRestriction.AccessibleOnly, loc);
- }
+ var members = MemberCache.FindMembers (queried_type, name, false);
+ if (members == null)
+ return null;
- public static Expression MemberLookup (CompilerContext ctx, TypeSpec container_type, TypeSpec qualifier_type,
- TypeSpec queried_type, string name, int arity, BindingRestriction binding, Location loc)
- {
- return MemberLookup (ctx, container_type, qualifier_type, queried_type,
- name, arity, MemberKind.All, binding | BindingRestriction.AccessibleOnly, loc);
- }
+ MemberSpec non_method = null;
+ MemberSpec ambig_non_method = null;
+ currentType = currentType ?? InternalType.FakeInternalType;
+ do {
+ for (int i = 0; i < members.Count; ++i) {
+ var member = members[i];
- /// <summary>
- /// This is a wrapper for MemberLookup that is not used to "probe", but
- /// to find a final definition. If the final definition is not found, we
- /// look for private members and display a useful debugging message if we
- /// find it.
- /// </summary>
- protected Expression MemberLookupFinal (ResolveContext ec, TypeSpec qualifier_type,
- TypeSpec queried_type, string name, int arity,
- MemberKind mt, BindingRestriction bf,
- Location loc)
- {
- Expression e;
+ // HACK: for events because +=/-= can appear at same class only, should use OverrideToBase there
+ if ((member.Modifiers & Modifiers.OVERRIDE) != 0 && member.Kind != MemberKind.Event)
+ continue;
- int errors = ec.Report.Errors;
- e = MemberLookup (ec.Compiler, ec.CurrentType, qualifier_type, queried_type, name, arity, mt, bf, loc);
+ if (arity > 0 && member.Arity != arity)
+ continue;
- if (e != null || errors != ec.Report.Errors)
- return e;
+ if (rc != null && !member.IsAccessible (currentType))
+ continue;
- // No errors were reported by MemberLookup, but there was an error.
- return Error_MemberLookupFailed (ec, ec.CurrentType, qualifier_type, queried_type,
- name, arity, null, mt, bf);
- }
+ if (invocableOnly) {
+ if (member is MethodSpec)
+ return new MethodGroupExpr (members, queried_type, loc);
- protected virtual Expression Error_MemberLookupFailed (ResolveContext ec, TypeSpec container_type, TypeSpec qualifier_type,
- TypeSpec queried_type, string name, int arity, string class_name,
- MemberKind mt, BindingRestriction bf)
- {
- IList<MemberSpec> lookup = null;
- if (queried_type == null) {
- class_name = "global::";
- } else {
- BindingRestriction restriction = bf & BindingRestriction.DeclaredOnly;
-
- lookup = TypeManager.MemberLookup (queried_type, null, queried_type,
- mt, restriction, name, arity, null);
-
- if (lookup != null) {
- Expression e = Error_MemberLookupFailed (ec, queried_type, lookup);
-
- //
- // FIXME: This is still very wrong, it should be done inside
- // OverloadResolve to do correct arguments matching.
- // Requires MemberLookup accessiblity check removal
- //
- if (e == null || (mt & (MemberKind.Method | MemberKind.Constructor)) == 0) {
- var mi = lookup.First ();
- ec.Report.SymbolRelatedToPreviousError (mi);
- if ((mi.Modifiers & Modifiers.PROTECTED) != 0 && qualifier_type != null && container_type != null && qualifier_type != container_type &&
- TypeManager.IsNestedFamilyAccessible (container_type, mi.DeclaringType)) {
- // Although a derived class can access protected members of
- // its base class it cannot do so through an instance of the
- // base class (CS1540). If the qualifier_type is a base of the
- // ec.CurrentType and the lookup succeeds with the latter one,
- // then we are in this situation.
- Error_CannotAccessProtected (ec, loc, mi, qualifier_type, container_type);
- } else {
- ErrorIsInaccesible (loc, TypeManager.GetFullNameSignature (mi), ec.Report);
- }
+ if (!Invocation.IsMemberInvocable (member))
+ continue;
}
- return e;
+ if (non_method == null || member is MethodSpec) {
+ non_method = member;
+ } else if (currentType != null) {
+ ambig_non_method = member;
+ }
}
- lookup = TypeManager.MemberLookup (queried_type, null, queried_type,
- MemberKind.All, BindingRestriction.None, name, -System.Math.Max (1, arity), null);
- }
+ if (non_method != null) {
+ if (ambig_non_method != null && rc != null) {
+ rc.Report.SymbolRelatedToPreviousError (non_method);
+ rc.Report.SymbolRelatedToPreviousError (ambig_non_method);
+ rc.Report.Error (229, loc, "Ambiguity between `{0}' and `{1}'",
+ non_method.GetSignatureForError (), ambig_non_method.GetSignatureForError ());
+ }
- if (lookup == null) {
- if (class_name != null) {
- ec.Report.Error (103, loc, "The name `{0}' does not exist in the current context",
- name);
- } else {
- Error_TypeDoesNotContainDefinition (ec, queried_type, name);
- }
- return null;
- }
+ if (non_method is MethodSpec)
+ return new MethodGroupExpr (members, queried_type, loc);
- var mge = Error_MemberLookupFailed (ec, queried_type, lookup);
- if (arity > 0 && mge != null) {
- mge.SetTypeArguments (ec, new TypeArguments (new FullNamedExpression [arity]));
- }
+ return ExprClassFromMemberInfo (non_method, loc);
+ }
- return mge.Resolve (ec);
- }
+ if (members[0].DeclaringType.BaseType == null)
+ members = null;
+ else
+ members = MemberCache.FindMembers (members[0].DeclaringType.BaseType, name, false);
- protected virtual MemberExpr Error_MemberLookupFailed (ResolveContext ec, TypeSpec type, IList<MemberSpec> members)
- {
- if (members.Any ((m) => !(m is MethodSpec)))
- return (MemberExpr) ExprClassFromMemberInfo (type, members.First (), loc);
+ } while (members != null);
- // By default propagate the closest candidates upwards
- return new MethodGroupExpr (members, type, loc, true);
+ return null;
}
protected virtual void Error_NegativeArrayIndex (ResolveContext ec, Location loc)
if (methods == null)
return null;
- var mg = new MethodGroupExpr (methods, e.type, loc);
-
Arguments arguments = new Arguments (1);
arguments.Add (new Argument (e));
- mg = mg.OverloadResolve (ec, ref arguments, false, loc);
- if (mg == null)
+ var res = new OverloadResolver (methods, OverloadResolver.Restrictions.NoBaseMembers, loc);
+ var oper = res.ResolveOperator (ec, ref arguments);
+
+ if (oper == null)
return null;
- return new UserOperatorCall (mg.BestCandidate, arguments, null, loc);
+ return new UserOperatorCall (oper, arguments, null, loc);
}
public virtual string ExprClassName
else
return 0;
}
-
- protected void Error_CannotCallAbstractBase (ResolveContext ec, string name)
- {
- ec.Report.Error (205, loc, "Cannot call an abstract base member `{0}'", name);
- }
-
+
protected void Error_CannotModifyIntermediateExpressionValue (ResolveContext ec)
{
ec.Report.SymbolRelatedToPreviousError (type);
return Name;
}
+
+ public abstract Expression LookupNameExpression (ResolveContext rc, bool readMode, bool invocableOnly);
}
/// <summary>
return SimpleNameResolve (ec, right_side, false);
}
- public Expression DoResolve (ResolveContext ec, bool intermediate)
- {
- return SimpleNameResolve (ec, null, intermediate);
- }
-
public override FullNamedExpression ResolveAsTypeStep (IMemberContext ec, bool silent)
{
int errors = ec.Compiler.Report.Errors;
return null;
}
- Expression SimpleNameResolve (ResolveContext ec, Expression right_side, bool intermediate)
+ public override Expression LookupNameExpression (ResolveContext rc, bool readMode, bool invocableOnly)
{
- Expression e = DoSimpleNameResolve (ec, right_side, intermediate);
+ int lookup_arity = Arity;
+ bool errorMode = false;
+ Expression e;
+ Block current_block = rc.CurrentBlock;
- if (e == null)
- return null;
+ while (true) {
+ //
+ // Stage 1: binding to local variables or parameters
+ //
+ if (current_block != null && lookup_arity == 0) {
+ LocalInfo vi = current_block.GetLocalInfo (Name);
+ if (vi != null) {
+ // TODO: pass vi in to speed things up
+ e = new LocalVariableReference (rc.CurrentBlock, Name, loc);
+ } else {
+ e = current_block.Toplevel.GetParameterReference (Name, loc);
+ }
- if (ec.CurrentBlock == null || ec.CurrentBlock.CheckInvariantMeaningInBlock (Name, e, Location))
- return e;
+ if (e != null) {
+ if (Arity > 0)
+ Error_TypeArgumentsCannotBeUsed (rc.Report, "variable", Name, loc);
- return null;
- }
+ return e;
+ }
- /// <remarks>
- /// 7.5.2: Simple Names.
- ///
- /// Local Variables and Parameters are handled at
- /// parse time, so they never occur as SimpleNames.
- ///
- /// The `intermediate' flag is used by MemberAccess only
- /// and it is used to inform us that it is ok for us to
- /// avoid the static check, because MemberAccess might end
- /// up resolving the Name as a Type name and the access as
- /// a static type access.
- ///
- /// ie: Type Type; .... { Type.GetType (""); }
- ///
- /// Type is both an instance variable and a Type; Type.GetType
- /// is the static method not an instance method of type.
- /// </remarks>
- Expression DoSimpleNameResolve (ResolveContext ec, Expression right_side, bool intermediate)
- {
- Expression e = null;
+ if (!errorMode)
+ current_block.CheckInvariantMeaningInBlock (Name, this, loc);
- //
- // Stage 1: Performed by the parser (binding to locals or parameters).
- //
- Block current_block = ec.CurrentBlock;
- if (current_block != null){
- LocalInfo vi = current_block.GetLocalInfo (Name);
- if (vi != null){
- e = new LocalVariableReference (ec.CurrentBlock, Name, loc);
-
- if (right_side != null) {
- e = e.ResolveLValue (ec, right_side);
- } else {
- if (intermediate) {
- using (ec.With (ResolveContext.Options.DoFlowAnalysis, false)) {
- e = e.Resolve (ec, ResolveFlags.VariableOrValue);
- }
+/*
+ //if (errorMode) {
+ IKnownVariable ikv = current_block.Explicit.GetKnownVariable (Name);
+ if (ikv != null) {
+ LocalInfo li = ikv as LocalInfo;
+ // Supress CS0219 warning
+ if (li != null)
+ li.Used = true;
+
+ Error_VariableIsUsedBeforeItIsDeclared (rc.Report, Name);
+ return null;
+ }
+ //}
+*/
+ }
+
+ //
+ // Stage 2: Lookup members if we are inside a type up to top level type for nested types
+ //
+ TypeSpec member_type = rc.CurrentType;
+ TypeSpec current_type = member_type;
+ for (; member_type != null; member_type = member_type.DeclaringType) {
+ var me = MemberLookup (errorMode ? null : rc, current_type, member_type, Name, lookup_arity, invocableOnly, loc) as MemberExpr;
+ if (me == null)
+ continue;
+
+ if (errorMode) {
+ if (me is MethodGroupExpr) {
+ // Leave it to overload resolution to report correct error
} else {
- e = e.Resolve (ec, ResolveFlags.VariableOrValue);
+ // TODO: rc.Report.SymbolRelatedToPreviousError ()
+ ErrorIsInaccesible (rc, me.GetSignatureForError (), loc);
}
- }
+ } else {
+ //
+ // MemberLookup does not check accessors availability, this is actually needed for properties only
+ //
+ var pe = me as PropertyExpr;
+ if (pe != null) {
- if (e != null && Arity > 0)
- e.Error_TypeArgumentsCannotBeUsed (ec.Report, loc, null, 0);
+ // Break as there is no other overload available anyway
+ if (readMode) {
+ if (!pe.PropertyInfo.HasGet || !pe.PropertyInfo.Get.IsAccessible (current_type))
+ break;
- return e;
- }
+ pe.Getter = pe.PropertyInfo.Get;
+ } else {
+ if (!pe.PropertyInfo.HasSet || !pe.PropertyInfo.Set.IsAccessible (current_type))
+ break;
- e = current_block.Toplevel.GetParameterReference (Name, loc);
- if (e != null) {
- if (right_side != null)
- e = e.ResolveLValue (ec, right_side);
- else
- e = e.Resolve (ec);
+ pe.Setter = pe.PropertyInfo.Set;
+ }
+ }
+ }
- if (e != null && Arity > 0)
- e.Error_TypeArgumentsCannotBeUsed (ec.Report, loc, null, 0);
+ // TODO: It's used by EventExpr -> FieldExpr transformation only
+ // TODO: Should go to MemberAccess
+ me = me.ResolveMemberAccess (rc, null, null);
- return e;
- }
- }
-
- //
- // Stage 2: Lookup members
- //
- int arity = HasTypeArguments ? Arity : -1;
-// TypeSpec almost_matched_type = null;
-// IList<MemberSpec> almost_matched = null;
- for (TypeSpec lookup_ds = ec.CurrentType; lookup_ds != null; lookup_ds = lookup_ds.DeclaringType) {
- e = MemberLookup (ec.Compiler, ec.CurrentType, lookup_ds, Name, arity, BindingRestriction.DefaultMemberLookup, loc);
- if (e != null) {
- PropertyExpr pe = e as PropertyExpr;
- if (pe != null) {
- // since TypeManager.MemberLookup doesn't know if we're doing a lvalue access or not,
- // it doesn't know which accessor to check permissions against
- if (pe.PropertyInfo.Kind == MemberKind.Property && pe.IsAccessibleFrom (ec.CurrentType, right_side != null))
- break;
- } else if (e is EventExpr) {
- if (((EventExpr) e).IsAccessibleFrom (ec.CurrentType))
- break;
- } else if (HasTypeArguments && e is TypeExpression) {
- e = new GenericTypeExpr (e.Type, targs, loc).ResolveAsTypeStep (ec, false);
- break;
- } else {
- break;
+ if (Arity > 0) {
+ targs.Resolve (rc);
+ me.SetTypeArguments (rc, targs);
}
- e = null;
- }
-/*
- if (almost_matched == null && almost_matched_members.Count > 0) {
- almost_matched_type = lookup_ds;
- almost_matched = new List<MemberSpec>(almost_matched_members);
+
+ return me;
}
-*/
- }
- if (e == null) {
-/*
- if (almost_matched == null && almost_matched_members.Count > 0) {
- almost_matched_type = ec.CurrentType;
- almost_matched = new List<MemberSpec> (almost_matched_members);
+ //
+ // Stage 3: Lookup nested types, namespaces and type parameters in the context
+ //
+ if (!invocableOnly) {
+ e = ResolveAsTypeStep (rc, lookup_arity == 0 || !errorMode);
+ if (e != null)
+ return e;
}
-*/
- e = ResolveAsTypeStep (ec, true);
- }
- if (e == null) {
- if (current_block != null) {
- IKnownVariable ikv = current_block.Explicit.GetKnownVariable (Name);
- if (ikv != null) {
- LocalInfo li = ikv as LocalInfo;
- // Supress CS0219 warning
- if (li != null)
- li.Used = true;
-
- Error_VariableIsUsedBeforeItIsDeclared (ec.Report, Name);
- return null;
- }
+ if (errorMode) {
+ rc.Report.Error (103, loc, "The name `{0}' does not exist in the current context", Name);
+ return null;
}
- if (RootContext.EvalMode){
+ if (RootContext.EvalMode) {
var fi = Evaluator.LookupField (Name);
if (fi != null)
- return new FieldExpr (fi.Item1, loc).Resolve (ec);
+ return new FieldExpr (fi.Item1, loc);
}
-/*
- if (almost_matched != null)
- almost_matched_members = almost_matched;
- if (almost_matched_type == null)
- almost_matched_type = ec.CurrentType;
-*/
- string type_name = ec.MemberContext.CurrentType == null ? null : ec.MemberContext.CurrentType.Name;
- return Error_MemberLookupFailed (ec, ec.CurrentType, null, ec.CurrentType, Name, arity,
- type_name, MemberKind.All, BindingRestriction.AccessibleOnly);
- }
-
- if (e is MemberExpr) {
- MemberExpr me = (MemberExpr) e;
- // TODO: It's used by EventExpr -> FieldExpr transformation only
- me = me.ResolveMemberAccess (ec, null, null);
-
- if (HasTypeArguments) {
- if (!targs.Resolve (ec))
- return null;
+ lookup_arity = 0;
+ invocableOnly = false;
+ errorMode = true;
+ }
+ }
- me.SetTypeArguments (ec, targs);
- }
+ Expression SimpleNameResolve (ResolveContext ec, Expression right_side, bool intermediate)
+ {
+ Expression e = LookupNameExpression (ec, right_side == null, false);
- if (intermediate)
- return me;
+ if (e == null)
+ return null;
- return (right_side != null)
- ? me.DoResolveLValue (ec, right_side)
- : me.Resolve (ec);
- }
+ if (right_side != null)
+ e = e.ResolveLValue (ec, right_side);
+ else
+ e = e.Resolve (ec);
+ //if (ec.CurrentBlock == null || ec.CurrentBlock.CheckInvariantMeaningInBlock (Name, e, Location))
return e;
}
}
get;
}
- /// <summary>
- /// The type which declares this member.
- /// </summary>
- public abstract TypeSpec DeclaringType {
+ // TODO: Not needed
+ protected abstract TypeSpec DeclaringType {
get;
}
//
// Only when base.member is used and method is virtual
//
- if (!IsBase || method.DeclaringType == InstanceExpression.Type)
+ if (!IsBase)
return method;
//
// means for base.member access we have to find the closest match after we found best candidate
//
if ((method.Modifiers & (Modifiers.ABSTRACT | Modifiers.VIRTUAL | Modifiers.STATIC)) != Modifiers.STATIC) {
- var base_override = MemberCache.FindMember (InstanceExpression.Type, new MemberFilter (method), BindingRestriction.InstanceOnly) as MethodSpec;
- if (base_override != null && base_override.DeclaringType != method.DeclaringType) {
- if (base_override.IsGeneric)
- base_override = base_override.MakeGenericMethod (method.TypeArguments);
+ //
+ // The method could already be what we are looking for
+ //
+ TypeSpec[] targs = null;
+ if (method.DeclaringType != InstanceExpression.Type) {
+ var base_override = MemberCache.FindMember (InstanceExpression.Type, new MemberFilter (method), BindingRestriction.InstanceOnly) as MethodSpec;
+ if (base_override != null && base_override.DeclaringType != method.DeclaringType) {
+ if (base_override.IsGeneric)
+ targs = method.TypeArguments;
+
+ method = base_override;
+ }
+ }
+
+ // TODO: For now we do it for any hoisted call even if it's needed for
+ // hoisted stories only but that requires a new expression wrapper
+ if (rc.CurrentAnonymousMethod != null) {
+ if (targs == null && method.IsGeneric) {
+ targs = method.TypeArguments;
+ method = method.GetGenericMethodDefinition ();
+ }
+
+ if (method.Parameters.HasArglist)
+ throw new NotImplementedException ("__arglist base call proxy");
- if (rc.CurrentAnonymousMethod != null)
- throw new NotImplementedException ("base call hoisting");
+ method = rc.CurrentMemberDefinition.Parent.PartialContainer.CreateHoistedBaseCallProxy (rc, method);
- return base_override;
+ // Ideally this should apply to any proxy rewrite but in the case of unary mutators on
+ // get/set member expressions second call would fail to proxy because left expression
+ // would be of 'this' and not 'base'
+ if (rc.CurrentType.IsStruct)
+ InstanceExpression = rc.GetThis (loc);
}
+
+ if (targs != null)
+ method = method.MakeGenericMethod (targs);
+ }
+
+ //
+ // Only base will allow this invocation to happen.
+ //
+ if (method.IsAbstract) {
+ Error_CannotCallAbstractBase (rc, method.GetSignatureForError ());
}
return method;
}
+ protected void CheckProtectedMemberAccess<T> (ResolveContext rc, T member) where T : MemberSpec
+ {
+ if (InstanceExpression == null)
+ return;
+
+ if ((member.Modifiers & Modifiers.AccessibilityMask) == Modifiers.PROTECTED && !(InstanceExpression is This)) {
+ var ct = rc.CurrentType;
+ var expr_type = InstanceExpression.Type;
+ if (ct != expr_type && !TypeManager.IsSubclassOf (expr_type, ct)) {
+ expr_type = expr_type.GetDefinition ();
+ if (ct != expr_type && !IsSameOrBaseQualifier (ct, expr_type)) {
+ rc.Report.SymbolRelatedToPreviousError (member);
+ rc.Report.Error (1540, loc,
+ "Cannot access protected member `{0}' via a qualifier of type `{1}'. The qualifier must be of type `{2}' or derived from it",
+ member.GetSignatureForError (), expr_type.GetSignatureForError (), ct.GetSignatureForError ());
+ }
+ }
+ }
+ }
+
+ static bool IsSameOrBaseQualifier (TypeSpec type, TypeSpec qtype)
+ {
+ do {
+ type = type.GetDefinition ();
+
+ if (type == qtype || TypeManager.IsFamilyAccessible (qtype, type))
+ return true;
+
+ type = type.DeclaringType;
+ } while (type != null);
+
+ return false;
+ }
+
+ protected void DoBestMemberChecks<T> (ResolveContext rc, T member) where T : MemberSpec, IInterfaceMemberSpec
+ {
+ if (InstanceExpression != null) {
+ InstanceExpression = InstanceExpression.Resolve (rc);
+ CheckProtectedMemberAccess (rc, member);
+ }
+
+ if (member.MemberType.IsPointer && !rc.IsUnsafe) {
+ UnsafeError (rc, loc);
+ }
+
+ if (!rc.IsObsolete) {
+ ObsoleteAttribute oa = member.GetAttributeObsolete ();
+ if (oa != null)
+ AttributeTester.Report_ObsoleteMessage (oa, member.GetSignatureForError (), loc, rc.Report);
+ }
+
+ if (!(member is FieldSpec))
+ member.MemberDefinition.SetIsUsed ();
+ }
+
+ protected virtual void Error_CannotCallAbstractBase (ResolveContext rc, string name)
+ {
+ rc.Report.Error (205, loc, "Cannot call an abstract base member `{0}'", name);
+ }
+
//
// Implements identicial simple name and type-name
//
return left;
}
- protected bool ResolveInstanceExpression (ResolveContext rc)
+ public bool ResolveInstanceExpression (ResolveContext rc)
{
if (IsStatic) {
if (InstanceExpression != null) {
}
var me = InstanceExpression as MemberExpr;
- if (me != null)
+ if (me != null) {
me.ResolveInstanceExpression (rc);
+ var fe = me as FieldExpr;
+ if (fe != null && fe.IsMarshalByRefAccess ()) {
+ rc.Report.SymbolRelatedToPreviousError (me.DeclaringType);
+ rc.Report.Warning (1690, 1, loc,
+ "Cannot call methods, properties, or indexers on `{0}' because it is a value type member of a marshal-by-reference class",
+ me.GetSignatureForError ());
+ }
+ }
+
return true;
}
ec.Emit (OpCodes.Dup);
}
- public virtual void SetTypeArguments (ResolveContext ec, TypeArguments ta)
- {
- // TODO: need to get correct member type
- ec.Report.Error (307, loc, "The property `{0}' cannot be used with type arguments",
- GetSignatureForError ());
- }
+ public abstract void SetTypeArguments (ResolveContext ec, TypeArguments ta);
}
- ///
- /// Represents group of extension methods
- ///
- public class ExtensionMethodGroupExpr : MethodGroupExpr
+ //
+ // Represents a group of extension method candidates for whole namespace
+ //
+ class ExtensionMethodGroupExpr : MethodGroupExpr, OverloadResolver.IErrorHandler
{
- readonly NamespaceEntry namespace_entry;
- public Expression ExtensionExpression;
+ NamespaceEntry namespace_entry;
+ public readonly Expression ExtensionExpression;
- public ExtensionMethodGroupExpr (List<MethodSpec> list, NamespaceEntry n, TypeSpec extensionType, Location l)
- : base (list.Cast<MemberSpec>().ToList (), extensionType, l)
+ public ExtensionMethodGroupExpr (IList<MethodSpec> list, NamespaceEntry n, Expression extensionExpr, Location l)
+ : base (list.Cast<MemberSpec>().ToList (), extensionExpr.Type, l)
{
this.namespace_entry = n;
+ this.ExtensionExpression = extensionExpr;
}
public override bool IsStatic {
get { return true; }
}
- public bool IsTopLevel {
- get { return namespace_entry == null; }
+ public override IList<MemberSpec> GetBaseMembers (TypeSpec baseType)
+ {
+ if (namespace_entry == null)
+ return null;
+
+ //
+ // For extension methodgroup we are not looking for base members but parent
+ // namespace extension methods
+ //
+ int arity = type_arguments == null ? 0 : type_arguments.Count;
+ var found = namespace_entry.LookupExtensionMethod (DeclaringType, Name, arity, ref namespace_entry);
+ if (found == null)
+ return null;
+
+ return found.Cast<MemberSpec> ().ToList ();
+ }
+
+ public override MethodGroupExpr LookupExtensionMethod (ResolveContext rc)
+ {
+ // We are already here
+ return null;
}
- public override MethodGroupExpr OverloadResolve (ResolveContext ec, ref Arguments arguments, bool may_fail, Location loc)
+ public override MethodGroupExpr OverloadResolve (ResolveContext ec, ref Arguments arguments, OverloadResolver.IErrorHandler ehandler, OverloadResolver.Restrictions restr)
{
if (arguments == null)
arguments = new Arguments (1);
arguments.Insert (0, new Argument (ExtensionExpression));
- MethodGroupExpr mg = ResolveOverloadExtensions (ec, ref arguments, namespace_entry, loc);
+ var res = base.OverloadResolve (ec, ref arguments, ehandler ?? this, restr);
// Store resolved argument and restore original arguments
- if (mg == null)
- arguments.RemoveAt (0); // Clean-up modified arguments for error reporting
+ if (res == null) {
+ // Clean-up modified arguments for error reporting
+ arguments.RemoveAt (0);
+ return null;
+ }
- return mg;
+ var me = ExtensionExpression as MemberExpr;
+ if (me != null)
+ me.ResolveInstanceExpression (ec);
+
+ InstanceExpression = null;
+ return this;
}
- MethodGroupExpr ResolveOverloadExtensions (ResolveContext ec, ref Arguments arguments, NamespaceEntry ns, Location loc)
+ #region IErrorHandler Members
+
+ bool OverloadResolver.IErrorHandler.AmbiguousCandidates (ResolveContext rc, MemberSpec best, MemberSpec ambiguous)
{
- // Use normal resolve rules
- MethodGroupExpr mg = base.OverloadResolve (ec, ref arguments, ns != null, loc);
- if (mg != null)
- return mg;
+ return false;
+ }
- if (ns == null)
- return null;
+ bool OverloadResolver.IErrorHandler.ArgumentMismatch (ResolveContext rc, MemberSpec best, Argument arg, int index)
+ {
+ rc.Report.SymbolRelatedToPreviousError (best);
+ rc.Report.Error (1928, loc,
+ "Type `{0}' does not contain a member `{1}' and the best extension method overload `{2}' has some invalid arguments",
+ queried_type.GetSignatureForError (), Name, best.GetSignatureForError ());
- // Search continues
- int arity = type_arguments == null ? -1 : type_arguments.Count;
- ExtensionMethodGroupExpr e = ns.LookupExtensionMethod (type, Name, arity, loc);
- if (e == null)
- return base.OverloadResolve (ec, ref arguments, false, loc);
+ if (index == 0) {
+ rc.Report.Error (1929, loc,
+ "Extension method instance type `{0}' cannot be converted to `{1}'",
+ arg.Type.GetSignatureForError (), ((MethodSpec)best).Parameters.ExtensionMethodType.GetSignatureForError ());
+ }
- e.ExtensionExpression = ExtensionExpression;
- e.SetTypeArguments (ec, type_arguments);
- return e.ResolveOverloadExtensions (ec, ref arguments, e.namespace_entry, loc);
- }
- }
+ return true;
+ }
- /// <summary>
- /// MethodGroupExpr represents a group of method candidates which
- /// can be resolved to the best method overload
- /// </summary>
- public class MethodGroupExpr : MemberExpr
- {
- public interface IErrorHandler
+ bool OverloadResolver.IErrorHandler.NoArgumentMatch (ResolveContext rc, MemberSpec best)
{
- bool AmbiguousCall (ResolveContext ec, MethodGroupExpr mg, MethodSpec ambiguous);
- bool NoExactMatch (ResolveContext ec, MethodSpec method);
+ return false;
+ }
+
+ bool OverloadResolver.IErrorHandler.TypeInferenceFailed (ResolveContext rc, MemberSpec best)
+ {
+ return false;
}
- public IErrorHandler CustomErrorHandler;
+ #endregion
+ }
+
+ /// <summary>
+ /// MethodGroupExpr represents a group of method candidates which
+ /// can be resolved to the best method overload
+ /// </summary>
+ public class MethodGroupExpr : MemberExpr, OverloadResolver.IBaseMembersProvider
+ {
protected IList<MemberSpec> Methods;
MethodSpec best_candidate;
- // TODO: make private
- public TypeArguments type_arguments;
+ protected TypeArguments type_arguments;
+
SimpleName simple_name;
- bool has_inaccessible_candidates_only;
- TypeSpec delegate_type;
- TypeSpec queried_type;
+ protected TypeSpec queried_type;
- public MethodGroupExpr (IList<MemberSpec> mi, TypeSpec type, Location l)
- : this (type, l)
+ public MethodGroupExpr (IList<MemberSpec> mi, TypeSpec type, Location loc)
{
Methods = mi;
- }
+ this.loc = loc;
+ this.type = InternalType.MethodGroup;
- public MethodGroupExpr (MethodSpec m, TypeSpec type, Location l)
- : this (type, l)
- {
- Methods = new List<MemberSpec> (1) { m };
+ eclass = ExprClass.MethodGroup;
+ queried_type = type;
}
- public MethodGroupExpr (IList<MemberSpec> mi, TypeSpec type, Location l, bool inacessibleCandidatesOnly)
- : this (mi, type, l)
+ public MethodGroupExpr (MethodSpec m, TypeSpec type, Location loc)
+ : this (new MemberSpec[] { m }, type, loc)
{
- has_inaccessible_candidates_only = inacessibleCandidatesOnly;
- }
-
- protected MethodGroupExpr (TypeSpec type, Location loc)
- {
- this.loc = loc;
- eclass = ExprClass.MethodGroup;
- this.type = InternalType.MethodGroup;
- queried_type = type;
}
#region Properties
}
}
- public override TypeSpec DeclaringType {
+ protected override TypeSpec DeclaringType {
get {
return queried_type;
}
}
- public TypeSpec DelegateType {
- set {
- delegate_type = value;
- }
- }
-
public override bool IsInstance {
get {
if (best_candidate != null)
return Methods.First ().GetSignatureForError ();
}
+ public override Expression CreateExpressionTree (ResolveContext ec)
+ {
+ if (best_candidate == null) {
+ ec.Report.Error (1953, loc, "An expression tree cannot contain an expression with method group");
+ return null;
+ }
+
+ if (best_candidate.IsConditionallyExcluded (loc))
+ ec.Report.Error (765, loc,
+ "Partial methods with only a defining declaration or removed conditional methods cannot be used in an expression tree");
+
+ return new TypeOfMethod (best_candidate, loc);
+ }
+
+ protected override Expression DoResolve (ResolveContext ec)
+ {
+ this.eclass = ExprClass.MethodGroup;
+
+ if (InstanceExpression != null) {
+ InstanceExpression = InstanceExpression.Resolve (ec);
+ if (InstanceExpression == null)
+ return null;
+ }
+
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public void EmitCall (EmitContext ec, Arguments arguments)
+ {
+ Invocation.EmitCall (ec, InstanceExpression, best_candidate, arguments, loc);
+ }
+
+ public override void Error_ValueCannotBeConverted (ResolveContext ec, Location loc, TypeSpec target, bool expl)
+ {
+ ec.Report.Error (428, loc, "Cannot convert method group `{0}' to non-delegate type `{1}'. Consider using parentheses to invoke the method",
+ Name, TypeManager.CSharpName (target));
+ }
+
+ public static bool IsExtensionMethodArgument (Expression expr)
+ {
+ //
+ // LAMESPEC: No details about which expressions are not allowed
+ //
+ return !(expr is BaseThis);
+ }
+
+ /// <summary>
+ /// Find the Applicable Function Members (7.4.2.1)
+ ///
+ /// me: Method Group expression with the members to select.
+ /// it might contain constructors or methods (or anything
+ /// that maps to a method).
+ ///
+ /// Arguments: ArrayList containing resolved Argument objects.
+ ///
+ /// loc: The location if we want an error to be reported, or a Null
+ /// location for "probing" purposes.
+ ///
+ /// Returns: The MethodBase (either a ConstructorInfo or a MethodInfo)
+ /// that is the best match of me on Arguments.
+ ///
+ /// </summary>
+ public virtual MethodGroupExpr OverloadResolve (ResolveContext ec, ref Arguments args, OverloadResolver.IErrorHandler cerrors, OverloadResolver.Restrictions restr)
+ {
+ // TODO: causes issues with probing mode, remove explicit Kind check
+ if (best_candidate != null && best_candidate.Kind == MemberKind.Destructor)
+ return this;
+
+ var r = new OverloadResolver (Methods, type_arguments, restr, loc);
+ if ((restr & OverloadResolver.Restrictions.NoBaseMembers) == 0) {
+ r.BaseMembersProvider = this;
+ }
+
+ if (cerrors != null)
+ r.CustomErrors = cerrors;
+
+ // TODO: When in probing mode do IsApplicable only and when called again do VerifyArguments for full error reporting
+ best_candidate = r.ResolveMember<MethodSpec> (ec, ref args);
+ if (best_candidate == null)
+ return r.BestCandidateIsDynamic ? this : null;
+
+ // Overload resolver had to create a new method group, all checks bellow have already been executed
+ if (r.BestCandidateNewMethodGroup != null)
+ return r.BestCandidateNewMethodGroup;
+
+ if (best_candidate.Kind == MemberKind.Method) {
+ if (InstanceExpression != null) {
+ if (best_candidate.IsExtensionMethod && args[0].Expr == InstanceExpression) {
+ InstanceExpression = null;
+ } else {
+ if (best_candidate.IsStatic && simple_name != null) {
+ InstanceExpression = ProbeIdenticalTypeName (ec, InstanceExpression, simple_name);
+ }
+
+ InstanceExpression.Resolve (ec);
+ }
+ }
+
+ ResolveInstanceExpression (ec);
+ if (InstanceExpression != null)
+ CheckProtectedMemberAccess (ec, best_candidate);
+
+ if (best_candidate.IsGeneric) {
+ ConstraintChecker.CheckAll (ec.MemberContext, best_candidate.GetGenericMethodDefinition (), best_candidate.TypeArguments,
+ best_candidate.Constraints, loc);
+ }
+ }
+
+ best_candidate = CandidateToBaseOverride (ec, best_candidate);
+ return this;
+ }
+
+ public override MemberExpr ResolveMemberAccess (ResolveContext ec, Expression left, SimpleName original)
+ {
+ simple_name = original;
+ return base.ResolveMemberAccess (ec, left, original);
+ }
+
+ public override void SetTypeArguments (ResolveContext ec, TypeArguments ta)
+ {
+ type_arguments = ta;
+ }
+
+ #region IBaseMembersProvider Members
+
+ public virtual IList<MemberSpec> GetBaseMembers (TypeSpec baseType)
+ {
+ return baseType == null ? null : MemberCache.FindMembers (baseType, Methods [0].Name, false);
+ }
+
+ //
+ // Extension methods lookup after ordinary methods candidates failed to apply
+ //
+ public virtual MethodGroupExpr LookupExtensionMethod (ResolveContext rc)
+ {
+ if (InstanceExpression == null)
+ return null;
+
+ InstanceExpression = InstanceExpression.Resolve (rc);
+ if (!IsExtensionMethodArgument (InstanceExpression))
+ return null;
+
+ int arity = type_arguments == null ? 0 : type_arguments.Count;
+ NamespaceEntry methods_scope = null;
+ var methods = rc.LookupExtensionMethod (InstanceExpression.Type, Methods[0].Name, arity, ref methods_scope);
+ if (methods == null)
+ return null;
+
+ var emg = new ExtensionMethodGroupExpr (methods, methods_scope, InstanceExpression, loc);
+ emg.SetTypeArguments (rc, type_arguments);
+ return emg;
+ }
+
+ #endregion
+ }
+
+ public struct OverloadResolver
+ {
+ [Flags]
+ public enum Restrictions
+ {
+ None = 0,
+ DelegateInvoke = 1,
+ ProbingOnly = 1 << 1,
+ Covariant = 1 << 2,
+ NoBaseMembers = 1 << 3
+ }
+
+ public interface IBaseMembersProvider
+ {
+ IList<MemberSpec> GetBaseMembers (TypeSpec baseType);
+ MethodGroupExpr LookupExtensionMethod (ResolveContext rc);
+ }
+
+ public interface IErrorHandler
+ {
+ bool AmbiguousCandidates (ResolveContext rc, MemberSpec best, MemberSpec ambiguous);
+ bool ArgumentMismatch (ResolveContext rc, MemberSpec best, Argument a, int index);
+ bool NoArgumentMatch (ResolveContext rc, MemberSpec best);
+ bool TypeInferenceFailed (ResolveContext rc, MemberSpec best);
+ }
+
+ sealed class NoBaseMembers : IBaseMembersProvider
+ {
+ public static readonly IBaseMembersProvider Instance = new NoBaseMembers ();
+
+ public IList<MemberSpec> GetBaseMembers (TypeSpec baseType)
+ {
+ return null;
+ }
+
+ public MethodGroupExpr LookupExtensionMethod (ResolveContext rc)
+ {
+ return null;
+ }
+ }
+
+ struct AmbiguousCandidate
+ {
+ public readonly MemberSpec Member;
+ public readonly bool Expanded;
+
+ public AmbiguousCandidate (MemberSpec member, bool expanded)
+ {
+ Member = member;
+ Expanded = expanded;
+ }
+ }
+
+ Location loc;
+ IList<MemberSpec> members;
+ TypeArguments type_arguments;
+ IBaseMembersProvider base_provider;
+ IErrorHandler custom_errors;
+ Restrictions restrictions;
+ MethodGroupExpr best_candidate_extension_group;
+
+ SessionReportPrinter lambda_conv_msgs;
+ ReportPrinter prev_recorder;
+
+ public OverloadResolver (IList<MemberSpec> members, Restrictions restrictions, Location loc)
+ : this (members, null, restrictions, loc)
+ {
+ }
+
+ public OverloadResolver (IList<MemberSpec> members, TypeArguments targs, Restrictions restrictions, Location loc)
+ : this ()
+ {
+ if (members == null || members.Count == 0)
+ throw new ArgumentException ("empty members set");
+
+ this.members = members;
+ this.loc = loc;
+ type_arguments = targs;
+ this.restrictions = restrictions;
+ if (IsDelegateInvoke)
+ this.restrictions |= Restrictions.NoBaseMembers;
+
+ base_provider = NoBaseMembers.Instance;
+ }
+
+ #region Properties
+
+ public IBaseMembersProvider BaseMembersProvider {
+ get {
+ return base_provider;
+ }
+ set {
+ base_provider = value;
+ }
+ }
+
+ public bool BestCandidateIsDynamic { get; set; }
+
+ //
+ // Best candidate was found in newly created MethodGroupExpr, used by extension methods
+ //
+ public MethodGroupExpr BestCandidateNewMethodGroup {
+ get {
+ return best_candidate_extension_group;
+ }
+ }
+
+ public IErrorHandler CustomErrors {
+ get {
+ return custom_errors;
+ }
+ set {
+ custom_errors = value;
+ }
+ }
+
+ TypeSpec DelegateType {
+ get {
+ if ((restrictions & Restrictions.DelegateInvoke) == 0)
+ throw new InternalErrorException ("Not running in delegate mode", loc);
+
+ return members [0].DeclaringType;
+ }
+ }
+
+ bool IsProbingOnly {
+ get {
+ return (restrictions & Restrictions.ProbingOnly) != 0;
+ }
+ }
+
+ bool IsDelegateInvoke {
+ get {
+ return (restrictions & Restrictions.DelegateInvoke) != 0;
+ }
+ }
+
+ #endregion
+
//
// 7.4.3.3 Better conversion from expression
// Returns : 1 if a->p is better,
// Uwrap delegate from Expression<T>
//
if (p.GetDefinition () == TypeManager.expression_type) {
- p = TypeManager.GetTypeArguments (p) [0];
+ p = TypeManager.GetTypeArguments (p)[0];
}
if (q.GetDefinition () == TypeManager.expression_type) {
- q = TypeManager.GetTypeArguments (q) [0];
+ q = TypeManager.GetTypeArguments (q)[0];
}
-
+
p = Delegate.GetInvokeMethod (ec.Compiler, p).ReturnType;
q = Delegate.GetInvokeMethod (ec.Compiler, q).ReturnType;
if (p == TypeManager.void_type && q != TypeManager.void_type)
/// false if candidate ain't better
/// true if candidate is better than the current best match
/// </remarks>
- static bool BetterFunction (ResolveContext ec, Arguments args, int argument_count,
- MethodSpec candidate, bool candidate_params,
- MethodSpec best, bool best_params)
+ static bool BetterFunction (ResolveContext ec, Arguments args, MemberSpec candidate, bool candidate_params,
+ MemberSpec best, bool best_params)
{
- AParametersCollection candidate_pd = candidate.Parameters;
- AParametersCollection best_pd = best.Parameters;
-
+ AParametersCollection candidate_pd = ((IParametersMember) candidate).Parameters;
+ AParametersCollection best_pd = ((IParametersMember) best).Parameters;
+
bool better_at_least_one = false;
bool same = true;
- for (int j = 0, c_idx = 0, b_idx = 0; j < argument_count; ++j, ++c_idx, ++b_idx)
- {
- Argument a = args [j];
+ int args_count = args == null ? 0 : args.Count;
+ for (int j = 0, c_idx = 0, b_idx = 0; j < args_count; ++j, ++c_idx, ++b_idx) {
+ Argument a = args[j];
// Provided default argument value is never better
if (a.IsDefaultArgument && candidate_params == best_params)
return false;
- TypeSpec ct = candidate_pd.Types [c_idx];
- TypeSpec bt = best_pd.Types [b_idx];
+ TypeSpec ct = candidate_pd.Types[c_idx];
+ TypeSpec bt = best_pd.Types[b_idx];
- if (candidate_params && candidate_pd.FixedParameters [c_idx].ModFlags == Parameter.Modifier.PARAMS)
- {
+ if (candidate_params && candidate_pd.FixedParameters[c_idx].ModFlags == Parameter.Modifier.PARAMS) {
ct = TypeManager.GetElementType (ct);
--c_idx;
}
- if (best_params && best_pd.FixedParameters [b_idx].ModFlags == Parameter.Modifier.PARAMS)
- {
+ if (best_params && best_pd.FixedParameters[b_idx].ModFlags == Parameter.Modifier.PARAMS) {
bt = TypeManager.GetElementType (bt);
--b_idx;
}
-
+
if (TypeManager.IsEqual (ct, bt))
continue;
var best_def_pd = ((IParametersMember) best.MemberDefinition).Parameters;
bool specific_at_least_once = false;
- for (int j = 0; j < candidate_param_count; ++j)
- {
- var ct = candidate_def_pd.Types [j];
- var bt = best_def_pd.Types [j];
+ for (int j = 0; j < candidate_param_count; ++j) {
+ var ct = candidate_def_pd.Types[j];
+ var bt = best_def_pd.Types[j];
if (ct == bt)
continue;
TypeSpec specific = MoreSpecific (ct, bt);
return false;
}
- public override MemberExpr ResolveMemberAccess (ResolveContext ec, Expression left, SimpleName original)
+ public static void Error_ConstructorMismatch (ResolveContext rc, TypeSpec type, int argCount, Location loc)
{
- simple_name = original;
-
- return base.ResolveMemberAccess (ec, left, original);
+ rc.Report.Error (1729, loc,
+ "The type `{0}' does not contain a constructor that takes `{1}' arguments",
+ type.GetSignatureForError (), argCount.ToString ());
}
- public override Expression CreateExpressionTree (ResolveContext ec)
+ ///
+ /// Determines if the candidate method is applicable (section 14.4.2.1)
+ /// to the given set of arguments
+ /// A return value rates candidate method compatibility,
+ /// 0 = the best, int.MaxValue = the worst
+ ///
+ int IsApplicable (ResolveContext ec, ref Arguments arguments, int arg_count, ref MemberSpec candidate, ref bool params_expanded_form)
{
- if (best_candidate == null) {
- ec.Report.Error (1953, loc, "An expression tree cannot contain an expression with method group");
- return null;
- }
-
- if (best_candidate.IsConditionallyExcluded (loc))
- ec.Report.Error (765, loc,
- "Partial methods with only a defining declaration or removed conditional methods cannot be used in an expression tree");
-
- return new TypeOfMethod (best_candidate, loc);
- }
-
- protected override Expression DoResolve (ResolveContext ec)
- {
- this.eclass = ExprClass.MethodGroup;
-
- if (InstanceExpression != null) {
- InstanceExpression = InstanceExpression.Resolve (ec);
- if (InstanceExpression == null)
- return null;
- }
-
- return this;
- }
-
- public void ReportUsageError (ResolveContext ec)
- {
- ec.Report.Error (654, loc, "Method `" + DeclaringType + "." +
- Name + "()' is referenced without parentheses");
- }
-
- override public void Emit (EmitContext ec)
- {
- throw new NotSupportedException ();
- }
-
- public void EmitCall (EmitContext ec, Arguments arguments)
- {
- Invocation.EmitCall (ec, InstanceExpression, best_candidate, arguments, loc);
- }
-
- void Error_AmbiguousCall (ResolveContext ec, MethodSpec ambiguous)
- {
- if (CustomErrorHandler != null && CustomErrorHandler.AmbiguousCall (ec, this, ambiguous))
- return;
-
- ec.Report.SymbolRelatedToPreviousError (best_candidate);
- ec.Report.Error (121, loc, "The call is ambiguous between the following methods or properties: `{0}' and `{1}'",
- best_candidate.GetSignatureForError (), ambiguous.GetSignatureForError ());
- }
-
- protected virtual void Error_InvalidArguments (ResolveContext ec, Location loc, int idx, MethodSpec method,
- Argument a, AParametersCollection expected_par, TypeSpec paramType)
- {
- ExtensionMethodGroupExpr emg = this as ExtensionMethodGroupExpr;
-
- if (a is CollectionElementInitializer.ElementInitializerArgument) {
- ec.Report.SymbolRelatedToPreviousError (method);
- if ((expected_par.FixedParameters [idx].ModFlags & Parameter.Modifier.ISBYREF) != 0) {
- ec.Report.Error (1954, loc, "The best overloaded collection initalizer method `{0}' cannot have 'ref', or `out' modifier",
- TypeManager.CSharpSignature (method));
- return;
- }
- ec.Report.Error (1950, loc, "The best overloaded collection initalizer method `{0}' has some invalid arguments",
- TypeManager.CSharpSignature (method));
- } else if (TypeManager.IsDelegateType (method.DeclaringType)) {
- ec.Report.Error (1594, loc, "Delegate `{0}' has some invalid arguments",
- TypeManager.CSharpName (method.DeclaringType));
- } else {
- ec.Report.SymbolRelatedToPreviousError (method);
- if (emg != null) {
- ec.Report.Error (1928, loc,
- "Type `{0}' does not contain a member `{1}' and the best extension method overload `{2}' has some invalid arguments",
- emg.ExtensionExpression.GetSignatureForError (),
- emg.Name, TypeManager.CSharpSignature (method));
- } else {
- ec.Report.Error (1502, loc, "The best overloaded method match for `{0}' has some invalid arguments",
- TypeManager.CSharpSignature (method));
- }
- }
-
- Parameter.Modifier mod = idx >= expected_par.Count ? 0 : expected_par.FixedParameters [idx].ModFlags;
-
- string index = (idx + 1).ToString ();
- if (((mod & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) ^
- (a.Modifier & (Parameter.Modifier.REF | Parameter.Modifier.OUT))) != 0) {
- if ((mod & Parameter.Modifier.ISBYREF) == 0)
- ec.Report.Error (1615, loc, "Argument `#{0}' does not require `{1}' modifier. Consider removing `{1}' modifier",
- index, Parameter.GetModifierSignature (a.Modifier));
- else
- ec.Report.Error (1620, loc, "Argument `#{0}' is missing `{1}' modifier",
- index, Parameter.GetModifierSignature (mod));
- } else {
- string p1 = a.GetSignatureForError ();
- string p2 = TypeManager.CSharpName (paramType);
-
- if (p1 == p2) {
- ec.Report.ExtraInformation (loc, "(equally named types possibly from different assemblies in previous ");
- ec.Report.SymbolRelatedToPreviousError (a.Expr.Type);
- ec.Report.SymbolRelatedToPreviousError (paramType);
- }
-
- if (idx == 0 && emg != null) {
- ec.Report.Error (1929, loc,
- "Extension method instance type `{0}' cannot be converted to `{1}'", p1, p2);
- } else {
- ec.Report.Error (1503, loc,
- "Argument `#{0}' cannot convert `{1}' expression to type `{2}'", index, p1, p2);
- }
- }
- }
-
- public override void Error_ValueCannotBeConverted (ResolveContext ec, Location loc, TypeSpec target, bool expl)
- {
- ec.Report.Error (428, loc, "Cannot convert method group `{0}' to non-delegate type `{1}'. Consider using parentheses to invoke the method",
- Name, TypeManager.CSharpName (target));
- }
-
- void Error_ArgumentCountWrong (ResolveContext ec, int arg_count)
- {
- ec.Report.Error (1501, loc, "No overload for method `{0}' takes `{1}' arguments",
- Name, arg_count.ToString ());
- }
-
- protected virtual int GetApplicableParametersCount (MethodSpec method, AParametersCollection parameters)
- {
- return parameters.Count;
- }
-
- protected virtual IList<MemberSpec> GetBaseTypeMethods (ResolveContext rc, TypeSpec type)
- {
- var arity = type_arguments == null ? -1 : type_arguments.Count;
-
- return TypeManager.MemberLookup (rc.CurrentType, null, type,
- MemberKind.Method, BindingRestriction.AccessibleOnly | BindingRestriction.DefaultMemberLookup,
- Name, arity, null);
- }
-
- bool GetBaseTypeMethods (ResolveContext rc)
- {
- var base_type = Methods [0].DeclaringType.BaseType;
- if (base_type == null)
- return false;
-
- var methods = GetBaseTypeMethods (rc, base_type);
- if (methods == null)
- return false;
-
- Methods = methods;
- return true;
- }
-
- ///
- /// Determines if the candidate method is applicable (section 14.4.2.1)
- /// to the given set of arguments
- /// A return value rates candidate method compatibility,
- /// 0 = the best, int.MaxValue = the worst
- ///
- public int IsApplicable (ResolveContext ec,
- ref Arguments arguments, int arg_count, ref MethodSpec method, ref bool params_expanded_form)
- {
- var candidate = method;
-
- AParametersCollection pd = candidate.Parameters;
- int param_count = GetApplicableParametersCount (candidate, pd);
- int optional_count = 0;
+ AParametersCollection pd = ((IParametersMember) candidate).Parameters;
+ int param_count = pd.Count;
+ int optional_count = 0;
if (arg_count != param_count) {
for (int i = 0; i < pd.Count; ++i) {
- if (pd.FixedParameters [i].HasDefaultValue) {
+ if (pd.FixedParameters[i].HasDefaultValue) {
optional_count = pd.Count - i;
break;
}
//
// Shuffle named arguments to the right positions if there are any
//
- if (arguments [arg_count - 1] is NamedArgument) {
+ if (arguments[arg_count - 1] is NamedArgument) {
arg_count = arguments.Count;
for (int i = 0; i < arg_count; ++i) {
//
// 1. Handle generic method using type arguments when specified or type inference
//
- if (candidate.IsGeneric) {
+ var ms = candidate as MethodSpec;
+ if (ms != null && ms.IsGeneric) {
if (type_arguments != null) {
- var g_args_count = candidate.Arity;
+ var g_args_count = ms.Arity;
if (g_args_count != type_arguments.Count)
return int.MaxValue - 20000 + System.Math.Abs (type_arguments.Count - g_args_count);
- method = candidate.MakeGenericMethod (type_arguments.Arguments);
- candidate = method;
- pd = candidate.Parameters;
+ candidate = ms = ms.MakeGenericMethod (type_arguments.Arguments);
+ pd = ms.Parameters;
} else {
- int score = TypeManager.InferTypeArguments (ec, arguments, ref candidate);
+ // TODO: It should not be here (we don't know yet whether any argument is lambda) but
+ // for now it simplifies things. I should probably add a callback to ResolveContext
+ if (lambda_conv_msgs == null) {
+ lambda_conv_msgs = new SessionReportPrinter ();
+ prev_recorder = ec.Report.SetPrinter (lambda_conv_msgs);
+ }
+
+ int score = TypeManager.InferTypeArguments (ec, arguments, ref ms);
+ lambda_conv_msgs.EndSession ();
+
if (score != 0)
return score - 20000;
- pd = candidate.Parameters;
+ candidate = ms;
+ pd = ms.Parameters;
}
} else {
if (type_arguments != null)
//
// 2. Each argument has to be implicitly convertible to method parameter
//
- method = candidate;
Parameter.Modifier p_mod = 0;
TypeSpec pt = null;
for (int i = 0; i < arg_count; i++) {
- Argument a = arguments [i];
+ Argument a = arguments[i];
if (a == null) {
- if (!pd.FixedParameters [i].HasDefaultValue)
+ if (!pd.FixedParameters[i].HasDefaultValue)
throw new InternalErrorException ();
- Expression e = pd.FixedParameters [i].DefaultValue as Constant;
+ Expression e = pd.FixedParameters[i].DefaultValue as Constant;
if (e == null)
- e = new DefaultValueExpression (new TypeExpression (pd.Types [i], loc), loc).Resolve (ec);
+ e = new DefaultValueExpression (new TypeExpression (pd.Types[i], loc), loc).Resolve (ec);
- arguments [i] = new Argument (e, Argument.AType.Default);
+ arguments[i] = new Argument (e, Argument.AType.Default);
continue;
}
if (p_mod != Parameter.Modifier.PARAMS) {
- p_mod = pd.FixedParameters [i].ModFlags & ~(Parameter.Modifier.OUTMASK | Parameter.Modifier.REFMASK);
- pt = pd.Types [i];
+ p_mod = pd.FixedParameters[i].ModFlags & ~(Parameter.Modifier.OUTMASK | Parameter.Modifier.REFMASK);
+ pt = pd.Types[i];
} else {
params_expanded_form = true;
}
if (!params_expanded_form)
score = IsArgumentCompatible (ec, a_mod, a, p_mod & ~Parameter.Modifier.PARAMS, pt);
- if (score != 0 && (p_mod & Parameter.Modifier.PARAMS) != 0 && delegate_type == null) {
- // It can be applicable in expanded form
+ //
+ // It can be applicable in expanded form (when not doing exact match like for delegates)
+ //
+ if (score != 0 && (p_mod & Parameter.Modifier.PARAMS) != 0 && (restrictions & Restrictions.Covariant) == 0) {
score = IsArgumentCompatible (ec, a_mod, a, 0, TypeManager.GetElementType (pt));
if (score == 0)
params_expanded_form = true;
return (arg_count - i) * 2 + score;
}
}
-
+
if (arg_count != param_count)
- params_expanded_form = true;
-
+ params_expanded_form = true;
+
return 0;
}
//
// Types have to be identical when ref or out modifer is used
//
- if (arg_mod != 0 || param_mod != 0) {
+ if ((arg_mod | param_mod) != 0) {
if (argument.Type != parameter) {
if (argument.Type == InternalType.Dynamic)
return 0;
return 2;
}
} else {
+ //
+ // Deploy custom error reporting for lambda methods. When probing lambda methods
+ // keep all errors reported in separate set and once we are done and no best
+ // candidate found, this set is used to report more details about what was wrong
+ // with lambda body
+ //
+ if (argument.Expr.Type == InternalType.AnonymousMethod) {
+ if (lambda_conv_msgs == null) {
+ lambda_conv_msgs = new SessionReportPrinter ();
+ prev_recorder = ec.Report.SetPrinter (lambda_conv_msgs);
+ }
+ }
+
if (!Convert.ImplicitConversionExists (ec, argument.Expr, parameter)) {
+ if (lambda_conv_msgs != null) {
+ lambda_conv_msgs.EndSession ();
+ }
+
if (argument.Type == InternalType.Dynamic)
return 0;
var ac_p = p as ArrayContainer;
if (ac_p != null) {
var ac_q = ((ArrayContainer) q);
- TypeSpec specific = MoreSpecific (ac_p.Element, (ac_q.Element));
+ TypeSpec specific = MoreSpecific (ac_p.Element, ac_q.Element);
if (specific == ac_p.Element)
return p;
if (specific == ac_q.Element)
return null;
}
- /// <summary>
- /// Find the Applicable Function Members (7.4.2.1)
- ///
- /// me: Method Group expression with the members to select.
- /// it might contain constructors or methods (or anything
- /// that maps to a method).
- ///
- /// Arguments: ArrayList containing resolved Argument objects.
- ///
- /// loc: The location if we want an error to be reported, or a Null
- /// location for "probing" purposes.
- ///
- /// Returns: The MethodBase (either a ConstructorInfo or a MethodInfo)
- /// that is the best match of me on Arguments.
- ///
- /// </summary>
- public virtual MethodGroupExpr OverloadResolve (ResolveContext ec, ref Arguments Arguments,
- bool may_fail, Location loc)
+ //
+ // Find the best method from candidate list
+ //
+ public T ResolveMember<T> (ResolveContext rc, ref Arguments args) where T : MemberSpec, IParametersMember
{
- // TODO: causes some issues with linq
- //if (best_candidate != null)
- // return this;
+ List<AmbiguousCandidate> ambiguous_candidates = null;
- var candidates = new List<MethodSpec> (2);
- List<MethodSpec> params_candidates = null;
+ MemberSpec best_candidate;
+ Arguments best_candidate_args = null;
+ bool best_candidate_params = false;
+ int best_candidate_rate;
- int arg_count = Arguments != null ? Arguments.Count : 0;
- Dictionary<MethodSpec, Arguments> candidates_expanded = null;
- Arguments candidate_args = Arguments;
+ int args_count = args != null ? args.Count : 0;
+ Arguments candidate_args = args;
+ bool error_mode = false;
+ var current_type = rc.CurrentType;
+ MemberSpec invocable_member = null;
- if (RootContext.Version == LanguageVersion.ISO_1 && Name == "Invoke" && TypeManager.IsDelegateType (DeclaringType)) {
- if (!may_fail)
- ec.Report.Error (1533, loc, "Invoke cannot be called directly on a delegate");
- return null;
- }
+ // Be careful, cannot return until error reporter is restored
+ while (true) {
+ best_candidate = null;
+ best_candidate_rate = int.MaxValue;
+
+ var type_members = members;
- //
- // Enable message recording, it's used mainly by lambda expressions
- //
- var msg_recorder = new SessionReportPrinter ();
- var prev_recorder = ec.Report.SetPrinter (msg_recorder);
- try {
do {
- //
- // Methods in a base class are not candidates if any method in a derived
- // class is applicable
- //
- int best_candidate_rate = int.MaxValue;
-
- foreach (var member in Methods) {
- var m = member as MethodSpec;
- if (m == null) {
- // TODO: It's wrong when non-member is before applicable method
- // TODO: Should report only when at least 1 from the batch is applicable
- if (candidates.Count != 0) {
- ec.Report.SymbolRelatedToPreviousError (candidates[0]);
- ec.Report.SymbolRelatedToPreviousError (member);
- ec.Report.Warning (467, 2, loc, "Ambiguity between method `{0}' and non-method `{1}'. Using method `{0}'",
- candidates[0].GetSignatureForError (), member.GetSignatureForError ());
- }
+ for (int i = 0; i < type_members.Count; ++i) {
+ var member = type_members [i];
+
+ //
+ // Methods in a base class are not candidates if any method in a derived
+ // class is applicable
+ //
+ if ((member.Modifiers & Modifiers.OVERRIDE) != 0)
+ continue;
+
+ if (!member.IsAccessible (current_type) && !error_mode)
+ continue;
+
+ if (!(member is IParametersMember)) {
+ //
+ // Will use it later to report ambiguity between best method and invocable member
+ //
+ if (Invocation.IsMemberInvocable (member))
+ invocable_member = member;
+
continue;
}
//
- // Check if candidate is applicable (section 14.4.2.1)
+ // Check if candidate is applicable
//
bool params_expanded_form = false;
- int candidate_rate = IsApplicable (ec, ref candidate_args, arg_count, ref m, ref params_expanded_form);
+ int candidate_rate = IsApplicable (rc, ref candidate_args, args_count, ref member, ref params_expanded_form);
+ //
+ // How does it score compare to others
+ //
if (candidate_rate < best_candidate_rate) {
best_candidate_rate = candidate_rate;
- best_candidate = m;
- }
+ best_candidate = member;
+ best_candidate_args = candidate_args;
+ best_candidate_params = params_expanded_form;
+ } else if (candidate_rate == 0) {
+ // Is new candidate better
+ if (BetterFunction (rc, candidate_args, member, params_expanded_form, best_candidate, best_candidate_params)) {
+ best_candidate = member;
+ best_candidate_args = candidate_args;
+ best_candidate_params = params_expanded_form;
+ } else {
+ // It's not better but any other found later could be but we are not sure yet
+ if (ambiguous_candidates == null)
+ ambiguous_candidates = new List<AmbiguousCandidate> ();
- if (params_expanded_form) {
- if (params_candidates == null)
- params_candidates = new List<MethodSpec> (2);
- params_candidates.Add (m);
+ ambiguous_candidates.Add (new AmbiguousCandidate (member, params_expanded_form));
+ }
}
- if (candidate_args != Arguments) {
- if (candidates_expanded == null)
- candidates_expanded = new Dictionary<MethodSpec, Arguments> (2);
-
- candidates_expanded.Add (m, candidate_args);
- candidate_args = Arguments;
- }
+ // Restore expanded arguments
+ if (candidate_args != args)
+ candidate_args = args;
+ }
+ } while (best_candidate_rate != 0 && (type_members = base_provider.GetBaseMembers (type_members[0].DeclaringType.BaseType)) != null);
- if (candidate_rate != 0 || has_inaccessible_candidates_only) {
- if (msg_recorder != null)
- msg_recorder.EndSession ();
- continue;
- }
+ if (prev_recorder != null)
+ rc.Report.SetPrinter (prev_recorder);
- msg_recorder = null;
- candidates.Add (m);
- }
- } while (candidates.Count == 0 && GetBaseTypeMethods (ec));
- } finally {
- ec.Report.SetPrinter (prev_recorder);
- }
+ //
+ // We've found exact match
+ //
+ if (best_candidate_rate == 0)
+ break;
- int candidate_top = candidates.Count;
- if (candidate_top == 0) {
//
- // When we found a top level method which does not match and it's
- // not an extension method. We start extension methods lookup from here
+ // Try extension methods lookup when no ordinary method match was found and provider enables it
//
- if (InstanceExpression != null) {
- var first = Methods.First ();
- var arity = type_arguments == null ? -1 : type_arguments.Count;
- ExtensionMethodGroupExpr ex_method_lookup = ec.LookupExtensionMethod (type, first.Name, arity, loc);
- if (ex_method_lookup != null) {
- ex_method_lookup.ExtensionExpression = InstanceExpression.Resolve (ec);
- ex_method_lookup.SetTypeArguments (ec, type_arguments);
- var emg = ex_method_lookup.OverloadResolve (ec, ref Arguments, may_fail, loc);
- if (emg != null)
- return emg;
+ if (!error_mode) {
+ var emg = base_provider.LookupExtensionMethod (rc);
+ if (emg != null) {
+ emg = emg.OverloadResolve (rc, ref args, null, restrictions);
+ if (emg != null) {
+ best_candidate_extension_group = emg;
+ return (T) (MemberSpec) emg.BestCandidate;
+ }
}
}
- if (msg_recorder != null && !msg_recorder.IsEmpty) {
- if (!may_fail)
- msg_recorder.Merge (prev_recorder);
-
- return null;
- }
-
- if (may_fail)
+ // Don't run expensive error reporting mode for probing
+ if (IsProbingOnly)
return null;
- //
- // Okay so we have failed to find exact match so we
- // return error info about the closest match
- //
- if (best_candidate != null) {
- if (CustomErrorHandler != null && !has_inaccessible_candidates_only && CustomErrorHandler.NoExactMatch (ec, best_candidate))
- return null;
-
- bool params_expanded = params_candidates != null && params_candidates.Contains (best_candidate);
- if (NoExactMatch (ec, ref Arguments, params_expanded))
- return null;
- }
-
- //
- // We failed to find any method with correct argument count
- //
- if (Methods.First ().Kind == MemberKind.Constructor) {
- ec.Report.SymbolRelatedToPreviousError (queried_type);
- ec.Report.Error (1729, loc,
- "The type `{0}' does not contain a constructor that takes `{1}' arguments",
- TypeManager.CSharpName (queried_type), arg_count.ToString ());
- } else {
- Error_ArgumentCountWrong (ec, arg_count);
- }
-
- return null;
- }
+ if (error_mode)
+ break;
- if (arg_count != 0 && Arguments.HasDynamic) {
- best_candidate = null;
- return this;
+ lambda_conv_msgs = null;
+ error_mode = true;
}
//
- // Now we actually find the best method
+ // No best member match found, report an error
//
- best_candidate = candidates [0];
- bool method_params = params_candidates != null && params_candidates.Contains (best_candidate);
-
- for (int ix = 1; ix < candidate_top; ix++) {
- var candidate = candidates [ix];
-
- if (candidate == best_candidate)
- continue;
-
- bool cand_params = params_candidates != null && params_candidates.Contains (candidate);
-
- if (candidates_expanded != null && candidates_expanded.ContainsKey (candidate)) {
- candidate_args = candidates_expanded[candidate];
- arg_count = candidate_args.Count;
- }
-
- if (BetterFunction (ec, candidate_args, arg_count,
- candidate, cand_params,
- best_candidate, method_params)) {
- best_candidate = candidate;
- method_params = cand_params;
- }
-
- if (candidate_args != Arguments) {
- candidate_args = Arguments;
- arg_count = candidate_args != null ? candidate_args.Count : 0;
- }
+ if (best_candidate_rate != 0 || error_mode) {
+ ReportOverloadError (rc, best_candidate, best_candidate_args, best_candidate_params);
+ return null;
}
- if (candidates_expanded != null && candidates_expanded.ContainsKey (best_candidate)) {
- candidate_args = candidates_expanded[best_candidate];
- arg_count = candidate_args.Count;
+ // TODO: quite slow
+ if (args_count != 0 && args.HasDynamic) {
+ BestCandidateIsDynamic = true;
+ return null;
}
- //
- // Now check that there are no ambiguities i.e the selected method
- // should be better than all the others
- //
- MethodSpec ambiguous = null;
- for (int ix = 1; ix < candidate_top; ix++) {
- var candidate = candidates [ix];
-
- if (candidate == best_candidate)
- continue;
+ if (ambiguous_candidates != null) {
+ //
+ // Now check that there are no ambiguities i.e the selected method
+ // should be better than all the others
+ //
+ for (int ix = 0; ix < ambiguous_candidates.Count; ix++) {
+ var candidate = ambiguous_candidates [ix];
+
+ if (!BetterFunction (rc, candidate_args, best_candidate, best_candidate_params, candidate.Member, candidate.Expanded)) {
+ var ambiguous = candidate.Member;
+ if (custom_errors == null || !custom_errors.AmbiguousCandidates (rc, best_candidate, ambiguous)) {
+ rc.Report.SymbolRelatedToPreviousError (best_candidate);
+ rc.Report.SymbolRelatedToPreviousError (ambiguous);
+ rc.Report.Error (121, loc, "The call is ambiguous between the following methods or properties: `{0}' and `{1}'",
+ best_candidate.GetSignatureForError (), ambiguous.GetSignatureForError ());
+ }
- bool cand_params = params_candidates != null && params_candidates.Contains (candidate);
- if (!BetterFunction (ec, candidate_args, arg_count,
- best_candidate, method_params,
- candidate, cand_params))
- {
- if (!may_fail)
- ec.Report.SymbolRelatedToPreviousError (candidate);
- ambiguous = candidate;
+ return (T) best_candidate;
+ }
}
}
- if (ambiguous != null) {
- Error_AmbiguousCall (ec, ambiguous);
- return this;
+ if (invocable_member != null) {
+ rc.Report.SymbolRelatedToPreviousError (best_candidate);
+ rc.Report.SymbolRelatedToPreviousError (invocable_member);
+ rc.Report.Warning (467, 2, loc, "Ambiguity between method `{0}' and invocable non-method `{1}'. Using method group",
+ best_candidate.GetSignatureForError (), invocable_member.GetSignatureForError ());
}
- best_candidate = CandidateToBaseOverride (ec, best_candidate);
-
//
// And now check if the arguments are all
// compatible, perform conversions if
// necessary etc. and return if everything is
// all right
//
- if (!VerifyArgumentsCompat (ec, ref candidate_args, arg_count, best_candidate,
- method_params, may_fail, loc))
+ if (!VerifyArguments (rc, ref best_candidate_args, best_candidate, best_candidate_params))
return null;
if (best_candidate == null)
return null;
- if (best_candidate.Kind == MemberKind.Method) {
- if (InstanceExpression != null) {
- if (best_candidate.IsStatic && simple_name != null) {
- InstanceExpression = ProbeIdenticalTypeName (ec, InstanceExpression, simple_name);
- }
-
- InstanceExpression.Resolve (ec);
- }
-
- ResolveInstanceExpression (ec);
- }
-
- if (best_candidate.IsGeneric) {
- ConstraintChecker.CheckAll (ec, best_candidate.GetGenericMethodDefinition (), best_candidate.TypeArguments,
- best_candidate.Constraints, loc);
- }
-
//
// Check ObsoleteAttribute on the best method
//
ObsoleteAttribute oa = best_candidate.GetAttributeObsolete ();
- if (oa != null && !ec.IsObsolete)
- AttributeTester.Report_ObsoleteMessage (oa, GetSignatureForError (), loc, ec.Report);
+ if (oa != null && !rc.IsObsolete)
+ AttributeTester.Report_ObsoleteMessage (oa, best_candidate.GetSignatureForError (), loc, rc.Report);
best_candidate.MemberDefinition.SetIsUsed ();
- Arguments = candidate_args;
- return this;
+ args = best_candidate_args;
+ return (T) best_candidate;
}
- bool NoExactMatch (ResolveContext ec, ref Arguments Arguments, bool params_expanded)
+ public MethodSpec ResolveOperator (ResolveContext rc, ref Arguments args)
{
- AParametersCollection pd = best_candidate.Parameters;
- int arg_count = Arguments == null ? 0 : Arguments.Count;
+ return ResolveMember<MethodSpec> (rc, ref args);
+ }
- if (arg_count == pd.Count || pd.HasParams) {
- if (best_candidate.IsGeneric) {
- if (type_arguments == null) {
- ec.Report.Error (411, loc,
- "The type arguments for method `{0}' cannot be inferred from the usage. Try specifying the type arguments explicitly",
- best_candidate.GetGenericMethodDefinition().GetSignatureForError ());
- return true;
- }
- }
+ void ReportArgumentMismatch (ResolveContext ec, int idx, MemberSpec method,
+ Argument a, AParametersCollection expected_par, TypeSpec paramType)
+ {
+ if (custom_errors != null && custom_errors.ArgumentMismatch (ec, method, a, idx))
+ return;
- var ta = type_arguments == null ? 0 : type_arguments.Count;
- if (ta != best_candidate.Arity) {
- Error_TypeArgumentsCannotBeUsed (ec.Report, loc, best_candidate, type_arguments.Count);
- return true;
+ if (a is CollectionElementInitializer.ElementInitializerArgument) {
+ ec.Report.SymbolRelatedToPreviousError (method);
+ if ((expected_par.FixedParameters[idx].ModFlags & Parameter.Modifier.ISBYREF) != 0) {
+ ec.Report.Error (1954, loc, "The best overloaded collection initalizer method `{0}' cannot have 'ref', or `out' modifier",
+ TypeManager.CSharpSignature (method));
+ return;
}
+ ec.Report.Error (1950, loc, "The best overloaded collection initalizer method `{0}' has some invalid arguments",
+ TypeManager.CSharpSignature (method));
+ } else if (IsDelegateInvoke) {
+ ec.Report.Error (1594, loc, "Delegate `{0}' has some invalid arguments",
+ DelegateType.GetSignatureForError ());
+ } else {
+ ec.Report.SymbolRelatedToPreviousError (method);
+ ec.Report.Error (1502, loc, "The best overloaded method match for `{0}' has some invalid arguments",
+ method.GetSignatureForError ());
+ }
- if (has_inaccessible_candidates_only) {
- if (InstanceExpression != null && type != ec.CurrentType && TypeManager.IsNestedFamilyAccessible (ec.CurrentType, best_candidate.DeclaringType)) {
- // Although a derived class can access protected members of
- // its base class it cannot do so through an instance of the
- // base class (CS1540). If the qualifier_type is a base of the
- // ec.CurrentType and the lookup succeeds with the latter one,
- // then we are in this situation.
- Error_CannotAccessProtected (ec, loc, best_candidate, queried_type, ec.CurrentType);
- } else {
- ec.Report.SymbolRelatedToPreviousError (best_candidate);
- ErrorIsInaccesible (loc, GetSignatureForError (), ec.Report);
- }
- }
+ Parameter.Modifier mod = idx >= expected_par.Count ? 0 : expected_par.FixedParameters[idx].ModFlags;
- if (!VerifyArgumentsCompat (ec, ref Arguments, arg_count, best_candidate, params_expanded, false, loc))
- return true;
+ string index = (idx + 1).ToString ();
+ if (((mod & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) ^
+ (a.Modifier & (Parameter.Modifier.REF | Parameter.Modifier.OUT))) != 0) {
+ if ((mod & Parameter.Modifier.ISBYREF) == 0)
+ ec.Report.Error (1615, loc, "Argument `#{0}' does not require `{1}' modifier. Consider removing `{1}' modifier",
+ index, Parameter.GetModifierSignature (a.Modifier));
+ else
+ ec.Report.Error (1620, loc, "Argument `#{0}' is missing `{1}' modifier",
+ index, Parameter.GetModifierSignature (mod));
+ } else {
+ string p1 = a.GetSignatureForError ();
+ string p2 = TypeManager.CSharpName (paramType);
- if (has_inaccessible_candidates_only)
- return true;
- }
+ if (p1 == p2) {
+ ec.Report.ExtraInformation (loc, "(equally named types possibly from different assemblies in previous ");
+ ec.Report.SymbolRelatedToPreviousError (a.Expr.Type);
+ ec.Report.SymbolRelatedToPreviousError (paramType);
+ }
- return false;
+ ec.Report.Error (1503, loc,
+ "Argument `#{0}' cannot convert `{1}' expression to type `{2}'", index, p1, p2);
+ }
}
-
- public override void SetTypeArguments (ResolveContext ec, TypeArguments ta)
+
+ //
+ // We have failed to find exact match so we return error info about the closest match
+ //
+ void ReportOverloadError (ResolveContext rc, MemberSpec best_candidate, Arguments args, bool params_expanded)
{
- type_arguments = ta;
+ int ta_count = type_arguments == null ? 0 : type_arguments.Count;
+ int arg_count = args == null ? 0 : args.Count;
+
+ if (ta_count != best_candidate.Arity && (ta_count > 0 || ((IParametersMember) best_candidate).Parameters.IsEmpty)) {
+ var mg = new MethodGroupExpr (new [] { best_candidate }, best_candidate.DeclaringType, loc);
+ mg.Error_TypeArgumentsCannotBeUsed (rc.Report, loc, best_candidate, ta_count);
+ return;
+ }
+
+ if (lambda_conv_msgs != null) {
+ if (lambda_conv_msgs.Merge (rc.Report.Printer))
+ return;
+ }
+
+ //
+ // For candidates which match on parameters count report more details about incorrect arguments
+ //
+ var pm = best_candidate as IParametersMember;
+ if (pm != null) {
+ int unexpanded_count = pm.Parameters.HasParams ? pm.Parameters.Count - 1 : pm.Parameters.Count;
+ if (pm.Parameters.Count == arg_count || params_expanded || unexpanded_count == arg_count) {
+ // Reject any inaccessible member
+ if (!best_candidate.IsAccessible (rc.CurrentType)) {
+ rc.Report.SymbolRelatedToPreviousError (best_candidate);
+ Expression.ErrorIsInaccesible (rc, best_candidate.GetSignatureForError (), loc);
+ return;
+ }
+
+ var ms = best_candidate as MethodSpec;
+ if (ms != null && ms.IsGeneric && ta_count == 0) {
+ if (custom_errors != null && custom_errors.TypeInferenceFailed (rc, best_candidate))
+ return;
+
+ rc.Report.Error (411, loc,
+ "The type arguments for method `{0}' cannot be inferred from the usage. Try specifying the type arguments explicitly",
+ ms.GetGenericMethodDefinition ().GetSignatureForError ());
+ return;
+ }
+
+ VerifyArguments (rc, ref args, best_candidate, params_expanded);
+ return;
+ }
+ }
+
+ //
+ // We failed to find any method with correct argument count, report best candidate
+ //
+ if (custom_errors != null && custom_errors.NoArgumentMatch (rc, best_candidate))
+ return;
+
+ if (best_candidate.Kind == MemberKind.Constructor) {
+ rc.Report.SymbolRelatedToPreviousError (best_candidate);
+ Error_ConstructorMismatch (rc, best_candidate.DeclaringType, arg_count, loc);
+ } else if (IsDelegateInvoke) {
+ rc.Report.SymbolRelatedToPreviousError (DelegateType);
+ rc.Report.Error (1593, loc, "Delegate `{0}' does not take `{1}' arguments",
+ DelegateType.GetSignatureForError (), arg_count.ToString ());
+ } else {
+ string name = best_candidate.Kind == MemberKind.Indexer ? "this" : best_candidate.Name;
+ rc.Report.SymbolRelatedToPreviousError (best_candidate);
+ rc.Report.Error (1501, loc, "No overload for method `{0}' takes `{1}' arguments",
+ name, arg_count.ToString ());
+ }
}
- public bool VerifyArgumentsCompat (ResolveContext ec, ref Arguments arguments,
- int arg_count, MethodSpec method,
- bool chose_params_expanded,
- bool may_fail, Location loc)
+ bool VerifyArguments (ResolveContext ec, ref Arguments args, MemberSpec member, bool chose_params_expanded)
{
- AParametersCollection pd = method.Parameters;
- int param_count = GetApplicableParametersCount (method, pd);
+ var pm = member as IParametersMember;
+ var pd = pm.Parameters;
- int errors = ec.Report.Errors;
Parameter.Modifier p_mod = 0;
TypeSpec pt = null;
int a_idx = 0, a_pos = 0;
Argument a = null;
ArrayInitializer params_initializers = null;
- bool has_unsafe_arg = method.ReturnType.IsPointer;
+ bool has_unsafe_arg = pm.MemberType.IsPointer;
+ int arg_count = args == null ? 0 : args.Count;
for (; a_idx < arg_count; a_idx++, ++a_pos) {
- a = arguments [a_idx];
+ a = args[a_idx];
if (p_mod != Parameter.Modifier.PARAMS) {
- p_mod = pd.FixedParameters [a_idx].ModFlags;
- pt = pd.Types [a_idx];
+ p_mod = pd.FixedParameters[a_idx].ModFlags;
+ pt = pd.Types[a_idx];
has_unsafe_arg |= pt.IsPointer;
if (p_mod == Parameter.Modifier.PARAMS) {
break;
continue;
- } else {
- NamedArgument na = a as NamedArgument;
- if (na != null) {
- int name_index = pd.GetParameterIndexByName (na.Name);
- if (name_index < 0 || name_index >= param_count) {
- if (DeclaringType != null && TypeManager.IsDelegateType (DeclaringType)) {
- ec.Report.SymbolRelatedToPreviousError (DeclaringType);
- ec.Report.Error (1746, na.Location,
- "The delegate `{0}' does not contain a parameter named `{1}'",
- TypeManager.CSharpName (DeclaringType), na.Name);
- } else {
- ec.Report.SymbolRelatedToPreviousError (best_candidate);
- ec.Report.Error (1739, na.Location,
- "The best overloaded method match for `{0}' does not contain a parameter named `{1}'",
- TypeManager.CSharpSignature (method), na.Name);
- }
- } else if (arguments[name_index] != a) {
- if (DeclaringType != null && TypeManager.IsDelegateType (DeclaringType))
- ec.Report.SymbolRelatedToPreviousError (DeclaringType);
- else
- ec.Report.SymbolRelatedToPreviousError (best_candidate);
-
- ec.Report.Error (1744, na.Location,
- "Named argument `{0}' cannot be used for a parameter which has positional argument specified",
- na.Name);
+ }
+
+ NamedArgument na = a as NamedArgument;
+ if (na != null) {
+ int name_index = pd.GetParameterIndexByName (na.Name);
+ if (name_index < 0 || name_index >= pd.Count) {
+ if (IsDelegateInvoke) {
+ ec.Report.SymbolRelatedToPreviousError (DelegateType);
+ ec.Report.Error (1746, na.Location,
+ "The delegate `{0}' does not contain a parameter named `{1}'",
+ DelegateType.GetSignatureForError (), na.Name);
+ } else {
+ ec.Report.SymbolRelatedToPreviousError (member);
+ ec.Report.Error (1739, na.Location,
+ "The best overloaded method match for `{0}' does not contain a parameter named `{1}'",
+ TypeManager.CSharpSignature (member), na.Name);
}
+ } else if (args[name_index] != a) {
+ if (IsDelegateInvoke)
+ ec.Report.SymbolRelatedToPreviousError (DelegateType);
+ else
+ ec.Report.SymbolRelatedToPreviousError (member);
+
+ ec.Report.Error (1744, na.Location,
+ "Named argument `{0}' cannot be used for a parameter which has positional argument specified",
+ na.Name);
}
}
-
+
if (a.Expr.Type == InternalType.Dynamic)
continue;
- if (delegate_type != null && !Delegate.IsTypeCovariant (a.Expr, pt))
- break;
+ if ((restrictions & Restrictions.Covariant) != 0 && !Delegate.IsTypeCovariant (a.Expr, pt)) {
+ custom_errors.NoArgumentMatch (ec, member);
+ return false;
+ }
Expression conv = Convert.ImplicitConversion (ec, a.Expr, pt, loc);
if (conv == null)
// we choose to use 'a.Expr' rather than 'conv' so that
// we don't hide the kind of expression we have (esp. CompoundAssign.Helper)
params_initializers.Add (a.Expr);
- arguments.RemoveAt (a_idx--);
+ args.RemoveAt (a_idx--);
--arg_count;
continue;
}
}
if (a_idx != arg_count) {
- if (!may_fail && ec.Report.Errors == errors) {
- if (CustomErrorHandler != null)
- CustomErrorHandler.NoExactMatch (ec, best_candidate);
- else
- Error_InvalidArguments (ec, loc, a_pos, method, a, pd, pt);
- }
+ ReportArgumentMismatch (ec, a_pos, member, a, pd, pt);
return false;
}
//
// Fill not provided arguments required by params modifier
//
- if (params_initializers == null && pd.HasParams && arg_count + 1 == param_count) {
- if (arguments == null)
- arguments = new Arguments (1);
+ if (params_initializers == null && pd.HasParams && arg_count + 1 == pd.Count) {
+ if (args == null)
+ args = new Arguments (1);
- pt = pd.Types [param_count - 1];
+ pt = pd.Types[pd.Count - 1];
pt = TypeManager.GetElementType (pt);
has_unsafe_arg |= pt.IsPointer;
params_initializers = new ArrayInitializer (0, loc);
// Append an array argument with all params arguments
//
if (params_initializers != null) {
- arguments.Add (new Argument (
+ args.Add (new Argument (
new ArrayCreation (new TypeExpression (pt, loc), params_initializers, loc).Resolve (ec)));
arg_count++;
}
- if (arg_count < param_count) {
- if (!may_fail)
- Error_ArgumentCountWrong (ec, arg_count);
- return false;
- }
-
if (has_unsafe_arg && !ec.IsUnsafe) {
- if (!may_fail)
- UnsafeError (ec, loc);
- return false;
+ Expression.UnsafeError (ec, loc);
}
return true;
get { return true; }
}
- public override TypeSpec DeclaringType {
+ protected override TypeSpec DeclaringType {
get { return constant.DeclaringType; }
}
protected override Expression DoResolve (ResolveContext rc)
{
- constant.MemberDefinition.SetIsUsed ();
-
ResolveInstanceExpression (rc);
-
- if (!rc.IsObsolete) {
- var oa = constant.GetAttributeObsolete ();
- if (oa != null)
- AttributeTester.Report_ObsoleteMessage (oa, constant.GetSignatureForError (), loc, rc.Report);
- }
+ DoBestMemberChecks (rc, constant);
var c = constant.GetConstant (rc);
{
return constant.GetSignatureForError ();
}
+
+ public override void SetTypeArguments (ResolveContext ec, TypeArguments ta)
+ {
+ Error_TypeArgumentsCannotBeUsed (ec.Report, "constant", GetSignatureForError (), loc);
+ }
}
/// <summary>
{
}
+#region Properties
+
public override string Name {
get {
return spec.Name;
}
}
+ public bool IsHoisted {
+ get {
+ IVariableReference hv = InstanceExpression as IVariableReference;
+ return hv != null && hv.IsHoisted;
+ }
+ }
+
public override bool IsInstance {
get {
return !spec.IsStatic;
}
}
- public override TypeSpec DeclaringType {
+ protected override TypeSpec DeclaringType {
get {
return spec.DeclaringType;
}
}
+ public VariableInfo VariableInfo {
+ get {
+ return variable_info;
+ }
+ }
+
+#endregion
+
public override string GetSignatureForError ()
{
return TypeManager.GetFullNameSignature (spec);
}
- public VariableInfo VariableInfo {
- get {
- return variable_info;
- }
+ public bool IsMarshalByRefAccess ()
+ {
+ // Checks possible ldflda of field access expression
+ return !spec.IsStatic && TypeManager.IsValueType (spec.MemberType) &&
+ TypeManager.IsSubclassOf (spec.DeclaringType, TypeManager.mbr_type) &&
+ !(InstanceExpression is This);
}
public void SetHasAddressTaken ()
}
}
- if (type.IsPointer && !ec.IsUnsafe) {
- UnsafeError (ec, loc);
- }
-
- if (!ec.IsObsolete) {
- ObsoleteAttribute oa = spec.GetAttributeObsolete ();
- if (oa != null)
- AttributeTester.Report_ObsoleteMessage (oa, TypeManager.GetFullNameSignature (spec), loc, ec.Report);
- }
+ DoBestMemberChecks (ec, spec);
var fb = spec as FixedFieldSpec;
IVariableReference var = InstanceExpression as IVariableReference;
if (ec.HasSet (ResolveContext.Options.ConstructorScope)) {
// InitOnly fields cannot be assigned-to in a different constructor from their declaring type
- if (!TypeManager.IsEqual (ec.CurrentMemberDefinition.Parent.Definition, DeclaringType.GetDefinition ()))
+ if (!TypeManager.IsEqual (ec.CurrentMemberDefinition.Parent.Definition, spec.DeclaringType.GetDefinition ()))
return Report_AssignToReadonly (ec, right_side);
// static InitOnly fields cannot be assigned-to in an instance constructor
if (IsStatic && !ec.IsStatic)
}
if (right_side == EmptyExpression.OutAccess.Instance &&
- !IsStatic && !(InstanceExpression is This) && TypeManager.mbr_type != null && TypeManager.IsSubclassOf (DeclaringType, TypeManager.mbr_type)) {
- ec.Report.SymbolRelatedToPreviousError (DeclaringType);
+ !IsStatic && !(InstanceExpression is This) && TypeManager.mbr_type != null && TypeManager.IsSubclassOf (spec.DeclaringType, TypeManager.mbr_type)) {
+ ec.Report.SymbolRelatedToPreviousError (spec.DeclaringType);
ec.Report.Warning (197, 1, loc,
"Passing `{0}' as ref or out or taking its address may cause a runtime exception because it is a field of a marshal-by-reference class",
GetSignatureForError ());
return this;
}
- bool is_marshal_by_ref ()
- {
- return !IsStatic && TypeManager.IsStruct (Type) && TypeManager.mbr_type != null && TypeManager.IsSubclassOf (DeclaringType, TypeManager.mbr_type);
- }
-
- public override void CheckMarshalByRefAccess (ResolveContext ec)
- {
- if (is_marshal_by_ref () && !(InstanceExpression is This)) {
- ec.Report.SymbolRelatedToPreviousError (DeclaringType);
- ec.Report.Warning (1690, 1, loc, "Cannot call methods, properties, or indexers on `{0}' because it is a value type member of a marshal-by-reference class",
- GetSignatureForError ());
- }
- }
-
public override int GetHashCode ()
{
return spec.GetHashCode ();
}
}
- public bool IsHoisted {
- get {
- IVariableReference hv = InstanceExpression as IVariableReference;
- return hv != null && hv.IsHoisted;
- }
- }
-
public override bool Equals (object obj)
{
FieldExpr fe = obj as FieldExpr;
{
bool is_volatile = (spec.Modifiers & Modifiers.VOLATILE) != 0;
- if (is_volatile || is_marshal_by_ref ())
+ if (is_volatile) // || is_marshal_by_ref ())
base.EmitSideEffect (ec);
}
}
}
- public SLE.Expression MakeAssignExpression (BuilderContext ctx)
+ public SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source)
{
return MakeExpression (ctx);
}
{
return SLE.Expression.Field (InstanceExpression.MakeExpression (ctx), spec.GetMetaInfo ());
}
+
+ public override void SetTypeArguments (ResolveContext ec, TypeArguments ta)
+ {
+ Error_TypeArgumentsCannotBeUsed (ec.Report, "field", GetSignatureForError (), loc);
+ }
}
/// This is not an LValue because we need to re-write the expression, we
/// can not take data from the stack and store it.
/// </summary>
- public class PropertyExpr : MemberExpr, IDynamicAssign
+ class PropertyExpr : PropertyOrIndexerExpr<PropertySpec>
{
- PropertySpec spec;
-
- // getter and setter can be different for base calls
- MethodSpec getter, setter;
-
- TypeArguments targs;
- LocalTemporary temp;
- bool prepared;
-
public PropertyExpr (PropertySpec spec, Location l)
+ : base (l)
{
- this.spec = spec;
- loc = l;
-
+ best_candidate = spec;
type = spec.MemberType;
}
#region Properties
+ protected override TypeSpec DeclaringType {
+ get {
+ return best_candidate.DeclaringType;
+ }
+ }
+
public override string Name {
get {
- return spec.Name;
+ return best_candidate.Name;
}
}
public override bool IsStatic {
get {
- return spec.IsStatic;
+ return best_candidate.IsStatic;
}
}
public PropertySpec PropertyInfo {
get {
- return spec;
+ return best_candidate;
}
}
args.Add (new Argument (new NullLiteral (loc)));
else
args.Add (new Argument (InstanceExpression.CreateExpressionTree (ec)));
- args.Add (new Argument (new TypeOfMethod (getter, loc)));
+ args.Add (new Argument (new TypeOfMethod (Getter, loc)));
return CreateExpressionFactoryCall (ec, "Property", args);
}
public Expression CreateSetterTypeOfExpression ()
{
- return new TypeOfMethod (setter, loc);
- }
-
- public override TypeSpec DeclaringType {
- get {
- return spec.DeclaringType;
- }
+ return new TypeOfMethod (Setter, loc);
}
public override string GetSignatureForError ()
{
- return TypeManager.GetFullNameSignature (spec);
+ return best_candidate.GetSignatureForError ();
}
- public SLE.Expression MakeAssignExpression (BuilderContext ctx)
+ public override SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source)
{
- return SLE.Expression.Property (InstanceExpression.MakeExpression (ctx), (MethodInfo) setter.GetMetaInfo ());
+ return SLE.Expression.Property (InstanceExpression.MakeExpression (ctx), (MethodInfo) Setter.GetMetaInfo ());
}
public override SLE.Expression MakeExpression (BuilderContext ctx)
{
- return SLE.Expression.Property (InstanceExpression.MakeExpression (ctx), (MethodInfo) getter.GetMetaInfo ());
- }
-
- bool InstanceResolve (ResolveContext ec, bool lvalue_instance, bool must_do_cs1540_check)
- {
- if (!ResolveInstanceExpression (ec))
- return true;
-
- InstanceExpression = InstanceExpression.Resolve (ec);
- if (lvalue_instance && InstanceExpression != null)
- InstanceExpression = InstanceExpression.ResolveLValue (ec, EmptyExpression.LValueMemberAccess);
-
- if (InstanceExpression == null)
- return false;
-
- InstanceExpression.CheckMarshalByRefAccess (ec);
-
- if (must_do_cs1540_check && (InstanceExpression != EmptyExpression.Null) &&
- !(InstanceExpression is BaseThis) &&
- !TypeManager.IsInstantiationOfSameGenericType (InstanceExpression.Type, ec.CurrentType) &&
- !TypeManager.IsNestedChildOf (ec.CurrentType, InstanceExpression.Type) &&
- !TypeManager.IsSubclassOf (InstanceExpression.Type, ec.CurrentType)) {
- ec.Report.SymbolRelatedToPreviousError (spec);
- Error_CannotAccessProtected (ec, loc, spec, InstanceExpression.Type, ec.CurrentType);
- return false;
- }
-
- return true;
+ return SLE.Expression.Property (InstanceExpression.MakeExpression (ctx), (MethodInfo) Getter.GetMetaInfo ());
}
void Error_PropertyNotValid (ResolveContext ec)
{
- ec.Report.SymbolRelatedToPreviousError (spec);
+ ec.Report.SymbolRelatedToPreviousError (best_candidate);
ec.Report.Error (1546, loc, "Property or event `{0}' is not supported by the C# language",
GetSignatureForError ());
}
- public bool IsAccessibleFrom (TypeSpec invocation_type, bool lvalue)
- {
- bool dummy;
- var accessor = lvalue ? spec.Set : spec.Get;
- if (accessor == null && lvalue)
- accessor = spec.Get;
- return accessor != null && IsMemberAccessible (invocation_type, accessor, out dummy);
- }
-
bool IsSingleDimensionalArrayLength ()
{
- if (DeclaringType != TypeManager.array_type || !spec.HasGet || Name != "Length")
+ if (best_candidate.DeclaringType != TypeManager.array_type || !best_candidate.HasGet || Name != "Length")
return false;
ArrayContainer ac = InstanceExpression.Type as ArrayContainer;
return ac != null && ac.Rank == 1;
}
- protected override Expression DoResolve (ResolveContext ec)
- {
- eclass = ExprClass.PropertyAccess;
-
- bool must_do_cs1540_check = false;
- ec.Report.DisableReporting ();
- bool res = ResolveGetter (ec, ref must_do_cs1540_check);
- ec.Report.EnableReporting ();
-
- if (!res) {
- if (InstanceExpression != null) {
- TypeSpec expr_type = InstanceExpression.Type;
- ExtensionMethodGroupExpr ex_method_lookup = ec.LookupExtensionMethod (expr_type, Name, 0, loc);
- if (ex_method_lookup != null) {
- ex_method_lookup.ExtensionExpression = InstanceExpression;
- ex_method_lookup.SetTypeArguments (ec, targs);
- return ex_method_lookup.Resolve (ec);
- }
- }
-
- ResolveGetter (ec, ref must_do_cs1540_check);
- return null;
- }
-
- if (!InstanceResolve (ec, false, must_do_cs1540_check))
- return null;
-
- if (type.IsPointer && !ec.IsUnsafe) {
- UnsafeError (ec, loc);
- }
-
- getter = CandidateToBaseOverride (ec, spec.Get);
-
- //
- // Only base will allow this invocation to happen.
- //
- if (IsBase && getter.IsAbstract) {
- Error_CannotCallAbstractBase (ec, spec.GetSignatureForError ());
- }
-
- if (!ec.IsObsolete) {
- ObsoleteAttribute oa = spec.GetAttributeObsolete ();
- if (oa != null)
- AttributeTester.Report_ObsoleteMessage (oa, GetSignatureForError (), loc, ec.Report);
- }
-
- return this;
- }
-
- override public Expression DoResolveLValue (ResolveContext ec, Expression right_side)
- {
- eclass = ExprClass.PropertyAccess;
-
- if (right_side == EmptyExpression.OutAccess.Instance) {
- if (ec.CurrentBlock.Toplevel.GetParameterReference (spec.Name, loc) is MemberAccess) {
- ec.Report.Error (1939, loc, "A range variable `{0}' may not be passes as `ref' or `out' parameter",
- spec.Name);
- } else {
- right_side.DoResolveLValue (ec, this);
- }
- return null;
- }
-
- if (right_side == EmptyExpression.LValueMemberAccess || right_side == EmptyExpression.LValueMemberOutAccess) {
- Error_CannotModifyIntermediateExpressionValue (ec);
- }
-
- if (spec.IsNotRealProperty) {
- Error_PropertyNotValid (ec);
- return null;
- }
-
- if (!spec.HasSet){
- if (ec.CurrentBlock.Toplevel.GetParameterReference (spec.Name, loc) is MemberAccess) {
- ec.Report.Error (1947, loc, "A range variable `{0}' cannot be assigned to. Consider using `let' clause to store the value",
- spec.Name);
- } else {
- ec.Report.Error (200, loc, "Property or indexer `{0}' cannot be assigned to (it is read only)",
- GetSignatureForError ());
- }
- return null;
- }
-
- if (targs != null) {
- base.SetTypeArguments (ec, targs);
- return null;
- }
-
- bool must_do_cs1540_check;
- if (!IsMemberAccessible (ec.CurrentType, spec.Set, out must_do_cs1540_check)) {
- if (spec.HasDifferentAccessibility) {
- ec.Report.SymbolRelatedToPreviousError (spec.Set);
- ec.Report.Error (272, loc, "The property or indexer `{0}' cannot be used in this context because the set accessor is inaccessible",
- TypeManager.CSharpSignature (spec));
- } else {
- ec.Report.SymbolRelatedToPreviousError (spec.Set);
- ErrorIsInaccesible (loc, TypeManager.CSharpSignature (spec.Set), ec.Report);
- }
- return null;
- }
-
- if (!InstanceResolve (ec, TypeManager.IsStruct (spec.DeclaringType), must_do_cs1540_check))
- return null;
-
- setter = CandidateToBaseOverride (ec, spec.Set);
-
- //
- // Only base will allow this invocation to happen.
- //
- if (IsBase && setter.IsAbstract){
- Error_CannotCallAbstractBase (ec, setter.GetSignatureForError ());
- }
-
- if (spec.MemberType.IsPointer && !ec.IsUnsafe) {
- UnsafeError (ec, loc);
- }
-
- if (!ec.IsObsolete) {
- ObsoleteAttribute oa = spec.GetAttributeObsolete ();
- if (oa != null)
- AttributeTester.Report_ObsoleteMessage (oa, GetSignatureForError (), loc, ec.Report);
- }
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Emit (ec, false);
- }
-
- public void Emit (EmitContext ec, bool leave_copy)
+ public override void Emit (EmitContext ec, bool leave_copy)
{
//
// Special case: length of single dimension array property is turned into ldlen
return;
}
- Invocation.EmitCall (ec, InstanceExpression, getter, null, loc, prepared, false);
+ Invocation.EmitCall (ec, InstanceExpression, Getter, null, loc, prepared, false);
if (leave_copy) {
ec.Emit (OpCodes.Dup);
}
}
- //
- // Implements the IAssignMethod interface for assignments
- //
- public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
+ public override void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
{
Expression my_source = source;
Arguments args = new Arguments (1);
args.Add (new Argument (my_source));
- Invocation.EmitCall (ec, InstanceExpression, setter, args, loc, false, prepared);
+ Invocation.EmitCall (ec, InstanceExpression, Setter, args, loc, false, prepared);
if (temp != null) {
temp.Emit (ec);
}
}
- bool ResolveGetter (ResolveContext ec, ref bool must_do_cs1540_check)
+ protected override Expression OverloadResolve (ResolveContext rc, Expression right_side)
{
- if (targs != null) {
- base.SetTypeArguments (ec, targs);
- return false;
+ eclass = ExprClass.PropertyAccess;
+
+ if (best_candidate.IsNotRealProperty) {
+ Error_PropertyNotValid (rc);
}
- if (spec.IsNotRealProperty) {
- Error_PropertyNotValid (ec);
- return false;
+ if (ResolveInstanceExpression (rc)) {
+ if (right_side != null && best_candidate.DeclaringType.IsStruct)
+ InstanceExpression.DoResolveLValue (rc, EmptyExpression.LValueMemberAccess);
}
- if (!spec.HasGet) {
- if (InstanceExpression != EmptyExpression.Null) {
- ec.Report.SymbolRelatedToPreviousError (spec);
- ec.Report.Error (154, loc, "The property or indexer `{0}' cannot be used in this context because it lacks the `get' accessor",
- spec.GetSignatureForError ());
- return false;
+ DoBestMemberChecks (rc, best_candidate);
+ return this;
+ }
+
+ public override void SetTypeArguments (ResolveContext ec, TypeArguments ta)
+ {
+ Error_TypeArgumentsCannotBeUsed (ec.Report, "property", GetSignatureForError (), loc);
+ }
+ }
+
+ abstract class PropertyOrIndexerExpr<T> : MemberExpr, IDynamicAssign where T : PropertySpec
+ {
+ // getter and setter can be different for base calls
+ MethodSpec getter, setter;
+ protected T best_candidate;
+
+ protected LocalTemporary temp;
+ protected bool prepared;
+
+ protected PropertyOrIndexerExpr (Location l)
+ {
+ loc = l;
+ }
+
+ #region Properties
+
+ public MethodSpec Getter {
+ get {
+ return getter;
+ }
+ set {
+ getter = value;
+ }
+ }
+
+ public MethodSpec Setter {
+ get {
+ return setter;
+ }
+ set {
+ setter = value;
+ }
+ }
+
+ #endregion
+
+ protected override Expression DoResolve (ResolveContext ec)
+ {
+ if (eclass == ExprClass.Unresolved) {
+ var expr = OverloadResolve (ec, null);
+ if (expr == null)
+ return null;
+
+ if (InstanceExpression != null)
+ InstanceExpression.CheckMarshalByRefAccess (ec);
+
+ if (expr != this)
+ return expr.Resolve (ec);
+ }
+
+ if (!ResolveGetter (ec))
+ return null;
+
+ return this;
+ }
+
+ public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
+ {
+ if (right_side == EmptyExpression.OutAccess.Instance) {
+ // TODO: best_candidate can be null at this point
+ if (best_candidate != null && ec.CurrentBlock.Toplevel.GetParameterReference (best_candidate.Name, loc) is MemberAccess) {
+ ec.Report.Error (1939, loc, "A range variable `{0}' may not be passes as `ref' or `out' parameter",
+ best_candidate.Name);
+ } else {
+ right_side.DoResolveLValue (ec, this);
}
+ return null;
}
- if (spec.HasGet && !IsMemberAccessible (ec.CurrentType, spec.Get, out must_do_cs1540_check)) {
- if (spec.HasDifferentAccessibility) {
- ec.Report.SymbolRelatedToPreviousError (spec.Get);
- ec.Report.Error (271, loc, "The property or indexer `{0}' cannot be used in this context because the get accessor is inaccessible",
- TypeManager.CSharpSignature (spec));
+ // if the property/indexer returns a value type, and we try to set a field in it
+ if (right_side == EmptyExpression.LValueMemberAccess || right_side == EmptyExpression.LValueMemberOutAccess) {
+ Error_CannotModifyIntermediateExpressionValue (ec);
+ }
+
+ if (eclass == ExprClass.Unresolved) {
+ var expr = OverloadResolve (ec, right_side);
+ if (expr == null)
+ return null;
+
+ if (expr != this)
+ return expr.ResolveLValue (ec, right_side);
+ }
+
+ if (!ResolveSetter (ec))
+ return null;
+
+ return this;
+ }
+
+ //
+ // Implements the IAssignMethod interface for assignments
+ //
+ public abstract void Emit (EmitContext ec, bool leave_copy);
+ public abstract void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load);
+
+ public override void Emit (EmitContext ec)
+ {
+ Emit (ec, false);
+ }
+
+ public abstract SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source);
+
+ protected abstract Expression OverloadResolve (ResolveContext rc, Expression right_side);
+
+ bool ResolveGetter (ResolveContext rc)
+ {
+ if (!best_candidate.HasGet) {
+ if (InstanceExpression != EmptyExpression.Null) {
+ rc.Report.SymbolRelatedToPreviousError (best_candidate);
+ rc.Report.Error (154, loc, "The property or indexer `{0}' cannot be used in this context because it lacks the `get' accessor",
+ best_candidate.GetSignatureForError ());
+ return false;
+ }
+ } else if (!best_candidate.Get.IsAccessible (rc.CurrentType)) {
+ if (best_candidate.HasDifferentAccessibility) {
+ rc.Report.SymbolRelatedToPreviousError (best_candidate.Get);
+ rc.Report.Error (271, loc, "The property or indexer `{0}' cannot be used in this context because the get accessor is inaccessible",
+ TypeManager.CSharpSignature (best_candidate));
} else {
- ec.Report.SymbolRelatedToPreviousError (spec.Get);
- ErrorIsInaccesible (loc, TypeManager.CSharpSignature (spec.Get), ec.Report);
+ rc.Report.SymbolRelatedToPreviousError (best_candidate.Get);
+ ErrorIsInaccesible (rc, best_candidate.Get.GetSignatureForError (), loc);
}
+ }
- return false;
+ if (best_candidate.HasDifferentAccessibility) {
+ CheckProtectedMemberAccess (rc, best_candidate.Get);
}
+ getter = CandidateToBaseOverride (rc, best_candidate.Get);
return true;
}
- public override void SetTypeArguments (ResolveContext ec, TypeArguments ta)
+ bool ResolveSetter (ResolveContext rc)
{
- targs = ta;
+ if (!best_candidate.HasSet) {
+ if (rc.CurrentBlock.Toplevel.GetParameterReference (best_candidate.Name, loc) is MemberAccess) {
+ rc.Report.Error (1947, loc, "A range variable `{0}' cannot be assigned to. Consider using `let' clause to store the value",
+ best_candidate.Name);
+ } else {
+ rc.Report.Error (200, loc, "Property or indexer `{0}' cannot be assigned to (it is read-only)",
+ GetSignatureForError ());
+ }
+ return false;
+ }
+
+ if (!best_candidate.Set.IsAccessible (rc.CurrentType)) {
+ if (best_candidate.HasDifferentAccessibility) {
+ rc.Report.SymbolRelatedToPreviousError (best_candidate.Set);
+ rc.Report.Error (272, loc, "The property or indexer `{0}' cannot be used in this context because the set accessor is inaccessible",
+ GetSignatureForError ());
+ } else {
+ rc.Report.SymbolRelatedToPreviousError (best_candidate.Set);
+ ErrorIsInaccesible (rc, best_candidate.Set.GetSignatureForError (), loc);
+ }
+ }
+
+ if (best_candidate.HasDifferentAccessibility)
+ CheckProtectedMemberAccess (rc, best_candidate.Set);
+
+ setter = CandidateToBaseOverride (rc, best_candidate.Set);
+ return true;
}
}
/// <summary>
/// Fully resolved expression that evaluates to an Event
/// </summary>
- public class EventExpr : MemberExpr
+ public class EventExpr : MemberExpr, IAssignMethod
{
readonly EventSpec spec;
+ MethodSpec op;
public EventExpr (EventSpec spec, Location loc)
{
this.loc = loc;
}
+ #region Properties
+
+ protected override TypeSpec DeclaringType {
+ get {
+ return spec.DeclaringType;
+ }
+ }
+
public override string Name {
get {
return spec.Name;
}
}
- public override TypeSpec DeclaringType {
+ public MethodSpec Operator {
get {
- return spec.DeclaringType;
+ return op;
}
}
-
- public void Error_AssignmentEventOnly (ResolveContext ec)
- {
- ec.Report.Error (79, loc, "The event `{0}' can only appear on the left hand side of `+=' or `-=' operator",
- GetSignatureForError ());
- }
+
+ #endregion
public override MemberExpr ResolveMemberAccess (ResolveContext ec, Expression left, SimpleName original)
{
return base.ResolveMemberAccess (ec, left, original);
}
- bool InstanceResolve (ResolveContext ec, bool must_do_cs1540_check)
- {
- if (IsBase && spec.IsAbstract) {
- Error_CannotCallAbstractBase (ec, spec.GetSignatureForError ());
- }
-
- if (!ResolveInstanceExpression (ec))
- return true;
-
- InstanceExpression.Resolve (ec);
-
- //
- // This is using the same mechanism as the CS1540 check in PropertyExpr.
- // However, in the Event case, we reported a CS0122 instead.
- //
- // TODO: Exact copy from PropertyExpr
- //
- if (must_do_cs1540_check && InstanceExpression != EmptyExpression.Null &&
- !TypeManager.IsInstantiationOfSameGenericType (InstanceExpression.Type, ec.CurrentType) &&
- !TypeManager.IsNestedChildOf (ec.CurrentType, InstanceExpression.Type) &&
- !TypeManager.IsSubclassOf (InstanceExpression.Type, ec.CurrentType)) {
- ec.Report.SymbolRelatedToPreviousError (spec);
- ErrorIsInaccesible (loc, TypeManager.CSharpSignature (spec), ec.Report);
- return false;
- }
-
- return true;
- }
-
- public bool IsAccessibleFrom (TypeSpec invocation_type)
- {
- bool dummy;
- return IsMemberAccessible (invocation_type, spec.AccessorAdd, out dummy) &&
- IsMemberAccessible (invocation_type, spec.AccessorRemove, out dummy);
- }
-
public override Expression CreateExpressionTree (ResolveContext ec)
{
throw new NotSupportedException ("ET");
public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
{
- // contexts where an LValue is valid have already devolved to FieldExprs
- Error_CannotAssign (ec);
- return null;
+ if (right_side == EmptyExpression.EventAddition) {
+ op = spec.AccessorAdd;
+ } else if (right_side == EmptyExpression.EventSubtraction) {
+ op = spec.AccessorRemove;
+ }
+
+ if (op == null) {
+ Error_AssignmentEventOnly (ec);
+ return null;
+ }
+
+ op = CandidateToBaseOverride (ec, op);
+ return this;
}
protected override Expression DoResolve (ResolveContext ec)
{
eclass = ExprClass.EventAccess;
-
- bool must_do_cs1540_check;
- if (!(IsMemberAccessible (ec.CurrentType, spec.AccessorAdd, out must_do_cs1540_check) &&
- IsMemberAccessible (ec.CurrentType, spec.AccessorRemove, out must_do_cs1540_check))) {
- ec.Report.SymbolRelatedToPreviousError (spec);
- ErrorIsInaccesible (loc, TypeManager.CSharpSignature (spec), ec.Report);
- return null;
- }
-
type = spec.MemberType;
- if (!InstanceResolve (ec, must_do_cs1540_check))
- return null;
+ ResolveInstanceExpression (ec);
if (!ec.HasSet (ResolveContext.Options.CompoundAssignmentScope)) {
Error_CannotAssign (ec);
- return null;
}
- if (!ec.IsObsolete) {
- var oa = spec.GetAttributeObsolete ();
- if (oa != null)
- AttributeTester.Report_ObsoleteMessage (oa, GetSignatureForError (), loc, ec.Report);
- }
-
- spec.MemberDefinition.SetIsUsed ();
-
+ DoBestMemberChecks (ec, spec);
return this;
}
//Error_CannotAssign ();
}
+ #region IAssignMethod Members
+
+ public void Emit (EmitContext ec, bool leave_copy)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
+ {
+ if (leave_copy || !prepare_for_load)
+ throw new NotImplementedException ("EventExpr::EmitAssign");
+
+ Arguments args = new Arguments (1);
+ args.Add (new Argument (source));
+ Invocation.EmitCall (ec, InstanceExpression, op, args, loc);
+ }
+
+ #endregion
+
+ void Error_AssignmentEventOnly (ResolveContext ec)
+ {
+ ec.Report.Error (79, loc, "The event `{0}' can only appear on the left hand side of `+=' or `-=' operator",
+ GetSignatureForError ());
+ }
+
public void Error_CannotAssign (ResolveContext ec)
{
ec.Report.Error (70, loc,
GetSignatureForError (), TypeManager.CSharpName (spec.DeclaringType));
}
+ protected override void Error_CannotCallAbstractBase (ResolveContext rc, string name)
+ {
+ name = name.Substring (0, name.LastIndexOf ('.'));
+ base.Error_CannotCallAbstractBase (rc, name);
+ }
+
public override string GetSignatureForError ()
{
return TypeManager.CSharpSignature (spec);
}
- public void EmitAddOrRemove (EmitContext ec, bool is_add, Expression source)
+ public override void SetTypeArguments (ResolveContext ec, TypeArguments ta)
{
- Arguments args = new Arguments (1);
- args.Add (new Argument (source));
- Invocation.EmitCall (ec, InstanceExpression, is_add ? spec.AccessorAdd : spec.AccessorRemove, args, loc);
+ Error_TypeArgumentsCannotBeUsed (ec.Report, "event", GetSignatureForError (), loc);
}
}
type = right_side.Type;
if (type == TypeManager.null_type || type == TypeManager.void_type || type == InternalType.AnonymousMethod || type == InternalType.MethodGroup) {
- ec.Report.Error (815, loc, "An implicitly typed local variable declaration cannot be initialized with `{0}'",
- right_side.GetSignatureForError ());
+ ec.Report.Error (815, loc,
+ "An implicitly typed local variable declaration cannot be initialized with `{0}'",
+ type.GetSignatureForError ());
return false;
}
// Copyright 2001, 2002, 2003 Ximian, Inc.
// Copyright 2003-2008 Novell, Inc.
//
-#define USE_OLD
namespace Mono.CSharp {
using System;
if (methods == null)
return null;
- var user_op = new MethodGroupExpr (methods, expr.Type, loc);
-
Arguments args = new Arguments (1);
args.Add (new Argument (expr));
- user_op = user_op.OverloadResolve (ec, ref args, false, expr.Location);
- if (user_op == null)
+ var res = new OverloadResolver (methods, OverloadResolver.Restrictions.NoBaseMembers, loc);
+ var oper = res.ResolveOperator (ec, ref args);
+
+ if (oper == null)
return null;
Expr = args [0].Expr;
- return new UserOperatorCall (user_op.BestCandidate, args, CreateExpressionTree, expr.Location);
+ return new UserOperatorCall (oper, args, CreateExpressionTree, expr.Location);
}
//
continue;
}
- int result = MethodGroupExpr.BetterTypeConversion (ec, best_expr.Type, t);
+ int result = OverloadResolver.BetterTypeConversion (ec, best_expr.Type, t);
if (result == 0) {
ec.Report.Error (35, loc, "Operator `{0}' is ambiguous on an operand of type `{1}'",
OperName (Oper), TypeManager.CSharpName (expr.Type));
Arguments args = new Arguments (1);
args.Add (new Argument (expr));
- var mg = new MethodGroupExpr (methods, type, loc);
- mg = mg.OverloadResolve (ec, ref args, false, loc);
- if (mg == null)
+ var res = new OverloadResolver (methods, OverloadResolver.Restrictions.NoBaseMembers, loc);
+ var op = res.ResolveOperator (ec, ref args);
+ if (op == null)
return null;
args[0].Expr = operation;
- operation = new UserOperatorCall (mg.BestCandidate, args, null, loc);
+ operation = new UserOperatorCall (op, args, null, loc);
operation = Convert.ImplicitConversionRequired (ec, operation, type, loc);
return this;
}
{
int result = 0;
if (left != null && best_operator.left != null) {
- result = MethodGroupExpr.BetterTypeConversion (ec, best_operator.left, left);
+ result = OverloadResolver.BetterTypeConversion (ec, best_operator.left, left);
}
//
// When second argument is same as the first one, the result is same
//
if (right != null && (left != right || best_operator.left != best_operator.right)) {
- result |= MethodGroupExpr.BetterTypeConversion (ec, best_operator.right, right);
+ result |= OverloadResolver.BetterTypeConversion (ec, best_operator.right, right);
}
if (result == 0 || result > 2)
{
if (!TypeManager.IsEqual (l, r) && !TypeSpecComparer.Variant.IsEqual (r, l)) {
Expression tmp;
- if (right.eclass == ExprClass.MethodGroup || (r == InternalType.AnonymousMethod)) {
+ if (right.eclass == ExprClass.MethodGroup || r == InternalType.AnonymousMethod || r == InternalType.Null) {
tmp = Convert.ImplicitConversionRequired (ec, right, l, loc);
if (tmp == null)
return null;
left_operators = right_operators;
}
- var mg = new MethodGroupExpr (left_operators, l, loc);
- mg = mg.OverloadResolve (ec, ref args, true, loc);
- if (mg == null)
+ var res = new OverloadResolver (left_operators, OverloadResolver.Restrictions.ProbingOnly, loc);
+
+ var oper_method = res.ResolveOperator (ec, ref args);
+ if (oper_method == null)
return null;
Expression oper_expr;
// TODO: CreateExpressionTree is allocated every time
if ((oper & Operator.LogicalMask) != 0) {
- oper_expr = new ConditionalLogicalOperator (mg.BestCandidate, args, CreateExpressionTree,
+ oper_expr = new ConditionalLogicalOperator (oper_method, args, CreateExpressionTree,
oper == Operator.LogicalAnd, loc).Resolve (ec);
} else {
- oper_expr = new UserOperatorCall (mg.BestCandidate, args, CreateExpressionTree, loc);
+ oper_expr = new UserOperatorCall (oper_method, args, CreateExpressionTree, loc);
}
left = larg.Expr;
concat_args.Add (arguments [pos]);
add_args.Add (new Argument (arguments [pos].CreateExpressionTree (ec)));
- MethodGroupExpr method = CreateConcatMethodGroup ();
- if (method == null)
+ var methods = CreateConcatMethodCandidates ();
+ if (methods == null)
return null;
- method = method.OverloadResolve (ec, ref concat_args, false, loc);
+ var res = new OverloadResolver (methods, OverloadResolver.Restrictions.NoBaseMembers, loc);
+ var method = res.ResolveMember<MethodSpec> (ec, ref concat_args);
if (method == null)
return null;
- add_args.Add (new Argument (method.CreateExpressionTree (ec)));
+ add_args.Add (new Argument (new TypeOfMethod (method, loc)));
Expression expr = CreateExpressionFactoryCall (ec, "Add", add_args);
if (++pos == arguments.Count)
return expr;
- left = new Argument (new EmptyExpression (method.BestCandidate.ReturnType));
+ left = new Argument (new EmptyExpression (method.ReturnType));
return CreateExpressionAddCall (ec, left, expr, pos);
}
arguments.Add (new Argument (operand));
}
- MethodGroupExpr CreateConcatMethodGroup ()
+ IList<MemberSpec> CreateConcatMethodCandidates ()
{
if (concat_members == null) {
- concat_members = MemberCache.FindMembers (type,
- MemberFilter.Method ("Concat", -1, null, type), BindingRestriction.DeclaredOnly);
+ concat_members = MemberCache.FindMembers (type, "Concat", true);
}
- return new MethodGroupExpr (concat_members, type, loc);
+ return concat_members;
}
public override void Emit (EmitContext ec)
{
- var mg = CreateConcatMethodGroup ();
- mg = mg.OverloadResolve (new ResolveContext (ec.MemberContext), ref arguments, false, loc);
- if (mg != null)
- mg.EmitCall (ec, arguments);
+ var members = CreateConcatMethodCandidates ();
+ var res = new OverloadResolver (members, OverloadResolver.Restrictions.NoBaseMembers, loc);
+ var method = res.ResolveMember<MethodSpec> (new ResolveContext (ec.MemberContext), ref arguments);
+ if (method != null)
+ Invocation.EmitCall (ec, null, method, arguments, loc);
}
public override SLE.Expression MakeExpression (BuilderContext ctx)
protected override Expression DoResolve (ResolveContext ec)
{
- Expression member_expr = expr.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup);
+ Expression member_expr;
+ var atn = expr as ATypeNameExpression;
+ if (atn != null) {
+ member_expr = atn.LookupNameExpression (ec, true, true);
+ if (member_expr != null)
+ member_expr = member_expr.Resolve (ec);
+ } else {
+ member_expr = expr.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup);
+ }
+
if (member_expr == null)
return null;
return null;
}
- mg = ec.LookupExtensionMethod (me.Type, me.Name, -1, loc);
- if (mg == null) {
- ec.Report.Error (1955, loc, "The member `{0}' cannot be used as method or delegate",
+ ec.Report.Error (1955, loc, "The member `{0}' cannot be used as method or delegate",
member_expr.GetSignatureForError ());
- return null;
- }
-
- ((ExtensionMethodGroupExpr) mg).ExtensionExpression = me.InstanceExpression;
+ return null;
}
}
type = method.ReturnType;
}
- //
- // Only base will allow this invocation to happen.
- //
- if (mg.IsBase && method.IsAbstract){
- Error_CannotCallAbstractBase (ec, TypeManager.CSharpSignature (method));
- return null;
- }
-
if (arguments == null && method.DeclaringType == TypeManager.object_type && method.Name == Destructor.MetadataName) {
if (mg.IsBase)
ec.Report.Error (250, loc, "Do not directly call your base class Finalize method. It is called automatically from your destructor");
MemberAccess ma = expr as MemberAccess;
if (ma != null) {
- var left_type = ma.Left as TypeExpr;
+ var left_type = ma.LeftExpression as TypeExpr;
if (left_type != null) {
args.Insert (0, new Argument (new TypeOf (left_type, loc).Resolve (ec), Argument.AType.DynamicTypeName));
} else {
- args.Insert (0, new Argument (ma.Left));
+ args.Insert (0, new Argument (ma.LeftExpression.Resolve (ec)));
}
} else { // is SimpleName
if (ec.IsStatic) {
protected virtual MethodGroupExpr DoResolveOverload (ResolveContext ec)
{
- return mg.OverloadResolve (ec, ref arguments, false, loc);
+ return mg.OverloadResolve (ec, ref arguments, null, OverloadResolver.Restrictions.None);
+ }
+
+ //
+ // If a member is a method or event, or if it is a constant, field or property of either a delegate type
+ // or the type dynamic, then the member is invocable
+ //
+ public static bool IsMemberInvocable (MemberSpec member)
+ {
+ switch (member.Kind) {
+ case MemberKind.Event:
+ return true;
+ case MemberKind.Field:
+ case MemberKind.Property:
+ var m = member as IInterfaceMemberSpec;
+ return m.MemberType.IsDelegate || m.MemberType == InternalType.Dynamic;
+ default:
+ return false;
+ }
}
public static bool IsSpecialMethodInvocation (ResolveContext ec, MethodSpec method, Location loc)
if (!method.IsReservedMethod)
return false;
- if (ec.HasSet (ResolveContext.Options.InvokeSpecialName))
+ if (ec.HasSet (ResolveContext.Options.InvokeSpecialName) || ec.CurrentMemberDefinition.IsCompilerGenerated)
return false;
ec.Report.SymbolRelatedToPreviousError (method);
//
protected Expression RequestedType;
- protected MethodGroupExpr method;
+ protected MethodSpec method;
public New (Expression requested_type, Arguments arguments, Location l)
{
args.Add (new Argument (new TypeOf (new TypeExpression (type, loc), loc)));
} else {
args = Arguments.CreateForExpressionTree (ec,
- Arguments,
- method.CreateExpressionTree (ec));
+ Arguments, new TypeOfMethod (method, loc));
}
return CreateExpressionFactoryCall (ec, "New", args);
return null;
type = texpr.Type;
+ eclass = ExprClass.Value;
if (type.IsPointer) {
ec.Report.Error (1919, loc, "Unsafe type `{0}' cannot be used in an object creation expression",
}
}
- eclass = ExprClass.Value;
return this;
}
return null;
}
- bool is_struct = TypeManager.IsStruct (type);
- eclass = ExprClass.Value;
-
//
- // SRE returns a match for .ctor () on structs (the object constructor),
- // so we have to manually ignore it.
+ // Any struct always defines parameterless constructor
//
- if (is_struct && Arguments == null)
+ if (type.IsStruct && Arguments == null)
return this;
- // For member-lookup, treat 'new Foo (bar)' as call to 'foo.ctor (bar)', where 'foo' is of type 'Foo'.
- Expression ml = MemberLookupFinal (ec, type, type, ConstructorInfo.ConstructorName, 0,
- MemberKind.Constructor, BindingRestriction.AccessibleOnly | BindingRestriction.DeclaredOnly, loc);
-
bool dynamic;
if (Arguments != null) {
Arguments.Resolve (ec, out dynamic);
dynamic = false;
}
- if (ml == null)
- return null;
-
- method = ml as MethodGroupExpr;
- if (method == null) {
- ml.Error_UnexpectedKind (ec, ResolveFlags.MethodGroup, loc);
- return null;
- }
-
- method = method.OverloadResolve (ec, ref Arguments, false, loc);
- if (method == null)
- return null;
+ method = ConstructorLookup (ec, type, ref Arguments, loc);
if (dynamic) {
Arguments.Insert (0, new Argument (new TypeOf (texpr, loc).Resolve (ec), Argument.AType.DynamicTypeName));
}
if (vr != null) {
- ec.Emit (OpCodes.Call, method.BestCandidate);
+ ec.Emit (OpCodes.Call, method);
return false;
}
}
if (type is TypeParameterSpec)
return DoEmitTypeParameter (ec);
- ec.Emit (OpCodes.Newobj, method.BestCandidate);
+ ec.Emit (OpCodes.Newobj, method);
return true;
}
if (Arguments != null)
Arguments.Emit (ec);
- ec.Emit (OpCodes.Call, method.BestCandidate);
+ ec.Emit (OpCodes.Call, method);
}
value_target.AddressOf (ec, mode);
public override SLE.Expression MakeExpression (BuilderContext ctx)
{
- return SLE.Expression.New ((ConstructorInfo) method.BestCandidate.GetMetaInfo (), Arguments.MakeExpression (Arguments, ctx));
+ return SLE.Expression.New ((ConstructorInfo) method.GetMetaInfo (), Arguments.MakeExpression (Arguments, ctx));
}
}
return alias + "::" + name;
}
+ public override Expression LookupNameExpression (ResolveContext rc, bool readMode, bool invocableOnly)
+ {
+ return DoResolve (rc);
+ }
+
protected override void CloneTo (CloneContext clonectx, Expression t)
{
// Nothing
/// <summary>
/// Implements the member access expression
/// </summary>
- public class MemberAccess : ATypeNameExpression {
+ public class MemberAccess : ATypeNameExpression
+ {
protected Expression expr;
public MemberAccess (Expression expr, string id)
this.expr = expr;
}
- Expression DoResolve (ResolveContext ec, Expression right_side)
+ public Expression LeftExpression {
+ get {
+ return expr;
+ }
+ }
+
+ protected override Expression DoResolve (ResolveContext ec)
+ {
+ return DoResolveName (ec, null);
+ }
+
+ public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
{
- if (type != null)
- throw new Exception ();
+ return DoResolveName (ec, right_side);
+ }
+
+ Expression DoResolveName (ResolveContext rc, Expression right_side)
+ {
+ Expression e = LookupNameExpression (rc, right_side == null, false);
+ if (e == null)
+ return null;
+
+ if (right_side != null)
+ e = e.ResolveLValue (rc, right_side);
+ else
+ e = e.Resolve (rc, ResolveFlags.VariableOrValue | ResolveFlags.Type);
+
+ return e;
+ }
+
+ public override Expression LookupNameExpression (ResolveContext rc, bool readMode, bool invocableOnly)
+ {
+ var sn = expr as SimpleName;
+ const ResolveFlags flags = ResolveFlags.VariableOrValue | ResolveFlags.Type;
//
// Resolve the expression with flow analysis turned off, we'll do the definite
// will resolve to - it may resolve to a FieldExpr and in this case we must do the
// definite assignment check on the actual field and not on the whole struct.
//
-
- SimpleName original = expr as SimpleName;
- Expression expr_resolved;
- const ResolveFlags flags = ResolveFlags.VariableOrValue | ResolveFlags.Type;
-
- using (ec.Set (ResolveContext.Options.OmitStructFlowAnalysis)) {
- if (original != null) {
- expr_resolved = original.DoResolve (ec, true);
- if (expr_resolved != null) {
- // Ugly, simulate skipped Resolve
- if (expr_resolved is ConstantExpr) {
- expr_resolved = expr_resolved.Resolve (ec);
- } else if (expr_resolved is FieldExpr || expr_resolved is PropertyExpr) {
- // nothing yet
- } else if ((flags & expr_resolved.ExprClassToResolveFlags) == 0) {
- expr_resolved.Error_UnexpectedKind (ec, flags, expr.Location);
- expr_resolved = null;
+ using (rc.Set (ResolveContext.Options.OmitStructFlowAnalysis)) {
+ if (sn != null) {
+ expr = sn.LookupNameExpression (rc, true, false);
+
+ // Call resolve on expression which does have type set as we need expression type
+ // TODO: I should probably ensure that the type is always set and leave resolve for the final
+ if (expr is VariableReference || expr is ConstantExpr || expr is Linq.TransparentMemberAccess) {
+ using (rc.With (ResolveContext.Options.DoFlowAnalysis, false)) {
+ expr = expr.Resolve (rc);
}
+ } else if (expr is TypeParameterExpr) {
+ expr.Error_UnexpectedKind (rc, flags, expr.Location);
+ expr = null;
}
} else {
- expr_resolved = expr.Resolve (ec, flags);
+ expr = expr.Resolve (rc, flags);
}
}
- if (expr_resolved == null)
+ if (expr == null)
return null;
- Namespace ns = expr_resolved as Namespace;
+ Namespace ns = expr as Namespace;
if (ns != null) {
- FullNamedExpression retval = ns.Lookup (ec.Compiler, Name, Arity, loc);
+ FullNamedExpression retval = ns.Lookup (rc.Compiler, Name, Arity, loc);
+
+ if (retval == null) {
+ ns.Error_NamespaceDoesNotExist (loc, Name, Arity, rc);
+ return null;
+ }
- if (retval == null)
- ns.Error_NamespaceDoesNotExist (loc, Name, Arity, ec);
- else if (HasTypeArguments)
- retval = new GenericTypeExpr (retval.Type, targs, loc).ResolveAsTypeStep (ec, false);
+ if (HasTypeArguments)
+ return new GenericTypeExpr (retval.Type, targs, loc);
- expr = expr_resolved;
return retval;
}
- TypeSpec expr_type = expr_resolved.Type;
+ TypeSpec expr_type = expr.Type;
if (expr_type == InternalType.Dynamic) {
Arguments args = new Arguments (1);
- args.Add (new Argument (expr_resolved.Resolve (ec)));
- expr = new DynamicMemberBinder (Name, args, loc);
- if (right_side != null)
- return expr.DoResolveLValue (ec, right_side);
-
- return expr.Resolve (ec);
+ args.Add (new Argument (expr));
+ return new DynamicMemberBinder (Name, args, loc);
}
-
const MemberKind dot_kinds = MemberKind.Class | MemberKind.Struct | MemberKind.Delegate | MemberKind.Enum |
MemberKind.Interface | MemberKind.TypeParameter | MemberKind.ArrayType;
if ((expr_type.Kind & dot_kinds) == 0 || expr_type == TypeManager.void_type) {
- Unary.Error_OperatorCannotBeApplied (ec, loc, ".", expr_type);
+ Unary.Error_OperatorCannotBeApplied (rc, loc, ".", expr_type);
return null;
}
- var arity = HasTypeArguments ? targs.Count : -1;
-
- var member_lookup = MemberLookup (ec.Compiler,
- ec.CurrentType, expr_type, expr_type, Name, arity, BindingRestriction.DefaultMemberLookup, loc);
-
- if (member_lookup == null) {
- expr = expr_resolved.Resolve (ec);
+ var current_type = rc.CurrentType;
+ var lookup_arity = Arity;
+ bool errorMode = false;
+ Expression member_lookup;
+ while (true) {
+ member_lookup = MemberLookup (errorMode ? null : rc, current_type, expr_type, Name, lookup_arity, invocableOnly, loc);
+ if (member_lookup == null) {
+ //
+ // Try to look for extension method when member lookup failed
+ //
+ if (MethodGroupExpr.IsExtensionMethodArgument (expr)) {
+ NamespaceEntry scope = null;
+ var methods = rc.LookupExtensionMethod (expr_type, Name, lookup_arity, ref scope);
+ if (methods != null) {
+ var emg = new ExtensionMethodGroupExpr (methods, scope, expr, loc);
+ if (HasTypeArguments) {
+ if (!targs.Resolve (rc))
+ return null;
+
+ emg.SetTypeArguments (rc, targs);
+ }
+
+ // TODO: Should it really skip the checks bellow
+ return emg.Resolve (rc);
+ }
+ }
+ }
- ExprClass expr_eclass = expr.eclass;
+ if (errorMode) {
+ if (member_lookup == null) {
+ if (expr is TypeExpr)
+ base.Error_TypeDoesNotContainDefinition (rc, expr_type, Name);
+ else
+ Error_TypeDoesNotContainDefinition (rc, expr_type, Name);
- //
- // Extension methods are not allowed on all expression types
- //
- if (expr_eclass == ExprClass.Value || expr_eclass == ExprClass.Variable ||
- expr_eclass == ExprClass.IndexerAccess || expr_eclass == ExprClass.PropertyAccess ||
- expr_eclass == ExprClass.EventAccess) {
- ExtensionMethodGroupExpr ex_method_lookup = ec.LookupExtensionMethod (expr_type, Name, arity, loc);
- if (ex_method_lookup != null) {
- ex_method_lookup.ExtensionExpression = expr;
-
- if (HasTypeArguments) {
- if (!targs.Resolve (ec))
- return null;
-
- ex_method_lookup.SetTypeArguments (ec, targs);
- }
+ return null;
+ }
- return ex_method_lookup.Resolve (ec);
+ if (member_lookup is MethodGroupExpr) {
+ // Leave it to overload resolution to report correct error
+ } else {
+ // TODO: rc.SymbolRelatedToPreviousError
+ ErrorIsInaccesible (rc, member_lookup.GetSignatureForError (), loc);
}
+ break;
}
- member_lookup = Error_MemberLookupFailed (ec,
- ec.CurrentType, expr_type, expr_type, Name, arity, null,
- MemberKind.All, BindingRestriction.AccessibleOnly);
- if (member_lookup == null)
- return null;
- }
+ if (member_lookup != null)
+ break;
- expr = expr_resolved;
+ current_type = null;
+ lookup_arity = 0;
+ invocableOnly = false;
+ errorMode = true;
+ }
MemberExpr me;
TypeExpr texpr = member_lookup as TypeExpr;
+
if (texpr != null) {
- if (!(expr_resolved is TypeExpr)) {
- me = expr_resolved as MemberExpr;
- if (me == null || me.ProbeIdenticalTypeName (ec, expr_resolved, original) == expr_resolved) {
- ec.Report.Error (572, loc, "`{0}': cannot reference a type through an expression; try `{1}' instead",
+ if (!(expr is TypeExpr)) {
+ me = expr as MemberExpr;
+ if (me == null || me.ProbeIdenticalTypeName (rc, expr, sn) == expr) {
+ rc.Report.Error (572, loc, "`{0}': cannot reference a type through an expression; try `{1}' instead",
Name, member_lookup.GetSignatureForError ());
return null;
}
}
- if (!texpr.CheckAccessLevel (ec.MemberContext)) {
- ec.Report.SymbolRelatedToPreviousError (member_lookup.Type);
- ErrorIsInaccesible (loc, TypeManager.CSharpName (member_lookup.Type), ec.Report);
+ if (!texpr.Type.IsAccessible (rc.CurrentType)) {
+ rc.Report.SymbolRelatedToPreviousError (member_lookup.Type);
+ ErrorIsInaccesible (rc, member_lookup.Type.GetSignatureForError (), loc);
return null;
}
if (HasTypeArguments) {
- var ct = new GenericTypeExpr (member_lookup.Type, targs, loc);
- return ct.ResolveAsTypeStep (ec, false);
+ return new GenericTypeExpr (member_lookup.Type, targs, loc);
}
return member_lookup;
}
- me = (MemberExpr) member_lookup;
+ me = member_lookup as MemberExpr;
- if (original != null && me.IsStatic)
- expr_resolved = me.ProbeIdenticalTypeName (ec, expr_resolved, original);
+ if (sn != null && me.IsStatic)
+ expr = me.ProbeIdenticalTypeName (rc, expr, sn);
- me = me.ResolveMemberAccess (ec, expr_resolved, original);
+ me = me.ResolveMemberAccess (rc, expr, sn);
- if (HasTypeArguments) {
- if (!targs.Resolve (ec))
+ if (Arity > 0) {
+ if (!targs.Resolve (rc))
return null;
- me.SetTypeArguments (ec, targs);
+ me.SetTypeArguments (rc, targs);
}
- if (original != null && (!TypeManager.IsValueType (expr_type) || me is PropertyExpr)) {
+ if (sn != null && (!TypeManager.IsValueType (expr_type) || me is PropertyExpr)) {
if (me.IsInstance) {
- LocalVariableReference var = expr_resolved as LocalVariableReference;
- if (var != null && !var.VerifyAssigned (ec))
+ LocalVariableReference var = expr as LocalVariableReference;
+ if (var != null && !var.VerifyAssigned (rc))
return null;
}
}
- // The following DoResolve/DoResolveLValue will do the definite assignment
- // check.
-
- if (right_side != null)
- return me.DoResolveLValue (ec, right_side);
- else
- return me.Resolve (ec);
- }
-
- protected override Expression DoResolve (ResolveContext ec)
- {
- return DoResolve (ec, null);
- }
-
- public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
- {
- return DoResolve (ec, right_side);
+ return me;
}
public override FullNamedExpression ResolveAsTypeStep (IMemberContext ec, bool silent)
return null;
}
- bool extra_check;
- if (!IsMemberAccessible (rc.CurrentType ?? InternalType.FakeInternalType, nested, out extra_check)) {
- ErrorIsInaccesible (loc, nested.GetSignatureForError (), rc.Compiler.Report);
+ if (!nested.IsAccessible (rc.CurrentType ?? InternalType.FakeInternalType)) {
+ ErrorIsInaccesible (rc, nested.GetSignatureForError (), loc);
}
TypeExpr texpr;
return;
}
- var member_lookup = MemberLookup (rc.Compiler,
- rc.CurrentType, expr_type, expr_type, identifier, -1,
- MemberKind.All, BindingRestriction.None, loc);
-
- if (member_lookup == null) {
- rc.Compiler.Report.Error (426, loc, "The nested type `{0}' does not exist in the type `{1}'",
- Name, expr_type.GetSignatureForError ());
- } else {
- // TODO: Report.SymbolRelatedToPreviousError
- member_lookup.Error_UnexpectedKind (rc.Compiler.Report, null, "type", loc);
+ var any_other_member = MemberLookup (null, rc.CurrentType, expr_type, Name, 0, false, loc);
+ if (any_other_member != null) {
+ any_other_member.Error_UnexpectedKind (rc.Compiler.Report, null, "type", loc);
+ return;
}
+
+ rc.Compiler.Report.Error (426, loc, "The nested type `{0}' does not exist in the type `{1}'",
+ Name, expr_type.GetSignatureForError ());
}
protected override void Error_TypeDoesNotContainDefinition (ResolveContext ec, TypeSpec type, string name)
{
- if (RootContext.Version > LanguageVersion.ISO_2 && !ec.Compiler.IsRuntimeBinder && !(expr is BaseThis) &&
- ((expr.eclass & (ExprClass.Value | ExprClass.Variable)) != 0)) {
- ec.Report.Error (1061, loc, "Type `{0}' does not contain a definition for `{1}' and no " +
- "extension method `{1}' of type `{0}' could be found " +
- "(are you missing a using directive or an assembly reference?)",
- TypeManager.CSharpName (type), name);
+ if (RootContext.Version > LanguageVersion.ISO_2 && !ec.Compiler.IsRuntimeBinder && MethodGroupExpr.IsExtensionMethodArgument (expr)) {
+ ec.Report.Error (1061, loc,
+ "Type `{0}' does not contain a definition for `{1}' and no extension method `{1}' of type `{0}' could be found (are you missing a using directive or an assembly reference?)",
+ type.GetSignatureForError (), name);
return;
}
return expr.GetSignatureForError () + "." + base.GetSignatureForError ();
}
- public Expression Left {
- get {
- return expr;
- }
- }
-
protected override void CloneTo (CloneContext clonectx, Expression t)
{
MemberAccess target = (MemberAccess) t;
this.Arguments = args;
}
+ //
+ // We perform some simple tests, and then to "split" the emit and store
+ // code we create an instance of a different class, and return that.
+ //
+ Expression CreateAccessExpression (ResolveContext ec)
+ {
+ if (type.IsArray)
+ return (new ArrayAccess (this, loc));
+
+ if (type.IsPointer)
+ return MakePointerAccess (ec, type);
+
+ FieldExpr fe = Expr as FieldExpr;
+ if (fe != null) {
+ var ff = fe.Spec as FixedFieldSpec;
+ if (ff != null) {
+ return MakePointerAccess (ec, ff.ElementType);
+ }
+ }
+
+ var indexers = MemberCache.FindMembers (type, MemberCache.IndexerNameAlias, false);
+ if (indexers != null || type == InternalType.Dynamic) {
+ return new IndexerExpr (indexers, this);
+ }
+
+ ec.Report.Error (21, loc, "Cannot apply indexing with [] to an expression of type `{0}'",
+ type.GetSignatureForError ());
+ return null;
+ }
+
public override Expression CreateExpressionTree (ResolveContext ec)
{
Arguments args = Arguments.CreateForExpressionTree (ec, Arguments,
return CreateExpressionFactoryCall (ec, "ArrayIndex", args);
}
- Expression MakePointerAccess (ResolveContext ec, TypeSpec t)
+ Expression MakePointerAccess (ResolveContext ec, TypeSpec type)
{
if (Arguments.Count != 1){
ec.Report.Error (196, loc, "A pointer must be indexed by only one value");
if (Arguments [0] is NamedArgument)
Error_NamedArgument ((NamedArgument) Arguments[0], ec.Report);
- Expression p = new PointerArithmetic (Binary.Operator.Addition, Expr, Arguments [0].Expr.Resolve (ec), t, loc);
- return new Indirection (p, loc).Resolve (ec);
+ Expression p = new PointerArithmetic (Binary.Operator.Addition, Expr, Arguments [0].Expr.Resolve (ec), type, loc);
+ return new Indirection (p, loc);
}
protected override Expression DoResolve (ResolveContext ec)
if (Expr == null)
return null;
- //
- // We perform some simple tests, and then to "split" the emit and store
- // code we create an instance of a different class, and return that.
- //
- TypeSpec t = Expr.Type;
+ type = Expr.Type;
- if (t.IsArray)
- return (new ArrayAccess (this, loc)).Resolve (ec);
- if (t.IsPointer)
- return MakePointerAccess (ec, t);
+ // TODO: Create 1 result for Resolve and ResolveLValue ?
+ var res = CreateAccessExpression (ec);
+ if (res == null)
+ return null;
- FieldExpr fe = Expr as FieldExpr;
- if (fe != null) {
- var ff = fe.Spec as FixedFieldSpec;
- if (ff != null) {
- return MakePointerAccess (ec, ff.ElementType);
- }
- }
- return (new IndexerAccess (this, loc)).Resolve (ec);
+ return res.Resolve (ec);
}
public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
return null;
type = Expr.Type;
- if (type.IsArray)
- return (new ArrayAccess (this, loc)).DoResolveLValue (ec, right_side);
-
- if (type.IsPointer)
- return MakePointerAccess (ec, type);
- if (Expr.eclass != ExprClass.Variable && TypeManager.IsStruct (type))
- Error_CannotModifyIntermediateExpressionValue (ec);
+ var res = CreateAccessExpression (ec);
+ if (res == null)
+ return null;
- return (new IndexerAccess (this, loc)).DoResolveLValue (ec, right_side);
+ return res.ResolveLValue (ec, right_side);
}
public override void Emit (EmitContext ec)
ec.EmitArrayAddress (ac);
}
-#if NET_4_0
- public SLE.Expression MakeAssignExpression (BuilderContext ctx)
+ public SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source)
{
+#if NET_4_0
return SLE.Expression.ArrayAccess (
ea.Expr.MakeExpression (ctx),
Arguments.MakeExpression (ea.Arguments, ctx));
- }
+#else
+ throw new NotImplementedException ();
#endif
+ }
public override SLE.Expression MakeExpression (BuilderContext ctx)
{
}
}
- /// <summary>
- /// Expressions that represent an indexer call.
- /// </summary>
- class IndexerAccess : Expression, IDynamicAssign
+ //
+ // Indexer access expression
+ //
+ class IndexerExpr : PropertyOrIndexerExpr<IndexerSpec>, OverloadResolver.IBaseMembersProvider
{
- class IndexerMethodGroupExpr : MethodGroupExpr
- {
- IEnumerable<IndexerSpec> candidates;
-
- public IndexerMethodGroupExpr (IEnumerable<IndexerSpec> indexers, Location loc)
- : base (FilterAccessors (indexers).ToList (), null, loc)
- {
- candidates = indexers;
- }
-
- public IndexerSpec BestIndexer ()
- {
- return MemberCache.FindIndexers (BestCandidate.DeclaringType, BindingRestriction.None).
- Where (l =>
- (l.HasGet && l.Get.MemberDefinition == BestCandidate.MemberDefinition) ||
- (l.HasSet && l.Set.MemberDefinition == BestCandidate.MemberDefinition)).First ();
- }
-
- static IEnumerable<MemberSpec> FilterAccessors (IEnumerable<IndexerSpec> indexers)
- {
- foreach (IndexerSpec i in indexers) {
- if (i.HasGet)
- yield return i.Get;
- else
- yield return i.Set;
- }
- }
-
- protected override IList<MemberSpec> GetBaseTypeMethods (ResolveContext rc, TypeSpec type)
- {
- candidates = GetIndexersForType (type);
- if (candidates == null)
- return null;
-
- return FilterAccessors (candidates).ToList ();
- }
-
- public override string Name {
- get {
- return "this";
- }
- }
-
- protected override int GetApplicableParametersCount (MethodSpec method, AParametersCollection parameters)
- {
- //
- // Here is the trick, decrease number of arguments by 1 when only
- // available property method is setter. This makes overload resolution
- // work correctly for indexers.
- //
-
- if (method.Name [0] == 'g')
- return parameters.Count;
-
- return parameters.Count - 1;
- }
- }
-
- //
- // Points to our "data" repository
- //
- IndexerSpec spec;
- bool prepared;
- LocalTemporary temp;
LocalTemporary prepared_value;
- Expression set_expr;
-
- protected TypeSpec indexer_type;
- protected Expression instance_expr;
- protected Arguments arguments;
+ IList<MemberSpec> indexers;
+ Arguments arguments;
- public IndexerAccess (ElementAccess ea, Location loc)
+ public IndexerExpr (IList<MemberSpec> indexers, ElementAccess ea)
+ : base (ea.Location)
{
- this.instance_expr = ea.Expr;
+ this.indexers = indexers;
+ this.InstanceExpression = ea.Expr;
this.arguments = ea.Arguments;
- this.loc = loc;
- }
-
- static string GetAccessorName (bool isSet)
- {
- return isSet ? "set" : "get";
- }
-
- public override Expression CreateExpressionTree (ResolveContext ec)
- {
- Arguments args = Arguments.CreateForExpressionTree (ec, arguments,
- instance_expr.CreateExpressionTree (ec),
- new TypeOfMethod (spec.Get, loc));
-
- return CreateExpressionFactoryCall (ec, "Call", args);
- }
-
- static IEnumerable<IndexerSpec> GetIndexersForType (TypeSpec lookup_type)
- {
- return MemberCache.FindIndexers (lookup_type, BindingRestriction.AccessibleOnly | BindingRestriction.DefaultMemberLookup);
}
- protected override Expression DoResolve (ResolveContext ec)
- {
- return ResolveAccessor (ec, null);
- }
-
- public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
- {
- if (right_side == EmptyExpression.OutAccess.Instance) {
- right_side.DoResolveLValue (ec, this);
- return null;
- }
-
- // if the indexer returns a value type, and we try to set a field in it
- if (right_side == EmptyExpression.LValueMemberAccess || right_side == EmptyExpression.LValueMemberOutAccess) {
- Error_CannotModifyIntermediateExpressionValue (ec);
+ #region Properties
+ protected override TypeSpec DeclaringType {
+ get {
+ return best_candidate.DeclaringType;
}
-
- return ResolveAccessor (ec, right_side);
}
- Expression ResolveAccessor (ResolveContext ec, Expression right_side)
- {
- indexer_type = instance_expr.Type;
-
- bool dynamic;
- arguments.Resolve (ec, out dynamic);
-
- if (indexer_type == InternalType.Dynamic) {
- dynamic = true;
- } else {
- var ilist = GetIndexersForType (indexer_type);
- if (ilist == null) {
- ec.Report.Error (21, loc, "Cannot apply indexing with [] to an expression of type `{0}'",
- TypeManager.CSharpName (indexer_type));
- return null;
- }
-
- var mg = new IndexerMethodGroupExpr (ilist, loc) {
- InstanceExpression = instance_expr
- };
-
- mg = mg.OverloadResolve (ec, ref arguments, false, loc) as IndexerMethodGroupExpr;
- if (mg == null)
- return null;
-
- if (!dynamic)
- spec = mg.BestIndexer ();
- }
-
- if (dynamic) {
- Arguments args = new Arguments (arguments.Count + 1);
- if (instance_expr is BaseThis) {
- ec.Report.Error (1972, loc, "The indexer base access cannot be dynamically dispatched. Consider casting the dynamic arguments or eliminating the base access");
- } else {
- args.Add (new Argument (instance_expr));
- }
- args.AddRange (arguments);
-
- var expr = new DynamicIndexBinder (args, loc);
- if (right_side != null)
- return expr.ResolveLValue (ec, right_side);
-
- return expr.Resolve (ec);
- }
-
- type = spec.MemberType;
- if (type.IsPointer && !ec.IsUnsafe)
- UnsafeError (ec, loc);
-
- MethodSpec accessor;
- if (right_side == null) {
- accessor = spec.Get;
- } else {
- accessor = spec.Set;
- if (!spec.HasSet && spec.HasGet) {
- ec.Report.SymbolRelatedToPreviousError (spec);
- ec.Report.Error (200, loc, "The read only property or indexer `{0}' cannot be assigned to",
- spec.GetSignatureForError ());
- return null;
- }
-
- set_expr = Convert.ImplicitConversion (ec, right_side, type, loc);
- }
-
- if (accessor == null) {
- ec.Report.SymbolRelatedToPreviousError (spec);
- ec.Report.Error (154, loc, "The property or indexer `{0}' cannot be used in this context because it lacks a `{1}' accessor",
- spec.GetSignatureForError (), GetAccessorName (right_side != null));
- return null;
+ public override bool IsInstance {
+ get {
+ return true;
}
+ }
- //
- // Only base will allow this invocation to happen.
- //
- if (spec.IsAbstract && instance_expr is BaseThis) {
- Error_CannotCallAbstractBase (ec, spec.GetSignatureForError ());
+ public override bool IsStatic {
+ get {
+ return false;
}
+ }
- bool must_do_cs1540_check;
- if (!IsMemberAccessible (ec.CurrentType, accessor, out must_do_cs1540_check)) {
- if (spec.HasDifferentAccessibility) {
- ec.Report.SymbolRelatedToPreviousError (accessor);
- ec.Report.Error (271, loc, "The property or indexer `{0}' cannot be used in this context because a `{1}' accessor is inaccessible",
- TypeManager.GetFullNameSignature (spec), GetAccessorName (right_side != null));
- } else {
- ec.Report.SymbolRelatedToPreviousError (spec);
- ErrorIsInaccesible (loc, TypeManager.GetFullNameSignature (spec), ec.Report);
- }
+ public override string Name {
+ get {
+ return "this";
}
+ }
- instance_expr.CheckMarshalByRefAccess (ec);
+ #endregion
- if (must_do_cs1540_check && (instance_expr != EmptyExpression.Null) &&
- !(instance_expr is BaseThis) &&
- !TypeManager.IsInstantiationOfSameGenericType (instance_expr.Type, ec.CurrentType) &&
- !TypeManager.IsNestedChildOf (ec.CurrentType, instance_expr.Type) &&
- !TypeManager.IsSubclassOf (instance_expr.Type, ec.CurrentType)) {
- ec.Report.SymbolRelatedToPreviousError (accessor);
- Error_CannotAccessProtected (ec, loc, spec, instance_expr.Type, ec.CurrentType);
- return null;
- }
+ public override Expression CreateExpressionTree (ResolveContext ec)
+ {
+ Arguments args = Arguments.CreateForExpressionTree (ec, arguments,
+ InstanceExpression.CreateExpressionTree (ec),
+ new TypeOfMethod (Getter, loc));
- eclass = ExprClass.IndexerAccess;
- return this;
+ return CreateExpressionFactoryCall (ec, "Call", args);
}
- public override void Emit (EmitContext ec)
- {
- Emit (ec, false);
- }
-
- public void Emit (EmitContext ec, bool leave_copy)
+ public override void Emit (EmitContext ec, bool leave_copy)
{
if (prepared) {
prepared_value.Emit (ec);
} else {
- Invocation.EmitCall (ec, instance_expr, spec.Get,
- arguments, loc, false, false);
+ Invocation.EmitCall (ec, InstanceExpression, Getter, arguments, loc, false, false);
}
if (leave_copy) {
}
}
- //
- // source is ignored, because we already have a copy of it from the
- // LValue resolution and we have already constructed a pre-cached
- // version of the arguments (ea.set_arguments);
- //
- public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
+ public override void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
{
prepared = prepare_for_load;
- Expression value = set_expr;
+ Expression value = source;
if (prepared) {
- Invocation.EmitCall (ec, instance_expr, spec.Get,
+ Invocation.EmitCall (ec, InstanceExpression, Getter,
arguments, loc, true, false);
prepared_value = new LocalTemporary (type);
if (!prepared)
arguments.Add (new Argument (value));
- Invocation.EmitCall (ec, instance_expr, spec.Set, arguments, loc, false, prepared);
+ Invocation.EmitCall (ec, InstanceExpression, Setter, arguments, loc, false, prepared);
if (temp != null) {
temp.Emit (ec);
temp.Release (ec);
}
}
-
+
public override string GetSignatureForError ()
{
- return spec.GetSignatureForError ();
+ return best_candidate.GetSignatureForError ();
}
-
-#if NET_4_0
- public SLE.Expression MakeAssignExpression (BuilderContext ctx)
+
+ public override SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source)
{
- var value = new[] { set_expr.MakeExpression (ctx) };
+ var value = new[] { source.MakeExpression (ctx) };
var args = Arguments.MakeExpression (arguments, ctx).Concat (value);
-
+#if NET_4_0
return SLE.Expression.Block (
- SLE.Expression.Call (instance_expr.MakeExpression (ctx), (MethodInfo) spec.Set.GetMetaInfo (), args),
+ SLE.Expression.Call (InstanceExpression.MakeExpression (ctx), (MethodInfo) Setter.GetMetaInfo (), args),
value [0]);
- }
+#else
+ return args.First ();
#endif
+ }
public override SLE.Expression MakeExpression (BuilderContext ctx)
{
var args = Arguments.MakeExpression (arguments, ctx);
- return SLE.Expression.Call (instance_expr.MakeExpression (ctx), (MethodInfo) spec.Get.GetMetaInfo (), args);
+ return SLE.Expression.Call (InstanceExpression.MakeExpression (ctx), (MethodInfo) Getter.GetMetaInfo (), args);
+ }
+
+ protected override Expression OverloadResolve (ResolveContext rc, Expression right_side)
+ {
+ if (best_candidate != null)
+ return this;
+
+ eclass = ExprClass.IndexerAccess;
+
+ bool dynamic;
+ arguments.Resolve (rc, out dynamic);
+
+ if (indexers == null && InstanceExpression.Type == InternalType.Dynamic) {
+ dynamic = true;
+ } else {
+ var res = new OverloadResolver (indexers, OverloadResolver.Restrictions.None, loc);
+ res.BaseMembersProvider = this;
+
+ // TODO: Do I need 2 argument sets?
+ best_candidate = res.ResolveMember<IndexerSpec> (rc, ref arguments);
+ if (best_candidate != null)
+ type = best_candidate.MemberType;
+ else if (!res.BestCandidateIsDynamic)
+ return null;
+ }
+
+ if (dynamic || type == InternalType.Dynamic) {
+ Arguments args = new Arguments (arguments.Count + 1);
+ if (IsBase) {
+ rc.Report.Error (1972, loc,
+ "The indexer base access cannot be dynamically dispatched. Consider casting the dynamic arguments or eliminating the base access");
+ } else {
+ args.Add (new Argument (InstanceExpression));
+ }
+ args.AddRange (arguments);
+
+ best_candidate = null;
+ return new DynamicIndexBinder (args, loc);
+ }
+
+ ResolveInstanceExpression (rc);
+ CheckProtectedMemberAccess (rc, best_candidate);
+ return this;
}
protected override void CloneTo (CloneContext clonectx, Expression t)
{
- IndexerAccess target = (IndexerAccess) t;
+ IndexerExpr target = (IndexerExpr) t;
if (arguments != null)
target.arguments = arguments.Clone (clonectx);
+ }
- if (instance_expr != null)
- target.instance_expr = instance_expr.Clone (clonectx);
+ public override void SetTypeArguments (ResolveContext ec, TypeArguments ta)
+ {
+ Error_TypeArgumentsCannotBeUsed (ec.Report, "indexer", GetSignatureForError (), loc);
+ }
+
+ #region IBaseMembersProvider Members
+
+ IList<MemberSpec> OverloadResolver.IBaseMembersProvider.GetBaseMembers (TypeSpec baseType)
+ {
+ return baseType == null ? null : MemberCache.FindMembers (baseType, MemberCache.IndexerNameAlias, false);
}
+
+ MethodGroupExpr OverloadResolver.IBaseMembersProvider.LookupExtensionMethod (ResolveContext rc)
+ {
+ return null;
+ }
+
+ #endregion
}
//
eclass = ExprClass.Variable;
}
+ #region Properties
+
+ public override string Name {
+ get {
+ return "base";
+ }
+ }
+
+ #endregion
+
public override Expression CreateExpressionTree (ResolveContext ec)
{
ec.Report.Error (831, loc, "An expression tree may not contain a base access");
return base.CreateExpressionTree (ec);
}
- public override void ResolveBase (ResolveContext ec)
- {
- base.ResolveBase (ec);
- type = ec.CurrentType.BaseType;
- }
-
public override void Emit (EmitContext ec)
{
base.Emit (ec);
ec.Report.Error (1512, loc, "Keyword `base' is not available in the current context");
}
}
+
+ public override void ResolveBase (ResolveContext ec)
+ {
+ base.ResolveBase (ec);
+ type = ec.CurrentType.BaseType;
+ }
}
/// <summary>
public static readonly EmptyExpression LValueMemberAccess = new EmptyExpression ();
public static readonly EmptyExpression LValueMemberOutAccess = new EmptyExpression ();
public static readonly EmptyExpression UnaryAddress = new EmptyExpression ();
+ public static readonly EmptyExpression EventAddition = new EmptyExpression ();
+ public static readonly EmptyExpression EventSubtraction = new EmptyExpression ();
static EmptyExpression temp = new EmptyExpression ();
public static EmptyExpression Grab ()
{
if (source == null)
return EmptyExpressionStatement.Instance;
+
+ var t = ec.CurrentInitializerVariable.Type;
- MemberExpr me = MemberLookupFinal (ec, ec.CurrentInitializerVariable.Type, ec.CurrentInitializerVariable.Type,
- Name, 0, MemberKind.Field | MemberKind.Property, BindingRestriction.AccessibleOnly | BindingRestriction.InstanceOnly | BindingRestriction.DefaultMemberLookup, loc) as MemberExpr;
+ var member = MemberLookup (ec, ec.CurrentType, t, Name, 0, false, loc);
+ if (member == null) {
+ member = Expression.MemberLookup (null, ec.CurrentType, t, Name, 0, false, loc);
+
+ if (member != null) {
+ // TODO: ec.Report.SymbolRelatedToPreviousError (member);
+ ErrorIsInaccesible (ec, member.GetSignatureForError (), loc);
+ return null;
+ }
+ }
+
+ if (member == null) {
+ Error_TypeDoesNotContainDefinition (ec, loc, t, Name);
+ return null;
+ }
+
+ if (!(member is PropertyExpr || member is FieldExpr)) {
+ ec.Report.Error (1913, loc,
+ "Member `{0}' cannot be initialized. An object initializer may only be used for fields, or properties",
+ member.GetSignatureForError ());
- if (me == null)
return null;
+ }
+
+ var me = member as MemberExpr;
+ if (me.IsStatic) {
+ ec.Report.Error (1914, loc,
+ "Static field or property `{0}' cannot be assigned in an object initializer",
+ me.GetSignatureForError ());
+ }
target = me;
me.InstanceExpression = ec.CurrentInitializerVariable;
return base.DoResolve (ec);
}
-
- protected override MemberExpr Error_MemberLookupFailed (ResolveContext ec, TypeSpec type, IList<MemberSpec> members)
- {
- var member = members.First ();
- if (member.Kind != MemberKind.Property && member.Kind != MemberKind.Field)
- ec.Report.Error (1913, loc, "Member `{0}' cannot be initialized. An object " +
- "initializer may only be used for fields, or properties", TypeManager.GetFullNameSignature (member));
- else
- ec.Report.Error (1914, loc, " Static field or property `{0}' cannot be assigned in an object initializer",
- TypeManager.GetFullNameSignature (member));
-
- return null;
- }
-
+
public override void EmitStatement (EmitContext ec)
{
if (source is CollectionOrObjectInitializers)
ctor_args.Add (a.CreateExpressionTree (ec));
Arguments args = new Arguments (3);
- args.Add (new Argument (method.CreateExpressionTree (ec)));
+ args.Add (new Argument (new TypeOfMethod (method, loc)));
args.Add (new Argument (new ArrayCreation (TypeManager.expression_type_expr, ctor_args, loc)));
args.Add (new Argument (new ImplicitlyTypedArrayCreation (init, loc)));
Constraints constraints;
GenericTypeParameterBuilder builder;
-// Variance variance;
TypeParameterSpec spec;
public TypeParameter (DeclSpace parent, int index, MemberName name, Constraints constraints, Attributes attrs, Variance variance)
: base (parent, name, attrs)
{
this.constraints = constraints;
-// this.variance = variance;
this.spec = new TypeParameterSpec (null, index, this, SpecialConstraint.None, variance, null);
}
+ public TypeParameter (TypeParameterSpec spec, DeclSpace parent, TypeSpec parentSpec, MemberName name, Attributes attrs)
+ : base (parent, name, attrs)
+ {
+ this.spec = new TypeParameterSpec (parentSpec, spec.DeclaredPosition, spec.MemberDefinition, spec.SpecialConstraint, spec.Variance, null) {
+ BaseType = spec.BaseType,
+ InterfacesDefined = spec.InterfacesDefined,
+ TypeArguments = spec.TypeArguments
+ };
+ }
+
#region Properties
public override AttributeTargets AttributeTargets {
constraints.CheckGenericConstraints (this);
}
- public TypeParameter CreateHoistedCopy (TypeSpec declaringType)
+ public TypeParameter CreateHoistedCopy (TypeContainer declaringType, TypeSpec declaringSpec)
{
- return new TypeParameter (Parent, spec.DeclaredPosition, MemberName, constraints, null, spec.Variance) {
- spec = new TypeParameterSpec (declaringType, spec.DeclaredPosition, spec.MemberDefinition, spec.SpecialConstraint, spec.Variance, null) {
- BaseType = spec.BaseType,
- InterfacesDefined = spec.InterfacesDefined,
- TypeArguments = spec.TypeArguments
- }
- };
+ return new TypeParameter (spec, declaringType, declaringSpec, MemberName, null);
}
public override bool Define ()
if (constraints != null)
return constraints.Resolve (context, this);
- spec.BaseType = TypeManager.object_type;
+ if (spec.BaseType == null)
+ spec.BaseType = TypeManager.object_type;
+
return true;
}
MethodGroupExpr mg = (MethodGroupExpr) e;
Arguments args = DelegateCreation.CreateDelegateMethodArguments (invoke.Parameters, param_types, e.Location);
- mg = mg.OverloadResolve (ec, ref args, true, e.Location);
+ mg = mg.OverloadResolve (ec, ref args, null, OverloadResolver.Restrictions.Covariant | OverloadResolver.Restrictions.ProbingOnly);
if (mg == null)
return 0;
}
} else if (parameters.IsEmpty && name == Destructor.MetadataName) {
kind = MemberKind.Destructor;
+ if (declaringType == TypeManager.object_type) {
+ mod &= ~Modifiers.OVERRIDE;
+ mod |= Modifiers.VIRTUAL;
+ }
}
}
readonly Method method;
public DynamicMethodGroupExpr (Method method, Location loc)
- : base (null, loc)
+ : base ((IList<MemberSpec>) null, null, loc)
{
this.method = method;
eclass = ExprClass.Unresolved;
{
}
- protected override Expression Error_MemberLookupFailed (ResolveContext ec, TypeSpec container_type, TypeSpec qualifier_type,
- TypeSpec queried_type, string name, int arity, string class_name, MemberKind mt, BindingRestriction bf)
+ protected override void Error_TypeDoesNotContainDefinition (ResolveContext ec, TypeSpec type, string name)
{
ec.Report.Error (1935, loc, "An implementation of `{0}' query expression pattern could not be found. " +
"Are you missing `System.Linq' using directive or `System.Core.dll' assembly reference?",
name);
- return null;
}
}
- protected class QueryExpressionInvocation : Invocation, MethodGroupExpr.IErrorHandler
+ protected class QueryExpressionInvocation : Invocation, OverloadResolver.IErrorHandler
{
public QueryExpressionInvocation (QueryExpressionAccess expr, Arguments arguments)
: base (expr, arguments)
protected override MethodGroupExpr DoResolveOverload (ResolveContext ec)
{
- mg.CustomErrorHandler = this;
- MethodGroupExpr rmg = mg.OverloadResolve (ec, ref arguments, false, loc);
+ MethodGroupExpr rmg = mg.OverloadResolve (ec, ref arguments, this, OverloadResolver.Restrictions.None);
return rmg;
}
- public bool AmbiguousCall (ResolveContext ec, MethodGroupExpr mg, MethodSpec ambiguous)
+ #region IErrorHandler Members
+
+ bool OverloadResolver.IErrorHandler.AmbiguousCandidates (ResolveContext ec, MemberSpec best, MemberSpec ambiguous)
{
- ec.Report.SymbolRelatedToPreviousError (mg.BestCandidate);
+ ec.Report.SymbolRelatedToPreviousError (best);
ec.Report.SymbolRelatedToPreviousError (ambiguous);
ec.Report.Error (1940, loc, "Ambiguous implementation of the query pattern `{0}' for source type `{1}'",
- mg.Name, mg.InstanceExpression.GetSignatureForError ());
+ best.Name, mg.InstanceExpression.GetSignatureForError ());
return true;
}
- public bool NoExactMatch (ResolveContext ec, MethodSpec method)
+ bool OverloadResolver.IErrorHandler.ArgumentMismatch (ResolveContext rc, MemberSpec best, Argument arg, int index)
+ {
+ return false;
+ }
+
+ bool OverloadResolver.IErrorHandler.NoArgumentMatch (ResolveContext rc, MemberSpec best)
+ {
+ return false;
+ }
+
+ bool OverloadResolver.IErrorHandler.TypeInferenceFailed (ResolveContext rc, MemberSpec best)
{
- var pd = method.Parameters;
- TypeSpec source_type = pd.ExtensionMethodType;
+ var ms = (MethodSpec) best;
+ TypeSpec source_type = ms.Parameters.ExtensionMethodType;
if (source_type != null) {
- Argument a = arguments [0];
+ Argument a = arguments[0];
if (TypeManager.IsGenericType (source_type) && TypeManager.ContainsGenericParameters (source_type)) {
TypeInferenceContext tic = new TypeInferenceContext (source_type.TypeArguments);
- tic.OutputTypeInference (ec, a.Expr, source_type);
- if (tic.FixAllTypes (ec)) {
+ tic.OutputTypeInference (rc, a.Expr, source_type);
+ if (tic.FixAllTypes (rc)) {
source_type = source_type.GetDefinition ().MakeGenericType (tic.InferredTypeArguments);
}
}
- if (!Convert.ImplicitConversionExists (ec, a.Expr, source_type)) {
- ec.Report.Error (1936, loc, "An implementation of `{0}' query expression pattern for source type `{1}' could not be found",
- mg.Name, TypeManager.CSharpName (a.Type));
+ if (!Convert.ImplicitConversionExists (rc, a.Expr, source_type)) {
+ rc.Report.Error (1936, loc, "An implementation of `{0}' query expression pattern for source type `{1}' could not be found",
+ best.Name, TypeManager.CSharpName (a.Type));
return true;
}
}
- if (!method.IsGeneric)
- return false;
-
- if (mg.Name == "SelectMany") {
- ec.Report.Error (1943, loc,
+ if (best.Name == "SelectMany") {
+ rc.Report.Error (1943, loc,
"An expression type is incorrect in a subsequent `from' clause in a query expression with source type `{0}'",
- arguments [0].GetSignatureForError ());
+ arguments[0].GetSignatureForError ());
} else {
- ec.Report.Error (1942, loc,
+ rc.Report.Error (1942, loc,
"An expression type in `{0}' clause is incorrect. Type inference failed in the call to `{1}'",
- mg.Name.ToLower (), mg.Name);
+ best.Name.ToLowerInvariant (), best.Name);
}
return true;
}
+
+ #endregion
}
public AQueryClause next;
TransparentParameter tp_cursor = (TransparentParameter) parameters[0];
while (tp_cursor != tp) {
tp_cursor = (TransparentParameter) tp_cursor.Parent;
- expr = new MemberAccess (expr, tp_cursor.Name);
+ expr = new TransparentMemberAccess (expr, tp_cursor.Name);
}
- return new MemberAccess (expr, name);
+ return new TransparentMemberAccess (expr, name);
}
return null;
};
}
}
+
+ sealed class TransparentMemberAccess : MemberAccess
+ {
+ public TransparentMemberAccess (Expression expr, string name)
+ : base (expr, name)
+ {
+ }
+ }
}
{
None = 0,
- // Member has to be accessible
- AccessibleOnly = 1,
-
// Inspect only queried type members
DeclaredOnly = 1 << 1,
// Exclude static
InstanceOnly = 1 << 2,
- // Ignore member overrides
- NoOverrides = 1 << 3,
-
- NoAccessors = 1 << 4,
-
- StopOnFirstMatch = 1 << 5,
-
- DefaultMemberLookup = NoOverrides | StopOnFirstMatch
+ NoAccessors = 1 << 3
}
public struct MemberFilter : IEquatable<MemberSpec>
public readonly TypeSpec MemberType;
int arity; // -1 to ignore the check
- TypeSpec invocation_type;
private MemberFilter (string name, MemberKind kind)
{
Parameters = null;
MemberType = null;
arity = -1;
- invocation_type = null;
}
public MemberFilter (MethodSpec m)
Parameters = m.Parameters;
MemberType = m.ReturnType;
arity = m.Arity;
- invocation_type = null;
}
public MemberFilter (string name, int arity, MemberKind kind, AParametersCollection param, TypeSpec type)
Parameters = param;
MemberType = type;
this.arity = arity;
- invocation_type = null;
- }
-
- public TypeSpec InvocationType {
- get {
- return invocation_type;
- }
- set {
- invocation_type = value;
- }
}
public static MemberFilter Constructor (AParametersCollection param)
}
}
- if (invocation_type != null && !IsAccessible (other))
- return false;
-
return true;
}
- bool IsAccessible (MemberSpec other)
- {
- bool extra;
- return Expression.IsMemberAccessible (invocation_type, other, out extra);
- }
-
#endregion
}
return false;
}
- public static IEnumerable<IndexerSpec> FindIndexers (TypeSpec container, BindingRestriction restrictions)
- {
- var filter = new MemberFilter (IndexerNameAlias, 0, MemberKind.Indexer, null, null);
- var found = FindMembers (container, filter, restrictions);
- return found == null ? null : found.Cast<IndexerSpec> ();
- }
-
public static MemberSpec FindMember (TypeSpec container, MemberFilter filter, BindingRestriction restrictions)
{
do {
continue;
return entry;
-
- // TODO MemberCache:
- //if ((restrictions & BindingRestriction.AccessibleOnly) != 0)
- // throw new NotImplementedException ("net");
}
}
}
//
- // Returns the first set of members starting from
- // container, the returned list must not be modified
+ // A special method to work with member lookup only. It returns a list of all members named @name
+ // starting from @container. It's very performance sensitive
//
- public static IList<MemberSpec> FindMembers (TypeSpec container, MemberFilter filter, BindingRestriction restrictions)
+ public static IList<MemberSpec> FindMembers (TypeSpec container, string name, bool declaredOnly)
{
IList<MemberSpec> applicable;
- List<MemberSpec> found = null;
- int match_counter = 0;
do {
- int i;
- if (container.MemberCache.member_hash.TryGetValue (filter.Name, out applicable)) {
- for (i = 0; i < applicable.Count; ++i) {
- var entry = applicable [i];
-
- // Is the member of the correct type
- if ((entry.Kind & filter.Kind & MemberKind.MaskType) == 0)
- continue;
-
- //
- // When using overloadable overrides filter ignore members which
- // are not base members. Including properties because overrides can
- // implement get or set only and we are looking for complete base member
- //
- const MemberKind overloadable = MemberKind.Indexer | MemberKind.Method | MemberKind.Property;
- if ((restrictions & BindingRestriction.NoOverrides) != 0 && (entry.Kind & overloadable) != 0) {
- if ((entry.Modifiers & Modifiers.OVERRIDE) != 0)
- continue;
- }
-
- if ((restrictions & BindingRestriction.InstanceOnly) != 0 && entry.IsStatic)
- continue;
-
- // Apply the filter to it.
- if (!filter.Equals (entry))
- continue;
-
- // Try not to allocate a new list until it's necessary
- if (found == null) {
- if (i == match_counter) {
- ++match_counter;
- continue;
- }
-
- found = new List<MemberSpec> (System.Math.Max (4, match_counter + 1));
- for (int ii = 0; ii < match_counter; ++ii)
- found.Add (applicable [ii]);
- }
-
- found.Add (entry);
- }
-
- // Deal with allocation-less optimization
- if ((restrictions & (BindingRestriction.DeclaredOnly | BindingRestriction.StopOnFirstMatch)) != 0) {
- if (found != null)
- return found;
-
- if (i == match_counter)
- return applicable;
-
- if (match_counter > 0) {
- found = new List<MemberSpec> (match_counter);
- for (int ii = 0; ii < match_counter; ++ii)
- found.Add (applicable[ii]);
-
- return found;
- }
-
- if ((restrictions & BindingRestriction.DeclaredOnly) != 0)
- return null;
- } else if (found == null) {
- if (i == match_counter) {
- found = new List<MemberSpec> (applicable);
- } else if (match_counter > 0) {
- found = new List<MemberSpec> (System.Math.Max (4, match_counter));
- for (int ii = 0; ii < match_counter; ++ii)
- found.Add (applicable[ii]);
- }
- }
- }
+ if (container.MemberCache.member_hash.TryGetValue (name, out applicable) || declaredOnly)
+ return applicable;
container = container.BaseType;
} while (container != null);
- return found;
+ return null;
}
//
List<MethodSpec> candidates = null;
foreach (var entry in entries) {
- if (entry.Kind != MemberKind.Method || (arity >= 0 && entry.Arity != arity))
+ if (entry.Kind != MemberKind.Method || (arity > 0 && entry.Arity != arity))
continue;
var ms = (MethodSpec) entry;
if (!ms.IsExtensionMethod)
continue;
- bool extra;
- if (!Expression.IsMemberAccessible (invocationType, ms, out extra))
+ if (!ms.IsAccessible (invocationType))
continue;
// TODO: CodeGen.Assembly.Builder
if ((name_entry.Kind & (MemberKind.Constructor | MemberKind.Destructor | MemberKind.Operator)) != 0)
continue;
- bool extra;
- if (!Expression.IsMemberAccessible (InternalType.FakeInternalType, name_entry, out extra))
+ if (!name_entry.IsAccessible (InternalType.FakeInternalType))
continue;
if (name == null || name_entry.Name.StartsWith (name)) {
public abstract class ConstructorInitializer : ExpressionStatement
{
Arguments argument_list;
- MethodGroupExpr base_constructor_group;
+ MethodSpec base_ctor;
public ConstructorInitializer (Arguments argument_list, Location loc)
{
return this;
}
- base_constructor_group = MemberLookupFinal (
- ec, null, type, ConstructorBuilder.ConstructorName, 0, MemberKind.Constructor,
- BindingRestriction.AccessibleOnly | BindingRestriction.DeclaredOnly,
- loc) as MethodGroupExpr;
-
- if (base_constructor_group == null)
- return this;
-
- base_constructor_group = base_constructor_group.OverloadResolve (
- ec, ref argument_list, false, loc);
-
- if (base_constructor_group == null)
- return this;
-
- if (!ec.IsStatic)
- base_constructor_group.InstanceExpression = ec.GetThis (loc);
-
- var base_ctor = base_constructor_group.BestCandidate;
-
+ base_ctor = ConstructorLookup (ec, type, ref argument_list, loc);
+
// TODO MemberCache: Does it work for inflated types ?
if (base_ctor == caller_builder.Spec){
ec.Report.Error (516, loc, "Constructor `{0}' cannot call itself",
public override void Emit (EmitContext ec)
{
// It can be null for static initializers
- if (base_constructor_group == null)
+ if (base_ctor == null)
return;
ec.Mark (loc);
- base_constructor_group.EmitCall (ec, argument_list);
+ Invocation.EmitCall (ec, new CompilerGeneratedThis (type, loc), base_ctor, argument_list, loc);
}
public override void EmitStatement (EmitContext ec)
/// Does extension methods look up to find a method which matches name and extensionType.
/// Search starts from this namespace and continues hierarchically up to top level.
///
- public ExtensionMethodGroupExpr LookupExtensionMethod (TypeSpec extensionType, string name, int arity, Location loc)
+ public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
{
List<MethodSpec> candidates = null;
foreach (Namespace n in GetUsingTable ()) {
candidates = a;
else
candidates.AddRange (a);
- }
-
- if (candidates != null)
- return new ExtensionMethodGroupExpr (candidates, parent, extensionType, loc);
+ }\r
+\r
+ scope = parent;\r
+ if (candidates != null)\r
+ return candidates;\r
if (parent == null)
return null;
//
Namespace parent_ns = ns.Parent;
do {
- candidates = parent_ns.LookupExtensionMethod (extensionType, null, name, arity);
- if (candidates != null)
- return new ExtensionMethodGroupExpr (candidates, parent, extensionType, loc);
+ candidates = parent_ns.LookupExtensionMethod (extensionType, null, name, arity);\r
+ if (candidates != null)\r
+ return candidates;
parent_ns = parent_ns.Parent;
} while (parent_ns != null);
//
// Continue in parent scope
//
- return parent.LookupExtensionMethod (extensionType, name, arity, loc);
+ return parent.LookupExtensionMethod (extensionType, name, arity, ref scope);
}
public FullNamedExpression LookupNamespaceOrType (string name, int arity, Location loc, bool ignore_cs0104)
}
int top = param.Count;
- var ec = new EmitContext (null, proxy.GetILGenerator (), null);
-
+ var ec = new EmitContext (null, proxy.GetILGenerator (), null);\r
+ // TODO: GetAllParametersArguments
for (int i = 0; i <= top; i++)
ParameterReference.EmitLdArg (ec, i);
// Store common messages if any
//
for (int i = 0; i < common_messages.Count; ++i) {
- AbstractMessage cmsg = (AbstractMessage) common_messages[i];
+ AbstractMessage cmsg = common_messages[i];
bool common_msg_found = false;
foreach (AbstractMessage msg in session_messages) {
if (cmsg.Equals (msg)) {
// Merge session and previous messages
//
for (int i = 0; i < session_messages.Count; ++i) {
- AbstractMessage msg = (AbstractMessage) session_messages[i];
+ AbstractMessage msg = session_messages[i];
bool msg_found = false;
for (int ii = 0; ii < merged_messages.Count; ++ii) {
if (msg.Equals (merged_messages[ii])) {
ec.CurrentBlock = this;
Expression e;
using (ec.With (ResolveContext.Options.ConstantCheckState, (flags & Flags.Unchecked) == 0)) {
- e = cv.Resolve (ec);
+ using (ec.With (ResolveContext.Options.DoFlowAnalysis, false)) {
+ e = cv.Resolve (ec);
+ }
}
if (e == null)
continue;
return iterator_storey;
}
+ //
+ // Creates an arguments set from all parameters, useful for method proxy calls
+ //
+ public Arguments GetAllParametersArguments ()
+ {
+ int count = parameters.Count;
+ Arguments args = new Arguments (count);
+ for (int i = 0; i < count; ++i) {
+ var arg_expr = new ParameterReference (parameter_info[i], parameters[i].Location);
+ args.Add (new Argument (arg_expr));
+ }
+
+ return args;
+ }
+
//
// Returns a parameter reference expression for the given name,
// or null if there is no such parameter
Arguments get_value_args = new Arguments (1);
get_value_args.Add (new Argument (value));
- Expression get_item = new IndexerAccess (new ElementAccess (switch_cache_field, get_value_args, loc), loc).Resolve (rc);
+ Expression get_item = new ElementAccess (switch_cache_field, get_value_args, loc).Resolve (rc);
if (get_item == null)
return;
}
}
- sealed class CollectionForeach : Statement, MethodGroupExpr.IErrorHandler
+ sealed class CollectionForeach : Statement, OverloadResolver.IErrorHandler
{
class Body : Statement
{
enumerator.ReturnType.GetSignatureForError (), enumerator.GetSignatureForError ());
}
+ void Error_AmbiguousIEnumerable (ResolveContext rc, TypeSpec type)
+ {
+ rc.Report.SymbolRelatedToPreviousError (type);
+ rc.Report.Error (1640, loc,
+ "foreach statement cannot operate on variables of type `{0}' because it contains multiple implementation of `{1}'. Try casting to a specific implementation",
+ type.GetSignatureForError (), TypeManager.generic_ienumerable_type.GetSignatureForError ());
+ }
+
MethodGroupExpr ResolveGetEnumerator (ResolveContext rc)
{
//
// Option 1: Try to match by name GetEnumerator first
//
- var mexpr = Expression.MemberLookup (rc.Compiler, rc.CurrentType, null, expr.Type, "GetEnumerator", -1,
- MemberKind.All, BindingRestriction.DefaultMemberLookup | BindingRestriction.AccessibleOnly, loc);
+ var mexpr = Expression.MemberLookup (rc, rc.CurrentType, expr.Type, "GetEnumerator", 0, true, loc); // TODO: What if CS0229 ?
var mg = mexpr as MethodGroupExpr;
if (mg != null) {
mg.InstanceExpression = expr;
- mg.CustomErrorHandler = this;
Arguments args = new Arguments (0);
- mg = mg.OverloadResolve (rc, ref args, false, loc);
+ mg = mg.OverloadResolve (rc, ref args, this, OverloadResolver.Restrictions.None);
if (mg != null && args.Count == 0 && !mg.BestCandidate.IsStatic && mg.BestCandidate.IsPublic) {
return mg;
foreach (var iface in ifaces) {
if (TypeManager.generic_ienumerable_type != null && iface.MemberDefinition == TypeManager.generic_ienumerable_type.MemberDefinition) {
if (iface_candidate != null && iface_candidate != TypeManager.ienumerable_type) {
- rc.Report.SymbolRelatedToPreviousError (expr.Type);
- rc.Report.Error(1640, loc,
- "foreach statement cannot operate on variables of type `{0}' because it contains multiple implementation of `{1}'. Try casting to a specific implementation",
- expr.Type.GetSignatureForError (), TypeManager.generic_ienumerable_type.GetSignatureForError ());
-
+ Error_AmbiguousIEnumerable (rc, expr.Type);
return null;
}
if (iface_candidate == null) {
rc.Report.Error (1579, loc,
- "foreach statement cannot operate on variables of type `{0}' because it does not contain a definition for `{1}' or is not accessible",
+ "foreach statement cannot operate on variables of type `{0}' because it does not contain a definition for `{1}' or is inaccessible",
expr.Type.GetSignatureForError (), "GetEnumerator");
return null;
#region IErrorHandler Members
- bool MethodGroupExpr.IErrorHandler.AmbiguousCall (ResolveContext ec, MethodGroupExpr mg, MethodSpec ambiguous)
+ bool OverloadResolver.IErrorHandler.AmbiguousCandidates (ResolveContext ec, MemberSpec best, MemberSpec ambiguous)
{
- ec.Report.SymbolRelatedToPreviousError (mg.BestCandidate);
+ ec.Report.SymbolRelatedToPreviousError (best);
ec.Report.Warning (278, 2, loc,
"`{0}' contains ambiguous implementation of `{1}' pattern. Method `{2}' is ambiguous with method `{3}'",
- mg.DeclaringType.GetSignatureForError (), "enumerable",
- mg.BestCandidate.GetSignatureForError (), ambiguous.GetSignatureForError ());
+ expr.Type.GetSignatureForError (), "enumerable",
+ best.GetSignatureForError (), ambiguous.GetSignatureForError ());
+ Error_AmbiguousIEnumerable (ec, expr.Type);
return true;
}
- bool MethodGroupExpr.IErrorHandler.NoExactMatch (ResolveContext ec, MethodSpec method)
+ bool OverloadResolver.IErrorHandler.ArgumentMismatch (ResolveContext rc, MemberSpec best, Argument arg, int index)
+ {
+ return false;
+ }
+
+ bool OverloadResolver.IErrorHandler.NoArgumentMatch (ResolveContext rc, MemberSpec best)
+ {
+ return false;
+ }
+
+ bool OverloadResolver.IErrorHandler.TypeInferenceFailed (ResolveContext rc, MemberSpec best)
{
return false;
}
static MemberSpec GetPredefinedMember (TypeSpec t, MemberFilter filter, Location loc)
{
- const BindingRestriction restrictions = BindingRestriction.AccessibleOnly | BindingRestriction.DeclaredOnly;
- var member = MemberCache.FindMember (t, filter, restrictions);
+ var member = MemberCache.FindMember (t, filter, BindingRestriction.DeclaredOnly);
- if (member != null)
+ if (member != null && member.IsAccessible (InternalType.FakeInternalType))
return member;
string method_args = null;
return generic_nullable_type == t.GetDefinition ();
}
#endregion
-
- //
- // Looks up a member called `name' in the `queried_type'. This lookup
- // is done by code that is contained in the definition for `invocation_type'
- // through a qualifier of type `qualifier_type' (or null if there is no qualifier).
- //
- // `invocation_type' is used to check whether we're allowed to access the requested
- // member wrt its protection level.
- //
- // When called from MemberAccess, `qualifier_type' is the type which is used to access
- // the requested member (`class B { A a = new A (); a.foo = 5; }'; here invocation_type
- // is B and qualifier_type is A). This is used to do the CS1540 check.
- //
- // When resolving a SimpleName, `qualifier_type' is null.
- //
- // The `qualifier_type' is used for the CS1540 check; it's normally either null or
- // the same than `queried_type' - except when we're being called from BaseAccess;
- // in this case, `invocation_type' is the current type and `queried_type' the base
- // type, so this'd normally trigger a CS1540.
- //
- // The binding flags are `bf' and the kind of members being looked up are `mt'
- //
- // The return value always includes private members which code in `invocation_type'
- // is allowed to access (using the specified `qualifier_type' if given); only use
- // BindingFlags.NonPublic to bypass the permission check.
- //
- // The 'almost_match' argument is used for reporting error CS1540.
- //
- // Returns an array of a single element for everything but Methods/Constructors
- // that might return multiple matches.
- //
- public static IList<MemberSpec> MemberLookup (TypeSpec invocation_type, TypeSpec qualifier_type,
- TypeSpec queried_type, MemberKind mt,
- BindingRestriction opt, string name, int arity, IList<MemberSpec> almost_match)
- {
- Timer.StartTimer (TimerType.MemberLookup);
-
- var retval = RealMemberLookup (invocation_type, qualifier_type,
- queried_type, mt, opt, name, arity, almost_match);
-
- Timer.StopTimer (TimerType.MemberLookup);
-
- return retval;
- }
-
- static IList<MemberSpec> RealMemberLookup (TypeSpec invocation_type, TypeSpec qualifier_type,
- TypeSpec queried_type, MemberKind mt,
- BindingRestriction bf, string name, int arity, IList<MemberSpec> almost_match)
- {
- MemberFilter filter = new MemberFilter (name, arity, mt, null, null);
- if ((bf & BindingRestriction.AccessibleOnly) != 0) {
- filter.InvocationType = invocation_type ?? InternalType.FakeInternalType;
- }
-
- return MemberCache.FindMembers (queried_type, filter, bf);
- }
}
}
--- /dev/null
+/CommonAssemblyInfo.cs -crlf
+/license.rtf -crlf
+/nunit20under21.config -crlf
+/nunit20under22.config -crlf
+/nunit21under22.config -crlf
--- /dev/null
+/AggregatingTestRunner.cs -crlf
+/AssemblyInfo.cs -crlf
+/AssemblyItem.cs -crlf
+/AssemblyList.cs -crlf
+/AssemblyWatcher.cs -crlf
+/CategoryExpression.cs -crlf
+/CategoryManager.cs -crlf
+/CommandLineOptions.cs -crlf
+/ConsoleWriter.cs -crlf
+/ISettings.cs -crlf
+/ITestEvents.cs -crlf
+/ITestLoader.cs -crlf
+/MemorySettingsStorage.cs -crlf
+/MultipleTestDomainRunner.cs -crlf
+/NUnitProject.cs -crlf
+/NUnitRegistry.cs -crlf
+/PathUtils.cs -crlf
+/ProcessRunner.cs -crlf
+/ProjectConfig.cs -crlf
+/ProjectConfigCollection.cs -crlf
+/ProjectFormatException.cs -crlf
+/ProxyTestRunner.cs -crlf
+/RecentFileEntry.cs -crlf
+/RecentFiles.cs -crlf
+/RecentFilesCollection.cs -crlf
+/RegistrySettingsStorage.cs -crlf
+/RemoteTestAgent.cs -crlf
+/ResultSummarizer.cs -crlf
+/ServerBase.cs -crlf
+/ServerUtilities.cs -crlf
+/Services.cs -crlf
+/SettingsGroup.cs -crlf
+/SettingsStorage.cs -crlf
+/StackTraceFilter.cs -crlf
+/SummaryVisitor.cs -crlf
+/TestAgent.cs -crlf
+/TestDomain.cs -crlf
+/TestEventArgs.cs -crlf
+/TestEventDispatcher.cs -crlf
+/TestExceptionHandler.cs -crlf
+/TestLoader.cs -crlf
+/TestObserver.cs -crlf
+/TestResultItem.cs -crlf
+/TestServer.cs -crlf
+/Transform.resx -crlf
+/VSProject.cs -crlf
+/VSProjectConfig.cs -crlf
+/VSProjectConfigCollection.cs -crlf
+/XmlResultTransform.cs -crlf
+/XmlResultVisitor.cs -crlf
+/XmlSettingsStorage.cs -crlf
+/nunit.util.build -crlf
--- /dev/null
+/AddinManager.cs -crlf
+/AddinRegistry.cs -crlf
+/DomainManager.cs -crlf
+/RecentFilesService.cs -crlf
+/ServiceManager.cs -crlf
+/SettingsService.cs -crlf
+/TestAgency.cs -crlf
+/TestAgentManager.cs -crlf
--- /dev/null
+/App.config -crlf
+/Class1.cs -crlf
+/assemblyinfo.cs -crlf
+/nunit-console.exe.build -crlf
+/nunit-console.exe.config -crlf
+/nunit-console.exe.config.net_2_0 -crlf
+/nunit-console.exe.config.net_3_5 -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/ConsoleOptions.cs -crlf
+/ConsoleUi.cs -crlf
+/EventCollector.cs -crlf
+/Runner.cs -crlf
+/nunit-console.build -crlf
--- /dev/null
+/AbstractTestCaseDecoration.cs -crlf
+/AssemblyInfo.cs -crlf
+/AssemblyReader.cs -crlf
+/AssemblyResolver.cs -crlf
+/CoreExtensions.cs -crlf
+/CoreExtensions.save.cs -crlf
+/CultureDetector.cs -crlf
+/DelegatingTestRunner.cs -crlf
+/DirectorySwapper.cs -crlf
+/EventListenerTextWriter.cs -crlf
+/EventPump.cs -crlf
+/EventQueue.cs -crlf
+/ExtensionHost.cs -crlf
+/ExtensionPoint.cs -crlf
+/IgnoreDecorator.cs -crlf
+/InvalidSuiteException.cs -crlf
+/InvalidTestFixtureException.cs -crlf
+/LegacySuite.cs -crlf
+/Log4NetCapture.cs -crlf
+/LogCapture.cs -crlf
+/NTrace.cs -crlf
+/NUnitException.cs -crlf
+/NUnitFramework.cs -crlf
+/NUnitTestFixture.cs -crlf
+/NUnitTestMethod.cs -crlf
+/NamespaceTreeBuilder.cs -crlf
+/NoTestFixturesException.cs -crlf
+/NotRunnableTestCase.cs -crlf
+/NullListener.cs -crlf
+/PlatformHelper.cs -crlf
+/ProxyTestRunner.cs -crlf
+/QueuingEventListener.cs -crlf
+/Reflect.cs -crlf
+/RemoteTestRunner.cs -crlf
+/Results.xsd -crlf
+/SetUpFixture.cs -crlf
+/SimpleTestRunner.cs -crlf
+/StringTextWriter.cs -crlf
+/SuiteBuilderAttribute.cs -crlf
+/Summary.xslt -crlf
+/TestBuilderAttribute.cs -crlf
+/TestCase.cs -crlf
+/TestCaseBuilder.cs -crlf
+/TestCaseBuilderAttribute.cs -crlf
+/TestContext.cs -crlf
+/TestDecoratorAttribute.cs -crlf
+/TestFixture.cs -crlf
+/TestFixtureBuilder.cs -crlf
+/TestMethod.cs -crlf
+/TestRunnerThread.cs -crlf
+/TestSuite.cs -crlf
+/TestSuiteBuilder.cs -crlf
+/TextCapture.cs -crlf
+/ThreadedTestRunner.cs -crlf
+/nunit.core.build -crlf
--- /dev/null
+/AbstractFixtureBuilder.cs -crlf
+/AbstractTestCaseBuilder.cs -crlf
+/LegacySuiteBuilder.cs -crlf
+/MultiCultureDecorator.cs -crlf
+/NUnitTestCaseBuilder.cs -crlf
+/NUnitTestFixtureBuilder.cs -crlf
+/SetUpFixtureBuilder.cs -crlf
+/TestAssemblyBuilder.cs -crlf
--- /dev/null
+/AddinRegistry.cs -crlf
+/EventListenerCollection.cs -crlf
+/FrameworkRegistry.cs -crlf
+/SuiteBuilderCollection.cs -crlf
+/TestCaseBuilderCollection.cs -crlf
+/TestDecoratorCollection.cs -crlf
+/TestDecoratorCollection.save.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/EventListener.cs -crlf
+/IService.cs -crlf
+/ITest.cs -crlf
+/ITestFilter.cs -crlf
+/ResultState.cs -crlf
+/ResultVisitor.cs -crlf
+/RunState.cs -crlf
+/RuntimeFramework.cs -crlf
+/Test.cs -crlf
+/TestAssemblyInfo.cs -crlf
+/TestCaseResult.cs -crlf
+/TestFilter.cs -crlf
+/TestID.cs -crlf
+/TestInfo.cs -crlf
+/TestName.cs -crlf
+/TestNode.cs -crlf
+/TestOutput.cs -crlf
+/TestPackage.cs -crlf
+/TestResult.cs -crlf
+/TestRunner.cs -crlf
+/TestSuiteResult.cs -crlf
+/nunit.core.interfaces.build -crlf
--- /dev/null
+/Addin.cs -crlf
+/AddinStatus.cs -crlf
+/ExtensionType.cs -crlf
+/IAddin.cs -crlf
+/IAddinManager.cs -crlf
+/IAddinRegistry.cs -crlf
+/IExtensionHost.cs -crlf
+/IExtensionPoint.cs -crlf
+/IFrameworkRegistry.cs -crlf
+/ISuiteBuilder.cs -crlf
+/ITestCaseBuilder.cs -crlf
+/ITestDecorator.cs -crlf
+/NUnitAddinAttribute.cs -crlf
+/TestFramework.cs -crlf
--- /dev/null
+/AndFilter.cs -crlf
+/CategoryFilter.cs -crlf
+/NameFilter.cs -crlf
+/NotFilter.cs -crlf
+/OrFilter.cs -crlf
+/SimpleNameFilter.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/RepeatedTestCase.cs -crlf
+/RepeatedTestDecorator.cs -crlf
+/nunit.core.extensions.build -crlf
--- /dev/null
+/RowTestAddIn.cs -crlf
+/RowTestCase.cs -crlf
+/RowTestFactory.cs -crlf
+/RowTestFramework.cs -crlf
+/RowTestNameBuilder.cs -crlf
+/RowTestSuite.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/RepeatAttribute.cs -crlf
+/RowAttribute.cs -crlf
+/RowTestAttribute.cs -crlf
+/SpecialValue.cs -crlf
+/nunit.framework.extensions.build -crlf
--- /dev/null
+/RowAttribute.cs -crlf
+/RowTestAttribute.cs -crlf
+/SpecialValue.cs -crlf
--- /dev/null
+/AssemblyRunner.cs -crlf
+/PlatformInfo.cs -crlf
+/SnippetRunner.cs -crlf
+/TestCompiler.cs -crlf
+/TestLoadFixture.cs -crlf
+/TestTree.cs -crlf
+/nunit.fixtures.build -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/CompilationTests.cs -crlf
+/TestTreeTests.cs -crlf
+/nunit.fixtures.tests.build -crlf
--- /dev/null
+/AbstractAsserter.cs -crlf
+/AssemblyInfo.cs -crlf
+/Assert.cs -crlf
+/Assertion.cs -crlf
+/AssertionException.cs -crlf
+/AssertionFailureMessage.cs -crlf
+/AssertionHelper.cs -crlf
+/CategoryAttribute.cs -crlf
+/CollectionAssert.cs -crlf
+/DescriptionAttribute.cs -crlf
+/ExpectedExceptionAttribute.cs -crlf
+/ExplicitAttribute.cs -crlf
+/FileAssert.cs -crlf
+/GlobalSettings.cs -crlf
+/IAsserter.cs -crlf
+/IExpectException.cs -crlf
+/IgnoreAttribute.cs -crlf
+/IgnoreException.cs -crlf
+/IncludeExcludeAttributes.cs -crlf
+/MessageWriter.cs -crlf
+/MsgUtils.cs -crlf
+/OldTestCase.cs -crlf
+/PropertyAttribute.cs -crlf
+/SetCultureAttribute.cs -crlf
+/SetUpAttribute.cs -crlf
+/SetUpFixtureAttribute.cs -crlf
+/StringAssert.cs -crlf
+/SuiteAttribute.cs -crlf
+/TearDownAttribute.cs -crlf
+/TestAttribute.cs -crlf
+/TestFixtureAttribute.cs -crlf
+/TestFixtureSetUpAttribute.cs -crlf
+/TestFixtureTearDownAttribute.cs -crlf
+/TextMessageWriter.cs -crlf
+/nunit.framework.build -crlf
--- /dev/null
+/BinaryOperations.cs -crlf
+/CollectionConstraints.cs -crlf
+/ComparisonConstraints.cs -crlf
+/Constraint.cs -crlf
+/ConstraintBuilder.cs -crlf
+/ContainsConstraint.cs -crlf
+/EmptyConstraint.cs -crlf
+/EqualConstraint.cs -crlf
+/Numerics.cs -crlf
+/PrefixConstraints.cs -crlf
+/PropertyConstraint.cs -crlf
+/SameAsConstraint.cs -crlf
+/StringConstraints.cs -crlf
+/TypeConstraints.cs -crlf
--- /dev/null
+/Has.cs -crlf
+/Is.cs -crlf
+/List.cs -crlf
+/ListMapper.cs -crlf
+/Text.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/DynamicMock.cs -crlf
+/ICall.cs -crlf
+/ICallHandler.cs -crlf
+/IMethod.cs -crlf
+/IMock.cs -crlf
+/IVerify.cs -crlf
+/MethodSignature.cs -crlf
+/Mock.cs -crlf
+/MockCall.cs -crlf
+/MockInterfaceHandler.cs -crlf
+/MockMethod.cs -crlf
+/nunit.mocks.build -crlf
--- /dev/null
+/gtest-504-lib.cs -crlf
+/gtest-523.cs -crlf
+/gtest-xml-2-ref.xml -crlf
+/gtest-xml-3-ref.xml -crlf
+/test-746.cs -crlf
+/test-xml-001-ref.xml -crlf
+/test-xml-002-ref.xml -crlf
+/test-xml-003-ref.xml -crlf
+/test-xml-004-ref.xml -crlf
+/test-xml-005-ref.xml -crlf
+/test-xml-006-ref.xml -crlf
+/test-xml-007-ref.xml -crlf
+/test-xml-008-ref.xml -crlf
+/test-xml-009-ref.xml -crlf
+/test-xml-010-ref.xml -crlf
+/test-xml-011-ref.xml -crlf
+/test-xml-012-ref.xml -crlf
+/test-xml-013-ref.xml -crlf
+/test-xml-014-ref.xml -crlf
+/test-xml-015-ref.xml -crlf
+/test-xml-016-ref.xml -crlf
+/test-xml-017-ref.xml -crlf
+/test-xml-018-ref.xml -crlf
+/test-xml-019-ref.xml -crlf
+/test-xml-020-ref.xml -crlf
+/test-xml-021-ref.xml -crlf
+/test-xml-022-ref.xml -crlf
+/test-xml-023-ref.xml -crlf
+/test-xml-024-ref.xml -crlf
+/test-xml-025-ref.xml -crlf
+/test-xml-026-ref.xml -crlf
+/test-xml-027-ref.xml -crlf
+/test-xml-028-ref.xml -crlf
+/test-xml-029-ref.xml -crlf
+/test-xml-030-ref.xml -crlf
+/test-xml-031-ref.xml -crlf
+/test-xml-032-ref.xml -crlf
+/test-xml-033-ref.xml -crlf
+/test-xml-034-ref.xml -crlf
+/test-xml-035-ref.xml -crlf
+/test-xml-036-ref.xml -crlf
+/test-xml-037-ref.xml -crlf
+/test-xml-038-ref.xml -crlf
+/test-xml-050-ref.xml -crlf
+/gtest-522.cs -crlf
+/gtest-525.cs -crlf
+/gtest-linq-24.cs -crlf
+/test-788.cs -crlf
--- /dev/null
+using System;\r
+\r
+class C<T>\r
+{\r
+ public static int Foo;\r
+}\r
+\r
+class X\r
+{\r
+ public static void Main ()\r
+ {\r
+ }\r
+ \r
+ void Test<T> (T A)\r
+ {\r
+ A<T> ();\r
+ \r
+ object C;\r
+ var c = C<int>.Foo;\r
+ }\r
+ \r
+ static void A<U> ()\r
+ {\r
+ }\r
+}\r
--- /dev/null
+using System;\r
+\r
+class A\r
+{\r
+ static void MA<T> (string s)\r
+ {\r
+ }\r
+\r
+ static void F ()\r
+ {\r
+ }\r
+\r
+ class C\r
+ {\r
+ Func<int> MA;\r
+ int F;\r
+ \r
+ void Foo ()\r
+ {\r
+ F ();\r
+ MA<int> ("");\r
+ }\r
+ \r
+ public static void Main ()\r
+ {\r
+ new C ().Foo ();\r
+ }\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+class A<U>
+{
+ protected int foo;
+}
+
+class B<T> : A<T>
+{
+ protected class N
+ {
+ public void Test (C b)
+ {
+ var v = b.foo;
+ }
+ }
+}
+
+class C : B<int>
+{
+ public static void Main ()
+ {
+ new C.N ().Test (new C ());
+ }
+}
--- /dev/null
+using System;\r
+\r
+class A\r
+{\r
+ public virtual void Foo<T> (T a, params string[] b) where T : struct\r
+ {\r
+ }\r
+}\r
+\r
+class B : A\r
+{\r
+ public void Test (int v)\r
+ {\r
+ Action a = () => base.Foo<int> (b: "n", a: v);\r
+ a ();\r
+ }\r
+\r
+ public void Test2<T> (T b) where T : struct\r
+ {\r
+ Action a2 = () => base.Foo<T> (b, "as", "asdfa");\r
+ }\r
+}\r
+\r
+class Test\r
+{\r
+ public static void Main ()\r
+ {\r
+ new B ().Test (1);\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+using System;\r
+\r
+static class S\r
+{\r
+ public static void Extension (this A b, string s, bool n)\r
+ {\r
+ throw new ApplicationException ("wrong overload");\r
+ }\r
+}\r
+\r
+class A\r
+{\r
+ public void Extension (string s)\r
+ {\r
+ }\r
+}\r
+\r
+class Test\r
+{\r
+ static void TestMethod (Action<bool> arg)\r
+ {\r
+ }\r
+\r
+ static int TestMethod (Action<string> arg)\r
+ {\r
+ arg ("hola");\r
+ return 2;\r
+ }\r
+\r
+ public static int Main ()\r
+ {\r
+ var a = new A ();\r
+ if (TestMethod (a.Extension) != 2)\r
+ return 1;\r
+\r
+ return 0;\r
+ }\r
+}\r
--- /dev/null
+using System;\r
+using System.Collections.Generic;\r
+\r
+class A\r
+{\r
+ protected virtual int BaseM {\r
+ get {\r
+ return 2;\r
+ }\r
+ set\r
+ {\r
+ throw new ApplicationException ("it should not be called");\r
+ }\r
+ }\r
+}\r
+\r
+class B : A\r
+{\r
+ protected override int BaseM {\r
+ set\r
+ {\r
+ }\r
+ }\r
+}\r
+\r
+struct S\r
+{\r
+ public IEnumerable<int> GetIt ()\r
+ {\r
+ yield return base.GetHashCode ();\r
+ }\r
+}\r
+\r
+class X : B\r
+{\r
+ protected override int BaseM {\r
+ set\r
+ {\r
+ throw new ApplicationException ("it should not be called");\r
+ }\r
+ }\r
+\r
+ IEnumerable<int> GetIt ()\r
+ {\r
+ yield return base.BaseM++;\r
+ }\r
+\r
+ static int Main ()\r
+ {\r
+ foreach (var v in new X ().GetIt ())\r
+ Console.WriteLine (v);\r
+\r
+ foreach (var v in new S ().GetIt ())\r
+ Console.WriteLine (v);\r
+\r
+ return 0;\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+using System;\r
+using System.Linq;\r
+\r
+class A\r
+{\r
+ public int Value;\r
+}\r
+\r
+class C\r
+{\r
+ A[] Prop {\r
+ get {\r
+ return new A [1] { new A () };\r
+ }\r
+ }\r
+ \r
+ void Test ()\r
+ {\r
+ int i = 9;\r
+ var c = new C ();\r
+ var r = Prop.Select (l => l.Value).ToArray ();\r
+ }\r
+ \r
+ public static int Main ()\r
+ {\r
+ new C().Test ();\r
+ return 0;\r
+ }\r
+}\r
test-759.cs IGNORE bug #604218
test-xml-030.cs
+test-xml-035.cs
--- /dev/null
+using System;
+
+public class A
+{
+ protected int value = 9;
+
+ public virtual int this [int i]
+ {
+ get { throw new NotImplementedException (); }
+ set { this.value = i; }
+ }
+}
+
+public class B : A
+{
+ public override int this [int i]
+ {
+ get { return value; }
+ }
+}
+
+public class C : B
+{
+ public override int this [int i]
+ {
+ get { return base [i]; }
+ set { base [i] = value; }
+ }
+
+ public static int Main ()
+ {
+ var c = new C ();
+ var r = c [100]++;
+ Console.WriteLine (r);
+ if (r != 9)
+ return 1;
+
+ return 0;
+ }
+}
--- /dev/null
+using System;\r
+\r
+class Program\r
+{\r
+ static int Main ()\r
+ {\r
+ B b = new B ();\r
+ if (b.Message != "OK")\r
+ return 1;\r
+ return 0;\r
+ }\r
+}\r
+\r
+class A\r
+{\r
+ public virtual string Message\r
+ {\r
+ get\r
+ {\r
+ return "OK";\r
+ }\r
+ }\r
+}\r
+\r
+class B : A\r
+{\r
+ new string Message\r
+ {\r
+ get\r
+ {\r
+ throw new Exception ();\r
+ }\r
+ }\r
+}\r
+\r
--- /dev/null
+using System;
+
+class Program {
+ static void Main ()
+ {
+ Action action = () => Console.WriteLine (1);
+ action += null;
+ action ();
+ }
+}
--- /dev/null
+using System;\r
+\r
+public delegate int D ();\r
+\r
+public abstract class A\r
+{\r
+ protected abstract event D Event;\r
+}\r
+\r
+public class B : A\r
+{\r
+ protected override event D Event;\r
+\r
+ protected int Run ()\r
+ {\r
+ return Event ();\r
+ }\r
+}\r
+\r
+public class C : B\r
+{\r
+ int Test (int i)\r
+ {\r
+ Action a = () => base.Event += () => i;\r
+ a ();\r
+ return Run ();\r
+ }\r
+\r
+ public static int Main ()\r
+ {\r
+ if (new C ().Test (9) != 9)\r
+ return 1;\r
+\r
+ return 0;\r
+ }\r
+}
\ No newline at end of file
</assembly>\r
<members>\r
<member name="T:Testing.Test">\r
- comment without markup on class - it is allowed
+ comment without markup on class - it is allowed\r
</member>\r
<!-- Badly formed XML comment ignored for member "T:Testing.Test2" -->\r
<!-- Badly formed XML comment ignored for member "T:Testing.Test3" -->\r
</assembly>\r
<members>\r
<member name="M:Testing.Test.Foo">\r
- comment on method without parameter
+ comment on method without parameter\r
</member>\r
<member name="M:Testing.Test.Foo(System.Int64,Testing.Test,System.Collections.ArrayList)">\r
- here is a documentation with parameters (and has same name)
+ here is a documentation with parameters (and has same name)\r
</member>\r
<member name="M:Testing.Test.Foo(System.String[])">\r
- here is a documentation with parameters (and has same name)
+ here is a documentation with parameters (and has same name)\r
</member>\r
</members>\r
</doc>\r
</assembly>\r
<members>\r
<member name="M:Testing.Test.#ctor">\r
- comment for constructor
+ comment for constructor\r
</member>\r
<member name="M:Testing.Test.Finalize">\r
- comment for destructor
+ comment for destructor\r
</member>\r
</members>\r
</doc>\r
</assembly>\r
<members>\r
<member name="T:Testing.Test.InternalClass">\r
- comment for internal class
+ comment for internal class\r
</member>\r
<member name="T:Testing.Test.InternalStruct">\r
- comment for internal struct
+ comment for internal struct\r
</member>\r
</members>\r
</doc>\r
</assembly>\r
<members>\r
<member name="M:Test.Foo(Test.A,System.Int32)">\r
- here is a documentation
+ here is a documentation\r
</member>\r
</members>\r
</doc>\r
</assembly>\r
<members>\r
<member name="T:MyClass">\r
- <summary>help text</summary>
+ <summary>help text</summary>\r
</member>\r
<member name="M:MyClass.Main">\r
- <summary>help text</summary>
+ <summary>help text</summary>\r
</member>\r
<member name="M:MyClass.op_Explicit(MyClass)~System.Int32">\r
- <summary>help text</summary>
+ <summary>help text</summary>\r
</member>\r
<member name="M:MyClass.op_Implicit(MyClass)~System.Char">\r
- <summary>help text</summary>
+ <summary>help text</summary>\r
</member>\r
</members>\r
</doc>\r
</assembly>\r
<members>\r
<member name="T:Test">\r
- valid comment.
+ valid comment.\r
</member>\r
</members>\r
</doc>\r
</summary>\r
</member>\r
<member name="M:Whatever.Main">\r
- <summary>
- </summary>
+ <summary>\r
+ </summary>\r
</member>\r
</members>\r
</doc>\r
</method>
</type>
</test>
+ <test name="gtest-522.cs">
+ <type name="C`1[T]">
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="X">
+ <method name="Void Main()">
+ <size>1</size>
+ </method>
+ <method name="Void Test[T](T)">
+ <size>12</size>
+ </method>
+ <method name="Void A[U]()">
+ <size>1</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-523.cs">
<type name="Test.TestClass4`1[T]">
<method name="Boolean Equals(T)">
</method>
</type>
</test>
+ <test name="gtest-525.cs">
+ <type name="A">
+ <method name="Void MA[T](System.String)">
+ <size>1</size>
+ </method>
+ <method name="Void F()">
+ <size>1</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="A+C">
+ <method name="Void Foo()">
+ <size>16</size>
+ </method>
+ <method name="Void Main()">
+ <size>11</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
+ <test name="gtest-526.cs">
+ <type name="A`1[U]">
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="B`1[T]">
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="B`1+N[T]">
+ <method name="Void Test(C)">
+ <size>8</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="C">
+ <method name="Void Main()">
+ <size>16</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-anon-1.cs">
<type name="X">
<method name="Void .ctor()">
<size>32</size>
</method>
</type>
+ <type name="C">
+ <method name="Void <BaseM>__BaseCallProxy0()">
+ <size>7</size>
+ </method>
+ </type>
</test>
<test name="gtest-anon-24.cs">
<type name="Disposable`1[T]">
</method>
</type>
</test>
+ <test name="gtest-anon-63.cs">
+ <type name="A">
+ <method name="Void Foo[T](T, System.String[])">
+ <size>1</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="B">
+ <method name="Void Test(Int32)">
+ <size>40</size>
+ </method>
+ <method name="Void Test2[T](T)">
+ <size>34</size>
+ </method>
+ <method name="Void <Foo>__BaseCallProxy0[T](T, System.String[])">
+ <size>9</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="Test">
+ <method name="Void Main()">
+ <size>12</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="B+<Test>c__AnonStorey0">
+ <method name="Void <>m__0()">
+ <size>32</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="B+<Test2>c__AnonStorey1`1[T]">
+ <method name="Void <>m__1()">
+ <size>40</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-anon-7.cs">
<type name="MyDisposable">
<method name="Void .ctor()">
</method>
</type>
</test>
+ <test name="gtest-iter-14.cs">
+ <type name="A">
+ <method name="Int32 get_BaseM()">
+ <size>2</size>
+ </method>
+ <method name="Void set_BaseM(Int32)">
+ <size>11</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="B">
+ <method name="Void set_BaseM(Int32)">
+ <size>1</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="S">
+ <method name="IEnumerable`1 GetIt()">
+ <size>28</size>
+ </method>
+ <method name="Int32 <GetHashCode>__BaseCallProxy0()">
+ <size>17</size>
+ </method>
+ </type>
+ <type name="X">
+ <method name="Void set_BaseM(Int32)">
+ <size>11</size>
+ </method>
+ <method name="IEnumerable`1 GetIt()">
+ <size>23</size>
+ </method>
+ <method name="Int32 Main()">
+ <size>133</size>
+ </method>
+ <method name="Int32 <get_BaseM>__BaseCallProxy0()">
+ <size>7</size>
+ </method>
+ <method name="Void <set_BaseM>__BaseCallProxy1(Int32)">
+ <size>8</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="S+<GetIt>c__Iterator0">
+ <method name="Int32 System.Collections.Generic.IEnumerator<int>.get_Current()">
+ <size>7</size>
+ </method>
+ <method name="System.Object System.Collections.IEnumerator.get_Current()">
+ <size>12</size>
+ </method>
+ <method name="IEnumerator System.Collections.IEnumerable.GetEnumerator()">
+ <size>7</size>
+ </method>
+ <method name="IEnumerator`1 System.Collections.Generic.IEnumerable<int>.GetEnumerator()">
+ <size>40</size>
+ </method>
+ <method name="Boolean MoveNext()">
+ <size>75</size>
+ </method>
+ <method name="Void Dispose()">
+ <size>8</size>
+ </method>
+ <method name="Void Reset()">
+ <size>6</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="X+<GetIt>c__Iterator1">
+ <method name="Int32 System.Collections.Generic.IEnumerator<int>.get_Current()">
+ <size>7</size>
+ </method>
+ <method name="System.Object System.Collections.IEnumerator.get_Current()">
+ <size>12</size>
+ </method>
+ <method name="IEnumerator System.Collections.IEnumerable.GetEnumerator()">
+ <size>7</size>
+ </method>
+ <method name="IEnumerator`1 System.Collections.Generic.IEnumerable<int>.GetEnumerator()">
+ <size>40</size>
+ </method>
+ <method name="Boolean MoveNext()">
+ <size>86</size>
+ </method>
+ <method name="Void Dispose()">
+ <size>8</size>
+ </method>
+ <method name="Void Reset()">
+ <size>6</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-lambda-01.cs">
<type name="X">
<method name="Int32 Main()">
</method>
</type>
</test>
+ <test name="gtest-linq-24.cs">
+ <type name="A">
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="C">
+ <method name="A[] get_Prop()">
+ <size>15</size>
+ </method>
+ <method name="Void Test()">
+ <size>56</size>
+ </method>
+ <method name="Int32 Main()">
+ <size>12</size>
+ </method>
+ <method name="Int32 <Test>m__0(A)">
+ <size>7</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-named-01.cs">
<type name="C">
<method name="Int32 Test(Int32, Int32, System.String)">
</method>
</type>
</test>
+ <test name="test-784.cs">
+ <type name="A">
+ <method name="Int32 get_Item(Int32)">
+ <size>6</size>
+ </method>
+ <method name="Void set_Item(Int32, Int32)">
+ <size>8</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>15</size>
+ </method>
+ </type>
+ <type name="B">
+ <method name="Int32 get_Item(Int32)">
+ <size>7</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="C">
+ <method name="Int32 get_Item(Int32)">
+ <size>8</size>
+ </method>
+ <method name="Void set_Item(Int32, Int32)">
+ <size>9</size>
+ </method>
+ <method name="Int32 Main()">
+ <size>53</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-785.cs">
<type name="Base">
<method name="Int32 get_Prop()">
</method>
</type>
</test>
+ <test name="test-788.cs">
+ <type name="Program">
+ <method name="Int32 Main()">
+ <size>31</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="A">
+ <method name="System.String get_Message()">
+ <size>6</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="B">
+ <method name="System.String get_Message()">
+ <size>6</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-79.cs">
<type name="X">
<method name="Void .ctor()">
<method name="Void .ctor()">
<size>7</size>
</method>
+ <method name="Void <Print>__BaseCallProxy0()">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
+ <test name="test-anon-95.cs">
+ <type name="D">
+ <method name="Int32 Invoke()">
+ <size>0</size>
+ </method>
+ <method name="IAsyncResult BeginInvoke(System.AsyncCallback, System.Object)">
+ <size>0</size>
+ </method>
+ <method name="Int32 EndInvoke(IAsyncResult)">
+ <size>0</size>
+ </method>
+ <method name="Void .ctor(Object, IntPtr)">
+ <size>0</size>
+ </method>
+ </type>
+ <type name="A">
+ <method name="Void add_Event(D)">
+ <size>0</size>
+ </method>
+ <method name="Void remove_Event(D)">
+ <size>0</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="B">
+ <method name="Void add_Event(D)">
+ <size>24</size>
+ </method>
+ <method name="Void remove_Event(D)">
+ <size>24</size>
+ </method>
+ <method name="Int32 Run()">
+ <size>12</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="C">
+ <method name="Int32 Test(Int32)">
+ <size>46</size>
+ </method>
+ <method name="Int32 Main()">
+ <size>23</size>
+ </method>
+ <method name="Void <add_Event>__BaseCallProxy0(D)">
+ <size>8</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="C+<Test>c__AnonStorey0">
+ <method name="Void <>m__0()">
+ <size>24</size>
+ </method>
+ <method name="Int32 <>m__1()">
+ <size>7</size>
+ </method>
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
</type>
</test>
<test name="test-cls-00.cs">
--- /dev/null
+/mono-win32-setup.nsi -crlf
--- /dev/null
+/.cvsignore -crlf
--- /dev/null
+/xmldocdiff.cs -crlf
--- /dev/null
+/.cvsignore -crlf
--- /dev/null
+/.cvsignore -crlf
--- /dev/null
+/.cvsignore -crlf
+/depgraph.cs -crlf
+/ictool-config.xml -crlf
+/ictool.cs -crlf
+/peer.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/lc.cs -crlf
--- /dev/null
+/TestEcmaDocs.xml -crlf
--- /dev/null
+/EnumCheck.cs -crlf
+/EnumCheckAssemblyCollection.cs -crlf
+/GenerateDelegate.cs -crlf
+/IFaceDisco.cs -crlf
+/XMLUtil.cs -crlf
\r
; create bin/mono wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\mono.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mono.exe "$$@"'\r
FileClose $0\r
\r
; create bin/mint wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\mint.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mint.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mint.exe "$$@"'\r
FileClose $0\r
\r
; create bin/mcs wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\mcs.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe $6/bin/mcs.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mono.exe $6/bin/mcs.exe "$$@"'\r
FileClose $0\r
\r
; create bin/mbas wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\mbas.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe $6/bin/mbas.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mono.exe $6/bin/mbas.exe "$$@"'\r
FileClose $0\r
\r
; create bin/sqlsharp wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\sqlsharp.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe $6/bin/sqlsharp.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mono.exe $6/bin/sqlsharp.exe "$$@"'\r
FileClose $0\r
\r
; create bin/monodis wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\monodis.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe $6/bin/monodis.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mono.exe $6/bin/monodis.exe "$$@"'\r
FileClose $0\r
\r
; create bin/monoresgen wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\monoresgen.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe $6/bin/monoresgen.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mono.exe $6/bin/monoresgen.exe "$$@"'\r
FileClose $0\r
\r
; create bin/monoilasm wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\monoilasm.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe $6/bin/monoilasm.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mono.exe $6/bin/monoilasm.exe "$$@"'\r
FileClose $0\r
\r
; create bin/monosn wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\monosn.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe $6/bin/monosn.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mono.exe $6/bin/monosn.exe "$$@"'\r
FileClose $0\r
\r
; create bin/secutil wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\secutil.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe $6/bin/secutil.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mono.exe $6/bin/secutil.exe "$$@"'\r
FileClose $0\r
\r
; create bin/cert2spc wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\cert2spc.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe $6/bin/cert2spc.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mono.exe $6/bin/cert2spc.exe "$$@"'\r
FileClose $0\r
\r
; create bin/cilc wrapper to be used if the user has cygwin\r
FileOpen $0 "$INSTDIR\bin\cilc.exe.sh" "w"\r
-FileWrite $0 "#!/bin/sh$\r$\n"
-FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
-FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe $6/bin/cilc.exe "$$@"'
+FileWrite $0 "#!/bin/sh$\r$\n"\r
+FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"\r
+FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"\r
+FileWrite $0 '$6/bin/mono.exe $6/bin/cilc.exe "$$@"'\r
FileClose $0\r
\r
;\r
--- /dev/null
+/nunit_transform.xslt -crlf
--- /dev/null
+/.cvsignore -crlf
+/MonoXSD.cs -crlf
+/NewMonoXSD.cs -crlf
--- /dev/null
+/ABOUT.txt -crlf
+/BUILD.txt -crlf
+/CHANGES.txt -crlf
+/HISTORY.txt -crlf
+/LICENSE.txt -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/DeleteFiles.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/FileDocument.cs -crlf
+/HTMLDocument.cs -crlf
--- /dev/null
+/Entities.cs -crlf
+/HTMLParser.cs -crlf
+/HTMLParserConstants.cs -crlf
+/HTMLParserTokenManager.cs -crlf
+/ParseException.cs -crlf
+/ParserThread.cs -crlf
+/SimpleCharStream.cs -crlf
+/Tags.cs -crlf
+/Test.cs -crlf
+/Token.cs -crlf
+/TokenMgrError.cs -crlf
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
MatchLoop: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
else\r
{\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
MatchLoop1: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
else\r
{\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
MatchLoop1: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
else\r
{\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
MatchLoop1: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
else\r
{\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << (int) curChar;\r\r
+ ulong l = ((ulong) 1L) << (int) curChar;\r
MatchLoop1: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
else\r
{\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
MatchLoop1: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
else\r
{\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
MatchLoop1: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
else\r
{\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
MatchLoop1: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
else\r
{\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
--- /dev/null
+/AssemblyInfo.cs -crlf
+/IndexFiles.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/IndexHtml.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/SearchFiles.cs -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/Lucene.Net.xml -crlf
+/Overview.html -crlf
+/SupportClass.cs -crlf
--- /dev/null
+/Analyzer.cs -crlf
+/CharTokenizer.cs -crlf
+/LetterTokenizer.cs -crlf
+/LowerCaseFilter.cs -crlf
+/LowerCaseTokenizer.cs -crlf
+/Package.html -crlf
+/PerFieldAnalyzerWrapper.cs -crlf
+/PorterStemFilter.cs -crlf
+/PorterStemmer.cs -crlf
+/SimpleAnalyzer.cs -crlf
+/StopAnalyzer.cs -crlf
+/StopFilter.cs -crlf
+/Token.cs -crlf
+/TokenFilter.cs -crlf
+/TokenStream.cs -crlf
+/Tokenizer.cs -crlf
+/WhitespaceAnalyzer.cs -crlf
+/WhitespaceTokenizer.cs -crlf
--- /dev/null
+/GermanAnalyzer.cs -crlf
+/GermanStemFilter.cs -crlf
+/GermanStemmer.cs -crlf
+/Package.html -crlf
+/WordlistLoader.cs -crlf
--- /dev/null
+/Package.html -crlf
+/RussianAnalyzer.cs -crlf
+/RussianCharsets.cs -crlf
+/RussianLetterTokenizer.cs -crlf
+/RussianLowerCaseFilter.cs -crlf
+/RussianStemFilter.cs -crlf
+/RussianStemmer.cs -crlf
--- /dev/null
+/CharStream.cs -crlf
+/FastCharStream.cs -crlf
+/Package.html -crlf
+/ParseException.cs -crlf
+/StandardAnalyzer.cs -crlf
+/StandardFilter.cs -crlf
+/StandardTokenizer.cs -crlf
+/StandardTokenizerConstants.cs -crlf
+/StandardTokenizerTokenManager.cs -crlf
+/Token.cs -crlf
+/TokenMgrError.cs -crlf
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
do \r
{\r
switch (jjstateSet[--ii])\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
do \r
{\r
switch (jjstateSet[--ii])\r
int i1 = hiByte >> 6;\r
ulong l1 = ((ulong) 1L) << (hiByte & 63);\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
do \r
{\r
switch (jjstateSet[--ii])\r
--- /dev/null
+/DateField.cs -crlf
+/Document.cs -crlf
+/Field.cs -crlf
+/Package.html -crlf
}\r
\r
// make date strings long enough to last a millenium\r
- private static int DATE_LEN = SupportClass.Number.ToString(
+ private static int DATE_LEN = SupportClass.Number.ToString(\r
1000L * 365 * 24 * 60 * 60 * 1000, SupportClass.Number.MAX_RADIX).Length;\r
\r
public static System.String MIN_DATE_STRING()\r
if (time < 0)\r
throw new System.SystemException("time too early");\r
\r
- System.String s = SupportClass.Number.ToString(time, SupportClass.Number.MAX_RADIX);
+ System.String s = SupportClass.Number.ToString(time, SupportClass.Number.MAX_RADIX);\r
\r
if (s.Length > DATE_LEN)\r
throw new System.SystemException("time too late");\r
/// <summary>Converts a string-encoded date into a Date object. </summary>\r
public static System.DateTime StringToDate(System.String s)\r
{\r
- long ticks = StringToTime(s) * TimeSpan.TicksPerMillisecond;
- System.DateTime date = new System.DateTime(1970, 1, 1);
- date = date.AddTicks(ticks);
- date = date.Add(TimeZone.CurrentTimeZone.GetUtcOffset(date));
- return date;
+ long ticks = StringToTime(s) * TimeSpan.TicksPerMillisecond;\r
+ System.DateTime date = new System.DateTime(1970, 1, 1);\r
+ date = date.AddTicks(ticks);\r
+ date = date.Add(TimeZone.CurrentTimeZone.GetUtcOffset(date));\r
+ return date;\r
\r
/*\r
System.TimeSpan ts = System.TimeSpan.FromMilliseconds(System.DateField.StringToTime(s));\r
--- /dev/null
+/CompoundFileReader.cs -crlf
+/CompoundFileWriter.cs -crlf
+/DocumentWriter.cs -crlf
+/FieldInfo.cs -crlf
+/FieldInfos.cs -crlf
+/FieldsReader.cs -crlf
+/FieldsWriter.cs -crlf
+/FilterIndexReader.cs -crlf
+/IndexReader.cs -crlf
+/IndexWriter.cs -crlf
+/MultiReader.cs -crlf
+/MultipleTermPositions.cs -crlf
+/Package.html -crlf
+/SegmentInfo.cs -crlf
+/SegmentInfos.cs -crlf
+/SegmentMergeInfo.cs -crlf
+/SegmentMergeQueue.cs -crlf
+/SegmentMerger.cs -crlf
+/SegmentReader.cs -crlf
+/SegmentTermDocs.cs -crlf
+/SegmentTermEnum.cs -crlf
+/SegmentTermPositions.cs -crlf
+/SegmentTermVector.cs -crlf
+/Term.cs -crlf
+/TermDocs.cs -crlf
+/TermEnum.cs -crlf
+/TermFreqVector.cs -crlf
+/TermInfo.cs -crlf
+/TermInfosReader.cs -crlf
+/TermInfosWriter.cs -crlf
+/TermPositionVector.cs -crlf
+/TermPositions.cs -crlf
+/TermVectorsReader.cs -crlf
+/TermVectorsWriter.cs -crlf
fieldPositions = new int[fieldInfos.Size()]; // init fieldPositions\r
\r
fieldBoosts = new float[fieldInfos.Size()]; // init fieldBoosts\r
- float boost = doc.GetBoost();
- for (int i = 0; i < fieldBoosts.Length; i++)
- {
- fieldBoosts[i] = boost;
- }
+ float boost = doc.GetBoost();\r
+ for (int i = 0; i < fieldBoosts.Length; i++)\r
+ {\r
+ fieldBoosts[i] = boost;\r
+ }\r
\r
InvertDocument(doc);\r
\r
--- /dev/null
+/CharStream.cs -crlf
+/FastCharStream.cs -crlf
+/MultiFieldQueryParser.cs -crlf
+/Package.html -crlf
+/ParseException.cs -crlf
+/QueryParser.cs -crlf
+/QueryParserConstants.cs -crlf
+/QueryParserTokenManager.cs -crlf
+/Token.cs -crlf
+/TokenMgrError.cs -crlf
\r
int charsRead = 0;\r
\r
- try
- {
+ try\r
+ {\r
charsRead = input.Read(buffer, newPosition, buffer.Length - newPosition);\r
}\r
- catch
- {
- }
+ catch \r
+ {\r
+ }\r
\r
if (charsRead <= 0)\r
throw new System.IO.IOException("read past eof");\r
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
MatchLoop: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
int i1 = hiByte >> 6;\r
ulong l1 = ((ulong) 1L) << (hiByte & 63);\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
MatchLoop1: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
int i1 = hiByte >> 6;\r
ulong l1 = ((ulong) 1L) << (hiByte & 63);\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
MatchLoop1: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
int i1 = hiByte >> 6;\r
ulong l1 = ((ulong) 1L) << (hiByte & 63);\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
ReInitRounds();\r
if (curChar < 64)\r
{\r
- ulong l = ((ulong) 1L) << curChar;\r\r
+ ulong l = ((ulong) 1L) << curChar;\r
MatchLoop1: \r
do \r
{\r
}\r
else if (curChar < 128)\r
{\r
- ulong l = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
int i1 = hiByte >> 6;\r
ulong l1 = ((ulong) 1L) << (hiByte & 63);\r
int i2 = (curChar & 0xff) >> 6;\r
- ulong l2 = ((ulong) 1L) << (curChar & 63);\r\r
+ ulong l2 = ((ulong) 1L) << (curChar & 63);\r
MatchLoop1: \r
do \r
{\r
--- /dev/null
+/BooleanClause.cs -crlf
+/BooleanQuery.cs -crlf
+/BooleanScorer.cs -crlf
+/CachingWrapperFilter.cs -crlf
+/ConjunctionScorer.cs -crlf
+/DateFilter.cs -crlf
+/DefaultSimilarity.cs -crlf
+/ExactPhraseScorer.cs -crlf
+/Explanation.cs -crlf
+/FieldCache.cs -crlf
+/FieldCacheImpl.cs -crlf
+/FieldDoc.cs -crlf
+/FieldDocSortedHitQueue.cs -crlf
+/FieldSortedHitQueue.cs -crlf
+/Filter.cs -crlf
+/FilteredQuery.cs -crlf
+/FilteredTermEnum.cs -crlf
+/FuzzyQuery.cs -crlf
+/FuzzyTermEnum.cs -crlf
+/HitCollector.cs -crlf
+/HitQueue.cs -crlf
+/Hits.cs -crlf
+/IndexSearcher.cs -crlf
+/MultiSearcher.cs -crlf
+/MultiTermQuery.cs -crlf
+/Package.html -crlf
+/ParallelMultiSearcher.cs -crlf
+/PhrasePositions.cs -crlf
+/PhrasePrefixQuery.cs -crlf
+/PhraseQuery.cs -crlf
+/PhraseQueue.cs -crlf
+/PhraseScorer.cs -crlf
+/PrefixQuery.cs -crlf
+/Query.cs -crlf
+/QueryFilter.cs -crlf
+/QueryTermVector.cs -crlf
+/RangeQuery.cs -crlf
+/RemoteSearchable.cs -crlf
+/ScoreDoc.cs -crlf
+/ScoreDocComparator.cs -crlf
+/Scorer.cs -crlf
+/Searchable.cs -crlf
+/Searcher.cs -crlf
+/Similarity.cs -crlf
+/SloppyPhraseScorer.cs -crlf
+/Sort.cs -crlf
+/SortComparator.cs -crlf
+/SortComparatorSource.cs -crlf
+/SortField.cs -crlf
+/TermQuery.cs -crlf
+/TermScorer.cs -crlf
+/TopDocs.cs -crlf
+/TopFieldDocs.cs -crlf
+/Weight.cs -crlf
+/WildcardQuery.cs -crlf
+/WildcardTermEnum.cs -crlf
/// <summary>Returns a hash code value for this object.</summary>\r
public override int GetHashCode()\r
{\r
- int boostInt = BitConverter.ToInt32(BitConverter.GetBytes(GetBoost()), 0);
- return boostInt ^ clauses.GetHashCode();
+ int boostInt = BitConverter.ToInt32(BitConverter.GetBytes(GetBoost()), 0);\r
+ return boostInt ^ clauses.GetHashCode();\r
}\r
}\r
}
\ No newline at end of file
/// <summary>Returns a hash code value for this object.</summary>\r
public override int GetHashCode()\r
{\r
- return System.BitConverter.ToInt32(System.BitConverter.GetBytes(GetBoost()), 0) ^
- System.BitConverter.ToInt32(System.BitConverter.GetBytes(slop), 0) ^
- terms.GetHashCode() ^
- positions.GetHashCode();
+ return System.BitConverter.ToInt32(System.BitConverter.GetBytes(GetBoost()), 0) ^ \r
+ System.BitConverter.ToInt32(System.BitConverter.GetBytes(slop), 0) ^ \r
+ terms.GetHashCode() ^ \r
+ positions.GetHashCode();\r
}\r
override public System.Object Clone()\r
{\r
}\r
}\r
\r
- BooleanQuery result = new BooleanQuery();
- foreach (BooleanClause booleanClause in allClauses.Keys)
- {
- result.Add(booleanClause);
+ BooleanQuery result = new BooleanQuery();\r
+ foreach (BooleanClause booleanClause in allClauses.Keys)\r
+ {\r
+ result.Add(booleanClause);\r
}\r
return result;\r
}\r
--- /dev/null
+/NearSpans.cs -crlf
+/Package.html -crlf
+/SpanFirstQuery.cs -crlf
+/SpanNearQuery.cs -crlf
+/SpanNotQuery.cs -crlf
+/SpanOrQuery.cs -crlf
+/SpanQuery.cs -crlf
+/SpanScorer.cs -crlf
+/SpanTermQuery.cs -crlf
+/SpanWeight.cs -crlf
+/Spans.cs -crlf
--- /dev/null
+/Directory.cs -crlf
+/FSDirectory.cs -crlf
+/InputStream.cs -crlf
+/Lock.cs -crlf
+/OutputStream.cs -crlf
+/Package.html -crlf
+/RAMDirectory.cs -crlf
+/RAMFile.cs -crlf
+/RAMInputStream.cs -crlf
+/RAMOutputStream.cs -crlf
/* DEBUG */\r
// {{Aroush\r
public long position;\r
- public Descriptor(FSInputStream enclosingInstance, System.IO.FileInfo file, System.IO.FileAccess fileAccess)
- : base(new System.IO.FileStream(file.FullName, System.IO.FileMode.Open, fileAccess, System.IO.FileShare.ReadWrite))
- {
- }
+ public Descriptor(FSInputStream enclosingInstance, System.IO.FileInfo file, System.IO.FileAccess fileAccess) \r
+ : base(new System.IO.FileStream(file.FullName, System.IO.FileMode.Open, fileAccess, System.IO.FileShare.ReadWrite))\r
+ {\r
+ }\r
\r
//{{}}// public Descriptor(FSInputStream enclosingInstance, System.IO.FileInfo file, System.String mode) : base(file, mode)\r
//{{}}// {\r
\r
public FSOutputStream(System.IO.FileInfo path)\r
{\r
- file = new System.IO.BinaryWriter(new System.IO.FileStream(path.FullName, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite));
+ file = new System.IO.BinaryWriter(new System.IO.FileStream(path.FullName, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite));\r
}\r
\r
/// <summary>output methods: </summary>\r
--- /dev/null
+/BitVector.cs -crlf
+/Constants.cs -crlf
+/Package.html -crlf
+/PriorityQueue.cs -crlf
+/StringHelper.cs -crlf
--- /dev/null
+/AnalysisTest.cs -crlf
+/AssemblyInfo.cs -crlf
+/IndexTest.cs -crlf
+/SearchTest.cs -crlf
+/SearchTestForDuplicates.cs -crlf
+/StoreTest.cs -crlf
+/Test.nunit -crlf
+/TestSearch.cs -crlf
+/TestSearchForDuplicates.cs -crlf
+/ThreadSafetyTest.cs -crlf
--- /dev/null
+/TestAnalyzers.cs -crlf
+/TestPerFieldAnalzyerWrapper.cs -crlf
+/TestStopAnalyzer.cs -crlf
--- /dev/null
+/TEST1251.TXT -crlf
+/TESTKOI8.TXT -crlf
+/TestRussianAnalyzer.cs -crlf
+/TestRussianStem.cs -crlf
stopWordsSet.Add("analyzer", "analyzer");\r
\r
// {{Aroush how can we copy 'stopWordsSet' to 'System.String[]'?\r
- System.String[] arrStopWordsSet = new System.String[3];
- arrStopWordsSet[0] = "good";
- arrStopWordsSet[1] = "test";
- arrStopWordsSet[2] = "analyzer";
- // Aroush}}
+ System.String[] arrStopWordsSet = new System.String[3];\r
+ arrStopWordsSet[0] = "good";\r
+ arrStopWordsSet[1] = "test";\r
+ arrStopWordsSet[2] = "analyzer";\r
+ // Aroush}}\r
\r
StopAnalyzer newStop = new StopAnalyzer(arrStopWordsSet);\r
System.IO.StringReader reader = new System.IO.StringReader("This is a good test of the english stop analyzer");\r
--- /dev/null
+/test.txt -crlf
+/test2.txt -crlf
--- /dev/null
+/TestDocument.cs -crlf
--- /dev/null
+/DocHelper.cs -crlf
+/DocTest.cs -crlf
+/MockInputStream.cs -crlf
+/TermInfosTest.cs -crlf
+/TestCompoundFile.cs -crlf
+/TestDoc.cs -crlf
+/TestDocumentWriter.cs -crlf
+/TestFieldInfos.cs -crlf
+/TestFieldsReader.cs -crlf
+/TestFilterIndexReader.cs -crlf
+/TestIndexReader.cs -crlf
+/TestIndexWriter.cs -crlf
+/TestInputStream.cs -crlf
+/TestMultiReader.cs -crlf
+/TestSegmentMerger.cs -crlf
+/TestSegmentReader.cs -crlf
+/TestSegmentTermDocs.cs -crlf
+/TestSegmentTermEnum.cs -crlf
+/TestTermVectorsReader.cs -crlf
+/TestTermVectorsWriter.cs -crlf
--- /dev/null
+/FSDirectoryTestCase.cs -crlf
--- /dev/null
+/TestQueryParser.cs -crlf
--- /dev/null
+/CheckHits.cs -crlf
+/MockFilter.cs -crlf
+/SampleComparable.cs -crlf
+/TestBooleanPrefixQuery.cs -crlf
+/TestCachingWrapperFilter.cs -crlf
+/TestDateFilter.cs -crlf
+/TestDocBoost.cs -crlf
+/TestFilteredQuery.cs -crlf
+/TestMultiSearcher.cs -crlf
+/TestNot.cs -crlf
+/TestParallelMultiSearcher.cs -crlf
+/TestPhrasePrefixQuery.cs -crlf
+/TestPhraseQuery.cs -crlf
+/TestPositionIncrement.cs -crlf
+/TestPrefixQuery.cs -crlf
+/TestQueryTermVector.cs -crlf
+/TestRangeQuery.cs -crlf
+/TestRemoteSearchable.cs -crlf
+/TestSetNorm.cs -crlf
+/TestSimilarity.cs -crlf
+/TestSort.cs -crlf
+/TestTermVectors.cs -crlf
+/TestWildcard.cs -crlf
--- /dev/null
+/TestBasics.cs -crlf
+/TestSpans.cs -crlf
--- /dev/null
+/_TestHelper.cs -crlf
--- /dev/null
+/English.cs -crlf
+/StringHelperTest.cs -crlf
+/TestBitVector.cs -crlf
+/TestPriorityQueue.cs -crlf
--- /dev/null
+/commentservice.cs -crlf
--- /dev/null
+/helper.js -crlf
--- /dev/null
+/FailedTest.cs -crlf
+/NUnitReport.cs -crlf
--- /dev/null
+/style.css -crlf
--- /dev/null
+/ChangeLog -crlf
--- /dev/null
+/.cvsignore -crlf
--- /dev/null
+/.cvsignore -crlf
[assembly: AssemblyTitle ("Mono PermView")]
[assembly: AssemblyDescription ("Managed Permission Viewer for .NET assemblies")]
-namespace Mono.Tools {\r
-\r
- class SecurityElementComparer : IComparer {\r
-\r
- public int Compare (object x, object y)\r
- {\r
- SecurityElement sx = (x as SecurityElement);\r
- SecurityElement sy = (y as SecurityElement);\r
- if (sx == null)\r
- return (sy == null) ? 0 : -1;\r
- else if (sy == null)\r
- return 1;\r
-\r
- // compare by name (type name, method name, action name)\r
- return String.Compare (sx.Attribute ("Name"), sy.Attribute ("Name"));\r
- }\r
+namespace Mono.Tools {
+
+ class SecurityElementComparer : IComparer {
+
+ public int Compare (object x, object y)
+ {
+ SecurityElement sx = (x as SecurityElement);
+ SecurityElement sy = (y as SecurityElement);
+ if (sx == null)
+ return (sy == null) ? 0 : -1;
+ else if (sy == null)
+ return 1;
+
+ // compare by name (type name, method name, action name)
+ return String.Compare (sx.Attribute ("Name"), sy.Attribute ("Name"));
+ }
}
class PermView {
Console.WriteLine ("Usage: permview [options] assembly{0}", Environment.NewLine);
Console.WriteLine ("where options are:");
Console.WriteLine (" -output filename Output information into specified file.");
- Console.WriteLine (" -decl Show declarative security attributes on classes and methods.");\r
- Console.WriteLine (" -xml Output in XML format");\r
+ Console.WriteLine (" -decl Show declarative security attributes on classes and methods.");
+ Console.WriteLine (" -xml Output in XML format");
Console.WriteLine (" -help Show help informations (this text)");
Console.WriteLine ();
}
}
static SecurityElement AddSecurityXml (SecurityDeclarationCollection declarations)
- {\r
- ArrayList list = new ArrayList ();\r
- foreach (SecurityDeclaration declsec in declarations) {\r
- SecurityElement child = new SecurityElement ("Action");\r
- AddAttribute (child, "Name", declsec.Action.ToString ());\r
- child.AddChild (declsec.PermissionSet.ToXml ());\r
- list.Add (child);\r
- }\r
- // sort actions\r
+ {
+ ArrayList list = new ArrayList ();
+ foreach (SecurityDeclaration declsec in declarations) {
+ SecurityElement child = new SecurityElement ("Action");
+ AddAttribute (child, "Name", declsec.Action.ToString ());
+ child.AddChild (declsec.PermissionSet.ToXml ());
+ list.Add (child);
+ }
+ // sort actions
list.Sort (Comparer);
SecurityElement se = new SecurityElement ("Actions");
se.AddChild (child);
}
return se;
- }\r
-\r
+ }
+
static SecurityElementComparer comparer;
static IComparer Comparer {
get {
}
static bool ProcessAssemblyXml (TextWriter tw, AssemblyDefinition ad)
- {\r
+ {
SecurityElement se = new SecurityElement ("Assembly");
se.AddAttribute ("Name", ad.Name.FullName);
se.AddChild (AddSecurityXml (ad.SecurityDeclarations));
}
- ArrayList tlist = new ArrayList ();\r
+ ArrayList tlist = new ArrayList ();
ArrayList mlist = new ArrayList ();
foreach (ModuleDefinition module in ad.Modules) {
SecurityElement typelem = null;
if (type.SecurityDeclarations.Count > 0) {
typelem = AddSecurityXml (type.SecurityDeclarations);
- }\r
-\r
- if (mlist.Count > 0)\r
+ }
+
+ if (mlist.Count > 0)
mlist.Clear ();
foreach (MethodDefinition method in type.Methods) {
- if (method.SecurityDeclarations.Count > 0) {\r
+ if (method.SecurityDeclarations.Count > 0) {
SecurityElement meth = new SecurityElement ("Method");
AddAttribute (meth, "Name", method.ToString ());
meth.AddChild (AddSecurityXml (method.SecurityDeclarations));
}
}
- // sort methods\r
- mlist.Sort (Comparer);\r
- foreach (SecurityElement method in mlist) {\r
- methods.AddChild (method);\r
+ // sort methods
+ mlist.Sort (Comparer);
+ foreach (SecurityElement method in mlist) {
+ methods.AddChild (method);
}
if ((typelem != null) || ((methods.Children != null) && (methods.Children.Count > 0))) {
- AddAttribute (klass, "Name", type.ToString ());\r
+ AddAttribute (klass, "Name", type.ToString ());
if (typelem != null)
klass.AddChild (typelem);
if ((methods.Children != null) && (methods.Children.Count > 0))
}
// sort types
- tlist.Sort (Comparer);\r
- foreach (SecurityElement type in tlist) {\r
- se.AddChild (type);\r
+ tlist.Sort (Comparer);
+ foreach (SecurityElement type in tlist) {
+ se.AddChild (type);
}
}
Console.WriteLine ("No certificates available to sign the assembly.");
return 1;
}
- af.Certificates.AddRange (certs);\r
-\r
- if (!af.Sign (tbsFilename)) {\r
- Console.WriteLine ("Couldn't sign file '{0}'.", tbsFilename);\r
- return 1;\r
- }\r
- } else if (af.TimestampUrl != null) {\r
- bool ts = false;\r
- // only timestamp an already signed file\r
- for (int j = 0; j < timestampRetry && !ts; j++) {\r
- ts = af.Timestamp (tbsFilename);\r
- // wait (unless it's the last try) and retry\r
- if (!ts && (j < timestampRetry - 1)) {\r
- Console.WriteLine ("Couldn't timestamp file '{0}', will retry in {1} ms", tbsFilename, timestampDelay);\r
- Thread.Sleep (timestampDelay);\r
- }\r
- }\r
- if (!ts) {\r
- Console.WriteLine ("Couldn't timestamp file '{0}' after {1} retries.", tbsFilename, timestampRetry);\r
- return 1;\r
- }\r
- } else {\r
- Help ();\r
- return 1;\r
- }\r
-\r
+ af.Certificates.AddRange (certs);
+
+ if (!af.Sign (tbsFilename)) {
+ Console.WriteLine ("Couldn't sign file '{0}'.", tbsFilename);
+ return 1;
+ }
+ } else if (af.TimestampUrl != null) {
+ bool ts = false;
+ // only timestamp an already signed file
+ for (int j = 0; j < timestampRetry && !ts; j++) {
+ ts = af.Timestamp (tbsFilename);
+ // wait (unless it's the last try) and retry
+ if (!ts && (j < timestampRetry - 1)) {
+ Console.WriteLine ("Couldn't timestamp file '{0}', will retry in {1} ms", tbsFilename, timestampDelay);
+ Thread.Sleep (timestampDelay);
+ }
+ }
+ if (!ts) {
+ Console.WriteLine ("Couldn't timestamp file '{0}' after {1} retries.", tbsFilename, timestampRetry);
+ return 1;
+ }
+ } else {
+ Help ();
+ return 1;
+ }
+
Console.WriteLine ("Success");
return 0;
}
--- /dev/null
+/.cvsignore -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
+/sqlmetal.exe.config -crlf
--- /dev/null
+/AssemblyInfo.cs -crlf
--- /dev/null
+/.cvsignore -crlf
--- /dev/null
+/Makefile -crlf
editor = new SqlEditorSharp ();
editor.UseSyntaxHiLighting = true;
editor.View.Show ();
- editor.View.KeyPressEvent +=\r
- new GtkSharp.KeyPressEventHandler(OnKeyPressEventKey);\r
+ editor.View.KeyPressEvent +=
+ new GtkSharp.KeyPressEventHandler(OnKeyPressEventKey);
lastUnknownFile ++;
string unknownFile = "Unknown" +
return sw;
}
- void OnKeyPressEventKey(object o, GtkSharp.KeyPressEventArgs args) \r
- {\r
- if (o is TextView) {\r
- TextView tv = (TextView) o;\r
- //Gdk.EventKey k = args.Event;\r
-\r
- // if the F5 key was pressed\r
- if (args.Event.keyval == 0xFFC2) {\r
- if (tv.Editable == true) {\r
- // execute SQL\r
- ExecuteSQL (ExecuteOutputType.Normal, "");\r
- }\r
- }\r
- }\r
+ void OnKeyPressEventKey(object o, GtkSharp.KeyPressEventArgs args)
+ {
+ if (o is TextView) {
+ TextView tv = (TextView) o;
+ //Gdk.EventKey k = args.Event;
+
+ // if the F5 key was pressed
+ if (args.Event.keyval == 0xFFC2) {
+ if (tv.Editable == true) {
+ // execute SQL
+ ExecuteSQL (ExecuteOutputType.Normal, "");
+ }
+ }
+ }
}
Toolbar CreateToolbar ()
--- /dev/null
+/.cvsignore -crlf
+/MonoWSDL.cs -crlf
+/MonoWSDL2.cs -crlf
+2010-07-28 Ankit Jain <jankit@novell.com>
+
+ * xbuild/Microsoft.CSharp.targets: Use '*mcs.bat' on windows.
+
2010-07-22 Ankit Jain <jankit@novell.com>
* xbuild/Microsoft.Silverlight.Common.targets(GenerateMoonlightManifest):
<CreateManifestResourceNamesDependsOn></CreateManifestResourceNamesDependsOn>
<CoreCompileDependsOn></CoreCompileDependsOn>
- <CscToolExe Condition="'$(CscToolExe)' == '' and '$(TargetFrameworkVersion)' != 'v4.0'">gmcs</CscToolExe>
- <CscToolExe Condition="'$(CscToolExe)' == '' and '$(TargetFrameworkVersion)' == 'v4.0'">dmcs</CscToolExe>
+ <CscToolExe Condition="'$(CscToolExe)' == '' and '$(TargetFrameworkVersion)' != 'v4.0' and '$(OS)' != 'Windows_NT'">gmcs</CscToolExe>
+ <CscToolExe Condition="'$(CscToolExe)' == '' and '$(TargetFrameworkVersion)' != 'v4.0' and '$(OS)' == 'Windows_NT'">gmcs.bat</CscToolExe>
+
+ <CscToolExe Condition="'$(CscToolExe)' == '' and '$(TargetFrameworkVersion)' == 'v4.0' and '$(OS)' != 'Windows_NT'">dmcs</CscToolExe>
+ <CscToolExe Condition="'$(CscToolExe)' == '' and '$(TargetFrameworkVersion)' == 'v4.0' and '$(OS)' == 'Windows_NT'">dmcs.bat</CscToolExe>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildToolsPath)\Microsoft.CSharp.targets</MSBuildAllProjects>
</PropertyGroup>
%_bindir/mcs
%_bindir/mono
%_bindir/mono-configuration-crypto
+%_bindir/mono-sgen
%_bindir/mono-test-install
%_bindir/mozroots
%_bindir/peverify
%_libdir/pkgconfig/mono-2.pc
%_includedir/mono-2.0
+%package -n libmonosgen-2_0-0
+License: LGPL v2.1 only
+Summary: A Library for embedding Mono in your Application (sgen version)
+Group: Development/Libraries/C and C++
+
+%description -n libmonosgen-2_0-0
+The Mono Project is an open development initiative that is working to
+develop an open source, Unix version of the .NET development platform.
+Its objective is to enable Unix developers to build and deploy
+cross-platform .NET applications. The project will implement various
+technologies that have been submitted to the ECMA for standardization.
+
+A Library for embedding Mono in your Application (sgen version).
+
+%files -n libmonosgen-2_0-0
+%defattr(-, root, root)
+%_libdir/libmonosgen-2.0.so.0*
+
+%post -n libmonosgen-2_0-0 -p /sbin/ldconfig
+
+%postun -n libmonosgen-2_0-0 -p /sbin/ldconfig
+
+%package -n libmonosgen-2_0-devel
+License: LGPL v2.1 only
+Summary: Development files for libmonosgen
+Group: Development/Languages/Mono
+
+%description -n libmonosgen-2_0-devel
+The Mono Project is an open development initiative that is working to
+develop an open source, Unix version of the .NET development platform.
+Its objective is to enable Unix developers to build and deploy
+cross-platform .NET applications. The project will implement various
+technologies that have been submitted to the ECMA for standardization.
+
+Development files for libmonosgen.
+
+%files -n libmonosgen-2_0-devel
+%defattr(-, root, root)
+%_libdir/libmonosgen-2.0.a
+%_libdir/libmonosgen-2.0.so
+
%package -n mono-locale-extras
License: LGPL v2.1 only
Summary: Extra locale information
%_prefix/lib/mono/2.0/Novell.Directory.Ldap.dll
%_prefix/lib/mono/2.0/System.Data.DataSetExtensions.dll
%_prefix/lib/mono/2.0/System.Data.Linq.dll
+%_prefix/lib/mono/2.0/System.Data.Services.dll
%_prefix/lib/mono/2.0/System.Data.dll
%_prefix/lib/mono/2.0/System.DirectoryServices.dll
%_prefix/lib/mono/2.0/System.EnterpriseServices.dll
%_prefix/lib/mono/4.0/Novell.Directory.Ldap.dll
%_prefix/lib/mono/4.0/System.Data.DataSetExtensions.dll
%_prefix/lib/mono/4.0/System.Data.Linq.dll
+%_prefix/lib/mono/4.0/System.Data.Services.dll
%_prefix/lib/mono/4.0/System.Data.dll
%_prefix/lib/mono/4.0/System.DirectoryServices.dll
%_prefix/lib/mono/4.0/System.EnterpriseServices.dll
%_prefix/lib/mono/2.0/System.ServiceModel.dll
%_prefix/lib/mono/4.0/System.IdentityModel.Selectors.dll
%_prefix/lib/mono/4.0/System.IdentityModel.dll
+%_prefix/lib/mono/4.0/System.Runtime.DurableInstancing.dll
%_prefix/lib/mono/4.0/System.Runtime.Serialization.dll
%_prefix/lib/mono/4.0/System.ServiceModel.Routing.dll
%_prefix/lib/mono/4.0/System.ServiceModel.Web.dll
%_prefix/lib/mono/gac/System.Data.Services.Client
%_prefix/lib/mono/gac/System.IdentityModel
%_prefix/lib/mono/gac/System.IdentityModel.Selectors
+%_prefix/lib/mono/gac/System.Runtime.DurableInstancing
%_prefix/lib/mono/gac/System.Runtime.Serialization
%_prefix/lib/mono/gac/System.ServiceModel
%_prefix/lib/mono/gac/System.ServiceModel.Routing
--- /dev/null
+/arm-wmmx.h -crlf
--- /dev/null
+/bulkcpy.il -crlf
+/life.cs -crlf
+/zipmark.cs -crlf
-// created on 03/03/2002 at 15:12
-using System;
-
-class App {
- static String s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15;
- static int[] offsets = {-16, -15, -14, -1, 1, 14, 15, 16};
- public static int Main(String[] args) {
- int i2 = 500;
- int i0;
- double n2;
- DateTime start, end;
- start = DateTime.Now;
+// created on 03/03/2002 at 15:12\r
+using System;\r
+\r
+class App {\r
+ static String s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15;\r
+ static int[] offsets = {-16, -15, -14, -1, 1, 14, 15, 16};\r
+ public static int Main(String[] args) {\r
+ int i2 = 500;\r
+ int i0;\r
+ double n2;\r
+ DateTime start, end;\r
+ start = DateTime.Now;\r
s0 = " ";\r
s1 = " ";\r
s2 = " ";\r
s15 ="";\r
s15 = s0+s1+s2+s3+s4+s5+s6+s7+s8+s9+s10+s11+s12+s13+s14;\r
dump();\r
- i0 =0;\r\r
+ i0 =0;\r
while (i0++ < i2) {\r
generate();\r
dump();\r
Console.WriteLine("{0} generations in {1} milliseconds, {2} gen/sec.",\r
i2, (int)n2, (int)(i2/(n2/1000)));\r
return 0;\r
-}\r\r
+}\r\r \r
static void generate() {\r
int i0, i1, i2, i3;\r
i0 = s15.Length;\r
i3 = (offset + i0 + i1) % i0;\r
if (s15.Substring(i3, 1) == "*")\r
i2++;\r
- }\r
+ }\r \r
if (s15.Substring(i1, 1) == "*") {\r
if (i2 < 2 || i2 > 3) {\r
s1 += " ";\r
;\r
}\r
}\r\r\r
-
+\r
--- /dev/null
+/make-opcode-def.xsl -crlf
--- /dev/null
+/normalization-tables.h -crlf
+2010-07-30 Mark Probst <mark.probst@gmail.com>
+
+ * sgen-archdep.h (ARCH_COPY_SIGCTX_REGS): Add casts to fix
+ compiler warnings on AMD64.
+
+2010-07-29 Rodrigo Kumpera <rkumpera@novell.com>
+
+ Add support for calling vararg methods from SRE code.
+ This requires storing per-memberref signatures so
+ the JIT can know how many varargs parameters are
+ been passed.
+
+ * loader.c (mono_method_get_signature_full): If the
+ image is dynamic call mono_reflection_lookup_signature
+ to lookup the signature.
+
+ * reflection.c (mono_image_create_method_token): Save
+ the method object into the MonoDynamicImage::tokens.
+ Create a signature struct for MethodBuilders.
+ Save the signature into vararg_aux_hash so it can be
+ retrieved later.
+
+ * reflection.c (mono_reflection_lookup_signature): New
+ function. Check vararg_aux_hash for a signature before
+ returning method's own signature.
+
+ * metadata-internals.h (MonoDynamicImage): Add new
+ vararg_aux_hash hashtable.
+
+ * object-internals.h: Add mono_reflection_lookup_signature.
+
+ Fixes #626441
+
+2010-07-28 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * verify.c (mono_method_verify): Don't move forward
+ with verification if a stack overflow is detected for
+ the ARGLIST opcode.
+
+ Fixes #601953
+
+2010-07-28 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * class.c (mono_bounded_array_class_get): Fail arrays
+ of void or typedbyref. Those two types are not allowed
+ to be used with arrays. Failing them is easier and less
+ error prone than returning NULL.
+
+ Fixes #603279
+
+2010-07-28 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * object.c (mono_get_delegate_invoke): Don't assert if
+ the Invoke method is not found. This can happen with
+ broken types and it's the caller resposibility to deal
+ with a null return.
+
+ Fixes #553403
+
+2010-07-28 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * class.c (mono_assembly_name_from_token): Handle
+ images with null assembly. This can happen with resource
+ or broken assemblies.
+
+ Fixes #623586.
+
+2010-07-27 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * class.c (concat_two_strings_with_zero): Guard against
+ null strings.
+
+ Modified version of patch by Sebastien Pouliot.
+
+ Fixes #623653.
+
+2010-07-27 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * image.c (mono_image_load_module): Handle the case of
+ module index equal or smaller than zero. It is possible
+ to embed a valid zero index into metadata so this case
+ must be explicitly handled.
+
+ Patch by Sebastien Pouliot.
+
+ Fixes #623581.
+
+2010-07-27 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * metadata-verify.c (INVALID_IMPLMAP_FLAGS_BITS): Add non standard
+ bits for best fit on/off (4,5) and throw on unmappable on/off (12/13).
+
+ Fixes #622221.
+
+2010-07-27 Geoff Norton <gnorton@novell.com>
+
+ * sgen-archdep.h: Ensure we store the registers we actually
+ need to scan.
+
+2010-07-27 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * verify.c (do_invoke_method): Improve error message.
+
+2010-07-27 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * verify.c (mono_generic_param_is_constraint_compatible): Don't
+ fail a contraint check even if the candidate has no constraints.
+ All constraints might resolve to the candidate itself so it can
+ have none.
+
+ Fixes #622225.
+
+2010-07-25 Mark Probst <mark.probst@gmail.com>
+
+ * sgen-internal.c: Only compile this if HAVE_SGEN_GC is defined.
+
+2010-07-24 Mark Probst <mark.probst@gmail.com>
+
+ * sgen-internal.c, sgen-gc.h, sgen-major-copying.c: Make the
+ internal allocator fast by keeping free-lists of chunks, not only
+ within chunks. Align the chunks, so that on freeing we can get
+ the chunk without searching.
+
+2010-07-24 Mark Probst <mark.probst@gmail.com>
+
+ * sgen-internal.c, sgen-gc.c, sgen-gc.h, sgen-gray.c,
+ sgen-major-copying.c, sgen-marksweep.c, sgen-pinning-stats.c,
+ sgen-pinning.c: Allocate fixed-size structs without specifying the
+ size, instead registering it once with its type.
+ Dynamically-sized need their size specified when being freed.
+
+2010-07-24 Mark Probst <mark.probst@gmail.com>
+
+ * sgen-major-copying.c, sgen-internal.c, sgen-gc.c, sgen-gc.h,
+ sgen-pinning.c: Copying major collector doesn't mess around with
+ internals of the internal allocator anymore, instead using public
+ functions.
+
+2010-07-24 Mark Probst <mark.probst@gmail.com>
+
+ * sgen-internal.c: Internal allocator in its own module.
+
+ * sgen-gc.c, sgen-gc.h, sgen-gray.c, sgen-los.c,
+ sgen-major-copying.c, sgen-marksweep.c, sgen-pinning.c,
+ sgen-pinning-stats.c: Remove internal allocator and call the
+ public functions now.
+
+ * Makefile.am: Added new file.
+
+2010-07-24 Zoltan Varga <vargaz@gmail.com>
+
+ * sgen-archdep.h (ARCH_COPY_SIGCTX_REGS): Fix warnings on amd64.
+
+2010-07-24 Sanjoy Das <sanjoy@playingwithpointers.com>
+
+ * sgen-gc.h: Removed 'foo defined but not used' warnings for the
+ *_signal_num variables.
+
2010-07-23 Zoltan Varga <vargaz@gmail.com>
* file-io.c (ves_icall_System_IO_MonoIO_Read): Add a null check.
sgen-os-posix.c \
sgen-os-mach.c \
sgen-gc.c \
+ sgen-internal.c \
sgen-gc.h \
sgen-archdep.h \
sgen-scan-object.h \
static char*
concat_two_strings_with_zero (MonoImage *image, const char *s1, const char *s2)
{
- int len = strlen (s1) + strlen (s2) + 2;
+ int null_length = strlen ("(null)");
+ int len = (s1 ? strlen (s1) : null_length) + (s2 ? strlen (s2) : null_length) + 2;
char *s = mono_image_alloc (image, len);
int result;
- result = g_snprintf (s, len, "%s%c%s", s1, '\0', s2);
+ result = g_snprintf (s, len, "%s%c%s", s1 ? s1 : "(null)", '\0', s2 ? s2 : "(null)");
g_assert (result == len - 1);
return s;
class->parent = parent;
class->instance_size = mono_class_instance_size (class->parent);
- if (eclass->enumtype && !mono_class_enum_basetype (eclass)) {
+ if (eclass->byval_arg.type == MONO_TYPE_TYPEDBYREF || eclass->byval_arg.type == MONO_TYPE_VOID) {
+ /*Arrays of those two types are invalid.*/
+ mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, NULL);
+ } else if (eclass->enumtype && !mono_class_enum_basetype (eclass)) {
if (!eclass->ref_info_handle || eclass->wastypebuilder) {
g_warning ("Only incomplete TypeBuilder objects are allowed to be an enum without base_type");
g_assert (eclass->ref_info_handle && !eclass->wastypebuilder);
switch (type_token & 0xff000000){
case MONO_TOKEN_TYPE_DEF:
- return mono_stringify_assembly_name (&image->assembly->aname);
- break;
+ if (image->assembly)
+ return mono_stringify_assembly_name (&image->assembly->aname);
+ else if (image->assembly_name)
+ return g_strdup (image->assembly_name);
+ return g_strdup_printf ("%s", image->name ? image->name : "[Could not resolve assembly name");
case MONO_TOKEN_TYPE_REF: {
MonoAssemblyName aname;
guint32 cols [MONO_TYPEREF_SIZE];
ICALL(THREAD_49, "VolatileWrite(uint16&,uint16)", ves_icall_System_Threading_Thread_VolatileWrite2)
ICALL(THREAD_50, "VolatileWrite(uintptr&,uintptr)", ves_icall_System_Threading_Thread_VolatileWriteIntPtr)
ICALL(THREAD_51, "VolatileWrite(ulong&,ulong)", ves_icall_System_Threading_Thread_VolatileWrite8)
+ICALL(THREAD_9, "Yield", ves_icall_System_Threading_Thread_Yield)
ICALL(THREAD_52, "current_lcid()", ves_icall_System_Threading_Thread_current_lcid)
ICALL_TYPE(THREADP, "System.Threading.ThreadPool", THREADP_1)
GList *list_iter, *valid_modules = NULL;
MonoImageOpenStatus status;
- if ((image->module_count == 0) || (idx > image->module_count))
+ if ((image->module_count == 0) || (idx > image->module_count || idx <= 0))
return NULL;
if (image->modules_loaded [idx - 1])
return image->modules [idx - 1];
if (method->klass->generic_class)
return mono_method_signature (method);
- if (image->dynamic)
- /* FIXME: This might be incorrect for vararg methods */
- return mono_method_signature (method);
+ if (image->dynamic) {
+ sig = mono_reflection_lookup_signature (image, method, token);
+ } else {
+ mono_metadata_decode_row (&image->tables [MONO_TABLE_MEMBERREF], idx-1, cols, MONO_MEMBERREF_SIZE);
+ sig_idx = cols [MONO_MEMBERREF_SIGNATURE];
- mono_metadata_decode_row (&image->tables [MONO_TABLE_MEMBERREF], idx-1, cols, MONO_MEMBERREF_SIZE);
- sig_idx = cols [MONO_MEMBERREF_SIGNATURE];
+ sig = find_cached_memberref_sig (image, sig_idx);
+ if (!sig) {
+ if (!mono_verifier_verify_memberref_signature (image, sig_idx, NULL)) {
+ guint32 class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK;
+ const char *fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]);
- sig = find_cached_memberref_sig (image, sig_idx);
- if (!sig) {
- if (!mono_verifier_verify_memberref_signature (image, sig_idx, NULL)) {
+ mono_loader_set_error_bad_image (g_strdup_printf ("Bad method signature class token 0x%08x field name %s token 0x%08x on image %s", class, fname, token, image->name));
+ return NULL;
+ }
+
+ ptr = mono_metadata_blob_heap (image, sig_idx);
+ mono_metadata_decode_blob_size (ptr, &ptr);
+ sig = mono_metadata_parse_method_signature (image, 0, ptr, NULL);
+ if (!sig)
+ return NULL;
+ sig = cache_memberref_sig (image, sig_idx, sig);
+ }
+ /* FIXME: we probably should verify signature compat in the dynamic case too*/
+ if (!mono_verifier_is_sig_compatible (image, method, sig)) {
guint32 class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK;
const char *fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]);
- mono_loader_set_error_bad_image (g_strdup_printf ("Bad method signature class token 0x%08x field name %s token 0x%08x on image %s", class, fname, token, image->name));
+ mono_loader_set_error_bad_image (g_strdup_printf ("Incompatible method signature class token 0x%08x field name %s token 0x%08x on image %s", class, fname, token, image->name));
return NULL;
}
-
- ptr = mono_metadata_blob_heap (image, sig_idx);
- mono_metadata_decode_blob_size (ptr, &ptr);
- sig = mono_metadata_parse_method_signature (image, 0, ptr, NULL);
- if (!sig)
- return NULL;
- sig = cache_memberref_sig (image, sig_idx, sig);
}
- if (!mono_verifier_is_sig_compatible (image, method, sig)) {
- guint32 class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK;
- const char *fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]);
-
- mono_loader_set_error_bad_image (g_strdup_printf ("Incompatible method signature class token 0x%08x field name %s token 0x%08x on image %s", class, fname, token, image->name));
- return NULL;
- }
if (context) {
MonoError error;
GHashTable *method_to_table_idx;
GHashTable *field_to_table_idx;
GHashTable *method_aux_hash;
+ GHashTable *vararg_aux_hash;
MonoGHashTable *generic_def_objects;
MonoGHashTable *methodspec;
gboolean run;
ctx->token = 0;
}
-#define INVALID_IMPLMAP_FLAGS_BITS ~((1 << 0) | (1 << 1) | (1 << 2) | (1 << 6) | (1 << 8) | (1 << 9) | (1 << 10))
+#define INVALID_IMPLMAP_FLAGS_BITS ~((1 << 0) | (1 << 1) | (1 << 2) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 8) | (1 << 9) | (1 << 10) | (1 << 12) | (1 << 13))
static void
verify_implmap_table (VerifyContext *ctx)
{
void mono_reflection_register_with_runtime (MonoReflectionType *type) MONO_INTERNAL;
void mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args, MonoArray **named_args, CattrNamedArg **named_arg_info) MONO_INTERNAL;
+MonoMethodSignature * mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32 token) MONO_INTERNAL;
MonoArray* mono_param_get_objects_internal (MonoDomain *domain, MonoMethod *method, MonoClass *refclass) MONO_INTERNAL;
* mono_get_delegate_invoke:
* @klass: The delegate class
*
- * Returns: the MonoMethod for the "Invoke" method in the delegate klass
+ * Returns: the MonoMethod for the "Invoke" method in the delegate klass or NULL if @klass is a broken delegate type
*/
MonoMethod *
mono_get_delegate_invoke (MonoClass *klass)
if (klass->exception_type)
return NULL;
im = mono_class_get_method_from_name (klass, "Invoke", -1);
- g_assert (im);
-
return im;
}
{
MonoClass *klass;
guint32 token = 0;
+ MonoMethodSignature *sig;
klass = obj->vtable->klass;
if (strcmp (klass->name, "MonoMethod") == 0) {
MonoMethod *method = ((MonoReflectionMethod *)obj)->method;
- MonoMethodSignature *sig, *old;
+ MonoMethodSignature *old;
guint32 sig_token, parent;
int nargs, i;
} else if (strcmp (klass->name, "MethodBuilder") == 0) {
MonoReflectionMethodBuilder *mb = (MonoReflectionMethodBuilder *)obj;
ReflectionMethodBuilder rmb;
- guint32 parent, sig;
+ guint32 parent, sig_token;
+ int nopt_args, nparams, ngparams, i;
char *name;
reflection_methodbuilder_from_method_builder (&rmb, mb);
rmb.opt_types = opt_param_types;
+ nopt_args = mono_array_length (opt_param_types);
- sig = method_builder_encode_signature (assembly, &rmb);
+ nparams = rmb.parameters ? mono_array_length (rmb.parameters): 0;
+ ngparams = rmb.generic_params ? mono_array_length (rmb.generic_params): 0;
+ sig = mono_metadata_signature_alloc (&assembly->image, nparams + nopt_args);
+
+ sig->hasthis = !(rmb.attrs & METHOD_ATTRIBUTE_STATIC);
+ sig->explicit_this = (rmb.call_conv & 0x40) == 0x40;
+ sig->call_convention = rmb.call_conv;
+ sig->generic_param_count = ngparams;
+ sig->param_count = nparams + nopt_args;
+ sig->sentinelpos = nparams;
+ sig->ret = mono_reflection_type_get_handle (rmb.rtype);
+
+ for (i = 0; i < nparams; i++) {
+ MonoReflectionType *rt = mono_array_get (rmb.parameters, MonoReflectionType *, i);
+ sig->params [i] = mono_reflection_type_get_handle (rt);
+ }
+
+ for (i = 0; i < nopt_args; i++) {
+ MonoReflectionType *rt = mono_array_get (opt_param_types, MonoReflectionType *, i);
+ sig->params [nparams + i] = mono_reflection_type_get_handle (rt);
+ }
+
+ sig_token = method_builder_encode_signature (assembly, &rmb);
parent = mono_image_create_token (assembly, obj, TRUE, TRUE);
g_assert (mono_metadata_token_table (parent) == MONO_TABLE_METHOD);
name = mono_string_to_utf8 (rmb.name);
token = mono_image_get_varargs_method_token (
- assembly, parent, name, sig);
+ assembly, parent, name, sig_token);
g_free (name);
} else {
g_error ("requested method token for %s\n", klass->name);
}
+ g_hash_table_insert (assembly->vararg_aux_hash, GUINT_TO_POINTER (token), sig);
+ mono_g_hash_table_insert (assembly->tokens, GUINT_TO_POINTER (token), obj);
return token;
}
image->method_to_table_idx = g_hash_table_new (NULL, NULL);
image->field_to_table_idx = g_hash_table_new (NULL, NULL);
image->method_aux_hash = g_hash_table_new (NULL, NULL);
+ image->vararg_aux_hash = g_hash_table_new (NULL, NULL);
image->handleref = g_hash_table_new (NULL, NULL);
image->handleref_managed = mono_g_hash_table_new_type ((GHashFunc)mono_object_hash, NULL, MONO_HASH_KEY_GC);
image->tokens = mono_g_hash_table_new_type (NULL, NULL, MONO_HASH_VALUE_GC);
g_hash_table_destroy (di->field_to_table_idx);
if (di->method_aux_hash)
g_hash_table_destroy (di->method_aux_hash);
+ if (di->vararg_aux_hash)
+ g_hash_table_destroy (di->vararg_aux_hash);
g_free (di->strong_name);
g_free (di->win32_res);
if (di->public_key)
return resolve_object (image, obj, handle_class, context);
}
+MonoMethodSignature *
+mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32 token)
+{
+ MonoMethodSignature *sig;
+ g_assert (image->dynamic);
+
+ sig = g_hash_table_lookup (((MonoDynamicImage*)image)->vararg_aux_hash, GUINT_TO_POINTER (token));
+ if (sig)
+ return sig;
+
+ return mono_method_signature (method);
+}
+
/*
* ensure_complete_type:
*
#define ARCH_SIGCTX_SP(ctx) (UCONTEXT_REG_RSP (ctx))
#define ARCH_SIGCTX_IP(ctx) (UCONTEXT_REG_RIP (ctx))
#define ARCH_COPY_SIGCTX_REGS(a,ctx) do { \
- ((a)[0] = (UCONTEXT_REG_RAX (ctx))); \
- ((a)[1] = (UCONTEXT_REG_RBX (ctx))); \
- ((a)[2] = (UCONTEXT_REG_RCX (ctx))); \
- ((a)[3] = (UCONTEXT_REG_RDX (ctx))); \
- ((a)[4] = (UCONTEXT_REG_RSI (ctx))); \
- ((a)[5] = (UCONTEXT_REG_RDI (ctx))); \
- ((a)[6] = (UCONTEXT_REG_RBP (ctx))); \
- ((a)[7] = (UCONTEXT_REG_RSP (ctx))); \
- ((a)[8] = (UCONTEXT_REG_RSI (ctx))); \
- ((a)[9] = (UCONTEXT_REG_RDI (ctx))); \
- ((a)[10] = (UCONTEXT_REG_RIP (ctx))); \
- ((a)[11] = (UCONTEXT_REG_R12 (ctx))); \
- ((a)[12] = (UCONTEXT_REG_R13 (ctx))); \
- ((a)[13] = (UCONTEXT_REG_R14 (ctx))); \
- ((a)[14] = (UCONTEXT_REG_R15 (ctx))); \
+ ((a)[0] = (gpointer) (UCONTEXT_REG_RAX (ctx))); \
+ ((a)[1] = (gpointer) (UCONTEXT_REG_RBX (ctx))); \
+ ((a)[2] = (gpointer) (UCONTEXT_REG_RCX (ctx))); \
+ ((a)[3] = (gpointer) (UCONTEXT_REG_RDX (ctx))); \
+ ((a)[4] = (gpointer) (UCONTEXT_REG_RSI (ctx))); \
+ ((a)[5] = (gpointer) (UCONTEXT_REG_RDI (ctx))); \
+ ((a)[6] = (gpointer) (UCONTEXT_REG_RBP (ctx))); \
+ ((a)[7] = (gpointer) (UCONTEXT_REG_R8 (ctx))); \
+ ((a)[8] = (gpointer) (UCONTEXT_REG_R9 (ctx))); \
+ ((a)[9] = (gpointer) (UCONTEXT_REG_R10 (ctx))); \
+ ((a)[10] = (gpointer) (UCONTEXT_REG_R11 (ctx))); \
+ ((a)[11] = (gpointer) (UCONTEXT_REG_R12 (ctx))); \
+ ((a)[12] = (gpointer) (UCONTEXT_REG_R13 (ctx))); \
+ ((a)[13] = (gpointer) (UCONTEXT_REG_R14 (ctx))); \
+ ((a)[14] = (gpointer) (UCONTEXT_REG_R15 (ctx))); \
} while (0)
#elif defined(__ppc__)
*/
static int gc_initialized = 0;
-static int gc_debug_level = 0;
-static FILE* gc_debug_file;
/* If set, do a minor collection before every allocation */
static gboolean collect_before_allocs = FALSE;
/* If set, do a heap consistency check before each minor collection */
each collection */
static gboolean do_scan_starts_check = FALSE;
-/*
- * Turning on heavy statistics will turn off the managed allocator and
- * the managed write barrier.
- */
-//#define HEAVY_STATISTICS
-
-#ifdef HEAVY_STATISTICS
-#define HEAVY_STAT(x) x
-#else
-#define HEAVY_STAT(x)
-#endif
-
#ifdef HEAVY_STATISTICS
static long long stat_objects_alloced = 0;
static long long stat_bytes_alloced = 0;
static int stat_wbarrier_set_root = 0;
static int stat_wbarrier_value_copy = 0;
static int stat_wbarrier_object_copy = 0;
-
-static long long stat_internal_alloc = 0;
-static long long stat_internal_alloc_loop1 = 0;
-static long long stat_internal_alloc_loop2 = 0;
#endif
static long long time_minor_pre_collection_fragment_clear = 0;
static long long time_major_sweep = 0;
static long long time_major_fragment_creation = 0;
-static long long pinned_chunk_bytes_alloced = 0;
-static long long large_internal_bytes_alloced = 0;
+#define MAX_DEBUG_LEVEL 2
+#define DEBUG(level,a) do {if (G_UNLIKELY ((level) <= MAX_DEBUG_LEVEL && (level) <= gc_debug_level)) a;} while (0)
-/* Keep in sync with internal_mem_names in dump_heap()! */
-enum {
- INTERNAL_MEM_PIN_QUEUE,
- INTERNAL_MEM_FRAGMENT,
- INTERNAL_MEM_SECTION,
- INTERNAL_MEM_SCAN_STARTS,
- INTERNAL_MEM_FIN_TABLE,
- INTERNAL_MEM_FINALIZE_ENTRY,
- INTERNAL_MEM_DISLINK_TABLE,
- INTERNAL_MEM_DISLINK,
- INTERNAL_MEM_ROOTS_TABLE,
- INTERNAL_MEM_ROOT_RECORD,
- INTERNAL_MEM_STATISTICS,
- INTERNAL_MEM_REMSET,
- INTERNAL_MEM_GRAY_QUEUE,
- INTERNAL_MEM_STORE_REMSET,
- INTERNAL_MEM_MS_TABLES,
- INTERNAL_MEM_MS_BLOCK_INFO,
- INTERNAL_MEM_EPHEMERON_LINK,
- INTERNAL_MEM_MAX
-};
-
-static long small_internal_mem_bytes [INTERNAL_MEM_MAX];
+static int gc_debug_level = 0;
+static FILE* gc_debug_file;
/*
void
#define GC_BITS_PER_WORD (sizeof (mword) * 8)
-enum {
- MEMORY_ROLE_GEN0,
- MEMORY_ROLE_GEN1,
- MEMORY_ROLE_PINNED
-};
-
-typedef struct _Block Block;
-struct _Block {
- void *next;
- unsigned char role;
-};
-
/* each request from the OS ends up in a GCMemSection */
typedef struct _GCMemSection GCMemSection;
struct _GCMemSection {
- Block block;
+ SgenBlock block;
char *data;
mword size;
/* pointer where more data could be allocated if it fits */
#define SIZEOF_GC_MEM_SECTION ((sizeof (GCMemSection) + 7) & ~7)
-/* Pinned objects are allocated in the LOS space if bigger than half a page
- * or from freelists otherwise. We assume that pinned objects are relatively few
- * and they have a slow dying speed (like interned strings, thread objects).
- * As such they will be collected only at major collections.
- * free lists are not global: when we need memory we allocate a PinnedChunk.
- * Each pinned chunk is made of several pages, the first of wich is used
- * internally for bookeeping (here think of a page as 4KB). The bookeeping
- * includes the freelists vectors and info about the object size of each page
- * in the pinned chunk. So, when needed, a free page is found in a pinned chunk,
- * a size is assigned to it, the page is divided in the proper chunks and each
- * chunk is added to the freelist. To not waste space, the remaining space in the
- * first page is used as objects of size 16 or 32 (need to measure which are more
- * common).
- * We use this same structure to allocate memory used internally by the GC, so
- * we never use malloc/free if we need to alloc during collection: the world is stopped
- * and malloc/free will deadlock.
- * When we want to iterate over pinned objects, we just scan a page at a time
- * linearly according to the size of objects in the page: the next pointer used to link
- * the items in the freelist uses the same word as the vtable. Since we keep freelists
- * for each pinned chunk, if the word points outside the pinned chunk it means
- * it is an object.
- * We could avoid this expensive scanning in creative ways. We could have a policy
- * of putting in the pinned space only objects we know about that have no struct fields
- * with references and we can easily use a even expensive write barrier for them,
- * since pointer writes on such objects should be rare.
- * The best compromise is to just alloc interned strings and System.MonoType in them.
- * It would be nice to allocate MonoThread in it, too: must check that we properly
- * use write barriers so we don't have to do any expensive scanning of the whole pinned
- * chunk list during minor collections. We can avoid it now because we alloc in it only
- * reference-free objects.
- */
-#define PINNED_FIRST_SLOT_SIZE (sizeof (gpointer) * 4)
-#define MAX_FREELIST_SIZE 8192
-typedef struct _PinnedChunk PinnedChunk;
-struct _PinnedChunk {
- Block block;
- int num_pages;
- int *page_sizes; /* a 0 means the page is still unused */
- void **free_list;
- void *start_data;
- void *data [1]; /* page sizes and free lists are stored here */
-};
-
/* The method used to clear the nursery */
/* Clearing at nursery collections is the safest, but has bad interactions with caches.
* Clearing at TLAB creation is much faster, but more complex and it might expose hard
#define SCAN_START_SIZE (4096*2)
/* the minimum size of a fragment that we consider useful for allocation */
#define FRAGMENT_MIN_SIZE (512)
-/* This is a fixed value used for pinned chunks, not the system pagesize */
-#define FREELIST_PAGESIZE (16*1024)
static mword pagesize = 4096;
static mword nursery_size;
static LOCK_DECLARE (interruption_mutex);
-#ifdef SGEN_PARALLEL_MARK
-static LOCK_DECLARE (internal_allocator_mutex);
-#endif
-
typedef struct _FinalizeEntry FinalizeEntry;
struct _FinalizeEntry {
FinalizeEntry *next;
void *value;
} Ephemeron;
-#define LARGE_INTERNAL_MEM_HEADER_MAGIC 0x7d289f3a
-
-typedef struct _LargeInternalMemHeader LargeInternalMemHeader;
-struct _LargeInternalMemHeader {
- guint32 magic;
- size_t size;
- double data[0];
-};
-
enum {
GENERATION_NURSERY,
GENERATION_OLD,
static int num_ready_finalizers = 0;
static int no_finalize = 0;
-/* keep each size a multiple of ALLOC_ALIGN */
-/* on 64 bit systems 8 is likely completely unused. */
-static const int freelist_sizes [] = {
- 8, 16, 24, 32, 40, 48, 64, 80,
- 96, 128, 160, 192, 224, 256, 320, 384,
- 448, 512, 584, 680, 816, 1024, 1360, 2048,
- 2336, 2728, 3272, 4096, 5456, 8192 };
-#define FREELIST_NUM_SLOTS (sizeof (freelist_sizes) / sizeof (freelist_sizes [0]))
-
-/* This is also the MAJOR_SECTION_SIZE for the copying major
- collector */
-#define PINNED_CHUNK_SIZE (128 * 1024)
-
-/* internal_chunk_list is used for allocating structures needed by the GC */
-static PinnedChunk *internal_chunk_list = NULL;
-
-static int slot_for_size (size_t size);
-
enum {
ROOT_TYPE_NORMAL = 0, /* "normal" roots */
ROOT_TYPE_PINNED = 1, /* roots without a GC descriptor */
/* Functions supplied by the runtime to be called by the GC */
static MonoGCCallbacks gc_callbacks;
-#define ALLOC_ALIGN 8
-#define ALLOC_ALIGN_BITS 3
+#define ALLOC_ALIGN SGEN_ALLOC_ALIGN
+#define ALLOC_ALIGN_BITS SGEN_ALLOC_ALIGN_BITS
-#define ALIGN_UP(s) (((s)+(ALLOC_ALIGN-1)) & ~(ALLOC_ALIGN-1))
+#define ALIGN_UP SGEN_ALIGN_UP
#define MOVED_OBJECTS_NUM 64
static void *moved_objects [MOVED_OBJECTS_NUM];
typedef char* (*ScanObjectFunc) (char*, GrayQueue*);
/* forward declarations */
-static void* get_internal_mem (size_t size, int type);
-static void free_internal_mem (void *addr, int type);
-static void* get_os_memory (size_t size, int activate);
-static void* get_os_memory_aligned (mword size, mword alignment, gboolean activate);
-static void free_os_memory (void *addr, size_t size);
-static G_GNUC_UNUSED void report_internal_mem_usage (void);
-
static int stop_world (void);
static int restart_world (void);
static void add_to_global_remset (gpointer ptr);
static void optimize_pin_queue (int start_slot);
static void clear_remsets (void);
static void clear_tlabs (void);
-typedef void (*IterateObjectCallbackFunc) (char*, size_t, void*);
static void scan_area_with_callback (char *start, char *end, IterateObjectCallbackFunc callback, void *data);
static void scan_object (char *start, GrayQueue *queue);
static void major_scan_object (char *start, GrayQueue *queue);
static void par_copy_object_no_checks (char *destination, MonoVTable *vt, void *obj, mword objsize, GrayQueue *queue);
static void* copy_object_no_checks (void *obj, GrayQueue *queue);
static void copy_object (void **obj_slot, GrayQueue *queue);
-static void* get_chunk_freelist (PinnedChunk *chunk, int slot);
-static PinnedChunk* alloc_pinned_chunk (void);
static void sort_addresses (void **array, int size);
static void drain_gray_stack (GrayQueue *queue);
static void finish_gray_stack (char *start_addr, char *end_addr, int generation, GrayQueue *queue);
static gboolean need_major_collection (void);
static void major_collection (const char *reason);
-static void update_heap_boundaries (mword low, mword high);
static void mono_gc_register_disappearing_link (MonoObject *obj, void **link, gboolean track);
static void dump_occupied (char *start, char *end, char *section_start);
static void dump_section (GCMemSection *section, const char *type);
static void dump_heap (const char *type, int num, const char *reason);
-static void report_pinned_chunk (PinnedChunk *chunk, int seq);
void mono_gc_scan_for_specific_ref (MonoObject *key);
}
}
-static void
-update_heap_boundaries (mword low, mword high)
+void
+mono_sgen_update_heap_boundaries (mword low, mword high)
{
mword old;
frag->next = NULL;
return frag;
}
- frag = get_internal_mem (sizeof (Fragment), INTERNAL_MEM_FRAGMENT);
+ frag = mono_sgen_alloc_internal (INTERNAL_MEM_FRAGMENT);
frag->next = NULL;
return frag;
}
/* size must be a power of 2 */
-static void*
-get_os_memory_aligned (mword size, mword alignment, gboolean activate)
+void*
+mono_sgen_alloc_os_memory_aligned (mword size, mword alignment, gboolean activate)
{
/* Allocate twice the memory to be able to put the block on an aligned address */
- char *mem = get_os_memory (size + alignment, activate);
+ char *mem = mono_sgen_alloc_os_memory (size + alignment, activate);
char *aligned;
g_assert (mem);
g_assert (aligned >= mem && aligned + size <= mem + size + alignment && !((mword)aligned & (alignment - 1)));
if (aligned > mem)
- free_os_memory (mem, aligned - mem);
+ mono_sgen_free_os_memory (mem, aligned - mem);
if (aligned + size < mem + size + alignment)
- free_os_memory (aligned + size, (mem + size + alignment) - (aligned + size));
+ mono_sgen_free_os_memory (aligned + size, (mem + size + alignment) - (aligned + size));
return aligned;
}
* objects in the existing nursery.
*/
/* FIXME: handle OOM */
- section = get_internal_mem (SIZEOF_GC_MEM_SECTION, INTERNAL_MEM_SECTION);
+ section = mono_sgen_alloc_internal (INTERNAL_MEM_SECTION);
g_assert (nursery_size == DEFAULT_NURSERY_SIZE);
alloc_size = nursery_size;
#ifdef ALIGN_NURSERY
- data = get_os_memory_aligned (alloc_size, alloc_size, TRUE);
+ data = mono_sgen_alloc_os_memory_aligned (alloc_size, alloc_size, TRUE);
#else
- data = get_os_memory (alloc_size, TRUE);
+ data = mono_sgen_alloc_os_memory (alloc_size, TRUE);
#endif
nursery_start = data;
nursery_real_end = nursery_start + nursery_size;
- update_heap_boundaries ((mword)nursery_start, (mword)nursery_real_end);
+ mono_sgen_update_heap_boundaries ((mword)nursery_start, (mword)nursery_real_end);
nursery_next = nursery_start;
- total_alloc += alloc_size;
DEBUG (4, fprintf (gc_debug_file, "Expanding nursery size (%p-%p): %lu, total: %lu\n", data, data + alloc_size, (unsigned long)nursery_size, (unsigned long)total_alloc));
section->data = section->next_data = data;
section->size = alloc_size;
section->end_data = nursery_real_end;
scan_starts = (alloc_size + SCAN_START_SIZE - 1) / SCAN_START_SIZE;
- section->scan_starts = get_internal_mem (sizeof (char*) * scan_starts, INTERNAL_MEM_SCAN_STARTS);
+ section->scan_starts = mono_sgen_alloc_internal_dynamic (sizeof (char*) * scan_starts, INTERNAL_MEM_SCAN_STARTS);
section->num_scan_start = scan_starts;
section->block.role = MEMORY_ROLE_GEN0;
section->block.next = NULL;
static void
dump_heap (const char *type, int num, const char *reason)
{
- static char const *internal_mem_names [] = { "pin-queue", "fragment", "section", "scan-starts",
- "fin-table", "finalize-entry", "dislink-table",
- "dislink", "roots-table", "root-record", "statistics",
- "remset", "gray-queue", "store-remset", "marksweep-tables",
- "marksweep-block-info", "ephemeron-link" };
-
ObjectList *list;
LOSObject *bigobj;
- int i;
fprintf (heap_dump_file, "<collection type=\"%s\" num=\"%d\"", type, num);
if (reason)
fprintf (heap_dump_file, " reason=\"%s\"", reason);
fprintf (heap_dump_file, ">\n");
- fprintf (heap_dump_file, "<other-mem-usage type=\"pinned-chunks\" size=\"%lld\"/>\n", pinned_chunk_bytes_alloced);
- fprintf (heap_dump_file, "<other-mem-usage type=\"large-internal\" size=\"%lld\"/>\n", large_internal_bytes_alloced);
fprintf (heap_dump_file, "<other-mem-usage type=\"mempools\" size=\"%ld\"/>\n", mono_mempool_get_bytes_allocated ());
- for (i = 0; i < INTERNAL_MEM_MAX; ++i)
- fprintf (heap_dump_file, "<other-mem-usage type=\"%s\" size=\"%ld\"/>\n", internal_mem_names [i], small_internal_mem_bytes [i]);
+ mono_sgen_dump_internal_mem_usage (heap_dump_file);
fprintf (heap_dump_file, "<pinned type=\"stack\" bytes=\"%zu\"/>\n", pinned_byte_counts [PIN_TYPE_STACK]);
/* fprintf (heap_dump_file, "<pinned type=\"static-data\" bytes=\"%d\"/>\n", pinned_byte_counts [PIN_TYPE_STATIC_DATA]); */
fprintf (heap_dump_file, "<pinned type=\"other\" bytes=\"%zu\"/>\n", pinned_byte_counts [PIN_TYPE_OTHER]);
mono_counters_register ("Global remsets re-added", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_global_remsets_readded);
mono_counters_register ("Global remsets processed", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_global_remsets_processed);
mono_counters_register ("Global remsets discarded", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_global_remsets_discarded);
-
- mono_counters_register ("Internal allocs", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_internal_alloc);
- mono_counters_register ("Internal alloc loop1", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_internal_alloc_loop1);
- mono_counters_register ("Internal alloc loop2", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_internal_alloc_loop2);
#endif
inited = TRUE;
current_collection_generation = GENERATION_NURSERY;
- init_stats ();
binary_protocol_collection (GENERATION_NURSERY);
check_scan_starts ();
//count_ref_nonref_objs ();
//consistency_check ();
- init_stats ();
binary_protocol_collection (GENERATION_OLD);
check_scan_starts ();
gray_object_queue_init (&gray_queue);
* Internal memory can be handled with a freelist for small objects.
*/
+/*
+ * Debug reporting.
+ */
+G_GNUC_UNUSED static void
+report_internal_mem_usage (void)
+{
+ printf ("Internal memory usage:\n");
+ mono_sgen_report_internal_mem_usage ();
+ printf ("Pinned memory usage:\n");
+ major_report_pinned_memory_usage ();
+}
+
/*
* Allocate a big chunk of memory from the OS (usually 64KB to several megabytes).
* This must not require any lock.
*/
-static void*
-get_os_memory (size_t size, int activate)
+void*
+mono_sgen_alloc_os_memory (size_t size, int activate)
{
void *ptr;
unsigned long prot_flags = activate? MONO_MMAP_READ|MONO_MMAP_WRITE: MONO_MMAP_NONE;
size += pagesize - 1;
size &= ~(pagesize - 1);
ptr = mono_valloc (0, size, prot_flags);
+ /* FIXME: CAS */
+ total_alloc += size;
return ptr;
}
/*
- * Free the memory returned by get_os_memory (), returning it to the OS.
+ * Free the memory returned by mono_sgen_alloc_os_memory (), returning it to the OS.
*/
-static void
-free_os_memory (void *addr, size_t size)
+void
+mono_sgen_free_os_memory (void *addr, size_t size)
{
mono_vfree (addr, size);
-}
-
-/*
- * Debug reporting.
- */
-static void
-report_pinned_chunk (PinnedChunk *chunk, int seq) {
- void **p;
- int i, free_pages, num_free, free_mem;
- free_pages = 0;
- for (i = 0; i < chunk->num_pages; ++i) {
- if (!chunk->page_sizes [i])
- free_pages++;
- }
- printf ("Pinned chunk %d at %p, size: %d, pages: %d, free: %d\n", seq, chunk, chunk->num_pages * FREELIST_PAGESIZE, chunk->num_pages, free_pages);
- free_mem = FREELIST_PAGESIZE * free_pages;
- for (i = 0; i < FREELIST_NUM_SLOTS; ++i) {
- if (!chunk->free_list [i])
- continue;
- num_free = 0;
- p = chunk->free_list [i];
- while (p) {
- num_free++;
- p = *p;
- }
- printf ("\tfree list of size %d, %d items\n", freelist_sizes [i], num_free);
- free_mem += freelist_sizes [i] * num_free;
- }
- printf ("\tfree memory in chunk: %d\n", free_mem);
-}
-
-/*
- * Debug reporting.
- */
-static G_GNUC_UNUSED void
-report_internal_mem_usage (void) {
- PinnedChunk *chunk;
- int i;
- printf ("Internal memory usage:\n");
- i = 0;
- for (chunk = internal_chunk_list; chunk; chunk = chunk->block.next) {
- report_pinned_chunk (chunk, i++);
- }
- printf ("Pinned memory usage:\n");
- major_report_pinned_memory_usage ();
-}
-
-/*
- * Find the slot number in the freelist for memory chunks that
- * can contain @size objects.
- */
-static int
-slot_for_size (size_t size)
-{
- int slot;
- /* do a binary search or lookup table later. */
- for (slot = 0; slot < FREELIST_NUM_SLOTS; ++slot) {
- if (freelist_sizes [slot] >= size)
- return slot;
- }
- g_assert_not_reached ();
- return -1;
-}
-
-/*
- * Build a free list for @size memory chunks from the memory area between
- * start_page and end_page.
- */
-static void
-build_freelist (PinnedChunk *chunk, int slot, int size, char *start_page, char *end_page)
-{
- void **p, **end;
- int count = 0;
- /*g_print ("building freelist for slot %d, size %d in %p\n", slot, size, chunk);*/
- p = (void**)start_page;
- end = (void**)(end_page - size);
- g_assert (!chunk->free_list [slot]);
- chunk->free_list [slot] = p;
- while ((char*)p + size <= (char*)end) {
- count++;
- *p = (void*)((char*)p + size);
- p = *p;
- }
- *p = NULL;
- /*g_print ("%d items created, max: %d\n", count, (end_page - start_page) / size);*/
-}
-
-/* LOCKING: requires the internal allocator lock to be held */
-static PinnedChunk*
-alloc_pinned_chunk (void)
-{
- PinnedChunk *chunk;
- int offset;
- int size = PINNED_CHUNK_SIZE;
-
- chunk = get_os_memory_aligned (size, size, TRUE);
- chunk->block.role = MEMORY_ROLE_PINNED;
-
- update_heap_boundaries ((mword)chunk, ((mword)chunk + size));
- total_alloc += size;
- pinned_chunk_bytes_alloced += size;
-
- /* setup the bookeeping fields */
- chunk->num_pages = size / FREELIST_PAGESIZE;
- offset = G_STRUCT_OFFSET (PinnedChunk, data);
- chunk->page_sizes = (void*)((char*)chunk + offset);
- offset += sizeof (int) * chunk->num_pages;
- offset = ALIGN_UP (offset);
- chunk->free_list = (void*)((char*)chunk + offset);
- offset += sizeof (void*) * FREELIST_NUM_SLOTS;
- offset = ALIGN_UP (offset);
- chunk->start_data = (void*)((char*)chunk + offset);
-
- /* allocate the first page to the freelist */
- chunk->page_sizes [0] = PINNED_FIRST_SLOT_SIZE;
- build_freelist (chunk, slot_for_size (PINNED_FIRST_SLOT_SIZE), PINNED_FIRST_SLOT_SIZE, chunk->start_data, ((char*)chunk + FREELIST_PAGESIZE));
- DEBUG (4, fprintf (gc_debug_file, "Allocated pinned chunk %p, size: %d\n", chunk, size));
- return chunk;
-}
-
-/* assumes freelist for slot is empty, so try to alloc a new page */
-static void*
-get_chunk_freelist (PinnedChunk *chunk, int slot)
-{
- int i;
- void **p;
- p = chunk->free_list [slot];
- if (p) {
- chunk->free_list [slot] = *p;
- return p;
- }
- for (i = 0; i < chunk->num_pages; ++i) {
- int size;
- if (chunk->page_sizes [i])
- continue;
- size = freelist_sizes [slot];
- chunk->page_sizes [i] = size;
- build_freelist (chunk, slot, size, (char*)chunk + FREELIST_PAGESIZE * i, (char*)chunk + FREELIST_PAGESIZE * (i + 1));
- break;
- }
- /* try again */
- p = chunk->free_list [slot];
- if (p) {
- chunk->free_list [slot] = *p;
- return p;
- }
- return NULL;
-}
-
-/* used for the GC-internal data structures */
-static void*
-get_internal_mem (size_t size, int type)
-{
- int slot;
- void *res = NULL;
- PinnedChunk *pchunk;
-
- LOCK_INTERNAL_ALLOCATOR;
-
- HEAVY_STAT (++stat_internal_alloc);
-
- if (size > freelist_sizes [FREELIST_NUM_SLOTS - 1]) {
- LargeInternalMemHeader *mh;
-
- UNLOCK_INTERNAL_ALLOCATOR;
-
- size += sizeof (LargeInternalMemHeader);
- mh = get_os_memory (size, TRUE);
- mh->magic = LARGE_INTERNAL_MEM_HEADER_MAGIC;
- mh->size = size;
- /* FIXME: do a CAS here */
- large_internal_bytes_alloced += size;
- return mh->data;
- }
-
- slot = slot_for_size (size);
- g_assert (size <= freelist_sizes [slot]);
-
- small_internal_mem_bytes [type] += freelist_sizes [slot];
-
- for (pchunk = internal_chunk_list; pchunk; pchunk = pchunk->block.next) {
- void **p = pchunk->free_list [slot];
- HEAVY_STAT (++stat_internal_alloc_loop1);
- if (p) {
- pchunk->free_list [slot] = *p;
- UNLOCK_INTERNAL_ALLOCATOR;
-
- memset (p, 0, size);
- return p;
- }
- }
- for (pchunk = internal_chunk_list; pchunk; pchunk = pchunk->block.next) {
- HEAVY_STAT (++stat_internal_alloc_loop2);
- res = get_chunk_freelist (pchunk, slot);
- if (res) {
- UNLOCK_INTERNAL_ALLOCATOR;
-
- memset (res, 0, size);
- return res;
- }
- }
- pchunk = alloc_pinned_chunk ();
- /* FIXME: handle OOM */
- pchunk->block.next = internal_chunk_list;
- internal_chunk_list = pchunk;
- res = get_chunk_freelist (pchunk, slot);
-
- UNLOCK_INTERNAL_ALLOCATOR;
-
- memset (res, 0, size);
- return res;
-}
-
-static void
-free_internal_mem (void *addr, int type)
-{
- PinnedChunk *pchunk;
- LargeInternalMemHeader *mh;
- if (!addr)
- return;
-
- LOCK_INTERNAL_ALLOCATOR;
-
- for (pchunk = internal_chunk_list; pchunk; pchunk = pchunk->block.next) {
- /*printf ("trying to free %p in %p (pages: %d)\n", addr, pchunk, pchunk->num_pages);*/
- if (addr >= (void*)pchunk && (char*)addr < (char*)pchunk + pchunk->num_pages * FREELIST_PAGESIZE) {
- int offset = (char*)addr - (char*)pchunk;
- int page = offset / FREELIST_PAGESIZE;
- int slot = slot_for_size (pchunk->page_sizes [page]);
- void **p = addr;
- *p = pchunk->free_list [slot];
- pchunk->free_list [slot] = p;
-
- small_internal_mem_bytes [type] -= freelist_sizes [slot];
-
- UNLOCK_INTERNAL_ALLOCATOR;
-
- return;
- }
- }
-
- UNLOCK_INTERNAL_ALLOCATOR;
-
- mh = (LargeInternalMemHeader*)((char*)addr - G_STRUCT_OFFSET (LargeInternalMemHeader, data));
- g_assert (mh->magic == LARGE_INTERNAL_MEM_HEADER_MAGIC);
- /* FIXME: do a CAS */
- large_internal_bytes_alloced -= mh->size;
- free_os_memory (mh, mh->size);
+ size += pagesize - 1;
+ size &= ~(pagesize - 1);
+ /* FIXME: CAS */
+ total_alloc -= size;
}
/*
FinalizeEntry *entry, *next;
int new_size = g_spaced_primes_closest (hash_table->num_registered);
- new_hash = get_internal_mem (new_size * sizeof (FinalizeEntry*), INTERNAL_MEM_FIN_TABLE);
+ new_hash = mono_sgen_alloc_internal_dynamic (new_size * sizeof (FinalizeEntry*), INTERNAL_MEM_FIN_TABLE);
for (i = 0; i < finalizable_hash_size; ++i) {
for (entry = finalizable_hash [i]; entry; entry = next) {
hash = mono_object_hash (entry->object) % new_size;
new_hash [hash] = entry;
}
}
- free_internal_mem (finalizable_hash, INTERNAL_MEM_FIN_TABLE);
+ mono_sgen_free_internal_dynamic (finalizable_hash, finalizable_hash_size * sizeof (FinalizeEntry*), INTERNAL_MEM_FIN_TABLE);
hash_table->table = new_hash;
hash_table->size = new_size;
}
ephemeron_list = current->next;
current = current->next;
- free_internal_mem (tmp, INTERNAL_MEM_EPHEMERON_LINK);
+ mono_sgen_free_internal (tmp, INTERNAL_MEM_EPHEMERON_LINK);
} else {
prev = current;
current = current->next;
ephemeron_list = current->next;
current = current->next;
- free_internal_mem (tmp, INTERNAL_MEM_EPHEMERON_LINK);
+ mono_sgen_free_internal (tmp, INTERNAL_MEM_EPHEMERON_LINK);
continue;
}
disappearing_link_hash [i] = entry->next;
DEBUG (5, fprintf (gc_debug_file, "Dislink nullified at %p to GCed object %p\n", p, object));
old = entry->next;
- free_internal_mem (entry, INTERNAL_MEM_DISLINK);
+ mono_sgen_free_internal (entry, INTERNAL_MEM_DISLINK);
entry = old;
hash->num_links--;
continue;
else
disappearing_link_hash [i] = entry->next;
old = entry->next;
- free_internal_mem (entry, INTERNAL_MEM_DISLINK);
+ mono_sgen_free_internal (entry, INTERNAL_MEM_DISLINK);
entry = old;
hash->num_links--;
*(entry->link) = NULL;
g_warning ("Disappearing link %p not freed", entry->link);
} else {
- free_internal_mem (entry, INTERNAL_MEM_DISLINK);
+ mono_sgen_free_internal (entry, INTERNAL_MEM_DISLINK);
}
entry = next;
finalizable_hash [hash] = entry->next;
hash_table->num_registered--;
DEBUG (5, fprintf (gc_debug_file, "Removed finalizer %p for object: %p (%s) (%d)\n", entry, obj, obj->vtable->klass->name, hash_table->num_registered));
- free_internal_mem (entry, INTERNAL_MEM_FINALIZE_ENTRY);
+ mono_sgen_free_internal (entry, INTERNAL_MEM_FINALIZE_ENTRY);
}
UNLOCK_GC;
return;
UNLOCK_GC;
return;
}
- entry = get_internal_mem (sizeof (FinalizeEntry), INTERNAL_MEM_FINALIZE_ENTRY);
+ entry = mono_sgen_alloc_internal (INTERNAL_MEM_FINALIZE_ENTRY);
entry->object = obj;
entry->next = finalizable_hash [hash];
finalizable_hash [hash] = entry;
DisappearingLink *entry, *next;
int new_size = g_spaced_primes_closest (hash_table->num_links);
- new_hash = get_internal_mem (new_size * sizeof (DisappearingLink*), INTERNAL_MEM_DISLINK_TABLE);
+ new_hash = mono_sgen_alloc_internal_dynamic (new_size * sizeof (DisappearingLink*), INTERNAL_MEM_DISLINK_TABLE);
for (i = 0; i < disappearing_link_hash_size; ++i) {
for (entry = disappearing_link_hash [i]; entry; entry = next) {
hash = mono_aligned_addr_hash (entry->link) % new_size;
new_hash [hash] = entry;
}
}
- free_internal_mem (disappearing_link_hash, INTERNAL_MEM_DISLINK_TABLE);
+ mono_sgen_free_internal_dynamic (disappearing_link_hash,
+ disappearing_link_hash_size * sizeof (DisappearingLink*), INTERNAL_MEM_DISLINK_TABLE);
hash_table->table = new_hash;
hash_table->size = new_size;
}
disappearing_link_hash [hash] = entry->next;
hash_table->num_links--;
DEBUG (5, fprintf (gc_debug_file, "Removed dislink %p (%d) from %s table\n", entry, hash_table->num_links, generation_name (generation)));
- free_internal_mem (entry, INTERNAL_MEM_DISLINK);
+ mono_sgen_free_internal (entry, INTERNAL_MEM_DISLINK);
*link = NULL;
} else {
*link = HIDE_POINTER (obj, track); /* we allow the change of object */
}
if (obj == NULL)
return;
- entry = get_internal_mem (sizeof (DisappearingLink), INTERNAL_MEM_DISLINK);
+ entry = mono_sgen_alloc_internal (INTERNAL_MEM_DISLINK);
*link = HIDE_POINTER (obj, track);
entry->link = link;
entry->next = disappearing_link_hash [hash];
e = e->next;
e->next = entry->next;
}
- free_internal_mem (entry, INTERNAL_MEM_FINALIZE_ENTRY);
+ mono_sgen_free_internal (entry, INTERNAL_MEM_FINALIZE_ENTRY);
entry = NULL;
}
int new_size;
new_size = g_spaced_primes_closest (num_roots_entries [pinned]);
- new_hash = get_internal_mem (new_size * sizeof (RootRecord*), INTERNAL_MEM_ROOTS_TABLE);
+ new_hash = mono_sgen_alloc_internal_dynamic (new_size * sizeof (RootRecord*), INTERNAL_MEM_ROOTS_TABLE);
for (i = 0; i < roots_hash_size [pinned]; ++i) {
for (entry = roots_hash [pinned][i]; entry; entry = next) {
hash = mono_aligned_addr_hash (entry->start_root) % new_size;
new_hash [hash] = entry;
}
}
- free_internal_mem (roots_hash [pinned], INTERNAL_MEM_ROOTS_TABLE);
+ mono_sgen_free_internal_dynamic (roots_hash [pinned], roots_hash_size [pinned] * sizeof (RootRecord*), INTERNAL_MEM_ROOTS_TABLE);
roots_hash [pinned] = new_hash;
roots_hash_size [pinned] = new_size;
}
return TRUE;
}
}
- new_root = get_internal_mem (sizeof (RootRecord), INTERNAL_MEM_ROOT_RECORD);
+ new_root = mono_sgen_alloc_internal (INTERNAL_MEM_ROOT_RECORD);
if (new_root) {
new_root->start_root = start;
new_root->end_root = new_root->start_root + size;
roots_size -= (tmp->end_root - tmp->start_root);
num_roots_entries [root_type]--;
DEBUG (3, fprintf (gc_debug_file, "Removed root %p for range: %p-%p\n", tmp, tmp->start_root, tmp->end_root));
- free_internal_mem (tmp, INTERNAL_MEM_ROOT_RECORD);
+ mono_sgen_free_internal (tmp, INTERNAL_MEM_ROOT_RECORD);
break;
}
prev = tmp;
for (remset = global_remset; remset; remset = remset->next)
size += remset->store_next - remset->data;
- bumper = addresses = get_internal_mem (sizeof (mword) * size, INTERNAL_MEM_STATISTICS);
+ bumper = addresses = mono_sgen_alloc_internal_dynamic (sizeof (mword) * size, INTERNAL_MEM_STATISTICS);
for (i = 0; i < THREAD_HASH_SIZE; ++i) {
for (info = thread_table [i]; info; info = info->next) {
stat_store_remsets_unique += p - addresses;
- free_internal_mem (addresses, INTERNAL_MEM_STATISTICS);
+ mono_sgen_free_internal_dynamic (addresses, sizeof (mword) * size, INTERNAL_MEM_STATISTICS);
}
#endif
memset (*info->store_remset_buffer_addr, 0, sizeof (gpointer) * STORE_REMSET_BUFFER_SIZE);
}
+static size_t
+remset_byte_size (RememberedSet *remset)
+{
+ return sizeof (RememberedSet) + (remset->end_set - remset->data) * sizeof (gpointer);
+}
+
static void
scan_from_remsets (void *start_nursery, void *end_nursery, GrayQueue *queue)
{
handle_remset ((mword*)&addr, start_nursery, end_nursery, FALSE, queue);
}
- free_internal_mem (store_remset, INTERNAL_MEM_STORE_REMSET);
+ mono_sgen_free_internal (store_remset, INTERNAL_MEM_STORE_REMSET);
store_remset = next;
}
remset->next = NULL;
if (remset != info->remset) {
DEBUG (4, fprintf (gc_debug_file, "Freed remset at %p\n", remset->data));
- free_internal_mem (remset, INTERNAL_MEM_REMSET);
+ mono_sgen_free_internal_dynamic (remset, remset_byte_size (remset), INTERNAL_MEM_REMSET);
}
}
for (j = 0; j < *info->store_remset_buffer_index_addr; ++j)
}
next = remset->next;
DEBUG (4, fprintf (gc_debug_file, "Freed remset at %p\n", remset->data));
- free_internal_mem (remset, INTERNAL_MEM_REMSET);
+ mono_sgen_free_internal_dynamic (remset, remset_byte_size (remset), INTERNAL_MEM_REMSET);
freed_thread_remsets = next;
}
}
remset->next = NULL;
if (remset != global_remset) {
DEBUG (4, fprintf (gc_debug_file, "Freed remset at %p\n", remset->data));
- free_internal_mem (remset, INTERNAL_MEM_REMSET);
+ mono_sgen_free_internal_dynamic (remset, remset_byte_size (remset), INTERNAL_MEM_REMSET);
}
}
/* the generic store ones */
while (generic_store_remsets) {
GenericStoreRememberedSet *gs_next = generic_store_remsets->next;
- free_internal_mem (generic_store_remsets, INTERNAL_MEM_STORE_REMSET);
+ mono_sgen_free_internal (generic_store_remsets, INTERNAL_MEM_STORE_REMSET);
generic_store_remsets = gs_next;
}
/* the per-thread ones */
remset->next = NULL;
if (remset != info->remset) {
DEBUG (3, fprintf (gc_debug_file, "Freed remset at %p\n", remset->data));
- free_internal_mem (remset, INTERNAL_MEM_REMSET);
+ mono_sgen_free_internal_dynamic (remset, remset_byte_size (remset), INTERNAL_MEM_REMSET);
}
}
clear_thread_store_remset_buffer (info);
while (freed_thread_remsets) {
next = freed_thread_remsets->next;
DEBUG (4, fprintf (gc_debug_file, "Freed remset at %p\n", freed_thread_remsets->data));
- free_internal_mem (freed_thread_remsets, INTERNAL_MEM_REMSET);
+ mono_sgen_free_internal_dynamic (freed_thread_remsets, remset_byte_size (freed_thread_remsets), INTERNAL_MEM_REMSET);
freed_thread_remsets = next;
}
}
remembered_set = info->remset;
#endif
- STORE_REMSET_BUFFER = get_internal_mem (sizeof (gpointer) * STORE_REMSET_BUFFER_SIZE, INTERNAL_MEM_STORE_REMSET);
+ STORE_REMSET_BUFFER = mono_sgen_alloc_internal (INTERNAL_MEM_STORE_REMSET);
STORE_REMSET_BUFFER_INDEX = 0;
DEBUG (3, fprintf (gc_debug_file, "registered thread %p (%p) (hash: %d)\n", info, (gpointer)info->id, hash));
static void
add_generic_store_remset_from_buffer (gpointer *buffer)
{
- GenericStoreRememberedSet *remset = get_internal_mem (sizeof (GenericStoreRememberedSet), INTERNAL_MEM_STORE_REMSET);
+ GenericStoreRememberedSet *remset = mono_sgen_alloc_internal (INTERNAL_MEM_STORE_REMSET);
memcpy (remset->data, buffer + 1, sizeof (gpointer) * (STORE_REMSET_BUFFER_SIZE - 1));
remset->next = generic_store_remsets;
generic_store_remsets = remset;
}
if (*p->store_remset_buffer_index_addr)
add_generic_store_remset_from_buffer (*p->store_remset_buffer_addr);
- free_internal_mem (*p->store_remset_buffer_addr, INTERNAL_MEM_STORE_REMSET);
+ mono_sgen_free_internal (*p->store_remset_buffer_addr, INTERNAL_MEM_STORE_REMSET);
free (p);
}
static RememberedSet*
alloc_remset (int size, gpointer id) {
- RememberedSet* res = get_internal_mem (sizeof (RememberedSet) + (size * sizeof (gpointer)), INTERNAL_MEM_REMSET);
+ RememberedSet* res = mono_sgen_alloc_internal_dynamic (sizeof (RememberedSet) + (size * sizeof (gpointer)), INTERNAL_MEM_REMSET);
res->store_next = res->data;
res->end_set = res->data + size;
res->next = NULL;
LOCK_GC;
- node = get_internal_mem (sizeof (EphemeronLinkNode), INTERNAL_MEM_EPHEMERON_LINK);
+ node = mono_sgen_alloc_internal (INTERNAL_MEM_EPHEMERON_LINK);
if (!node) {
UNLOCK_GC;
return FALSE;
nursery_size = DEFAULT_NURSERY_SIZE;
minor_collection_allowance = MIN_MINOR_COLLECTION_ALLOWANCE;
+ init_stats ();
+ mono_sgen_init_internal_allocator ();
major_init ();
+ mono_sgen_register_fixed_internal_mem_type (INTERNAL_MEM_FRAGMENT, sizeof (Fragment));
+ mono_sgen_register_fixed_internal_mem_type (INTERNAL_MEM_SECTION, SIZEOF_GC_MEM_SECTION);
+ mono_sgen_register_fixed_internal_mem_type (INTERNAL_MEM_FINALIZE_ENTRY, sizeof (FinalizeEntry));
+ mono_sgen_register_fixed_internal_mem_type (INTERNAL_MEM_DISLINK, sizeof (DisappearingLink));
+ mono_sgen_register_fixed_internal_mem_type (INTERNAL_MEM_ROOT_RECORD, sizeof (RootRecord));
+ mono_sgen_register_fixed_internal_mem_type (INTERNAL_MEM_GRAY_QUEUE, sizeof (GrayQueueSection));
+ g_assert (sizeof (GenericStoreRememberedSet) == sizeof (gpointer) * STORE_REMSET_BUFFER_SIZE);
+ mono_sgen_register_fixed_internal_mem_type (INTERNAL_MEM_STORE_REMSET, sizeof (GenericStoreRememberedSet));
+ mono_sgen_register_fixed_internal_mem_type (INTERNAL_MEM_EPHEMERON_LINK, sizeof (EphemeronLinkNode));
+
if ((env = getenv ("MONO_GC_DEBUG"))) {
opts = g_strsplit (env, ",", -1);
for (ptr = opts; ptr && *ptr; ptr ++) {
return FALSE;
}
+void
+mono_sgen_debug_printf (int level, const char *format, ...)
+{
+ va_list ap;
+
+ if (level > gc_debug_level)
+ return;
+
+ va_start (ap, format);
+ vfprintf (gc_debug_file, format, ap);
+ va_end (ap);
+}
+
#endif /* HAVE_SGEN_GC */
/* #define SGEN_PARALLEL_MARK */
+/*
+ * Turning on heavy statistics will turn off the managed allocator and
+ * the managed write barrier.
+ */
+//#define HEAVY_STATISTICS
+
#define THREAD_HASH_SIZE 11
#define ARCH_THREAD_TYPE pthread_t
#endif
};
+enum {
+ MEMORY_ROLE_GEN0,
+ MEMORY_ROLE_GEN1,
+ MEMORY_ROLE_PINNED,
+ MEMORY_ROLE_INTERNAL
+};
+
+typedef struct _SgenBlock SgenBlock;
+struct _SgenBlock {
+ void *next;
+ unsigned char role;
+};
+
+/* This is also the MAJOR_SECTION_SIZE for the copying major
+ collector */
+#define SGEN_PINNED_CHUNK_SIZE (128 * 1024)
+
+#define SGEN_PINNED_CHUNK_FOR_PTR(o) ((SgenBlock*)(((mword)(o)) & ~(SGEN_PINNED_CHUNK_SIZE - 1)))
+
+typedef struct _SgenPinnedChunk SgenPinnedChunk;
+
#ifdef __APPLE__
-static int suspend_signal_num = SIGXFSZ;
+const static int suspend_signal_num = SIGXFSZ;
#else
-static int suspend_signal_num = SIGPWR;
+const static int suspend_signal_num = SIGPWR;
#endif
-static int restart_signal_num = SIGXCPU;
+const static int restart_signal_num = SIGXCPU;
/*
* Recursion is not allowed for the thread lock.
#define LOCK_INTERRUPTION pthread_mutex_lock (&interruption_mutex)
#define UNLOCK_INTERRUPTION pthread_mutex_unlock (&interruption_mutex)
-#ifdef SGEN_PARALLEL_MARK
-#define LOCK_INTERNAL_ALLOCATOR pthread_mutex_lock (&internal_allocator_mutex)
-#define UNLOCK_INTERNAL_ALLOCATOR pthread_mutex_unlock (&internal_allocator_mutex)
-#else
-#define LOCK_INTERNAL_ALLOCATOR
-#define UNLOCK_INTERNAL_ALLOCATOR
-#endif
-
#ifdef SGEN_PARALLEL_MARK
#define SGEN_CAS_PTR InterlockedCompareExchangePointer
#define SGEN_ATOMIC_ADD(x,i) do { \
/* we intercept pthread_create calls to know which threads exist */
#define USE_PTHREAD_INTERCEPT 1
-#define MAX_DEBUG_LEVEL 2
-#define DEBUG(level,a) do {if (G_UNLIKELY ((level) <= MAX_DEBUG_LEVEL && (level) <= gc_debug_level)) a;} while (0)
+#ifdef HEAVY_STATISTICS
+#define HEAVY_STAT(x) x
+#else
+#define HEAVY_STAT(x)
+#endif
+
+#define SGEN_ALLOC_ALIGN 8
+#define SGEN_ALLOC_ALIGN_BITS 3
+
+#define SGEN_ALIGN_UP(s) (((s)+(SGEN_ALLOC_ALIGN-1)) & ~(SGEN_ALLOC_ALIGN-1))
+
+typedef void (*IterateObjectCallbackFunc) (char*, size_t, void*);
+
+void* mono_sgen_alloc_os_memory (size_t size, int activate) MONO_INTERNAL;
+void* mono_sgen_alloc_os_memory_aligned (mword size, mword alignment, gboolean activate) MONO_INTERNAL;
+void mono_sgen_free_os_memory (void *addr, size_t size) MONO_INTERNAL;
int mono_sgen_thread_handshake (int signum) MONO_INTERNAL;
SgenThreadInfo* mono_sgen_thread_info_lookup (ARCH_THREAD_TYPE id) MONO_INTERNAL;
gboolean mono_sgen_is_worker_thread (pthread_t thread) MONO_INTERNAL;
-#endif /* __MONO_SGENGC_H__ */
+void mono_sgen_update_heap_boundaries (mword low, mword high) MONO_INTERNAL;
+
+/* Keep in sync with mono_sgen_dump_internal_mem_usage() in dump_heap()! */
+enum {
+ INTERNAL_MEM_MANAGED,
+ INTERNAL_MEM_PIN_QUEUE,
+ INTERNAL_MEM_FRAGMENT,
+ INTERNAL_MEM_SECTION,
+ INTERNAL_MEM_SCAN_STARTS,
+ INTERNAL_MEM_FIN_TABLE,
+ INTERNAL_MEM_FINALIZE_ENTRY,
+ INTERNAL_MEM_DISLINK_TABLE,
+ INTERNAL_MEM_DISLINK,
+ INTERNAL_MEM_ROOTS_TABLE,
+ INTERNAL_MEM_ROOT_RECORD,
+ INTERNAL_MEM_STATISTICS,
+ INTERNAL_MEM_REMSET,
+ INTERNAL_MEM_GRAY_QUEUE,
+ INTERNAL_MEM_STORE_REMSET,
+ INTERNAL_MEM_MS_TABLES,
+ INTERNAL_MEM_MS_BLOCK_INFO,
+ INTERNAL_MEM_EPHEMERON_LINK,
+ INTERNAL_MEM_MAX
+};
+
+#define SGEN_INTERNAL_FREELIST_NUM_SLOTS 30
+
+typedef struct _SgenInternalAllocator SgenInternalAllocator;
+struct _SgenInternalAllocator {
+ SgenPinnedChunk *chunk_list;
+ SgenPinnedChunk *free_lists [SGEN_INTERNAL_FREELIST_NUM_SLOTS];
+ long small_internal_mem_bytes [INTERNAL_MEM_MAX];
+};
+
+void mono_sgen_init_internal_allocator (void) MONO_INTERNAL;
+
+const char* mono_sgen_internal_mem_type_name (int type) MONO_INTERNAL;
+void mono_sgen_report_internal_mem_usage (void) MONO_INTERNAL;
+void mono_sgen_report_internal_mem_usage_full (SgenInternalAllocator *alc) MONO_INTERNAL;
+void mono_sgen_dump_internal_mem_usage (FILE *heap_dump_file) MONO_INTERNAL;
+void mono_sgen_register_fixed_internal_mem_type (int type, size_t size) MONO_INTERNAL;
+
+void* mono_sgen_alloc_internal (int type) MONO_INTERNAL;
+void mono_sgen_free_internal (void *addr, int type) MONO_INTERNAL;
+
+void* mono_sgen_alloc_internal_dynamic (size_t size, int type) MONO_INTERNAL;
+void mono_sgen_free_internal_dynamic (void *addr, size_t size, int type) MONO_INTERNAL;
+
+void* mono_sgen_alloc_internal_full (SgenInternalAllocator *allocator, size_t size, int type) MONO_INTERNAL;
+void mono_sgen_free_internal_full (SgenInternalAllocator *allocator, void *addr, size_t size, int type) MONO_INTERNAL;
+
+void mono_sgen_debug_printf (int level, const char *format, ...) MONO_INTERNAL;
+
+void mono_sgen_internal_scan_objects (SgenInternalAllocator *alc, IterateObjectCallbackFunc callback, void *callback_data) MONO_INTERNAL;
+void mono_sgen_internal_scan_pinned_objects (SgenInternalAllocator *alc, IterateObjectCallbackFunc callback, void *callback_data) MONO_INTERNAL;
+
+void** mono_sgen_find_optimized_pin_queue_area (void *start, void *end, int *num) MONO_INTERNAL;
+
+#endif /* __MONO_SGENGC_H__ */
queue->free_list = section->next;
} else {
/* Allocate a new section */
- section = get_internal_mem (sizeof (GrayQueueSection), INTERNAL_MEM_GRAY_QUEUE);
+ section = mono_sgen_alloc_internal (INTERNAL_MEM_GRAY_QUEUE);
}
section->end = 0;
static void
gray_object_free_queue_section (GrayQueueSection *section)
{
- free_internal_mem (section, INTERNAL_MEM_GRAY_QUEUE);
+ mono_sgen_free_internal (section, INTERNAL_MEM_GRAY_QUEUE);
}
static inline gboolean
int i;
g_assert (gray_object_queue_is_empty (queue));
- g_assert (sizeof (GrayQueueSection) < MAX_FREELIST_SIZE);
DEBUG (9, g_assert (queue->balance == 0));
/* Free the extra sections allocated during the last collection */
--- /dev/null
+/*
+ * sgen-gc.c: Simple generational GC.
+ *
+ * Author:
+ * Paolo Molaro (lupus@ximian.com)
+ *
+ * Copyright 2005-2010 Novell, Inc (http://www.novell.com)
+ *
+ * Thread start/stop adapted from Boehm's GC:
+ * Copyright (c) 1994 by Xerox Corporation. All rights reserved.
+ * Copyright (c) 1996 by Silicon Graphics. All rights reserved.
+ * Copyright (c) 1998 by Fergus Henderson. All rights reserved.
+ * Copyright (c) 2000-2004 by Hewlett-Packard Company. All rights reserved.
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+ *
+ * Permission is hereby granted to use or copy this program
+ * for any purpose, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ *
+ * Copyright 2001-2003 Ximian, Inc
+ * Copyright 2003-2010 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.
+ */
+
+#ifdef HAVE_SGEN_GC
+
+#include "metadata/sgen-gc.h"
+
+/* Pinned objects are allocated in the LOS space if bigger than half a page
+ * or from freelists otherwise. We assume that pinned objects are relatively few
+ * and they have a slow dying speed (like interned strings, thread objects).
+ * As such they will be collected only at major collections.
+ * free lists are not global: when we need memory we allocate a PinnedChunk.
+ * Each pinned chunk is made of several pages, the first of wich is used
+ * internally for bookeeping (here think of a page as 4KB). The bookeeping
+ * includes the freelists vectors and info about the object size of each page
+ * in the pinned chunk. So, when needed, a free page is found in a pinned chunk,
+ * a size is assigned to it, the page is divided in the proper chunks and each
+ * chunk is added to the freelist. To not waste space, the remaining space in the
+ * first page is used as objects of size 16 or 32 (need to measure which are more
+ * common).
+ * We use this same structure to allocate memory used internally by the GC, so
+ * we never use malloc/free if we need to alloc during collection: the world is stopped
+ * and malloc/free will deadlock.
+ * When we want to iterate over pinned objects, we just scan a page at a time
+ * linearly according to the size of objects in the page: the next pointer used to link
+ * the items in the freelist uses the same word as the vtable. Since we keep freelists
+ * for each pinned chunk, if the word points outside the pinned chunk it means
+ * it is an object.
+ * We could avoid this expensive scanning in creative ways. We could have a policy
+ * of putting in the pinned space only objects we know about that have no struct fields
+ * with references and we can easily use a even expensive write barrier for them,
+ * since pointer writes on such objects should be rare.
+ * The best compromise is to just alloc interned strings and System.MonoType in them.
+ * It would be nice to allocate MonoThread in it, too: must check that we properly
+ * use write barriers so we don't have to do any expensive scanning of the whole pinned
+ * chunk list during minor collections. We can avoid it now because we alloc in it only
+ * reference-free objects.
+ */
+struct _SgenPinnedChunk {
+ SgenBlock block;
+ int num_pages;
+ int *page_sizes; /* a 0 means the page is still unused */
+ void **free_list;
+ SgenPinnedChunk *free_list_nexts [SGEN_INTERNAL_FREELIST_NUM_SLOTS];
+ void *start_data;
+ void *data [1]; /* page sizes and free lists are stored here */
+};
+
+#define PINNED_FIRST_SLOT_SIZE (sizeof (gpointer) * 4)
+#define MAX_FREELIST_SIZE 8192
+
+/* This is a fixed value used for pinned chunks, not the system pagesize */
+#define FREELIST_PAGESIZE (16*1024)
+
+/* keep each size a multiple of ALLOC_ALIGN */
+/* on 64 bit systems 8 is likely completely unused. */
+static const int freelist_sizes [] = {
+ 8, 16, 24, 32, 40, 48, 64, 80,
+ 96, 128, 160, 192, 224, 256, 320, 384,
+ 448, 512, 584, 680, 816, 1024, 1360, 2048,
+ 2336, 2728, 3272, 4096, 5456, 8192 };
+
+/*
+ * Slot indexes for the fixed INTERNAL_MEM_XXX types. -1 if that type
+ * is dynamic.
+ */
+static int fixed_type_freelist_slots [INTERNAL_MEM_MAX];
+
+static SgenInternalAllocator unmanaged_allocator;
+
+#define LARGE_INTERNAL_MEM_HEADER_MAGIC 0x7d289f3a
+
+typedef struct _LargeInternalMemHeader LargeInternalMemHeader;
+struct _LargeInternalMemHeader {
+ guint32 magic;
+ size_t size;
+ double data[0];
+};
+
+#ifdef SGEN_PARALLEL_MARK
+static LOCK_DECLARE (internal_allocator_mutex);
+#define LOCK_INTERNAL_ALLOCATOR pthread_mutex_lock (&internal_allocator_mutex)
+#define UNLOCK_INTERNAL_ALLOCATOR pthread_mutex_unlock (&internal_allocator_mutex)
+#else
+#define LOCK_INTERNAL_ALLOCATOR
+#define UNLOCK_INTERNAL_ALLOCATOR
+#endif
+
+static long long pinned_chunk_bytes_alloced = 0;
+static long long large_internal_bytes_alloced = 0;
+
+#ifdef HEAVY_STATISTICS
+static long long stat_internal_alloc = 0;
+#endif
+
+/*
+ * Debug reporting.
+ */
+static void
+report_pinned_chunk (SgenPinnedChunk *chunk, int seq) {
+ void **p;
+ int i, free_pages, num_free, free_mem;
+ free_pages = 0;
+ for (i = 0; i < chunk->num_pages; ++i) {
+ if (!chunk->page_sizes [i])
+ free_pages++;
+ }
+ printf ("Pinned chunk %d at %p, size: %d, pages: %d, free: %d\n", seq, chunk, chunk->num_pages * FREELIST_PAGESIZE, chunk->num_pages, free_pages);
+ free_mem = FREELIST_PAGESIZE * free_pages;
+ for (i = 0; i < SGEN_INTERNAL_FREELIST_NUM_SLOTS; ++i) {
+ if (!chunk->free_list [i])
+ continue;
+ num_free = 0;
+ p = chunk->free_list [i];
+ while (p) {
+ num_free++;
+ p = *p;
+ }
+ printf ("\tfree list of size %d, %d items\n", freelist_sizes [i], num_free);
+ free_mem += freelist_sizes [i] * num_free;
+ }
+ printf ("\tfree memory in chunk: %d\n", free_mem);
+}
+
+/*
+ * Debug reporting.
+ */
+void
+mono_sgen_report_internal_mem_usage_full (SgenInternalAllocator *alc)
+{
+ SgenPinnedChunk *chunk;
+ int i = 0;
+ for (chunk = alc->chunk_list; chunk; chunk = chunk->block.next)
+ report_pinned_chunk (chunk, i++);
+}
+
+void
+mono_sgen_report_internal_mem_usage (void)
+{
+ mono_sgen_report_internal_mem_usage_full (&unmanaged_allocator);
+}
+
+/*
+ * Find the slot number in the freelist for memory chunks that
+ * can contain @size objects.
+ */
+static int
+slot_for_size (size_t size)
+{
+ int slot;
+ /* do a binary search or lookup table later. */
+ for (slot = 0; slot < SGEN_INTERNAL_FREELIST_NUM_SLOTS; ++slot) {
+ if (freelist_sizes [slot] >= size)
+ return slot;
+ }
+ g_assert_not_reached ();
+ return -1;
+}
+
+void
+mono_sgen_register_fixed_internal_mem_type (int type, size_t size)
+{
+ int slot;
+
+ g_assert (type >= 0 && type < INTERNAL_MEM_MAX);
+ g_assert (fixed_type_freelist_slots [type] == -1);
+
+ slot = slot_for_size (size);
+ g_assert (slot >= 0);
+
+ fixed_type_freelist_slots [type] = slot;
+}
+
+/*
+ * Build a free list for @size memory chunks from the memory area between
+ * start_page and end_page.
+ */
+static void
+build_freelist (SgenInternalAllocator *alc, SgenPinnedChunk *chunk, int slot, int size, char *start_page, char *end_page)
+{
+ void **p, **end;
+ int count = 0;
+ /*g_print ("building freelist for slot %d, size %d in %p\n", slot, size, chunk);*/
+ p = (void**)start_page;
+ end = (void**)(end_page - size);
+ g_assert (!chunk->free_list [slot]);
+ chunk->free_list [slot] = p;
+ while ((char*)p + size <= (char*)end) {
+ count++;
+ *p = (void*)((char*)p + size);
+ p = *p;
+ }
+ *p = NULL;
+ /*g_print ("%d items created, max: %d\n", count, (end_page - start_page) / size);*/
+
+ g_assert (!chunk->free_list_nexts [slot]);
+ chunk->free_list_nexts [slot] = alc->free_lists [slot];
+ alc->free_lists [slot] = chunk;
+}
+
+/* LOCKING: if !managed, requires the internal allocator lock to be held */
+static SgenPinnedChunk*
+alloc_pinned_chunk (SgenInternalAllocator *alc, gboolean managed)
+{
+ SgenPinnedChunk *chunk;
+ int offset;
+ int size = SGEN_PINNED_CHUNK_SIZE;
+
+ if (managed)
+ LOCK_INTERNAL_ALLOCATOR;
+
+ chunk = mono_sgen_alloc_os_memory_aligned (size, size, TRUE);
+ chunk->block.role = managed ? MEMORY_ROLE_PINNED : MEMORY_ROLE_INTERNAL;
+
+ if (managed)
+ mono_sgen_update_heap_boundaries ((mword)chunk, ((mword)chunk + size));
+
+ pinned_chunk_bytes_alloced += size;
+
+ /* setup the bookeeping fields */
+ chunk->num_pages = size / FREELIST_PAGESIZE;
+ offset = G_STRUCT_OFFSET (SgenPinnedChunk, data);
+ chunk->page_sizes = (void*)((char*)chunk + offset);
+ offset += sizeof (int) * chunk->num_pages;
+ offset = SGEN_ALIGN_UP (offset);
+ chunk->free_list = (void*)((char*)chunk + offset);
+ offset += sizeof (void*) * SGEN_INTERNAL_FREELIST_NUM_SLOTS;
+ offset = SGEN_ALIGN_UP (offset);
+ chunk->start_data = (void*)((char*)chunk + offset);
+
+ /* allocate the first page to the freelist */
+ chunk->page_sizes [0] = PINNED_FIRST_SLOT_SIZE;
+ build_freelist (alc, chunk, slot_for_size (PINNED_FIRST_SLOT_SIZE), PINNED_FIRST_SLOT_SIZE,
+ chunk->start_data, ((char*)chunk + FREELIST_PAGESIZE));
+ mono_sgen_debug_printf (4, "Allocated pinned chunk %p, size: %d\n", chunk, size);
+
+ chunk->block.next = alc->chunk_list;
+ alc->chunk_list = chunk;
+
+ if (managed)
+ UNLOCK_INTERNAL_ALLOCATOR;
+
+ return chunk;
+}
+
+/* Must be called with an empty freelist for the given slot. */
+static gboolean
+populate_chunk_page (SgenInternalAllocator *alc, SgenPinnedChunk *chunk, int slot)
+{
+ int size = freelist_sizes [slot];
+ int i;
+ g_assert (!chunk->free_list [slot]);
+ g_assert (!chunk->free_list_nexts [slot]);
+ for (i = 0; i < chunk->num_pages; ++i) {
+ if (chunk->page_sizes [i])
+ continue;
+ chunk->page_sizes [i] = size;
+ build_freelist (alc, chunk, slot, size, (char*)chunk + FREELIST_PAGESIZE * i, (char*)chunk + FREELIST_PAGESIZE * (i + 1));
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/* LOCKING: assumes the internal allocator lock is held */
+static void*
+alloc_from_slot (SgenInternalAllocator *alc, int slot, int type)
+{
+ SgenPinnedChunk *pchunk;
+ size_t size = freelist_sizes [slot];
+
+ alc->small_internal_mem_bytes [type] += size;
+
+ restart:
+ pchunk = alc->free_lists [slot];
+ if (pchunk) {
+ void **p = pchunk->free_list [slot];
+ void *next;
+
+ g_assert (p);
+
+ next = *p;
+ pchunk->free_list [slot] = next;
+
+ if (!next) {
+ alc->free_lists [slot] = pchunk->free_list_nexts [slot];
+ pchunk->free_list_nexts [slot] = NULL;
+ }
+
+ memset (p, 0, size);
+ return p;
+ }
+
+ for (pchunk = alc->chunk_list; pchunk; pchunk = pchunk->block.next) {
+ if (populate_chunk_page (alc, pchunk, slot))
+ goto restart;
+ }
+
+ pchunk = alloc_pinned_chunk (alc, type == INTERNAL_MEM_MANAGED);
+ /* FIXME: handle OOM */
+ if (pchunk->free_list [slot])
+ goto restart;
+ if (!populate_chunk_page (alc, pchunk, slot))
+ g_assert_not_reached ();
+ goto restart;
+}
+
+/* used for the GC-internal data structures */
+void*
+mono_sgen_alloc_internal_full (SgenInternalAllocator *alc, size_t size, int type)
+{
+ int slot;
+ void *res = NULL;
+
+ g_assert (fixed_type_freelist_slots [type] == -1);
+
+ LOCK_INTERNAL_ALLOCATOR;
+
+ HEAVY_STAT (++stat_internal_alloc);
+
+ if (size > freelist_sizes [SGEN_INTERNAL_FREELIST_NUM_SLOTS - 1]) {
+ LargeInternalMemHeader *mh;
+
+ UNLOCK_INTERNAL_ALLOCATOR;
+
+ size += sizeof (LargeInternalMemHeader);
+ mh = mono_sgen_alloc_os_memory (size, TRUE);
+ mh->magic = LARGE_INTERNAL_MEM_HEADER_MAGIC;
+ mh->size = size;
+ /* FIXME: do a CAS here */
+ large_internal_bytes_alloced += size;
+ return mh->data;
+ }
+
+ slot = slot_for_size (size);
+ g_assert (size <= freelist_sizes [slot]);
+ res = alloc_from_slot (alc, slot, type);
+
+ UNLOCK_INTERNAL_ALLOCATOR;
+
+ return res;
+}
+
+void*
+mono_sgen_alloc_internal (int type)
+{
+ void *res;
+ int slot = fixed_type_freelist_slots [type];
+ g_assert (slot >= 0);
+
+ LOCK_INTERNAL_ALLOCATOR;
+ res = alloc_from_slot (&unmanaged_allocator, slot, type);
+ UNLOCK_INTERNAL_ALLOCATOR;
+
+ return res;
+}
+
+void*
+mono_sgen_alloc_internal_dynamic (size_t size, int type)
+{
+ return mono_sgen_alloc_internal_full (&unmanaged_allocator, size, type);
+}
+
+static void
+free_from_slot (SgenInternalAllocator *alc, void *addr, int slot, int type)
+{
+ SgenPinnedChunk *pchunk = (SgenPinnedChunk*)SGEN_PINNED_CHUNK_FOR_PTR (addr);
+ void **p = addr;
+ void *next;
+
+ LOCK_INTERNAL_ALLOCATOR;
+
+ g_assert (addr >= (void*)pchunk && (char*)addr < (char*)pchunk + pchunk->num_pages * FREELIST_PAGESIZE);
+ if (type == INTERNAL_MEM_MANAGED)
+ g_assert (pchunk->block.role == MEMORY_ROLE_PINNED);
+ else
+ g_assert (pchunk->block.role == MEMORY_ROLE_INTERNAL);
+
+ next = pchunk->free_list [slot];
+ *p = next;
+ pchunk->free_list [slot] = p;
+
+ if (!next) {
+ g_assert (!pchunk->free_list_nexts [slot]);
+ pchunk->free_list_nexts [slot] = alc->free_lists [slot];
+ alc->free_lists [slot] = pchunk;
+ }
+
+ alc->small_internal_mem_bytes [type] -= freelist_sizes [slot];
+
+ UNLOCK_INTERNAL_ALLOCATOR;
+}
+
+void
+mono_sgen_free_internal_full (SgenInternalAllocator *alc, void *addr, size_t size, int type)
+{
+ LargeInternalMemHeader *mh;
+
+ g_assert (fixed_type_freelist_slots [type] == -1);
+
+ if (!addr)
+ return;
+
+ if (size <= freelist_sizes [SGEN_INTERNAL_FREELIST_NUM_SLOTS - 1]) {
+ int slot = slot_for_size (size);
+ free_from_slot (alc, addr, slot, type);
+ return;
+ }
+
+ mh = (LargeInternalMemHeader*)((char*)addr - G_STRUCT_OFFSET (LargeInternalMemHeader, data));
+ g_assert (mh->magic == LARGE_INTERNAL_MEM_HEADER_MAGIC);
+ g_assert (mh->size == size + sizeof (LargeInternalMemHeader));
+ /* FIXME: do a CAS */
+ large_internal_bytes_alloced -= mh->size;
+ mono_sgen_free_os_memory (mh, mh->size);
+}
+
+void
+mono_sgen_free_internal (void *addr, int type)
+{
+ int slot = fixed_type_freelist_slots [type];
+ g_assert (slot >= 0);
+
+ free_from_slot (&unmanaged_allocator, addr, slot, type);
+}
+
+void
+mono_sgen_free_internal_dynamic (void *addr, size_t size, int type)
+{
+ mono_sgen_free_internal_full (&unmanaged_allocator, addr, size, type);
+}
+
+void
+mono_sgen_dump_internal_mem_usage (FILE *heap_dump_file)
+{
+ static char const *internal_mem_names [] = { "managed", "pin-queue", "fragment", "section", "scan-starts",
+ "fin-table", "finalize-entry", "dislink-table",
+ "dislink", "roots-table", "root-record", "statistics",
+ "remset", "gray-queue", "store-remset", "marksweep-tables",
+ "marksweep-block-info", "ephemeron-link" };
+
+ int i;
+
+ fprintf (heap_dump_file, "<other-mem-usage type=\"large-internal\" size=\"%lld\"/>\n", large_internal_bytes_alloced);
+ fprintf (heap_dump_file, "<other-mem-usage type=\"pinned-chunks\" size=\"%lld\"/>\n", pinned_chunk_bytes_alloced);
+ for (i = 0; i < INTERNAL_MEM_MAX; ++i) {
+ fprintf (heap_dump_file, "<other-mem-usage type=\"%s\" size=\"%ld\"/>\n",
+ internal_mem_names [i], unmanaged_allocator.small_internal_mem_bytes [i]);
+ }
+}
+
+void
+mono_sgen_init_internal_allocator (void)
+{
+ int i;
+
+ g_assert (SGEN_INTERNAL_FREELIST_NUM_SLOTS == sizeof (freelist_sizes) / sizeof (freelist_sizes [0]));
+
+ for (i = 0; i < INTERNAL_MEM_MAX; ++i)
+ fixed_type_freelist_slots [i] = -1;
+
+#ifdef HEAVY_STATISTICS
+ mono_counters_register ("Internal allocs", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_internal_alloc);
+#endif
+}
+
+void
+mono_sgen_internal_scan_objects (SgenInternalAllocator *alc, IterateObjectCallbackFunc callback, void *callback_data)
+{
+ SgenPinnedChunk *chunk;
+ int i, obj_size;
+ char *p, *endp;
+ void **ptr;
+ void *end_chunk;
+ for (chunk = alc->chunk_list; chunk; chunk = chunk->block.next) {
+ end_chunk = (char*)chunk + chunk->num_pages * FREELIST_PAGESIZE;
+ mono_sgen_debug_printf (6, "Scanning pinned chunk %p (range: %p-%p)\n", chunk, chunk->start_data, end_chunk);
+ for (i = 0; i < chunk->num_pages; ++i) {
+ obj_size = chunk->page_sizes [i];
+ if (!obj_size)
+ continue;
+ p = i? (char*)chunk + i * FREELIST_PAGESIZE: chunk->start_data;
+ endp = i? p + FREELIST_PAGESIZE: (char*)chunk + FREELIST_PAGESIZE;
+ mono_sgen_debug_printf (6, "Page %d (size: %d, range: %p-%p)\n", i, obj_size, p, endp);
+ while (p + obj_size <= endp) {
+ ptr = (void**)p;
+ /* if the first word (the vtable) is outside the chunk we have an object */
+ if (*ptr && (*ptr < (void*)chunk || *ptr >= end_chunk))
+ callback ((char*)ptr, obj_size, callback_data);
+ p += obj_size;
+ }
+ }
+ }
+}
+
+/*
+ * the array of pointers from @start to @end contains conservative
+ * pointers to objects inside @chunk: mark each referenced object
+ * with the PIN bit.
+ */
+static void
+mark_pinned_from_addresses (SgenPinnedChunk *chunk, void **start, void **end, IterateObjectCallbackFunc callback, void *callback_data)
+{
+ for (; start < end; start++) {
+ char *addr = *start;
+ int offset = (char*)addr - (char*)chunk;
+ int page = offset / FREELIST_PAGESIZE;
+ int obj_offset = page == 0? offset - ((char*)chunk->start_data - (char*)chunk): offset % FREELIST_PAGESIZE;
+ int slot_size = chunk->page_sizes [page];
+ void **ptr;
+ /* the page is not allocated */
+ if (!slot_size)
+ continue;
+ /* would be faster if we restrict the sizes to power of two,
+ * but that's a waste of memory: need to measure. it could reduce
+ * fragmentation since there are less pages needed, if for example
+ * someone interns strings of each size we end up with one page per
+ * interned string (still this is just ~40 KB): with more fine-grained sizes
+ * this increases the number of used pages.
+ */
+ if (page == 0) {
+ obj_offset /= slot_size;
+ obj_offset *= slot_size;
+ addr = (char*)chunk->start_data + obj_offset;
+ } else {
+ obj_offset /= slot_size;
+ obj_offset *= slot_size;
+ addr = (char*)chunk + page * FREELIST_PAGESIZE + obj_offset;
+ }
+ ptr = (void**)addr;
+ /* if the vtable is inside the chunk it's on the freelist, so skip */
+ /* FIXME: is it possible that we're pinning objects more than once here? */
+ if (*ptr && (*ptr < (void*)chunk->start_data || *ptr > (void*)((char*)chunk + chunk->num_pages * FREELIST_PAGESIZE)))
+ callback (addr, slot_size, callback_data);
+ }
+}
+
+void
+mono_sgen_internal_scan_pinned_objects (SgenInternalAllocator *alc, IterateObjectCallbackFunc callback, void *callback_data)
+{
+ SgenPinnedChunk *chunk;
+
+ /* look for pinned addresses for pinned-alloc objects */
+ mono_sgen_debug_printf (6, "Pinning from pinned-alloc objects\n");
+ for (chunk = alc->chunk_list; chunk; chunk = chunk->block.next) {
+ int num_pinned;
+ void **pinned = mono_sgen_find_optimized_pin_queue_area (chunk->start_data,
+ (char*)chunk + chunk->num_pages * FREELIST_PAGESIZE, &num_pinned);
+ if (num_pinned)
+ mark_pinned_from_addresses (chunk, pinned, pinned + num_pinned, callback, callback_data);
+ }
+}
+
+#endif
if (free_chunks)
return (LOSObject*)free_chunks;
- section = get_os_memory_aligned (LOS_SECTION_SIZE, LOS_SECTION_SIZE, TRUE);
-
- total_alloc += LOS_SECTION_SIZE;
+ section = mono_sgen_alloc_os_memory_aligned (LOS_SECTION_SIZE, LOS_SECTION_SIZE, TRUE);
free_chunks = (LOSFreeChunks*)((char*)section + LOS_CHUNK_SIZE);
free_chunks->size = LOS_SECTION_SIZE - LOS_CHUNK_SIZE;
size += sizeof (LOSObject);
size += pagesize - 1;
size &= ~(pagesize - 1);
- total_alloc -= size;
- free_os_memory (obj, size);
+ mono_sgen_free_os_memory (obj, size);
} else {
free_los_section_memory (obj, size + sizeof (LOSObject));
#ifdef LOS_CONSISTENCY_CHECKS
#ifdef LOS_DUMMY
if (!los_segment)
- los_segment = get_os_memory (LOS_SEGMENT_SIZE, TRUE);
+ los_segment = mono_sgen_alloc_os_memory (LOS_SEGMENT_SIZE, TRUE);
los_segment_index = ALIGN_UP (los_segment_index);
obj = (LOSObject*)(los_segment + los_segment_index);
alloc_size += pagesize - 1;
alloc_size &= ~(pagesize - 1);
/* FIXME: handle OOM */
- obj = get_os_memory (alloc_size, TRUE);
- total_alloc += alloc_size;
+ obj = mono_sgen_alloc_os_memory (alloc_size, TRUE);
} else {
obj = get_los_section_memory (size + sizeof (LOSObject));
memset (obj, 0, size + sizeof (LOSObject));
obj->size = size;
vtslot = (void**)obj->data;
*vtslot = vtable;
- update_heap_boundaries ((mword)obj->data, (mword)obj->data + size);
+ mono_sgen_update_heap_boundaries ((mword)obj->data, (mword)obj->data + size);
obj->next = los_object_list;
los_object_list = obj;
los_memory_usage += size;
prev->next = next;
else
los_sections = next;
- free_os_memory (section, LOS_SECTION_SIZE);
+ mono_sgen_free_os_memory (section, LOS_SECTION_SIZE);
section = next;
--los_num_sections;
continue;
#error Parallel mark not supported in copying major collector
#endif
-#define MAJOR_SECTION_SIZE PINNED_CHUNK_SIZE
-#define BLOCK_FOR_OBJECT(o) ((Block*)(((mword)(o)) & ~(MAJOR_SECTION_SIZE - 1)))
+#define MAJOR_SECTION_SIZE SGEN_PINNED_CHUNK_SIZE
+#define BLOCK_FOR_OBJECT(o) SGEN_PINNED_CHUNK_FOR_PTR ((o))
#define MAJOR_SECTION_FOR_OBJECT(o) ((GCMemSection*)BLOCK_FOR_OBJECT ((o)))
#define MAJOR_OBJ_IS_IN_TO_SPACE(o) (MAJOR_SECTION_FOR_OBJECT ((o))->is_to_space)
static GCMemSection *section_list = NULL;
-/* pinned_chunk_list is used for allocations of objects that are never moved */
-static PinnedChunk *pinned_chunk_list = NULL;
+static SgenInternalAllocator pinned_allocator;
/*
* used when moving the objects
static void
free_pinned_object (char *obj, size_t size)
{
- PinnedChunk *chunk = (PinnedChunk*) BLOCK_FOR_OBJECT (obj);
- void **p = (void**)obj;
- int slot = slot_for_size (size);
-
- g_assert (obj >= (char*)chunk->start_data && obj < ((char*)chunk + chunk->num_pages * FREELIST_PAGESIZE));
- *p = chunk->free_list [slot];
- chunk->free_list [slot] = p;
+ mono_sgen_free_internal_full (&pinned_allocator, obj, size, INTERNAL_MEM_MANAGED);
}
/*
GCMemSection *section;
int scan_starts;
- section = get_os_memory_aligned (MAJOR_SECTION_SIZE, MAJOR_SECTION_SIZE, TRUE);
+ section = mono_sgen_alloc_os_memory_aligned (MAJOR_SECTION_SIZE, MAJOR_SECTION_SIZE, TRUE);
section->next_data = section->data = (char*)section + SIZEOF_GC_MEM_SECTION;
g_assert (!((mword)section->data & 7));
section->size = MAJOR_SECTION_SIZE - SIZEOF_GC_MEM_SECTION;
section->end_data = section->data + section->size;
- update_heap_boundaries (section->data, section->end_data);
- total_alloc += section->size;
+ mono_sgen_update_heap_boundaries ((mword)section->data, (mword)section->end_data);
DEBUG (3, fprintf (gc_debug_file, "New major heap section: (%p-%p), total: %zd\n", section->data, section->end_data, total_alloc));
scan_starts = (section->size + SCAN_START_SIZE - 1) / SCAN_START_SIZE;
- section->scan_starts = get_internal_mem (sizeof (char*) * scan_starts, INTERNAL_MEM_SCAN_STARTS);
+ section->scan_starts = mono_sgen_alloc_internal_dynamic (sizeof (char*) * scan_starts, INTERNAL_MEM_SCAN_STARTS);
section->num_scan_start = scan_starts;
section->block.role = MEMORY_ROLE_GEN1;
section->is_to_space = TRUE;
free_major_section (GCMemSection *section)
{
DEBUG (3, fprintf (gc_debug_file, "Freed major section %p (%p-%p)\n", section, section->data, section->end_data));
- free_internal_mem (section->scan_starts, INTERNAL_MEM_SCAN_STARTS);
- free_os_memory (section, MAJOR_SECTION_SIZE);
- total_alloc -= MAJOR_SECTION_SIZE - SIZEOF_GC_MEM_SECTION;
+ mono_sgen_free_internal_dynamic (section->scan_starts,
+ (section->size + SCAN_START_SIZE - 1) / SCAN_START_SIZE * sizeof (char*), INTERNAL_MEM_SCAN_STARTS);
+ mono_sgen_free_os_memory (section, MAJOR_SECTION_SIZE);
--num_major_sections;
}
if (ptr_in_nursery (obj))
return FALSE;
- objsize = ALIGN_UP (safe_object_get_size ((MonoObject*)obj));
+ objsize = SGEN_ALIGN_UP (safe_object_get_size ((MonoObject*)obj));
/* LOS */
if (objsize > MAX_SMALL_OBJ_SIZE)
static void*
major_alloc_small_pinned_obj (size_t size, gboolean has_references)
{
- int slot;
- void *res = NULL;
- PinnedChunk *pchunk;
- slot = slot_for_size (size);
- /*g_print ("using slot %d for size %d (slot size: %d)\n", slot, size, freelist_sizes [slot]);*/
- g_assert (size <= freelist_sizes [slot]);
- for (pchunk = pinned_chunk_list; pchunk; pchunk = pchunk->block.next) {
- void **p = pchunk->free_list [slot];
- if (p) {
- /*g_print ("found freelist for slot %d in chunk %p, returning %p, next %p\n", slot, pchunk, p, *p);*/
- pchunk->free_list [slot] = *p;
- res = p;
- goto found;
- }
- }
- for (pchunk = pinned_chunk_list; pchunk; pchunk = pchunk->block.next) {
- res = get_chunk_freelist (pchunk, slot);
- if (res)
- goto found;
- }
- LOCK_INTERNAL_ALLOCATOR;
- pchunk = alloc_pinned_chunk ();
- UNLOCK_INTERNAL_ALLOCATOR;
- /* FIXME: handle OOM */
- pchunk->block.next = pinned_chunk_list;
- pinned_chunk_list = pchunk;
- res = get_chunk_freelist (pchunk, slot);
- found:
- memset (res, 0, size);
- return res;
+ return mono_sgen_alloc_internal_full (&pinned_allocator, size, INTERNAL_MEM_MANAGED);
}
/*
* see whether it's a pinned chunk or a major heap section.
*/
- objsize = ALIGN_UP (safe_object_get_size ((MonoObject*)obj));
+ objsize = SGEN_ALIGN_UP (safe_object_get_size ((MonoObject*)obj));
if (G_UNLIKELY (objsize > MAX_SMALL_OBJ_SIZE || obj_is_from_pinned_alloc (obj))) {
if (object_is_pinned (obj))
binary_protocol_empty (frag_start, frag_size);
memset (frag_start, 0, frag_size);
}
- frag_size = ALIGN_UP (safe_object_get_size ((MonoObject*)pin_queue [i]));
+ frag_size = SGEN_ALIGN_UP (safe_object_get_size ((MonoObject*)pin_queue [i]));
frag_start = (char*)pin_queue [i] + frag_size;
section->next_data = MAX (section->next_data, frag_start);
}
}
}
-static void
-scan_pinned_objects (IterateObjectCallbackFunc callback, void *callback_data)
-{
- PinnedChunk *chunk;
- int i, obj_size;
- char *p, *endp;
- void **ptr;
- void *end_chunk;
- for (chunk = pinned_chunk_list; chunk; chunk = chunk->block.next) {
- end_chunk = (char*)chunk + chunk->num_pages * FREELIST_PAGESIZE;
- DEBUG (6, fprintf (gc_debug_file, "Scanning pinned chunk %p (range: %p-%p)\n", chunk, chunk->start_data, end_chunk));
- for (i = 0; i < chunk->num_pages; ++i) {
- obj_size = chunk->page_sizes [i];
- if (!obj_size)
- continue;
- p = i? (char*)chunk + i * FREELIST_PAGESIZE: chunk->start_data;
- endp = i? p + FREELIST_PAGESIZE: (char*)chunk + FREELIST_PAGESIZE;
- DEBUG (6, fprintf (gc_debug_file, "Page %d (size: %d, range: %p-%p)\n", i, obj_size, p, endp));
- while (p + obj_size <= endp) {
- ptr = (void**)p;
- DEBUG (9, fprintf (gc_debug_file, "Considering %p (vtable: %p)\n", ptr, *ptr));
- /* if the first word (the vtable) is outside the chunk we have an object */
- if (*ptr && (*ptr < (void*)chunk || *ptr >= end_chunk))
- callback ((char*)ptr, obj_size, callback_data);
- p += obj_size;
- }
- }
- }
-}
-
-/*
- * the array of pointers from @start to @end contains conservative
- * pointers to objects inside @chunk: mark each referenced object
- * with the PIN bit.
- */
-static void
-mark_pinned_from_addresses (PinnedChunk *chunk, void **start, void **end, GrayQueue *queue)
-{
- for (; start < end; start++) {
- char *addr = *start;
- int offset = (char*)addr - (char*)chunk;
- int page = offset / FREELIST_PAGESIZE;
- int obj_offset = page == 0? offset - ((char*)chunk->start_data - (char*)chunk): offset % FREELIST_PAGESIZE;
- int slot_size = chunk->page_sizes [page];
- void **ptr;
- /* the page is not allocated */
- if (!slot_size)
- continue;
- /* would be faster if we restrict the sizes to power of two,
- * but that's a waste of memory: need to measure. it could reduce
- * fragmentation since there are less pages needed, if for example
- * someone interns strings of each size we end up with one page per
- * interned string (still this is just ~40 KB): with more fine-grained sizes
- * this increases the number of used pages.
- */
- if (page == 0) {
- obj_offset /= slot_size;
- obj_offset *= slot_size;
- addr = (char*)chunk->start_data + obj_offset;
- } else {
- obj_offset /= slot_size;
- obj_offset *= slot_size;
- addr = (char*)chunk + page * FREELIST_PAGESIZE + obj_offset;
- }
- ptr = (void**)addr;
- /* if the vtable is inside the chunk it's on the freelist, so skip */
- if (*ptr && (*ptr < (void*)chunk->start_data || *ptr > (void*)((char*)chunk + chunk->num_pages * FREELIST_PAGESIZE))) {
- binary_protocol_pin (addr, (gpointer)LOAD_VTABLE (addr), safe_object_get_size ((MonoObject*)addr));
- if (heap_dump_file && !object_is_pinned (addr))
- pin_stats_register_object ((char*) addr, safe_object_get_size ((MonoObject*) addr));
- pin_object (addr);
- GRAY_OBJECT_ENQUEUE (queue, addr);
- DEBUG (6, fprintf (gc_debug_file, "Marked pinned object %p (%s) from roots\n", addr, safe_name (addr)));
- }
- }
-}
-
static void
sweep_pinned_objects_callback (char *ptr, size_t size, void *data)
{
static void
sweep_pinned_objects (void)
{
- scan_pinned_objects (sweep_pinned_objects_callback, NULL);
+ mono_sgen_internal_scan_objects (&pinned_allocator, sweep_pinned_objects_callback, NULL);
}
static void
scan_area_with_callback (section->data, section->end_data, callback, data);
}
if (pinned)
- scan_pinned_objects (callback, data);
+ mono_sgen_internal_scan_objects (&pinned_allocator, callback, data);
}
static void
memset (obj, 0, size);
}
+static void
+pin_pinned_object_callback (void *addr, size_t slot_size, GrayQueue *queue)
+{
+ binary_protocol_pin (addr, (gpointer)LOAD_VTABLE (addr), safe_object_get_size ((MonoObject*)addr));
+ if (heap_dump_file && !object_is_pinned (addr))
+ pin_stats_register_object ((char*) addr, safe_object_get_size ((MonoObject*) addr));
+ pin_object (addr);
+ GRAY_OBJECT_ENQUEUE (queue, addr);
+ DEBUG (6, fprintf (gc_debug_file, "Marked pinned object %p (%s) from roots\n", addr, safe_name (addr)));
+}
+
static void
major_find_pin_queue_start_ends (GrayQueue *queue)
{
GCMemSection *section;
- PinnedChunk *chunk;
for (section = section_list; section; section = section->block.next)
find_section_pin_queue_start_end (section);
-
- /* look for pinned addresses for pinned-alloc objects */
- DEBUG (6, fprintf (gc_debug_file, "Pinning from pinned-alloc objects\n"));
- for (chunk = pinned_chunk_list; chunk; chunk = chunk->block.next) {
- int start, end;
- find_optimized_pin_queue_area (chunk->start_data, (char*)chunk + chunk->num_pages * FREELIST_PAGESIZE, &start, &end);
- if (start != end)
- mark_pinned_from_addresses (chunk, pin_queue + start, pin_queue + end, queue);
- }
+ mono_sgen_internal_scan_pinned_objects (&pinned_allocator, (IterateObjectCallbackFunc)pin_pinned_object_callback, queue);
}
static void
static void
major_report_pinned_memory_usage (void)
{
- PinnedChunk *chunk;
- int i = 0;
- for (chunk = pinned_chunk_list; chunk; chunk = chunk->block.next)
- report_pinned_chunk (chunk, i++);
+ mono_sgen_report_internal_mem_usage_full (&pinned_allocator);
}
retry:
if (!empty_blocks) {
- p = get_os_memory_aligned (MS_BLOCK_SIZE * MS_BLOCK_ALLOC_NUM, MS_BLOCK_SIZE, TRUE);
+ p = mono_sgen_alloc_os_memory_aligned (MS_BLOCK_SIZE * MS_BLOCK_ALLOC_NUM, MS_BLOCK_SIZE, TRUE);
for (i = 0; i < MS_BLOCK_ALLOC_NUM; ++i) {
block = p;
g_assert (!((mword)block & (MS_BLOCK_SIZE - 1)));
- update_heap_boundaries ((mword)block, (mword)block + MS_BLOCK_SIZE);
+ mono_sgen_update_heap_boundaries ((mword)block, (mword)block + MS_BLOCK_SIZE);
return block;
}
{
int size = block_obj_sizes [size_index];
int count = MS_BLOCK_FREE / size;
- MSBlockInfo *info = get_internal_mem (sizeof (MSBlockInfo), INTERNAL_MEM_MS_BLOCK_INFO);
+ MSBlockInfo *info = mono_sgen_alloc_internal (INTERNAL_MEM_MS_BLOCK_INFO);
MSBlockHeader *header;
MSBlockInfo **free_blocks = FREE_BLOCKS (pinned, has_references);
char *obj_start;
*iter = block->next;
ms_free_block (block->block);
- free_internal_mem (block, INTERNAL_MEM_MS_BLOCK_INFO);
+ mono_sgen_free_internal (block, INTERNAL_MEM_MS_BLOCK_INFO);
--num_major_sections;
}
{
int i;
+ mono_sgen_register_fixed_internal_mem_type (INTERNAL_MEM_MS_BLOCK_INFO, sizeof (MSBlockInfo));
+
num_block_obj_sizes = ms_calculate_block_obj_sizes (MS_BLOCK_OBJ_SIZE_FACTOR, NULL);
- block_obj_sizes = get_internal_mem (sizeof (int) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES);
+ block_obj_sizes = mono_sgen_alloc_internal_dynamic (sizeof (int) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES);
ms_calculate_block_obj_sizes (MS_BLOCK_OBJ_SIZE_FACTOR, block_obj_sizes);
/*
*/
for (i = 0; i < MS_BLOCK_TYPE_MAX; ++i)
- free_block_lists [i] = get_internal_mem (sizeof (MSBlockInfo*) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES);
+ free_block_lists [i] = mono_sgen_alloc_internal_dynamic (sizeof (MSBlockInfo*) * num_block_obj_sizes, INTERNAL_MEM_MS_TABLES);
for (i = 0; i < MS_NUM_FAST_BLOCK_OBJ_SIZE_INDEXES; ++i)
fast_block_obj_size_indexes [i] = ms_find_block_obj_size_index (i * 8);
while (num_empty_blocks > section_reserve) {
void *next = *(void**)empty_blocks;
- free_os_memory (empty_blocks, MS_BLOCK_SIZE);
+ mono_sgen_free_os_memory (empty_blocks, MS_BLOCK_SIZE);
empty_blocks = next;
/*
* Needs not be atomic because this is running
return;
pin_stats_tree_free (node->left);
pin_stats_tree_free (node->right);
- free_internal_mem (node, INTERNAL_MEM_STATISTICS);
+ mono_sgen_free_internal_dynamic (node, sizeof (PinStatAddress), INTERNAL_MEM_STATISTICS);
}
static void
pinned_byte_counts [i] = 0;
while (pinned_objects) {
ObjectList *next = pinned_objects->next;
- free_internal_mem (pinned_objects, INTERNAL_MEM_STATISTICS);
+ mono_sgen_free_internal_dynamic (pinned_objects, sizeof (ObjectList), INTERNAL_MEM_STATISTICS);
pinned_objects = next;
}
}
node_ptr = &node->right;
}
- node = get_internal_mem (sizeof (PinStatAddress), INTERNAL_MEM_STATISTICS);
+ node = mono_sgen_alloc_internal_dynamic (sizeof (PinStatAddress), INTERNAL_MEM_STATISTICS);
node->addr = addr;
node->pin_types = pin_type_bit;
node->left = node->right = NULL;
pin_stats_register_object (char *obj, size_t size)
{
int pin_types = 0;
- ObjectList *list = get_internal_mem (sizeof (ObjectList), INTERNAL_MEM_STATISTICS);
+ ObjectList *list = mono_sgen_alloc_internal_dynamic (sizeof (ObjectList), INTERNAL_MEM_STATISTICS);
pin_stats_count_object_from_tree (obj, size, pin_stat_addresses, &pin_types);
list->obj = (MonoObject*)obj;
list->next = pinned_objects;
realloc_pin_queue (void)
{
int new_size = pin_queue_size? pin_queue_size + pin_queue_size/2: 1024;
- void **new_pin = get_internal_mem (sizeof (void*) * new_size, INTERNAL_MEM_PIN_QUEUE);
+ void **new_pin = mono_sgen_alloc_internal_dynamic (sizeof (void*) * new_size, INTERNAL_MEM_PIN_QUEUE);
memcpy (new_pin, pin_queue, sizeof (void*) * next_pin_slot);
- free_internal_mem (pin_queue, INTERNAL_MEM_PIN_QUEUE);
+ mono_sgen_free_internal_dynamic (pin_queue, sizeof (void*) * pin_queue_size, INTERNAL_MEM_PIN_QUEUE);
pin_queue = new_pin;
pin_queue_size = new_size;
DEBUG (4, fprintf (gc_debug_file, "Reallocated pin queue to size: %d\n", new_size));
*last = optimized_pin_queue_search (end);
}
+void**
+mono_sgen_find_optimized_pin_queue_area (void *start, void *end, int *num)
+{
+ int first, last;
+ find_optimized_pin_queue_area (start, end, &first, &last);
+ *num = last - first;
+ if (first == last)
+ return NULL;
+ return pin_queue + first;
+}
+
static void
find_section_pin_queue_start_end (GCMemSection *section)
{
void *pa = ares->async_state;
mono_runtime_delegate_invoke (ares->async_delegate, &pa, &exc);
} else {
+ MonoObject *cb_exc = NULL;
+
ac->msg->exc = NULL;
res = mono_message_invoke (ares->async_delegate, ac->msg, &exc, &out_args);
MONO_OBJECT_SETREF (ac, res, res);
/* call async callback if cb_method != null*/
if (ac != NULL && ac->cb_method) {
- MonoObject *exc = NULL;
void *pa = &ares;
- mono_runtime_invoke (ac->cb_method, ac->cb_target, pa, &exc);
- /* 'exc' will be the previous ac->msg->exc if not NULL and not
- * catched. If catched, this will be set to NULL and the
- * exception will not be printed. */
- MONO_OBJECT_SETREF (ac->msg, exc, exc);
+ cb_exc = NULL;
+ mono_runtime_invoke (ac->cb_method, ac->cb_target, pa, &cb_exc);
+ MONO_OBJECT_SETREF (ac->msg, exc, cb_exc);
+ exc = cb_exc;
+ } else {
+ exc = NULL;
}
}
}
if (mono_domain_set (domain, FALSE)) {
- /* ASyncCall *ac; */
+ MonoObject *exc;
if (tp_item_begin_func)
tp_item_begin_func (tp_item_user_data);
if (!is_io_task && ar->add_time > 0)
process_idle_times (tp, ar->add_time);
- /*FIXME: Do something with the exception returned? */
- mono_async_invoke (tp, ar);
+ exc = mono_async_invoke (tp, ar);
if (tp_item_end_func)
tp_item_end_func (tp_item_user_data);
- /*
- ac = (ASyncCall *) ar->object_data;
- if (ac->msg->exc != NULL)
- mono_unhandled_exception (ac->msg->exc);
- */
+ if (exc && mono_runtime_unhandled_exception_policy_get () == MONO_UNHANDLED_POLICY_CURRENT) {
+ mono_unhandled_exception (exc);
+ exit (255);
+ }
mono_domain_set (mono_get_root_domain (), TRUE);
}
mono_thread_pop_appdomain_ref ();
void ves_icall_System_Threading_Thread_Sleep_internal(gint32 ms) MONO_INTERNAL;
gboolean ves_icall_System_Threading_Thread_Join_internal(MonoInternalThread *this_obj, int ms, HANDLE thread) MONO_INTERNAL;
gint32 ves_icall_System_Threading_Thread_GetDomainID (void) MONO_INTERNAL;
+gboolean ves_icall_System_Threading_Thread_Yield (void) MONO_INTERNAL;
MonoString* ves_icall_System_Threading_Thread_GetName_internal (MonoInternalThread *this_obj) MONO_INTERNAL;
void ves_icall_System_Threading_Thread_SetName_internal (MonoInternalThread *this_obj, MonoString *name) MONO_INTERNAL;
MonoObject* ves_icall_System_Threading_Thread_GetCachedCurrentCulture (MonoInternalThread *this_obj) MONO_INTERNAL;
return mono_domain_get()->domain_id;
}
+gboolean
+ves_icall_System_Threading_Thread_Yield (void)
+{
+#ifdef HOST_WIN32
+ return SwitchToThread ();
+#else
+ return sched_yield () == 0;
+#endif
+}
+
/*
* mono_thread_get_name:
*
if (tinfo->constraints) {
MonoClass **target_class, **candidate_class;
- if (!cinfo->constraints)
- return FALSE;
for (target_class = tinfo->constraints; *target_class; ++target_class) {
MonoClass *tc;
MonoType *inflated = verifier_inflate_type (ctx, &(*target_class)->byval_arg, context);
if (mono_metadata_type_equal (&tc->byval_arg, &candidate_param_class->byval_arg))
continue;
+ if (!cinfo->constraints)
+ return FALSE;
+
for (candidate_class = cinfo->constraints; *candidate_class; ++candidate_class) {
MonoClass *cc;
inflated = verifier_inflate_type (ctx, &(*candidate_class)->byval_arg, ctx->generic_context);
if (method->klass->valuetype && (stack_slot_is_boxed_value (value) || !stack_slot_is_managed_pointer (value)))
CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Cannot use a boxed or literal valuetype to call a valuetype method at 0x%04x", ctx->ip_offset));
}
- if (!verify_stack_type_compatibility (ctx, type, ©))
- CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Incompatible this argument on stack with method signature at 0x%04x", ctx->ip_offset));
+ if (!verify_stack_type_compatibility (ctx, type, ©)) {
+ char *expected = mono_type_full_name (type);
+ char *effective = stack_slot_full_name (©);
+ char *method_name = mono_method_full_name (method, TRUE);
+ CODE_NOT_VERIFIABLE (ctx, g_strdup_printf ("Incompatible this argument on stack with method signature expected '%s' but got '%s' for a call to '%s' at 0x%04x",
+ expected, effective, method_name, ctx->ip_offset));
+ g_free (method_name);
+ g_free (effective);
+ g_free (expected);
+ }
if (!IS_SKIP_VISIBILITY (ctx) && !mono_method_can_access_method_full (ctx->method, method, mono_class_from_mono_type (value->type))) {
char *name = mono_method_full_name (method, TRUE);
MonoClass *handle_class;
if (!check_overflow (ctx))
return;
+
+ switch (token & 0xff000000) {
+ case MONO_TOKEN_TYPE_DEF:
+ case MONO_TOKEN_TYPE_REF:
+ case MONO_TOKEN_TYPE_SPEC:
+ case MONO_TOKEN_FIELD_DEF:
+ case MONO_TOKEN_METHOD_DEF:
+ case MONO_TOKEN_METHOD_SPEC:
+ case MONO_TOKEN_MEMBER_REF:
+ if (!token_bounds_check (ctx->image, token)) {
+ ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Table index out of range 0x%x for token %x for ldtoken at 0x%04x", mono_metadata_token_index (token), token, ctx->ip_offset));
+ return;
+ }
+ break;
+ default:
+ ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Invalid table 0x%x for token 0x%x for ldtoken at 0x%04x", mono_metadata_token_table (token), token, ctx->ip_offset));
+ return;
+ }
+
handle = mono_ldtoken (ctx->image, token, &handle_class, ctx->generic_context);
if (!handle) {
ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Invalid token 0x%x for ldtoken at 0x%04x", token, ctx->ip_offset));
case CEE_ARGLIST:
- check_overflow (&ctx);
+ if (!check_overflow (&ctx))
+ break;
if (ctx.signature->call_convention != MONO_CALL_VARARG)
ADD_VERIFY_ERROR (&ctx, g_strdup_printf ("Cannot use arglist on method without VARGARG calling convention at 0x%04x", ctx.ip_offset));
set_stack_value (&ctx, stack_push (&ctx), &mono_defaults.argumenthandle_class->byval_arg, FALSE);
+2010-07-27 Mark Mason <glowingpurple@gmail.com>
+
+ * mini-mips.c: Fix compilation errors.
+
+2010-07-25 Zoltan Varga <vargaz@gmail.com>
+
+ * mini-trampolines.c (common_call_trampoline): Fix a warning.
+
+2010-07-24 Zoltan Varga <vargaz@gmail.com>
+
+ * mini-s390x.c: Change the calling convention to pass this as first as on other
+ architectures. Remove some dead code from the get_vcall_slot().
+
+2010-07-24 Geoff Norton <gnorton@novell.com>
+
+ * mini-darwin.c: Having reviewed xnu-1504.7.4 it is safe to call fork directly
+ here, it seems the old implementation was a hold over from the linux behaviour
+ This fixed gdb backtrace on amd64 and ppc.
+
2010-07-23 Zoltan Varga <vargaz@gmail.com>
* xdebug.c (mono_save_trampoline_xdebug_info): Call
}
} else if (cmethod->klass == mono_defaults.monitor_class) {
#if defined(MONO_ARCH_MONITOR_OBJECT_REG)
- if (strcmp (cmethod->name, "Enter") == 0) {
+ if (strcmp (cmethod->name, "Enter") == 0 && fsig->param_count == 1) {
MonoCallInst *call;
if (COMPILE_LLVM (cfg)) {
strcmp (cfg->method->name, "FastMonitorExit") == 0))
return NULL;
- if (strcmp (cmethod->name, "Enter") == 0 ||
+ if ((strcmp (cmethod->name, "Enter") == 0 && fsig->param_count == 1) ||
strcmp (cmethod->name, "Exit") == 0)
fast_method = mono_monitor_get_fast_path (cmethod);
if (!fast_method)
pid_t
mono_runtime_syscall_fork ()
{
-#if defined(__i386__)
- /* Apple's fork syscall returns a regpair in EAX:EDX.
- * EAX == pid of caller always
- * EDX == 0 for parent, 1 for child
- */
- register_t eax;
- register_t edx;
- pid_t pid;
-
- __asm__ __volatile__ (
- "mov $0x2, %%eax;"
- "int $0x80;"
- "mov %%eax, %0;"
- "mov %%edx, %1;"
- : "=m" (eax), "=m" (edx));
-
- if (edx == 0) {
- pid = eax;
- } else if (edx == 1) {
- pid = 0;
- } else {
- g_assert_not_reached ();
- }
-
- return pid;
-#else
- g_assert_not_reached ();
-#endif
+ return (pid_t) fork ();
}
gboolean
if (mips_is_imm16 (v))
mips_addiu (code, dreg, mips_zero, ((guint32)v) & 0xffff);
else {
-#ifdef SIZEOF_REGISTER == 8
+#if SIZEOF_REGISTER == 8
if (v != (long) v) {
/* v is not a sign-extended 32-bit value */
mips_lui (code, dreg, mips_zero, (guint32)((v >> (32+16)) & 0xffff));
* pinvoke wrappers when they call functions returning structure
*/
if (inst->backend.is_pinvoke && MONO_TYPE_ISSTRUCT (inst->inst_vtype) && inst->inst_vtype->type != MONO_TYPE_TYPEDBYREF)
- size = mono_class_native_size (mono_class_from_mono_type (inst->inst_vtype), &align);
+ size = mono_class_native_size (mono_class_from_mono_type (inst->inst_vtype), (unsigned int *) &align);
else
size = mono_type_size (inst->inst_vtype, &align);
break;
}
case OP_THROW: {
- gpointer addr = mono_arch_get_throw_exception();
+ gpointer addr = mono_arch_get_throw_exception(NULL, FALSE);
mips_move (code, mips_a0, ins->sreg1);
mips_load_const (code, mips_t9, addr);
mips_jalr (code, mips_t9, mips_ra);
break;
}
case OP_RETHROW: {
- gpointer addr = mono_arch_get_rethrow_exception();
+ gpointer addr = mono_arch_get_rethrow_exception(NULL, FALSE);
mips_move (code, mips_a0, ins->sreg1);
mips_load_const (code, mips_t9, addr);
mips_jalr (code, mips_t9, mips_ra);
ArgInfo ret;
ArgInfo sigCookie;
size_data sz;
+ int vret_arg_index;
ArgInfo args [1];
} CallInfo;
static CallInfo *
get_call_info (MonoCompile *cfg, MonoMemPool *mp, MonoMethodSignature *sig, gboolean is_pinvoke)
{
- guint i, fr, gr, size;
+ guint i, fr, gr, size, pstart;
int nParm = sig->hasthis + sig->param_count;
MonoType *ret_type;
guint32 simpletype, align;
else
size = mono_class_value_size (klass, &align);
- cinfo->ret.reg = s390_r2;
cinfo->struct_ret = 1;
cinfo->ret.size = size;
cinfo->ret.vtsize = size;
- gr++;
break;
}
case MONO_TYPE_TYPEDBYREF:
size = sizeof (MonoTypedRef);
- cinfo->ret.reg = s390_r2;
cinfo->struct_ret = 1;
cinfo->ret.size = size;
cinfo->ret.vtsize = size;
- gr++;
break;
case MONO_TYPE_VOID:
break;
g_error ("Can't handle as return value 0x%x", sig->ret->type);
}
- if (sig->hasthis) {
- cinfo->args[nParm].size = sizeof(gpointer);
- add_general (&gr, sz, cinfo->args+nParm);
- nParm++;
+
+ pstart = 0;
+ /*
+ * To simplify get_this_arg_reg () and LLVM integration, emit the vret arg after
+ * the first argument, allowing 'this' to be always passed in the first arg reg.
+ * Also do this if the first argument is a reference type, since virtual calls
+ * are sometimes made using calli without sig->hasthis set, like in the delegate
+ * invoke wrappers.
+ */
+ if (cinfo->struct_ret && !is_pinvoke && (sig->hasthis || (sig->param_count > 0 && MONO_TYPE_IS_REFERENCE (mini_type_get_underlying_type (gsctx, sig->params [0]))))) {
+ if (sig->hasthis) {
+ cinfo->args[nParm].size = sizeof (gpointer);
+ add_general (&gr, sz, cinfo->args + nParm);
+ } else {
+ cinfo->args[nParm].size = sizeof (gpointer);
+ add_general (&gr, sz, &cinfo->args [sig->hasthis + nParm]);
+ pstart = 1;
+ }
+ nParm ++;
+ cinfo->vret_arg_index = 1;
+ cinfo->ret.reg = gr;
+ gr ++;
+ } else {
+ /* this */
+ if (sig->hasthis) {
+ cinfo->args[nParm].size = sizeof (gpointer);
+ add_general (&gr, sz, cinfo->args + nParm);
+ nParm ++;
+ }
+
+ if (cinfo->struct_ret) {
+ cinfo->ret.reg = gr;
+ gr ++;
+ }
}
if ((sig->call_convention == MONO_CALL_VARARG) && (sig->param_count == 0)) {
/* parameters. */
/*----------------------------------------------------------*/
- for (i = 0; i < sig->param_count; ++i) {
+ for (i = pstart; i < sig->param_count; ++i) {
MonoType *ptype;
/*--------------------------------------------------*/
MonoLMF *lmf = (MonoLMF *) ((gchar *) regs - sizeof(MonoLMF));
/* FIXME: handle returning a struct */
- if (MONO_TYPE_ISSTRUCT (sig->ret))
- return (gpointer) lmf->gregs [s390_r3];
return (gpointer) lmf->gregs [s390_r2];
}
#define MONO_ARCH_HAVE_THROW_CORLIB_EXCEPTION 1
#define MONO_ARCH_HAVE_IMT 1
#define MONO_ARCH_IMT_REG s390_r9
+#define MONO_ARCH_THIS_AS_FIRST_ARG 1
#define MONO_ARCH_USE_SIGACTION 1
#ifdef MONO_ARCH_HAVE_IMT
/* IMT call */
if (vt && (gpointer)vtable_slot < (gpointer)vt) {
- MonoMethod *impl_method;
+ MonoMethod *impl_method = NULL;
MonoObject *this_arg;
/* we get the interface method because mono_convert_imt_slot_to_vtable_slot ()
int this_pos = s390_r2;
MonoDomain *domain = mono_domain_get ();
- start = addr;
- if (MONO_TYPE_ISSTRUCT (mono_method_signature (method)->ret))
- this_pos = s390_r3;
-
start = code = mono_domain_code_reserve (domain, 28);
s390_basr (code, s390_r1, 0);
gpointer
mono_arch_get_vcall_slot (guint8 *code, mgreg_t *regs, int *displacement)
{
- int reg, lkReg;
- guchar* base;
- unsigned short opcode;
- char *sp;
- MonoLMF *lmf = (MonoLMF *) ((gchar *) regs - sizeof(MonoLMF));
-
- // We are passed sp instead of the register array
-#if 0
- sp = (char *) regs;
-#endif
- sp = (char *) lmf->gregs[s390_r15];
-
- *displacement = 0;
-
- opcode = *((unsigned short *) (code - 6));
- if (opcode == 0xc0e5)
- /* This is the 'brasl' instruction */
- return NULL;
-
- /*-----------------------------------*/
- /* This is a basr r14,Rz instruction */
- /* If it's preceded by a LG Rx,d(Ry) */
- /* If Rz == 1 then this is virtual */
- /* call. */
- /*-----------------------------------*/
- code -= 6;
-
- /*-----------------------------------*/
- /* If call is preceded by LGR then */
- /* there's nothing to patch */
- /*-----------------------------------*/
- if ((code[0] == 0xb9) && (code[1] == 0x04))
- return NULL;
-
- /*-----------------------------------*/
- /* We back up until we're pointing at*/
- /* the base/displacement portion of */
- /* the LG instruction */
- /*-----------------------------------*/
- lkReg = code[5] & 0x0f;
-
- /*-----------------------------------*/
- /* The LG instruction has format: */
- /* E3x0ylllhh04 - where: */
- /* x = Rx; y = Ry; */
- /* lll = low 12 bits of displacement */
- /* hh = high 8 bits of displacement */
- /*-----------------------------------*/
- reg = code[0] >> 4;
- *displacement = (code[2] << 12) |
- ((code[0] & 0x0f) << 8) |
- code[1];
-
- if (code[2] & 0x80)
- *displacement |= 0xfff00000;
-
- base = ((guchar *) lmf->gregs[reg]);
-#if 0
- if (reg > 5)
- base = *((guchar **) (sp + S390_REG_SAVE_OFFSET +
- sizeof(long)*(reg-6)));
- else
- base = *((guchar **) ((sp - CREATE_STACK_SIZE) +
- CREATE_GR_OFFSET +
- sizeof(long)*(reg-2)));
-#endif
- if (lkReg != 1)
- /* Non virtual call */
- return NULL;
-
- return base;
+ /* Not used on s390x */
+ g_assert_not_reached ();
+ return NULL;
}
/*========================= End of Function ========================*/
--- /dev/null
+/bug-335131.2.cs -crlf
+/bug-472600.2.cs -crlf
+/bug-515884.il -crlf
+/checked.cs -crlf
+/load-missing.il -crlf
+/mutexes.cs -crlf
+/thread4.cs -crlf
async_read.cs \
threadpool.cs \
threadpool1.cs \
+ threadpool-exceptions1.cs \
+ threadpool-exceptions2.cs \
+ threadpool-exceptions3.cs \
+ threadpool-exceptions4.cs \
base-definition.cs \
bug-27420.cs \
bug-47295.cs \
-using System;\r
+using System;
using System.Threading;
/*
-using System;\r
-using System.IO;\r
+using System;
+using System.IO;
class Driver
{
--- /dev/null
+/all.cs -crlf
+/min.cs -crlf
+/none.cs -crlf
+/opt.cs -crlf
+/ref.cs -crlf
--- /dev/null
+/appdomain.out -crlf
+/delegate-async-exit.out -crlf
+/delegate-delegate-exit.out -crlf
+/delegate.out -crlf
+/finalizer-abort.out -crlf
+/finalizer-exit.out -crlf
+/main-exit.out -crlf
+/main-returns-abort-resetabort.out -crlf
+/main-returns-background-abort-resetabort.out -crlf
+/main-returns-background-resetabort.out -crlf
+/main-returns-background.out -crlf
+/main-returns.out -crlf
+/subthread-exit.out -crlf
--- /dev/null
+/module.il -crlf
\r
} // end of class Module.Exported\r
\r
-
+\r
--- /dev/null
+using System;
+using System.Threading;
+
+class Test {
+ static int Main ()
+ {
+ AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
+ ThreadPool.QueueUserWorkItem ((a) => {
+ throw new Exception ("From the threadpoool");
+ });
+ Thread.Sleep (1000);
+ return 1;
+ }
+
+ static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
+ {
+ Environment.Exit (0);
+ }
+}
+
--- /dev/null
+using System;
+using System.Threading;
+
+class Test {
+ static int return_value = 2;
+ static int Main ()
+ {
+ AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
+ WaitCallback wcb = new WaitCallback ((a) => {
+ throw new Exception ("From the threadpoool");
+ });
+ wcb.BeginInvoke (wcb, OnCBFinished, null);
+ Thread.Sleep (1000);
+ return 1;
+ }
+
+ static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
+ {
+ string str = e.ExceptionObject.ToString ();
+ if (str.IndexOf ("From the threadpool") != -1)
+ return_value = 3;
+ Environment.Exit (return_value);
+ }
+
+ static void OnCBFinished (object arg)
+ {
+ return_value = 0;
+ throw new Exception ("From OnCBFinished");
+ }
+}
+
--- /dev/null
+using System;
+using System.Threading;
+
+class Test {
+ static int Main ()
+ {
+ AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
+ WaitCallback wcb = new WaitCallback ((a) => {
+ throw new Exception ("From the threadpoool");
+ });
+ wcb.BeginInvoke (wcb, null, null);
+ Thread.Sleep (1000);
+ return 0;
+ }
+
+ static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
+ {
+ Environment.Exit (1);
+ }
+}
+
--- /dev/null
+using System;
+using System.Threading;
+
+class Test {
+ static int Main ()
+ {
+ AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
+ WaitCallback wcb = new WaitCallback ((a) => {
+ throw new Exception ("From the threadpoool");
+ });
+ wcb.BeginInvoke (wcb, OnCBFinished, null);
+ Thread.Sleep (1000);
+ return 1;
+ }
+
+ static void OnCBFinished (object arg)
+ {
+ throw new Exception ("From OnCBFinished");
+ }
+
+ static void OnUnhandledException (object sender, UnhandledExceptionEventArgs e)
+ {
+ Environment.Exit (0);
+ }
+}
+
static int csum = 0;
public static void test_callback (object state) {
- Console.WriteLine("test_casllback:" + state);
+ Console.WriteLine("test_callback:" + state);
Thread.Sleep (200);
Interlocked.Increment (ref csum);
}
--- /dev/null
+/make_type_visibility_test.sh -crlf
+/unverifiable_ldobj_with_generic_type_definition.il -crlf
+/unverifiable_throw_with_unboxed_generic_argument.il -crlf
+2010-07-30 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * Makefile: Fix build.
+
2010-07-12 Rodrigo Kumpera <rkumpera@novell.com>
* valid_generic_arg_satisty_constraint_compat_check.cs:
ilasm2 -out:$@ $<
BatchCompiler.exe: BatchCompiler.cs
- gmcs -r:../../../../mcs/class/lib/net_2_0/ilasm.exe BatchCompiler.cs
+ gmcs -r:../../../mcs/class/lib/net_2_0/ilasm.exe BatchCompiler.cs
test_lib.dll: test_lib.cs
gmcs test_lib.cs -target:library
gmcs /unsafe $$i; \
fi \
done
- MONO_PATH=../../../../mcs/class/lib/net_2_0/ mono BatchCompiler.exe
+ MONO_PATH=../../../mcs/class/lib/net_2_0/ mono BatchCompiler.exe
#for $$I in *.il; do ilasm2 $$I; done
touch compile-stamp
+2010-07-27 Geoff Norton <gnorton@novell.com>
+
+ * mono-sigcontext.h: Extend the macro's for darwin and linux
+ to expose r8-r11 as well.
+
2010-07-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
* mono-semaphore.c: fixes bug #622398 for real in OSX.
#define UCONTEXT_REG_RSI(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__rsi)
#define UCONTEXT_REG_RDI(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__rdi)
#define UCONTEXT_REG_RIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__rip)
+ #define UCONTEXT_REG_R8(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r8)
+ #define UCONTEXT_REG_R9(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r9)
+ #define UCONTEXT_REG_R10(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r10)
+ #define UCONTEXT_REG_R11(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r11)
#define UCONTEXT_REG_R12(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r12)
#define UCONTEXT_REG_R13(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r13)
#define UCONTEXT_REG_R14(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r14)
#define UCONTEXT_REG_RSI(ctx) (UCONTEXT_GREGS ((ctx)) [REG_RSI])
#define UCONTEXT_REG_RDI(ctx) (UCONTEXT_GREGS ((ctx)) [REG_RDI])
#define UCONTEXT_REG_RIP(ctx) (UCONTEXT_GREGS ((ctx)) [REG_RIP])
+#define UCONTEXT_REG_R8(ctx) (UCONTEXT_GREGS ((ctx)) [REG_R8])
+#define UCONTEXT_REG_R9(ctx) (UCONTEXT_GREGS ((ctx)) [REG_R9])
+#define UCONTEXT_REG_R10(ctx) (UCONTEXT_GREGS ((ctx)) [REG_R10])
+#define UCONTEXT_REG_R11(ctx) (UCONTEXT_GREGS ((ctx)) [REG_R11])
#define UCONTEXT_REG_R12(ctx) (UCONTEXT_GREGS ((ctx)) [REG_R12])
#define UCONTEXT_REG_R13(ctx) (UCONTEXT_GREGS ((ctx)) [REG_R13])
#define UCONTEXT_REG_R14(ctx) (UCONTEXT_GREGS ((ctx)) [REG_R14])
--- /dev/null
+/build-dll -crlf
+/libmonowrapper.rc -crlf
--- /dev/null
+/monoposixhelper.def -crlf
+/win32.xml -crlf
--- /dev/null
+/csproj.tmpl -crlf
+/mcs.pre -crlf
--- /dev/null
+/monoposixhelper.def -crlf
-/semantic.cache
+
/al
/al1
/al2
/chktrust
/cilc
/csharp
+/csharp2
/disco
+/dmcs
+/dtd2rng
/dtd2xsd
/gacutil
/gacutil1
/ilasm1
/ilasm2
/installvst
+/lc
/macpack
/makecert
/Makefile
/mconfig
/mcs
/mcs1
+/mdoc
+/mdoc-*
/mjs
/mkbundle
/mkbundle1
/mkbundle2
-/mdoc
-/mdoc-*
/mod
/mono-api-diff
/mono-api-info
/mono-api-info1
/mono-api-info2
/mono-cil-strip
+/mono-configuration-crypto
/mono-find-provides
/mono-find-requires
+/monolinker
/mono-nunit.pc
/monop
/monop1
/monop2
-/monolinker
/monoresgen
/mono-service
/mono-service2
/mozroots
/nunit-console
/nunit-console2
+/pdb2mdb
/permview
+/peverify
/prj2make
/resgen
/resgen1
/resgen2
/secutil
+/semantic.cache
/setreg
/sgen
/sgen1
/smcs
/sn
/soapsuds
+/sqlmetal
/sqlsharp
+/svcutil
/wsdl
-/wsdl2
/wsdl1
+/wsdl2
/xbuild
/xsd
/xsd2
-/dtd2rng
-/sqlmetal
-/svcutil
-
--- /dev/null
+#!/usr/bin/python
+
+from optparse import OptionParser
+import subprocess
+import re
+import os.path
+import fnmatch
+import os
+
+# subtract 8 for the leading tabstop
+fill_column = 74 - 8
+
+path_to_root = None
+
+all_changelogs = {}
+
+def git (command, *args):
+ return subprocess.Popen (["git", command] + list (args), stdout = subprocess.PIPE).communicate () [0]
+
+def changelog_path (changelog):
+ global path_to_root
+ if not path_to_root:
+ path_to_root = git ("rev-parse", "--show-cdup").strip ()
+ (pathname, filename) = changelog
+ return path_to_root + "./" + pathname + "/" + filename
+
+def changelog_for_file (filename):
+ while filename != "":
+ dirname = os.path.dirname (filename)
+ if dirname in all_changelogs:
+ return (dirname, all_changelogs [dirname])
+ filename = dirname
+ assert False
+
+def changelogs_for_file_pattern (pattern, changed_files):
+ changelogs = set ()
+ for filename in changed_files:
+ suffix = filename
+ while suffix != "":
+ # FIXME: fnmatch doesn't support the {x,y} pattern
+ if fnmatch.fnmatch (suffix, pattern):
+ changelogs.add (changelog_for_file (filename))
+ (_, _, suffix) = suffix.partition ("/")
+ return changelogs
+
+def format_paragraph (paragraph):
+ lines = []
+ words = paragraph.split ()
+ current = words [0]
+ for word in words [1:]:
+ if len (current) + 1 + len (word) <= fill_column:
+ current += " " + word
+ else:
+ lines.append ("\t" + current)
+ current = word
+ lines.append ("\t" + current)
+ return lines
+
+def format_changelog_paragraph (files, paragraph):
+ files_string = ""
+ for (filename, entity) in files:
+ if len (files_string) > 0:
+ files_string += ", "
+ files_string += filename
+ if entity:
+ files_string += " (" + entity + ")"
+ return format_paragraph ("* " + files_string + ": " + paragraph)
+
+def append_paragraph (lines, paragraph):
+ if len (lines):
+ lines.append ("")
+ lines += paragraph
+
+def format_changelog_entries (commit, changed_files, prefix, file_entries, all_paragraphs):
+ changelogs = set ()
+ for f in changed_files:
+ changelogs.add (changelog_for_file (f))
+ marked_changelogs = set ()
+
+ author_line = git ("log", "-n1", "--date=short", "--format=%ad %an <%ae>", commit).strip ()
+
+ paragraphs = {}
+ for changelog in changelogs:
+ paragraphs [changelog] = [author_line]
+
+ for (files, comments) in file_entries:
+ changelog_entries = {}
+ for (filename, entity) in files:
+ entry_changelogs = changelogs_for_file_pattern (filename, changed_files)
+ if len (entry_changelogs) == 0:
+ print "Warning: could not match file %s in commit %s" % (filename, commit)
+ for changelog in entry_changelogs:
+ if changelog not in changelog_entries:
+ changelog_entries [changelog] = []
+ changelog_entries [changelog].append ((filename, entity))
+ marked_changelogs.add (changelog)
+
+ for (changelog, files) in changelog_entries.items ():
+ append_paragraph (paragraphs [changelog], format_changelog_paragraph (files, comments [0]))
+ for paragraph in comments [1:]:
+ append_paragraph (paragraphs [changelog], format_paragraph (paragraph))
+
+ unmarked_changelogs = changelogs - marked_changelogs
+ for changelog in unmarked_changelogs:
+ if len (prefix) == 0:
+ print "Warning: empty entry in %s for commit %s" % (changelog_path (changelog), commit)
+ insert_paragraphs = all_paragraphs
+ else:
+ insert_paragraphs = prefix
+ for paragraph in insert_paragraphs:
+ append_paragraph (paragraphs [changelog], format_paragraph (paragraph))
+
+ return paragraphs
+
+def debug_print_commit (commit, raw_message, prefix, file_entries, changed_files, changelog_entries):
+ print "===================== Commit"
+ print commit
+ print "--------------------- RAW"
+ print raw_message
+ print "--------------------- Prefix"
+ for line in prefix:
+ print line
+ print "--------------------- File entries"
+ for (files, comments) in file_entries:
+ files_str = ""
+ for (filename, entity) in files:
+ if len (files_str):
+ files_str = files_str + ", "
+ files_str = files_str + filename
+ if entity:
+ files_str = files_str + " (" + entity + ")"
+ print files_str
+ for line in comments:
+ print " " + line
+ print "--------------------- Files touched"
+ for f in changed_files:
+ print f
+ print "--------------------- ChangeLog entries"
+ for ((dirname, filename), lines) in changelog_entries.items ():
+ print "%s/%s:" % (dirname, filename)
+ for line in lines:
+ print line
+
+def process_commit (commit):
+ changed_files = map (lambda l: l.split () [2], git ("diff-tree", "--numstat", commit).splitlines () [1:])
+ if len (filter (lambda f: re.search ("(^|/)Change[Ll]og$", f), changed_files)):
+ return
+ raw_message = git ("log", "-n1", "--format=%B", commit)
+ # filter SVN migration message
+ message = re.sub ("(^|\n)svn path=[^\n]+revision=\d+(?=$|\n)", "", raw_message)
+ # filter ChangeLog headers
+ message = re.sub ("(^|\n)\d+-\d+-\d+[ \t]+((\w|[.-])+[ \t]+)+<[^\n>]+>(?=$|\n)", "", message)
+ # filter leading whitespace
+ message = re.sub ("^\s+", "", message)
+ # filter trailing whitespace
+ message = re.sub ("\s+$", "", message)
+ # paragraphize - first remove whitespace at beginnings and ends of lines
+ message = re.sub ("[ \t]*\n[ \t]*", "\n", message)
+ # paragraphize - now replace three or more consecutive newlines with two
+ message = re.sub ("\n\n\n+", "\n\n", message)
+ # paragraphize - replace single newlines with a space
+ message = re.sub ("(?<!\n)\n(?!\n)", " ", message)
+ # paragraphize - finally, replace double newlines with single ones
+ message = re.sub ("\n\n", "\n", message)
+
+ # A list of paragraphs (strings without newlines) that occur
+ # before the first file comments
+ prefix = []
+
+ # A list of tuples of the form ([(filename, entity), ...], [paragraph, ...]).
+ #
+ # Each describes a file comment, containing multiple paragraphs.
+ # Those paragraphs belong to a list of files, each with an
+ # optional entity (usually a function name).
+ file_entries = []
+
+ current_files = None
+ current_files_comments = None
+
+ message_lines = message.splitlines ()
+ for line in message_lines:
+ if re.match ("\*\s[^:]+:", line):
+ if current_files:
+ file_entries.append ((current_files, current_files_comments))
+
+ (files, _, comments) = line.partition (":")
+
+ current_files_comments = [comments.strip ()]
+
+ current_files = []
+ for f in re.split ("\s*,\s*", files [1:].strip ()):
+ m = re.search ("\(([^()]+)\)$", f)
+ if m:
+ filename = f [:m.start (0)].strip ()
+ entity = m.group (1).strip ()
+ else:
+ filename = f
+ entity = None
+ current_files.append ((filename, entity))
+ else:
+ if current_files:
+ current_files_comments.append (line)
+ else:
+ prefix.append (line)
+ if current_files:
+ file_entries.append ((current_files, current_files_comments))
+
+ changelog_entries = format_changelog_entries (commit, changed_files, prefix, file_entries, message_lines)
+
+ #debug_print_commit (commit, raw_message, prefix, file_entries, changed_files, changelog_entries)
+
+ return changelog_entries
+
+def start_changelog (changelog):
+ full_path = changelog_path (changelog)
+ old_name = full_path + ".old"
+ os.rename (full_path, old_name)
+ return open (full_path, "w")
+
+def finish_changelog (changelog, file):
+ old_file = open (changelog_path (changelog) + ".old")
+ file.write (old_file.read ())
+ old_file.close ()
+ file.close ()
+
+def append_lines (file, lines):
+ for line in lines:
+ file.write (line + "\n")
+ file.write ("\n")
+
+def main ():
+ usage = "usage: %prog [options] <start-commit>"
+ parser = OptionParser (usage)
+ parser.add_option ("-r", "--root", dest = "root", help = "Root directory of the working tree to be changed")
+ (options, args) = parser.parse_args ()
+ if len (args) != 1:
+ parser.error ("incorrect number of arguments")
+ start_commit = args [0]
+
+ if options.root:
+ global path_to_root
+ path_to_root = options.root + "/"
+
+ for filename in git ("ls-tree", "-r", "--name-only", "HEAD").splitlines ():
+ if re.search ("(^|/)Change[Ll]og$", filename):
+ (path, name) = os.path.split (filename)
+ all_changelogs [path] = name
+
+ commits = git ("rev-list", "--no-merges", "HEAD", "^%s" % start_commit).splitlines ()
+
+ touched_changelogs = {}
+ for commit in commits:
+ entries = process_commit (commit)
+ for (changelog, lines) in entries.items ():
+ if changelog not in touched_changelogs:
+ touched_changelogs [changelog] = start_changelog (changelog)
+ append_lines (touched_changelogs [changelog], lines)
+ for (changelog, file) in touched_changelogs.items ():
+ finish_changelog (changelog, file)
+
+if __name__ == "__main__":
+ main ()
--- /dev/null
+/lcids.xml -crlf
--- /dev/null
+/nb.xml -crlf
+/nn.xml -crlf
--- /dev/null
+/nb_NO.xml -crlf
+/nn_NO.xml -crlf
--- /dev/null
+/gtk-sharp -crlf
+/mbas -crlf
+/mono-beginning-windows.xml -crlf
<ul>
<li>XML Schema Definition tool</li>
<ul>
- <li><b>XDR to XSD</b> - used to generate an XML schema from an XDR (XML Data Reduced schema) file. \r
- XDR was used by Microsoft prior to XSD becoming a W3C recommendation. So, this needs\r
- to be supported for legacy reasons</li>\r
- <li><b>XML to XSD</b> - used to generate an XML schema from an XML file</li> \r
- <li><b>XSD to DataSet</b> - used to generate DataSet classes from an XSD schema file. The\r
- DataSet classes created can then be used with XML data</li>\r
- <li><b>XSD to Classes</b> - used to generate classes from an XSD schema file. The \r
- classes created can be used with System.XML.Serialization.XMLSerializer \r
- to read and write XML code that follows the schema</li>\r
- <li><b>Classes to XSD</b> - used to generate an XML schema \r
- from type(s) in a assembly file. The \r
- XML schema created by the tool defines the XML format used \r
- by System.XML.Serialization.XMLSerializer</li>\r
- </ul>\r
- </li>\r
- </ul>\r
+ <li><b>XDR to XSD</b> - used to generate an XML schema from an XDR (XML Data Reduced schema) file.
+ XDR was used by Microsoft prior to XSD becoming a W3C recommendation. So, this needs
+ to be supported for legacy reasons</li>
+ <li><b>XML to XSD</b> - used to generate an XML schema from an XML file</li>
+ <li><b>XSD to DataSet</b> - used to generate DataSet classes from an XSD schema file. The
+ DataSet classes created can then be used with XML data</li>
+ <li><b>XSD to Classes</b> - used to generate classes from an XSD schema file. The
+ classes created can be used with System.XML.Serialization.XMLSerializer
+ to read and write XML code that follows the schema</li>
+ <li><b>Classes to XSD</b> - used to generate an XML schema
+ from type(s) in a assembly file. The
+ XML schema created by the tool defines the XML format used
+ by System.XML.Serialization.XMLSerializer</li>
+ </ul>
+ </li>
+ </ul>
</li>
</ul>
</td>
</tr>
<tr>
- <td bgcolor="#999999">\r
- <b>Windows Setup Wizard (NT/2000/XP)</b>\r
- <ul>\r
- <li><a href="archive/mono-0.17-stable.exe">Mono-Setup</a>\r
- </ul>\r
- </td>\r
- <td bgcolor="#999999">\r
- <b>Debian packages</b>\r
- <ul>\r
+ <td bgcolor="#999999">
+ <b>Windows Setup Wizard (NT/2000/XP)</b>
+ <ul>
+ <li><a href="archive/mono-0.17-stable.exe">Mono-Setup</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <b>Debian packages</b>
+ <ul>
<li><a href="http://www.atoker.com/mono/">Alp's web site</a>
- </ul>\r
- </td>\r
+ </ul>
+ </td>
</tr>
</table>
</td>
<tr>
<td></td>
</tr>
- \r
- <tr bgcolor="#999999">\r
- <td>\r
- <b>Windows (win95 friendly)</b>\r
- <ul>\r
- <li><a href="archive/mono-w32-Aug_28_2002.zip">Mono-w32</a>\r
- </ul>\r
- </td>\r
- <td bgcolor="#999999">\r
- <b>Red Hat null-8.0/x86</b>\r
- <ul>\r
- <li><a href="archive/redhat-null-i386/libgc-6.1alpha5-1.i386.rpm">libgc-6.1alpha5-1.i386.rpm</a>\r
- <li><a href="archive/redhat-null-i386/libgc-devel-6.1alpha5-1.i386.rpm">libgc-devel-6.1alpha5-1.i386.rpm</a>\r
- <li><a href="archive/redhat-null-i386/mono-0.15-1.i386.rpm">mono-0.15-1.i386.rpm</a>\r
- <li><a href="archive/redhat-null-i386/mono-devel-0.15-1.i386.rpm">mono-devel-0.15-1.i386.rpm</a>\r
- </ul>\r
- </td>\r
- </tr>\r
+
+ <tr bgcolor="#999999">
+ <td>
+ <b>Windows (win95 friendly)</b>
+ <ul>
+ <li><a href="archive/mono-w32-Aug_28_2002.zip">Mono-w32</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <b>Red Hat null-8.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-null-i386/libgc-6.1alpha5-1.i386.rpm">libgc-6.1alpha5-1.i386.rpm</a>
+ <li><a href="archive/redhat-null-i386/libgc-devel-6.1alpha5-1.i386.rpm">libgc-devel-6.1alpha5-1.i386.rpm</a>
+ <li><a href="archive/redhat-null-i386/mono-0.15-1.i386.rpm">mono-0.15-1.i386.rpm</a>
+ <li><a href="archive/redhat-null-i386/mono-devel-0.15-1.i386.rpm">mono-devel-0.15-1.i386.rpm</a>
+ </ul>
+ </td>
+ </tr>
</table>
</td>
</tr>
* mbas: Mono's VisualBasic.NET Compiler.\r
\r
- MonoBASIC (mbas) is a CIL compiler for the VisualBasic.NET language,
+ MonoBASIC (mbas) is a CIL compiler for the VisualBasic.NET language, \r
an extended version of Visual Basic. It's based on the MCS compiler\r
and still in heavy development, though many language features are\r
already supported. See mcs/mbas/\r
\r
A lot of this stuff is implemented rebuilding proper expressions and \r
statements on top of the classes based on those of mcs (look at the grammar - \r
- mb-parser.jay - and compare it with cs-parser.jay, if interested), but some
+ mb-parser.jay - and compare it with cs-parser.jay, if interested), but some \r
are getting deeply changed, to better conform to VB.NET semantics.\r
\r
** TODO-list\r
We'd like to implement the missing statements, exception handling, \r
structures and actual event support (not necessarily in this order). Once we \r
have all this stuff set up and reasonably bug-free, more work could be done \r
- on helper functions and Object-vars handling.
-
- Also work on the supporting library (we don't currently depend on it as much
- as MS vbc-compiled programs, but especially for late-binding scenarios we will)
+ on helper functions and Object-vars handling.\r
+\r
+ Also work on the supporting library (we don't currently depend on it as much\r
+ as MS vbc-compiled programs, but especially for late-binding scenarios we will)\r
is surely needed: it's in mcs/class/Microsoft.VisualBasic/\r
<li>ByteFX.Data.MySqlClient
<ul>
<li>Build and Runs on Microsoft .NET and Mono</li>
- <li>Works with SQL# (command-line and GTK# GUI versions)</li>\r
- <li>MySQLCommandBuilder now implemented</li>\r
- <li>Transaction support now implemented (not all table types support this)</li>\r
- <li>GetSchemaTable fixed to not use xsd (for Mono)</li>\r
- <li>Driver is now Mono-compatible</li>\r
- <li>TIME data type now supported</li>\r
- <li>More work to improve Timestamp data type handling</li>\r
- <li>Changed signatures of all classes to match corresponding SqlClient classes</li>\r
- <li>Protocol compression using <a href="http://www.icsharpcode.net/OpenSource/SharpZipLib/default.asp">SharpZipLib</a></li>\r
- <li>Named pipes on Windows now working properly</li>\r
- <li>Work done to improve Timestamp data type handling</li>\r
- <li>Implemented IEnumerable on DataReader so DataGrid would work</li>\r
- <li>Speed increased dramatically by removing bugging network sync code</li>\r
- <li>Driver no longer buffers rows of data (more ADO.Net compliant)</li>\r
- <li>Conversion bugs related to TIMESTAMP and DATETIME fields fixed</li>\r
+ <li>Works with SQL# (command-line and GTK# GUI versions)</li>
+ <li>MySQLCommandBuilder now implemented</li>
+ <li>Transaction support now implemented (not all table types support this)</li>
+ <li>GetSchemaTable fixed to not use xsd (for Mono)</li>
+ <li>Driver is now Mono-compatible</li>
+ <li>TIME data type now supported</li>
+ <li>More work to improve Timestamp data type handling</li>
+ <li>Changed signatures of all classes to match corresponding SqlClient classes</li>
+ <li>Protocol compression using <a href="http://www.icsharpcode.net/OpenSource/SharpZipLib/default.asp">SharpZipLib</a></li>
+ <li>Named pipes on Windows now working properly</li>
+ <li>Work done to improve Timestamp data type handling</li>
+ <li>Implemented IEnumerable on DataReader so DataGrid would work</li>
+ <li>Speed increased dramatically by removing bugging network sync code</li>
+ <li>Driver no longer buffers rows of data (more ADO.Net compliant)</li>
+ <li>Conversion bugs related to TIMESTAMP and DATETIME fields fixed</li>
</ul>
</li>
<li>Here is a ConnectionString format if you do not have a DSN (have not
gotten this to work though):
<pre>
-"DRIVER={MySQL ODBC 3.51 Driver};" +\r
-"SERVER=localhost;DATABASE=test;" +\r
-"UID=myuserid;PASSWORD=mypassword;" +\r
-"OPTION=3";\r
+"DRIVER={MySQL ODBC 3.51 Driver};" +
+"SERVER=localhost;DATABASE=test;" +
+"UID=myuserid;PASSWORD=mypassword;" +
+"OPTION=3";
</pre>
</li>
System.Security.Principal.WindowsImpersonationContext
System.Security.Principal.WindowsPrincipal
System.Threading.CompressedStack
-\r
+
<ul>
<li>Builds and Runs on both Microsoft .NET and Mono.</li>
<li>Works using SQL# (command-line and GTK# versions)</li>
- <li>You can send insert, update, delete queries \r
- through NpgsqlCommand.ExecuteNonQuery() method.</li>\r
- <li>You can send queries like, select count(*) from table, select version()\r
- with NpgsqlCommand.ExecuteScalar() method.</li>\r
- <li>There is logging support. (Thanks Dave Page)\r
- To use it, place code like that in your program:</li>\r
-\r
-<pre> \r
- // Enable logging.\r
- NpgsqlEventLog.Level = LogLevel.Debug; // LogLevel.\r
- NpgsqlEventLog.LogName = "NpgsqlTests.LogFile"; // LogFile.\r
-</pre>\r
- \r
- <li>You can use Npgsql with Mono (Thanks Kristis Makris). It is not working perfectly.</li>\r
- <li>There is a winforms test suite (Thanks Dave Page).</li>\r
- <li>Clearer code in NpgsqlConnection removing *magic* numbers and constants. (Thanks Kristis Makris)</li>\r
- <li>Better support of ODBC-like ConnectionString in NpgsqlConnection (Thanks Dave Page)</li>\r
- <li>Thanks Ulrich Sprick for all discussion and ideas.</li>\r
+ <li>You can send insert, update, delete queries
+ through NpgsqlCommand.ExecuteNonQuery() method.</li>
+ <li>You can send queries like, select count(*) from table, select version()
+ with NpgsqlCommand.ExecuteScalar() method.</li>
+ <li>There is logging support. (Thanks Dave Page)
+ To use it, place code like that in your program:</li>
+
+<pre>
+ // Enable logging.
+ NpgsqlEventLog.Level = LogLevel.Debug; // LogLevel.
+ NpgsqlEventLog.LogName = "NpgsqlTests.LogFile"; // LogFile.
+</pre>
+
+ <li>You can use Npgsql with Mono (Thanks Kristis Makris). It is not working perfectly.</li>
+ <li>There is a winforms test suite (Thanks Dave Page).</li>
+ <li>Clearer code in NpgsqlConnection removing *magic* numbers and constants. (Thanks Kristis Makris)</li>
+ <li>Better support of ODBC-like ConnectionString in NpgsqlConnection (Thanks Dave Page)</li>
+ <li>Thanks Ulrich Sprick for all discussion and ideas.</li>
</ul>
</li>
MSDE 2000, make sure you have the special Service Pack 3 for MSDE 2000. You
can get it from <a href="http://www.microsoft.com/sql/downloads/2000/sp3.asp">here</a></li>
- <li>For those that only have MSDE installed. You can change the authentication mode \r
- from Windows Only Authentication to SQL Server and Windows Authentications (also knows as Mixed-mode authentication)\r
- via the <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q322336&sd=tech#4">registry</a></li>. It is\r
- the LoginMode you need to change. By default,\r
- MSDE is installed with Windows Only Authentication. If you want SqlClient to work with MSDE via SQL Server authentication, you will\r
- need to change the setting. Otherwise, you wil have to use NT Authentication.</a>\r
- \r
- <li>If using MSDE, you might need to create a new user with password. Give\r
- this user access to various databases in this MSDE instance. Also, for each\r
- database, give this new user at least SELECT access to the various tables you want\r
- to retrieve data from.</li>\r
- \r
- <li>If you have Enterprise Manager, you can easily change the authentication mode\r
- for both MSDE and Microsoft SQL Server. To change the authentication mode in \r
- Enterprise Mananger, select the instance, right-click on it, and select properites.\r
- The SQL Server properties dialog for that instance will pop up. Choose the Security\r
- tab. Change the Authentication from Windows Only to SQL Server and Windows. If\r
- the instance of your database does not show up in Enterprise Manager, Register first\r
- by selecting the Action menu and choosing New SQL Server Registration.</li>\r
+ <li>For those that only have MSDE installed. You can change the authentication mode
+ from Windows Only Authentication to SQL Server and Windows Authentications (also knows as Mixed-mode authentication)
+ via the <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q322336&sd=tech#4">registry</a></li>. It is
+ the LoginMode you need to change. By default,
+ MSDE is installed with Windows Only Authentication. If you want SqlClient to work with MSDE via SQL Server authentication, you will
+ need to change the setting. Otherwise, you wil have to use NT Authentication.</a>
+
+ <li>If using MSDE, you might need to create a new user with password. Give
+ this user access to various databases in this MSDE instance. Also, for each
+ database, give this new user at least SELECT access to the various tables you want
+ to retrieve data from.</li>
+
+ <li>If you have Enterprise Manager, you can easily change the authentication mode
+ for both MSDE and Microsoft SQL Server. To change the authentication mode in
+ Enterprise Mananger, select the instance, right-click on it, and select properites.
+ The SQL Server properties dialog for that instance will pop up. Choose the Security
+ tab. Change the Authentication from Windows Only to SQL Server and Windows. If
+ the instance of your database does not show up in Enterprise Manager, Register first
+ by selecting the Action menu and choosing New SQL Server Registration.</li>
<li>Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient
named SqlTest.cs and you could use this as a basis for your test.</li>
the <a href"http://www.hwaci.com/sw/sqlite/">SQL Lite</a> which
is an embeddable SQL database engine</li>
- <li>From the SQL Lite web page: SQLite is a C library that \r
- implements an embeddable SQL database engine. Programs that link with \r
- the SQLite library can have SQL database access without \r
- running a separate RDBMS process. The distribution \r
- comes with a standalone command-line access program (sqlite) that \r
- can be used to administer an SQLite database and which serves \r
- as an example of how to use the SQLite library. SQLite is not a client library \r
- used to connect to a big database server. SQLite is the server. The SQLite \r
- library reads and writes directly to and from the database files on disk.</li>\r
+ <li>From the SQL Lite web page: SQLite is a C library that
+ implements an embeddable SQL database engine. Programs that link with
+ the SQLite library can have SQL database access without
+ running a separate RDBMS process. The distribution
+ comes with a standalone command-line access program (sqlite) that
+ can be used to administer an SQLite database and which serves
+ as an example of how to use the SQLite library. SQLite is not a client library
+ used to connect to a big database server. SQLite is the server. The SQLite
+ library reads and writes directly to and from the database files on disk.</li>
<li>SQL Lite can be downloaded
from <a href="http://www.hwaci.com/sw/sqlite/download.html">here</a>.
--- /dev/null
+/team.xsd -crlf